﻿/* 
 * Game Common Styles - "Simple & Solid" Theme (v3.2 - Layout Fixed)
 * Optimized for Cinsistency, Senior Accessibility, and Game-like Polish
 * STRICTLY NO GRADIENTS.
 */

:root {
    /* Color System - Solid & High Contrast */
    --primary-color: #2563eb;
    /* Royal Blue */
    --primary-dark: #1e3a8a;
    --primary-light: #eff6ff;

    --success-color: #16a34a;
    /* Green */
    --warning-color: #f59e0b;
    /* Amber */
    --danger-color: #dc2626;
    /* Red */

    --text-main: #111827;
    /* Near Black */
    --text-sub: #4b5563;
    /* Dark Gray */

    --bg-page: #f9fafb;
    /* Very light gray */
    --bg-card: #ffffff;
    /* Pure White */

    --border-color: #e5e7eb;

    /* Spacing & Sizing */
    --container-width: 1200px;
    --game-shell-max-width: 1120px;
    --game-stage-max-width: 860px;
    --game-tablet-height-budget: calc(100dvh - var(--header-height, 70px) - 56px - 32px);
    --btn-height: 60px;

    --radius-lg: 24px;
    --radius-md: 12px;

    /* Shadows & Effects */
    --shadow-card: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-game: 3px solid #e2e8f0;
}

/* 怨듯넻 ?ㅻ퉬寃뚯씠??諛?*/
.learning-topnav {
    position: sticky; top: var(--header-height, 70px); z-index: 100;
    margin-top: var(--header-height, 70px);
    background: #fff; border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.learning-topnav-inner {
    max-width: 1200px; margin: 0 auto; padding: 0 20px;
    display: flex; align-items: center; justify-content: space-between;
    height: 56px; gap: 12px;
}
.learning-topnav-back {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 16px; border-radius: 8px; font-size: 0.95rem; font-weight: 600;
    color: #374151; text-decoration: none; background: #f3f4f6; transition: all 0.15s;
    white-space: nowrap;
}
.learning-topnav-back:hover { background: #e5e7eb; color: #111827; }
.learning-topnav-back i { font-size: 0.85rem; }
.learning-topnav-title {
    font-size: 1.05rem; font-weight: 700; color: #111827; margin: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; flex: 1;
}
.learning-topnav-right { display: flex; align-items: center; gap: 8px; }
.learning-topnav-hub {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 8px; font-size: 0.9rem; font-weight: 600;
    color: #2563eb; text-decoration: none; background: #eff6ff; transition: all 0.15s;
    white-space: nowrap;
}
.learning-topnav-hub:hover { background: #dbeafe; }
@media (max-width: 600px) {
    .learning-topnav-inner { height: 48px; padding: 0 12px; }
    .learning-topnav-back span, .learning-topnav-hub span { display: none; }
    .learning-topnav-back, .learning-topnav-hub { padding: 8px 12px; }
    .learning-topnav-title { font-size: 0.95rem; }
}

/* Reset & Base */
body {
    background-color: var(--bg-page);
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
}

.learning-main {
    padding-top: 16px;
    padding-bottom: 2rem;
    padding-left: 0;
    padding-right: 0;
    min-height: calc(100vh - var(--header-height, 70px) - 56px);
    display: flex;
    justify-content: center;
    box-sizing: border-box;
}

/* Common Layout Containers - ?ㅻ뜑? ?숈씪??醫뚯슦 ?뺣젹 (max-width 1200px + padding 0 20px) */
.game-container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Standard Card Wrapper */
.game-content-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    padding: 1.5rem 2rem;
    border: 2px solid #e2e8f0;
    position: relative;
    overflow: visible;
    transition: box-shadow 0.3s ease;
    max-width: min(100%, var(--game-shell-max-width));
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}
.game-content-wrapper:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

/* Standard Header Section */
.game-header {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Back Button (Standard Flow) */
.header-left-btn {
    align-self: flex-start;
    margin-bottom: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.2rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-sub);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-left-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: translateX(-2px);
}

.game-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 0.3rem;
    letter-spacing: -0.02rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    line-height: 1.2;
    text-align: center;
}

.game-title i {
    color: var(--primary-color);
    background: var(--primary-light);
    padding: 0.45rem;
    border-radius: 10px;
    font-size: 1.3rem;
    box-shadow: 0 2px 8px rgba(37,99,235,0.12);
}

.game-subtitle {
    font-size: 0.95rem;
    color: var(--text-sub);
    margin: 0;
    font-weight: 500;
    text-align: center;
    line-height: 1.4;
}

/* Info Bar (Score, Time, Level) */
.info-bar {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    background: #f8fafc;
    padding: 0.6rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.info-item {
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid #f1f5f9;
    min-width: 90px;
}

.info-item i {
    color: var(--primary-color);
    font-size: 1.05rem;
}

/* Buttons */
.btn-group {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.game-btn {
    height: var(--btn-height);
    padding: 0 2rem;
    border-radius: var(--radius-md);
    font-size: 1.2rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    transition: all 0.1s ease;
    min-width: 150px;
    border-bottom: 4px solid rgba(0, 0, 0, 0.1);
}

.game-btn:hover {
    transform: translateY(-2px);
    filter: brightness(105%);
}

.game-btn:active {
    transform: translateY(2px);
    border-bottom-width: 0px;
    margin-bottom: 4px;
    /* Maintain layout on press */
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border-bottom: 4px solid #1d4ed8;
}

.btn-secondary {
    background-color: white;
    color: var(--text-main);
    border: 2px solid var(--border-color);
    border-bottom: 4px solid #d1d5db;
}

.btn-large-start {
    width: 100%;
    max-width: 340px;
    height: 58px;
    font-size: 1.3rem;
    background-color: var(--success-color);
    color: white;
    border-bottom: 5px solid #14532d;
    margin: 0.5rem auto;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 16px rgba(22,163,74,0.25);
    transition: all 0.15s ease;
}
.btn-large-start:hover {
    box-shadow: 0 6px 24px rgba(22,163,74,0.35);
    background-color: #15803d;
}
.btn-large-start:active {
    transform: translateY(3px);
    border-bottom-width: 2px;
    box-shadow: 0 2px 8px rgba(22,163,74,0.2);
}


/* Accessibility focus ring */
.game-btn:focus-visible,
.btn:focus-visible,
button:focus-visible,
select:focus-visible,
a:focus-visible,
.memory-card:focus-visible,
canvas:focus-visible {
    outline: 3px solid #0ea5e9;
    outline-offset: 3px;
}
/* Canvas Container */
.canvas-container {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
    position: relative;
    background: #f1f5f9;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 2px solid var(--border-color);
}

#gameCanvas {
    display: block;
    max-width: 100%;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.common-modal {
    background: white;
    width: 90%;
    max-width: 450px;
    border-radius: 28px;
    padding: 3rem 2.5rem;
    text-align: center;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.3);
    border: 3px solid var(--primary-light);
    animation: modalBounce 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalBounce {
    from { opacity: 0; transform: scale(0.85) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-icon {
    font-size: 4.5rem;
    display: block;
    margin-bottom: 1rem;
    animation: modalIconPop 0.5s 0.15s both;
}
@keyframes modalIconPop {
    from { transform: scale(0); }
    50% { transform: scale(1.2); }
    to { transform: scale(1); }
}

.modal-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.modal-message {
    font-size: 1.2rem;
    color: var(--text-sub);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Guide Box */
.guide-box {
    background: #f8fafc;
    border-radius: var(--radius-md);
    padding: 1rem 1.2rem;
    margin-top: 1rem;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
}

.guide-box h4 {
    color: var(--primary-dark);
    font-size: 1rem;
    margin-bottom: 0.3rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.guide-box p {
    color: var(--text-sub);
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Bottom Actions */
.bottom-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

.bottom-actions.with-sound-controls {
    justify-content: space-between;
}

.btn-back-bottom {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 2rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-sub);
    font-weight: 700;
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.btn-back-bottom:hover {
    background: #f3f4f6;
    color: var(--text-main);
    border-color: #cbd5e1;
}

/* Responsive */
@media (max-width: 1024px) {
    .header-left-btn {
        position: static;
        transform: none;
        margin-bottom: 1rem;
        width: 100%;
        justify-content: center;
    }

    .game-header {
        align-items: stretch;
    }

    .game-title {
        font-size: 2rem;
    }
}

/* 寃뚯엫 ?낆옣 ?좊땲硫붿씠??*/
.game-content-wrapper {
    animation: gameSlideIn 0.5s ease both;
}
@keyframes gameSlideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Info Bar ?レ옄 媛뺤“ */
.info-item span { color: var(--primary-color); }

/* ?쒖씠???좏깮湲?*/
.difficulty-selector {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.difficulty-btn {
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    background: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-sub);
}
.difficulty-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }
.difficulty-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(37,99,235,0.2);
}

@media (max-width: 600px) {
    .learning-main {
        padding-top: 16px;
        padding-left: 0;
        padding-right: 0;
    }
    .game-container {
        padding: 0 12px;
    }

    .game-content-wrapper {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .game-title {
        font-size: 1.6rem;
    }
    .game-subtitle {
        font-size: 1rem;
    }

    .header-left-btn {
        width: 100%;
        justify-content: center;
    }

    .btn-large-start {
        height: 62px;
        font-size: 1.3rem;
        max-width: 100%;
    }

    .info-bar {
        gap: 0.5rem;
    }

    .info-item {
        padding: 0.5rem 1rem;
        font-size: 1rem;
        min-width: auto;
        flex: 1;
    }

    .guide-box {
        padding: 1.2rem;
    }
}

/* Sound controls */
.sound-control-fab {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 1200;
    display: inline-flex;
    gap: 8px;
    padding: 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.95);
    border: 1px solid #dbeafe;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(6px);
}
.sound-control-fab .sound-btn {
    min-width: 44px;
    height: 44px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}
.sound-control-fab.is-muted .sound-btn {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #4b5563;
}

/* Reduced motion for accessibility and low-end devices */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Utility classes to replace inline styles */
.is-hidden { display: none !important; }
.is-hidden-inline { display: none; }
.inline-flex-gap-10 { display: flex; gap: 10px; }
.mt-1 { margin-top: 1rem !important; }
.mt-2 { margin-top: 2rem !important; }
.mt-3 { margin-top: 3rem !important; }
.ml-5 { margin-left: 5px !important; }
.text-primary-accent { color: var(--primary-color); }
.text-blue { color: #2563eb; }
.text-center { text-align: center; }
.center-mt-2 { text-align: center; margin-top: 2rem; }
.w-150 { width: 150px; }
.info-select-plain {
    border: none;
    font-weight: 700;
    font-size: 1.1rem;
    outline: none;
    color: inherit;
    background: transparent;
}
.guide-box-standard {
    background: var(--primary-light);
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 3rem;
}
.guide-title-standard {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
}
.guide-text-standard {
    margin: 0;
    color: var(--text-sub);
}
.btn-warning {
    background: #f59e0b !important;
    border-color: #d97706 !important;
}

/* Game toast */
.game-toast {
    position: fixed;
    left: 50%;
    bottom: 80px;
    transform: translateX(-50%);
    z-index: 1400;
    padding: 10px 16px;
    border-radius: 10px;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    opacity: 1;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.game-toast-info { background: #2563eb; }
.game-toast-success { background: #16a34a; }
.game-toast-error { background: #dc2626; }
.game-toast.leaving { opacity: 0; transform: translateX(-50%) translateY(8px); }

/* Shared UI components (2026 refresh) */
.game-panel {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.game-select {
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    padding: 0.45rem 0.7rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    background: #fff;
}

.game-select:focus-visible {
    outline: 3px solid #0ea5e9;
    outline-offset: 2px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 0.2rem 0.65rem;
    font-size: 0.9rem;
    font-weight: 700;
}

.status-pill.info {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.status-pill.success {
    color: #166534;
    background: #ecfdf5;
    border-color: #86efac;
}

.status-pill.warning {
    color: #92400e;
    background: #fffbeb;
    border-color: #fcd34d;
}

/* Unified viewport-fit baseline for desktop and tablet */
.game-content-wrapper,
.info-bar,
.btn-group,
.guide-box,
.bottom-actions {
    box-sizing: border-box;
}

@media (min-width: 768px) and (max-width: 1180px) {
    .learning-main {
        padding-top: 8px;
        padding-bottom: 10px;
    }

    .game-container {
        padding-left: 14px;
        padding-right: 14px;
    }

    .game-content-wrapper {
        padding: 1rem 1rem 0.9rem;
        border-radius: 20px;
    }

    .game-header {
        margin-bottom: 0.65rem;
    }

    .game-title {
        font-size: clamp(1.45rem, 2.6vw, 1.85rem);
        margin-bottom: 0.2rem;
    }

    .game-subtitle {
        font-size: 0.92rem;
    }

    .info-bar,
    .game-stats {
        margin-bottom: 0.55rem;
        gap: 0.45rem;
        padding: 0.45rem;
    }

    .info-item,
    .stat-item {
        min-height: 46px;
        padding: 0.42rem 0.8rem;
        font-size: 0.96rem;
    }

    .btn-group,
    .game-controls,
    .bottom-actions {
        margin-top: 0.55rem;
        gap: 0.55rem;
    }

    .game-btn,
    .btn,
    button,
    .difficulty-btn {
        min-height: 48px;
    }

    .guide-box,
    .guide-box-standard,
    .classic-guide-box {
        margin-top: 0.6rem;
        padding: 0.8rem 0.95rem;
    }

    .bottom-actions {
        padding-top: 0.55rem;
    }
}

@media (min-width: 1200px) {
    .game-content-wrapper {
        padding: 1.2rem 1.35rem 1rem;
    }

    .game-header {
        margin-bottom: 0.7rem;
    }

    .info-bar,
    .game-stats {
        margin-bottom: 0.65rem;
    }
}

/* Senior-first unified layout baseline */
.senior-unified {
    border: 2px solid #dbeafe;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.senior-unified .game-title {
    font-size: clamp(1.6rem, 2.2vw, 2.2rem);
}

.senior-unified .game-subtitle {
    font-size: clamp(1rem, 1.4vw, 1.15rem);
}

.senior-unified .game-play-section {
    border: 2px solid #dbeafe;
    border-radius: 18px;
    background: #f8fbff;
    padding: 0.9rem;
    margin-top: 0.35rem;
}

.senior-unified .game-help-section {
    margin-top: 0.9rem;
}

.senior-unified .game-list-section {
    margin-top: 0.75rem;
}

.senior-unified .info-item {
    min-height: 56px;
    font-size: 1.08rem;
    border-width: 2px;
}

.senior-unified .game-btn,
.senior-unified button,
.senior-unified .difficulty-btn {
    min-height: 58px;
}

.senior-unified .btn-group {
    gap: 0.7rem;
}

.senior-unified select {
    min-height: 48px;
    font-size: 1rem;
}

@media (min-width: 768px) and (max-width: 1180px) {
    .senior-unified .game-play-section {
        min-height: calc(100dvh - var(--header-height, 70px) - 56px - 120px);
    }

    .senior-unified .game-btn,
    .senior-unified button,
    .senior-unified .difficulty-btn {
        min-height: 54px;
    }

    .senior-unified .info-item {
        min-height: 50px;
        font-size: 1rem;
    }
}

/* Unified difficulty controls */
.difficulty-source-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.difficulty-unified {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.difficulty-unified .difficulty-btn {
    min-height: 52px;
    min-width: 128px;
    padding: 0.55rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 12px;
}

/* Vertical compaction to reduce unnecessary scrolling */
@media (min-width: 1200px) {
    .learning-main {
        padding-top: 10px;
        padding-bottom: 12px;
    }

    .senior-unified {
        padding: 1rem 1.1rem;
    }

    .senior-unified .game-header {
        margin-bottom: 0.65rem;
    }

    .senior-unified .game-subtitle {
        margin-bottom: 0;
    }

    .senior-unified .game-play-section {
        padding: 0.75rem;
    }

    .senior-unified .info-bar,
    .senior-unified .game-stats {
        margin-bottom: 0.6rem;
        gap: 0.45rem;
        padding: 0.45rem;
    }

    .senior-unified .info-item,
    .senior-unified .stat-item {
        min-height: 50px;
        font-size: 0.98rem;
        padding: 0.42rem 0.78rem;
    }

    .senior-unified .btn-group,
    .senior-unified .game-controls {
        margin-top: 0.6rem;
        gap: 0.6rem;
    }

    .senior-unified .game-btn,
    .senior-unified button,
    .senior-unified .difficulty-btn {
        min-height: 52px;
    }

    .senior-unified .guide-box {
        margin-top: 0.65rem;
        padding: 0.8rem 0.95rem;
    }

    .senior-unified .bottom-actions {
        margin-top: 0.45rem;
        padding-top: 0.55rem;
    }
}

@media (max-width: 700px) {
    .difficulty-unified .difficulty-btn {
        width: 100%;
        min-width: 0;
    }
}

/* Classic Table Theme for all learning games */
body.learning-classic-theme {
    background:
        radial-gradient(circle at 10% 8%, rgba(212, 175, 99, 0.18), transparent 30%),
        radial-gradient(circle at 90% 85%, rgba(212, 175, 99, 0.12), transparent 28%),
        linear-gradient(180deg, #0d251b 0%, #113325 58%, #0f2d21 100%);
}

body.learning-classic-theme .learning-topnav {
    background: #0e2219;
    border-bottom: 1px solid #304538;
    box-shadow: none;
}

body.learning-classic-theme .learning-topnav-title {
    color: #f7ecd2;
}

body.learning-classic-theme .learning-topnav-back,
body.learning-classic-theme .learning-topnav-hub {
    background: #1b3327;
    border: 1px solid #385746;
    color: #f7ecd2;
    border-radius: 999px;
}

body.learning-classic-theme .learning-topnav-back:hover,
body.learning-classic-theme .learning-topnav-hub:hover {
    background: #244436;
    color: #fff6e2;
}

body.learning-classic-theme .game-content-wrapper {
    background: linear-gradient(180deg, #faf3e3 0%, #f1e7cf 100%);
    border: 2px solid #9f8451;
    box-shadow: none;
}

body.learning-classic-theme .game-content-wrapper:hover {
    box-shadow: none;
}

body.learning-classic-theme .senior-unified {
    background: linear-gradient(180deg, #faf3e3 0%, #f1e7cf 100%);
    border-color: #9f8451;
    box-shadow: none;
}

body.learning-classic-theme .senior-unified .game-play-section {
    background: linear-gradient(180deg, #f7f0dc 0%, #efe4c8 100%);
    border-color: #b89b63;
}

body.learning-classic-theme .game-title {
    color: #253329;
}

body.learning-classic-theme .game-subtitle,
body.learning-classic-theme .guide-box p,
body.learning-classic-theme .info-item,
body.learning-classic-theme .stat-item {
    color: #4f5a49;
}

body.learning-classic-theme .game-title i {
    color: #715a2f;
    background: #f2e3bf;
    box-shadow: none;
}

body.learning-classic-theme .info-bar,
body.learning-classic-theme .game-stats {
    background: #f6ecca;
    border-color: #ccb27a;
}

body.learning-classic-theme .info-item,
body.learning-classic-theme .stat-item {
    background: #fff9e9;
    border-color: #d7bf8a;
}

body.learning-classic-theme .info-item i,
body.learning-classic-theme .stat-item i {
    color: #8c6d34;
}

body.learning-classic-theme .canvas-container {
    background: linear-gradient(180deg, #1f5f45 0%, #184e38 100%);
    border-color: #d2b57d;
}

body.learning-classic-theme .difficulty-btn {
    background: #fff8e8;
    color: #4f4c3b;
    border-color: #ccb07a;
}

body.learning-classic-theme .difficulty-btn:hover {
    border-color: #a48343;
    color: #3f3b2b;
}

body.learning-classic-theme .difficulty-btn.active {
    background: #1f5d45;
    border-color: #1f5d45;
    color: #f8edd1;
    box-shadow: none;
}

body.learning-classic-theme .btn-large-start,
body.learning-classic-theme .classic-start-btn {
    max-width: 340px;
    min-height: 48px;
    height: 48px;
    border-radius: 10px;
    padding: 0 18px;
    border: 1px solid #9b7839;
    border-bottom-width: 1px;
    background: linear-gradient(180deg, #d4af63 0%, #b08a45 100%);
    color: #1f2a22;
    box-shadow: none;
    font-size: 0.98rem;
    font-weight: 700;
}

body.learning-classic-theme .btn-large-start:hover,
body.learning-classic-theme .classic-start-btn:hover {
    background: linear-gradient(180deg, #e0bf7b 0%, #bb9550 100%);
    color: #18231b;
    box-shadow: none;
}

body.learning-classic-theme .btn-large-start:active,
body.learning-classic-theme .classic-start-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

body.learning-classic-theme .game-play-section {
    background: linear-gradient(180deg, #f7f0dc 0%, #efe4c8 100%);
    border: 1px solid #b89b63;
    border-radius: 14px;
}

body.learning-classic-theme .difficulty-selector,
body.learning-classic-theme .difficulty-unified {
    gap: 0.4rem;
    margin: 0.45rem auto 0.55rem;
}

body.learning-classic-theme .difficulty-selector .difficulty-btn,
body.learning-classic-theme .difficulty-unified .difficulty-btn {
    min-height: 44px;
    border-radius: 999px;
    border: 1px solid #cbb07a;
    background: #fff8e8;
    color: #4a4738;
    font-size: 0.88rem;
    font-weight: 700;
    box-shadow: none;
}

body.learning-classic-theme .difficulty-selector .difficulty-btn.active,
body.learning-classic-theme .difficulty-unified .difficulty-btn.active {
    background: #1f5d45;
    border-color: #1f5d45;
    color: #f7edd2;
}

body.learning-classic-theme .guide-box,
body.learning-classic-theme .guide-box-standard,
body.learning-classic-theme .classic-guide-box {
    max-width: 760px;
    margin: 0.75rem auto 0;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    border: 1px solid #ccb27a;
    background: #f7edd8;
    box-shadow: none;
}

body.learning-classic-theme .guide-box h4,
body.learning-classic-theme .guide-box-standard h4,
body.learning-classic-theme .guide-title-standard,
body.learning-classic-theme .classic-guide-box h4 {
    margin: 0 0 0.45rem;
    color: #4d583f;
}

body.learning-classic-theme .btn-group {
    margin-top: 0.6rem;
    gap: 0.6rem;
}

body.learning-classic-theme .game-play-section .info-bar,
body.learning-classic-theme .game-play-section .game-stats {
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 700px) {
    body.learning-classic-theme .btn-large-start,
    body.learning-classic-theme .classic-start-btn {
        width: 100%;
        max-width: 100%;
    }
}

body.learning-classic-theme .game-btn,
body.learning-classic-theme .btn {
    box-shadow: none;
}

body.learning-classic-theme .btn-primary {
    background: linear-gradient(180deg, #d2b06d 0%, #ae8743 100%);
    border-bottom-color: #8f6b34;
    color: #20261f;
}

body.learning-classic-theme .btn-secondary {
    background: #fff9ea;
    border-color: #cdb17a;
    border-bottom-color: #ad9260;
    color: #3f4636;
}

body.learning-classic-theme .guide-box {
    background: #fff8e8;
    border-color: #ccb27a;
    border-left-color: #9f7f46;
}

body.learning-classic-theme .guide-box h4 {
    color: #57492b;
}

body.learning-classic-theme .bottom-actions {
    border-top-color: #d2bc8c;
}

body.learning-classic-theme .btn-back-bottom {
    background: #1a3b2c;
    border-color: #365746;
    color: #f8edd1;
}

body.learning-classic-theme .btn-back-bottom:hover {
    background: #224936;
    color: #fff6e2;
}

/* Classic theme: top header on dark page background should be high contrast */
body.learning-classic-theme .game-container > .game-header .game-title {
    color: #f7ecd2;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

body.learning-classic-theme .game-container > .game-header .game-subtitle {
    color: #e6dbc1;
}

body.learning-classic-theme .game-container > .game-header .text-primary-accent {
    color: #e5c47b;
}

/* Fix: vertically center unified difficulty controls inside info-item */
.info-item .difficulty-selector,
.info-item .difficulty-unified {
    margin: 0 !important;
    align-items: center;
}

.info-item .difficulty-unified {
    display: inline-flex;
}

.info-item > .difficulty-source-hidden + .difficulty-unified {
    margin: 0 !important;
}

.game-toast-host {
    position: relative;
}

.game-toast-inline {
    position: absolute;
    top: 50%;
    left: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
    z-index: 1400;
    min-width: min(320px, calc(100% - 32px));
    max-width: calc(100% - 32px);
    text-align: center;
    pointer-events: none;
}

.game-toast-inline.leaving {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 8px));
}
