/* ==========================================================================
   15BALLPOOL PORTAL - CORE STYLING & RESPONSIVE LAYOUT ENGINE
   ========================================================================== */

body {
    margin: 0;
    padding: 0;
    background: #141414;
    color: #ffffff;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-display: swap;
    display: flex;
    flex-direction: column; /* Stacks Header, Game Box, and Footer vertically */
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto; /* Restores global layout scroll matrix */
    -webkit-user-select: none;
    user-select: none;
    /* Prevent pull-to-refresh and overscroll on mobile */
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
    /* Prevent iOS rubber-band scrolling */
    position: relative;
}

/* Restrict touch-action to the game canvas only, not the whole page */
#canvas-container {
    touch-action: none;          /* Prevents scroll, zoom, double-tap zoom on canvas */
    -webkit-touch-callout: none; /* Prevents iOS callout/link preview on long-press */
    touch-callout: none;
    /* Ensure canvas captures pointer events properly */
    pointer-events: auto;
    /* Prevent text selection within canvas area */
    -webkit-user-select: none;
    user-select: none;
}

/* ==========================================================================
   🌐 WEBSITE HEADER LAYER STYLING
   ========================================================================== */
#main-web-header {
    width: 100%;
    background: #1a1a1a;
    border-bottom: 2px solid #2a2a2a;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    padding: 14px 0;
    margin-bottom: 25px;
}

.header-container {
    width: 90vw;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 🖼️ BRAND PNG LOGO DIMENSIONS & POSITIONING */
.brand-png-logo {
    height: 38px;          /* Perfect uniform height matching standard pro navbars */
    width: 180px;          /* Explicit width matching HTML attribute — prevents CLS */
    display: block;
    object-fit: contain;   /* Ensures image never stretches or distorts */
    transition: transform 0.2s ease;
}

/* Sub-container flex box parameters fallback override */
.web-logo-zone {
    display: flex;
    align-items: center;
    padding: 0;
    margin: 0;
}

.web-logo-zone:hover .brand-png-logo {
    transform: scale(1.03); /* Subtle pro lifting feedback on mouse hover */
}

/* 15-BALL STRIPED ICON STRUCTURAL VECTOR */
.pool-ball-15-icon {
    width: 28px;
    height: 28px;
    background-color: #990000; /* Deep Crimson hue of Ball 15 */
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5), inset -3px -3px 6px rgba(0,0,0,0.6);
    border: 1px solid #7a0c0c;
    margin-right: 4px;
}

/* Central white band stripe ring simulator */
.pool-ball-15-icon::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background-color: #ffffff;
    border-radius: 50%;
    z-index: 1;
}

/* Hard centering numbers text overlay over the stripe matrix */
.pool-ball-15-icon:after {
    content: '15';
    position: absolute;
    z-index: 2;
    color: #000000;
    font-size: 9px;
    font-weight: bold;
    font-family: Arial, sans-serif;
    text-align: center;
}

.header-menu-links {
    list-style: none;
    display: flex;
    gap: 24px;
    margin: 0;
    padding: 0;
}
.header-menu-links a {
    color: #aaaaaa;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}
.header-menu-links a:hover, .header-menu-links a.active {
    color: #00ffcc;
}

.header-social-icons {
    display: flex;
    gap: 10px;
}
.social-icon {
    text-decoration: none;
    background: #2a2a2a;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    color: #ccc;
}
.social-icon:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.social-icon.fb:hover { background: #1877F2; color: #fff; }
.social-icon.tw:hover { background: #000; color: #fff; }
.social-icon.ig:hover { background: #E4405F; color: #fff; }
.social-icon.yt:hover { background: #FF0000; color: #fff; }
.social-icon.li:hover { background: #0A66C2; color: #fff; }
.social-icon.dc:hover { background: #5865F2; color: #fff; }
.social-icon.yt:hover { background: #FF0000; color: #fff; }
.social-icon.ig:hover { background: #E4405F; color: #fff; }
.social-icon.gh:hover { background: #333; color: #fff; }

/* ==========================================================================
   🎮 GAME CANVAS FRAME & HUD DISPLAY OVERLAY
   ========================================================================== */
#game-wrapper {
    display: flex;
    flex-direction: column;
    width: 95vw;
    max-width: 1200px;
    gap: 10px;
    margin-bottom: 40px; /* Secure clear space gap before footer elements block */
    min-height: 400px;    /* Reserve space to prevent CLS during load */
    contain: layout style; /* Isolate layout calculations */
}

/* Fullscreen button hover effect */
#fullscreen-btn:hover {
    transform: scale(1.1);
    border-color: #00ffcc !important;
    color: #00ffcc !important;
}

/* ==========================================================================
   🌐 FULLSCREEN MODE OVERRIDES (.fs-mode = JS toggle, :fullscreen = browser fallback)
   ========================================================================== */

/* ── Game wrapper fills viewport ── */
#game-wrapper.fs-mode,
#game-wrapper:fullscreen {
    width: 100vw;
    max-width: 100vw;
    height: 100vh; /* Fixed viewport height — avoids dvh async update delay on mobile */
    height: 100dvh; /* Fallback for browsers that support dvh */
    max-height: 100vh;
    max-height: 100dvh;
    margin: 0 !important;
    padding: 0;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    background: #0a0a0a;
    justify-content: flex-start;
    gap: 4px;
    overflow: hidden !important;
}

/* ── HUD — compact ── */
#game-wrapper.fs-mode #hud-overlay,
#game-wrapper:fullscreen #hud-overlay {
    padding: 4px 10px;
    border-radius: 6px;
    flex-shrink: 0;
}
#game-wrapper.fs-mode .player-profile,
#game-wrapper:fullscreen .player-profile {
    min-width: 100px;
}
#game-wrapper.fs-mode .avatar,
#game-wrapper:fullscreen .avatar {
    width: 24px;
    height: 24px;
    font-size: 1rem;
    padding: 3px;
}
#game-wrapper.fs-mode .username,
#game-wrapper:fullscreen .username {
    font-size: 0.75rem;
}
#game-wrapper.fs-mode #status-msg,
#game-wrapper:fullscreen #status-msg {
    font-size: 0.75rem;
    max-width: 200px;
}
#game-wrapper.fs-mode #shot-timer-box,
#game-wrapper:fullscreen #shot-timer-box {
    padding: 2px 8px;
    font-size: 0.9rem;
}
#game-wrapper.fs-mode .mode-btn,
#game-wrapper:fullscreen .mode-btn {
    padding: 2px 6px;
    font-size: 0.6rem;
}
#game-wrapper.fs-mode .diff-btn,
#game-wrapper:fullscreen .diff-btn {
    padding: 1px 5px;
    font-size: 0.55rem;
}

/* ── Table layout — FILL available space, STRETCH children vertically ── */
#game-wrapper.fs-mode #table-layout-container,
#game-wrapper:fullscreen #table-layout-container {
    flex: 1;
    min-height: 0;
    align-items: stretch !important;  /* CRITICAL: stretch children to fill height */
    gap: 6px;
    width: 100%;
}

/* ── Canvas container — fill remaining space, no aspect-ratio constraint ── */
#game-wrapper.fs-mode #canvas-container,
#game-wrapper:fullscreen #canvas-container {
    flex: 1;
    aspect-ratio: unset;
    border-width: 3px;
    border-radius: 6px;
    height: auto;
    /* Phaser's Scale.FIT will handle 2:1 within this container */
}

/* ── Power rail — compact ── */
#game-wrapper.fs-mode #power-rail-container,
#game-wrapper:fullscreen #power-rail-container {
    height: 140px;
    width: 28px;
    padding: 4px 0;
    flex-shrink: 0;
}
#game-wrapper.fs-mode #power-handle,
#game-wrapper:fullscreen #power-handle {
    width: 34px;
    height: 12px;
    left: -5px;
}

/* ── Sidebar — compact ── */
#game-wrapper.fs-mode #color-sidebar-board,
#game-wrapper:fullscreen #color-sidebar-board {
    padding: 4px 3px;
    min-width: 44px;
    flex-shrink: 0;
}
#game-wrapper.fs-mode .sidebar-title,
#game-wrapper:fullscreen .sidebar-title {
    font-size: 0.55rem;
    margin-bottom: 6px;
}
#game-wrapper.fs-mode .color-btn,
#game-wrapper:fullscreen .color-btn {
    width: 24px;
    height: 24px;
}
#game-wrapper.fs-mode .pocket-btn,
#game-wrapper:fullscreen .pocket-btn {
    font-size: 0.45rem;
    padding: 2px 4px;
}
#game-wrapper.fs-mode .cue-arrow-btn,
#game-wrapper:fullscreen .cue-arrow-btn {
    padding: 1px 5px;
    font-size: 0.6rem;
}
#game-wrapper.fs-mode #cue-name-display,
#game-wrapper:fullscreen #cue-name-display {
    font-size: 0.5rem;
}

#hud-overlay {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(30, 30, 30, 0.9);
    border-radius: 12px;
    padding: 12px 24px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    border: 1px solid #2a2a2a;
    min-height: 64px;  /* Fixed height to prevent CLS when content loads */
}

.player-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0.4;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 180px;
}
#player2-card { justify-content: flex-end; text-align: right; }
.player-profile.active { opacity: 1; transform: scale(1.04); }

.avatar {
    font-size: 1.8rem; background: #2a2a2a; padding: 6px; border-radius: 50%;
    width: 40px; height: 40px; display: flex; justify-content: center; align-items: center;
}
.player-profile.active .avatar { box-shadow: 0 0 12px #00ffcc; border: 1px solid #00ffcc; }
.meta { display: flex; flex-direction: column; }
#player2-card .ball-pocketed-rack { justify-content: flex-end; }
.username { font-weight: 700; font-size: 1.05rem; }

.group-indicator {
    font-size: 0.75rem; padding: 2px 6px; border-radius: 4px; margin-top: 3px;
    text-align: center; font-weight: bold; display: inline-block; width: fit-content;
}
#player2-card .group-indicator { align-self: flex-end; }
.text-muted { background: #3c3c3c; color: #aaa; }
.solids { background: #cc2222; color: #fff; }
.stripes { background: #ffaa00; color: #000; }

.ball-pocketed-rack { display: flex; gap: 5px; margin-top: 6px; min-height: 18px; }
.mini-ui-ball {
    width: 16px; height: 16px; border-radius: 50%; position: relative; font-size: 8px;
    font-weight: bold; color: #000000; display: flex; justify-content: center; align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4); overflow: hidden; background-color: #ffffff;
}
.mini-ui-ball::before { content: ''; position: absolute; width: 6px; height: 6px; background-color: #ffffff; border-radius: 50%; z-index: 1; }
.mini-ui-ball span { position: relative; z-index: 2; }
/* Stripe balls: white body with colored band using CSS custom property */
.mini-stripe { background-color: #ffffff; }
.mini-stripe::after { content: ''; position: absolute; width: 100%; height: 10px; top: 3px; background-color: var(--stripe-color, #888); z-index: 0; }

#center-hud-display { display: flex; flex-direction: column; align-items: center; gap: 4px; }
#status-msg { color: #ffcc00; font-weight: 600; text-shadow: 0 2px 4px rgba(0,0,0,0.5); font-size: 1rem; text-align: center; max-width: 300px; }

/* 🎮 Game Mode Selector Buttons */
#game-mode-selector {
    display: flex;
    gap: 4px;
}
.mode-btn {
    border: none;
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.mode-btn:hover {
    transform: scale(1.08);
}

/* 🧠 AI Difficulty Selector Buttons */
#ai-difficulty-selector {
    display: flex;
    gap: 3px;
}
.diff-btn {
    border: none;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 0.65rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.diff-btn:hover {
    transform: scale(1.1);
}

/* 📊 Shot Stats Display */
#shot-stats-display {
    font-size: 0.7rem;
    color: #888;
    margin-top: 2px;
    display: flex;
    gap: 6px;
    align-items: center;
    background: rgba(30, 30, 30, 0.6);
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid #2a2a2a;
}
#shot-stats-display span {
    cursor: default;
}
#shot-stats-display span[onclick] {
    cursor: pointer;
    color: #555;
}
#shot-stats-display span[onclick]:hover {
    color: #00ffcc;
}

/* ⏱️ SHOT TIMER CONTAINER BOX STYLING */
#shot-timer-box { 
    background: #1e1e1e; 
    border: 2px solid #ff3333; 
    padding: 3px 12px; 
    border-radius: 12px; 
    font-weight: bold; 
    font-size: 1.1rem; 
    color: #ff3333; 
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.8); 
    transition: border-color 0.3s ease, color 0.3s ease;
}

#table-layout-container { display: flex; flex-direction: row; align-items: center; gap: 15px; width: 100%; }

#power-rail-container {
    position: relative; width: 36px; height: 320px; background: #222; border: 2px solid #3a3a3a;
    border-radius: 20px; box-shadow: inset 0 4px 12px rgba(0,0,0,0.9); display: flex; justify-content: center; align-items: flex-end; padding: 6px 0; box-sizing: border-box;
}
#power-gradient-track { width: 12px; height: 100%; background: linear-gradient(to top, #00ffcc 0%, #ffcc00 50%, #ff3333 100%); border-radius: 6px; overflow: hidden; position: relative; }
#power-fill-bar { width: 100%; height: 100%; background: #2a2a2a; position: absolute; top: 0; }
#power-handle { position: absolute; left: -5px; bottom: 6px; width: 42px; height: 16px; background: #ffffff; border: 2px solid #111; border-radius: 8px; box-shadow: 0 3px 6px rgba(0,0,0,0.6); }

#canvas-container { flex-grow: 1; aspect-ratio: 2 / 1; border: 10px solid #3d230d; border-radius: 12px; box-shadow: 0 15px 35px rgba(0,0,0,0.7); overflow: hidden; box-sizing: border-box; min-height: 200px; contain: layout style; }
#canvas-container canvas { display: block; width: 100% !important; height: 100% !important; }

#color-sidebar-board { display: flex; flex-direction: column; align-items: center; background: rgba(30, 30, 30, 0.9); border: 1px solid #2a2a2a; border-radius: 12px; padding: 15px 12px; box-shadow: 0 8px 20px rgba(0,0,0,0.4); min-width: 80px; box-sizing: border-box; }
.sidebar-title { font-size: 0.7rem; font-weight: 800; letter-spacing: 1px; color: #888; margin: 0 0 12px 0; text-align: center; }
.color-options-grid { display: flex; flex-direction: column; gap: 12px; }
.color-btn { width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; box-shadow: 0 4px 6px rgba(0,0,0,0.3); transition: all 0.2s ease; }
.color-btn:hover { transform: scale(1.1); }
.color-btn.active { border-color: #00ffcc; box-shadow: 0 0 10px #00ffcc; }

/* Cue Stick Panel */
.cue-stick-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}
.cue-nav-arrows {
    display: flex;
    align-items: center;
    gap: 6px;
}
.cue-arrow-btn {
    background: #2a2a2a;
    color: #aaa;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}
.cue-arrow-btn:hover {
    background: #00ffcc;
    color: #000;
    border-color: #00ffcc;
}
.cue-preview {
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
#cue-name-display {
    font-size: 0.65rem;
    color: #00ffcc;
    font-weight: bold;
    text-align: center;
    margin-top: 4px;
    white-space: nowrap;
}
.cue-length-control {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
}
#cue-length-display {
    color: #aaa;
    font-size: 0.6rem;
    min-width: 30px;
    text-align: center;
}
#chalk-btn {
    background: #2255cc;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.6rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
#chalk-btn:hover {
    background: #3366dd;
    transform: scale(1.05);
}
#chalk-fill {
    width: 100%;
    height: 100%;
    background: #5588ff;
    position: absolute;
    bottom: 0;
    transition: height 0.3s ease;
}

/* 🕳️ Pocket Size Preset Buttons */
.pocket-preset-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}
.pocket-btn {
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.6rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    width: 100%;
    border: 2px solid transparent;
}
.pocket-btn:hover {
    transform: scale(1.04);
}
#pocket-desc {
    font-size: 0.55rem;
    color: #666;
    text-align: center;
    margin-top: 4px;
    line-height: 1.3;
}

/* 🎨 Table Design Navigator */
.table-design-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}
.td-arrow-btn {
    background: #2a2a2a;
    color: #aaa;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}
.td-arrow-btn:hover {
    background: #00ffcc;
    color: #000;
    border-color: #00ffcc;
}
#table-design-name {
    font-size: 0.65rem;
    color: #00ffcc;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.table-design-dots {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 6px;
}
.td-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin: 0 2px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.td-dot:hover {
    transform: scale(1.3);
}

/* ==========================================================================
   🌐 WEBSITE FOOTER LAYER STYLING
   ========================================================================== */
#main-web-footer {
    width: 100%;
    background: #111111;
    border-top: 2px solid #222222;
    padding: 40px 0 0 0;
    margin-top: auto; /* Keeps footer pinned to the document bottom boundaries */
}

.footer-container {
    width: 90vw;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 40px;
    padding-bottom: 30px;
}

.footer-column {
    display: flex;
    flex-direction: column;
}

.website-details-col {
    max-width: 450px;
}

.footer-col-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 15px 0;
    border-left: 3px solid #00ffcc;
    padding-left: 10px;
}

.footer-desc-text {
    color: #888888;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.footer-menu-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-menu-col a {
    color: #888888;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}
.footer-menu-col a:hover {
    color: #00ffcc;
}

.footer-contact-col {
    min-width: 220px;
}
.footer-contact-col address a {
    text-decoration: none;
}
.footer-contact-col address a:hover {
    text-decoration: underline;
}

.footer-copyright-bar {
    width: 100%;
    background: #0a0a0a;
    padding: 15px 0;
    border-top: 1px solid #1c1c1c;
    text-align: center;
}
.footer-copyright-bar p {
    margin: 0;
    color: #555555;
    font-size: 0.8rem;
}

/* ==========================================================================
   📱 RESPONSIVE ORIENTATION MECHANISMS GUARD
   ========================================================================== */
@media screen and (orientation: portrait) and (max-width: 900px) {
    /* Only block the game area in portrait — let users browse nav & footer */
    #game-wrapper {
        position: relative;
    }
    #game-wrapper::before {
        content: "🔄 Please rotate your device to Landscape (Horizontal) to play 15BallPool Pro!";
        position: absolute;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(20, 20, 20, 0.95);
        color: #fff; z-index: 99999;
        display: flex; justify-content: center; align-items: center;
        font-size: 1rem; font-weight: bold; padding: 20px; text-align: center;
        border-radius: 12px;
    }
    #hud-overlay, #table-layout-container { display: none; }
}

/* ==========================================================================
   📱 MOBILE NAV RESPONSIVE
   ========================================================================== */
@media screen and (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        gap: 10px;
    }
    .header-menu-links {
        gap: 12px;
        order: 3;
        width: 100%;
        justify-content: center;
    }
    .header-menu-links a {
        font-size: 0.8rem;
    }
    .header-social-icons {
        gap: 8px;
    }
    .social-icon {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    .brand-png-logo {
        height: 30px;
    }
    #hud-overlay {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 12px;
    }
    .player-profile {
        min-width: auto;
        flex: 1;
    }
    #player2-card {
        text-align: left;
        justify-content: flex-start;
    }
    #player2-card .ball-pocketed-rack {
        justify-content: flex-start;
    }
    #center-hud-display {
        order: -1;
        width: 100%;
    }
    #status-msg {
        font-size: 0.8rem;
        max-width: 100%;
    }
    #shot-stats-display {
        font-size: 0.6rem;
        padding: 1px 6px;
    }
    .avatar {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }
    .username {
        font-size: 0.85rem;
    }
    #table-layout-container {
        flex-direction: column;
    }
    #color-sidebar-board {
        flex-direction: row;
        min-width: auto;
        width: 100%;
        justify-content: center;
        padding: 10px;
    }
    .color-options-grid {
        flex-direction: row;
    }
    .color-btn {
        width: 30px;
        height: 30px;
    }
    .pocket-preset-grid {
        flex-direction: row;
        gap: 3px;
    }
    .pocket-btn {
        font-size: 0.5rem;
        padding: 2px 5px;
    }
    #power-rail-container {
        height: 200px;
        width: 30px;
    }
    #power-handle {
        width: 36px;
        height: 14px;
    }
    .footer-container {
        flex-direction: column;
        gap: 20px;
    }
    .website-details-col {
        max-width: 100%;
    }
}

/* ==========================================================================
   📤 SHARE BUTTON & POPUP STYLING
   ========================================================================== */
#share-btn {
    background: none;
    border: 2px solid #444;
    border-radius: 8px;
    color: #aaa;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.2s ease;
    line-height: 1;
}
#share-btn:hover {
    border-color: #00ffcc !important;
    color: #00ffcc !important;
    transform: scale(1.1);
}

/* Font Awesome icon base styling */
.fa-brands, .fa-solid {
    pointer-events: none;  /* Let parent handle clicks */
}
.social-icon .fa-brands,
.social-icon .fa-solid {
    font-size: 1.15rem;
    line-height: 1;
}

/* Header social icon mobile */
@media screen and (max-width: 768px) {
    .header-social-icons {
        gap: 6px;
    }
    .social-icon {
        width: 30px;
        height: 30px;
        font-size: 0.95rem;
    }
}

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

.share-platform-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #222;
    border: 1px solid #333;
    border-radius: 8px;
    color: #ddd;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}
.share-platform-btn:hover {
    transform: scale(1.03);
}
.share-platform-btn:active {
    transform: scale(0.97);
}

/* ==========================================================================
   💬 GAME COMMENTARY SYSTEM
   ========================================================================== */
#commentary-container {
    position: fixed;
    top: 12%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
    text-align: center;
    width: auto;
    max-width: 85vw;
    /* Prevent CLS: container is position:fixed so it never affects document flow */
    contain: layout style paint;
}

.commentary-message {
    display: inline-block;
    padding: 10px 28px;
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(0, 255, 204, 0.3);
    border-radius: 16px;
    color: #00ffcc;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    text-shadow: 0 2px 12px rgba(0, 255, 204, 0.25), 0 2px 4px rgba(0,0,0,0.5);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transform: scale(0.7) translateY(-10px);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap;
    /* Prevent CLS: no layout-affecting properties in transition */
}

.commentary-message.commentary-visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.commentary-message.commentary-fadeout {
    opacity: 0;
    transform: scale(0.95) translateY(5px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

/* Mobile responsive */
@media screen and (max-width: 768px) {
    #commentary-container { top: 10%; }
    .commentary-message {
        font-size: 1rem;
        padding: 8px 18px;
        white-space: normal;
    }
}

/* Fullscreen mode */
#game-wrapper.fs-mode #commentary-container,
#game-wrapper:fullscreen #commentary-container {
    top: 8%;
}

/* Fullscreen compact share button */
#game-wrapper.fs-mode #share-btn,
#game-wrapper:fullscreen #share-btn {
    font-size: 0.9rem;
    padding: 2px 6px;
}

/* Mobile responsive for share popup */
@media screen and (max-width: 480px) {
    #share-popup-overlay > div {
        padding: 20px 16px !important;
    }
}

/* ==========================================================================
   📝 BLOG ARTICLE SHARED STYLES (used by all /blog/*.html pages)
   ========================================================================== */
.article-body { max-width: 800px; margin: 0 auto; padding: 30px 20px; }
.article-body h1 { color: #fff; font-size: 2rem; margin: 0 0 10px; }
.article-body .meta { color: #888; font-size: 0.9rem; margin-bottom: 20px; }
.article-body .meta i { margin-right: 4px; }
.article-body .featured-img { width: 100%; border-radius: 12px; margin-bottom: 25px; }
.article-body h2 { color: #00ffcc; font-size: 1.4rem; margin: 30px 0 12px; }
.article-body h3 { color: #fff; font-size: 1.15rem; margin: 25px 0 10px; }
.article-body p, .article-body li { color: #ccc; line-height: 1.7; font-size: 1rem; }
.article-body ul, .article-body ol { padding-left: 20px; }
.article-body li { margin-bottom: 6px; }
.article-body .tip-box { background: #0d421622; border-left: 3px solid #00ffcc; padding: 15px 20px; border-radius: 8px; margin: 20px 0; }
.article-body .tip-box strong { color: #00ffcc; }
.article-body .tip-box p { margin: 5px 0 0; }
.article-body .faq-item { background: #161616; border: 1px solid #2b2b2b; border-radius: 8px; padding: 15px 20px; margin-bottom: 10px; }
.article-body .faq-item h3 { margin: 0 0 6px; font-size: 1rem; }
.article-body .table-wrap { overflow-x: auto; margin: 20px 0; }
.article-body table { width: 100%; border-collapse: collapse; }
.article-body th, .article-body td { padding: 10px 14px; text-align: left; border-bottom: 1px solid #2b2b2b; font-size: 0.9rem; }
.article-body th { background: #1a1a1a; color: #00ffcc; font-weight: 600; }
.article-body td { color: #ccc; }
.article-nav { display: flex; justify-content: space-between; gap: 15px; margin-top: 40px; padding-top: 20px; border-top: 1px solid #2b2b2b; }
.article-nav a { background: #222; border: 1px solid #333; border-radius: 8px; padding: 12px 18px; color: #ddd; text-decoration: none; flex: 1; transition: border-color 0.2s; font-size: 0.9rem; }
.article-nav a:hover { border-color: #00ffcc; }
.article-nav .next { text-align: right; }
.article-nav .label { color: #888; font-size: 0.75rem; text-transform: uppercase; }
.article-nav .title { color: #00ffcc; font-weight: 600; }
@media screen and (max-width: 768px) {
    .article-body h1 { font-size: 1.5rem; }
    .article-nav { flex-direction: column; }
    .article-nav .next { text-align: left; }
}