/* ========== ГЛОБАЛЬНЫЕ СТИЛИ ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Comic Sans MS', cursive, sans-serif;
}

body {
    background: linear-gradient(145deg, #f9f3e8 0%, #ffe9d6 100%);
    min-height: 100vh;
    padding: 20px;
}

/* ========== ШАПКА ========== */
.header {
    max-width: 1200px;
    margin: 0 auto 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    padding: 12px 30px;
    border-radius: 60px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.logo {
    font-size: 28px;
    font-weight: 800;
    color: #4a2c1b;
}
.logo span { color: #f57c00; }

.header nav {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.header nav a {
    text-decoration: none;
    color: #4a2c1b;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 30px;
    transition: 0.2s;
}

.header nav a:hover,
.header nav a.active {
    background: #f57c00;
    color: white;
}

.btn-logout {
    background: #ef5350;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.btn-logout:hover {
    background: #c62828;
}

.btn-login {
    background: transparent;
    color: #4a2c1b;
    border: 2px solid #4a2c1b;
    padding: 8px 24px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    font-size: 16px;
}

.btn-login:hover {
    background: #4a2c1b;
    color: white;
}

.btn-register {
    background: #f57c00;
    color: white;
    border: none;
    padding: 8px 24px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    font-size: 16px;
}

.btn-register:hover {
    background: #e65100;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: #f57c00;
    border: 2px solid #f57c00;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    font-size: 16px;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    background: #f57c00;
    color: white;
}

/* ========== КОНТЕЙНЕР ========== */
.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
}

.welcome {
    text-align: center;
    margin-bottom: 30px;
}

.welcome h1 {
    font-size: 32px;
    color: #4a2c1b;
}
.welcome h1 span { color: #f57c00; }

.seo-intro {
    color: #6b4f38;
    line-height: 1.6;
    margin: 12px auto 0;
    max-width: 760px;
}

/* ========== СТАТИСТИКА ========== */
.game-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

.stat-badge {
    background: white;
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    font-size: 16px;
}

.stat-badge span {
    color: #f57c00;
    font-size: 20px;
}

/* ========== ПАНЕЛЬ УПРАВЛЕНИЯ ========== */
.control-panel {
    background: white;
    border-radius: 30px;
    padding: 20px 30px;
    margin-bottom: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-group label {
    font-weight: 600;
    color: #4a2c1b;
    font-size: 16px;
}

.level-buttons {
    display: flex;
    gap: 8px;
}

.level-btn {
    padding: 6px 16px;
    border: 2px solid #e0d6c8;
    border-radius: 20px;
    background: white;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
    font-size: 14px;
}

.level-btn:hover {
    background: #fff3e0;
}

.level-btn.active {
    background: #f57c00;
    color: white;
    border-color: #f57c00;
}

.theme-select {
    padding: 6px 16px;
    border: 2px solid #e0d6c8;
    border-radius: 20px;
    font-weight: 600;
    background: white;
    cursor: pointer;
    font-size: 14px;
}

.theme-select:focus {
    outline: none;
    border-color: #f57c00;
}

/* ========== МЕНЮ ИГР ========== */
.game-menu {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.game-btn {
    background: white;
    border: none;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #3e2a1b;
    box-shadow: none;
    cursor: pointer;
    transition: all 0.08s linear;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
    text-align: left;
    width: 100%;
}

.game-btn:active {
    transform: translateY(1px);
}

.game-btn.active {
    border-color: #f57c00;
    background: #fff3e0;
    box-shadow: none;
}

.difficulty-badge {
    background: #e8f5e9;
    border-radius: 999px;
    color: #2e7d32;
    font-size: 10px;
    font-weight: 800;
    margin-left: auto;
    padding: 3px 6px;
    white-space: nowrap;
}

.game-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 270px;
    gap: 22px;
    align-items: start;
}

.games-sidebar,
.achievements-sidebar {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(214, 192, 168, 0.65);
    border-radius: 20px;
    padding: 18px 14px;
    box-shadow: 0 12px 30px rgba(74, 44, 27, 0.08);
    position: sticky;
    top: 20px;
}

.sidebar-heading {
    padding: 4px 8px 14px;
}

.sidebar-heading h2 {
    color: #4a2c1b;
    font-size: 21px;
}

.sidebar-kicker {
    color: #f57c00;
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.game-column {
    min-width: 0;
}

.stats-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.stat-card,
.leaderboard-row {
    background: #fff;
    border: 1px solid #eadcca;
    border-radius: 14px;
    padding: 16px;
}

.stat-card h3 {
    color: #e65100;
    margin-bottom: 10px;
}

.stat-card p {
    color: #6b4f38;
    margin: 6px 0;
}

.results-table {
    overflow-x: auto;
}

.results-table table {
    border-collapse: collapse;
    min-width: 560px;
    width: 100%;
}

.results-table th,
.results-table td {
    border-bottom: 1px solid #eadcca;
    padding: 12px 10px;
    text-align: left;
}

.leaderboard-row {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: 60px minmax(0, 1fr) 130px 80px;
    margin-bottom: 10px;
}

.leaderboard-rank {
    color: #e65100;
    font-weight: 800;
}

.leaderboard-player {
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    color: #8d6e63;
    padding: 20px 0;
    text-align: center;
}

.error-state {
    color: #c62828;
}

.achievement-list {
    display: grid;
    gap: 9px;
    max-height: 580px;
    overflow-y: auto;
    padding: 2px 3px 8px;
}

.achievement-list:empty::before {
    color: #8d6e63;
    content: 'Войдите, чтобы увидеть достижения';
    font-size: 14px;
    line-height: 1.4;
    padding: 12px 5px;
}

.achievement-error {
    color: #c62828;
    font-size: 14px;
    line-height: 1.4;
    padding: 12px 5px;
}

.achievement-list .achievement-card {
    border-radius: 12px;
    margin: 0;
    padding: 12px 10px;
}

.achievement-list .achievement-card .description {
    font-size: 12px;
}

.sidebar-link {
    background: none;
    border: 0;
    color: #e65100;
    cursor: pointer;
    font-weight: 700;
    padding: 12px 6px 2px;
    width: 100%;
}

.sidebar-link span {
    float: right;
    font-size: 18px;
}

/* ========== КОНТЕЙНЕР ИГР ========== */
.game-container {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border-radius: 60px;
    padding: 30px 25px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.12);
    min-height: 500px;
    border: 2px solid rgba(255,255,255,0.5);
}

.game-title {
    font-size: 34px;
    font-weight: 800;
    color: #3e2a1b;
    text-align: center;
    margin-bottom: 10px;
}
.game-desc {
    text-align: center;
    color: #6b4f38;
    font-size: 18px;
    margin-bottom: 25px;
}

.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* ========== ПРИГЛАШЕНИЕ ДЛЯ ГОСТЕЙ ========== */
.guest-invite {
    margin-top: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    animation: slideUp 0.5s ease;
    display: none;
}

.guest-invite-content {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    padding: 25px 35px;
    border-radius: 20px;
    border: 2px solid #ffb300;
    position: relative;
    text-align: center;
    box-shadow: 0 4px 20px rgba(245, 124, 0, 0.15);
}

.guest-invite-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.guest-invite-content h3 {
    font-size: 20px;
    color: #4a2c1b;
    margin-bottom: 8px;
    font-weight: 700;
}

.guest-invite-content p {
    font-size: 16px;
    color: #6b4f38;
    margin-bottom: 18px;
}

.guest-invite-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.guest-invite-buttons .btn-primary {
    width: auto !important;
    padding: 10px 28px;
    font-size: 16px;
    flex-shrink: 0;
    border-radius: 30px;
}

.guest-invite-buttons .btn-secondary {
    width: auto !important;
    padding: 10px 28px;
    font-size: 16px;
    flex-shrink: 0;
    border-radius: 30px;
    background: transparent;
    color: #f57c00;
    border: 2px solid #f57c00;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
    display: inline-block;
}

.guest-invite-buttons .btn-secondary:hover {
    background: #f57c00;
    color: white;
}

.guest-invite-close {
    position: absolute;
    top: 12px;
    right: 18px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #999;
    transition: 0.2s;
    padding: 4px 8px;
    line-height: 1;
    border-radius: 50%;
}

.guest-invite-close:hover {
    color: #333;
    background: rgba(0,0,0,0.05);
    transform: rotate(90deg);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== АДАПТИВ ДЛЯ ПРИГЛАШЕНИЯ ========== */
@media (max-width: 500px) {
    .guest-invite-content {
        padding: 20px 15px;
    }
    
    .guest-invite-content h3 {
        font-size: 17px;
    }
    
    .guest-invite-content p {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .guest-invite-buttons {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .guest-invite-buttons .btn-primary,
    .guest-invite-buttons .btn-secondary {
        width: 100% !important;
        text-align: center;
        padding: 12px 20px;
    }
    
    .guest-invite-close {
        top: 8px;
        right: 12px;
        font-size: 20px;
    }
}
/* ========== МОДАЛЬНЫЕ ОКНА ========== */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 40px;
    max-width: 800px;
    width: 95%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: bounceIn 0.3s ease;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 25px;
    top: 20px;
    font-size: 36px;
    cursor: pointer;
    color: #999;
    transition: 0.2s;
}

.close:hover {
    color: #333;
}

/* ========== ДОСТИЖЕНИЯ ========== */
.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.achievement-card {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    transition: 0.2s;
    border: 2px solid #e0e0e0;
}

.achievement-card.unlocked {
    background: #fff8e1;
    border-color: #ffb300;
}

.achievement-card.locked {
    opacity: 0.6;
    filter: grayscale(0.5);
}

.achievement-card .icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

.achievement-card .name {
    font-weight: 700;
    color: #4a2c1b;
    margin-bottom: 5px;
}

.achievement-card .description {
    font-size: 14px;
    color: #6b4f38;
}

.achievement-card .status {
    font-size: 12px;
    margin-top: 8px;
    padding: 4px 12px;
    border-radius: 12px;
    display: inline-block;
}

.achievement-card.unlocked .status {
    background: #66bb6a;
    color: white;
}

.achievement-card.locked .status {
    background: #ef5350;
    color: white;
}

/* ========== АВТОРИЗАЦИЯ ========== */
.auth-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: linear-gradient(145deg, #f9f3e8 0%, #ffe9d6 100%);
}

.auth-box {
    background: white;
    padding: 40px 50px;
    border-radius: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    max-width: 450px;
    width: 100%;
    animation: slideIn 0.5s ease;
}

.auth-box .logo-big {
    text-align: center;
    font-size: 60px;
    margin-bottom: 10px;
}

.auth-box h1 {
    font-size: 32px;
    text-align: center;
    color: #4a2c1b;
    margin-bottom: 5px;
}

.auth-box h2 {
    text-align: center;
    color: #6b4f38;
    font-size: 18px;
    font-weight: 400;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #4a2c1b;
    margin-bottom: 5px;
}

.form-group input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e0d6c8;
    border-radius: 16px;
    font-size: 16px;
    transition: 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #f57c00;
    box-shadow: 0 0 0 3px rgba(245, 124, 0, 0.1);
}

.form-group .hint {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: #f57c00;
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.btn-primary:hover {
    background: #e65100;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 124, 0, 0.3);
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    color: #6b4f38;
}

.auth-link a {
    color: #f57c00;
    text-decoration: none;
    font-weight: 600;
    transition: 0.2s;
}

.auth-link a:hover {
    text-decoration: underline;
}

.error-msg {
    color: #ef5350;
    margin-top: 15px;
    text-align: center;
    font-weight: 600;
    padding: 10px;
    background: #ffebee;
    border-radius: 12px;
}

.success-msg {
    color: #66bb6a;
    margin-top: 15px;
    text-align: center;
    font-weight: 600;
    padding: 10px;
    background: #e8f5e9;
    border-radius: 12px;
}

/* ========== КАРТОЧКИ ИГР ========== */
.grid-3x3, .grid-4x4 {
    display: grid;
    gap: 15px;
    width: 100%;
    max-width: 450px;
}
.grid-3x3 { grid-template-columns: repeat(3, 1fr); }
.grid-4x4 { grid-template-columns: repeat(4, 1fr); }

.card {
    background: #ffb74d;
    aspect-ratio: 1/1;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    color: white;
    text-shadow: 0 4px 0 #bf6f00;
    box-shadow: 0 8px 0 #bf6f00;
    cursor: pointer;
    transition: all 0.1s ease;
    user-select: none;
    border: 3px solid #ffe0b2;
}
.card:active { transform: scale(0.94); }
.card.flipped {
    background: #4dd0e1;
    box-shadow: 0 8px 0 #00838f;
    border-color: #b2ebf2;
}
.card.matched {
    background: #81c784;
    box-shadow: 0 8px 0 #2e7d32;
    border-color: #c8e6c9;
    pointer-events: none;
    opacity: 0.7;
}

.letter-box {
    background: #fff8e1;
    padding: 20px 40px;
    border-radius: 80px;
    font-size: 72px;
    font-weight: 800;
    color: #bf6f00;
    border: 4px dashed #ffb300;
    min-width: 120px;
    text-align: center;
}

.options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}
.option-btn {
    background: #ffcc80;
    border: none;
    padding: 18px 40px;
    border-radius: 60px;
    font-size: 28px;
    font-weight: bold;
    color: #3e2a1b;
    box-shadow: 0 6px 0 #bf6f00;
    cursor: pointer;
    transition: 0.06s linear;
    min-width: 80px;
}
.option-btn:active {
    transform: translateY(6px);
    box-shadow: 0 0px 0 #bf6f00;
}
.option-btn.correct {
    background: #66bb6a;
    box-shadow: 0 6px 0 #2e7d32;
    color: white;
}
.option-btn.wrong {
    background: #ef5350;
    box-shadow: 0 6px 0 #b71c1c;
    color: white;
}

.number-display {
    font-size: 80px;
    font-weight: 800;
    color: #4a2c1b;
    background: #fff3e0;
    padding: 10px 50px;
    border-radius: 60px;
    border: 4px solid #ffb300;
}

.color-block {
    width: 150px;
    height: 150px;
    border-radius: 40px;
    border: 4px solid white;
    box-shadow: 0 8px 0 #bdbdbd;
}

.logic-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 400px;
    width: 100%;
}
.logic-item {
    background: #ce93d8;
    padding: 20px;
    border-radius: 30px;
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    color: white;
    box-shadow: 0 6px 0 #7b1fa2;
    cursor: pointer;
    transition: 0.06s;
}
.logic-item:active { transform: scale(0.94); }
.logic-item.selected {
    background: #ffb74d;
    box-shadow: 0 6px 0 #bf6f00;
}

.letter-btn.used {
    opacity: 0.5;
    cursor: not-allowed;
    transform: scale(0.95);
}

/* ========== ЧИТАЕМ ТЕКСТЫ ПО СЛОГАМ ========== */
.read-text-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 10px;
}

.read-text-btn {
    background: white;
    border: 2px solid #e0d6c8;
    padding: 8px 18px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: 0.2s;
    color: #4a2c1b;
}

.read-text-btn:hover {
    background: #fff3e0;
}

.read-text-btn.active {
    background: #f57c00;
    color: white;
    border-color: #f57c00;
}

.read-text-card {
    background: white;
    border-radius: 30px;
    padding: 25px 30px;
    max-width: 720px;
    width: 100%;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    border: 3px solid #ffe0b2;
}

.read-text-title {
    font-size: 24px;
    font-weight: 800;
    color: #4a2c1b;
    text-align: center;
    margin-bottom: 15px;
}

.read-text-body {
    font-size: 28px;
    line-height: 1.9;
    text-align: justify;
    color: #3e2a1b;
    user-select: none;
}

.read-word {
    display: inline-block;
    white-space: nowrap;
    margin-right: 10px;
}

.read-syllable {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.read-syllable:hover,
.read-syllable.hovered {
    background: #ffb74d;
    color: white;
    transform: scale(1.1);
}

/* ========== МАТЕМАТИЧЕСКИЙ ЛАБИРИНТ ========== */
.maze-cell {
    background: #fff8e1;
    padding: 15px 10px;
    border-radius: 12px;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    border: 3px solid #e0d6c8;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-word;
}

.maze-cell.current {
    background: #ffb74d;
    border-color: #f57c00;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(245, 124, 0, 0.3);
}

.maze-cell.start {
    background: #81c784;
    border-color: #2e7d32;
}

.maze-cell.end {
    background: #ef5350;
    border-color: #c62828;
    color: white;
}

.maze-cell.finish {
    background: #ffd54f;
    border-color: #f9a825;
    animation: pulse 0.5s ease-in-out infinite;
}

.maze-cell:hover:not(.current):not(.finish) {
    transform: scale(1.05);
    border-color: #f57c00;
}

/* ========== УВЕДОМЛЕНИЯ ========== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 15px;
    background: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 9999;
    max-width: 350px;
    animation: slideIn 0.3s ease;
}

.notification.success {
    border-left: 4px solid #66bb6a;
}

.notification.achievement {
    border-left: 4px solid #f9a825;
    background: #fffde7;
}

.notification.error {
    border-left: 4px solid #ef5350;
}

.notification.info {
    border-left: 4px solid #2196f3;
}

.notification .icon {
    font-size: 24px;
    margin-right: 10px;
}

.notification .message {
    font-size: 16px;
    color: #4a2c1b;
}

/* ========== КОНФЕТТИ ========== */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10000;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: confetti 2s ease-in-out forwards;
}

@keyframes confetti {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(720deg);
        opacity: 0;
    }
}

/* ========== АНИМАЦИИ ========== */
@keyframes slideIn {
    from {
        transform: translateX(30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-30px);
        opacity: 0;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.animate-slide-in {
    animation: slideIn 0.3s ease;
}

.animate-slide-out {
    animation: slideOut 0.3s ease;
}

/* ========== АДАПТИВ ========== */
@media (max-width: 1100px) {
    .game-layout {
        grid-template-columns: 210px minmax(0, 1fr);
    }

    .achievements-sidebar {
        grid-column: 1 / -1;
        position: static;
    }

    .achievement-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        max-height: none;
    }
}

@media (max-width: 720px) {
    .game-layout {
        display: flex;
        flex-direction: column;
    }

    .games-sidebar,
    .achievements-sidebar,
    .game-column {
        width: 100%;
    }

    .games-sidebar,
    .achievements-sidebar {
        position: static;
    }

    .game-menu {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .achievement-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .header {
        flex-direction: column;
        gap: 12px;
        padding: 15px;
    }
    
    .auth-box {
        padding: 30px 20px;
    }
    
    .game-btn {
        padding: 10px 16px;
        font-size: 15px;
    }

    .leaderboard-row {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .leaderboard-row strong,
    .leaderboard-row > span:last-child {
        grid-column: 2;
    }
    
    .grid-3x3, .grid-4x4 {
        max-width: 320px;
        gap: 10px;
    }
    
    .card {
        font-size: 32px;
        border-radius: 18px;
    }
    
    .letter-box {
        font-size: 48px;
        padding: 10px 20px;
    }
    
    .option-btn {
        font-size: 22px;
        padding: 12px 20px;
        min-width: 60px;
    }
    
    .number-display {
        font-size: 56px;
        padding: 5px 30px;
    }
    
    .achievement-grid {
        grid-template-columns: 1fr 1fr;
    }
    
