/* ============================================================
   DAME GAME — Premium Dark UI
   ============================================================ */

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

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:         #0A0E1A;
    --surface:    #12162A;
    --surface2:   #1C2138;
    --border:     rgba(255,215,0,0.12);
    --gold:       #FFD700;
    --gold2:      #FFA500;
    --purple:     #00E676;     /* Primary 3D Green Accent */
    --text:       #E8E8F0;
    --text-dim:   #6C6C8A;
    --success:    #00FF87;
    --danger:     #FF4444;
    --radius:     18px;
    --trans:      0.22s ease;
}

html {
    height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
    height: 100%;
    /* Prevent double-tap zoom */
    touch-action: manipulation;
    /* iOS safe-area bottom (home bar) */
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* ─── APP SHELL ─── */
#app {
    width: 100vw;
    height: 100vh;        /* base: works everywhere */
    height: 100dvh;       /* modern: excludes browser chrome */
    position: relative;
    overflow: hidden;
}

/* iOS Safari ONLY fix — scoped so it never runs on Chrome/Samsung.
   -webkit-touch-callout is an iOS-exclusive property. */
@supports (-webkit-touch-callout: none) {
    html { height: -webkit-fill-available; }
    body { min-height: -webkit-fill-available; }
    #app { height: -webkit-fill-available; }
}

/* ─── SCREENS ─── */
.screen {
    position: absolute;
    inset: 0;
    /* iOS smooth scroll */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 16px 16px;
    /* account for iOS notch top */
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateX(120%);
    transition: transform 0.35s cubic-bezier(0.35,0,0.15,1);
    gap: 10px;
    background: transparent;
}
#menuScreen {
    padding-top: calc(48px + env(safe-area-inset-top, 0px));
}
.screen.active { transform: translateX(0); }
.screen h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    align-self: flex-start;
}

/* ─── MENU ─── */
.menu-logo {
    text-align: center;
    padding: 32px 0 16px;
}
.menu-logo .icon {
    font-size: 72px;
    filter: drop-shadow(0 0 24px rgba(255,215,0,0.45));
    animation: crown-pulse 2.8s ease-in-out infinite;
}
@keyframes crown-pulse {
    0%, 100% { transform: scale(1) rotate(-3deg); }
    50%       { transform: scale(1.07) rotate(3deg); }
}
.menu-logo h1 {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FF6B00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}
.menu-logo p {
    color: var(--text-dim);
    font-size: 13px;
    margin-top: 4px;
}

.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    max-width: 400px;
}
.menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom: 4px solid rgba(0,0,0,0.4);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, border-bottom-width 0.1s, box-shadow 0.1s;
    position: relative;
    padding: 10px 16px;
}
.menu-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,230,118,0.06) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.2s;
}
.menu-btn:hover::before { opacity: 1; }
.menu-btn:active {
    transform: translateY(3px);
    border-bottom-width: 1px;
}
.menu-btn.primary {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #00FF87 0%, #00C853 100%);
    border-color: transparent;
    border-bottom: 5px solid #008a38;
    font-size: 17px;
    padding: 14px 20px;
    color: #0A0E1A;
    font-weight: 800;
    box-shadow: 0 8px 24px rgba(0,255,135,0.25);
}
.menu-btn.primary:active {
    transform: translateY(4px);
    border-bottom-width: 1px;
    box-shadow: 0 3px 12px rgba(0,255,135,0.15);
}
.menu-btn .emoji { font-size: 26px; }
.emoji-large {
    font-size: 20px;
    vertical-align: middle;
    margin-right: 6px;
    display: inline-block;
}

.back-btn {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-bottom: 3.5px solid rgba(0,0,0,0.4);
    border-radius: 12px;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 14px;
    padding: 10px 24px;
    cursor: pointer;
    transition: transform 0.1s, border-bottom-width 0.1s, color 0.2s;
    margin-top: 8px;
    align-self: center;
}
.back-btn:hover { color: var(--text); border-color: rgba(255,215,0,0.3); }
.back-btn:active {
    transform: translateY(2.5px);
    border-bottom-width: 1px;
}
.mode-option {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
    padding: 18px 20px;
    cursor: pointer;
    text-align: left;
    transition: var(--trans);
    line-height: 1.3;
}
.mode-option .sub {
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 400;
    margin-top: 3px;
}
.mode-option:hover, .mode-option:active {
    border-color: rgba(255,215,0,0.35);
    background: var(--surface2);
    transform: translateX(4px);
}
.mode-option.expert {
    border-color: rgba(255,107,107,0.3);
    background: linear-gradient(120deg, #1C2138 80%, rgba(255,107,107,0.07) 100%);
}

.back-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 14px;
    padding: 10px 24px;
    cursor: pointer;
    transition: var(--trans);
    margin-top: 8px;
    align-self: center;
}
.back-btn:hover { color: var(--text); border-color: rgba(255,215,0,0.3); }

/* ─── ONLINE SETUP ─── */
.join-room-form { width: 100%; max-width: 400px; }
.room-input {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    font-family: 'Outfit', monospace;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 6px;
    text-align: center;
    padding: 16px;
    outline: none;
    transition: border-color 0.2s;
}
.room-input::placeholder { letter-spacing: 2px; color: var(--text-dim); font-size: 13px; }
.room-input:focus { border-color: var(--gold); }

.room-code-big {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: 8px;
    color: var(--gold);
    background: var(--surface2);
    border: 2px solid var(--border);
    border-radius: 14px;
    padding: 14px 24px;
    display: inline-block;
    font-family: 'Outfit', monospace;
}

/* ─── GAME SCREEN ─── */
#gameScreen {
    padding: 0;
    gap: 0;
    overflow: hidden;
}

/* Top bar */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(12,16,30,0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    width: 100%;
    flex-shrink: 0;
    z-index: 10;
}
.top-bar .left, .top-bar .right { display: flex; align-items: center; gap: 8px; }
.game-title { font-weight: 700; font-size: 16px; color: var(--gold); }
.top-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 18px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--trans);
}
.top-btn:hover { background: var(--surface2); border-color: rgba(255,215,0,0.3); }

/* Stats */
.game-stats {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    width: 100%;
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.stat-item {
    font-size: 13px;
    color: var(--text-dim);
    white-space: nowrap;
    padding: 2px 8px;
    background: var(--surface2);
    border-radius: 8px;
    border: 1px solid var(--border);
}
.stat-item .value { font-weight: 700; color: var(--text); }
.stat-item .value.gold { color: var(--gold); }

/* Mode selector */
.mode-selector {
    display: flex;
    gap: 6px;
    padding: 8px 16px;
    width: 100%;
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.mode-btn {
    flex: 0 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 14px;
    cursor: pointer;
    transition: var(--trans);
    white-space: nowrap;
}
.mode-btn.active {
    background: var(--gold);
    color: #0A0E1A;
    border-color: var(--gold);
}
.mode-btn:not(.active):hover { border-color: rgba(255,215,0,0.4); color: var(--text); }

/* Turn indicator */
.turn-indicator {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    width: 100%;
    flex-shrink: 0;
    background: rgba(255,215,0,0.06);
    border-bottom: 1px solid var(--border);
    letter-spacing: 0.2px;
    color: var(--gold);
    transition: color 0.3s, background 0.3s;
}
.turn-indicator.forced { background: rgba(255,68,68,0.12); }

/* ─── TIMER ─── */
.timer-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px;
    width: 100%;
    flex-shrink: 0;
    background: rgba(12,16,30,0.6);
    border-bottom: 1px solid var(--border);
    transition: opacity 0.3s;
}
.timer-label { font-size: 14px; flex-shrink: 0; }
.timer-track {
    flex: 1;
    height: 7px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    overflow: hidden;
}
.timer-bar {
    height: 100%;
    width: 100%;
    background: var(--gold);
    border-radius: 4px;
    transition: width 1s linear, background 0.5s;
    transform-origin: left;
}
.timer-seconds {
    font-size: 14px;
    font-weight: 700;
    color: var(--gold);
    width: 26px;
    text-align: center;
    flex-shrink: 0;
}

/* ─── VIEW CONTROLS ─── */
.view-controls {
    display: flex;
    gap: 6px;
    padding: 6px 16px;
    width: 100%;
    flex-shrink: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.view-btn {
    flex: 1;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 4px;
    cursor: pointer;
    transition: var(--trans);
}
.view-btn.active {
    background: rgba(123,97,255,0.2);
    border-color: var(--purple);
    color: var(--purple);
}

/* ─── SVG BOARD ─── */
.board-wrapper {
    flex: 1;
    min-height: 0;          /* CRITICAL: prevents flex overflow on iOS Safari */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    overflow: hidden;
    width: 100%;
}

.board-svg-container {
    position: relative;
    /* Width & height calculated below in responsive section */
    width: 100%;
    max-width: min(94vw, 84vh);
    /* aspect-ratio kept in JS via inline style (varies by mode) */
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        0 0 0 2px rgba(255,215,0,0.18),
        0 12px 60px rgba(0,0,0,0.7),
        0 0 80px rgba(123,97,255,0.12);
    transition: transform 0.4s cubic-bezier(0.35,0,0.15,1),
                box-shadow 0.4s;
    background: #1a1a2e;
    /* IMPORTANT: must have a non-zero height for absolute children (svg layers) */
    /* Height is set via aspect-ratio or padding-bottom trick in JS */
}

.svg-layer {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: block;
    pointer-events: none;
    object-fit: fill;
}
.svg-overlay {
    cursor: pointer;
    pointer-events: all;
}

/* View transforms */
.view-isometric {
    transform: rotateX(38deg) rotateZ(-20deg) scale(0.9);
    box-shadow: 0 60px 120px rgba(0,0,0,0.8);
}
.view-top {
    transform: rotateX(90deg) scale(0.9);
    box-shadow: none;
}
.view-front { transform: none; }

/* Piece animation — NO loop; only animate king promotion via .king-new class */
@keyframes piece-appear {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
/* piece-group: NO animation by default — avoids re-firing on every render() */
.piece-group { /* animation removed — was looping on every click */ }
.king-new { animation: piece-appear 0.35s ease; }
.piece-active { filter: drop-shadow(0 0 7px rgba(255,215,0,0.65)); }
.piece-active-ring { filter: drop-shadow(0 0 7px rgba(255,215,0,0.65)); }

/* ─── MESSAGE ─── */
.message {
    width: 100%;
    flex-shrink: 0;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    background: rgba(255,215,0,0.06);
    border-top: 1px solid var(--border);
    transition: background 0.3s, color 0.3s;
}
.message.info    { color: var(--text-dim); }
.message.success { color: var(--success); background: rgba(0,255,135,0.06); }
.message.error   { color: var(--danger);  background: rgba(255,68,68,0.06); }
.message.forced  { color: #FF8800; background: rgba(255,136,0,0.08); font-weight:700; }

/* ─── BOTTOM CONTROLS ─── */
.bottom-controls {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    width: 100%;
    flex-shrink: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
}
.ctrl-btn {
    flex: 1;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-bottom: 3.5px solid rgba(0,0,0,0.4);
    border-radius: 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    padding: 10px 4px;
    cursor: pointer;
    transition: transform 0.1s, border-bottom-width 0.1s;
}
.ctrl-btn:hover { border-color: rgba(255,215,0,0.35); background: var(--surface); }
.ctrl-btn:active {
    transform: translateY(2.5px);
    border-bottom-width: 1px;
}
.ctrl-btn.primary {
    background: linear-gradient(135deg, #00FF87 0%, #00C853 100%);
    border-color: transparent;
    border-bottom: 4px solid #008a38;
    color: #0A0E1A;
    font-weight: 800;
}
.ctrl-btn.primary:active {
    transform: translateY(3px);
    border-bottom-width: 1px;
}
.ctrl-btn.ad {
    background: linear-gradient(135deg, #1a1a2e, #1a1a2e);
    border-color: rgba(0,255,135,0.3);
    color: var(--success);
}

/* ─── MODAL / OVERLAY ─── */
#modalOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(6px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}
#modalOverlay.open {
    opacity: 1;
    pointer-events: all;
}
#modalBox {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px 24px;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 24px 80px rgba(0,0,0,0.5);
    animation: modal-in 0.28s cubic-bezier(0.35,0,0.15,1);
}
@keyframes modal-in {
    from { transform: scale(0.85) translateY(16px); opacity:0; }
    to   { transform: scale(1)    translateY(0);    opacity:1; }
}

/* Loading spinner inside modal */
.loading-spin {
    font-size: 36px;
    animation: spin 1s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── CELEBRATION (confetti / winner) ─── */
#celebrationOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s;
}
#celebrationOverlay.show {
    opacity: 1;
    pointer-events: all;
}
.winner-card {
    background: linear-gradient(135deg, #1C2138, #12162A);
    border: 2px solid var(--gold);
    border-radius: 28px;
    padding: 36px 40px;
    text-align: center;
    box-shadow: 0 0 80px rgba(255,215,0,0.2);
    animation: winner-pop 0.5s cubic-bezier(0.35,0,0.15,1);
}
@keyframes winner-pop {
    from { transform: scale(0.5) rotate(-8deg); opacity: 0; }
    to   { transform: scale(1)   rotate(0);     opacity: 1; }
}
.winner-emoji { font-size: 72px; margin-bottom: 12px; }
.winner-title { font-size: 28px; font-weight: 800; color: var(--gold); }
.winner-sub   { font-size: 14px; color: var(--text-dim); margin-top: 8px; }

/* ─── SHOP ─── */
.menu-coins-bar {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px 14px;
    font-size: 14px;
    font-weight: 700;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.shop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 440px;
    margin-bottom: 8px;
    margin-top: 12px;
}
.shop-coins-indicator {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px 14px;
    font-size: 15px;
    font-weight: 700;
    color: var(--gold);
}

.shop-tabs {
    display: flex;
    gap: 4px;
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 4px;
    border-radius: 14px;
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
}
.shop-tabs::-webkit-scrollbar { display: none; }
.shop-tab-btn {
    flex: 1;
    min-width: 70px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 10px 4px;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--trans);
}
.shop-tab-btn.active {
    background: var(--surface2);
    color: var(--gold);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.shop-tab-content {
    display: none;
    width: 100%;
    max-width: 440px;
    flex: 1;
}
.shop-tab-content.active {
    display: block;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 12px 0 24px;
}

.shop-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    transition: var(--trans);
}
.shop-card:hover {
    border-color: rgba(255,215,0,0.3);
    transform: translateY(-2px);
}
.shop-flag-preview.round {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.15);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    background: rgba(255,255,255,0.05);
}
.shop-flag-preview.round img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.shop-card-emoji {
    font-size: 44px;
    margin-bottom: 8px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.shop-card-emoji .play-hint {
    position: absolute;
    bottom: -2px; right: -4px;
    font-size: 10px;
    background: var(--gold);
    color: #000;
    border-radius: 40%;
    padding: 2px 4px;
}
.shop-card-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
}
.shop-card-desc {
    font-size: 11px;
    color: var(--text-dim);
    line-height: 1.3;
    margin-bottom: 12px;
    flex: 1;
}

.shop-action {
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--trans);
}
.shop-action.price {
    background: linear-gradient(135deg, var(--gold), var(--gold2));
    color: #0A0E1A;
}
.shop-action.owned {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
}
.shop-action.active {
    background: rgba(0, 255, 135, 0.15);
    border: 1px solid var(--success);
    color: var(--success);
    cursor: default;
}
.shop-action:not(.active):active {
    transform: scale(0.96);
}

.shop-color-box {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.15);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.shop-earn-btn {
    margin-top: 8px;
    width: 100%;
    padding: 6px;
    border: 1px solid rgba(0, 255, 135, 0.25);
    background: rgba(0, 255, 135, 0.05);
    color: var(--success);
    border-radius: 8px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--trans);
}
.shop-earn-btn:hover {
    background: rgba(0, 255, 135, 0.12);
}

/* Sights specific styles */
.moves-card {
    grid-column: span 2;
    text-align: left;
    align-items: flex-start;
}
.moves-stat-box {
    font-size: 11px;
    font-weight: 700;
    color: var(--purple);
    background: rgba(123, 97, 255, 0.12);
    padding: 4px 10px;
    border-radius: 6px;
}

/* Sights animated threat highlight */
@keyframes pulse-threat-ring {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 0.3; }
    100% { transform: scale(0.9); opacity: 0.8; }
}
.pulse-threat {
    animation: pulse-threat-ring 1.8s infinite ease-in-out;
    transform-origin: center;
}

/* ─── SETTINGS ─── */
.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 400px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.setting-item .label { font-weight: 500; }
.toggle {
    width: 46px; height: 26px;
    background: var(--surface2);
    border-radius: 13px;
    border: 1px solid var(--border);
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}
.toggle::after {
    content: '';
    position: absolute;
    width: 20px; height: 20px;
    background: #fff;
    border-radius: 50%;
    top: 2px; left: 2px;
    transition: left 0.2s;
}
.toggle.active { background: var(--success); border-color: var(--success); }
.toggle.active::after { left: 22px; }

/* ─── TOURNAMENT / FRIENDS ─── */
.tournament-item, .friend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
}
.tournament-item .name, .friend-item .name { font-weight: 600; }
.join-btn, .invite-btn {
    background: linear-gradient(135deg, var(--purple), #4A9EFF);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 16px;
    cursor: pointer;
    transition: transform 0.15s;
}
.join-btn:active, .invite-btn:active { transform: scale(0.95); }
.friend-connect {
    width: 100%;
    max-width: 400px;
    background: rgba(74,158,255,0.1);
    border: 1px solid rgba(74,158,255,0.3);
    border-radius: var(--radius);
    color: #4A9EFF;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 14px;
    cursor: pointer;
    transition: var(--trans);
}

/* ─── VIP LEADERBOARD ─── */
.lb-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 440px;
    margin-bottom: 4px;
    flex-shrink: 0;
}
.lb-level-select {
    display: flex;
    gap: 4px;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 4px;
    border-radius: 14px;
    overflow-x: auto;
    scrollbar-width: none;
}
.lb-level-select::-webkit-scrollbar { display: none; }
.lb-level-btn {
    flex: 1;
    min-width: 76px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    padding: 8px 4px;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--trans);
}
.lb-level-btn.active {
    background: var(--surface2);
    color: var(--gold);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

/* Podium Styles */
.podium-container {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 440px;
    height: 190px;
    margin-top: 10px;
    padding-bottom: 4px;
    flex-shrink: 0;
}
.podium-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}
.avatar-wrap {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    padding: 3px;
    background: var(--surface2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
.rank-badge {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: #000;
}

/* Border colors for stages */
.border-gold {
    border: 3px solid #D4AF37;
    box-shadow: 0 0 16px rgba(212, 175, 55, 0.4);
}
.border-silver {
    border: 3px solid #C0C0C0;
    box-shadow: 0 0 12px rgba(192, 192, 192, 0.25);
}
.border-bronze {
    border: 3px solid #CD7F32;
    box-shadow: 0 0 10px rgba(205, 127, 50, 0.2);
}

.rank-badge.gold { background: #D4AF37; }
.rank-badge.silver { background: #C0C0C0; }
.rank-badge.bronze { background: #CD7F32; }

/* 1st Place Glow */
.vip-crown-glow {
    animation: gold-glow-pulse 2.2s infinite ease-in-out;
}
@keyframes gold-glow-pulse {
    0%, 100% { box-shadow: 0 0 12px rgba(212, 175, 55, 0.35); }
    50% { box-shadow: 0 0 24px rgba(212, 175, 55, 0.7); }
}

.podium-name {
    font-size: 12px;
    font-weight: 700;
    margin-top: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
}
.podium-score {
    font-size: 11px;
    font-weight: 700;
    color: var(--gold);
    margin-top: 2px;
}

/* Pedestals */
.podium-pedestal {
    width: 100%;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: none;
    transition: box-shadow 0.3s;
}
.p-1 {
    height: 75px;
    margin-top: 4px;
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.25) 0%, rgba(20, 25, 45, 0.85) 100%);
    border: 2px solid #D4AF37;
    border-bottom: none;
    box-shadow: 0 -6px 20px rgba(212, 175, 55, 0.5), inset 0 0 12px rgba(212, 175, 55, 0.2);
    animation: gold-pedestal-glow 2.2s infinite alternate ease-in-out;
}
.p-2 {
    height: 50px;
    margin-top: 4px;
    background: linear-gradient(180deg, rgba(192, 192, 192, 0.2) 0%, rgba(20, 25, 45, 0.85) 100%);
    border: 2px solid #C0C0C0;
    border-bottom: none;
    box-shadow: 0 -5px 15px rgba(192, 192, 192, 0.35), inset 0 0 10px rgba(192, 192, 192, 0.15);
    animation: silver-pedestal-glow 2.2s infinite alternate ease-in-out;
}
.p-3 {
    height: 35px;
    margin-top: 4px;
    background: linear-gradient(180deg, rgba(205, 127, 50, 0.18) 0%, rgba(20, 25, 45, 0.85) 100%);
    border: 2px solid #CD7F32;
    border-bottom: none;
    box-shadow: 0 -4px 12px rgba(205, 127, 50, 0.3), inset 0 0 8px rgba(205, 127, 50, 0.1);
    animation: bronze-pedestal-glow 2.2s infinite alternate ease-in-out;
}

@keyframes gold-pedestal-glow {
    0% { box-shadow: 0 -3px 8px rgba(212, 175, 55, 0.3), inset 0 0 8px rgba(212, 175, 55, 0.15); }
    100% { box-shadow: 0 -10px 25px rgba(212, 175, 55, 0.7), inset 0 0 16px rgba(212, 175, 55, 0.35); }
}
@keyframes silver-pedestal-glow {
    0% { box-shadow: 0 -2px 6px rgba(192, 192, 192, 0.25), inset 0 0 6px rgba(192, 192, 192, 0.15); }
    100% { box-shadow: 0 -8px 20px rgba(192, 192, 192, 0.55), inset 0 0 12px rgba(192, 192, 192, 0.25); }
}
@keyframes bronze-pedestal-glow {
    0% { box-shadow: 0 -2px 4px rgba(205, 127, 50, 0.2), inset 0 0 4px rgba(205, 127, 50, 0.1); }
    100% { box-shadow: 0 -6px 16px rgba(205, 127, 50, 0.5), inset 0 0 10px rgba(205, 127, 50, 0.2); }
}

.pedestal-num {
    font-size: 24px;
    font-weight: 800;
    color: rgba(255,255,255,0.08);
}
.p-1 .pedestal-num { color: rgba(212, 175, 55, 0.25); }

/* Scrollable Rank List */
.lb-list-container {
    width: 100%;
    max-width: 440px;
    flex: 1;
    overflow-y: auto;
    padding-right: 2px;
}
.lb-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 16px;
}
.rank-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: var(--surface);
    border: 1px solid rgba(0, 230, 118, 0.22);
    border-radius: var(--radius);
    padding: 10px 16px;
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.1), inset 0 0 4px rgba(0, 230, 118, 0.05);
    transition: transform var(--trans), border-color var(--trans), box-shadow var(--trans);
}
.rank-item:hover {
    transform: translateX(4px);
    border-color: rgba(0, 230, 118, 0.5);
    box-shadow: 0 0 14px rgba(0, 230, 118, 0.25), inset 0 0 6px rgba(0, 230, 118, 0.15);
}
.rank-item.self {
    border-color: var(--gold);
    background: rgba(255, 215, 0, 0.08);
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.2), inset 0 0 6px rgba(255, 215, 0, 0.1);
}
.rank-item.self:hover {
    border-color: #fff200;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4), inset 0 0 10px rgba(255, 215, 0, 0.25);
}
.rank-item .rank {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dim);
    width: 32px;
}
.rank-item.self .rank { color: var(--gold); }
.rank-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.1);
}
.rank-item.self .rank-avatar {
    border-color: var(--gold);
}
.rank-item .name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
}
.rank-item .score {
    font-size: 13px;
    font-weight: 700;
    color: var(--gold);
}

/* ─── TUTORIAL ─── */
#tutorialScreen { padding: 20px 16px 32px; }
.tutorial-progress {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    align-self: center;
}
.tutorial-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--surface2);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}
.tutorial-dot.active { background: var(--gold); border-color: var(--gold); }
.tutorial-step { display: none; width: 100%; max-width: 400px; }
.tutorial-step.active { display: block; }
.step-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 16px;
}
.step-content p {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 15px;
}
.step-content p:last-child { border-bottom: none; }
.highlight { color: var(--gold); font-weight: 600; }
.tutorial-nav {
    display: flex;
    gap: 8px;
    margin-top: 24px;
}
.tutorial-nav button {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    padding: 12px;
    cursor: pointer;
    transition: var(--trans);
}
.tutorial-nav .next { background: var(--gold); color: #0A0E1A; border-color: var(--gold); font-weight: 700; }
.tutorial-nav .close-tut { flex: 0.7; color: var(--text-dim); }

/* ─── CONFETTI CANVAS — sits ABOVE winner card ─── */
#confettiCanvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 99999;   /* above celebrationOverlay(200) AND winner card */
    opacity: 0;
    transition: opacity 0.5s;
}
#confettiCanvas.show { opacity: 1; }

/* ─── SCROLLBAR ─── */
.screen::-webkit-scrollbar { width: 4px; }
.screen::-webkit-scrollbar-track { background: transparent; }
.screen::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ════════════════════════════════════════════════
   RESPONSIVE — iOS / Android / Tablet
   ════════════════════════════════════════════════ */

/* ── iPhone SE / mini (height < 670px) ── */
@media (max-height: 670px) {
    .top-bar       { padding: 6px 12px; }
    .game-stats    { padding: 4px 12px; }
    .mode-selector { padding: 4px 12px; }
    .turn-indicator{ padding: 5px 12px; font-size: 12px; }
    .timer-wrap    { padding: 4px 12px; }
    .view-controls { display: none; }        /* hide 3D/Top view on tiny screens */
    .board-wrapper { padding: 4px 8px; }
    .message       { padding: 5px 12px; font-size: 12px; min-height: 28px; }
    .bottom-controls { padding: 6px 12px; }
    .ctrl-btn      { padding: 8px 4px; font-size: 11px; }
    .winner-card   { padding: 20px 24px; }
    .winner-emoji  { font-size: 48px; }
    .winner-title  { font-size: 22px; }
}

/* ── Very tall phones (height > 800px) ── */
@media (min-height: 800px) {
    .board-wrapper { padding: 12px 16px; }
    .menu-logo .icon { font-size: 84px; }
    .menu-logo h1    { font-size: 36px; }
}

/* ── Tablet / iPad ── */
@media (min-width: 600px) {
    .menu-grid { max-width: 480px; }
    .board-wrapper { padding: 16px 24px; }
    .bottom-controls { gap: 12px; padding: 12px 24px; }
    #gameScreen .board-svg-container { max-width: min(85vh, 760px); }
    .mode-option { font-size: 18px; }
}

/* ── Landscape phones ── */
@media (orientation: landscape) and (max-height: 500px) {
    #gameScreen { flex-direction: row; flex-wrap: wrap; }
    .top-bar, .game-stats, .mode-selector { width: 100%; }
    .board-wrapper {
        flex: 1;
        padding: 4px;
        align-self: stretch;
        justify-content: flex-start;
    }
    .board-svg-container { max-width: min(90vh, 90%) !important; }
    .turn-indicator, .timer-wrap { font-size: 11px; padding: 3px 8px; }
    .view-controls { display: none; }
    .bottom-controls {
        flex-direction: column;
        width: 160px;
        border-top: none;
        border-left: 1px solid var(--border);
        padding: 8px;
        justify-content: center;
    }
}

/* ── iOS notch / dynamic island safe areas ── */
@supports (padding-top: env(safe-area-inset-top)) {
    .top-bar {
        padding-top: calc(10px + env(safe-area-inset-top, 0px));
    }
    .bottom-controls {
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }
    .screen {
        padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
    }
}

/* ── Board height constraint: never taller than available space ── */
#gameScreen .board-svg-container {
    max-height: calc(100dvh - 180px);
    max-height: calc(100vh - 180px); /* fallback */
    max-width: min(94vw, calc(100dvh - 180px));
}

/* Make sure SVG overlay fills the container's actual rendered size */
.board-svg-container > svg.svg-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

/* Force all interactive elements touchable */
button, [onclick] { touch-action: manipulation; }

/* ─── ONBOARDING ─── */
.onboarding-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 420px;
    width: 100%;
    margin: auto 0;
    gap: 16px;
}
.onboarding-image-wrap {
    width: 200px;
    height: 200px;
    margin: 0 auto;
    position: relative;
    perspective: 1000px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid var(--gold);
    box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 20px rgba(255,215,0,0.25);
    background: var(--surface);
}
.onboarding-img {
    width: 90%;
    height: 90%;
    object-fit: contain;
    transform: rotateX(20deg) rotateY(-10deg) rotateZ(5deg);
    filter: drop-shadow(0 15px 25px rgba(255,215,0,0.35)) drop-shadow(0 4px 10px rgba(0,0,0,0.6));
    animation: float-3d 3.5s infinite alternate ease-in-out;
}
@keyframes float-3d {
    0% { transform: rotateX(20deg) rotateY(-10deg) rotateZ(5deg) translateY(0); }
    100% { transform: rotateX(22deg) rotateY(-8deg) rotateZ(6deg) translateY(-8px); }
}
/* Shine Sparkle Overlay Sweep */
.onboarding-image-wrap::after {
    content: '';
    position: absolute;
    top: 0; left: -150%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: skewX(-20deg);
    animation: onboarding-sparkle 3s infinite;
    pointer-events: none;
}
@keyframes onboarding-sparkle {
    0% { left: -150%; }
    30% { left: 150%; }
    100% { left: 150%; }
}
.onboarding-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: 1.5px;
    margin-top: 10px;
    text-shadow: 0 0 10px rgba(255,215,0,0.25);
}
.onboarding-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-dim);
    padding: 0 12px;
}
.onboarding-btn {
    width: 100%;
    margin-top: 12px;
    box-shadow: 0 6px 24px rgba(0,255,135,0.3);
}

/* ─── LOADING & 3D SPARKLING IMAGE ─── */
.loading-3d-wrap {
    position: relative;
    width: 75%;
    max-width: 260px;
    aspect-ratio: 1;
    margin: auto 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.loading-3d-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.08);
    animation: pulse-smooth 2.2s ease-in-out infinite;
    will-change: transform;
}

/* Light sparkle swipe using simple gradient without mix-blend-mode overlay */
.sparkle-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
    border-radius: 20px;
    background: linear-gradient(
        135deg,
        rgba(255,255,255,0) 40%,
        rgba(255,255,255,0.12) 50%,
        rgba(255,255,255,0) 60%
    );
    background-size: 200% 200%;
    animation: pulse-smooth 2.2s ease-in-out infinite, sparkle-sweep 3s linear infinite;
    will-change: transform, background-position;
}

@keyframes pulse-smooth {
    0% { transform: translateY(0) scale(0.98); }
    50% { transform: translateY(-8px) scale(1.02); }
    100% { transform: translateY(0) scale(0.98); }
}

@keyframes sparkle-sweep {
    0% { background-position: -150% 0; }
    100% { background-position: 150% 0; }
}

.loading-progress-container {
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: auto;
}
.loading-text-hint {
    font-size: 13px;
    color: var(--text-dim);
    text-align: center;
    font-weight: 500;
}
.loading-progress-track {
    width: 100%;
    height: 6px;
    background: var(--surface);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
}
.loading-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--purple), var(--gold));
    border-radius: 3px;
    transition: width 0.05s linear;
}

/* ─── SETTINGS AVATAR PICKER ─── */
.setting-avatar-section {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.setting-avatar-section h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--gold);
}
.avatar-source-select {
    display: flex;
    gap: 6px;
}
.avatar-source-btn {
    flex: 1;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    padding: 8px;
    cursor: pointer;
    transition: var(--trans);
}
.avatar-source-btn.active {
    background: rgba(123,97,255,0.2);
    border-color: var(--purple);
    color: var(--purple);
}
.preset-avatar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-height: 160px;
    overflow-y: auto;
    padding-right: 4px;
}
.preset-avatar-grid::-webkit-scrollbar { width: 4px; }
.preset-avatar-grid::-webkit-scrollbar-track { background: transparent; }
.preset-avatar-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.avatar-picker-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--trans);
}
.avatar-picker-card img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
}
.avatar-picker-card span {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-dim);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}
.avatar-picker-card:hover {
    border-color: rgba(255,215,0,0.3);
}
.avatar-picker-card.selected {
    border-color: var(--gold);
    background: rgba(255,215,0,0.08);
}
.avatar-picker-card.selected img {
    border-color: var(--gold);
}

/* ─── TOURNAMENT 4P SEATS & CORNERS ─── */
.corners-layer {
    pointer-events: none;
    z-index: 1; /* beneath svg interactive layer, above board bg */
}
.board-corner-seat {
    position: absolute;
    width: 25%;
    height: 25%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.corner-ul { top: 0; left: 0; }
.corner-ur { top: 0; right: 0; }
.corner-dl { bottom: 0; left: 0; }
.corner-dr { bottom: 0; right: 0; }

.corner-bg-img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    opacity: 0.85;
}
.corner-player-tag {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.corner-player-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    box-shadow: 0 4px 8px rgba(0,0,0,0.6);
    object-fit: cover;
}
.corner-player-name {
    font-size: 11px;
    font-weight: 750;
    color: #fff;
    background: rgba(10,14,26,0.85);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

/* Mobile responsive scaling adjustments for 4P corners */
@media (max-width: 480px) {
    .corner-player-avatar {
        width: 40px;
        height: 40px;
        border-width: 2px;
    }
    .corner-player-name {
        font-size: 9px;
        padding: 1px 4px;
    }
}

/* ─── BUTTON SPARKLING SHIMMER ANIMATION ─── */
.menu-btn.primary, .ctrl-btn.primary, .onboarding-btn {
    position: relative;
    overflow: hidden;
}
.menu-btn.primary::after, .ctrl-btn.primary::after, .onboarding-btn::after {
    content: '';
    position: absolute;
    top: -50%; left: -100%;
    width: 30%;
    height: 200%;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.4) 50%,
        rgba(255,255,255,0) 100%
    );
    transform: skewX(-25deg);
    pointer-events: none;
    animation: btn-sparkle-sweep 6s infinite ease-in-out;
}

@keyframes btn-sparkle-sweep {
    0% {
        left: -120%;
    }
    60% {
        left: 220%;
    }
    100% {
        left: 220%;
    }
}

/* ─── INVISIBLE SCROLLING — HIDE SCROLLBARS GLOBALLY ─── */
body, .screen, .lb-list-container, .preset-avatar-grid, .shop-tab-content, .shop-grid, #friendList, .recharge-container {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
body::-webkit-scrollbar, 
.screen::-webkit-scrollbar, 
.lb-list-container::-webkit-scrollbar, 
.preset-avatar-grid::-webkit-scrollbar, 
.shop-tab-content::-webkit-scrollbar, 
.shop-grid::-webkit-scrollbar,
#friendList::-webkit-scrollbar,
.recharge-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* ─── PODIUM CROWNS ─── */
.podium-crown {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
.gold-crown {
    animation: crown-float 2s infinite alternate ease-in-out;
}
.silver-crown {
    filter: grayscale(1) brightness(1.3) drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    font-size: 17px;
    top: -13px;
}
.bronze-crown {
    filter: sepia(1) hue-rotate(-30deg) saturate(4) brightness(0.8) drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    font-size: 15px;
    top: -11px;
}

@keyframes crown-float {
    0% { transform: translateX(-50%) translateY(0); }
    100% { transform: translateX(-50%) translateY(-4px); }
}

/* ─── TOURNAMENT SCREEN ─── */
.tourney-subtitle {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 20px;
    text-align: center;
}
.tournament-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 400px;
}
.tourney-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom: 4px solid rgba(0,0,0,0.4);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
}
.tourney-badge {
    position: absolute;
    top: 14px; right: 14px;
    font-size: 9px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    color: #000;
}
.tourney-badge.gold { background: var(--success); }
.tourney-badge.danger { background: var(--danger); color: #fff; }

.tourney-preview {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 4px;
    border: 1px solid var(--border);
}
.tourney-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.tourney-card:hover .tourney-preview img {
    transform: scale(1.08);
}

.tourney-title {
    font-size: 15px;
    font-weight: 750;
    color: var(--gold);
}
.tourney-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 600;
}
.tourney-timer {
    font-size: 12px;
    font-weight: 700;
    color: #FFA500;
    background: rgba(255,165,0,0.1);
    border-radius: 8px;
    padding: 4px 10px;
    align-self: flex-start;
}
.tourney-join-btn {
    margin-top: 6px;
    padding: 12px;
    font-size: 13px !important;
}

/* LOBBY overlay */
.tourney-lobby {
    position: fixed;
    inset: 0;
    background: rgba(10,14,26,0.95);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lobby-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    width: 90%;
    max-width: 360px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}
.lobby-spin {
    font-size: 40px;
    animation: lobby-rot 2s infinite linear;
}
@keyframes lobby-rot {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.15); }
    100% { transform: rotate(360deg) scale(1); }
}
.lobby-player-slots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 10px 0;
}
.lobby-slot {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--text-dim);
    position: relative;
    overflow: hidden;
}
.lobby-slot.filled {
    border: 2px solid var(--gold);
    background: var(--surface2);
}
.lobby-slot img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.lobby-countdown {
    font-size: 14px;
    font-weight: 700;
    color: var(--success);
}

@keyframes text-pulse {
    0% { transform: scale(1); opacity: 0.9; }
    100% { transform: scale(1.08); opacity: 1; text-shadow: 0 0 8px rgba(255,215,0,0.4); }
}

/* Game start countdown overlay */
.game-start-countdown {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 26, 0.85);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: inherit;
}
.countdown-number {
    font-size: 100px;
    font-weight: 800;
    color: var(--gold);
    text-shadow: 0 0 40px rgba(255, 215, 0, 0.6);
    animation: zoom-pulse 1s infinite alternate ease-in-out;
}
@keyframes zoom-pulse {
    0% { transform: scale(0.85); }
    100% { transform: scale(1.1); }
}

/* Celebration Popup buttons */
.double-reward-btn {
    margin-top: 16px;
    padding: 14px 30px;
    width: 85%;
    max-width: 320px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #00FF87, #00C853);
    color: #0A0E1A;
    font-weight: 750;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,255,135,0.25);
    font-family: inherit;
    transition: transform 0.1s, opacity 0.2s;
}
.double-reward-btn:hover {
    transform: scale(1.02);
}
.double-reward-btn:active {
    transform: scale(0.98);
}
.play-again-btn {
    margin-top: 12px;
    padding: 12px 30px;
    width: 85%;
    max-width: 320px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #0A0E1A;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(255,215,0,0.2);
    font-family: inherit;
    transition: transform 0.1s;
}
.play-again-btn:hover {
    transform: scale(1.02);
}
.play-again-btn:active {
    transform: scale(0.98);
}
.back-to-menu-btn {
    margin-top: 12px;
    padding: 10px 30px;
    width: 85%;
    max-width: 320px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    background: var(--surface2);
    color: var(--text-dim);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}
.back-to-menu-btn:hover {
    background: var(--surface3);
    color: var(--text);
}

/* Recharge Screen Cards */
.recharge-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    transition: var(--trans);
}
.recharge-card:hover {
    border-color: rgba(255,215,0,0.25);
    background: var(--surface3);
}
.recharge-card-info {
    display: flex;
    flex-direction: column;
    text-align: left;
    gap: 2px;
}
.recharge-action-btn {
    padding: 10px 18px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #00FF87, #00C853);
    color: #0A0E1A;
    font-weight: 750;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(0,255,135,0.2);
}
.recharge-action-btn.gold {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    box-shadow: 0 4px 12px rgba(255,215,0,0.2);
}
.recharge-action-btn:active {
    transform: scale(0.96);
}

/* Flashing Get Free Energy Badge */
.free-energy-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    font-weight: 900;
    color: #fff;
    background: #FF0055;
    padding: 2px 6px;
    border-radius: 6px;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 0 8px #FF0055;
    animation: flash-pulse 1s infinite alternate ease-in-out;
}
@keyframes flash-pulse {
    0% { opacity: 0.8; transform: translateX(-50%) scale(0.9); }
    100% { opacity: 1; transform: translateX(-50%) scale(1.1); box-shadow: 0 0 14px #FF0055; }
}

/* Bottom Selector Drawer */
.bottom-selector-drawer {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(180deg, rgba(16,22,46,0.98) 0%, rgba(10,14,26,0.98) 100%);
    border-top: 2px solid var(--border);
    border-radius: 20px 20px 0 0;
    padding: 16px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.6);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.35, 0, 0.15, 1);
}
.bottom-selector-drawer.show {
    transform: translateY(0);
}
.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.drawer-header h4 {
    margin: 0;
    color: var(--gold);
    font-size: 15px;
    font-weight: 800;
}
.drawer-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 16px;
    cursor: pointer;
}
.drawer-scroll-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 8px 4px;
    scrollbar-width: none;
}
.drawer-scroll-list::-webkit-scrollbar {
    display: none;
}
.drawer-item {
    flex: 0 0 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--trans);
}
.drawer-item.selected {
    border-color: var(--gold);
    background: rgba(255,215,0,0.1);
}
.drawer-item-icon {
    font-size: 24px;
}
.drawer-item-name {
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}
.drawer-apply-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #0A0E1A;
    font-weight: 750;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 4px 15px rgba(255,215,0,0.25);
}

/* 3D Header Buttons inside Game Screen */
.top-bar .top-btn {
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 750;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    font-size: 13px;
    padding: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Quit Button - 3D Red */
.quit-game-btn {
    background: linear-gradient(135deg, #FF3B30, #FF0055) !important;
    color: #fff !important;
    box-shadow: 0 4px 0 #990022, 0 6px 15px rgba(255,0,85,0.3) !important;
    transform: translateY(-2px);
}
.quit-game-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 0 #990022, 0 8px 18px rgba(255,0,85,0.4) !important;
}
.quit-game-btn:active {
    transform: translateY(2px) !important;
    box-shadow: 0 0px 0 transparent, 0 2px 6px rgba(255,0,85,0.2) !important;
}

/* Sound Drawer Button - 3D Blue */
.sound-drawer-btn {
    background: linear-gradient(135deg, #2196F3, #00BCD4) !important;
    color: #fff !important;
    box-shadow: 0 4px 0 #0D47A1, 0 6px 15px rgba(33,150,243,0.3) !important;
    transform: translateY(-2px);
    margin-right: 8px;
}
.sound-drawer-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 0 #0D47A1, 0 8px 18px rgba(33,150,243,0.4) !important;
}
.sound-drawer-btn:active {
    transform: translateY(2px) !important;
    box-shadow: 0 0px 0 transparent, 0 2px 6px rgba(33,150,243,0.2) !important;
}

/* Effect Drawer Button - 3D Emerald Green */
.effect-drawer-btn {
    background: linear-gradient(135deg, #00e676, #00b248) !important;
    color: #0A0E1A !important;
    box-shadow: 0 4px 0 #007B3A, 0 6px 15px rgba(0,230,118,0.3) !important;
    transform: translateY(-2px);
}
.effect-drawer-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 0 #007B3A, 0 8px 18px rgba(0,230,118,0.4) !important;
}
.effect-drawer-btn:active {
    transform: translateY(2px) !important;
    box-shadow: 0 0px 0 transparent, 0 2px 6px rgba(0,230,118,0.2) !important;
}

/* 3D Floating Menu Logo */
.logo-image-container {
    perspective: 800px;
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
}
.menu-3d-logo {
    width: 110px;
    height: 110px;
    object-fit: contain;
    transform: rotateX(24deg) rotateY(-18deg) rotateZ(8deg);
    filter: drop-shadow(0 15px 25px rgba(0,0,0,0.65)) drop-shadow(0 0 15px rgba(255,215,0,0.15));
    animation: logo-float 4s infinite ease-in-out alternate;
}
@keyframes logo-float {
    0% {
        transform: rotateX(24deg) rotateY(-18deg) rotateZ(8deg) translateY(0);
    }
    100% {
        transform: rotateX(26deg) rotateY(-14deg) rotateZ(10deg) translateY(-12px);
    }
}

/* User Profile Header */
.menu-user-profile {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    z-index: 10;
}
.menu-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    box-shadow: 0 0 12px rgba(255,215,0,0.3);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.menu-user-avatar:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 0 18px rgba(255,215,0,0.5);
}
.menu-user-welcome {
    display: flex;
    flex-direction: column;
    text-align: left;
    animation: fade-slide-in 0.8s cubic-bezier(0.35, 0, 0.15, 1);
}
.welcome-label {
    font-size: 8px;
    font-weight: 800;
    color: var(--text-dim);
    letter-spacing: 1px;
}
.welcome-name {
    font-size: 13px;
    font-weight: 750;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
@keyframes fade-slide-in {
    0% { opacity: 0; transform: translateX(-10px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* Welcome Burst Particle CSS */
.welcome-burst-particle {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    z-index: 1000;
}

/* ─── STATIC SHOP LAYOUT & SEARCH INPUT ─── */
#shopScreen {
    overflow-y: hidden !important;
    display: flex;
    flex-direction: column;
}
#shopScreen .shop-tab-content {
    overflow-y: auto;
    flex: 1;
    width: 100%;
    scrollbar-width: none;  /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}
#shopScreen .shop-tab-content::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}
#shopScreen .back-btn {
    margin-top: 12px;
    margin-bottom: 4px;
    flex-shrink: 0;
}
.shop-search-container {
    width: 100%;
    padding: 8px 0;
    position: sticky;
    top: 0;
    background: #0B0D17; /* match screen default deep bg */
    z-index: 20;
    margin-bottom: 8px;
}
.flag-search-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
    color: #FFF;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: var(--trans);
    box-sizing: border-box;
}
.flag-search-input:focus {
    border-color: var(--gold);
    background: rgba(255,255,255,0.08);
    box-shadow: 0 0 10px rgba(255,215,0,0.15);
}

/* ============================================
   NEW FEATURES STYLES
   ============================================ */

/* ─── ENERGY BAR ─── */
.energy-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.energy-bar {
    width: 60px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.energy-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF6B6B, #FFD700, #00FF87);
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 100%;
}

.energy-text {
    color: #A0A0B0;
    font-size: 10px;
    font-weight: 500;
    min-width: 30px;
}

/* ─── FRIEND LIST ─── */
.friend-list-container {
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}

.friend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 6px;
    transition: all 0.3s ease;
}

.friend-item:hover {
    background: rgba(255, 215, 0, 0.05);
    border-color: rgba(255, 215, 0, 0.1);
}

.friend-item .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    overflow: hidden;
}

.friend-item .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.friend-item .info {
    flex: 1;
    margin-left: 10px;
}

.friend-item .info .name {
    color: #FFFFFF;
    font-weight: 500;
    font-size: 13px;
}

.friend-item .info .status {
    color: #8888AA;
    font-size: 11px;
}

.friend-item .friend-actions {
    display: flex;
    gap: 6px;
}

.friend-item .friend-actions button {
    padding: 4px 12px;
    border: none;
    border-radius: 16px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
    touch-action: manipulation;
}

.friend-item .friend-actions .invite-btn {
    background: rgba(0, 255, 135, 0.1);
    color: #00FF87;
}

.friend-item .friend-actions .invite-btn:hover {
    background: rgba(0, 255, 135, 0.2);
}

.friend-item .friend-actions .challenge-btn {
    background: rgba(255, 215, 0, 0.1);
    color: #FFD700;
}

.friend-item .friend-actions .challenge-btn:hover {
    background: rgba(255, 215, 0, 0.2);
}

.friend-item .friend-actions .remove-btn {
    background: rgba(255, 68, 68, 0.1);
    color: #FF4444;
}

/* ─── SHARE IDEA BUTTON ─── */
.share-idea-btn {
    padding: 12px 20px;
    border: 2px dashed rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    background: rgba(255, 215, 0, 0.03);
    color: #FFD700;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    width: 100%;
    touch-action: manipulation;
}

.share-idea-btn:hover {
    background: rgba(255, 215, 0, 0.08);
    border-color: rgba(255, 215, 0, 0.4);
    transform: translateY(-2px);
}

.share-idea-btn:active {
    transform: scale(0.98);
}

/* ─── FOLLOW US BUTTON ─── */
.follow-us-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #1877F2, #0D65D9);
    color: #FFFFFF;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    width: 100%;
    touch-action: manipulation;
}

.follow-us-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(24, 119, 242, 0.3);
}

.follow-us-btn:active {
    transform: scale(0.98);
}

/* ─── MESSAGE TO PLAY BUTTON ─── */
.message-play-btn {
    padding: 10px 18px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #FF6B6B, #FF4444);
    color: #FFFFFF;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    touch-action: manipulation;
}

.message-play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 68, 68, 0.3);
}

.message-play-btn:active {
    transform: scale(0.98);
}

/* ─── SETTINGS ITEMS ─── */
.settings-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.settings-actions .action-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-actions .action-item .label {
    color: #FFFFFF;
    font-weight: 500;
    font-size: 13px;
}

.settings-actions .action-item .badge {
    font-size: 11px;
    color: #8888AA;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 10px;
    border-radius: 12px;
}

/* ─── FRIEND ZONE SCREEN ─── */
.friend-zone-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.friend-zone-actions button {
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    touch-action: manipulation;
    width: 100%;
}

.friend-zone-actions .invite-friends {
    background: linear-gradient(135deg, #00FF87, #00CC6A);
    color: #0A0E1A;
}

.friend-zone-actions .invite-friends:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 255, 135, 0.3);
}

.friend-zone-actions .play-friends {
    background: linear-gradient(135deg, #FFD700, #F5A623);
    color: #0A0E1A;
}

.friend-zone-actions .play-friends:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
}

.friend-zone-actions .saved-games {
    background: rgba(255, 255, 255, 0.05);
    color: #A0A0B0;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.friend-zone-actions .saved-games:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
}

/* ─── FOOTER BANNER FOR FACEBOOK ─── */
.fb-footer-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #1877F2, #0D65D9);
    border-radius: 16px;
    margin: 24px auto 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(24, 119, 242, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
}
.fb-footer-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(24, 119, 242, 0.5);
}
.fb-footer-banner:active {
    transform: scale(0.98);
}
.fb-banner-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    background: #fff;
    padding: 2px;
}
.fb-banner-text {
    flex: 1;
    margin-left: 12px;
    text-align: left;
}
.fb-banner-title {
    color: #FFF;
    font-size: 13px;
    font-weight: 700;
}
.fb-banner-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 11px;
    font-weight: 500;
    margin-top: 2px;
}
.fb-banner-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 20px;
    background: #FFF;
    color: #1877F2;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

