/* CSS Variables for theme colors */
:root {
    --bg-primary: #F5F5DC; /* Beige */
    --bg-secondary: #FFFEF7; /* Light cream */
    --color-primary: #8B4513; /* Warm brown */
    --color-accent: #FF6B6B; /* Soft coral */
    --color-text: #4A4A4A; /* Medium grey */
    --color-grid: #D3D3D3; /* Light grey */
    --color-white: #FFFFFF;
    --shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-piece: 0 4px 15px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* Dark mode variables */
[data-theme="dark"] {
    --bg-primary: #2C2C2C; /* Charcoal */
    --bg-secondary: #3A3A3A;
    --color-primary: #D2B48C; /* Light brown */
    --color-accent: #FF8E8E; /* Light coral */
    --color-text: #E0E0E0; /* Light grey */
    --color-grid: #555555; /* Medium grey */
    --color-white: #1E1E1E;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    transition: var(--transition);
}

.game-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Header styles */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 2px solid var(--color-grid);
    margin-bottom: 30px;
}

.game-title {
    font-family: 'Comfortaa', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0;
}

.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.score-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--color-white);
    padding: 12px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
}

.score-label {
    font-weight: 600;
    color: var(--color-text);
}

.score-value {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--color-primary);
}

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

.toggle-btn, .menu-btn {
    background: var(--color-white);
    border: 2px solid var(--color-grid);
    color: var(--color-text);
    padding: 10px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-btn:hover, .menu-btn:hover {
    background: var(--color-accent);
    color: white;
    transform: translateY(-2px);
}

.toggle-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Main game area */
.game-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    position: relative;
}

/* Paw decorations */
.paw-decoration {
    position: absolute;
    font-size: 3rem;
    opacity: 0.1;
    user-select: none;
    pointer-events: none;
    z-index: 1;
    animation: pawFloat 3s ease-in-out infinite;
}

.paw-left {
    left: 10%;
    top: 20%;
    animation-delay: 0s;
}

.paw-right {
    right: 10%;
    top: 60%;
    animation-delay: 1.5s;
}

/* Game board styles */
.game-board {
    padding: 15px;
    background: var(--color-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    width: min(420px, 85vw);
    height: min(420px, 85vw);
    position: relative;
    z-index: 10;
    box-sizing: border-box;
    max-width: 100%;
    max-height: 100%;
}

/* Board layers container */
.board-layers {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Grid layer base styles */
.grid-layer {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 2px;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Pieces layer (background) - displays cat pieces */
.grid-layer--pieces {
    z-index: 1;
    pointer-events: none;
}

/* Overlay layer (front) - handles drag interactions */
.grid-layer--overlay {
    z-index: 2;
    pointer-events: auto;
}

/* Make overlay cells transparent so pieces layer shows through */
.grid-layer--overlay .grid-cell {
    background: transparent;
    border: none;
    will-change: background-color, border-color;
    transition: background-color 0.08s ease-out, border-color 0.08s ease-out;
}

/* Only show background on hover for overlay cells */
.grid-layer--overlay .grid-cell:hover {
    background: rgba(255, 107, 107, 0.15);
    border: 1px dashed var(--color-accent);
}

/* 9x9 grid adjustments */
.game-board.grid-9x9 {
    width: min(500px, 90vw);
    height: min(500px, 90vw);
    padding: 12px;
}

.game-board.grid-9x9 .grid-layer {
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);
    gap: 1px;
}

.grid-cell {
    background: var(--bg-secondary);
    border: 1px solid var(--color-grid);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    will-change: background-color, border-color;
    transition: background-color 0.08s ease-out, border-color 0.08s ease-out;
    aspect-ratio: 1;
    min-width: 0;
    min-height: 0;
    box-sizing: border-box;
    overflow: hidden;
}

.grid-cell:hover {
    background: var(--color-accent);
    opacity: 0.8;
}

.grid-cell.valid-drop {
    background: rgba(100, 200, 100, 0.4) !important;
    border-color: #4CAF50 !important;
    border-width: 2px !important;
    border-style: solid !important;
}

.grid-cell.invalid-drop {
    background: rgba(255, 100, 100, 0.35) !important;
    border-color: #e74c3c !important;
    border-width: 2px !important;
    border-style: solid !important;
}

/* Touch drag clone — floats above finger on mobile */
#touchDragClone {
    border-radius: var(--border-radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    background: var(--color-white);
}

/* Placement preview styles */
.placement-preview {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
}

.placement-preview .cat-symbol {
    width: 80%;
    height: 80%;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* Cat piece styles */
.cat-piece {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border-radius: 4px;
    background: var(--color-white);
    box-shadow: var(--shadow-piece);
    transition: var(--transition);
    box-sizing: border-box;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.cat-piece:active {
    cursor: grabbing;
}

.cat-piece.dragging {
    opacity: 0.8;
    transform: scale(1.1);
    z-index: 1000;
}

.cat-piece.matching {
    animation: matchPulse 0.5s ease-in-out;
}

/* Cat symbols */
.cat-symbol {
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    display: block;
    image-rendering: auto;
    image-rendering: smooth;
    -ms-interpolation-mode: bicubic;
}

.cat-type-1 { color: #FF6B6B; } /* Pink cat */
.cat-type-2 { color: #4ECDC4; } /* Teal cat */
.cat-type-3 { color: #45B7D1; } /* Blue cat */
.cat-type-4 { color: #96CEB4; } /* Green cat */
.cat-type-5 { color: #9B59B6; } /* Purple frog */

/* Next piece container */
.next-piece-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    background: var(--color-white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    min-width: 200px;
}

.next-piece-title {
    font-family: 'Comfortaa', sans-serif;
    color: var(--color-primary);
    margin: 0;
}

.next-piece {
    display: flex;
    gap: 5px;
    min-height: 100px;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.domino-piece {
    display: flex;
    background: var(--color-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-piece);
    cursor: grab;
    padding: 15px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.domino-piece:hover {
    transform: scale(1.05);
}

.domino-piece.horizontal {
    flex-direction: row;
}

.domino-piece.vertical {
    flex-direction: column;
}

.domino-half {
    width: min(60px, 12vw);
    height: min(60px, 12vw);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-grid);
    background: var(--bg-secondary);
    box-sizing: border-box;
}

.domino-half:first-child {
    border-top-left-radius: var(--border-radius);
    border-bottom-left-radius: var(--border-radius);
}

.domino-half:last-child {
    border-top-right-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
}

.domino-piece.vertical .domino-half:first-child {
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    border-bottom-left-radius: 0;
}

.domino-piece.vertical .domino-half:last-child {
    border-bottom-left-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
    border-top-right-radius: 0;
}

/* Action button */
.action-btn {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.action-btn:hover {
    background: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-piece);
}

.action-btn--secondary {
    background: var(--bg-secondary);
    color: var(--color-text);
    border: 2px solid var(--color-grid);
}

.action-btn--secondary:hover {
    background: var(--color-grid);
    color: var(--color-text);
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

/* Mode toggle pill */
.mode-toggle-pill {
    display: flex;
    align-items: center;
    gap: 0;
    margin-top: 5px;
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 2px;
    border: 1.5px solid var(--color-grid);
}

.mode-pill-btn {
    background: transparent;
    border: none;
    padding: 2px 10px;
    border-radius: 18px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-text);
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
    line-height: 1.6;
    font-family: inherit;
}

.mode-pill-btn.active {
    background: var(--color-primary);
    color: white;
}

.mode-pill-btn:not(.active):hover {
    background: var(--color-accent);
    color: white;
}

/* Gift indicator */
.gift-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-primary);
}

.gift-icon {
    font-size: 0.85rem;
}

.gift-label {
    color: var(--color-text);
}

/* Undo row and button */
.undo-row {
    margin-top: 4px;
    display: none;
    justify-content: center;
}

.undo-btn {
    background: var(--color-white);
    border: 1.5px solid var(--color-grid);
    color: var(--color-text);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, opacity 0.18s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 5px;
}

.undo-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.undo-btn:not(:disabled):hover {
    background: var(--color-primary);
    color: white;
}

.undo-badge {
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Hamburger Menu Styles */
.hamburger-menu {
    position: relative;
}

.hamburger-btn {
    z-index: 101;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--color-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    min-width: 160px;
    z-index: 100;
    overflow: hidden;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--color-text);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.dropdown-item:hover {
    background: var(--bg-secondary);
    color: var(--color-primary);
}

.dropdown-item i {
    width: 18px;
    height: 18px;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--color-white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-piece);
    text-align: center;
    max-width: 400px;
    margin: 20px;
}

.modal-content h2 {
    color: var(--color-primary);
    margin-bottom: 15px;
    font-family: 'Comfortaa', sans-serif;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--color-grid);
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

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

@keyframes pawFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-10px) rotate(5deg); }
    66% { transform: translateY(5px) rotate(-3deg); }
}

.score-update {
    animation: slideIn 0.3s ease;
}

/* Responsive design */
@media (max-width: 768px) {
    .game-container {
        padding: 15px;
    }

    .game-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .header-right {
        order: -1;
    }

    .game-title {
        font-size: 1.5rem;
    }

    .game-board {
        width: min(320px, 85vw);
        height: min(320px, 85vw);
        padding: 12px;
        gap: 1px;
    }
    
    .game-board.grid-9x9 {
        width: min(380px, 90vw);
        height: min(380px, 90vw);
        padding: 10px;
    }

    .cat-symbol {
        font-size: 1.5rem;
    }

    .domino-half {
        width: 35px;
        height: 35px;
    }

    .next-piece-container {
        padding: 15px;
        min-width: 150px;
    }
}

@media (max-width: 480px) {
    .game-board {
        width: min(280px, 80vw);
        height: min(280px, 80vw);
        padding: 8px;
        gap: 1px;
    }
    
    .game-board.grid-9x9 {
        width: min(320px, 85vw);
        height: min(320px, 85vw);
        padding: 6px;
    }

    .cat-symbol {
        font-size: 1.2rem;
    }

    .domino-half {
        width: 30px;
        height: 30px;
    }
    
    .next-piece-container {
        padding: 12px;
        min-width: 140px;
    }
}

/* Touch device optimizations */
@media (hover: none) {
    .grid-cell:hover {
        background: var(--bg-secondary);
    }

    .cat-piece:hover {
        transform: none;
    }

    .toggle-btn:hover, .menu-btn:hover {
        transform: none;
    }

    .action-btn:hover {
        transform: none;
    }
}

/* ===== GAME AREA WRAPPER (board + leaderboard sidebar) ===== */
.game-area-wrapper {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: start;
    gap: 16px;
    width: 100%;
}

.leaderboard-spacer {
    justify-self: start;
}

/* ===== LEADERBOARD SIDEBAR PANEL ===== */
.leaderboard-panel {
    background: var(--color-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    padding: 14px 16px;
    min-width: 150px;
    max-width: 170px;
    position: relative;
    z-index: 10;
    justify-self: end;
}

.lb-panel-title {
    font-family: 'Comfortaa', sans-serif;
    font-size: 0.85rem;
    color: var(--color-primary);
    margin: 0 0 10px;
    text-align: center;
    font-weight: 700;
}

.lb-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 10px;
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 2px;
    border: 1.5px solid var(--color-grid);
}

.lb-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 3px 6px;
    border-radius: 18px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--color-text);
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
    font-family: inherit;
}

.lb-tab.active {
    background: var(--color-primary);
    color: white;
}

.lb-tab:not(.active):hover {
    background: var(--color-accent);
    color: white;
}

.lb-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.lb-list li {
    font-size: 0.72rem;
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 5px 8px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 3px solid var(--color-primary);
}

.lb-list li:first-child {
    border-left-color: #f5a623;
}

.lb-list li:nth-child(2) {
    border-left-color: #9b9b9b;
}

.lb-list li:nth-child(3) {
    border-left-color: #b87333;
}

.lb-entry-name {
    font-weight: 700;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}

.lb-entry-date {
    font-size: 0.62rem;
    color: var(--color-text);
    opacity: 0.6;
}

.lb-empty-item {
    font-size: 0.72rem;
    color: var(--color-text);
    opacity: 0.55;
    text-align: center;
    padding: 10px 0;
    list-style: none;
    border-left: none !important;
    background: transparent !important;
}

/* ===== FULL LEADERBOARD MODAL ===== */
.modal-content--wide {
    max-width: 600px;
    width: 90vw;
}

.lb-modal-subtitle {
    font-size: 0.8rem;
    opacity: 0.65;
    margin: -8px 0 16px;
    color: var(--color-text);
}

.lb-full-columns {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
    text-align: left;
}

.lb-full-col {
    flex: 1;
    min-width: 0;
}

.lb-col-title {
    font-family: 'Comfortaa', sans-serif;
    font-size: 0.9rem;
    color: var(--color-primary);
    margin: 0 0 10px;
    font-weight: 700;
}

/* ===== WIN MODAL ===== */
.gameover-win h2 {
    color: var(--color-primary);
    font-family: 'Comfortaa', sans-serif;
    margin-bottom: 8px;
}

.gameover-lose h2 {
    color: var(--color-primary);
    font-family: 'Comfortaa', sans-serif;
    margin-bottom: 8px;
}

.gameover-mode-label {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-bottom: 12px;
}

.username-prompt {
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.username-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 2px solid var(--color-grid);
    background: var(--bg-secondary);
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.95rem;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}

.username-input:focus {
    border-color: var(--color-primary);
}

.username-error {
    color: #e55;
    font-size: 0.78rem;
    min-height: 18px;
    margin: 6px 0 0;
}

.gameover-restart-btn {
    margin-top: 16px;
}

/* ===== QUICK GUIDE MODAL ===== */
.guide-modal .modal-content {
    max-width: 420px;
    padding: 28px 24px 20px;
}

.guide-content {
    text-align: center;
    position: relative;
}

.guide-close-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--color-text);
    opacity: 0.5;
    transition: opacity 0.15s;
    border-radius: 8px;
    padding: 0;
    line-height: 1;
}

.guide-close-btn:hover {
    opacity: 1;
}

.guide-domino {
    display: flex;
    gap: 3px;
    border: 2px solid var(--color-primary);
    border-radius: 10px;
    padding: 5px;
    background: var(--bg-secondary);
}

.guide-steps-wrapper {
    position: relative;
    min-height: 190px;
    overflow: hidden;
}

.guide-step {
    display: none;
    flex-direction: column;
    align-items: center;
    animation: slideInStep 0.32s ease both;
}

.guide-step.active {
    display: flex;
}

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

.guide-step h3 {
    font-family: 'Comfortaa', sans-serif;
    color: var(--color-primary);
    font-size: 1.1rem;
    margin: 12px 0 6px;
}

.guide-step p {
    font-size: 0.88rem;
    color: var(--color-text);
    line-height: 1.5;
    margin: 0;
    max-width: 320px;
}

/* Step visual areas */
.guide-step-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 4px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 14px;
    width: 100%;
    box-sizing: border-box;
    min-height: 80px;
}

.guide-cat-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.guide-arrow {
    font-size: 1.4rem;
    color: var(--color-primary);
}

.guide-grid-mini {
    display: flex;
    gap: 4px;
}

.guide-grid-cell {
    width: 26px;
    height: 26px;
    border-radius: 5px;
    background: var(--color-grid);
    border: 1.5px solid var(--bg-primary);
}

.guide-drop-cell {
    background: rgba(0, 180, 100, 0.35);
    border-color: #00b464;
}

.guide-step-visual--match {
    gap: 6px;
}

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

.guide-cat-flash {
    animation: catFlash 0.9s ease-in-out infinite;
}

.guide-step-visual--score {
    font-family: 'Comfortaa', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
}

.guide-score-before {
    color: var(--color-primary);
}

.guide-score-after {
    color: #3cb371;
}

.guide-step-visual--win {
    font-size: 2rem;
    gap: 12px;
}

.guide-trophy {
    font-size: 2.2rem;
}

.guide-score-zero {
    font-family: 'Comfortaa', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-primary);
}

/* Guide dots */
.guide-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 14px 0 12px;
}

.guide-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-grid);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.guide-dot.active {
    background: var(--color-primary);
    transform: scale(1.25);
}

/* Guide navigation */
.guide-nav {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.guide-prev-btn,
.guide-next-btn,
.guide-done-btn {
    min-width: 90px;
}

.guide-done-btn {
    display: none;
}

/* Dropdown emoji icon helper */
.dropdown-emoji {
    font-size: 1rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    width: 16px;
    justify-content: center;
}

/* ===== RESPONSIVE: leaderboard sidebar on mobile ===== */
@media (max-width: 768px) {
    .game-area-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .leaderboard-spacer {
        display: none;
    }

    .leaderboard-panel {
        max-width: 100%;
        width: min(420px, 85vw);
        box-sizing: border-box;
        justify-self: unset;
    }

    .lb-full-columns {
        flex-direction: column;
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .leaderboard-panel {
        width: min(280px, 80vw);
    }
}

/* Print styles */
@media print {
    .game-container {
        background: white;
        color: black;
    }
    
    .toggle-btn, .menu-btn, .action-btn {
        display: none;
    }
}
