/**
 * LEXIGRA v6 - Главные стили игры
 * Полный CSS с анимациями, модалками и адаптивностью
 */

/* ========== ПЕРЕМЕННЫЕ ========== */
:root {
    --brand-bg: #ffffff;
    --brand-tile: #2563eb;
    --brand-accent: #60a5fa;
    --brand-muted: #dbe5f3;
    --brand-ink: #172a45;
    --brand-blue: #2563eb;
    --brand-caption: #64748b;
    --mode-solo-accent: #2563eb;
    --mode-solo-tint: #edf1f6;
    --mode-solo-edge: #dbe2ea;
    --mode-daily-accent: #b94f1f;
    --mode-daily-tint: #fff0d9;
    --mode-daily-edge: #f1d7b7;
    --mode-marathon-accent: #7c3aed;
    --mode-marathon-tint: #f3edff;
    --mode-marathon-edge: #e2d6fa;
    --mode-group-accent: #047857;
    --mode-group-tint: #e9f5ee;
    --mode-group-edge: #cbe4d6;
    --mode-active-ink: #ffffff;
    --logo-inset: 8px;
    --bg-main: #f5f5f5;
    --bg-white: #ffffff;
    --bg-card: #ffffff;

    --blue: rgb(37, 99, 235);
    --blue-hover: rgb(29, 78, 216);
    --yellow: rgb(253, 224, 71);
    --green: rgb(34, 197, 94);
    --gray: rgb(200, 204, 212);
    --gray-dark: rgb(107, 114, 128);
    --gray-light: rgb(243, 244, 246);
    --red: rgb(239, 68, 68);

    --text-main: #111827;
    --text-muted: #6b7280;
    --text-light: #9ca3af;

    --shadow-soft: 0 2px 6px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 3px 9px rgba(15, 23, 42, 0.07);
    --shadow-lg: 0 6px 16px rgba(15, 23, 42, 0.10);

    --radius: 14px;
    --radius-sm: 8px;
    --radius-lg: 20px;

    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Тёмная тема */
[data-theme="dark"] {
    --brand-bg: #101c32;
    --brand-tile: #dbeafe;
    --brand-accent: #3b82f6;
    --brand-muted: #293e5c;
    --brand-ink: #f8fafc;
    --brand-blue: #60a5fa;
    --brand-caption: #b2c3db;
    --mode-solo-accent: #60a5fa;
    --mode-solo-tint: #334155;
    --mode-solo-edge: #475569;
    --mode-daily-accent: #f99a48;
    --mode-daily-tint: #33251f;
    --mode-daily-edge: #684832;
    --mode-marathon-accent: #a78bfa;
    --mode-marathon-tint: #2a2243;
    --mode-marathon-edge: #52406d;
    --mode-group-accent: #34d399;
    --mode-group-tint: #18352f;
    --mode-group-edge: #2f6250;
    --mode-active-ink: #0f172a;
    --bg-main: #0f172a;
    --bg-white: #1e293b;
    --bg-card: #1e293b;

    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-light: #64748b;

    --gray: rgb(51, 65, 85);
    --gray-light: rgb(30, 41, 59);

    --shadow-soft: 0 2px 6px rgba(0, 0, 0, 0.16);
    --shadow-md: 0 3px 9px rgba(0, 0, 0, 0.20);
    --shadow-lg: 0 6px 16px rgba(0, 0, 0, 0.28);
}

/* ========== БАЗОВЫЕ СТИЛИ ========== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow-x: hidden;
}

.game-page {
    scrollbar-width: none;
}

.game-page::-webkit-scrollbar {
    display: none;
}

.game-page body,
body:has(> .footer) {
    /* Keep scrolling on the viewport rather than in a nested scroll container. */
    overflow: clip visible !important;
}

body {
    --mode-accent: var(--mode-solo-accent);
    --mode-tint: var(--mode-solo-tint);
    --mode-edge: var(--mode-solo-edge);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color var(--transition), color var(--transition);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

button, select, input {
    font-family: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ========== SPLASH SCREEN ========== */
#splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-main);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.8s ease-out;
}

#splash.hidden {
    opacity: 0;
    pointer-events: none;
}

.splash-content {
    text-align: center;
    color: white;
}

.splash-logo .logo-svg {
    display: block;
    width: min(576px, 90vw);
    height: auto;
    margin: 0 auto;
}

.splash-logo {
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

.splash-title {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 30px;
}

.splash-loader {
    width: 50px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
}

.splash-loader::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 40%;
    background: white;
    border-radius: 2px;
    animation: loader 1.5s infinite;
}

@keyframes loader {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

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

/* Адаптивность для splash (мобильные и планшеты) */
@media (max-width: 1024px) {
    :root { --logo-inset: 6px; }
    .splash-title {
        font-size: 32px;
    }

    .splash-logo .logo-svg {
        width: 90%;
        height: auto;
    }
}

@media (max-width: 480px) {
    .splash-title {
        font-size: 24px;
    }

    .splash-logo {
        margin-bottom: 10px;
    }

    .splash-logo .logo-svg {
        width: 95%;
        max-width: 360px;
    }
}

/* ========== ГЛАВНЫЙ КОНТЕНТ ========== */
#main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    opacity: 1;
    transition: opacity 0.8s ease-in-out;
}

#main.main-hidden {
    opacity: 0;
}

.skip-game-splash #splash {
    display: none;
}

.skip-game-splash #main.main-hidden {
    opacity: 1;
    visibility: visible;
}
.skip-game-splash #main { transition: none; }

/* Android already shows a native launch screen. Show the reserved board immediately. */
@media (max-width: 1024px), (display-mode: standalone), (display-mode: fullscreen), (display-mode: minimal-ui) {
    #splash { display: none; }
    #main.main-hidden { opacity: 1; visibility: visible; }
    #main { transition: none; }
}

/* ========== HEADER ========== */
.header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--gray-light);
    padding: 16px 0;
    box-shadow: var(--shadow-soft);
    position: relative; /* Не sticky! */
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header-left, .header-center, .header-right, .header-extra {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    white-space: nowrap;
}

#main[data-header-layout="menu"] .header,
#main:is([data-header-layout="compact"], [data-header-layout="modes"]) .header-extra,
#main[data-header-layout="modes"] .header-left,
#main:is([data-header-layout="wide"], [data-header-layout="compact"]) .mobile-menu-theme,
#main:is([data-header-layout="wide"], [data-header-layout="compact"], [data-header-layout="modes"]) .menu-collapsed-only,
#main[data-header-layout="wide"] .mobile-menu-info {
    display: none;
}

.header-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.dictionary-select {
    padding: 8px 32px 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--gray);
    background: var(--bg-main);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.dictionary-select:hover {
    border-color: var(--blue);
}

#themeSelect, #themeSelectMobile {
    appearance: none;
    padding-inline-end: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px 14px;
}

[data-theme="dark"] :is(#themeSelect, #themeSelectMobile) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23cbd5e1' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.dictionary-select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Mode Switch */
[data-mode-color="solo"] {
    --mode-accent: var(--mode-solo-accent);
    --mode-tint: var(--mode-solo-tint);
    --mode-edge: var(--mode-solo-edge);
}
.daily-word-mode, [data-mode-color="daily"] {
    --mode-accent: var(--mode-daily-accent);
    --mode-tint: var(--mode-daily-tint);
    --mode-edge: var(--mode-daily-edge);
}
.marathon-mode, [data-mode-color="marathon"] {
    --mode-accent: var(--mode-marathon-accent);
    --mode-tint: var(--mode-marathon-tint);
    --mode-edge: var(--mode-marathon-edge);
}
.cup-page, [data-mode-color="group"] {
    --mode-accent: var(--mode-group-accent);
    --mode-tint: var(--mode-group-tint);
    --mode-edge: var(--mode-group-edge);
}
.mode-switch,
.mobile-mode-switch {
    --mode-count: 4;
    --selected-mode: 1;
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: repeat(var(--mode-count), minmax(0, 1fr));
    background: var(--mode-tint);
    border: 1px solid var(--mode-edge);
    padding: 4px;
    border-radius: 12px;
    touch-action: pan-y pinch-zoom;
    user-select: none;
}

.marathon-mode :is(.mode-switch, .mobile-mode-switch) {
    --selected-mode: 2;
}

.daily-word-mode :is(.mode-switch, .mobile-mode-switch) {
    --selected-mode: 0;
}

.cup-page :is(.mode-switch, .mobile-mode-switch) {
    --selected-mode: 3;
}

.mode-switch::before,
.mobile-mode-switch::before {
    content: '';
    position: absolute;
    inset-block: 4px;
    inset-inline-start: 4px;
    width: calc((100% - 8px) / var(--mode-count));
    transform: translateX(calc(var(--mode-position, var(--selected-mode)) * 100%));
    border-radius: 8px;
    background: var(--mode-accent);
    box-shadow: var(--shadow-soft);
    pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
    :is(.mode-switch, .mobile-mode-switch)[data-settling]::before {
        transition: transform 160ms ease-out;
    }
}

.mode-btn,
.mobile-mode-btn {
    position: relative;
    display: grid;
    place-items: center;
    padding: 8px 12px;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
}

.mode-btn.active,
.mobile-mode-btn.active {
    color: var(--mode-active-ink);
    cursor: grab;
}

:is(.mode-switch, .mobile-mode-switch):not([data-dragging]) > a:not(.active, .mode-preview):hover {
    background: var(--mode-tint);
}

:is(.mode-switch, .mobile-mode-switch)[data-dragging] > a {
    color: var(--text-main);
    cursor: grabbing;
}

:is(.mode-switch, .mobile-mode-switch)[data-settling] > .active:not(.mode-preview) {
    color: var(--text-main);
}

:is(.mode-switch, .mobile-mode-switch):is([data-dragging], [data-settling]) > .mode-preview {
    color: var(--mode-active-ink);
}

.btn-header {
    padding: 8px 16px;
    border: 1px solid var(--gray);
    background: var(--bg-white);
    color: var(--text-main);
    font-size: 14px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-header:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.btn-icon {
    font-size: 16px;
}

/* ========== TOP BAR (Логотип и меню) ========== */
.top-bar {
    padding: var(--logo-inset) 0;
    position: sticky;
    top: 0;
    background: var(--bg-main);
    z-index: 100;
    box-shadow: var(--shadow-soft);
}

.top-bar .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.top-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
}

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

.logo a {
    display: block;
    max-width: 100%;
}

.logo-svg {
    display: block;
    width: 288px;
    max-width: 100%;
    height: auto;
}

.logo-text {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--blue);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-icon-text {
    padding: 10px 16px;
    border: 1px solid var(--gray);
    background: var(--bg-white);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: var(--shadow-soft);
}

.btn-icon-text:hover {
    border-color: var(--blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Кнопка возврата в игру - выделенная */
.btn-back-to-game {
    padding: 10px 16px;
    border: 2px solid var(--blue);
    background: linear-gradient(135deg, var(--blue) 0%, #1d4ed8 100%);
    color: white;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-back-to-game:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

/* Profile Button */
.profile-btn-wrapper {
    position: relative;
}

.profile-btn {
    padding: 8px 16px;
    border: 1px solid var(--gray);
    background: var(--bg-white);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    box-shadow: var(--shadow-soft);
}

.profile-btn:hover {
    border-color: var(--blue);
}

.profile-icon {
    font-size: 20px;
}

.profile-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

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

.profile-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.profile-btn-wrapper:hover .profile-arrow {
    transform: rotate(180deg);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--gray-light);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 100;
}

.profile-btn-wrapper:hover .profile-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 12px 16px;
    color: var(--text-main);
    font-size: 14px;
    transition: all 0.2s;
    border-bottom: 1px solid var(--gray-light);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: var(--blue);
    color: white;
}

.dropdown-item:first-child {
    border-radius: 10px 10px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 10px 10px;
}

/* ========== GAME TOOLBAR ========== */
#gameTop[hidden],
#gameKeyboard[hidden] {
    display: none;
}

.game-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px 12px;
    margin-top: 8px;
    padding: 8px 12px;
    border: 1px solid var(--gray-light);
    border-radius: 12px;
    background: var(--bg-white);
    box-shadow: var(--shadow-soft);
}

.game-settings-summary {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.game-settings-summary strong {
    color: var(--blue);
}

.game-settings-controls {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    display: flex;
    align-items: stretch;
    gap: 6px;
}

.game-toolbar #settingsBtn {
    border-color: #d6dae1;
    background: var(--blue);
    color: white;
}

.game-toolbar #settingsBtn:hover {
    background: var(--blue-hover);
}

.game-view-controls {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    gap: 6px;
}

.mobile-input-hint {
    display: none;
    grid-column: 1 / -1;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.4;
}

@media (max-width: 1024px) and (pointer: coarse) {
    #main:has(#gameKeyboard[hidden]) .mobile-input-hint {
        display: block;
    }
}

.game-toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 36px;
    padding: 4px 9px;
    border: 1px solid var(--gray);
    border-radius: 8px;
    background: var(--bg-white);
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.game-toolbar-btn svg {
    width: 17px;
    height: 17px;
    flex: none;
}

.game-toolbar-btn:hover,
.game-toolbar-btn[aria-expanded="false"] {
    border-color: var(--blue);
    color: var(--blue);
}

.game-toolbar-btn[aria-controls="gameTop"][aria-expanded="false"] svg {
    transform: rotate(180deg);
}

.game-toolbar-btn[aria-expanded="true"] .keyboard-toggle-slash {
    display: none;
}

/* ========== HAMBURGER MENU ========== */
.mobile-account-btn {
    display: none;
}

.hamburger-btn {
    display: none;
    flex-shrink: 0;
    flex-direction: column;
    justify-content: space-between;
    width: 32px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

#main:is([data-header-layout="compact"], [data-header-layout="modes"], [data-header-layout="menu"]) .hamburger-btn {
    display: flex;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background: var(--blue);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: translateY(10.5px) rotate(45deg);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: translateY(-10.5px) rotate(-45deg);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-menu-overlay.show {
    display: block;
    opacity: 1;
}

/* Mobile Menu Panel */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background: var(--bg-white);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.mobile-menu.show {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--gray-light);
    position: sticky;
    top: 0;
    background: var(--bg-white);
    z-index: 10;
}

.mobile-menu-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.mobile-menu-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gray-light);
    color: var(--text-main);
    font-size: 28px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.mobile-menu-close:hover {
    background: var(--gray);
}

.mobile-menu-content {
    padding: 12px; /* Уменьшен с 16px */
    padding-bottom: 100px; /* Дополнительный отступ для Safari iOS */
    max-height: calc(100vh - 70px); /* Ограничиваем высоту */
    overflow-y: auto;
}

.mobile-menu-section {
    margin-bottom: 16px; /* Уменьшен с 24px */
    padding-bottom: 16px; /* Уменьшен с 24px */
    border-bottom: 1px solid var(--gray-light);
}

.mobile-menu-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.mobile-menu-label {
    display: block;
    font-size: 13px; /* Уменьшен с 14px */
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px; /* Уменьшен с 12px */
}

.mobile-menu-select {
    width: 100%;
    padding: 10px; /* Уменьшен с 12px */
    border-radius: 8px;
    border: 1px solid var(--gray);
    background: var(--bg-main);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.mobile-mode-btn {
    min-height: 44px;
    padding: 6px 3px;
    font-size: 12px;
}

.marathon-mode .score-card,
.marathon-mode #resultHintsItem,
.marathon-mode #resultPointsItem,
.daily-word-mode #resultHintsItem {
    display: none;
}

.marathon-overview,
.marathon-leaderboard {
    padding-block: 16px;
}

.marathon-overview p,
.marathon-leaderboard p {
    margin: 6px 0;
}

.marathon-leaderboard table {
    width: 100%;
    max-width: 640px;
    margin-top: 12px;
    border-collapse: collapse;
}

.marathon-leaderboard th,
.marathon-leaderboard td {
    padding: 8px;
    border-bottom: 1px solid var(--gray);
    text-align: start;
    overflow-wrap: anywhere;
}

.daily-word-stats {
    max-width: 540px;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    background: var(--bg-card);
}

.daily-word-stats h2 {
    font-size: 16px;
}

.daily-word-streaks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 8px 0;
}

.daily-word-streaks > div {
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-main);
}

.daily-word-streaks dt,
.daily-word-history-range,
#dailyWordStatsMessage {
    color: var(--text-muted);
    font-size: 13px;
}

#dailyWordStatsMessage:empty {
    display: none;
}

.daily-word-streaks dd {
    font-size: 19px;
    font-weight: 700;
}

.daily-word-stats summary {
    font-weight: 600;
    cursor: pointer;
}

.daily-word-weekdays,
.daily-word-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    text-align: center;
    font-size: 12px;
}

.daily-word-weekdays {
    margin-bottom: 4px;
    color: var(--text-muted);
}

.daily-word-calendar,
.daily-word-legend {
    list-style: none;
}

.daily-word-calendar li > :is(time, button) {
    display: grid;
    width: 100%;
    justify-items: center;
    padding: 3px 1px;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
}

.daily-word-calendar button time {
    display: grid;
    justify-items: center;
}

.daily-word-calendar button {
    border-color: var(--gray);
    background: var(--bg-main);
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.daily-word-calendar button:hover,
.daily-word-calendar [aria-current="date"] {
    border-color: var(--blue);
    font-weight: 700;
}

.daily-word-recap-grid {
    margin-block: 12px;
    font-size: 20px;
    line-height: 1.45;
}

.daily-word-mark {
    display: inline-grid;
    width: 18px;
    height: 18px;
    place-items: center;
    border-radius: 4px;
    background: var(--day-mark-bg, var(--bg-main));
    color: var(--day-mark-text, var(--text-main));
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.daily-word-stats [data-status="won"] {
    --day-mark-bg: var(--green);
    --day-mark-text: #111827;
}

.daily-word-stats [data-status="lost"] {
    --day-mark-bg: var(--red);
    --day-mark-text: #111827;
}

.daily-word-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 12px;
}

.daily-word-legend li {
    display: flex;
    align-items: center;
    gap: 4px;
}

.daily-challenges {
    min-width: 0;
    padding: 9px 0;
}

.daily-challenges summary {
    font-weight: 700;
    cursor: pointer;
}

.daily-challenges p,
.daily-challenges h3 {
    margin-block: 10px;
}

.daily-challenges small,
.daily-task span {
    color: var(--text-muted);
}

.daily-tasks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 8px;
    list-style: none;
    margin-block: 10px;
}

.daily-task {
    display: grid;
    gap: 5px;
    padding: 10px;
    border-radius: 8px;
    background: var(--gray-light);
}

.daily-task progress {
    width: 100%;
    accent-color: var(--blue);
}

.daily-badges {
    padding-inline-start: 20px;
}

.daily-badges time {
    color: var(--text-muted);
}

.mobile-menu-btn {
    width: 100%;
    padding: 10px 12px; /* Уменьшен с 14px 16px */
    border: 1px solid var(--gray);
    background: var(--bg-main);
    color: var(--text-main);
    font-size: 13px; /* Уменьшен с 14px */
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px; /* Уменьшен с 12px */
    margin-bottom: 6px; /* Уменьшен с 8px */
    transition: all 0.2s;
    text-align: left;
}

.mobile-menu-btn:last-child {
    margin-bottom: 0;
}

.mobile-menu-btn:hover {
    border-color: var(--blue);
    background: var(--bg-white);
}

.mobile-menu-icon {
    font-size: 16px; /* Уменьшен с 18px */
}

/* ========== GAME CONTAINER ========== */
.game-container {
    --game-board-gap: 24px;
    padding-block: var(--game-board-gap);
    min-height: 0; /* Позволяет контенту сжиматься при необходимости */
}

.game-layout {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 30px;
    align-items: start;
}

/* Обеспечиваем, чтобы центральная колонка (сетка) была в зоне видимости */
@supports (display: grid) {
    @media (max-width: 1200px) {
        /* На планшетах и мобильных обеспечиваем оптимальное размещение */
        .game-container {
            display: flex;
            flex-direction: column;
        }

        /* Сетка + клавиатура должны быть видны вместе */
        .game-center {
            position: sticky;
            top: 10px;
            z-index: 10;
        }
    }
}

/* ========== LEFT COLUMN ========== */
.game-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mascot-card, .timer-card, .score-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-md);
}

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

.mascot-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, var(--blue) 0%, #3b82f6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mascot-emoji {
    font-size: 48px;
}

.mascot-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--blue);
}

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

/* Скрываем дисплей и метку таймера до начала игры */
.timer-display,
.timer-label {
    display: none;
}

.timer-card.game-active .timer-display,
.timer-card.game-active .timer-label {
    display: block;
}

.timer-display {
    font-size: 32px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: var(--blue);
    margin-bottom: 8px;
}

.timer-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.btn-reload, #cup-start, #newGameBtn {
    width: 100%;
    min-height: 54px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #047857, #065f46);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    cursor: pointer;
    box-shadow: 0 5px 14px rgb(4 120 87 / 24%);
    transition: background .2s, transform .2s, box-shadow .2s;
}

.btn-reload:hover:not(:disabled), #cup-start:hover:not(:disabled), #newGameBtn:hover:not(:disabled) {
    background: linear-gradient(135deg, #065f46, #064e3b);
    transform: translateY(-2px);
    box-shadow: 0 7px 18px rgb(4 120 87 / 30%);
}
.btn-reload:focus-visible, #cup-start:focus-visible, #newGameBtn:focus-visible { outline: 3px solid var(--text-main); outline-offset: 3px; }
.btn-reload:active:not(:disabled), #cup-start:active:not(:disabled), #newGameBtn:active:not(:disabled) { transform: translateY(0); }

.btn-reload:disabled, #cup-start:disabled, #newGameBtn:disabled {
    opacity: .7;
    box-shadow: none;
    cursor: wait;
}

.btn-restart-solo {
    min-height: 44px;
    padding: 10px;
    font-size: 14px;
    margin-top: 8px;
    color: var(--blue);
    background: var(--bg-white);
    border: 1px solid var(--blue);
    box-shadow: none;
    animation: none;
}

.btn-restart-solo:hover:not(:disabled) {
    background: var(--blue-hover);
    color: white;
}

.btn-give-up {
    width: 100%;
    padding: 10px;
    background: var(--red);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.btn-give-up:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.score-card {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
}

.score-item {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: baseline;
    gap: 6px;
    white-space: nowrap;
}

.score-label {
    font-size: 13px;
    color: var(--text-muted);
}

.score-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--blue);
}

.score-arrow {
    color: var(--text-muted);
    font-size: 18px;
}

/* ========== CENTER COLUMN (GRID) ========== */
.game-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--game-board-gap);
    border: none;
    outline: none;
}

.game-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 16px;
    box-shadow:
        0 0 0 1px rgba(102, 126, 234, 0.1),
        var(--shadow-soft),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    position: relative;
    backdrop-filter: blur(10px);
    max-width: 100%;
    width: fit-content;
    margin: 0 auto;
}

[data-theme="dark"] .game-grid {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    box-shadow:
        0 0 0 1px rgba(102, 126, 234, 0.15),
        var(--shadow-soft),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.grid-row {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.grid-loading .grid-row {
    opacity: 0.4;
}

.grid-revealing .grid-row {
    animation: gridReveal 400ms ease-out both;
    animation-delay: calc(var(--grid-row, 0) * 25ms);
}

@keyframes gridReveal {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .grid-revealing .grid-row {
        animation: none;
    }
}

/* Базовый размер для слов 4-5 букв */
.cell {
    width: 75px;
    height: 75px;
    border: 3px solid var(--gray);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    font-weight: 700;
    text-transform: uppercase;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    position: relative;
}

/* Средний размер для слов 6-7 букв */
.game-grid[data-word-length="6"] .cell,
.game-grid[data-word-length="7"] .cell {
    width: 68px;
    height: 68px;
    font-size: 34px;
}

/* Маленький размер для слов 8-9 букв */
.game-grid[data-word-length="8"] .cell,
.game-grid[data-word-length="9"] .cell {
    width: 60px;
    height: 60px;
    font-size: 30px;
}

[data-theme="dark"] .cell {
    background: linear-gradient(145deg, #374151 0%, #1f2937 100%);
    border-color: #4b5563;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.cell.filled {
    border-color: var(--blue);
    transform: scale(1.08);
    box-shadow:
        0 4px 12px rgba(59, 130, 246, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    animation: cellPop 0.2s ease;
}

.cell.prefilled {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    border-color: #16a34a;
    color: white;
    font-weight: 700;
    cursor: not-allowed;
    box-shadow:
        0 6px 20px rgba(34, 197, 94, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 0 3px rgba(34, 197, 94, 0.15);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

@keyframes cellPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1.08); }
}

.cell.cell-selected {
    border-color: var(--blue);
    box-shadow:
        0 0 0 3px rgba(59, 130, 246, 0.3),
        0 4px 12px rgba(59, 130, 246, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
    animation: selectedPulse 1.5s ease-in-out infinite;
    cursor: pointer;
}

@keyframes selectedPulse {
    0%, 100% {
        box-shadow:
            0 0 0 3px rgba(59, 130, 246, 0.3),
            0 4px 12px rgba(59, 130, 246, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.8),
            inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    }
    50% {
        box-shadow:
            0 0 0 4px rgba(59, 130, 246, 0.5),
            0 6px 16px rgba(59, 130, 246, 0.6),
            inset 0 1px 0 rgba(255, 255, 255, 0.9),
            inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    }
}

.cell:not(.tile-correct):not(.tile-present):not(.tile-absent):not(.tile-unknown) {
    cursor: pointer;
}

.cell.hint-revealed {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow:
        0 6px 20px rgba(102, 126, 234, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 0 3px rgba(102, 126, 234, 0.2);
    animation: hintGlow 1s ease-in-out infinite;
}

@keyframes hintGlow {
    0%, 100% { box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 0 3px rgba(102, 126, 234, 0.2); }
    50% { box-shadow: 0 8px 24px rgba(102, 126, 234, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 0 0 4px rgba(102, 126, 234, 0.3); }
}

.cell.tile-correct {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    border-color: #16a34a;
    color: white;
    box-shadow:
        0 6px 20px rgba(34, 197, 94, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 0 3px rgba(34, 197, 94, 0.15);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cell.tile-present {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-color: #d97706;
    color: white;
    box-shadow:
        0 6px 20px rgba(245, 158, 11, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 0 3px rgba(245, 158, 11, 0.15);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cell.tile-absent {
    background: linear-gradient(135deg, #3f3f46 0%, #27272a 100%);
    border-color: #18181b;
    color: #a1a1aa;
    box-shadow:
        0 4px 12px rgba(24, 24, 27, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
}

/* Анимация переворота */
.cell.tile-flip {
    animation: flip 0.6s ease;
    transform-style: preserve-3d;
}

@keyframes flip {
    0% {
        transform: rotateX(0) scale(1);
    }
    45% {
        transform: rotateX(90deg) scale(1.05);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    }
    55% {
        transform: rotateX(90deg) scale(1.05);
    }
    100% {
        transform: rotateX(0) scale(1);
    }
}

/* Анимация тряски */
.grid-row.row-error {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.grid-row.row-error .cell {
    border-color: var(--red);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

/* ========== HINTS SYSTEM ========== */
.hints-container {
    margin-top: 20px;
    display: none; /* Скрыт до начала игры */
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Показываем когда игра началась */
.hints-container.game-started {
    display: flex;
}

.hints-toggle {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: var(--blue);
    text-decoration: none;
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    border: 2px dashed var(--blue);
    transition: var(--transition);
    cursor: pointer;
}

.hints-toggle:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.hints-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 16px;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-soft);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-hint {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-soft);
}

.btn-hint:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-hint:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.hints-info {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
}

.hints-info.no-hints {
    color: var(--text-light);
    font-style: italic;
}

/* ========== HELP BUTTON ========== */
.help-button {
    --help-size: 36px;
    flex: 0 0 var(--help-size);
    width: var(--help-size);
    height: var(--help-size);
    border-radius: 8px;
    background: var(--bg-white);
    color: var(--blue);
    border: 1px solid var(--gray);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    font-weight: 700;
    transition: border-color var(--transition), background-color var(--transition);
}

.help-button[hidden] {
    display: none;
}

.help-button:hover {
    border-color: var(--blue);
    background: var(--gray-light);
}

.help-icon {
    display: block;
    line-height: 1;
}

@media (max-width: 1024px) {
    .help-button {
        display: none;
    }
}

/* Анимация победы */
.grid-row.row-win {
    animation: winGlow 1.5s ease-in-out;
}

@keyframes winGlow {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.05);
        filter: brightness(1.15);
        box-shadow: 0 0 40px rgba(34, 197, 94, 0.8);
    }
}

.grid-row.row-win .cell {
    animation: bounceWin 0.6s ease;
}

@keyframes bounceWin {
    0% { transform: translateY(0) scale(1); }
    30% { transform: translateY(-15px) scale(1.1); }
    50% { transform: translateY(-20px) scale(1.15); }
    70% { transform: translateY(-10px) scale(1.05); }
    100% { transform: translateY(0) scale(1); }
}

/* ========== RIGHT COLUMN (TRANSLATIONS) ========== */
.game-right {
}

.translations-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-md);
    max-height: 600px;
    overflow-y: auto;
}

.translations-placeholder {
    font-size: 14px;
    font-weight: 300;
    font-style: italic;
    color: #999;
    margin-bottom: 16px;
    padding: 12px;
    text-align: center;
}

.translations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.translation-item {
    padding: 12px;
    background: var(--gray-light);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.translation-word {
    font-weight: 700;
    color: var(--text-main);
}

.translation-text {
    color: var(--text-muted);
    font-weight: 500;
}

.translation-transcript {
    color: var(--text-light);
    font-style: italic;
}

/* ========== FEEDBACK CARD ========== */
.feedback-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    margin-top: 16px;
    border: 1px solid var(--border);
}

.feedback-header {
    margin-bottom: 8px;
}

.feedback-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.feedback-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0 0 12px 0;
}

.feedback-actions {
    display: flex;
    gap: 8px;
}

.feedback-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-white);
}

.feedback-btn-bug {
    color: #dc2626;
    border-color: #fecaca;
    background: linear-gradient(to bottom, #fff, #fef2f2);
}

.feedback-btn-bug:hover {
    border-color: #fca5a5;
    background: linear-gradient(to bottom, #fef2f2, #fee2e2);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.1);
}

.feedback-btn-idea {
    color: #2563eb;
    border-color: #bfdbfe;
    background: linear-gradient(to bottom, #fff, #eff6ff);
}

.feedback-btn-idea:hover {
    border-color: #93c5fd;
    background: linear-gradient(to bottom, #eff6ff, #dbeafe);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.1);
}

.feedback-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.feedback-btn-text {
    white-space: nowrap;
}

/* Dark theme */
[data-theme="dark"] .feedback-btn {
    background: var(--bg-secondary);
}

[data-theme="dark"] .feedback-btn-bug {
    color: #fca5a5;
    border-color: #7f1d1d;
    background: linear-gradient(to bottom, #1f1f1f, #1a1414);
}

[data-theme="dark"] .feedback-btn-bug:hover {
    border-color: #991b1b;
    background: linear-gradient(to bottom, #1a1414, #220f0f);
}

[data-theme="dark"] .feedback-btn-idea {
    color: #93c5fd;
    border-color: #1e3a8a;
    background: linear-gradient(to bottom, #1f1f1f, #141a24);
}

[data-theme="dark"] .feedback-btn-idea:hover {
    border-color: #1e40af;
    background: linear-gradient(to bottom, #141a24, #0f1629);
}

/* ========== KEYBOARD ========== */
.keyboard-container {
    padding-bottom: 24px;
}

.keyboard {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 700px;
    margin: 0 auto;
}

.keyboard-row {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.key {
    min-width: 43px;
    height: 58px;
    padding: 0 8px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.1s ease-out;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.08) inset,
        0 1px 2px 0 rgba(255, 255, 255, 0.5) inset,
        0 4px 0 0 rgba(0, 0, 0, 0.12),
        0 4px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    top: 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .key {
    background: linear-gradient(180deg, #4a5568 0%, #2d3748 100%);
    color: #e2e8f0;
    border: 1px solid rgba(0, 0, 0, 0.3);
}

.key:hover {
    background: linear-gradient(180deg, #ffffff 0%, #f1f3f5 100%);
    transform: translateY(-2px);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.08) inset,
        0 1px 3px 0 rgba(255, 255, 255, 0.6) inset,
        0 6px 0 0 rgba(0, 0, 0, 0.12),
        0 6px 12px rgba(0, 0, 0, 0.18);
}

[data-theme="dark"] .key:hover {
    background: linear-gradient(180deg, #5a6778 0%, #3d4958 100%);
}

.key:active {
    transform: translateY(4px);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.1) inset,
        0 1px 1px 0 rgba(255, 255, 255, 0.3) inset,
        0 0 0 0 rgba(0, 0, 0, 0.12),
        0 2px 4px rgba(0, 0, 0, 0.1);
    top: 4px;
}

.key.key-pressed {
    transform: translateY(4px);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.1) inset,
        0 1px 1px 0 rgba(255, 255, 255, 0.3) inset,
        0 0 0 0 rgba(0, 0, 0, 0.12),
        0 2px 4px rgba(0, 0, 0, 0.1);
    top: 4px;
}

.key.key-backspace, .key.key-enter {
    min-width: 80px;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 12px;
}

.key.key-backspace {
    background: linear-gradient(180deg, #f87171 0%, #dc2626 100%);
    color: white;
    border: 1px solid #b91c1c;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.1) inset,
        0 1px 2px 0 rgba(255, 255, 255, 0.3) inset,
        0 4px 0 0 #b91c1c,
        0 4px 8px rgba(220, 38, 38, 0.4);
}

.key.key-backspace:hover {
    background: linear-gradient(180deg, #fca5a5 0%, #ef4444 100%);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.1) inset,
        0 1px 3px 0 rgba(255, 255, 255, 0.4) inset,
        0 6px 0 0 #b91c1c,
        0 6px 12px rgba(220, 38, 38, 0.5);
}

.key.key-backspace:active,
.key.key-backspace.key-pressed {
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.15) inset,
        0 1px 1px 0 rgba(255, 255, 255, 0.2) inset,
        0 0 0 0 #b91c1c,
        0 2px 4px rgba(220, 38, 38, 0.3);
}

.key.key-backspace .key-icon {
    transform: rotate(180deg);
}

.key.key-enter {
    background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
    color: white;
    border: 1px solid #2563eb;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.1) inset,
        0 1px 2px 0 rgba(255, 255, 255, 0.3) inset,
        0 4px 0 0 #2563eb,
        0 4px 8px rgba(59, 130, 246, 0.4);
}

.key.key-enter:hover {
    background: linear-gradient(180deg, #93c5fd 0%, #60a5fa 100%);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.1) inset,
        0 1px 3px 0 rgba(255, 255, 255, 0.4) inset,
        0 6px 0 0 #2563eb,
        0 6px 12px rgba(59, 130, 246, 0.5);
}

.key.key-enter:active,
.key.key-enter.key-pressed {
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.15) inset,
        0 1px 1px 0 rgba(255, 255, 255, 0.2) inset,
        0 0 0 0 #2563eb,
        0 2px 4px rgba(59, 130, 246, 0.3);
}

.key.key-backspace .key-icon,
.key.key-enter .key-icon {
    font-size: 20px;
    line-height: 1;
}

.key.key-backspace .key-label,
.key.key-enter .key-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.9;
    line-height: 1;
}

.key.key-correct {
    background: linear-gradient(180deg, #4ade80 0%, #22c55e 100%);
    color: white;
    border: 1px solid #16a34a;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.1) inset,
        0 1px 2px 0 rgba(255, 255, 255, 0.3) inset,
        0 4px 0 0 #16a34a,
        0 4px 8px rgba(34, 197, 94, 0.3);
}

.key.key-present {
    background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    border: 1px solid #d97706;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.1) inset,
        0 1px 2px 0 rgba(255, 255, 255, 0.3) inset,
        0 4px 0 0 #d97706,
        0 4px 8px rgba(245, 158, 11, 0.3);
}

.key.key-absent {
    background: linear-gradient(180deg, #3f3f46 0%, #27272a 100%);
    color: #a1a1aa;
    border: 1px solid #18181b;
    opacity: 0.9;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.3) inset,
        0 1px 2px 0 rgba(255, 255, 255, 0.05) inset,
        0 4px 0 0 #18181b,
        0 4px 8px rgba(24, 24, 27, 0.4);
}

/* ========== DAILY TASKS & SHARING ========== */
.game-extras {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 8px;
    padding: 6px 12px;
    border: 1px solid var(--gray-light);
    border-radius: 12px;
    background: var(--bg-white);
}

.social-share {
    display: flex;
    flex: none;
    align-items: center;
    gap: 6px;
    margin-inline-start: auto;
}

.social-title {
    margin-inline-end: 4px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}

.social-btn {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 8px;
    background: var(--bg-white);
    color: var(--blue);
    cursor: pointer;
}

.social-btn svg {
    width: 20px;
    height: 20px;
}

.social-btn[data-network="whatsapp"] {
    color: var(--green);
}

:is(.social-btn[data-network="max"], .max-share-icon) {
    color: #6e1aff;
}

[data-theme="dark"] :is(.social-btn[data-network="max"], .max-share-icon) {
    color: #be9aff;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .social-btn {
        transition: transform 160ms ease, box-shadow 160ms ease;
    }

    .social-btn:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-soft);
    }
}

/* ========== FOOTER ========== */
.footer {
    background: var(--bg-white);
    border-top: 1px solid var(--gray-light);
    padding: 24px 0;
    margin-top: auto;
    position: sticky;
    bottom: 0;
    z-index: 90;
}

/* Keep the game footer in the page flow below the grid and keyboard. */
.game-page #main > .footer {
    position: relative;
    bottom: auto;
    align-self: stretch;
    width: 100%;
    max-width: 100%;
    margin-top: 24px;
    border-radius: 0;
}

@media (max-width: 1024px) {
    .footer {
        padding-block: 10px max(10px, env(safe-area-inset-bottom));
    }

    .footer .footer-brand {
        margin-bottom: 6px;
    }

    .footer .footer-left {
        font-size: 11px;
        line-height: 1.4;
    }

    .footer .footer-right {
        display: none;
    }

    .game-page #main > .footer {
        margin-top: 12px;
    }

}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-left, .footer-right {
    font-size: 14px;
    color: var(--text-muted);
}

.footer-right {
    margin-inline-start: auto;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
    color: var(--text-main);
    font-weight: 700;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--blue);
    text-decoration: underline;
}

/* ========== MODAL ========== */
.modal-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    --modal-top:clamp(16px,5vh,48px);
    align-items: flex-start;
    padding-block:var(--modal-top) 16px;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-bg.active {
    display: flex;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -120%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -120%) scale(1);
    }
}

@keyframes gentlePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 4px 16px rgba(59, 130, 246, 0.5);
    }
}@keyframes tooltipFadeOut {
    from {
        opacity: 1;
        transform: translate(-50%, -120%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -120%) scale(0.8);
    }
}

.modal {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: calc(100dvh - var(--modal-top,48px) - 16px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.2s;
}

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

.modal.modal-large {
    max-width: 700px;
}

.modal.modal-small {
    max-width: 420px;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
}

.modal-close {
    position: relative;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-main);
    font-size: 0;
    line-height: 0;
    cursor: pointer;
    transition: background-color .2s;
    -webkit-tap-highlight-color: transparent;
}
.modal-close::before, .modal-close::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 22px;
    height: 2px;
    border-radius: 1px;
    background: currentColor;
    transform: translate(-50%,-50%) rotate(45deg);
}
.modal-close::after { transform: translate(-50%,-50%) rotate(-45deg); }
.modal-close:is(:hover,:active) { background: var(--gray-light); }
.modal-close:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.confirm-message {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-main);
    text-align: center;
    margin: 0;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--gray-light);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.rules-content > * + * {
    margin-top: 10px;
}

.rules-legend {
    display: grid;
    gap: 6px;
    list-style: none;
}

.rules-legend li,
.tutorial-widget-preference {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rules-color {
    flex: 0 0 20px;
    height: 20px;
    border-radius: 4px;
}

.rules-color-correct { background: var(--tile-correct); }
.rules-color-present { background: var(--tile-present); }
.rules-color-absent { background: var(--tile-absent); }

.rules-faq {
    display: inline-block;
    color: var(--blue);
    text-decoration: underline;
}

.tutorial-widget-preference {
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
}

@media (max-width: 1024px) {
    .rules-content .tutorial-widget-preference {
        display: none;
    }
    .modal-bg {
        height: 100dvh;
        padding:0;
    }

    .modal-bg > .modal {
        width: 100%;
        max-width: none;
        height: 100%;
        max-height: none;
        padding: 0;
        border-radius: 0;
    }

    .modal-header {
        flex: none;
        gap: 10px;
        padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 12px max(12px, env(safe-area-inset-left));
        overflow-wrap: anywhere;
    }

    .modal-header .modal-close {
        flex-basis: 48px;
        align-self: center;
        width: 48px;
        height: 48px;
        margin-inline-start: auto;
    }

    .modal-body {
        min-height: 0;
        padding: 16px;
        overscroll-behavior: contain;
    }

    .modal-footer {
        flex: none;
        padding: 12px 16px max(12px, env(safe-area-inset-bottom));
    }
}

/* ========== BUTTONS ========== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--blue);
    color: white;
}

.btn-primary:hover {
    background: var(--blue-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-light);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: var(--gray);
}

.btn-danger {
    background: var(--red);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-block {
    width: 100%;
}

/* ========== FORMS ========== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-input, .setting-select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray);
    border-radius: 8px;
    background: var(--bg-main);
    color: var(--text-main);
    font-size: 14px;
    transition: all 0.2s;
}

.form-input:focus, .setting-select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-help {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.form-divider {
    height: 1px;
    background: var(--gray-light);
    margin: 20px 0;
}

.form-links {
    margin-top: 12px;
    text-align: center;
}

.form-links a {
    color: var(--blue);
    font-size: 13px;
}

.form-links a:hover {
    text-decoration: underline;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-label .required {
    color: var(--red);
    margin-left: 2px;
}

.form-select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray);
    border-radius: 8px;
    background: var(--bg-main);
    color: var(--text-main);
    font-size: 14px;
    transition: all 0.2s;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray);
    border-radius: 8px;
    background: var(--bg-main);
    color: var(--text-main);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    transition: all 0.2s;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea::placeholder,
.form-input::placeholder,
.form-select::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

.modal-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
    padding: 12px;
    background: var(--gray-light);
    border-radius: 8px;
    border-left: 3px solid var(--blue);
}

.form-note {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 12px;
}

/* ========== SETTINGS ========== */
.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-item-full {
    grid-column: 1 / -1;
}

.setting-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.setting-name {
}

.setting-description {
    color: var(--text-muted);
    font-size: 13px;
}

.setting-value {
    color: var(--blue);
    font-size: 16px;
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--gray-light);
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--blue);
    cursor: pointer;
    box-shadow: var(--shadow-soft);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--blue);
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-soft);
}

.btn-group {
    display: flex;
    gap: 8px;
}

.btn-group-item {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--gray);
    background: var(--bg-white);
    color: var(--text-main);
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-group-item:hover {
    border-color: var(--blue);
}

.btn-group-item.active {
    background: var(--blue);
    color: white;
    border-color: var(--blue);
}

/* Pills для настроек (кнопки с числами и опциями) */
.btn-group-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-group-pills .pill {
    padding: 6px 12px;
    border: 2px solid var(--gray);
    background: var(--bg-white);
    color: var(--text-main);
    font-size: 13px;
    font-weight: 500;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 42px;
    text-align: center;
}

.btn-group-pills .pill:hover {
    border-color: var(--blue);
    background: rgba(59, 130, 246, 0.05);
}

.btn-group-pills .pill.active {
    background: var(--blue);
    color: white;
    border-color: var(--blue);
}

.setting-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.setting-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ========== AUTH TABS ========== */
.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--gray);
}

.auth-tab {
    flex: 1;
    min-height: 44px;
    padding: 8px 4px;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.auth-tab.active {
    border-bottom-color: var(--blue);
    color: var(--blue);
    font-weight: 700;
}

/* ========== STATS ========== */
.stats-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: var(--gray-light);
    padding: 4px;
    border-radius: 10px;
}

.stats-tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.stats-tab.active {
    background: var(--blue);
    color: white;
}

.stats-content {
    animation: fadeIn 0.3s ease-in-out;
}

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

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

.stat-card {
    background: linear-gradient(135deg, var(--gray-light) 0%, var(--bg-white) 100%);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--gray-light);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--blue) 0%, #3b82f6 100%);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--blue);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-icon {
    font-size: 24px;
    margin-bottom: 8px;
    opacity: 0.7;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 8px;
    line-height: 1;
}

.stat-value.stat-positive {
    color: var(--green);
}

.stat-value.stat-word {
    font-size: 20px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.stat-value.stat-warning {
    color: var(--yellow);
}

.stat-value.stat-negative {
    color: var(--red);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-subvalue {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 4px;
}

/* Progress bar для винрейта */
.stat-progress {
    width: 100%;
    height: 6px;
    background: var(--gray-light);
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.stat-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--blue) 0%, #3b82f6 100%);
    border-radius: 3px;
    transition: width 0.6s ease-out;
}

.stat-progress-bar.progress-high {
    background: linear-gradient(90deg, var(--green) 0%, #22c55e 100%);
}

.stat-progress-bar.progress-medium {
    background: linear-gradient(90deg, var(--yellow) 0%, #fbbf24 100%);
}

.stat-progress-bar.progress-low {
    background: linear-gradient(90deg, var(--red) 0%, #ef4444 100%);
}

/* Распределение попыток */
.attempts-distribution {
    margin-top: 24px;
    padding: 20px;
    background: var(--gray-light);
    border-radius: 12px;
}

.attempts-distribution-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 16px;
    text-align: center;
}

.attempts-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.attempt-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.attempt-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    min-width: 80px;
}

.attempt-progress {
    flex: 1;
    height: 32px;
    background: var(--bg-white);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.attempt-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue) 0%, #3b82f6 100%);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    transition: width 0.6s ease-out;
    min-width: 40px;
}

.attempt-count {
    min-width: 40px;
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

/* История игр */
.game-history {
    margin-top: 24px;
}

.game-history-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 16px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--gray-light);
    border-radius: 10px;
    border-left: 4px solid var(--blue);
    transition: all 0.2s;
}

.history-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-soft);
}

.history-item.history-win {
    border-left-color: var(--green);
}

.history-item.history-loss {
    border-left-color: var(--red);
}

.history-info {
    flex: 1;
}

.history-word {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.history-details {
    font-size: 12px;
    color: var(--text-muted);
}

.history-score {
    font-size: 20px;
    font-weight: 700;
    color: var(--blue);
    text-align: right;
}

.history-score.score-win {
    color: var(--green);
}

.history-score.score-loss {
    color: var(--red);
}

.stats-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.stats-filter-select {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--gray);
    border-radius: 8px;
    background: var(--bg-main);
    color: var(--text-main);
    font-size: 14px;
}

.stats-detailed-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Детальные карточки статистики */
.detailed-stat-card {
    background: var(--bg-white);
    border: 1px solid var(--gray-light);
    border-radius: 10px;
    padding: 16px;
    transition: all 0.2s;
}

.detailed-stat-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--blue);
}

.detailed-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.detailed-stat-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
}

.detailed-stat-badge {
    padding: 4px 10px;
    background: var(--blue);
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.detailed-stat-body {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.detailed-stat-item {
    text-align: center;
}

.detailed-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--blue);
}

.detailed-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Пустое состояние */
.stats-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.stats-empty-icon {
    font-size: 64px;
    opacity: 0.3;
    margin-bottom: 16px;
}

.stats-empty-text {
    font-size: 16px;
    font-weight: 500;
}

/* ========== PROFILE ========== */
.profile-avatar-section {
    text-align: center;
    margin-bottom: 24px;
}

.profile-avatar-preview {
    width: 100px;
    height: 100px;
    margin: 0 auto 16px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--gray-light);
}

.profile-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: var(--gray-light);
}

/* ========== RESULT MODAL ========== */
.saved-words {
    margin-bottom: 16px;
    padding: 12px;
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    background: var(--bg-main);
}

.saved-words summary {
    font-weight: 700;
    cursor: pointer;
}

.saved-words-status {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 13px;
}

.saved-words-status:empty,
.saved-words-more[hidden] {
    display: none;
}

.saved-words-list {
    list-style: none;
    overflow-wrap: anywhere;
}

.saved-words-list li {
    padding-block: 8px;
}

.saved-words-list li + li {
    border-top: 1px solid var(--gray);
}

.saved-words-list small {
    margin-inline-start: 8px;
    color: var(--text-muted);
}

.saved-words-list p {
    font-size: 14px;
}

.save-word {
    margin-block: 10px;
}

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

.result-word {
    margin-bottom: 12px;
}

.result-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-right: 8px;
}

.result-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--blue);
}

.result-translation {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.result-stats {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin-top: 24px;
}

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

.result-stat-label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.result-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
}

.result-points {
    color: var(--green);
}

/* ========== RESPONSIVE ========== */

/* Desktop - виртуальная клавиатура работает */
@media (min-width: 1025px) {
    .mobile-keyboard-input,
    .mobile-menu-actions {
        display: none !important;
    }
}

/* Планшеты и мобильные устройства */
@media (max-width: 1024px) {
    /* ====== ПОКАЗЫВАЕМ МОБИЛЬНЫЕ ЭЛЕМЕНТЫ ====== */
    .hamburger-btn {
        display: flex;
        flex-shrink: 0;
    }

    .mobile-account-btn {
        display: inline-flex;
        flex-shrink: 0;
        align-items: center;
        justify-content: center;
        gap: 5px;
        min-height: 44px;
        padding: 0 9px;
        border: 1px solid var(--blue);
        border-radius: 8px;
        background: var(--bg-white);
        color: var(--blue);
        font: inherit;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
    }

    .game-toolbar {
        column-gap: 6px;
        padding: 6px 8px;
    }

    .game-settings-summary {
        font-size: 12px;
    }

    .game-toolbar-btn {
        width: 44px;
        min-height: 44px;
        padding: 0;
    }

    .game-toolbar-label,
    .social-title {
        display: none;
    }

    .game-extras {
        gap: 8px;
        padding-inline: 8px;
    }

    .game-extras .daily-challenges {
        font-size: 14px;
    }

    .social-share {
        gap: 4px;
    }

    /* ====== СКРЫВАЕМ DESKTOP ЭЛЕМЕНТЫ ====== */
    /* Узкая шапка до проверки ширины элементов. */
    #main:not([data-header-layout]) .header {
        display: none;
    }

    /* Скрываем desktop меню */
    .user-menu {
        display: none !important;
    }

    /* Скрываем блоки, которые не нужны на мобильных */
    .game-left,  /* Маскот, таймер, очки будут показаны отдельно */
    .translations-card,  /* Переводы */
    .feedback-card {  /* Давайте сделаем игру лучше */
        display: none !important;
    }

    /* ====== МОБИЛЬНАЯ СТРУКТУРА ====== */
    /* Убираем ограничения высоты, позволяем нормальную прокрутку */
    body {
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .wrapper {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    /* Логотип, профиль и мобильное меню */
    .top-bar {
        padding: var(--logo-inset) 0;
        position: relative;
        box-shadow: none;
    }

    .top-bar-inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        gap: 16px;
    }

    .logo {
        flex: 1;
        min-width: 0;
    }

    .logo a {
        display: block;
        max-width: 100%;
    }

    .logo-svg {
        display: block;
        width: 100%;
        max-width: 240px;
        height: auto;
    }

    .game-container {
        --game-board-gap: 16px;
    }

    .game-layout {
        display: flex;
        flex-direction: column;
        gap: var(--game-board-gap);
        align-items: center;
    }

    /* 3.1. СЕТКА - первый элемент, центрирована */
    .game-center {
        order: 1;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        position: static; /* Убираем sticky positioning на мобильных */
    }

    /* On mobile both cards in this column are hidden. */
    .game-right {
        display: none !important;
    }

    /* GRID: оптимизируем размер ячеек */
    .game-grid {
        padding: 12px;
        gap: 6px;
        margin: 0 auto;
        width: fit-content; /* Сетка занимает только необходимое пространство */
    }

    .grid-row {
        gap: 6px;
    }

    /* Размеры для 4-5 букв */
    .cell {
        width: 50px;
        height: 50px;
        font-size: 24px;
        border-width: 2px;
    }

    /* Размеры для 6-7 букв */
    .game-grid[data-word-length="6"] .cell,
    .game-grid[data-word-length="7"] .cell {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    /* Размеры для 8-9 букв */
    .game-grid[data-word-length="8"] .cell,
    .game-grid[data-word-length="9"] .cell {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .keyboard-container {
        padding-bottom: 20px;
    }

    #gameKeyboard .keyboard {
        width: 100%;
        max-width: 540px;
    }

    #gameKeyboard .key {
        min-width: 0;
        flex: 1 1 0;
        max-width: 42px;
        padding: 0;
    }

    #gameKeyboard .key:is(.key-backspace, .key-enter) {
        flex-grow: 2;
        max-width: 80px;
    }

    #gameKeyboard .key-label {
        display: none;
    }

    /* Скрытое поле для нативной клавиатуры на мобильных */
    .mobile-keyboard-input {
        position: absolute;
        left: -9999px;
        width: 1px;
        height: 1px;
        opacity: 0;
        pointer-events: none;
        font-size: 16px; /* Предотвращает зум на iOS */
    }

    /* Индикатор языка клавиатуры для мобильных */
    .mobile-keyboard-lang-indicator {
        display: block;
        text-align: center;
        font-size: 14px;
        font-weight: 600;
        color: var(--blue);
        padding: 10px 16px;
        background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(59, 130, 246, 0.15));
        border-radius: 10px;
        border: 2px solid var(--blue);
        box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
    }

    .mobile-keyboard-lang-indicator .lang-icon {
        font-size: 18px;
        margin-right: 8px;
    }

    .mobile-keyboard-lang-indicator .lang-text {
        vertical-align: middle;
    }

    .keyboard {
        max-width: 100%;
        gap: 5px;
        width: fit-content; /* Клавиатура занимает только необходимое пространство */
    }

    .keyboard-row {
        gap: 4px;
        justify-content: center;
    }

    .key {
        min-width: 34px;
        height: 48px;
        font-size: 13px;
    }

    .key.key-backspace, .key.key-enter {
        min-width: 60px;
        font-size: 14px;
    }

    /* 5. ТАЙМЕР И ОЧКИ - показываем как отдельные блоки через CSS Grid */
    .game-left {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        order: 4;
        width: 100%;
    }

    /* Маскот скрываем на mobile */
    .game-left .mascot-card {
        display: none;
    }

    /* Таймер занимает левую ячейку */
    .game-left .timer-card {
        grid-column: 1 / 2;
    }

    /* Скрываем надпись "Время раунда" на мобильных */
    .timer-label {
        display: none;
    }

    .game-left .score-card {
        grid-column: 1 / -1;
    }

    /* CARDS: компактные карточки */
    .mascot-card, .timer-card, .score-card {
        padding: 12px;
    }

    /* Подсказки на мобильных - компактный блок справа от таймера */
    /* Показывается только если в игре есть подсказки */
    .hints-container {
        grid-column: 2 / 3;
        margin-top: 0;
        background: var(--bg-white);
        border-radius: var(--radius);
        padding: 12px;
        box-shadow: var(--shadow-md);
        /* display управляется через JS - по умолчанию display: none в HTML */
        flex-direction: column;
        justify-content: center;
        gap: 8px;
        height: auto;
        max-height: 120px;
        min-height: 80px;
    }

    /* Когда игра началась, показываем блок */
    .hints-container.game-started {
        display: flex !important;
    }

    /* Если подсказок нет (скрыт через JS), таймер занимает всю ширину */
    .game-left:not(:has(.hints-container:not([style*="display: none"]))) .timer-card,
    .game-left:has(.hints-container[style*="display: none"]) .timer-card {
        grid-column: 1 / -1;
    }

    /* Скрываем заголовок подсказок на мобильных */
    .hints-container .hints-toggle {
        display: none !important;
    }

    /* Показываем панель подсказок сразу без toggle */
    .hints-container .hints-panel {
        display: flex !important;
        margin-top: 0;
        padding: 0;
        background: transparent;
        box-shadow: none;
        animation: none;
        gap: 8px;
    }

    /* Компактная кнопка подсказки */
    .hints-container .btn-hint {
        padding: 8px 12px;
        font-size: 13px;
        width: 100%;
    }

    /* Компактная информация о подсказках */
    .hints-container .hints-info {
        font-size: 12px;
    }

    .mascot-avatar {
        width: 50px;
        height: 50px;
    }

    .mascot-emoji {
        font-size: 30px;
    }

    .timer-display {
        font-size: 20px;
        margin-bottom: 8px;
    }

    /* Основное действие удобно нажимать большим пальцем. */
    #reloadGameBtn, #cup-start, #newGameBtn {
        min-height: 60px;
        padding: 16px 20px;
        font-size: 18px;
        margin-top: 0;
    }

    .btn-give-up,
    .btn-start-game {
        font-size: 13px;
        padding: 8px;
        margin-top: 6px;
    }

    .score-value {
        font-size: 18px;
    }

    /* MODALS */
    .settings-row {
        grid-template-columns: 1fr;
    }

    .modal {
        width: 95%;
        max-width: 480px;
    }
}

/* Мобильные устройства */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    /* TOP BAR: еще компактнее */
    .logo-svg {
        max-width: 240px !important;
    }

    .hamburger-btn {
        width: 28px;
        height: 20px;
    }

    .hamburger-line {
        height: 2.5px;
    }

    /* GRID: еще компактнее */
    .game-grid {
        padding: 10px;
        gap: 5px;
    }

    .grid-row {
        gap: 5px;
    }

    /* Размеры для 4-5 букв */
    .cell {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }

    /* Размеры для 6-7 букв */
    .game-grid[data-word-length="6"] .cell,
    .game-grid[data-word-length="7"] .cell {
        width: 36px;
        height: 36px;
        font-size: 17px;
    }

    /* Размеры для 8-9 букв */
    .game-grid[data-word-length="8"] .cell,
    .game-grid[data-word-length="9"] .cell {
        width: 32px;
        height: 32px;
        font-size: 15px;
    }

    /* KEYBOARD: компактная клавиатура */
    .keyboard-container {
        padding-bottom: 16px;
    }

    .keyboard {
        gap: 4px;
    }

    .keyboard-row {
        gap: 3px;
    }

    .key {
        min-width: 28px;
        height: 44px;
        font-size: 12px;
        padding: 0 4px;
    }

    .key.key-backspace, .key.key-enter {
        min-width: 50px;
        font-size: 12px;
        padding: 5px 6px;
    }

    .key-label {
        font-size: 9px;
    }

    /* CARDS */
    .timer-card, .score-card {
        padding: 10px;
    }

    .timer-display {
        font-size: 18px;
        margin-bottom: 6px;
    }

    .btn-give-up,
    .btn-start-game {
        font-size: 12px;
        padding: 7px;
    }

    .score-value {
        font-size: 16px;
    }

    .score-label {
        font-size: 11px;
    }

    /* MODALS */
    .modal {
        width: 95%;
        padding: 16px;
        max-height: 92vh;
    }

    .modal-header h2 {
        font-size: 18px;
    }

    /* MOBILE MENU */
    .mobile-menu {
        width: 90%;
    }
}
        gap: 6px;
    }

    .grid-row {
        gap: 6px;
    }

    /* Размеры для 4-5 букв */
    .cell {
        width: 45px;
        height: 45px;
        font-size: 22px;
        border-width: 2px;
    }

    /* Размеры для 6-7 букв */
    .game-grid[data-word-length="6"] .cell,
    .game-grid[data-word-length="7"] .cell {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    /* Размеры для 8-9 букв */
    .game-grid[data-word-length="8"] .cell,
    .game-grid[data-word-length="9"] .cell {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }

    /* KEYBOARD: оптимизация для маленьких экранов */
    .keyboard-container {
        padding-bottom: 16px;
    }

    .keyboard {
        gap: 5px;
    }

    .keyboard-row {
        gap: 3px;
    }

    .key {
        min-width: 30px;
        height: 46px;
        font-size: 12px;
        padding: 0 5px;
    }

    .key.key-backspace, .key.key-enter {
        min-width: 55px;
        font-size: 13px;
        padding: 6px 8px;
    }

    .key-label {
        font-size: 10px;
    }

    /* CARDS */
    .mascot-card, .timer-card, .score-card {
        padding: 12px;
    }

    .mascot-avatar {
        width: 60px;
        height: 60px;
    }

    .mascot-emoji {
        font-size: 36px;
    }

    .timer-display {
        font-size: 24px;
    }

    .score-value {
        font-size: 20px;
    }

    /* MODALS */
    .modal {
        width: 95%;
        max-height: 90vh;
        padding: 20px;
    }

    .modal-header h2 {
        font-size: 20px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 360px) {
    /* Минимальные размеры для корректной работы */
    .cell {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .game-grid[data-word-length="6"] .cell,
    .game-grid[data-word-length="7"] .cell {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .game-grid[data-word-length="8"] .cell,
    .game-grid[data-word-length="9"] .cell {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .key {
        min-width: 26px;
        height: 42px;
        font-size: 11px;
    }

    .key.key-backspace, .key.key-enter {
        min-width: 48px;
    }
}

/* Ландшафтная ориентация на мобильных */
@media (max-height: 600px) and (orientation: landscape) {
    .game-container {
        --game-board-gap: 12px;
    }

    .game-grid {
        padding: 10px;
    }

    .keyboard-container {
        padding-bottom: 16px;
    }

    .mascot-card, .timer-card, .score-card {
        padding: 10px;
        min-height: 80px;
        max-height: 120px;
    }

    /* Компактная сетка для экономии места */
    .game-left {
        flex-direction: row;
        gap: 10px;
    }

    .mascot-card, .timer-card, .score-card {
        flex: 1;
    }
}

/* ========== MOBILE QUICK ACCESS MENU ========== */
/* Кнопка быстрого доступа для мобильных устройств */
.mobile-quick-menu {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.quick-menu-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue) 0%, #1d4ed8 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s;
}

.quick-menu-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.5);
}

.quick-menu-btn:active {
    transform: scale(0.95);
}

.quick-menu-panel {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 8px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-menu-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.quick-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.quick-menu-item:hover {
    background: var(--gray-light);
}

.quick-menu-item .btn-icon {
    font-size: 20px;
}

@media (max-width: 1024px) {
    .mobile-quick-menu {
        display: block;
    }
}

@media (max-width: 480px) {
    .mobile-quick-menu {
        bottom: 15px;
        right: 15px;
    }

    .quick-menu-btn {
        width: 52px;
        height: 52px;
        font-size: 22px;
    }
}

/* ========== INFO CONTENT ========== */
.info-content {
    line-height: 1.8;
}

.info-content h3 {
    font-size: 18px;
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--text-main);
}

.info-content p {
    margin-bottom: 12px;
    color: var(--text-muted);
}

.info-content ul {
    margin: 12px 0;
    padding-left: 24px;
}

.info-content li {
    margin-bottom: 8px;
    color: var(--text-muted);
}

.info-content strong {
    color: var(--text-main);
}

/* ========== УТИЛИТЫ ========== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }

/* ========== УВЕДОМЛЕНИЯ ========== */
.notification {
    position: fixed;
    top: 300px;
    left:49%;
    transform: translateX(-50%) translateY(-100px);
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
    min-width: 280px;
    text-align: center;
}

.dictionary-source-link {
    color: inherit;
    text-decoration: underline;
    white-space: nowrap;
}

.notification:has(.dictionary-source-link) {
    min-width: 0;
    max-width: min(480px, calc(100vw - 24px));
}

.notification .dictionary-source-link {
    pointer-events: auto;
}

.notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.notification-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.notification-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.notification-error {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: #1f2937;
    font-weight: 700;
}

.notification-success {
    background: linear-gradient(135deg, #13f1fc 0%, #0470dc 100%);
    color: white;
}

/* ==================== INTERACTIVE TUTORIAL ==================== */

#main.tutorial-running {
    overflow-anchor: none;
}

/* Оверлей туториала - НЕ блокирует видимость */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9998;
    display: none;
}

.tutorial-overlay.active {
    display: block;
}

/* Подсветка элемента с затемнением вокруг через box-shadow */
.tutorial-spotlight {
    position: fixed;
    border: 3px solid #3b82f6;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.75),
                0 0 40px rgba(59, 130, 246, 0.8),
                inset 0 0 20px rgba(59, 130, 246, 0.3);
    z-index: 9999;
    pointer-events: none;
    animation: spotlight-pulse 2s ease-in-out infinite;
}

/* В темной теме делаем затемнение светлее, чтобы сайт был виден */
[data-theme="dark"] .tutorial-spotlight {
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5),
                0 0 40px rgba(59, 130, 246, 0.8),
                inset 0 0 20px rgba(59, 130, 246, 0.3);
}

@keyframes spotlight-pulse {
    0%, 100% {
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.75),
                    0 0 40px rgba(59, 130, 246, 0.8),
                    inset 0 0 20px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.75),
                    0 0 60px rgba(59, 130, 246, 1),
                    inset 0 0 30px rgba(59, 130, 246, 0.5);
    }
}

/* В темной теме анимация с более светлым затемнением */
[data-theme="dark"] .tutorial-spotlight {
    animation: spotlight-pulse-dark 2s ease-in-out infinite;
}

@keyframes spotlight-pulse-dark {
    0%, 100% {
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5),
                    0 0 40px rgba(59, 130, 246, 0.8),
                    inset 0 0 20px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5),
                    0 0 60px rgba(59, 130, 246, 1),
                    inset 0 0 30px rgba(59, 130, 246, 0.5);
    }
}

/* Окно подсказки туториала */
.tutorial-tooltip {
    position: fixed;
    background: var(--bg-white);
    border-radius: 16px;
    padding: clamp(12px, 3vw, 24px);
    max-width: 400px;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    display: none;
    animation: tutorial-tooltip-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
}

.tutorial-tooltip.active {
    display: block;
}

@keyframes tutorial-tooltip-in {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.tutorial-tooltip-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.tutorial-tooltip-icon {
    font-size: 32px;
}

.tutorial-tooltip-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    flex: 1;
}

.tutorial-tooltip-step {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--gray-light);
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.tutorial-tooltip-content {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.tutorial-tooltip-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tutorial-progress {
    display: flex;
    gap: 6px;
    flex: 1;
}

.tutorial-progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-light);
    transition: all 0.3s;
}

[data-theme="dark"] .tutorial-progress-dot {
    background: #9ca3af;
}

.tutorial-progress-dot.active {
    background: var(--blue);
    width: 24px;
    border-radius: 4px;
}

.tutorial-tooltip-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

.tutorial-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tutorial-btn-skip {
    background: var(--gray-light);
    color: var(--text-muted);
}

.tutorial-btn-skip:hover {
    background: var(--gray);
}

.tutorial-btn-back {
    background: var(--gray);
    color: var(--text-main);
}

.tutorial-btn-back:hover {
    background: #9ca3af;
    transform: translateY(-2px);
}

.tutorial-btn-next {
    background: var(--blue);
    color: white;
}

.tutorial-btn-next:hover {
    background: var(--blue-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.tutorial-btn-finish {
    background: var(--green);
    color: white;
}

.tutorial-btn-finish:hover {
    background: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

/* Кнопка запуска туториала (отключена, заменена на .help-button) */
.btn-tutorial {
    display: none !important; /* Скрыта, теперь используется .help-button */
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    transition: all 0.3s;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-tutorial:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.6);
}

.btn-tutorial.pulse {
    animation: tutorial-btn-pulse 2s ease-in-out infinite;
}

@keyframes tutorial-btn-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 32px rgba(102, 126, 234, 0.7);
    }
}

/* ========== НОВОГОДНЯЯ ТЕМА ========== */
.new-year-theme {
    position: relative;
}

/* Снежинки на фоне */
.new-year-theme::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background-image:
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 60%, white, transparent),
        radial-gradient(1px 1px at 33% 80%, white, transparent),
        radial-gradient(1px 1px at 66% 25%, white, transparent);
    background-size: 200px 200px, 300px 300px, 150px 150px, 250px 250px, 180px 180px, 220px 220px, 280px 280px;
    animation: snowfall 20s linear infinite;
    opacity: 0.6;
    z-index: -1;
}

@keyframes snowfall {
    from {
        background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
    }
    to {
        background-position: 0 200px, 0 300px, 0 150px, 0 250px, 0 180px, 0 220px, 0 280px;
    }
}

/* Новогодний градиент для игрового поля */
.new-year-theme .game-grid {
    background: linear-gradient(135deg,
        rgba(220, 38, 38, 0.05) 0%,
        rgba(34, 197, 94, 0.05) 50%,
        rgba(220, 38, 38, 0.05) 100%);
    border: 2px solid rgba(220, 38, 38, 0.2);
}

/* Праздничные цвета для правильных букв - оставляем зеленые, но с красноватым оттенком */
.new-year-theme .cell.tile-correct {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border-color: #15803d;
    box-shadow:
        0 6px 20px rgba(34, 197, 94, 0.5),
        0 0 15px rgba(220, 38, 38, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 0 3px rgba(34, 197, 94, 0.15);
}

.new-year-theme .cell.prefilled {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border-color: #15803d;
    box-shadow:
        0 6px 20px rgba(34, 197, 94, 0.5),
        0 0 15px rgba(220, 38, 38, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 0 3px rgba(34, 197, 94, 0.15);
}

/* Золотые акценты для желтых букв - оставляем желтые, добавляем золотистый блеск */
.new-year-theme .cell.tile-present {
    background: linear-gradient(135deg, #fde047 0%, #facc15 100%);
    border-color: #eab308;
    box-shadow:
        0 6px 20px rgba(253, 224, 71, 0.5),
        0 0 15px rgba(251, 191, 36, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 0 3px rgba(253, 224, 71, 0.15);
}

/* Праздничная клавиатура - сохраняем зеленый для правильных */
.new-year-theme .key.key-correct {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border-color: #15803d;
    box-shadow:
        0 4px 12px rgba(34, 197, 94, 0.4),
        0 0 10px rgba(220, 38, 38, 0.15);
}

/* Сохраняем желтый для букв не на месте */
.new-year-theme .key.key-present {
    background: linear-gradient(135deg, #fde047 0%, #facc15 100%);
    border-color: #eab308;
    box-shadow:
        0 4px 12px rgba(253, 224, 71, 0.4),
        0 0 10px rgba(251, 191, 36, 0.2);
}

/* Новогоднее свечение для кнопок */
.new-year-theme .btn-primary {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.new-year-theme .btn-primary:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4);
}

/* Новогодний header */
.new-year-theme .header {
    background: linear-gradient(135deg,
        rgba(220, 38, 38, 0.1) 0%,
        rgba(34, 197, 94, 0.1) 50%,
        rgba(220, 38, 38, 0.1) 100%);
    border-bottom: 2px solid rgba(220, 38, 38, 0.2);
}

/* Добавляем елочные украшения на логотип */
.new-year-theme .logo::before {
    content: '🎄';
    margin-right: 8px;
    font-size: 28px;
    animation: sway 3s ease-in-out infinite;
}

.new-year-theme .logo::after {
    content: '✨';
    margin-left: 8px;
    animation: sparkle 2s ease-in-out infinite;
}

/* Скрываем елочку на мобильных и планшетах */
@media (max-width: 1024px) {
    .new-year-theme .logo::before {
        display: none;
    }
}

@keyframes sway {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* Новогодние снежинки в углах */
.new-year-theme .game-container::before {
    content: '❄️';
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 32px;
    opacity: 0.3;
    animation: rotate 10s linear infinite;
}

.new-year-theme .game-container::after {
    content: '⛄';
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 32px;
    opacity: 0.3;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Новогодний шар у header-center */
.new-year-theme .header {
    position: relative;
}



/* Шар */
.new-year-theme .header::after {
    content: '';
    position: absolute;
    left: calc(33.33% + 150px - 40px);
    bottom: -90px;
    width: 60px;
    height: 90px;
    background-image: url('../images/bauble5.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    animation: baubleSwing 3s ease-in-out infinite;
    transform-origin: center top;
    z-index: 100;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

@keyframes baubleSwing {
    0%, 100% {
        transform: rotate(-4deg);
    }
    50% {
        transform: rotate(4deg);
    }
}

/* ========== IDEAS PAGE ========== */
.ideas-page {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.ideas-header {
    text-align: center;
    margin-bottom: 40px;
}

.ideas-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 12px 0;
}

.ideas-subtitle {
    font-size: 16px;
    color: var(--text-muted);
    margin: 0;
}

.ideas-filters {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    padding: 16px;
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--gray);
    border-radius: 6px;
    background: var(--bg-main);
    color: var(--text-main);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-select:focus {
    outline: none;
    border-color: var(--blue);
}

.ideas-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.idea-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.idea-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--blue);
}

.idea-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.idea-meta {
    display: flex;
    gap: 8px;
    align-items: center;
}

.idea-category {
    font-size: 12px;
    padding: 4px 10px;
    background: var(--gray-light);
    color: var(--text-muted);
    border-radius: 12px;
    font-weight: 500;
}

.idea-status {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.idea-status-approved {
    background: #d1fae5;
    color: #065f46;
}

.idea-status-in_progress {
    background: #dbeafe;
    color: #1e40af;
}

.idea-status-implemented {
    background: #fef3c7;
    color: #92400e;
}

.idea-status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

[data-theme="dark"] .idea-status-approved {
    background: #065f46;
    color: #d1fae5;
}

[data-theme="dark"] .idea-status-in_progress {
    background: #1e40af;
    color: #dbeafe;
}

[data-theme="dark"] .idea-status-implemented {
    background: #92400e;
    color: #fef3c7;
}

[data-theme="dark"] .idea-status-rejected {
    background: #991b1b;
    color: #fee2e2;
}

.idea-date {
    font-size: 13px;
    color: var(--text-light);
}

.idea-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 8px 0;
}

.idea-description {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0 0 16px 0;
}

.idea-admin-comment {
    background: var(--gray-light);
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid var(--blue);
    margin-bottom: 16px;
}

.idea-admin-comment strong {
    display: block;
    font-size: 12px;
    color: var(--blue);
    margin-bottom: 6px;
}

.idea-admin-comment p {
    font-size: 14px;
    color: var(--text-main);
    margin: 0;
}

.idea-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.idea-votes {
    display: flex;
    gap: 12px;
    align-items: center;
}

.vote-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--gray);
    border-radius: 6px;
    background: var(--bg-main);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.vote-btn svg {
    width: 18px;
    height: 18px;
}

.vote-btn:not(:disabled):hover {
    background: var(--gray-light);
    border-color: var(--blue);
}

.vote-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.vote-like.active {
    background: #d1fae5;
    border-color: #10b981;
    color: #065f46;
}

.vote-dislike.active {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

[data-theme="dark"] .vote-like.active {
    background: #065f46;
    border-color: #10b981;
    color: #d1fae5;
}

[data-theme="dark"] .vote-dislike.active {
    background: #991b1b;
    border-color: #ef4444;
    color: #fee2e2;
}

.vote-net {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    min-width: 40px;
    text-align: center;
}

.vote-net.positive {
    color: #10b981;
}

.vote-net.negative {
    color: #ef4444;
}

.ideas-submit-section {
    text-align: center;
    padding: 40px 0;
}

/* Пагинация */
.pagination-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px 0;
    margin-top: 24px;
    border-top: 1px solid var(--gray-light);
}

.pagination {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--bg-white);
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover:not(.active) {
    background: var(--bg-gray);
    border-color: var(--gray);
}

.pagination-btn.active {
    background: var(--blue);
    color: white;
    border-color: var(--blue);
}

.pagination-dots {
    padding: 0 4px;
    color: var(--text-muted);
}

.pagination-info {
    font-size: 13px;
    color: var(--text-muted);
}

.btn-submit-idea {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--blue) 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-submit-idea:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.submit-idea-icon {
    width: 20px;
    height: 20px;
}

.loading, .error, .no-ideas {
    text-align: center;
    padding: 60px 20px;
    font-size: 16px;
    color: var(--text-muted);
}

.error {
    color: var(--red);
}

/* ========== PUSH NOTIFICATIONS STYLES ========== */

/* Кнопка напоминаний */
.btn-reminder {
    position: relative;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-reminder.reminder-active {
    background: var(--gray-light);
    color: var(--text-main);
    border-color: var(--gray);
    box-shadow: none;
}
.btn-reminder.reminder-active::after { content: ''; width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--blue); }

.btn-reminder .reminder-text {
    color: inherit;
}

.btn-reminder.reminder-active:hover {
    background: var(--bg-white);
    border-color: var(--blue);
    transform: none;
    box-shadow: none;
}

/* Модальное окно напоминаний */
.modal-reminder {
    max-width: 580px;
}

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

.reminder-mascot {
    margin: 20px auto 10px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.reminder-subtitle {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main);
    margin: 15px 0 20px;
}

.reminder-message {
    margin: 25px 0;
}

.reminder-bubble {
    background: var(--bg-card);
    border: 2px solid var(--blue);
    border-radius: var(--radius);
    padding: 20px;
    text-align: left;
    box-shadow: var(--shadow-soft);
    position: relative;
}

.reminder-bubble::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid var(--blue);
}

.reminder-avatar {
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 8px;
    font-size: 16px;
}

.reminder-text {
    color: var(--text-main);
    line-height: 1.6;
    font-size: 15px;
}

.reminder-info {
    margin: 25px 0;
    padding: 20px;
    background: var(--gray-light);
    border-radius: var(--radius-sm);
}

.btn-info-toggle {
    background: transparent;
    border: none;
    color: var(--blue);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    font-size: 14px;
}

.btn-info-toggle:hover {
    background: rgba(37, 99, 235, 0.1);
}

.info-icon {
    font-size: 18px;
}

.reminder-info-content {
    margin-top: 15px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reminder-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.reminder-info-list li {
    padding: 10px 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.reminder-info-list li::before {
    content: attr(data-icon);
    flex-shrink: 0;
}

.reminder-status {
    margin: 20px 0;
    padding: 15px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray);
}

#reminderHour {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-main);
    font: inherit;
}

.reminder-status-text {
    font-size: 15px;
    color: var(--text-muted);
    font-weight: 500;
}

#reminderStatusText {
    font-weight: 700;
    font-size: 16px;
}

/* Toast уведомления для напоминаний */
.toast {
    animation: slideInRight 0.3s ease-out, slideOutRight 0.3s ease-out 2.7s;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Адаптивность для мобильных и планшетов */
@media (max-width: 1024px) {
    .btn-reminder .reminder-text {
        display: none;
    }

    .btn-reminder {
        padding: 8px 12px;
    }

    .modal-reminder {
        margin: 20px;
    }

    .reminder-bubble {
        padding: 15px;
    }

    .reminder-info-list li {
        font-size: 13px;
    }
}

/* ========== FAQ СТРАНИЦА ========== */
.faq-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.faq-intro {
    text-align: center;
    margin-bottom: 40px;
}

.faq-intro-text {
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1.7;
}

.faq-section {
    margin-bottom: 48px;
}

.faq-section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-light);
}

.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: var(--bg-white);
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all var(--transition);
}

.faq-item:hover {
    box-shadow: var(--shadow-soft);
}

.faq-item.active {
    border-color: var(--blue);
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    transition: background-color var(--transition);
}

.faq-question:hover {
    background: var(--bg-main);
}

.faq-item.active .faq-question {
    color: var(--blue);
}

.faq-icon {
    font-size: 24px;
    font-weight: 300;
    color: var(--text-muted);
    transition: transform var(--transition), color var(--transition);
    flex-shrink: 0;
    margin-left: 12px;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
    color: var(--blue);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 20px;
}

.faq-item.active .faq-answer {
    max-height: 1000px;
    padding: 0 20px 20px 20px;
}

.faq-answer p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-answer ul {
    margin: 12px 0;
    padding-left: 24px;
}

.faq-answer li {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.faq-answer strong {
    font-weight: 600;
    color: var(--text-main);
}

/* Адаптивность FAQ (мобильные и планшеты) */
@media (max-width: 1024px) {
    .faq-page {
        padding: 15px;
    }

    .faq-section-title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .faq-question {
        padding: 15px;
        font-size: 15px;
    }

    .faq-answer {
        padding: 0 15px;
    }

    .faq-item.active .faq-answer {
        padding: 0 15px 15px 15px;
    }

    .faq-answer p,
    .faq-answer li {
        font-size: 14px;
    }
}

/* ========== DESKTOP RESPONSIVE ========== */
/* Увеличенные размеры для больших мониторов (после всех mobile правил для приоритета) */
@media (min-width: 1025px) {
    /* Игровая сетка - увеличенные клетки */
    .cell {
        width: 90px !important;
        height: 90px !important;
        font-size: 46px !important;
        border-radius: 12px !important;
    }

    .game-grid[data-word-length="6"] .cell,
    .game-grid[data-word-length="7"] .cell {
        width: 82px !important;
        height: 82px !important;
        font-size: 42px !important;
    }

    .game-grid[data-word-length="8"] .cell,
    .game-grid[data-word-length="9"] .cell {
        width: 72px !important;
        height: 72px !important;
        font-size: 36px !important;
    }

    .game-grid {
        gap: 12px !important;
        padding: 30px !important;
    }

    .grid-row {
        gap: 12px !important;
    }

    /* Клавиатура - увеличенные клавиши */
    .keyboard {
        max-width: 900px !important;
        gap: 10px !important;
    }

    .keyboard-row {
        gap: 8px !important;
    }

    .key {
        min-width: 52px !important;
        height: 70px !important;
        padding: 0 10px !important;
        border-radius: 10px !important;
        font-size: 18px !important;
    }

    .key.key-backspace,
    .key.key-enter {
        min-width: 100px !important;
        font-size: 18px !important;
    }

    .key.key-backspace .key-icon,
    .key.key-enter .key-icon {
        font-size: 24px !important;
    }

    .key.key-backspace .key-label,
    .key.key-enter .key-label {
        font-size: 12px !important;
    }

    /* Разрешаем прокрутку на десктопе для размещения увеличенного контента */
    body {
        min-height: 100vh;
        height: auto !important;
        overflow-y: auto !important;
    }

    .wrapper {
        min-height: 100vh;
        height: auto !important;
    }

    .game-container {
        min-height: auto !important;
    }

    /* Увеличиваем отступы между секциями */
    .game-layout {
        gap: 40px !important;
        min-height: auto !important;
    }

    /* На десктопе hints-container остается под сеткой, все стили по умолчанию */
    .hints-container {
        grid-column: auto !important;
        grid-row: auto !important;
        margin-top: 20px !important;
        background: transparent !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    /* Показываем когда игра началась */
    .hints-container.game-started {
        display: flex !important;
    }

    .hints-container .hints-toggle {
        display: inline-block !important;
    }
}
