@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Inter:wght@300;400;600;700&family=Outfit:wght@500;700&display=swap');

:root {
    --panel-bg: rgba(255, 255, 255, 0.08);
    --panel-border: rgba(255, 255, 255, 0.2);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --board-light: #f1f5f9;
    --board-dark: #334155;
    --highlight: rgba(56, 189, 248, 0.4);
    --move-hint: rgba(255, 255, 255, 0.2);
    --accent: #38bdf8;
    --accent-hover: #0ea5e9;
    --danger: #f43f5e;
}

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

.external-link {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    font-family: 'Fredoka', cursive;
    font-size: 0.9rem;
    color: var(--text-primary);
    text-decoration: none;
    background: var(--panel-bg);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.3s ease;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3), inset 0 0 10px rgba(255,255,255,0.05);
}

.external-link:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    color: var(--accent);
    border-color: var(--accent);
}

body {
    font-family: 'Inter', sans-serif;
    /* Default fallback background */
    background: linear-gradient(135deg, #020617 0%, #0f172a 100%) center/cover no-repeat fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.4s ease;
}

/* Per-theme direct body backgrounds (CSS variables can't hold image URLs reliably) */
[data-theme="default"] body,
body[data-theme="default"] {
    background: url('cat_bg.jpg') center/cover no-repeat fixed, linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

[data-theme="pink"] body,
body[data-theme="pink"] {
    background: url('images/sakura.png') center/cover no-repeat fixed, linear-gradient(135deg, #fbcfe8 0%, #f472b6 100%);
}

[data-theme="space"] body,
body[data-theme="space"] {
    background: url('images/spacebg.jpg') center/cover no-repeat fixed, linear-gradient(135deg, #020617 0%, #1e1b4b 100%);
}

[data-theme="winter"] body,
body[data-theme="winter"] {
    background: url('images/sn2winter.jpg') center/cover no-repeat fixed, linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.game-wrapper {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border-radius: 32px;
    padding: 32px;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        inset 0 1px 1px rgba(255,255,255,0.1);
    max-width: 1200px;
    width: 95%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.header {
    text-align: center;
    margin-bottom: 32px;
    background: var(--panel-bg);
    padding: 16px 48px;
    border-radius: 16px;
    border: 2px solid var(--panel-border);
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
}

/* old header h1 removed */

.status {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.status.check {
    color: var(--danger);
    font-weight: 700;
}

.main-content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: center;
    align-items: flex-start;
}

.board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    width: min(80vw, 560px);
    height: min(80vw, 560px);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    border: 4px solid var(--panel-border);
    user-select: none;
    position: relative; /* Support for centered overlays */
}

.square {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: background-color 0.2s ease;
}

.square.light {
    background-color: var(--board-light);
}

.square.dark {
    background-color: var(--board-dark);
}

.square.highlight {
    background-color: var(--highlight) !important;
}

.square.premove {
    background-color: rgba(239, 68, 68, 0.6) !important;
}

.square.last-move {
    background-color: var(--last-move-color, rgba(251, 191, 36, 0.35)) !important;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.square.hint::after {
    content: '';
    position: absolute;
    width: 25%;
    height: 25%;
    background-color: var(--move-hint);
    border-radius: 50%;
}

.square.hint.capture-hint::after {
    width: 80%;
    height: 80%;
    background-color: transparent;
    border: 5px solid var(--move-hint);
    border-radius: 50%;
}

.square.drag-hover {
    box-shadow: inset 0 0 0 4px var(--accent-hover);
    opacity: 0.9;
}

.piece {
    width: 85%;
    height: 85%;
    z-index: 10;
    transition: transform 0.1s ease;
    filter: drop-shadow(0px 4px 6px rgba(0,0,0,0.3));
    user-select: none;
    -webkit-user-drag: element;
}


/* Base style for draggable */
.square:hover { filter: brightness(1.15); }
.piece { cursor: grab; transition: transform 0.1s; }
.piece:hover { transform: scale(1.08); }
.piece:active { cursor: grabbing; transform: scale(1.1); }
.piece.dragging { opacity: 0.1; }

.panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    max-width: 300px;
    position: relative;
}

.history {
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 16px;
    height: 300px;
    overflow-y: auto;
    border: 1px solid var(--panel-border);
}

.history h3 {
    margin-bottom: 12px;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
}

.history ul {
    list-style: none;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.history li {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.history li span.turn-num {
    color: #475569;
    width: 24px;
}
.history li span.move {
    flex: 1;
}

.controls {
    display: flex;
    gap: 8px; /* Slightly tighter gap for 3 buttons */
}

.btn {
    flex: 1;
    background: var(--accent);
    color: white;
    border: 3px solid #0f172a;
    padding: 10px 8px; /* Reduced vertical and horizontal padding */
    border-radius: 12px;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 0.95rem; /* Slightly smaller to fit RESTART */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 4px 0 #0f172a; /* Reduced shadow height */
    transition: transform 0.1s, box-shadow 0.1s, background 0.1s;
}

.btn:hover {
    background: var(--accent-hover);
    transform: translateY(2px);
    box-shadow: 0 4px 0 #0f172a;
}

.btn:active {
    transform: translateY(6px);
    box-shadow: 0 0px 0 #0f172a;
}

.theme-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.theme-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 3px solid rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 12px;
    font-family: 'Fredoka', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 5px 0 rgba(0, 0, 0, 0.2);
    transition: transform 0.1s, box-shadow 0.1s, background 0.1s, border-color 0.1s;
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(2px);
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2);
}

.theme-btn.active {
    background: var(--accent);
    color: white;
    border-color: #0f172a;
    box-shadow: 0 5px 0 #0f172a;
}

.theme-btn.active:active {
    transform: translateY(5px);
    box-shadow: 0 0px 0 #0f172a;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(145deg, #1e293b, #0f172a);
    padding: 36px 32px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid var(--panel-border);
    box-shadow: 
        0 30px 60px rgba(0,0,0,0.9),
        inset 0 1px 0 rgba(255,255,255,0.1);
    z-index: 2000;
    width: 380px;
    max-width: 95vw;
    max-height: 85vh;
    overflow-y: auto;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Larger modal for Help/About section */
#about-modal.modal {
    width: 600px;
    max-width: 95vw;
}

/* Backdrop overlay behind modals */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1999;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.modal-backdrop.visible {
    opacity: 1;
    pointer-events: all;
}

/* ─── Piece Intel (Help Section) Styling ──────────────────────── */
.piece-catalog {
    text-align: left;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

.piece-entry {
    background: rgba(255, 255, 255, 0.05);
    padding: 24px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.piece-entry:hover {
    transform: translateY(-8px) scale(1.02);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px var(--accent);
}

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

.piece-icon {
    width: 52px;
    height: 52px;
    background: #fbbf24;
    border-radius: 12px;
    border: 2px solid #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 0 #0f172a;
    transition: transform 0.3s ease;
}

.piece-entry:hover .piece-icon {
    transform: rotate(10deg) scale(1.1);
}

.piece-title {
    font-family: 'Outfit', sans-serif;
    color: var(--accent);
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
}

.piece-desc {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
}

.piece-stats {
    padding-left: 0;
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
    margin: 16px 0 0 0;
}

.piece-stats li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.piece-stats li::before {
    content: '◈';
    color: var(--accent);
    font-size: 0.8rem;
}

.modal.hidden {
    display: none;
}

.hidden {
    display: none !important;
}

.modal h2 {
    font-family: 'Outfit', sans-serif;
    margin-bottom: 8px;
}

.modal p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
        align-items: center;
    }
}

/* Themes */
[data-theme="default"] {
    --panel-bg: rgba(15, 23, 42, 0.75);
    --panel-border: rgba(52, 211, 153, 0.4);
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --board-light: #ecfdf5;
    --board-dark: #064e3b;
    --accent: #10b981;
    --accent-hover: #059669;
    --highlight: rgba(16, 185, 129, 0.5);
    --move-hint: rgba(16, 185, 129, 0.3);
    --last-move-color: rgba(16, 185, 129, 0.4);
}

[data-theme="default"] .piece[data-color="w"] {
    filter: drop-shadow(0px 4px 10px rgba(0,0,0,0.5));
}

[data-theme="default"] .piece[data-color="b"] {
    filter: brightness(0.9) contrast(1.1) drop-shadow(0px 4px 10px rgba(0,0,0,0.6));
}

[data-theme="pink"] {
    --panel-bg: rgba(255, 255, 255, 0.95);
    --panel-border: rgba(219, 39, 119, 0.3);
    --text-primary: #500724;
    --text-secondary: #9d174d;
    --board-light: #fff1f2;
    --board-dark: #fb7185;
    --accent: #e11d48;
    --accent-hover: #be123c;
    --highlight: rgba(253, 224, 71, 0.8);
    --move-hint: rgba(190, 18, 60, 0.4);
    --last-move-color: rgba(251, 113, 133, 0.45);
}

[data-theme="pink"] .modal {
    background: #fffafa;
    color: #500724;
    border-color: #fda4af;
}

[data-theme="pink"] .modal p {
    color: #9d174d;
}

[data-theme="pink"] .theme-btn:not(.active) {
    background: rgba(0, 0, 0, 0.05);
    color: #500724;
    border: 3px solid rgba(0, 0, 0, 0.1);
}

[data-theme="space"] {
    --panel-bg: rgba(15, 23, 42, 0.85);
    --panel-border: #818cf8;
    --text-primary: #e0e7ff;
    --text-secondary: #c7d2fe;
    --board-light: #e0e7ff;
    --board-dark: #4338ca;
    --accent: #818cf8;
    --accent-hover: #6366f1;
    --highlight: rgba(251, 191, 36, 0.6);
    --move-hint: #a5b4fc;
    --last-move-color: rgba(129, 140, 248, 0.4);
}

.header h1, .game-title {
    font-family: 'Fredoka', cursive;
    font-size: 3.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    text-shadow: 
        -1px -1px 0 #0f172a,  
         1px -1px 0 #0f172a,
        -1px  1px 0 #0f172a,
         1px  1px 0 #0f172a,
        -3px -3px 0 #0f172a,  
         3px -3px 0 #0f172a,
        -3px  3px 0 #0f172a,
         3px  3px 0 #0f172a,
         0    6px 0 #0f172a;
    letter-spacing: 2px;
    -webkit-text-stroke: 1px #0f172a;
}

.menu-title {
    font-family: 'Fredoka', cursive;
    font-size: 5.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 32px;
    text-shadow: 
        -2px -2px 0 #0f172a,  
         2px -2px 0 #0f172a,
        -2px  2px 0 #0f172a,
         2px  2px 0 #0f172a,
        -4px -4px 0 #0f172a,  
         4px -4px 0 #0f172a,
        -4px  4px 0 #0f172a,
         4px  4px 0 #0f172a,
         0    10px 0 #0f172a;
    letter-spacing: 4px;
    -webkit-text-stroke: 2px #0f172a;
}
.caterpillar-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(60vw, 300px);
    z-index: 1000;
    pointer-events: none;
    animation: caterpillar-pop 1.5s ease-in-out forwards;
}

@keyframes caterpillar-pop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    30% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 1;
    }
    70% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background-color: #fce18a;
    z-index: 2000;
    pointer-events: none;
}

.john-piece {
    filter: brightness(1.8) sepia(100%) saturate(3000%) hue-rotate(20deg) drop-shadow(0 0 12px #fbbf24) drop-shadow(0 0 4px #fbbf24) !important;
    transform: scale(1.15);
    z-index: 15;
}

/* rooook-piece styles moved to motion.css (color-specific blue tinting) */

.square.frozen::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(100, 200, 255, 0.3);
    border: 2px solid rgba(100, 200, 255, 0.8);
    box-shadow: inset 0 0 15px rgba(100, 200, 255, 0.6);
    pointer-events: none;
    z-index: 20;
    box-sizing: border-box;
}

/* ─── Icon Buttons (Settings / About) ─────────────────────────── */
.icon-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.icon-btn img {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.icon-btn:hover img {
    transform: rotate(45deg);
}

/* ─── Enhanced .btn hover glow ─────────────────────────────────── */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.15);
    opacity: 0;
    border-radius: inherit;
    transition: opacity 0.2s ease;
}

.btn:hover::after {
    opacity: 1;
}

/* ─── Entrance Animations ──────────────────────────────────────── */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Modal animation preserving the centering transform with a bounce */
@keyframes modalIn {
    from { opacity: 0; transform: translate(-50%, -45%) scale(0.9); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

#main-menu {
    animation: fadeSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.game-wrapper:not(#main-menu) {
    animation: fadeSlideUp 0.4s ease both;
}

/* ─── Active theme-btn — no pulse, just glow ─────────────────── */
.theme-btn.active {
    background: var(--accent);
    color: white;
    border-color: rgba(0,0,0,0.3);
    box-shadow: 0 5px 0 rgba(0,0,0,0.3);
}

/* ─── Theme-specific glow & button styles ──────────────────────── */

/* Default / Green Theme */
body[data-theme="default"] .btn:hover,
[data-theme="default"] body .btn:hover {
    box-shadow: 0 4px 0 #0f172a, 0 0 16px rgba(16, 185, 129, 0.6);
}

body[data-theme="default"] .theme-btn:not(.active):hover,
[data-theme="default"] body .theme-btn:not(.active):hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.5);
}

/* Pink Theme */
body[data-theme="pink"] .btn {
    border-color: #be123c;
    box-shadow: 0 6px 0 #be123c;
}

body[data-theme="pink"] .btn:hover {
    box-shadow: 0 4px 0 #be123c, 0 0 16px rgba(225, 29, 72, 0.4);
}

body[data-theme="pink"] .btn:active {
    box-shadow: 0 0 0 #be123c;
}

body[data-theme="pink"] .theme-btn {
    border-color: rgba(219, 39, 119, 0.3);
    color: #500724;
    background: rgba(251, 207, 232, 0.5);
}

body[data-theme="pink"] .theme-btn:not(.active):hover {
    background: rgba(251, 207, 232, 0.9);
    border-color: #e11d48;
}

body[data-theme="pink"] .theme-btn.active {
    box-shadow: 0 5px 0 #be123c;
    border-color: #be123c;
}

body[data-theme="pink"] .icon-btn img {
    filter: brightness(0) invert(0) sepia(1) saturate(5) hue-rotate(310deg) !important;
}

/* Space Theme */
body[data-theme="space"] .btn:hover {
    box-shadow: 0 4px 0 #0f172a, 0 0 20px rgba(129, 140, 248, 0.7);
}

body[data-theme="space"] .theme-btn:not(.active) {
    background: rgba(129, 140, 248, 0.1);
    border-color: rgba(129, 140, 248, 0.3);
    color: #e0e7ff;
}

body[data-theme="space"] .theme-btn:not(.active):hover {
    background: rgba(129, 140, 248, 0.25);
    border-color: #818cf8;
}

body[data-theme="space"] .theme-btn.active {
    background: #6366f1;
    border-color: #4f46e5;
    box-shadow: 0 5px 0 #3730a3, 0 0 12px rgba(99, 102, 241, 0.6);
}

body[data-theme="space"] .game-wrapper {
    border-color: rgba(129, 140, 248, 0.5);
    box-shadow: 0 25px 50px rgba(0,0,0,0.8), 0 0 40px rgba(99,102,241,0.15);
}

/* ─── Smooth modal appear ─────────────────────────────────────── */
.modal:not(.hidden) {
    animation: modalIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ─── Corner Mode Switch ────────────────────────────────────── */
.corner-mode-switch {
    position: absolute;
    bottom: 16px;
    right: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.3s ease;
    background: none;
    border: none;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

.corner-mode-switch:hover {
    color: var(--accent);
}

/* ─── Timer UI ─────────────────────────────────────────────── */
.timer-container {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.timer-box {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    backdrop-filter: blur(8px);
}

.timer-box .label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.timer-box .time {
    font-family: 'Fira Code', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.timer-box.active {
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

.timer-box.warning .time {
    color: var(--danger);
}

/* ─── Mode Selection Layer (Cleanup) ─────────────────────────── */
/* We keep the classes but they won't be used for a separate layer anymore */
.mode-selection-container {
    display: none;
}

/* ─── Multiplayer UI ────────────────────────────────────────── */
#online-options-menu {
    animation: slideDown 0.3s ease-out;
}

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

#id-display {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 12px;
    padding: 12px;
    margin-top: 12px;
}

#peer-id-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

#connection-status {
    font-weight: 500;
    letter-spacing: 0.5px;
}

.hidden {
    display: none !important;
}

/* Layer transitions */
.menu-layer {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.menu-layer.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    position: absolute;
}

/* ─── Winter Theme & Snow Effect ────────────────────────────── */
body[data-theme="winter"] {
    --accent: #60a5fa;
    --panel-bg: rgba(15, 23, 42, 0.4);
    --panel-border: rgba(147, 197, 253, 0.3);
    --text-primary: #eff6ff;
    --text-secondary: #bfdbfe;
}

body[data-theme="winter"] .square.light { background-color: #eff6ff; }
body[data-theme="winter"] .square.dark { background-color: #93c5fd; }
body[data-theme="winter"] .square.hint { background: radial-gradient(rgba(96, 165, 250, 0.5) 20%, transparent 20%); }
body[data-theme="winter"] .square.capture-hint { border: 4px solid rgba(96, 165, 250, 0.5); }
body[data-theme="winter"] .square.last-move { background-color: rgba(147, 197, 253, 0.5) !important; }

.snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.snowflake {
    position: absolute;
    top: -10px;
    background: white;
    border-radius: 50%;
    animation: snow-fall linear infinite;
    pointer-events: none;
}

@keyframes snow-fall {
    to { transform: translateY(105vh); }
}
