/* TDET.VIP lobby — faithful to reference (black theme, game-player hero). */
:root {
  --bg: #08080b;
  --bg2: #0d0d12;
  --card: #141419;
  --card2: #1b1b22;
  --line: rgba(255, 255, 255, .065);
  --line2: rgba(255, 255, 255, .11);
  --text: #f2f2f6;
  --muted: #8a8a96;
  --red: #e2333f;
  --red-deep: #a4131c;
  --gold: #f4c14e;
  --green: #34d07a;
  --img-base: https://cdn.zmcyu9ypc.com;
  --side: 88px;
  /* Same type system as the admin back-office for a consistent, clean look. */
  --font: "IBM Plex Sans Thai", "Noto Sans Thai", system-ui, "Segoe UI", Arial, sans-serif;
  font-family: var(--font);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); min-height: 100%;
  font-family: var(--font); font-size: 15px; line-height: 1.55; letter-spacing: .1px;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
h1, h2, h3, h4 { letter-spacing: 0; line-height: 1.3; }
/* Form controls don't inherit font by default — keep them on the brand font. */
button, input, select, textarea { font-family: var(--font); }
/* Tabular figures so balances / amounts line up cleanly (matches admin). */
.balance .bl b, .wm-bal b, .pb-win .w, .pod .amt, .rank-row .amt, .tx-row .tx-amt, .wm-pane input { font-variant-numeric: tabular-nums; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
:focus-visible { outline: 2px solid rgba(226, 51, 63, .8); outline-offset: 2px; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #26262e; border-radius: 8px; }

/* Iconify icon sizing per context */
iconify-icon { display: inline-block; vertical-align: -0.125em; }
.nav-item iconify-icon { font-size: 24px; }
.icon-btn iconify-icon { font-size: 21px; }
.balance .add iconify-icon { font-size: 22px; }
.user .vip iconify-icon { font-size: 11px; }
.user .chev iconify-icon { font-size: 16px; }
.ph-btn iconify-icon { font-size: 18px; }
.mode iconify-icon { font-size: 14px; }
.pb-ic iconify-icon { font-size: 15px; }
.search iconify-icon { font-size: 19px; color: var(--muted); }
.tab iconify-icon { font-size: 15px; vertical-align: -2px; }
.sec-head h2 iconify-icon { font-size: 19px; vertical-align: -3px; }
.bn iconify-icon { font-size: 23px; }
.bn.center .ring iconify-icon { font-size: 24px; }
.wm-close iconify-icon { font-size: 18px; }
.hs-loading iconify-icon { font-size: 20px; vertical-align: -4px; }
.promo .ic iconify-icon { font-size: 22px; }

.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }

/* ===== Sidebar ===== */
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  align-items: center; gap: 3px; padding: 14px 8px; background: #060608;
  border-right: 1px solid var(--line); overflow-y: auto; scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }
.side-logo { width: 44px; height: 44px; margin-bottom: 12px; }
.side-logo img { width: 100%; height: 100%; object-fit: contain; }
.nav-item { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 11px 4px; border-radius: 14px; color: var(--muted); font-size: 11px; font-weight: 600; transition: all .15s; }
.nav-item svg { width: 23px; height: 23px; }
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .04); }
.nav-item.active { color: #fff; background: linear-gradient(180deg, var(--red), var(--red-deep)); box-shadow: 0 8px 16px -8px rgba(226, 51, 63, .85); }

/* ===== Main / topbar ===== */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 14px;
  padding: 14px 22px; background: #060608; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; }
.brand img { height: 42px; }
.brand .bt b { font-size: 21px; font-weight: 800; letter-spacing: .3px; line-height: 1; }
.brand .bt b i { color: var(--red); font-style: normal; }
.brand .bt small { display: block; font-size: 8px; letter-spacing: 2.5px; color: var(--muted); margin-top: 3px; }
.top-spacer { flex: 1; }
.balance { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line2); border-radius: 14px; padding: 8px 8px 8px 18px; }
.balance .bl small { font-size: 10px; color: var(--muted); display: block; }
.balance .bl b { font-size: 17px; }
.balance .add { width: 36px; height: 36px; border-radius: 11px; font-size: 22px; font-weight: 700; color: #3a2a00; background: linear-gradient(180deg, #ffd86b, var(--gold)); display: grid; place-items: center; box-shadow: 0 6px 14px -6px rgba(244, 193, 78, .8); }
.user { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line2); border-radius: 14px; padding: 6px 14px 6px 7px; }
.user .av { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: linear-gradient(135deg, var(--red), #6d3bf5); display: grid; place-items: center; font-weight: 700; }
.user .un b { font-size: 14px; line-height: 1; }
.user .un .vip { display: inline-flex; align-items: center; gap: 3px; font-size: 9.5px; color: #3a2a00; background: linear-gradient(180deg, #ffd86b, var(--gold)); padding: 2px 8px; border-radius: 999px; font-weight: 700; margin-top: 3px; }
.user .chev { color: var(--muted); }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; background: var(--card); border: 1px solid var(--line2); display: grid; place-items: center; color: #cfcfd6; position: relative; }
.icon-btn:hover { color: #fff; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .badge { position: absolute; top: -5px; right: -5px; background: var(--red); color: #fff; font-size: 10px; min-width: 18px; height: 18px; border-radius: 999px; display: grid; place-items: center; font-weight: 700; border: 2px solid var(--bg); }
.menu-btn { display: none; }

.content { padding: 18px 22px 30px; display: flex; flex-direction: column; gap: 20px; }

/* ===== CMS: announcement bar + promo banner ===== */
.announce { display: flex; align-items: center; gap: 10px; background: linear-gradient(90deg, rgba(227, 36, 43, .18), rgba(244, 193, 78, .12)); border: 1px solid var(--line-red); border-radius: 12px; padding: 11px 16px; font-size: 14px; line-height: 1.4; }
.announce iconify-icon { color: var(--gold); font-size: 19px; flex: none; }
.announce span { min-width: 0; }
.banner { display: block; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); transition: opacity .4s ease; }
.banner img { width: 100%; max-height: 240px; object-fit: cover; display: block; }

/* ===== Game-player hero ===== */
.player { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.crumbs { padding: 14px 18px 0; font-size: 12px; color: var(--muted); }
.crumbs b { color: var(--text); font-weight: 600; }
.player-head { display: flex; align-items: center; gap: 12px; padding: 8px 18px 14px; }
.player-head h1 { margin: 0; font-size: 22px; }
.player-head .prov { font-size: 12px; font-weight: 700; color: var(--gold); letter-spacing: 1px; }
.player-head .ph-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.mode { display: flex; align-items: center; gap: 7px; background: var(--card2); border: 1px solid var(--line2); border-radius: 10px; padding: 8px 14px; font-size: 13px; }
.mode .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.ph-btn { width: 38px; height: 38px; border-radius: 10px; background: var(--card2); border: 1px solid var(--line2); display: grid; place-items: center; color: var(--muted); }
.ph-btn:hover { color: #fff; }
.player-screen { position: relative; aspect-ratio: 16 / 6.2; max-height: 460px; overflow: hidden; cursor: pointer; background: #0d0a16; }
.hs-bg { position: absolute; inset: -12%; z-index: 0; background-size: cover; background-position: center; filter: blur(36px) brightness(.42) saturate(1.25); }
.hs-art { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1; max-height: 78%; max-width: 44%; width: auto; height: auto; object-fit: contain; border-radius: 16px; box-shadow: 0 22px 54px -16px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 255, 255, .06); }
.hs-loading { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 2; color: var(--muted); font-size: 13px; }
.hs-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 3; opacity: 0; transition: opacity .5s ease; background: #0d0a16; }
.player-screen.live { cursor: default; }
.player-screen.live .hs-frame { opacity: 1; }
.player-screen.live .hs-loading { display: none; }
.player-screen::after { content: "▶ เล่นเลย"; position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; font-size: 20px; font-weight: 800; color: #fff; background: rgba(8, 6, 16, .45); opacity: 0; transition: opacity .18s; }
.player-screen.live::after { display: none; }
.player-screen:hover::after { opacity: 1; }
.player-screen { transition: opacity .35s ease; }
.player-screen.fading { opacity: .15; }
.hero-dots { display: flex; gap: 6px; justify-content: center; padding: 10px 0 2px; background: #0d0d12; }
.hero-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line2); transition: all .2s; cursor: pointer; }
.hero-dot.active { background: var(--red); width: 22px; border-radius: 4px; }
.player-bar { display: flex; align-items: center; gap: 18px; padding: 14px 18px; background: #0d0d12; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pb-icons { display: flex; gap: 8px; }
.pb-ic { width: 34px; height: 34px; border-radius: 50%; background: var(--card2); border: 1px solid var(--line2); display: grid; place-items: center; color: var(--muted); font-size: 14px; }
.pb-stat { font-size: 12px; color: var(--muted); line-height: 1.5; }
.pb-stat b { color: var(--text); }
.pb-win { margin-left: auto; text-align: center; }
.pb-win .w { font-size: 22px; font-weight: 800; }
.pb-win .w span { color: var(--gold); }
.pb-win small { color: var(--muted); font-size: 11px; }
.pb-spin { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.pb-round { width: 38px; height: 38px; border-radius: 50%; background: var(--card2); border: 1px solid var(--line2); color: #fff; font-size: 20px; display: grid; place-items: center; }
.pb-go { width: 64px; height: 64px; border-radius: 50%; background: var(--card2); border: 3px solid var(--red); display: grid; place-items: center; position: relative; }
.pb-go span { width: 22px; height: 22px; border-radius: 5px; background: var(--red); }
.pb-go small { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); color: var(--red); font-size: 10px; white-space: nowrap; }

/* ===== Toolbar ===== */
.game-status { background: linear-gradient(135deg, rgba(226, 51, 63, .14), rgba(244, 193, 78, .06) 58%, rgba(10, 10, 14, .92)); border: 1px solid rgba(244, 193, 78, .18); border-radius: 16px; padding: 14px; box-shadow: 0 18px 44px -28px rgba(226, 51, 63, .65); }
.game-status-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: #fff; }
.game-status-head span { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; }
.game-status-head iconify-icon { color: var(--gold); font-size: 20px; }
.game-status-head small { color: var(--muted); font-size: 12px; text-align: right; }
.game-status-more { display: inline-flex; align-items: center; gap: 6px; flex: none; border: 1px solid rgba(244, 193, 78, .32); background: rgba(244, 193, 78, .08); color: var(--gold); border-radius: 999px; padding: 7px 11px; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.game-status-more iconify-icon { font-size: 16px; }
.game-status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.game-status-item { min-width: 0; min-height: 74px; display: flex; align-items: center; gap: 11px; text-align: left; border-radius: 13px; padding: 12px; background: rgba(13, 13, 18, .74); border: 1px solid var(--line2); cursor: default; }
.game-status-item iconify-icon { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; padding: 8px; background: rgba(255, 255, 255, .06); font-size: 22px; }
.game-status-item span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.game-status-item b { font-size: 14px; line-height: 1.25; }
.game-status-item small { color: var(--muted); font-size: 12px; line-height: 1.25; overflow-wrap: anywhere; }
.game-status-item.ok iconify-icon { color: var(--green); background: rgba(52, 208, 122, .12); }
.game-status-item.warn { border-color: rgba(244, 193, 78, .38); cursor: pointer; }
.game-status-item.warn iconify-icon { color: var(--gold); background: rgba(244, 193, 78, .13); }
.game-status-item.bad { border-color: rgba(226, 51, 63, .46); cursor: pointer; }
.game-status-item.bad iconify-icon { color: #ff5f68; background: rgba(226, 51, 63, .14); }
.activity-panel { display: grid; grid-template-columns: 1.05fr 1fr 1.15fr; gap: 12px; margin: 14px 0 10px; }
.activity-card { min-width: 0; background: linear-gradient(145deg, rgba(21, 21, 28, .94), rgba(9, 9, 12, .96)); border: 1px solid rgba(244, 193, 78, .14); border-radius: 16px; padding: 14px; box-shadow: 0 18px 42px -32px rgba(226, 51, 63, .72); }
.activity-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; color: #fff; }
.activity-head span { min-width: 0; display: inline-flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 900; line-height: 1.2; }
.activity-head iconify-icon { color: var(--gold); font-size: 19px; }
.activity-head b { flex: none; color: var(--gold); font-size: 20px; line-height: 1; }
.activity-head small { color: var(--muted); font-size: 12px; text-align: right; }
.activity-all { flex: none; display: inline-flex; align-items: center; gap: 3px; color: var(--gold); border: 1px solid rgba(244, 193, 78, .28); border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 900; background: rgba(244, 193, 78, .07); }
.activity-score { display: flex; align-items: baseline; gap: 7px; margin: -2px 0 9px; }
.activity-score b { color: var(--gold); font-size: 24px; line-height: 1; }
.activity-score small { color: var(--muted); font-size: 12px; }
.mission-list, .reward-feed { display: flex; flex-direction: column; gap: 8px; }
.mission-row { display: flex; align-items: center; gap: 9px; min-height: 42px; border-radius: 12px; padding: 8px 9px; background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .07); }
.mission-row iconify-icon { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 10px; padding: 5px; color: var(--muted); background: rgba(255, 255, 255, .055); }
.mission-row.done iconify-icon { color: var(--green); background: rgba(52, 208, 122, .12); }
.mission-row span { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mission-row b { color: #fff; font-size: 13px; line-height: 1.25; overflow-wrap: anywhere; }
.mission-row small { color: var(--muted); font-size: 11px; line-height: 1.25; overflow-wrap: anywhere; }
.rights-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.right-tile { min-height: 58px; border-radius: 12px; padding: 10px; background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .07); }
.right-tile b { display: block; color: var(--gold); font-size: 18px; line-height: 1.1; overflow-wrap: anywhere; }
.right-tile small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.25; }
.right-tile.hot { border-color: rgba(226, 51, 63, .35); background: linear-gradient(135deg, rgba(226, 51, 63, .13), rgba(244, 193, 78, .06)); }
.reward-item { display: grid; grid-template-columns: 86px minmax(0, 1fr) auto; gap: 8px; align-items: center; min-height: 36px; border-radius: 11px; padding: 8px 9px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .065); }
.reward-item b { color: #fff; font-size: 12px; line-height: 1.25; white-space: nowrap; }
.reward-item span { color: var(--muted); font-size: 12px; line-height: 1.25; overflow-wrap: anywhere; }
.reward-item strong { color: var(--gold); font-size: 13px; white-space: nowrap; }
.activity-muted { color: var(--muted); font-size: 12px; line-height: 1.35; padding: 7px 0; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; overflow: hidden; }
.search { flex: 0 0 260px; display: flex; align-items: center; gap: 9px; background: var(--card); border: 1px solid var(--line2); border-radius: 12px; padding: 0 14px; height: 48px; }
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input { flex: 1; background: none; border: 0; color: var(--text); height: 100%; }
.search input:focus { outline: none; }
.tabs { display: flex; gap: 9px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 0 0 auto; height: 48px; padding: 0 20px; border-radius: 12px; background: var(--card); border: 1px solid var(--line2); color: var(--muted); font-weight: 700; font-size: 14px; white-space: nowrap; display: flex; align-items: center; gap: 7px; }
.tab:hover { color: #fff; }
.tab.active { color: #fff; background: linear-gradient(180deg, #ff3d48, var(--red-deep)); border-color: transparent; box-shadow: 0 8px 20px -8px rgba(226, 51, 63, .85), inset 0 1px 0 rgba(255, 255, 255, .2); }
.tab.end { margin-left: auto; color: var(--muted); }

/* Provider (ค่ายเกม) chips */
.providers { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.providers::-webkit-scrollbar { display: none; }
.prov-chip { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; height: 50px; padding: 0 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--line2); color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; transition: all .15s; }
.prov-chip img { height: 30px; width: auto; max-width: 76px; object-fit: contain; }
.prov-chip:hover { color: #fff; border-color: var(--line-red); }
.prov-chip.active { color: #fff; border-color: var(--red); background: linear-gradient(180deg, rgba(226, 51, 63, .2), rgba(164, 19, 28, .08)); box-shadow: 0 8px 18px -10px rgba(226, 51, 63, .7); }

.sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sec-head h2 { margin: 0; font-size: 18px; }
.sec-head .more-link { color: var(--muted); font-size: 13px; }

/* ===== Cards / grid / carousel ===== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(162px, 1fr)); gap: 16px; }
.carousel { display: grid; grid-auto-flow: column; grid-auto-columns: 168px; gap: 14px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.carousel::-webkit-scrollbar { display: none; }
.g-wrap { display: flex; flex-direction: column; gap: 7px; }
.g-card { position: relative; border-radius: 16px; overflow: hidden; background: var(--card); border: 1px solid var(--line); aspect-ratio: 1/1; transition: transform .16s, box-shadow .16s, border-color .16s; }
.carousel .g-card { aspect-ratio: 1/1; }
.g-card:hover { transform: translateY(-4px); border-color: var(--line-red); box-shadow: 0 16px 30px -12px rgba(0, 0, 0, .8), 0 0 0 1px rgba(226, 51, 63, .3); }
.g-card::before { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(100deg, #19151f 28%, #241d30 50%, #19151f 72%); background-size: 220% 100%; animation: shimmer 1.3s linear infinite; }
.g-card.loaded::before { display: none; }
.g-card img { width: 100%; height: 100%; object-fit: cover; background: #19151f; position: relative; z-index: 1; opacity: 0; transition: opacity .35s ease; }
.g-card.loaded img { opacity: 1; }
/* fallback when a provider's thumbnail isn't hosted on the CDN (e.g. joker/askmeplay) */
.g-ph { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px; text-align: center; background: radial-gradient(120% 100% at 50% 0%, #3a1016, #18090f 72%); }
.g-ph iconify-icon { font-size: 30px; color: var(--gold); filter: drop-shadow(0 2px 6px rgba(0,0,0,.6)); }
.g-ph span { font-size: 12px; font-weight: 700; color: #ecdcc4; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@keyframes shimmer { to { background-position: -220% 0; } }
.g-card .g-badge { position: absolute; top: 8px; right: 8px; font-size: 10px; font-weight: 800; padding: 3px 9px; border-radius: 7px; color: #fff; letter-spacing: .5px; }
.g-badge.hot { background: linear-gradient(180deg, #ff5a3a, #d11); }
.g-badge.new { background: linear-gradient(180deg, #34d07a, #14934e); }
.g-badge.off { left: 8px; right: auto; max-width: calc(100% - 16px); background: linear-gradient(180deg, #f4c14e, #a87312); color: #211400; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 5px 14px -7px rgba(244, 193, 78, .75); }
.g-card .g-play { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; background: rgba(164, 19, 28, .4); transition: opacity .16s; }
.g-card:hover .g-play { opacity: 1; }
.g-card .g-play span { background: linear-gradient(180deg, #ff3a3a, var(--red-deep)); color: #fff; font-weight: 700; padding: 8px 16px; border-radius: 999px; font-size: 13px; }
.g-card.disabled { opacity: .42; pointer-events: none; filter: grayscale(.6); }
.g-card.provider-off { opacity: .78; pointer-events: auto; filter: grayscale(.35); }
.g-card.provider-off .g-play { opacity: 1; background: rgba(0,0,0,.62); }
.g-cap { font-size: 13px; font-weight: 600; text-align: center; color: #d6d6db; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more-btn { display: block; margin: 8px auto 0; border: 1px solid var(--line-red); background: var(--card); color: #fff; border-radius: 12px; padding: 12px 30px; font-weight: 700; }
.more-btn:hover { background: rgba(226, 51, 63, .12); }
.state { padding: 40px; text-align: center; color: var(--muted); }
:root { --line-red: rgba(226, 51, 63, .45); }

/* ===== Social ===== */
.social { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card-box { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 12px; margin: 16px 0 8px; }
.pod { text-align: center; }
.pod .av { width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 8px; display: grid; place-items: center; font-weight: 800; font-size: 22px; color: #fff; position: relative; }
.pod.p1 .av { width: 78px; height: 78px; box-shadow: 0 0 0 3px var(--gold), 0 12px 26px -8px rgba(244, 193, 78, .7); }
.pod.p2 .av { box-shadow: 0 0 0 3px #c9ccd6; }
.pod.p3 .av { box-shadow: 0 0 0 3px #cd7f32; }
.pod .crown { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 18px; }
.pod .rk { position: absolute; bottom: -7px; right: -7px; width: 24px; height: 24px; border-radius: 50%; background: #0d0d12; border: 1px solid var(--line2); font-size: 12px; display: grid; place-items: center; font-weight: 800; }
.pod.p1 .rk { background: var(--gold); color: #3a2a00; }
.pod.p2 .rk { background: #c9ccd6; color: #222; }
.pod.p3 .rk { background: #cd7f32; color: #fff; }
.pod .nm { font-size: 13px; font-weight: 700; }
.pod .amt { font-size: 12px; color: var(--gold); font-weight: 700; }
.rank-row { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.rank-row .r { color: var(--muted); font-weight: 700; }
.rank-row .amt { color: var(--gold); font-weight: 700; }
.win-row { display: grid; grid-template-columns: 36px 1fr auto; gap: 11px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.win-row:first-of-type { border-top: 0; }
.win-row .av { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; }
.win-row .info { min-width: 0; line-height: 1.3; }
.win-row .info b { font-size: 13px; }
.win-row .info small { display: block; color: var(--muted); font-size: 11px; }
.win-row .right { text-align: right; line-height: 1.3; }
.win-row .right .amt { color: var(--green); font-weight: 700; font-size: 13px; }
.win-row .right small { color: var(--muted); font-size: 10px; }

/* ===== Promo bar ===== */
.promos { display: grid; grid-template-columns: repeat(6, 1fr); background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 6px; }
.sys-status { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.sys-item { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.sys-item iconify-icon { font-size: 22px; flex: none; }
.sys-item b { display: block; font-size: 12px; line-height: 1.25; }
.sys-item small { color: var(--muted); font-size: 11px; line-height: 1.25; }
.sys-item small b { color: var(--gold); }
.sys-item.ok iconify-icon { color: var(--green); }
.sys-item.bad { border-color: rgba(244,193,78,.35); }
.sys-item.bad iconify-icon { color: var(--gold); }
.sys-item.wide { grid-column: 1 / -1; align-items: flex-start; }
.sys-item.provider-down small { display: block; margin-top: 2px; line-height: 1.45; }
.promo { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; position: relative; }
.promo + .promo::before { content: ""; position: absolute; left: 0; top: 18%; height: 64%; width: 1px; background: var(--line); }
.promo:hover { background: rgba(255, 255, 255, .03); }
.promo .ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; background: radial-gradient(circle at 50% 30%, rgba(244, 193, 78, .25), rgba(226, 51, 63, .12)); border: 1px solid rgba(244, 193, 78, .3); flex: none; }
.promo .tx b { font-size: 13px; display: block; }
.promo .tx small { font-size: 11px; color: var(--muted); }

/* ===== Bottom nav ===== */
.bottomnav { display: none; }

/* ===== Overlay / toast ===== */
.overlay { position: fixed; inset: 0; z-index: 80; display: none; place-items: center; background: rgba(0, 0, 0, .75); backdrop-filter: blur(3px); }
.overlay.show { display: grid; }
.overlay .box { text-align: center; }
.overlay .spin { width: 46px; height: 46px; margin: 0 auto 14px; border: 4px solid rgba(255, 255, 255, .25); border-top-color: var(--red); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px); z-index: 90; background: #1a1416; color: #ffb3b3; border: 1px solid var(--line-red); padding: 12px 20px; border-radius: 12px; font-size: 14px; opacity: 0; transition: .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Notifications ===== */
.notif-panel { position: fixed; top: 66px; right: 20px; z-index: 45; width: 330px; max-width: calc(100vw - 24px); background: var(--card); border: 1px solid var(--line2); border-radius: 14px; box-shadow: 0 20px 50px -16px rgba(0, 0, 0, .85); display: none; overflow: hidden; }
.notif-panel.open { display: block; }
.notif-head { padding: 14px 16px; font-weight: 700; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.notif-head iconify-icon { color: var(--gold); }
.notif-list { max-height: 60vh; overflow: auto; }
.notif-item { display: flex; gap: 11px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.notif-item:last-child { border-bottom: 0; }
.notif-item.unread { background: rgba(227, 36, 43, .07); }
.notif-item .ni { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.notif-item .ni iconify-icon { font-size: 18px; }
.ni.ok { background: rgba(52, 208, 122, .16); color: var(--green); }
.ni.pending { background: rgba(244, 193, 78, .16); color: var(--gold); }
.ni.rej { background: rgba(226, 51, 63, .16); color: #ff8a8a; }
.notif-item .nt { flex: 1; line-height: 1.45; }
.notif-item .nt small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.notif-empty { text-align: center; color: var(--muted); padding: 34px 16px; font-size: 13px; }
@media (max-width: 640px) { .notif-panel { top: 60px; right: 8px; } }

/* ===== Wallet modal (deposit / withdraw / history) ===== */
.wallet-modal { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; background: rgba(0, 0, 0, .72); backdrop-filter: blur(4px); padding: 16px; }
.wallet-modal.show { display: grid; }
.wm-box { width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--line2); border-radius: 18px; padding: 22px; position: relative; max-height: 92vh; overflow-y: auto; }
.wm-close { position: absolute; top: 12px; right: 14px; width: 32px; height: 32px; border-radius: 8px; color: var(--muted); font-size: 18px; }
.wm-close:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.wm-title { font-size: 18px; font-weight: 800; margin: 0 0 14px; }
.wm-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.wm-tab { flex: 1; height: 42px; border-radius: 10px; background: var(--card2); border: 1px solid var(--line); color: var(--muted); font-weight: 700; font-size: 13px; }
.wm-tab.active { background: linear-gradient(180deg, var(--red), var(--red-deep)); color: #fff; border-color: transparent; }
.wm-bal { text-align: center; margin-bottom: 16px; color: var(--muted); font-size: 13px; }
.wm-bal b { color: var(--gold); font-size: 24px; display: block; margin-top: 4px; }
.wm-pane { display: none; }
.wm-pane.active { display: block; }
.wm-pane label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
.wm-pane input { width: 100%; height: 52px; background: #0c0d0e; border: 1px solid var(--line2); border-radius: 12px; padding: 0 14px; color: var(--text); font-size: 18px; font-weight: 700; }
.wm-pane input:focus { outline: none; border-color: var(--red); }
.wm-bankinfo { background: var(--card2); border: 1px dashed var(--line-red); border-radius: 12px; padding: 14px; font-size: 13px; line-height: 1.8; }
.wm-bankinfo b { color: var(--gold); }
.amt-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.amt-chip { height: 42px; border-radius: 10px; background: var(--card2); border: 1px solid var(--line2); color: var(--text); font-weight: 700; font-size: 13px; }
.amt-chip:hover { border-color: var(--red); color: #fff; }
.wm-submit { width: 100%; height: 52px; margin-top: 18px; border-radius: 12px; background: linear-gradient(180deg, #ff3a3a, var(--red-deep)); color: #fff; font-weight: 800; font-size: 16px; }
.wm-submit[disabled] { opacity: .6; }
.wm-state { margin-top: 14px; text-align: center; font-size: 13px; min-height: 18px; }
.wm-state.ok { color: var(--green); } .wm-state.bad { color: #ff8a8a; }
.tx-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 13px; }
.tx-row:first-child { border-top: 0; }
.tx-row .tx-amt { font-weight: 700; }
.tx-amt.deposit { color: var(--green); } .tx-amt.withdraw { color: var(--gold); }
.tx-badge { font-size: 11px; padding: 3px 9px; border-radius: 7px; font-weight: 700; }
.tx-badge.pending { background: rgba(246, 194, 68, .16); color: var(--gold); }
.tx-badge.approved { background: rgba(52, 208, 122, .16); color: var(--green); }
.tx-badge.rejected { background: rgba(226, 51, 63, .16); color: #ff8a8a; }
.tx-empty { text-align: center; color: var(--muted); padding: 24px; font-size: 13px; }

/* ===== Favorite star on cards ===== */
.g-card .g-fav { position: absolute; top: 8px; left: 8px; z-index: 3; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(8, 6, 16, .55); color: rgba(255, 255, 255, .6); backdrop-filter: blur(2px); opacity: 0; transition: opacity .16s, color .16s, transform .12s; }
.g-card:hover .g-fav, .g-card .g-fav.on { opacity: 1; }
.g-card .g-fav iconify-icon { font-size: 17px; }
.g-card .g-fav:hover { transform: scale(1.12); color: #fff; }
.g-card .g-fav.on { color: var(--gold); }

/* ===== Daily check-in modal ===== */
.checkin-modal { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; background: rgba(0, 0, 0, .72); backdrop-filter: blur(4px); padding: 16px; }
.checkin-modal.show { display: grid; }
.ci-box { width: 100%; max-width: 460px; background: linear-gradient(160deg, #1a1320, #120b16); border: 1px solid var(--line2); border-radius: 18px; padding: 24px; position: relative; max-height: 92vh; overflow-y: auto; }
.ci-title { font-size: 19px; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.ci-title iconify-icon { font-size: 22px; }
.ci-sub { color: var(--muted); font-size: 13px; margin: 0 0 18px; line-height: 1.6; }
.ci-days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.ci-day { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 13px 6px; text-align: center; position: relative; }
.ci-day .d { font-size: 11px; color: var(--muted); }
.ci-day .r { font-size: 15px; font-weight: 800; color: var(--gold); margin-top: 5px; }
.ci-day .r small { font-size: 9px; font-weight: 600; color: var(--muted); display: block; }
.ci-day.done { border-color: rgba(52, 208, 122, .5); background: rgba(52, 208, 122, .1); }
.ci-day.done::after { content: "✓"; position: absolute; top: 4px; right: 7px; color: var(--green); font-weight: 800; font-size: 12px; }
.ci-day.today { border-color: var(--gold); background: rgba(244, 193, 78, .14); box-shadow: 0 0 0 1px var(--gold), 0 10px 22px -10px rgba(244, 193, 78, .6); }
.ci-day.lock { opacity: .55; }
.ci-claim { width: 100%; height: 52px; border-radius: 12px; background: linear-gradient(180deg, #ffd86b, var(--gold)); color: #3a2a00; font-weight: 800; font-size: 16px; }
.ci-claim[disabled] { background: var(--card2); color: var(--muted); border: 1px solid var(--line2); cursor: default; }
.ci-state { margin-top: 12px; text-align: center; font-size: 13px; min-height: 16px; }
.ci-state.ok { color: var(--green); } .ci-state.bad { color: #ff8a8a; }
.promo .pdot { position: absolute; top: 12px; left: 40px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--card); animation: pdot 1.4s infinite; }
@keyframes pdot { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.45); opacity: .55; } }

/* ===== Lucky wheel modal ===== */
.wheel-modal { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; background: rgba(0, 0, 0, .74); backdrop-filter: blur(4px); padding: 16px; }
.wheel-modal.show { display: grid; }
.wh-box { width: 100%; max-width: 400px; background: linear-gradient(160deg, #1a1320, #120b16); border: 1px solid var(--line2); border-radius: 18px; padding: 24px; position: relative; text-align: center; }
.wheel-wrap { position: relative; width: 290px; height: 290px; margin: 6px auto 18px; }
.wheel { width: 290px; height: 290px; border-radius: 50%; position: relative; overflow: hidden;
  transition: transform 4.2s cubic-bezier(.16, .84, .2, 1);
  background: conic-gradient(#3a2a18 0 45deg, #2a1f33 45deg 90deg, #3a2a18 90deg 135deg, #2a1f33 135deg 180deg, #3a2a18 180deg 225deg, #2a1f33 225deg 270deg, #3a2a18 270deg 315deg, #2a1f33 315deg 360deg);
  border: 6px solid var(--gold); box-shadow: 0 0 0 4px #241a12, 0 16px 44px -14px rgba(244, 193, 78, .55); }
.wheel .wseg { position: absolute; left: 50%; top: 50%; transform-origin: 0 0; font-size: 14px; font-weight: 800; color: var(--gold); white-space: nowrap; }
.wheel .wseg b { display: inline-block; }
.wheel-pointer { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); z-index: 5; width: 0; height: 0; border-left: 13px solid transparent; border-right: 13px solid transparent; border-top: 22px solid var(--red); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); }
.wheel-hub { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 4; width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(180deg, #ffd86b, var(--gold)); display: grid; place-items: center; color: #3a2a00; box-shadow: 0 4px 12px rgba(0, 0, 0, .5); border: 3px solid #241a12; }
.wheel-hub iconify-icon { font-size: 24px; }

/* ===== Provider status modal ===== */
.provider-status-modal { position: fixed; inset: 0; z-index: 105; display: none; place-items: center; background: rgba(0, 0, 0, .74); backdrop-filter: blur(4px); padding: 16px; }
.provider-status-modal.show { display: grid; }
.ps-box { width: min(640px, 100%); max-height: min(760px, 92vh); overflow: auto; position: relative; background: linear-gradient(180deg, #15151d, #08080b); border: 1px solid rgba(244,193,78,.24); border-radius: 18px; padding: 22px; box-shadow: 0 22px 70px rgba(0,0,0,.55); }
.ps-list { display: grid; gap: 10px; margin-top: 14px; }
.ps-row { display: grid; grid-template-columns: auto 1fr; gap: 11px; align-items: flex-start; border: 1px solid var(--line2); background: rgba(255,255,255,.035); border-radius: 14px; padding: 12px; }
.ps-row iconify-icon { width: 38px; height: 38px; display: grid; place-items: center; padding: 8px; border-radius: 12px; font-size: 22px; background: rgba(255,255,255,.06); color: var(--green); }
.ps-row.bad iconify-icon { color: #ff5f68; background: rgba(226,51,63,.15); }
.ps-row.warn iconify-icon { color: var(--gold); background: rgba(244,193,78,.13); }
.ps-row b { display: block; color: #fff; font-size: 14px; line-height: 1.3; }
.ps-row small { display: block; color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 2px; overflow-wrap: anywhere; }

/* ===== Responsive ===== */
@media (max-width: 1100px) { .player-screen { aspect-ratio: 16/8; max-height: none; } }
@media (max-width: 640px) { .player-screen { aspect-ratio: 3/4; max-height: none; } }
@media (max-width: 900px) { .social { grid-template-columns: 1fr; } .activity-panel { grid-template-columns: 1fr; } .game-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sys-status, .promos { grid-template-columns: repeat(2, 1fr); } .promo + .promo::before { display: none; } }
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .brand .bt small { display: none; }
  .menu-btn { display: grid; }
  .content { padding-bottom: 92px; }
  .bottomnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: #0a0a0e; border-top: 1px solid var(--line2); padding: 6px 4px 8px; }
  .bn { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 600; padding: 6px 0; }
  .bn svg { width: 22px; height: 22px; }
  .bn.active { color: #fff; }
  .bn.center .ring { width: 52px; height: 52px; margin-top: -24px; border-radius: 50%; background: linear-gradient(180deg, var(--red), var(--red-deep)); display: grid; place-items: center; color: #fff; box-shadow: 0 8px 18px -6px rgba(226, 51, 63, .85); border: 4px solid var(--bg); }
}
@media (max-width: 640px) {
  .topbar { gap: 8px; padding: 10px 12px; }
  .brand .bt { display: none; }              /* logo only — frees space, no overlap */
  .menu-btn { display: none; }               /* bottom nav already covers navigation */
  .balance .bl small { display: none; }
  .balance { padding: 5px 5px 5px 12px; gap: 8px; }
  .balance .bl b { font-size: 14px; }
  .balance .add { width: 30px; height: 30px; font-size: 18px; }
  .icon-btn { width: 36px; height: 36px; }
  .user { padding: 4px; }
  .user .un, .user .chev { display: none; }
  .player-head { align-items: flex-start; flex-wrap: wrap; gap: 8px; padding: 8px 12px 12px; }
  .player-head > div:first-child { min-width: 0; flex: 1 1 190px; }
  .player-head h1 { font-size: 17px; }
  .player-head .prov { font-size: 10px; }
  .player-head .ph-right { flex: 0 1 auto; gap: 6px; max-width: 100%; margin-left: 0; }
  .mode { padding: 7px 9px; font-size: 11px; white-space: nowrap; }
  .ph-btn { width: 32px; height: 32px; border-radius: 9px; }
  .game-status { padding: 12px; border-radius: 14px; }
  .game-status-head { align-items: flex-start; flex-direction: column; gap: 7px; }
  .game-status-head small { text-align: left; }
  .game-status-more { width: 100%; justify-content: center; }
  .game-status-grid { gap: 8px; }
  .game-status-item { min-height: 66px; padding: 10px; gap: 8px; }
  .game-status-item iconify-icon { width: 32px; height: 32px; font-size: 19px; border-radius: 10px; padding: 6px; }
  .game-status-item b { font-size: 13px; }
  .game-status-item small { font-size: 11px; }
  .activity-panel { gap: 10px; margin: 12px 0 9px; }
  .activity-card { border-radius: 14px; padding: 12px; }
  .activity-head { margin-bottom: 8px; }
  .activity-head span { font-size: 14px; }
  .activity-head b { font-size: 18px; }
  .rights-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .right-tile { min-height: 54px; padding: 9px; }
  .reward-item { grid-template-columns: 78px minmax(0, 1fr) auto; padding: 8px; }
  .pb-stat, .pb-win { display: none; }
  .player-bar { justify-content: space-between; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(106px, 1fr)); gap: 10px; }
  .promos { grid-template-columns: 1fr 1fr; }
  .g-card .g-fav { opacity: 1; width: 26px; height: 26px; }
  .ci-days { grid-template-columns: repeat(3, 1fr); }
}

/* Mobile lobby header: keep the brand logo visually centered while the
   wallet/actions stay usable on the left and right. */
@media (max-width: 640px) {
  .topbar {
    min-height: 58px;
    padding: 9px 12px;
    justify-content: space-between;
  }
  .top-spacer { display: none; }
  .brand {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    transform: translate(-50%, -50%);
    justify-content: center;
    pointer-events: auto;
  }
  .brand img { height: 44px; }
  .balance {
    position: relative;
    z-index: 2;
    padding: 5px 5px 5px 10px;
    gap: 7px;
  }
  .icon-btn,
  .user {
    position: relative;
    z-index: 2;
  }
  .user { display: none; }
}
@media (max-width: 420px) {
  #logoutBtn { display: none; }
}
