:root {
  --bg: #0a0a0e; --bg-2: #121219; --panel: #16161f; --panel-2: #1d1d28;
  --text: #f5f5f7; --muted: #9aa0aa; --line: #26262f;
  --purple: #6d28d9; --purple-2: #7c3aed; --pink: #db2777; --gold: #e0b341;
  --radius: 14px; --shadow: 0 8px 24px rgba(0,0,0,.35);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text); padding-bottom: 88px;
  background:
    radial-gradient(1200px 480px at 50% -160px, rgba(124,58,237,.28), transparent 70%),
    radial-gradient(900px 380px at 100% 0, rgba(219,39,119,.16), transparent 65%),
    var(--bg);
  background-attachment: fixed;
}
img { display: block; }
a { color: inherit; text-decoration: none; }

/* Page sections fade/rise in on load */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.banner, .big-btns, .search, .chips, .section, .mega-card { animation: rise .45s ease both; }
.big-btns { animation-delay: .03s; } .search { animation-delay: .06s; }
.chips { animation-delay: .09s; } .section { animation-delay: .12s; }

/* Status bar clock (kept exactly — sits on top of every page) */
.statusbar { background: #000; display: flex; justify-content: center; padding: 8px 0 6px; }
.statusbar .clock { background: #2c2c2e; color: #fff; font-size: 13px; font-weight: 600; padding: 3px 14px; border-radius: 999px; letter-spacing: .5px; font-variant-numeric: tabular-nums; }

/* WanejoBets navbar (host) — kept on top of every page */
.navbar { background: linear-gradient(180deg, #000, rgba(0,0,0,.82)); backdrop-filter: blur(6px); padding: 10px 16px 14px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20; }
.navbar .back { background: var(--panel-2); color: #fff; border: 1px solid var(--line); width: 36px; height: 36px; border-radius: 10px; font-size: 18px; cursor: pointer; transition: transform .12s, background .12s; }
.navbar .back:active { transform: scale(.92); background: #2a2a36; }
.navbar .logo { font-weight: 800; font-size: 19px; font-style: italic; letter-spacing: .5px; color: #fff; }
.navbar .logo b { color: var(--gold); }

/* Game page navbar: back on the left, logo centered, nothing else. */
.navbar-game { justify-content: center; position: relative; }
.navbar-game .back { position: absolute; left: 16px; }

.section { padding: 16px; }
.section h3 { margin: 0 0 12px; font-size: 17px; letter-spacing: .2px; }
.section-head { display: flex; align-items: center; justify-content: space-between; }
.section-head .all { color: var(--text); font-size: 12px; font-weight: 600; background: rgba(255,255,255,.08); padding: 4px 11px; border-radius: 999px; cursor: pointer; transition: background .12s; }
.section-head .all:active { background: rgba(255,255,255,.16); }

/* Banner + big buttons (home) */
.banner { position: relative; height: 122px; background: linear-gradient(120deg,#1e3a8a,#7c3aed 45%,#db2777); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 16px; text-align: center; padding: 0 16px; overflow: hidden; }
.banner::after { content: ""; position: absolute; inset: 0; background: radial-gradient(420px 120px at 20% 0, rgba(255,255,255,.25), transparent 70%); }
.big-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 16px; }
.big-btn { border: 1.5px solid rgba(224,179,65,.6); color: var(--gold); background: linear-gradient(180deg, rgba(224,179,65,.10), rgba(224,179,65,.02)); border-radius: 12px; padding: 14px 8px; font-weight: 800; font-size: 13px; letter-spacing: .6px; cursor: pointer; text-align: center; transition: transform .12s, box-shadow .12s, background .12s; }
.big-btn:active { transform: translateY(1px) scale(.99); }
.big-btn:hover { background: linear-gradient(180deg, rgba(224,179,65,.18), rgba(224,179,65,.05)); box-shadow: 0 6px 18px rgba(224,179,65,.12); }

/* Search + chips */
.search { margin: 14px 16px; display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--muted); transition: border-color .15s, box-shadow .15s; }
.search:focus-within { border-color: var(--purple-2); box-shadow: 0 0 0 3px rgba(124,58,237,.18); }
.search input { flex: 1; background: transparent; border: none; outline: none; color: var(--text); font-size: 14px; }
.search .ico { color: var(--gold); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip-btn { white-space: nowrap; background: rgba(255,255,255,.05); color: var(--muted); border: 1px solid transparent; font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 999px; cursor: pointer; transition: color .12s, background .12s, border-color .12s; }
.chip-btn:hover { color: var(--text); }
.chip-btn.active { color: #fff; background: linear-gradient(135deg, var(--purple), var(--purple-2)); border-color: rgba(124,58,237,.6); box-shadow: 0 4px 14px rgba(124,58,237,.3); }

/* Tiles */
.tile-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.tile-row::-webkit-scrollbar { display: none; }
.tile-row .tile { width: 100px; flex: 0 0 auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 14px; }
.tile { cursor: pointer; transition: transform .14s; }
.tile:active { transform: scale(.96); }
.tile .art { aspect-ratio: 1/1; border-radius: 14px; overflow: hidden; position: relative; background: var(--panel-2); box-shadow: var(--shadow); }
.tile .art::after { content: ""; position: absolute; inset: 0; border-radius: 14px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); pointer-events: none; }
.tile .art img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.tile:hover .art img { transform: scale(1.06); }
.tile .badge { position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,.65); border-radius: 6px; padding: 2px 7px; font-size: 10px; font-weight: 700; }
.tile .label { font-size: 12.5px; margin-top: 7px; line-height: 1.25; font-weight: 600; }
.tile .plays { font-size: 11px; color: var(--muted); margin-top: 2px; }

.mega-card { margin: 14px 16px; border: 1px solid var(--line); border-radius: 16px; padding: 20px; background: linear-gradient(135deg,#111827,#312e81 60%,#6d28d9); font-weight: 800; font-size: 17px; box-shadow: var(--shadow); }

/* Providers */
.providers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.provider { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: 14px; min-height: 84px; display: grid; place-items: center; font-weight: 700; font-size: 14px; text-align: center; padding: 12px; cursor: pointer; transition: transform .12s, border-color .12s, box-shadow .12s; }
.provider:hover { border-color: rgba(124,58,237,.5); box-shadow: 0 6px 18px rgba(124,58,237,.15); }
.provider:active { transform: scale(.97); }

/* Bottom nav */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.92); backdrop-filter: blur(8px); display: flex; justify-content: space-around; padding: 10px 6px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); z-index: 20; }
.bottom-nav button { background: none; border: none; color: var(--muted); font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; transition: color .12s; }
.bottom-nav button:active { transform: scale(.95); }
.bottom-nav button.active { color: var(--purple-2); }
.bottom-nav .ic { font-size: 20px; }

/* Game page: navbar on top, the whole area below is the game iframe */
body[data-page="game"] { padding-bottom: 0; display: flex; flex-direction: column; min-height: 100vh; background: var(--bg); }
.game-stage { position: relative; flex: 1 1 auto; display: flex; min-height: 0; background: var(--bg); }
.game-stage iframe { flex: 1 1 auto; width: 100%; border: 0; background: var(--bg); opacity: 0; transition: opacity .35s ease; }
.game-stage.loaded iframe { opacity: 1; }

/* Branded loading screen over the iframe (no white flash) */
.game-loader {
  position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  background: radial-gradient(700px 360px at 50% 35%, rgba(124,58,237,.22), transparent 70%), var(--bg);
  transition: opacity .35s ease; opacity: 1;
}
.game-stage.loaded .game-loader { opacity: 0; pointer-events: none; }
.loader-logo { font-weight: 800; font-size: 26px; font-style: italic; letter-spacing: .5px; color: #fff; }
.loader-logo b { color: var(--gold); }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 3px solid rgba(255,255,255,.15); border-top-color: var(--purple-2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { color: var(--muted); font-size: 13px; letter-spacing: .3px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 100px; transform: translate(-50%, 12px); background: rgba(20,20,28,.96); border: 1px solid var(--line); color: var(--text); font-size: 13px; font-weight: 600; padding: 11px 18px; border-radius: 999px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
