/* Import theme files */
@import url('theme-light.css');
@import url('theme-dark-green.css');
@import url('theme-dark-grey.css');
@import url('theme-dark-blue.css');
@import url('theme-dark-pink.css');

/* IMPROVED MODERN TETRIS STYLING */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Georgia', 'Times New Roman', serif;
}

.container {
    max-width: 1100px;
}

.game-container {
    max-width: 900px;
    margin: 0 auto;
    border-radius: 24px;
    padding: 2rem;
    display: flex;
    flex-direction: row;
    gap: 40px;
    min-height: 100%;
    height: 100%;
    box-sizing: border-box;
    border: 2px solid;
}

#tetris-canvas {
    width: 320px;
    height: 640px;
    border-radius: 12px;
    border: 4px solid;
    box-shadow: 0 8px 32px 0;
    display: block;
    margin: 0 auto;
    position: relative;
}

#next-piece-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    pointer-events: none;
}

#next-piece-canvas {
    border: 2px solid;
    border-radius: 8px;
    display: block;
    margin: 0;
    width: 64px !important;
    height: 64px !important;
}

.game-sidebar {
    flex: 1;
    min-width: 260px;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: 100%;
}

.game-info, .highscores, .controls {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    padding: 1.5rem 1.2rem;
    box-shadow: 0 2px 12px 0;
    border: 1.5px solid;
}

h1, h2, h3, h4 {
    font-family: 'Georgia', 'Times New Roman', serif;
    margin-bottom: 15px;
    letter-spacing: 0.02em;
}

.score, .level, .lines {
    margin: 10px 0;
    font-size: 1.2rem;
    font-family: 'Georgia', 'Times New Roman', serif;
}

.highscores ol {
    padding-left: 1.5rem;
    margin-bottom: 0;
}

.highscores li {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-family: 'Georgia', 'Times New Roman', serif;
}

.highscores .name {
    font-weight: 600;
}

.highscores .score {
    font-weight: bold;
}

.highscores .details {
    font-size: 0.9rem;
}

.highscores-list .meta, .highscores-preview .meta, ol .meta {
    font-size: 0.88em;
    font-style: italic;
    margin-left: 0.5em;
    opacity: 0.7;
}

#start-btn, #save-score-btn, #play-again-btn {
    font-size: 1.15rem;
    border-radius: 10px;
    padding: 10px 0;
    font-weight: 600;
    letter-spacing: 0.03em;
    border: none;
    box-shadow: 0 2px 8px;
    transition: background 0.2s, color 0.2s;
}

#start-btn:hover, #save-score-btn:hover, #play-again-btn:hover {
    transition: background 0.2s, color 0.2s;
}

/* Scrollbar for highscores */
#highscores-list {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color:  #f7ecd4;
}
#highscores-list::-webkit-scrollbar {
    width: 8px;
    background: #f7ecd4;
}
#highscores-list::-webkit-scrollbar-thumb {
    border-radius: 4px;
}

@media (max-width: 1200px) {
    .game-container {
        flex-direction: column;
        align-items: center;
        gap: 24px;
        padding: 1.2rem;
    }
    #tetris-canvas {
        margin-bottom: 24px;
    }
}

@media (max-width: 768px) {
    .container {
        max-width: 100vw;
        padding: 0 2vw;
    }
    .game-container {
        padding: 0.5rem;
        gap: 12px;
    }
    #tetris-canvas {
        width: 90vw;
        max-width: 350px;
        height: 50vw;
        max-height: 70vw;
    }
    .game-sidebar {
        min-width: 0;
        max-width: 100vw;
        gap: 12px;
    }
}

html {
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
