

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {

    --bg-primary: hsl(0, 0%, 92%);
    --bg-canvas: hsl(0, 0%, 98%);
    --text-primary: hsl(0, 0%, 15%);
    --text-secondary: hsl(0, 0%, 35%);
    --border-primary: hsl(0, 0%, 50%);
    --grid-color: hsl(0, 0%, 85%);
    --block-outline: hsl(0, 0%, 10%);
    --overlay-dark: hsla(0, 0%, 10%, 0.8);
    
    --tetromino-i: hsl(0, 0%, 45%);
    --tetromino-o: hsl(0, 0%, 55%);
    --tetromino-t: hsl(0, 0%, 40%);
    --tetromino-s: hsl(0, 0%, 50%);
    --tetromino-z: hsl(0, 0%, 35%);
    --tetromino-j: hsl(0, 0%, 42%);
    --tetromino-l: hsl(0, 0%, 48%);
    
    --accent-light: hsl(0, 0%, 65%);
    --accent-medium: hsl(0, 0%, 50%);
    --accent-dark: hsl(0, 0%, 35%);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1.6;
}

/* === СТРАНИЦА ВХОДА === */

.login-page {
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.login-card {
    background: var(--bg-canvas);
    border: 2px solid var(--border-primary);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.game-title {
    font-size: 2.5em;
    font-weight: 600;
    text-align: center;
    color: var(--accent-medium);
    margin-bottom: 30px;
}

/* Превью тетромино */

.tetromino-preview {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 30px 0;
    flex-wrap: wrap;
    gap: 15px;
}

.tetromino-display {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tetromino-row {
    display: flex;
    gap: 2px;
}

.block {
    width: 20px;
    height: 20px;
    border: 1px solid var(--block-outline);
    border-radius: 3px;
}

.block-empty {
    border: none;
    background: transparent;
}

.block-i { background: var(--tetromino-i); }
.block-o { background: var(--tetromino-o); }
.block-t { background: var(--tetromino-t); }
.block-s { background: var(--tetromino-s); }
.block-z { background: var(--tetromino-z); }
.block-j { background: var(--tetromino-j); }
.block-l { background: var(--tetromino-l); }

/* Форма входа */

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.login-label {
    font-size: 1em;
    font-weight: 500;
    text-align: center;
    color: var(--text-secondary);
}

.login-input {
    font-family: inherit;
    font-size: 1.1em;
    padding: 12px 20px;
    border: 2px solid var(--border-primary);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    text-align: center;
    transition: all 0.3s;
}

.login-input:focus {
    outline: none;
    border-color: var(--accent-medium);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.login-button {
    font-family: inherit;
    font-size: 1.1em;
    font-weight: 600;
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    background: var(--accent-medium);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.login-button:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.login-button:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Футер с управлением */

.login-footer {
    margin-top: 40px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85em;
}

.login-footer p {
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 600;
}

.controls-list {
    list-style: none;
    text-align: left;
    display: inline-block;
}

.controls-list li {
    margin: 8px 0;
}

/* === СТРАНИЦА ИГРЫ === */

.game-page {
    padding: 20px;
    align-items: flex-start;
}

.game-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Шапка */

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.game-title-small {
    font-size: 2em;
    font-weight: 600;
    color: var(--accent-medium);
}

.header-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Кнопки */

.icon-button,
.text-button {
    font-family: inherit;
    font-weight: 500;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    background: var(--accent-medium);
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1em;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.icon-button {
    font-size: 1.3em;
    padding: 8px 14px;
}

.icon-svg-button {
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-svg {
    width: 20px;
    height: 20px;
    display: block;
}

.pause-icon {
    display: block;
}

.play-icon {
    display: none;
}

/* Когда игра на паузе - показываем play */
.icon-svg-button.paused .pause-icon {
    display: none;
}

.icon-svg-button.paused .play-icon {
    display: block;
}

.icon-button:hover,
.text-button:hover {
    background: var(--accent-light);
    transform: scale(1.05);
}

.icon-button:active,
.text-button:active {
    transform: scale(0.98);
}

.danger-button {
    background: var(--accent-dark);
    font-size: 0.9em;
}

.danger-button:hover {
    background: var(--accent-medium);
}

/* Индикатор темы */

.theme-indicator {
    text-align: center;
    font-size: 0.95em;
    color: var(--text-secondary);
    margin-bottom: 20px;
    padding: 10px;
    background: var(--bg-canvas);
    border-radius: 8px;
    border: 1px solid var(--border-primary);
}

#themeName {
    color: var(--accent-medium);
    font-weight: bold;
}

/* Основной контент игры */

.game-content {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.game-main {
    flex: 0 0 auto;
}

.game-canvas {
    display: block;
    border: 2px solid var(--border-primary);
    border-radius: 8px;
    background: var(--bg-canvas);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Боковые панели */

.game-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 200px;
}

.game-sidebar-left {
    /* Специфичные стили для левой панели, если нужны */
}

.game-sidebar-right {
    /* Специфичные стили для правой панели, если нужны */
}

.info-panel {
    background: var(--bg-canvas);
    border: 2px solid var(--border-primary);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.panel-title {
    font-size: 1em;
    font-weight: 600;
    color: var(--accent-medium);
    margin-bottom: 15px;
    text-align: center;
    border-bottom: 2px solid var(--border-primary);
    padding-bottom: 10px;
}

.player-name,
.score-value,
.level-value,
.lines-value {
    font-size: 1.2em;
    text-align: center;
    color: var(--text-primary);
}

.score-value {
    font-size: 1.5em;
    color: var(--accent-medium);
}

/* Управление */

.controls-compact {
    list-style: none;
    font-size: 0.8em;
    color: var(--text-secondary);
    line-height: 2;
}

.controls-compact li {
    margin: 5px 0;
}

/* Превью следующей фигуры */

.next-piece-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 120px;
}

.next-canvas {
    display: block;
    border: 1px solid var(--grid-color);
    border-radius: 6px;
    background: var(--bg-canvas);
}

/* Таблица лидеров */

.leaderboard-section {
    background: var(--bg-canvas);
    border: 2px solid var(--border-primary);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.leaderboard-header {
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.5em;
    font-weight: 600;
    color: var(--accent-medium);
    text-align: center;
    margin-bottom: 15px;
}

.leaderboard-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.theme-btn {
    font-size: 0.9em;
}

.leaderboard-container {
    overflow-x: auto;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 12px 15px;
    text-align: center;
    border: 1px solid var(--grid-color);
}

.leaderboard-table th {
    background: var(--accent-medium);
    color: white;
    font-weight: 600;
}

.leaderboard-table tr:nth-child(even) {
    background: var(--bg-primary);
}

.leaderboard-table tr:hover {
    background: var(--accent-light);
    color: var(--bg-canvas);
}

.no-records {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1em;
    padding: 40px;
}

/* === АДАПТИВНОСТЬ === */

@media (max-width: 1024px) {
    .game-content {
        flex-direction: column;
        align-items: center;
    }
    
    .game-sidebar {
        width: 100%;
        max-width: 500px;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .info-panel {
        flex: 1 1 200px;
    }
}

@media (max-width: 768px) {
    .game-title {
        font-size: 2em;
    }
    
    .game-title-small {
        font-size: 1.5em;
    }
    
    .login-card {
        padding: 25px;
    }
    
    .login-button,
    .icon-button,
    .text-button {
        font-size: 0.9em;
    }
    
    .leaderboard-table {
        font-size: 0.85em;
    }
    
    .leaderboard-controls {
        flex-direction: column;
    }
    
    .theme-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .tetromino-preview {
        gap: 10px;
    }
    
    .block {
        width: 15px;
        height: 15px;
    }
    
    .login-footer {
        font-size: 0.75em;
    }
}

/* === АНИМАЦИИ === */

/* Анимации появления отключены */

/* === УТИЛИТЫ === */

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

