/* ============================================
   BACKGAMMON ROYALE - Main Stylesheet
   Theme: Wood Royale
   ============================================ */

/* iOS TAP RESPONSIVENESS — disable the 300ms double-tap zoom delay on
   all interactive elements. Without this, every tap on iPhone has a
   small lag while the browser waits to see if it's a double-tap.
   `manipulation` allows pinch-zoom on the page but not double-tap zoom. */
button, a, input, label, select, textarea,
[role="button"], [onclick], [data-clickable],
.pkbtn, .pk-modal-btn, .pk-action-btn, .pk-seat,
.pkt-card, .pkt-card-content, .pkt-cta,
.tabbar-item, .nav-btn, .lobby-card, .modal-btn,
.kr-btn, .kr-tab, .kr-card {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;  /* no grey overlay on tap */
}

:root {
    /* Poker Supreme — dark blue/black palette (no leftover backgammon green) */
    --bg-deep: #020408;          /* deepest blue-black */
    --bg-main: #0a1220;          /* dark navy */
    --bg-card: rgba(8,15,30,0.82);
    --bg-card-hover: rgba(12,22,40,0.85);
    --surface: rgba(12,22,40,0.7);
    --border: rgba(91,142,219,0.14);
    --border-gold: #c9a44e;
    --gold: #d4a847;
    --gold-light: #f0d078;
    --gold-bright: #ffe4a0;
    --gold-dim: #8a7230;
    --text: #d8e3f4;             /* clean blue-white */
    --text-dim: rgba(160,180,210,0.55);
    --text-bright: #f0f6ff;
    --accent-blue: #6ab2e8;
    --accent-red: #c25454;
    --accent-green: #6abf6e;     /* kept only for "online/playing" status indicators */
    --white-piece: #f0e8d8;
    --black-piece: #2e2015;
    --sidebar-w: 220px;
    --bar-h: 56px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0,0,0,0.5);
    --glow-gold: 0 0 20px rgba(212,168,71,0.3);
}

* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color: transparent !important; }

/* PHONE-FRAME on desktop / tablet ─────────────────────────────────────────
   On screens ≥ 768px wide, the app is constrained to a phone-shaped window
   in the center of the viewport. The area around it is a cinematic dark
   gradient, like watching the app inside a phone bezel.
   On mobile (<520px) this kicks off and the app fills the screen normally. */
@media (min-width: 520px) {
  html, body {
    width: 100%;
    height: 100%;
    background:
      radial-gradient(ellipse at 50% 40%, #1a2438 0%, #0a1220 60%, #04080f 100%);
    overflow: hidden;
  }
  body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* Full window dark backdrop so wings of bg image are dimmed */
  }
  /* Constrain DIRECT body children to a phone-shaped column. */
  body > * {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }
  /* Background image MUST stretch to full viewport even when content is centered */
  body > #pkBgImage {
    max-width: none !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
  }
  /* Header (top bar) — fixed at top of phone frame.
     Cover BOTH .g-header and any header / #appHeader. */
  body > .g-header,
  body > .game-header,
  body > #gHeader,
  body > #appHeader,
  body > header {
    position: fixed !important;
    top: max(env(safe-area-inset-top), 0px);
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    width: 100% !important;
    max-width: 480px !important;
    z-index: 1000;
  }
  /* Main content area inside the phone frame */
  #appContent,
  body > main {
    width: 100%;
    max-width: 480px;
    height: min(900px, 100vh);
    max-height: 100vh;
    margin: 0 auto;
    background: rgba(5,10,20,0.55);
    border-radius: 0;
    overflow: hidden auto;
    position: relative;
    box-shadow:
      0 0 0 1px rgba(91,142,219,0.10),
      0 0 0 6px rgba(0,0,0,0.55),
      0 30px 80px rgba(0,0,0,0.85);
  }
  /* Footer (bottom nav) — pinned to the phone frame.
     Cover .g-footer (nav element) and .g-footer-bar (inner div). */
  body > .g-footer,
  body > .g-footer-bar,
  body > footer {
    position: fixed !important;
    bottom: max(env(safe-area-inset-bottom), 0px);
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    width: 100% !important;
    max-width: 480px !important;
    z-index: 999;
  }
  /* Preloader, modals, overlays - all centered in phone column */
  body > #appPreloader,
  body > .rotate-overlay,
  body > .modal-overlay,
  body > .agent-dash-overlay,
  body > #toastContainer,
  body > .toast-container {
    max-width: 480px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
  }
}
/* Larger screens — keep frame at fixed size, don't grow to fill */
@media (min-width: 1024px) {
  body > main, #appContent {
    max-height: 100vh;
  }
}
*, *:focus, *:active, *:focus-visible, *:focus-within {
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
}
html, body, div, span, button, a, section, nav, header, footer, label, p, h1, h2, h3, h4, h5, h6 {
    cursor: default;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none;
    outline: none !important;
}
input, textarea, [contenteditable] {
    cursor: text;
    -webkit-user-select: text;
    user-select: text;
}

html {
    background: #0a1628;
}
html, body {
    width: 100%; height: 100%;
    font-family: 'Noto Sans Hebrew', 'Raleway', sans-serif;
    color: var(--text);
    overflow: hidden;
    background: transparent !important;
}

/* Z-index stack:
   - bg image: 0 (in <body>)
   - #appContent: 1 (page content)
   - .g-header / .g-footer-bar: 100 (above content, glass-blur over bg+content) */
#appContent {
    position: relative;
    z-index: 1;
    background: transparent !important;
}
.g-header, #gHeader {
    position: sticky; top: 0;
    z-index: 100;
}
.g-footer-bar, .nav-footer {
    position: sticky; bottom: 0;
    z-index: 100;
}
.sidebar {
    z-index: 50;
}

/* Make sure no container paints over the bg */
.page, .page.active, .lobby-container, .pk-lobby {
    background: transparent !important;
}

h1,h2,h3 { font-family: 'Cinzel', serif; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 3px; }

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed; left: 0; top: 0;
    width: var(--sidebar-w); height: 100vh;
    background: linear-gradient(180deg, #0a1a0e 0%, #040e06 100%);
    border-right: 1px solid rgba(201,148,74,0.08);
    z-index: 100;
    display: flex; flex-direction: column;
    transition: transform 0.3s ease;
}
.sidebar-logo {
    padding: 24px 20px;
    display: flex; align-items: center; gap: 10px;
    border-bottom: 1px solid var(--border);
}
.logo-icon {
    font-size: 28px; color: var(--gold);
    filter: drop-shadow(0 0 8px rgba(212,168,71,0.4));
}
.logo-text {
    font-family: 'Cinzel', serif;
    font-size: 20px; font-weight: 700;
    color: var(--gold-light);
    letter-spacing: 4px;
}
.sidebar-nav {
    list-style: none; padding: 16px 0; flex: 1;
}
.sidebar-nav li {
    padding: 14px 24px;
    cursor: pointer;
    display: flex; align-items: center; gap: 12px;
    font-size: 14px; font-weight: 500;
    color: var(--text-dim);
    transition: all 0.2s;
    border-right: 3px solid transparent;
}
.sidebar-nav li:hover {
    background: rgba(212,168,71,0.06);
    color: var(--text);
}
.sidebar-nav li.active {
    color: var(--gold-light);
    background: rgba(212,168,71,0.1);
    border-right-color: var(--gold);
}
.nav-icon { font-size: 18px; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}
.user-info { display: flex; align-items: center; gap: 10px; }
.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--gold-dim);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; color: var(--gold);
}
.user-name { font-size: 13px; color: var(--text-dim); }

.sidebar-toggle {
    position: fixed; top: 12px; left: 12px;
    z-index: 101;
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--gold); font-size: 20px;
    width: 40px; height: 40px; border-radius: 8px;
    cursor: pointer; display: none;
    transition: 0.2s;
}
.sidebar-toggle:hover { background: var(--surface); }

/* ===== PAGES ===== */
#appContent {
    margin-right: 0;
    margin-left: 0;
    height: calc(100vh - 50px);
    overflow-y: auto;
}
.page { display: none; min-height: calc(100vh - 110px); padding: 8px 8px 0; }
.page.active { display: block; }
/* Each page must scroll on its own because body has overflow:hidden. */
.page.active {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  height: 100%;
  /* Big bottom padding so the LAST item is fully visible above the sticky
     footer (footer is ~58-65px + safe-area). 130px is generous. */
  padding-bottom: 130px;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 12px 24px;
    border: 1px solid rgba(91,142,219,0.25);
    border-radius: 10px;
    font-family: 'Outfit', 'Rubik', sans-serif;
    font-weight: 700; font-size: 14px;
    cursor: pointer;
    transition: all 0.18s;
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(10,22,40,0.5);
    color: #e8eef8;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.btn:hover { background: rgba(20,40,68,0.65); border-color: rgba(91,142,219,0.4); }
.btn-primary {
    background: linear-gradient(180deg, rgba(91,142,219,0.85) 0%, rgba(45,90,160,0.95) 100%);
    color: #ffffff;
    border-color: rgba(140,180,235,0.5);
    box-shadow: 0 4px 14px rgba(40,80,160,0.4), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-primary:hover {
    background: linear-gradient(180deg, rgba(110,160,235,0.95) 0%, rgba(60,110,180,0.98) 100%);
    box-shadow: 0 6px 20px rgba(60,110,200,0.5), inset 0 1px 0 rgba(255,255,255,0.22);
    border-color: rgba(160,200,245,0.6);
}
.btn-secondary {
    border-color: rgba(91,142,219,0.3);
    color: #a8c5ee;
    background: rgba(10,22,40,0.4);
}
.btn-secondary:hover { background: rgba(91,142,219,0.12); border-color: rgba(91,142,219,0.45); }
.btn-danger {
    border-color: rgba(239,83,80,0.4);
    color: #ef9a9a;
    background: rgba(60,20,20,0.4);
}
.btn-danger:hover { background: rgba(239,83,80,0.18); color: #ffb4b4; border-color: rgba(239,83,80,0.6); }
.btn-large { padding: 16px 36px; font-size: 16px; border-radius: 12px; }
.btn-sm { padding: 8px 16px; font-size: 12px; border-radius: 8px; }
.btn-confirm {
    background: linear-gradient(180deg, rgba(74,222,128,0.85), rgba(34,150,80,0.95));
    color: #fff;
    border-color: rgba(110,250,160,0.5);
    box-shadow: 0 4px 14px rgba(40,150,80,0.4), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-icon { font-size: 18px; }

/* ===== STAT CARDS ===== */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px; text-align: center;
    min-width: 120px;
}
.stat-num {
    font-family: 'Cinzel', serif;
    font-size: 28px; font-weight: 700;
    color: var(--gold-light);
}
.stat-label { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

/* ===== SECTION TITLES ===== */
.section-title {
    font-size: 18px; color: var(--gold-light);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* ===== ROOM CARDS ===== */
.rooms-grid, .live-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}
.room-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: all 0.25s;
}
.room-card:hover {
    border-color: var(--gold-dim);
    box-shadow: var(--glow-gold);
    transform: translateY(-2px);
}
.room-card .room-name {
    font-family: 'Cinzel', serif;
    font-size: 15px; color: var(--gold-light); margin-bottom: 8px;
}
.room-card .room-info {
    font-size: 12px; color: var(--text-dim);
    display: flex; justify-content: space-between;
}
.room-card .room-status {
    display: inline-block;
    padding: 2px 8px; border-radius: 4px;
    font-size: 11px; font-weight: 600;
}
.room-status.waiting { background: rgba(212,168,71,0.15); color: var(--gold-light); }
.room-status.playing { background: rgba(84,194,112,0.15); color: var(--accent-green); }
.room-status.full { background: rgba(194,84,84,0.15); color: var(--accent-red); }
.room-empty { color: var(--text-dim); font-size: 14px; padding: 20px; text-align: center; }

/* ===== MODAL ===== */
.modal {
    position: fixed; inset: 0;
    background: rgba(5,12,24,0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    z-index: 99999;
}
.modal-content {
    background: linear-gradient(180deg, rgba(20,40,68,0.95), rgba(10,22,40,0.95));
    border: 1px solid rgba(91,142,219,0.3);
    border-radius: 16px;
    padding: 24px; min-width: 320px; max-width: 440px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px rgba(91,142,219,0.1), inset 0 1px 0 rgba(255,255,255,0.06);
    color: #e8eef8;
}
.modal-header {
    font-family: 'Outfit', 'Rubik', sans-serif;
    font-size: 18px; font-weight: 800;
    color: #e8eef8;
    margin-bottom: 16px;
    letter-spacing: 0.3px;
}
.modal-body { margin-bottom: 20px; color: #c5d3e8; }
.modal-body input {
    width: 100%; padding: 11px 14px;
    background: rgba(10,22,40,0.5);
    border: 1px solid rgba(91,142,219,0.25);
    border-radius: 10px;
    color: #e8eef8; font-size: 14px;
    font-family: 'Rubik', sans-serif;
}
.modal-body input:focus { outline: none; border-color: #5b8edb; box-shadow: 0 0 0 3px rgba(91,142,219,0.18); }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; }

/* ===== TOAST — premium color-coded with icons ===== */
.toast-container {
    position: fixed; top: max(env(safe-area-inset-top), 16px); left: 50%;
    transform: translateX(-50%);
    z-index: 300; display: flex; flex-direction: column; gap: 8px;
    max-width: calc(100vw - 32px);
}
.toast {
    position: relative;
    background: linear-gradient(180deg, rgba(15,25,45,0.95), rgba(8,15,30,0.98));
    border: 1px solid rgba(91,142,219,0.22);
    border-left: 3px solid var(--toast-accent, #5b8edb);
    border-radius: 10px;
    padding: 11px 18px 11px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #e0e8f4;
    box-shadow: 0 8px 28px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.02);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: toastIn 0.3s cubic-bezier(.2,.8,.3,1.1), toastOut 0.3s ease 2.7s forwards;
    min-width: 180px; max-width: 360px;
    text-align: right;
    direction: rtl;
}
.toast::before {
    /* Soft accent glow on the left edge */
    content: '';
    position: absolute; top: 0; bottom: 0; left: 0; width: 3px;
    background: var(--toast-accent, #5b8edb);
    box-shadow: 0 0 16px var(--toast-accent, #5b8edb);
    border-radius: 10px 0 0 10px;
    opacity: 0.7;
}
.toast-success { --toast-accent: #4ade80; }
.toast-error   { --toast-accent: #ef5350; }
.toast-warn,
.toast-warning { --toast-accent: #fbbf24; }
.toast-info    { --toast-accent: #5b8edb; }
.toast-gold    { --toast-accent: #d4a847; }

/* Compatibility — old code uses default class */
@keyframes toastIn { from { opacity:0; transform:translateY(-12px) scale(0.95); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes toastOut { from { opacity:1; } to { opacity:0; transform:translateY(-8px); } }

/* ===== PROFILE ===== */
.profile-container { max-width: 420px; margin: 0 auto; padding: 12px; }
.profile-card {
    background: linear-gradient(180deg, rgba(15,28,48,0.7), rgba(8,15,30,0.85));
    border: 1px solid rgba(91,142,219,0.22);
    border-radius: 18px;
    padding: 28px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.45);
}
.profile-avatar-large {
    width: 90px; height: 90px; margin: 0 auto 14px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(91,142,219,0.22), rgba(8,15,30,0.85));
    border: 3px solid rgba(232,196,122,0.4);
    display: flex; align-items: center; justify-content: center;
    font-size: 34px; font-weight: 800;
    color: #f0d99a;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.profile-input {
    width: 100%; padding: 10px 14px;
    background: rgba(8,15,30,0.65);
    border: 1px solid rgba(91,142,219,0.22);
    border-radius: 8px;
    color: #d8e3f4; font-size: 15px; text-align: center;
    font-family: inherit; margin-bottom: 16px;
}
.profile-input:focus { outline: none; border-color: rgba(232,196,122,0.5); }
.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 18px 0;
    padding: 12px 0;
    border-top: 1px solid rgba(91,142,219,0.12);
    border-bottom: 1px solid rgba(91,142,219,0.12);
}
.pstat {
    text-align: center;
    padding: 4px 0;
}
.pstat-val {
    display: block;
    font-size: 22px;
    font-weight: 800;
    color: #f0d99a;
    font-family: 'Outfit', sans-serif;
    line-height: 1;
}
.pstat-lbl {
    font-size: 10px;
    color: rgba(168,192,224,0.6);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 4px;
    display: block;
}

/* ===== ADMIN ===== */
.admin-container { max-width: 900px; margin: 0 auto; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.admin-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
}
.admin-card h3 { font-size: 14px; color: var(--gold-light); margin-bottom: 12px; }
.admin-list { font-size: 13px; color: var(--text-dim); max-height: 300px; overflow-y: auto; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: block; }
    #appContent { margin-left: 0; }
    .admin-grid { grid-template-columns: 1fr; }
    .lobby-stats { flex-wrap: wrap; }
}

/* ===== LOBBY SPECIFICS ===== */
.lobby-container { max-width: 500px; margin: 0 auto; padding: 0 12px; }

/* === LOBBY TOP BAR === */
.lobby-top-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 0; margin-bottom: 12px;
}
.lobby-user-badge {
    display: flex; align-items: center; gap: 8px;
}
.lobby-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, #3a2a1a, #2a1a0a);
    border: 2px solid var(--gold-dim);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
}
.lobby-username {
    font-size: 14px; font-weight: 700; color: var(--text);
}
.lobby-balance-pill {
    display: flex; align-items: center; gap: 4px;
    background: linear-gradient(135deg, rgba(201,164,78,0.15), rgba(201,164,78,0.05));
    border: 1px solid rgba(201,164,78,0.3);
    border-radius: 20px; padding: 6px 14px;
}
.balance-coin { font-size: 14px; }
.balance-amount { font-weight: 900; color: var(--gold-light); font-size: 16px; }
.balance-currency { font-size: 12px; color: var(--gold-dim); }

/* === HERO PLAY BUTTON === */
.lobby-hero {
    display: flex; justify-content: center; margin: 16px 0 20px;
}
.play-btn-hero {
    position: relative; overflow: hidden;
    width: 85%; max-width: 380px; padding: 18px 24px;
    border: none; border-radius: 16px; cursor: pointer;
    background: linear-gradient(135deg, #ffd700 0%, #ff9500 40%, #ff6b00 100%);
    box-shadow: 0 6px 30px rgba(255,150,0,0.4), 0 2px 8px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.3);
    display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: transform 0.15s, box-shadow 0.15s;
}
.play-btn-hero:active {
    transform: scale(0.97);
    box-shadow: 0 3px 15px rgba(255,150,0,0.3);
}
.play-btn-shine {
    position: absolute; top: 0; left: -100%; width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: btnShine 3s ease infinite;
}
@keyframes btnShine {
    0% { left: -100%; } 60% { left: 150%; } 100% { left: 150%; }
}
.play-btn-icon { font-size: 24px; }
.play-btn-text {
    font-size: 22px; font-weight: 900; color: #1a0a00;
    text-shadow: 0 1px 0 rgba(255,255,255,0.3);
    letter-spacing: 2px;
}

/* === LOBBY CARDS === */
.lobby-cards-row {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
    margin-bottom: 16px;
}
.lobby-card {
    background: linear-gradient(180deg, rgba(60,40,20,0.6) 0%, rgba(40,25,12,0.8) 100%);
    border: 1px solid rgba(201,164,78,0.2);
    border-radius: 12px; padding: 12px 4px;
    cursor: pointer; text-align: center;
    transition: all 0.2s;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.lobby-card:active {
    transform: scale(0.95);
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(201,164,78,0.2);
}
.lobby-card-icon { font-size: 24px; }
.lobby-card-label { font-size: 11px; color: var(--text-dim); font-weight: 600; }

/* === BET SECTION === */
.lobby-bet-section {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 16px; padding: 10px 12px;
    background: rgba(30,20,10,0.5);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.bet-label { font-size: 13px; color: var(--text-dim); font-weight: 700; white-space: nowrap; }
.bet-chip {
    padding: 6px 14px; border-radius: 20px; border: 1.5px solid var(--border);
    background: rgba(40,30,15,0.6); color: var(--gold-light);
    font-size: 13px; font-weight: 700; cursor: pointer;
    transition: all 0.2s;
}
.bet-chip:active, .bet-chip.active {
    background: linear-gradient(135deg, rgba(201,164,78,0.3), rgba(201,164,78,0.1));
    border-color: var(--gold);
    box-shadow: 0 0 10px rgba(201,164,78,0.2);
    color: var(--gold-bright);
}

/* === STATS PILLS === */
.lobby-stats {
    display: flex; gap: 8px; justify-content: center; margin-bottom: 16px;
}
.stat-pill {
    display: flex; align-items: center; gap: 4px;
    padding: 5px 12px; border-radius: 16px;
    background: rgba(30,20,10,0.5);
    border: 1px solid var(--border);
    font-size: 12px;
}
.stat-dot {
    width: 6px; height: 6px; border-radius: 50%;
}
.stat-dot.online { background: #4caf50; box-shadow: 0 0 6px #4caf50; }
.stat-dot.active { background: #ff9800; box-shadow: 0 0 6px #ff9800; }
.stat-dot.waiting { background: #2196f3; box-shadow: 0 0 6px #2196f3; }
.stat-num { font-weight: 900; color: var(--text); }
.stat-label { color: var(--text-dim); }

/* === SECTION TITLES === */
.section-title-fancy {
    font-size: 14px; font-weight: 700; color: var(--gold-light);
    margin-bottom: 8px; padding-bottom: 6px;
    border-bottom: 1px solid rgba(201,164,78,0.15);
}

.lobby-rooms, .lobby-live { margin-bottom: 16px; }

/* Old balance bar - hidden (replaced by pill) */
.balance-bar { display: none; }
.lobby-header { display: none; }
.lobby-actions { display: none; }

/* Turn Banner */
.turn-banner {
    text-align: center;
    padding: 3px 12px;
    font-family: 'Cinzel', serif;
    font-size: 12px; font-weight: 700;
    letter-spacing: 1px;
    border-radius: 4px;
    margin-bottom: 2px;
    transition: all 0.3s;
}
.turn-mine {
    background: linear-gradient(135deg, rgba(84,194,112,0.15), rgba(84,194,112,0.05));
    color: #54c270;
    border: 1px solid rgba(84,194,112,0.3);
    animation: turnGlow 2s ease infinite;
}
.turn-opp {
    background: rgba(30,22,15,0.5);
    color: var(--text-dim);
    border: 1px solid var(--border);
}
@keyframes turnGlow {
    0%,100% { box-shadow: 0 0 10px rgba(84,194,112,0.1); }
    50% { box-shadow: 0 0 20px rgba(84,194,112,0.25); }
}

/* Bet Display in game */
.bet-display {
    text-align: center;
    font-family: 'Cinzel', serif;
    font-size: 11px;
    color: var(--gold);
    margin-bottom: 2px;
    line-height: 1;
}

/* Active player bar glow */
.bar-active {
    border-color: rgba(201,164,78,0.4) !important;
    box-shadow: 0 0 15px rgba(201,164,78,0.15);
}
.bar-active .player-timer { animation: timerPulse 1s ease infinite; }
@keyframes timerPulse { 0%,100%{opacity:1} 50%{opacity:0.6} }

/* Player color dot */
.player-color-dot {
    width: 20px; height: 20px; border-radius: 50%;
    flex-shrink: 0;
}
.player-color-dot.dot-white {
    background: radial-gradient(ellipse at 35% 30%, #faf6ee, #c8bca8);
    box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.player-color-dot.dot-black {
    background: radial-gradient(ellipse at 35% 30%, #4a3828, #201510);
    box-shadow: 0 1px 4px rgba(0,0,0,0.5);
    border: 1px solid rgba(80,55,35,0.3);
}

/* === TELEGRAM MINI APP === */
body.tg-mode .sidebar { display: none !important; }
body.tg-mode .main-content { margin-right: 0 !important; }
body.tg-mode .page { padding: 0 8px !important; }
body.tg-mode .page.active {
  /* Generous bottom padding to clear Telegram's nav bar */
  padding: 0 8px 140px !important;
}
body.tg-mode .lobby-container { padding: 0 12px 130px !important; }
body.tg-mode .lobby-title { font-size: 22px; }

/* (The universal min-width: 520px frame above already centers everything
    on Telegram Desktop and standalone PWA on big screens.) */

/* Safe area for fullscreen + nav bar clearance.
   NOTE: don't add padding-top to body - the .g-header already accounts for
   --tg-content-top via its padding, and #appContent already accounts for
   the full header height. Adding body padding here creates double offset. */
body.tg-mode {
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}
body.tg-mode #page-game {
    padding-bottom: 70px !important;
}
body.tg-mode .game-controls {
    margin-bottom: 8px;
}
body.tg-mode .game-chat {
    margin-bottom: 8px;
}

/* TG navigation (replace sidebar) */
.tg-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(20,16,12,0.95);
    border-top: 1px solid rgba(201,164,78,0.15);
    padding: 6px 8px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0));
    z-index: 100;
    gap: 4px;
    justify-content: space-around;
}
body.tg-mode .tg-nav { display: flex; }
.tg-nav-btn {
    flex: 1;
    padding: 8px 4px;
    text-align: center;
    font-size: 10px;
    color: var(--text-dim);
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 6px;
}
.tg-nav-btn.active { color: var(--gold); background: rgba(201,164,78,0.1); }
.tg-nav-btn span { display: block; font-size: 18px; margin-bottom: 2px; }

/* === LOGIN PAGE === */
.login-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 48px 16px;
    text-align: center;
}
.login-card {
    background: linear-gradient(180deg, rgba(15,28,48,0.7), rgba(8,15,30,0.85));
    border: 1px solid rgba(91,142,219,0.22);
    border-radius: 16px;
    padding: 22px 20px;
    margin-top: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.45);
    position: relative;
    overflow: hidden;
}
.login-card::before {
    /* Top accent stripe — gold */
    content: '';
    position: absolute;
    top: 0; left: 30%; right: 30%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #e8c47a 40%, #f0d99a 50%, #e8c47a 60%, transparent);
    border-radius: 0 0 2px 2px;
}
.login-card input {
    display: block;
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 12px;
    background: rgba(8,15,30,0.65);
    border: 1px solid rgba(91,142,219,0.22);
    border-radius: 8px;
    color: #d8e3f4;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, background 0.2s;
}
.login-card input:focus {
    border-color: rgba(232,196,122,0.5);
    background: rgba(8,15,30,0.85);
    outline: none;
}
.login-card input::placeholder {
    color: rgba(160,180,210,0.4);
}

/* === SVG ICONS === */
.nav-icon svg, [data-icon] svg {
    display: inline-block;
    vertical-align: middle;
}
.nav-icon svg {
    width: 18px; height: 18px;
}
.tg-nav-btn [data-icon] svg {
    width: 20px; height: 20px;
}
.balance-icon svg {
    width: 22px; height: 22px;
    color: var(--gold);
}

/* === VS BATTLE BADGE === */
.vs-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 13px;
    direction: ltr;
}
.vs-badge .vs-name {
    color: #e8d5a3;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vs-badge .vs-sep {
    background: linear-gradient(135deg, #c62828, #ff5252);
    color: #fff;
    font-family: 'Cinzel', serif;
    font-weight: 900;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    box-shadow: 0 0 6px rgba(198,40,40,0.5);
}
.vs-badge .vs-name.white { color: #f0e6d0; }
.vs-badge .vs-name.black { color: #bbb; }

/* Larger VS for game page */
.vs-badge-lg {
    font-size: 16px;
    gap: 10px;
}
.vs-badge-lg .vs-sep {
    font-size: 13px;
    padding: 3px 10px;
    border-radius: 4px;
}
.vs-badge-lg .vs-name {
    max-width: 120px;
}

/* === RETURN TO GAME FLASH === */
@keyframes flashBar {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
@keyframes urgentFlash {
    0%, 100% { opacity: 1; background: linear-gradient(135deg,#b71c1c,#d32f2f); }
    50% { opacity: 0.85; background: linear-gradient(135deg,#ff1744,#ff5252); }
}

/* === TURN INDICATORS === */
@keyframes softPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
@keyframes softGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(212,168,122,0.2); }
    50% { box-shadow: 0 0 15px rgba(212,168,122,0.5); }
}
@keyframes borderGlow {
    0%, 100% { border-color: rgba(212,168,122,0.3); }
    50% { border-color: rgba(212,168,122,0.7); }
}
.my-turn-bar {
    animation: borderGlow 2s ease infinite;
    border-color: rgba(212,168,122,0.5) !important;
}
.my-turn-name {
    animation: softPulse 2s ease infinite;
    color: var(--gold-light) !important;
}
.dice-btn-pulse {
    animation: softGlow 1.5s ease infinite !important;
    border-color: rgba(212,168,122,0.6) !important;
    color: var(--gold-light) !important;
}
.confirm-pulse {
    animation: softGlow 1.5s ease infinite;
}
.piece-my-turn {
    filter: brightness(1.15);
}
.turn-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 6px;
    vertical-align: middle;
}
.turn-dot-active {
    animation: softPulse 1.5s ease infinite;
    box-shadow: 0 0 6px currentColor;
}

/* === LEVEL BADGES === */
.lvl-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: linear-gradient(145deg, rgba(20,20,30,0.9), rgba(10,10,18,0.95));
    border: 1px solid var(--badge-color, #888);
    border-radius: 12px;
    padding: 2px 6px 2px 3px;
    box-shadow: 0 0 8px var(--badge-glow, rgba(100,100,100,0.2));
    vertical-align: middle;
    line-height: 1;
    color: var(--badge-color, #888);
}
.lvl-badge-lg {
    padding: 3px 10px 3px 5px;
    border-radius: 16px;
    box-shadow: 0 0 15px var(--badge-glow, rgba(100,100,100,0.3));
}
.lvl-badge-md {
    padding: 2px 8px 2px 4px;
}
.lvl-icon {
    display: flex;
    align-items: center;
    filter: drop-shadow(0 0 3px var(--badge-glow, rgba(100,100,100,0.3)));
}
.lvl-num {
    font-weight: 900;
    font-family: 'Cinzel', serif;
    text-shadow: 0 0 6px var(--badge-glow, rgba(100,100,100,0.3));
}
.lvl-inline {
    font-weight: 700;
    font-size: 11px;
    vertical-align: middle;
}
/* Progress bar */
.lvl-progress-wrap {
    margin: 8px 0;
}
.lvl-progress-bar {
    height: 6px;
    background: rgba(30,22,15,0.8);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
    border: 1px solid rgba(212,168,122,0.1);
}
.lvl-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}
.lvl-progress-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* === LEADERBOARD === */
.lb-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    direction: rtl;
}
.lb-rank {
    font-weight: 900;
    font-size: 16px;
    width: 30px;
    text-align: center;
    font-family: 'Cinzel', serif;
}
.lb-rank-1 { color: #ffd700; text-shadow: 0 0 10px rgba(255,215,0,0.5); }
.lb-rank-2 { color: #c0c0c0; text-shadow: 0 0 8px rgba(192,192,192,0.4); }
.lb-rank-3 { color: #cd7f32; text-shadow: 0 0 8px rgba(205,127,50,0.4); }
.lb-name {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
}
.lb-stats {
    font-size: 11px;
    color: var(--text-dim);
    text-align: left;
}
.lb-elo {
    font-weight: 800;
    color: var(--gold-light);
    font-size: 14px;
    font-family: 'Cinzel', serif;
}


/* Timer extend button */
.btn-extend-time {
    background: rgba(255,152,0,0.2);
    border: 1px solid rgba(255,152,0,0.5);
    color: #ffb74d;
    font-size: 10px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 6px;
    cursor: pointer;
    margin-left: 4px;
    animation: extendPulse 1.5s infinite;
}
.btn-extend-time:active { transform: scale(0.9); }
@keyframes extendPulse {
    0%,100% { box-shadow: 0 0 4px rgba(255,152,0,0.3); }
    50% { box-shadow: 0 0 12px rgba(255,152,0,0.6); }
}

/* Timer urgent state */
.timer-urgent { color: #f44336 !important; font-weight: 900 !important; }
@keyframes timerFlash {
    0%,100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* My color banner */
.my-color-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 2px 12px;
    margin: 0 auto 1px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    max-width: 160px;
    direction: rtl;
}
.my-color-banner.is-white {
    background: linear-gradient(135deg, rgba(240,232,220,0.15), rgba(208,192,172,0.1));
    border: 1px solid rgba(240,232,220,0.3);
    color: #f0e8dc;
}
.my-color-banner.is-black {
    background: linear-gradient(135deg, rgba(46,32,21,0.4), rgba(32,21,16,0.3));
    border: 1px solid rgba(80,55,35,0.4);
    color: #c0a888;
}
.color-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.is-white .color-icon {
    background: radial-gradient(circle at 35% 35%, #fff, #d0c0ac);
    border: 1px solid rgba(208,192,172,0.5);
}
.is-black .color-icon {
    background: radial-gradient(circle at 35% 35%, #4a3828, #201510);
    border: 1px solid rgba(80,55,35,0.5);
}

/* ========================================================================
   ROTATE-TO-PORTRAIT OVERLAY
   Shown only on TOUCH devices in LANDSCAPE orientation.
   Desktop browsers stay untouched (they're naturally wide).
   ======================================================================== */
.rotate-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: linear-gradient(135deg, #0a1220 0%, #040810 60%, #0a1220 100%);
    color: #f0d99a;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    direction: rtl;
}
.rotate-inner {
    max-width: 380px;
    animation: rotateIn 0.45s cubic-bezier(.2,.8,.3,1);
}
@keyframes rotateIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}
.rotate-phone {
    color: #e8c47a;
    margin-bottom: 18px;
    filter: drop-shadow(0 4px 16px rgba(232,196,122,0.3));
    animation: rotateRotate 2.4s ease-in-out infinite;
    transform-origin: center center;
}
@keyframes rotateRotate {
    0%, 30%, 100% { transform: rotate(-90deg); }
    65%           { transform: rotate(0deg); }
}
.rot-phone-body { fill: rgba(232,196,122,0.06); }
.rot-phone-arrow { stroke: #f0d99a; opacity: 0.9; }

.rotate-title {
    font-family: 'Outfit', 'Noto Sans Hebrew', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: #f0d99a;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 8px rgba(232,196,122,0.25);
}
.rotate-sub {
    font-size: 14px;
    color: #a8c5ee;
    line-height: 1.5;
    font-weight: 500;
    margin-bottom: 14px;
}
.rotate-hint {
    font-size: 11px;
    color: rgba(168,192,224,0.5);
    direction: ltr;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    font-weight: 600;
}

/* === SHOW the overlay when:
       1) Touch device (no hover, coarse pointer = mobile/tablet)
       2) Orientation: landscape
       3) Viewport height is short (< 500px = clearly mobile landscape)
   This combination prevents desktop browsers from showing it. === */
@media (orientation: landscape) and (max-height: 500px) and (hover: none) and (pointer: coarse) {
    .rotate-overlay { display: flex !important; }
    /* Hide everything else underneath to save resources/avoid weird scroll */
    body > *:not(.rotate-overlay):not(#appPreloader) {
        visibility: hidden !important;
    }
}

/* === Telegram-specific: also show when Telegram tells us viewport is too short
   (we set body class via JS) === */
body.tg-landscape-locked .rotate-overlay { display: flex !important; }
body.tg-landscape-locked > *:not(.rotate-overlay):not(#appPreloader) {
    visibility: hidden !important;
}

/* ========================================================================
   WELCOME POPUP (Play-Money-Only Disclaimer)
   Shown once on first login. Required for Google Play compliance.
   ======================================================================== */
.welcome-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 999990;
    background: rgba(2, 4, 8, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.welcome-popup-overlay.show {
    opacity: 1;
}
.welcome-popup-card {
    max-width: 380px;
    width: 100%;
    background: linear-gradient(180deg, rgba(20, 36, 64, 0.95), rgba(8, 15, 30, 0.98));
    border: 1px solid rgba(232, 196, 122, 0.35);
    border-radius: 22px;
    padding: 32px 26px 24px;
    text-align: center;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    animation: welcomePop 0.5s cubic-bezier(.2, .9, .3, 1);
}
@keyframes welcomePop {
    from { transform: scale(0.88); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.welcome-popup-card::before {
    content: '';
    position: absolute;
    top: 0; left: 25%; right: 25%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #e8c47a 35%, #f5dc8e 50%, #e8c47a 65%, transparent);
    border-radius: 0 0 3px 3px;
    box-shadow: 0 0 12px rgba(232, 196, 122, 0.5);
}
.welcome-popup-chip {
    margin-bottom: 16px;
    filter: drop-shadow(0 6px 16px rgba(232, 196, 122, 0.35));
    animation: welcomeChipFloat 3s ease-in-out infinite;
}
.welcome-popup-chip svg {
    display: inline-block;
}
@keyframes welcomeChipFloat {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50%      { transform: translateY(-4px) rotate(3deg); }
}
.welcome-popup-title {
    font-family: 'Outfit', 'Noto Sans Hebrew', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: #f0d99a;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 8px rgba(232, 196, 122, 0.25);
}
.welcome-popup-sub {
    font-size: 13px;
    color: rgba(168, 192, 224, 0.75);
    margin-bottom: 22px;
    line-height: 1.5;
    font-weight: 500;
}
.welcome-popup-bullets {
    text-align: right;
    margin: 18px 0;
    padding: 14px 14px;
    background: rgba(8, 15, 30, 0.5);
    border: 1px solid rgba(91, 142, 219, 0.18);
    border-radius: 12px;
}
.wp-bullet {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 13.5px;
    color: #d8e3f4;
    font-weight: 500;
    line-height: 1.4;
}
.wp-bullet svg {
    flex-shrink: 0;
    margin-top: 1px;
}
.welcome-popup-disclaimer {
    font-size: 11px;
    color: rgba(168, 192, 224, 0.55);
    line-height: 1.6;
    margin: 16px 4px 22px;
    padding: 0 4px;
    text-align: center;
}
.welcome-popup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 800;
    font-family: 'Outfit', 'Noto Sans Hebrew', sans-serif;
    color: #1a1208;
    background: linear-gradient(180deg, #f5dc8e 0%, #e8c47a 50%, #b8860b 100%);
    border: 1px solid rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.3px;
    box-shadow:
        0 4px 14px rgba(232, 196, 122, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.welcome-popup-btn:hover {
    transform: translateY(-1px);
    box-shadow:
        0 6px 18px rgba(232, 196, 122, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.welcome-popup-btn:active {
    transform: translateY(0);
    box-shadow:
        0 2px 8px rgba(232, 196, 122, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ========================================================================
   ACTIVE PLAY REWARD POPUP
   Shown when player gets a surprise reward for playing.
   Compact, celebratory, auto-dismisses after 6s.
   ======================================================================== */
.reward-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 999988;
    background: rgba(2, 4, 8, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.reward-popup-overlay.show {
    opacity: 1;
    pointer-events: auto;
}
.reward-popup-card {
    position: relative;
    max-width: 320px;
    width: 100%;
    background: linear-gradient(180deg, rgba(28, 50, 88, 0.96), rgba(8, 15, 30, 0.98));
    border: 1px solid rgba(232, 196, 122, 0.55);
    border-radius: 18px;
    padding: 28px 24px 22px;
    text-align: center;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(232, 196, 122, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    overflow: hidden;
    animation: rewardPop 0.55s cubic-bezier(.2, .9, .3, 1.05);
}
@keyframes rewardPop {
    0%   { transform: scale(0.7) translateY(20px); opacity: 0; }
    50%  { transform: scale(1.04) translateY(-2px); }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}
.reward-popup-shine {
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: linear-gradient(45deg,
        transparent 35%,
        rgba(232, 196, 122, 0.08) 47%,
        rgba(245, 220, 142, 0.18) 50%,
        rgba(232, 196, 122, 0.08) 53%,
        transparent 65%);
    animation: rewardShine 3s linear infinite;
    pointer-events: none;
}
@keyframes rewardShine {
    0%   { transform: translate(-30%, -30%) rotate(0deg); }
    100% { transform: translate(-30%, -30%) rotate(360deg); }
}
.reward-popup-chip {
    margin-bottom: 14px;
    filter: drop-shadow(0 4px 12px rgba(232, 196, 122, 0.5));
    animation: rewardChipBounce 0.7s cubic-bezier(.2, .9, .3, 1.2);
    position: relative;
    z-index: 1;
}
@keyframes rewardChipBounce {
    0%   { transform: scale(0) rotate(-180deg); }
    60%  { transform: scale(1.2) rotate(20deg); }
    100% { transform: scale(1) rotate(0); }
}
.reward-popup-title {
    font-family: 'Outfit', 'Noto Sans Hebrew', sans-serif;
    font-size: 19px;
    font-weight: 800;
    color: #f0d99a;
    margin-bottom: 5px;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 6px rgba(232, 196, 122, 0.3);
}
.reward-popup-sub {
    font-size: 12.5px;
    color: rgba(168, 192, 224, 0.75);
    margin-bottom: 18px;
    line-height: 1.4;
    position: relative;
    z-index: 1;
}
.reward-popup-amount {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 22px;
    margin: 0 0 18px;
    background: linear-gradient(180deg, rgba(232, 196, 122, 0.18), rgba(122, 84, 16, 0.22));
    border: 1px solid rgba(232, 196, 122, 0.4);
    border-radius: 12px;
    direction: ltr;
    position: relative;
    z-index: 1;
}
.reward-popup-plus {
    font-family: 'Outfit', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: #6cdc92;
    margin-right: 2px;
}
.reward-popup-num {
    font-family: 'Outfit', sans-serif;
    font-size: 26px;
    font-weight: 800;
    color: #f5dc8e;
    text-shadow: 0 1px 4px rgba(232, 196, 122, 0.4);
}
.reward-popup-btn {
    display: inline-block;
    padding: 10px 24px;
    font-size: 13.5px;
    font-weight: 700;
    font-family: 'Outfit', 'Noto Sans Hebrew', sans-serif;
    color: #1a1208;
    background: linear-gradient(180deg, #f5dc8e 0%, #e8c47a 50%, #b8860b 100%);
    border: 1px solid rgba(0, 0, 0, 0.4);
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow:
        0 3px 10px rgba(232, 196, 122, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    position: relative;
    z-index: 1;
}
.reward-popup-btn:hover {
    transform: translateY(-1px);
    box-shadow:
        0 5px 14px rgba(232, 196, 122, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
