/* ═══════════════════════════════════════════════════════════════════════════════
   P-WORDLE - COMPREHENSIVE STYLING
   Daily Password Cracking Puzzle Game
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════════
   CSS VARIABLES & COLOR SCHEME
   ═══════════════════════════════════════════════════════════════════════════════ */

:root {
    /* Brand colours */
    --pwordle-primary: #C90C0F;
    --pwordle-secondary: #FAB719;
    
    /* Game tile states (Wordle-inspired) */
    --tile-correct: #DC2626; /* Red for correctly placed */
    --tile-present: #9333EA; /* Purple for right letter wrong place */
    --tile-absent: #787C7E;
    --tile-empty: #FFFFFF;
    --tile-border-empty: #334155;
    --tile-border-filled: #475569;
    
    /* Keyboard colours */
    --key-bg: #1F2937;
    --key-bg-absent: #475569;
    --key-bg-present: #9333EA; /* Purple for right letter wrong place */
    --key-bg-correct: #DC2626; /* Red for correctly placed */
    --key-text: #FFFFFF;
    --key-text-default: #E2E8F0;
    
    /* UI elements */
    --background: #0B1120;
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --border-color: #1F2937;
    --modal-bg: rgba(15, 23, 42, 0.98);
    --overlay-bg: rgba(2, 6, 23, 0.65);
    
    /* Spacing */
    --tile-size: 62px;
    --tile-gap: 5px;
    --key-height: 58px;
    --key-gap: 6px;
    
    /* Animations */
    --animation-speed: 0.25s;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #080F1D;
        --text-primary: #F8FAFC;
        --text-secondary: #94A3B8;
        --tile-empty: #0F172A;
        --tile-border-empty: #1E293B;
        --tile-border-filled: #334155;
        --key-bg: #1F2937;
        --key-text-default: #E2E8F0;
        --modal-bg: rgba(12, 19, 33, 0.95);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   LAYOUT & STRUCTURE
   ═══════════════════════════════════════════════════════════════════════════════ */

body.pwordle-page {
    background: radial-gradient(circle at 15% 15%, rgba(201, 12, 15, 0.12), transparent 55%),
                radial-gradient(circle at 85% 25%, rgba(250, 183, 25, 0.12), transparent 50%),
                linear-gradient(180deg, #0B1120 0%, #0F172A 100%);
    color: var(--text-primary);
    font-family: 'Rockwell', 'Rockwell Nova', 'Roboto Slab', serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Ensure html has no margin/padding that could push header down */
html {
    margin: 0;
    padding: 0;
}

/* Game menu modernisation */
body.pwordle-page.game-menu-active {
    --menu-bg-start: #111827;
    --menu-bg-end: #1f2937;
    --game-primary: #C90C0F;
    --game-primary-dark: #a00a0c;
    --game-secondary: #FAB719;
    --menu-card-bg: rgba(15, 23, 42, 0.65);
    --menu-card-border: rgba(255, 255, 255, 0.12);
    --menu-text-light: #F8FAFC;
}

.pwordle-menu {
    position: relative;
    z-index: 2;
}

/* Hide game screen initially */
#game-screen {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -9999px !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Hide container when game screen is not active */
#game-screen:not(.active) .pwordle-container {
    display: none !important;
    visibility: hidden !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Show game screen when active */
#game-screen.active {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    position: relative !important;
    left: auto !important;
    width: auto !important;
    height: auto !important;
    background: transparent;
    padding: 0;
    margin: 0;
}

.pwordle-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 24px;
    box-shadow: 0 25px 60px rgba(2, 6, 23, 0.55);
    position: relative;
    padding-top: 80px;
    /* Ensure container doesn't create containing block for fixed header */
    transform: none;
    will-change: auto;
    overflow: hidden; /* Prevent scrolling */
}

/* Desktop: Remove padding-top from container since header is outside */
@media (min-width: 769px) {
    .pwordle-container {
        padding-top: 0 !important; /* Header is outside container, no padding needed */
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   GAME TOP BAR - Use shared game-header.css styling
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Ensure header spans full width and uses shared styling - positioned relative to viewport */
/* Header is now outside container, so it's positioned relative to body/viewport */
.game-top-bar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0.75rem 1rem !important; /* Reduced padding */
    background: rgba(0, 0, 0, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    z-index: 10000 !important;
    transform: none !important;
    box-sizing: border-box !important; /* Ensure padding is included in width */
}

/* Also apply to header inside container if it exists (for backwards compatibility) */
.pwordle-container .game-top-bar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 1rem 2rem !important;
    background: rgba(0, 0, 0, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    z-index: 10000 !important;
    transform: none !important;
}

/* Desktop centering - ensure container is centered on larger screens */
@media (min-width: 769px) {
    body.pwordle-page {
        display: flex;
        justify-content: center;
        align-items: flex-start;
        padding: 0;
    }
    
    .pwordle-container {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        position: relative;
    }
    
    /* Header always spans full viewport width on desktop - now outside container so it's properly fixed */
    .game-top-bar {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        transform: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 0.75rem 1rem !important; /* Reduced padding for better fit */
        box-sizing: border-box !important;
    }
    
    /* Make buttons more compact on desktop */
    .game-top-bar .button-group {
        gap: 0.5rem !important; /* Reduced gap between buttons */
        flex-wrap: wrap !important; /* Allow wrapping if needed */
    }
    
    .game-top-bar .top-bar-btn {
        padding: 0.4rem 0.75rem !important; /* Reduced padding */
        font-size: 0.85rem !important; /* Slightly smaller font */
        white-space: nowrap !important;
    }
    
    /* Make title more compact */
    .game-top-bar .game-title-header {
        font-size: 1.5rem !important; /* Reduced from default */
        letter-spacing: 1px !important;
        flex-shrink: 1 !important; /* Allow title to shrink if needed */
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    /* Increase game board size significantly to fill 95% height */
    :root {
        --tile-size: 95px; /* Increased from 78px to fill more space */
        --tile-gap: 7px; /* Slightly increase gap proportionally */
        --key-height: 72px; /* Increased from 58px */
        --key-gap: 5px; /* Slightly increased */
    }
    
    /* Remove ALL blank space above and below the answer grid */
    .pwordle-board-container {
        padding: 0 !important; /* No padding at all */
        margin: 0 !important;
        justify-content: center !important; /* Center vertically */
        flex: 0 1 95% !important; /* Take 95% of available space */
        align-items: center !important;
    }
    
    .pwordle-board {
        padding: 0 !important; /* No padding */
        margin: 0 !important;
        max-width: 550px !important; /* Increased to accommodate larger tiles */
        width: 100% !important;
        border-radius: 0 !important; /* Remove rounded corners for tighter fit */
    }
    
    /* Increase tile font size proportionally */
    .pwordle-tile {
        font-size: 3rem !important; /* Increased to match larger tiles */
    }
    
    /* Increase keyboard letter size */
    .key-btn {
        font-size: 1rem !important; /* Increased from 0.8rem */
        font-weight: bold !important;
    }
    
    /* Add a little space between grid and keyboard - make keyboard full viewport width */
    .pwordle-keyboard {
        padding: 0 4px 0 !important; /* No vertical padding */
        margin-top: 12px !important; /* Small gap between grid and keyboard */
        margin-bottom: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important; /* Full width of container (which is now 100vw) */
        max-width: 100% !important;
        border-top: none !important; /* Remove border between board and keyboard */
        border-radius: 0 !important; /* Remove rounded corners */
    }
    
    .keyboard-row {
        margin-bottom: 4px !important; /* Reduced gap between rows */
    }
    
    /* Ensure container fits without scrolling */
    .pwordle-container {
        min-height: auto !important;
        height: calc(100vh - 80px) !important; /* Full height minus header */
        max-height: calc(100vh - 80px) !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        justify-content: space-between !important; /* Push keyboard to bottom */
    }
    
    /* Game board fills 95% of remaining height with gap above keyboard */
    .pwordle-board-container {
        overflow-y: auto !important; /* Allow scrolling if needed */
        overflow-x: hidden !important;
        flex: 0 1 95% !important; /* Take 95% of available space */
        min-height: 0 !important; /* Allow flex shrinking */
        margin-top: 0 !important; /* No margin at top */
        margin-bottom: 12px !important; /* Gap above keyboard */
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important; /* Center board vertically */
    }
    
    /* Keyboard stuck to bottom of page */
    .pwordle-keyboard {
        flex-shrink: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        position: relative !important;
    }
    
    /* Reduce row gap in board */
    .pwordle-row {
        gap: 4px !important; /* Reduced from 6px */
    }
}

/* Body padding for header */
body.pwordle-page:has(#game-screen.active),
body.pwordle-page.with-game-header {
    padding-top: 80px;
    margin: 0;
}

/* Override title color to Pwordle red */
.pwordle-page .game-top-bar .game-title-header {
    color: #C90C0F !important;
}

/* Ensure game screen has proper styling when active */
#game-screen.active {
    display: flex !important;
    background: transparent;
}

/* Ensure modals appear above everything */
.pwordle-modal-overlay {
    z-index: 10000 !important;
}

/* Mobile menu overlay */
.game-header-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1000;
}

.game-header-mobile-overlay.active {
    display: block;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   GAME BOARD
   ═══════════════════════════════════════════════════════════════════════════════ */

.pwordle-board-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 32px 18px 18px;
    overflow-y: auto;
}

.pwordle-board {
    display: flex;
    flex-direction: column;
    gap: var(--tile-gap);
    align-items: center;
    margin: 0 auto;
    padding: 24px 20px;
    background: rgba(8, 14, 30, 0.85);
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    box-shadow: inset 0 1px 0 rgba(248, 250, 252, 0.04);
    max-width: 360px;
    width: 100%;
}

.pwordle-row {
    display: flex;
    gap: var(--tile-gap);
    justify-content: center;
    width: 100%;
}

.pwordle-tile {
    width: var(--tile-size);
    height: var(--tile-size);
    border: 2px solid var(--tile-border-empty);
    background: var(--tile-empty);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    transition: all var(--animation-speed) ease;
    position: relative;
}

.pwordle-tile.filled {
    border-color: var(--tile-border-filled);
    background: #FFFFFF !important;
    color: #0F172A !important;
    animation: pop 0.1s ease;
}

/* Ensure filled tiles are visible on mobile */
@media (max-width: 768px) {
    .pwordle-tile.filled {
        background: #FFFFFF !important;
        color: #0F172A !important;
        border-color: var(--tile-border-filled) !important;
    }
}

.pwordle-tile.correct {
    background: var(--tile-correct) !important;
    border-color: var(--tile-correct) !important;
    color: white !important;
}

.pwordle-tile.present {
    background: var(--tile-present) !important;
    border-color: var(--tile-present) !important;
    color: white !important;
}

.pwordle-tile.absent {
    background: var(--tile-absent) !important;
    border-color: var(--tile-absent) !important;
    color: white !important;
}

/* Flip animation */
.pwordle-tile.flipping {
    transform: rotateY(90deg);
    transition: transform 0.5s ease;
}

/* Win animation */
.pwordle-tile.winning {
    animation: winBounce 0.6s ease;
    animation-delay: calc(var(--tile-index, 0) * 0.1s);
}

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

/* Invalid shake */
.pwordle-row.invalid {
    animation: shake 0.6s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   KEYBOARD
   ═══════════════════════════════════════════════════════════════════════════════ */

.pwordle-keyboard {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 16px 4px 28px;
    background: rgba(8, 14, 30, 0.8);
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 0 0 24px 24px;
    box-shadow: inset 0 -1px 0 rgba(248, 250, 252, 0.04);
    box-sizing: border-box;
    overflow-x: hidden;
}

.keyboard-row {
    display: flex;
    gap: var(--key-gap);
    justify-content: center;
}

.keyboard-actions {
    margin-top: 10px;
    justify-content: space-between;
    max-width: 400px; /* Match keyboard width */
    width: 100%;
}

.key-btn {
    flex: 1;
    min-width: 50px;
    height: var(--key-height);
    background: var(--key-bg);
    border: none;
    border-radius: 8px;
    color: var(--key-text-default);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

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

.key-btn:active {
    transform: translateY(0);
}

.key-btn.correct {
    background: var(--key-bg-correct);
    color: white;
}

.key-btn.present {
    background: var(--key-bg-present);
    color: white; /* Changed to white for better contrast on purple */
}

.key-btn.absent {
    background: var(--key-bg-absent);
    color: var(--key-text);
}

.key-submit {
    flex: 2;
    background: var(--pwordle-primary);
    color: white;
    font-weight: 700;
}

.key-submit:hover {
    background: #a00a0c;
}

.key-backspace {
    flex: 1;
    font-size: 20px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════════════════════ */

.pwordle-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: var(--overlay-bg);
    display: none !important;
    align-items: center;
    justify-content: center;
    z-index: 10000 !important;
    backdrop-filter: blur(4px);
    margin: 0 !important;
    padding: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow: auto;
    /* Ensure modals are not affected by parent containers */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.pwordle-modal-overlay:not(.active) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.pwordle-modal-overlay.active {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Ensure modals work even if inside containers with overflow */
body > .pwordle-modal-overlay,
html > body > .pwordle-modal-overlay {
    position: fixed !important;
}

.pwordle-modal {
    background: var(--modal-bg);
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 30px 70px rgba(2, 6, 23, 0.65);
    color: var(--text-primary);
    margin: 0 auto !important; /* Ensure centered */
    box-sizing: border-box !important; /* Include padding in width */
}

/* Ensure stats modal content is properly centered and fills width */
.stats-modal .pwordle-modal {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important; /* Stretch children to full width */
}

.stats-modal .stats-grid,
.stats-modal .guess-distribution {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

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

.results-win h2,
.results-loss h2 {
    font-size: 2rem;
    margin: 0 0 20px 0;
    color: var(--pwordle-secondary);
}

.password-answer {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--pwordle-primary);
    margin: 10px 0;
    letter-spacing: 0.2em;
}

.results-guesses {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin: 15px 0;
}

.results-score {
    margin: 20px 0;
}

.score-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--pwordle-secondary);
}

.score-label {
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.results-stats-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 20px 0;
}

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

.stat-item .stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--pwordle-secondary);
}

.stat-item .stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.guess-distribution {
    margin: 30px 0;
}

.guess-distribution h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.distribution-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bar-label {
    width: 20px;
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
}

.bar-container {
    flex: 1;
    background: transparent; /* Transparent by default - only show background when bar has content */
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

/* Show bar-container background only when bar-fill has meaningful width */
.bar-container:has(.bar-fill[style*="width"]:not([style*="width: 0%"]):not([style*="width: 0px"])) {
    background: rgba(0, 0, 0, 0.1);
}

/* Hide bar-fill when width is 0% */
.bar-fill[style*="width: 0%"],
.bar-fill[style*="width: 0px"] {
    display: none;
}

.bar-fill {
    height: 100%;
    background: var(--pwordle-secondary);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    color: #1f2937;
    font-weight: 600;
    font-size: 0.85rem;
}

.bar-fill.current {
    background: var(--pwordle-primary);
    color: white;
}

.results-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: center;
}

.share-btn,
.view-stats-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

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

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

.view-stats-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.view-stats-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   STATISTICS MODAL
   ═══════════════════════════════════════════════════════════════════════════════ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.stat-box {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-box .stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--pwordle-secondary);
    margin-bottom: 5px;
}

.stat-box .stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   MESSAGES
   ═══════════════════════════════════════════════════════════════════════════════ */

.pwordle-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--modal-bg);
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    font-weight: 600;
}

.pwordle-message.success {
    background: var(--tile-correct);
    color: white;
}

.pwordle-message.error {
    background: #DC2626;
    color: white;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PRACTICE & HARD MODE INDICATORS
   ═══════════════════════════════════════════════════════════════════════════════ */

.practice-indicator,
.hard-mode-indicator {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 1000;
    white-space: nowrap;
}

.practice-indicator {
    top: 60px;
    background: rgba(250, 183, 25, 0.2);
    color: #FAB719;
}

.hard-mode-indicator {
    top: 100px; /* Position below practice indicator */
    background: rgba(168, 85, 247, 0.2);
    color: #A855F7;
}

.hidden {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    /* Ensure button group is hidden on mobile (burger menu shows instead) */
    .pwordle-container .game-top-bar .button-group {
        display: none !important;
    }
    
    /* Ensure burger menu is visible on mobile */
    .pwordle-container .game-top-bar .game-header-burger {
        display: block !important;
    }
    :root {
        --tile-size: 50px;
        --key-height: 50px;
    }
    
    .pwordle-container {
        padding: 120px 10px 10px 10px; /* Extra padding for indicators on mobile */
    }
    
    .pwordle-tile {
        font-size: 24px;
    }
    
    .key-btn {
        font-size: 16px;
    }
    
    .pwordle-board,
    .pwordle-keyboard {
        max-width: 100%; /* Full width on mobile */
    }
    
    .results-stats-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    :root {
        --tile-size: 45px;
        --key-height: 45px;
    }
    
    .pwordle-container {
        padding: 85px 8px 8px 8px; /* Further reduced padding for small screens */
    }
    
    .pwordle-tile {
        font-size: 20px;
    }
    
    .pwordle-modal {
        padding: 20px;
    }
    
    .pwordle-board,
    .pwordle-keyboard {
        max-width: 100%;
    }
}

/* Difficulty selector buttons */
.difficulty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.difficulty-btn:active {
    transform: translateY(0);
}

