/* =========================================================
   91 GAMES — DESIGN SYSTEM
   Mobile-first. Desktop renders the same centered mobile-width
   application shell (never a stretched desktop dashboard).
   Palette: black / gold / orange / white.
   ========================================================= */

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

/* =========================================================
   1. TOKENS
   ========================================================= */
:root {
  --bg:            #0a0a0a;
  --bg-2:          #111111;
  --bg-deep:       #050505;
  --surface:       #1a1a1a;
  --surface-2:     #222222;

  --gold:          #c8a84b;
  --gold-soft:     #e5c97a;
  --gold-dim:      #8a7030;
  --orange:        #f07020;
  --orange-soft:   #ff8840;

  --white:         #f5f5f5;
  --white-dim:     #aaaaaa;
  --muted:         #6f6f6f;

  --green:         #66bb6a;
  --red:           #e57373;

  --border:        rgba(200,168,75,0.15);
  --border-strong: rgba(200,168,75,0.35);

  --radius-sm:     8px;
  --radius:        12px;
  --radius-lg:     16px;

  --shell-max:     480px;
  --header-h:      56px;
  --nav-h:         62px;

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --transition: 0.18s ease;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--white);
  line-height: 1.5;
  min-height: 100vh;
  /* Belt-and-braces against horizontal overflow at every width. */
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
ul, ol { list-style: none; }

/* Long unbroken strings (references, UPI ids, account numbers) must
   wrap rather than force the viewport wider. */
.break, .mono.break { overflow-wrap: anywhere; word-break: break-word; }
.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; }
.small { font-size: 11px; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 2px; }

/* =========================================================
   3. APP SHELL — centered mobile width on every screen size
   ========================================================= */
.app-shell {
  position: relative;
  width: 100%;
  max-width: var(--shell-max);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* From 600px up the shell stays mobile-width and is framed. */
@media (min-width: 600px) {
  body {
    background: var(--bg-deep);
    background-image:
      radial-gradient(ellipse at 20% 40%, rgba(200,168,75,0.05) 0%, transparent 60%),
      radial-gradient(ellipse at 80% 60%, rgba(240,112,32,0.04) 0%, transparent 60%);
  }
  .app-shell {
    box-shadow: 0 0 60px rgba(0,0,0,0.85), 0 0 0 1px rgba(200,168,75,0.10);
  }
}

.page-content {
  flex: 1;
  padding: 16px 14px calc(var(--nav-h) + 24px);
  min-width: 0;
}

/* Pages with no bottom nav (auth, admin, errors) need less bottom room. */
.auth-page, .admin-content { padding-bottom: 24px; }

/* =========================================================
   4. HEADER
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px;
  background: rgba(10,10,10,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-logo { display: flex; align-items: center; gap: 6px; min-width: 0; }
.brand-mark {
  font-size: 18px; font-weight: 900; color: var(--gold);
  letter-spacing: -0.5px; flex-shrink: 0;
}
.brand-text {
  font-size: 12px; font-weight: 800; color: var(--white);
  letter-spacing: 2px;
}
.admin-brand-text { color: var(--orange); }

.header-right { display: flex; align-items: center; gap: 8px; min-width: 0; }

.balance-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  background: rgba(200,168,75,0.12);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  min-width: 0;
}
.balance-icon { font-size: 13px; flex-shrink: 0; }
.balance-amount {
  font-size: 13px; font-weight: 800; color: var(--gold-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.header-icon-btn {
  width: 34px; height: 34px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 15px;
  transition: var(--transition);
}
.header-icon-btn:hover { background: rgba(200,168,75,0.16); }

.admin-user {
  font-size: 12px; font-weight: 700; color: var(--gold-soft);
  max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* =========================================================
   5. TYPOGRAPHY / PAGE HEADS
   ========================================================= */
.page-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; min-width: 0;
}
.page-title {
  font-size: 20px; font-weight: 800; color: var(--white);
  flex: 1; min-width: 0;
}
.page-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.page-count {
  font-size: 12px; font-weight: 700; color: var(--gold);
  background: rgba(200,168,75,0.12);
  padding: 3px 9px; border-radius: 999px; flex-shrink: 0;
}
.back-link {
  font-size: 20px; color: var(--gold); flex-shrink: 0;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
}

.section { margin-bottom: 22px; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 10px;
}
.section-title { font-size: 15px; font-weight: 800; color: var(--white); }
.section-link { font-size: 12px; font-weight: 700; color: var(--gold); flex-shrink: 0; }
.result-count { font-size: 11px; color: var(--muted); margin-bottom: 10px; }

/* =========================================================
   6. BUTTONS
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  font-size: 14px; font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  text-align: center;
  transition: var(--transition);
  min-height: 44px;              /* comfortable touch target */
  white-space: nowrap;
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: #1a1400;
}
.btn-gold:hover { filter: brightness(1.08); }
.btn-primary { background: var(--orange); color: #fff; }
.btn-ghost {
  background: rgba(255,255,255,0.04);
  border-color: var(--border-strong);
  color: var(--white);
}
.btn-ghost:hover { background: rgba(200,168,75,0.12); }
.btn-danger {
  background: rgba(229,115,115,0.14);
  border-color: rgba(229,115,115,0.45);
  color: var(--red);
}
.btn-danger:hover { background: rgba(229,115,115,0.24); }
.btn-full { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 12px; min-height: 36px; }
.btn:disabled, .btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.flex-1 { flex: 1; min-width: 0; }

/* =========================================================
   7. CARDS & FORMS
   ========================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  margin-bottom: 16px;
}
.card-title { font-size: 15px; font-weight: 800; margin-bottom: 12px; }
.card-text { font-size: 13px; color: var(--white-dim); line-height: 1.6; }

.form-label {
  display: block;
  font-size: 12px; font-weight: 600; color: var(--white-dim);
  margin-bottom: 6px;
}
.optional { color: var(--muted); font-weight: 400; }

.form-input {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 12px 13px;
  margin-bottom: 14px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 15px;             /* >=16px avoids iOS zoom; 15 is a good compromise */
  outline: none;
  min-height: 44px;
  transition: var(--transition);
}
.form-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200,168,75,0.14); }
.form-input-lg { font-size: 22px; font-weight: 800; text-align: center; }
.form-input::placeholder { color: var(--muted); }
.form-hint { font-size: 11px; color: var(--muted); margin-top: 8px; text-align: center; }

select.form-input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%),
                    linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 16px) center, calc(100% - 11px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 359px) { .field-pair { grid-template-columns: 1fr; } }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  padding: 8px 13px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px; font-weight: 700; color: var(--gold-soft);
  min-height: 36px;
}
.chip:hover { background: rgba(200,168,75,0.15); }
.chip:disabled { opacity: 0.4; cursor: not-allowed; }

.option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
@media (max-width: 359px) { .option-grid { grid-template-columns: 1fr; } }
.option-card {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.option-card:has(input:checked) { border-color: var(--gold); background: rgba(200,168,75,0.08); }
.option-card input { accent-color: var(--gold); margin-bottom: 4px; }
.option-title { font-size: 13px; font-weight: 700; color: var(--white); }
.option-sub { font-size: 10px; color: var(--muted); }

/* =========================================================
   8. ALERTS / BADGES / NOTICES
   ========================================================= */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
  border: 1px solid transparent;
  overflow-wrap: anywhere;
}
.alert-success { background: rgba(102,187,106,0.12); border-color: rgba(102,187,106,0.4); color: var(--green); }
.alert-danger  { background: rgba(229,115,115,0.12); border-color: rgba(229,115,115,0.4); color: var(--red); }
.alert-warn    { background: rgba(240,112,32,0.12);  border-color: rgba(240,112,32,0.4);  color: var(--orange-soft); }
.alert-info    { background: rgba(200,168,75,0.10);  border-color: var(--border-strong);  color: var(--gold-soft); }

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.4px;
  white-space: nowrap;
}
.badge-success { background: rgba(102,187,106,0.16); color: var(--green); }
.badge-danger  { background: rgba(229,115,115,0.16); color: var(--red); }
.badge-warn    { background: rgba(200,168,75,0.18);  color: var(--gold); }
.badge-gold    { background: rgba(200,168,75,0.18);  color: var(--gold); }
.badge-muted   { background: rgba(255,255,255,0.08); color: var(--white-dim); }

.notice-banner {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: rgba(200,168,75,0.07);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.notice-icon { font-size: 16px; flex-shrink: 0; }
.notice-banner strong { display: block; font-size: 12px; font-weight: 800; color: var(--gold-soft); }
.notice-banner span { display: block; font-size: 11px; color: var(--white-dim); line-height: 1.5; }

/* =========================================================
   9. HERO / BALANCE
   ========================================================= */
.hero {
  background: linear-gradient(135deg, rgba(200,168,75,0.16), rgba(240,112,32,0.07));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  margin-bottom: 18px;
  text-align: center;
}
.hero-eyebrow {
  font-size: 10px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1.5px;
}
.hero-title { font-size: 22px; font-weight: 900; color: var(--white); margin-top: 4px; overflow-wrap: anywhere; }
.hero-sub { font-size: 12px; color: var(--white-dim); margin-top: 6px; }
.hero-balance {
  font-size: 32px; font-weight: 900; color: var(--gold);
  margin: 8px 0 4px; overflow-wrap: anywhere;
}
.hero-actions { display: flex; gap: 10px; margin-top: 14px; }

.balance-card {
  background: linear-gradient(135deg, rgba(200,168,75,0.18), rgba(240,112,32,0.08));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  margin-bottom: 16px;
  text-align: center;
}
.balance-card-label {
  font-size: 10px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1.4px;
}
.balance-card-amount {
  font-size: 34px; font-weight: 900; color: var(--gold);
  margin: 6px 0 2px; overflow-wrap: anywhere;
}
.balance-card-actions { display: flex; gap: 10px; margin-top: 16px; }

.balance-strip {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px; color: var(--muted);
}
.balance-strip strong { font-size: 16px; font-weight: 800; color: var(--gold); overflow-wrap: anywhere; }

/* =========================================================
   10. STAT TILES / METRIC GRID
   ========================================================= */
.stat-row { display: flex; gap: 10px; margin-bottom: 18px; }
.stat-tile {
  flex: 1; min-width: 0;
  padding: 14px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.stat-value {
  font-size: 16px; font-weight: 800; color: var(--white);
  overflow-wrap: anywhere;
}
.stat-label {
  font-size: 10px; color: var(--muted); margin-top: 2px;
  text-transform: uppercase; letter-spacing: 0.5px;
}

/* Metric cards: 2-up on phones, never wider than the shell. */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
@media (max-width: 339px) { .metric-grid { grid-template-columns: minmax(0, 1fr); } }

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  min-width: 0;
}
.metric-label {
  font-size: 10px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.metric-value {
  font-size: 19px; font-weight: 800; color: var(--white);
  margin-top: 5px;
  overflow-wrap: anywhere;
}
.metric-value.gold   { color: var(--gold); }
.metric-value.credit { color: var(--green); }
.metric-value.debit  { color: var(--orange-soft); }
.metric-value.warn   { color: var(--orange); }
.metric-sub { font-size: 10px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }

/* =========================================================
   11. DATA LISTS — cards instead of tables
   -----------------------------------------------------------
   Tabular data is rendered as stacked cards at every width, so no
   admin or history screen can force horizontal page scrolling.
   ========================================================= */
.data-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }

.data-card {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 0;
}
.data-card-block { flex-direction: column; gap: 10px; }
.data-card-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; width: 100%; min-width: 0;
}
.data-card-main { flex: 1; min-width: 0; }
.data-card-title {
  font-size: 13px; font-weight: 700; color: var(--white);
  overflow-wrap: anywhere;
}
.data-card-meta {
  font-size: 11px; color: var(--muted); margin-top: 2px;
  overflow-wrap: anywhere;
}
.data-card-meta.ref { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 10px; }
.data-card-meta.warn { color: var(--orange-soft); }
.data-card-side {
  display: flex; flex-direction: column; align-items: flex-end; gap: 5px;
  flex-shrink: 0; max-width: 45%;
}
.amount { font-size: 14px; font-weight: 800; color: var(--white); text-align: right; overflow-wrap: anywhere; }
.amount-credit { color: var(--green); }
.amount-debit  { color: var(--orange-soft); }

/* Key/value detail blocks */
.payee-details, .detail-list {
  display: flex; flex-direction: column; gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  width: 100%;
}
.payee-details > div, .detail-list > div {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 11px;
  min-width: 0;
}
.payee-details dt, .detail-list dt { color: var(--muted); flex-shrink: 0; }
.payee-details dd, .detail-list dd {
  color: var(--white); text-align: right; min-width: 0;
  overflow-wrap: anywhere;
}
.detail-list { border-top: none; padding-top: 0; }
.detail-list > div { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.detail-list > div:last-child { border-bottom: none; }

.admin-row-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding-top: 10px; border-top: 1px solid var(--border);
  width: 100%;
}
.inline-form { display: inline-flex; }
.adjust-form { width: 100%; padding-top: 10px; border-top: 1px solid var(--border); }
.decision-form { width: 100%; padding-top: 10px; border-top: 1px solid var(--border); }
.decision-actions { display: flex; gap: 10px; }
.processed-note {
  font-size: 11px; color: var(--muted); font-style: italic;
  padding-top: 8px; border-top: 1px solid var(--border); width: 100%;
}

/* =========================================================
   12. FILTER BARS
   ========================================================= */
.filter-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.filter-bar .form-input { margin-bottom: 0; }

/* Filters stack on phones and wrap to a grid on wider shells. */
.filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 12px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.filter-grid .form-input { margin-bottom: 0; }
@media (min-width: 400px) {
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* =========================================================
   13. PAGINATION
   ========================================================= */
.pagination {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
  margin: 16px 0;
}
.page-btn {
  min-width: 38px; min-height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700; color: var(--white-dim);
  transition: var(--transition);
}
.page-btn:hover { border-color: var(--gold); color: var(--gold); }
.page-btn.active {
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  border-color: var(--gold);
  color: #1a1400;
}
.page-btn.disabled { opacity: 0.35; pointer-events: none; }

/* =========================================================
   14. EMPTY STATES
   ========================================================= */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 40px 20px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}
.empty-state-icon { font-size: 38px; margin-bottom: 10px; opacity: 0.75; }
.empty-state-title { font-size: 14px; font-weight: 700; color: var(--white); }
.empty-state-sub {
  font-size: 12px; color: var(--muted); margin-top: 5px;
  max-width: 260px; line-height: 1.55;
}

/* =========================================================
   15. GAMES (player experience only)
   ========================================================= */
.category-nav { margin: 0 -14px 16px; }
.category-list {
  display: flex; gap: 8px;
  padding: 0 14px 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.category-list::-webkit-scrollbar { display: none; }
.category-item {
  display: inline-flex; align-items: center; gap: 5px;
  flex-shrink: 0;
  padding: 8px 13px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--white-dim);
  white-space: nowrap;
  min-height: 36px;
}
.category-item.active {
  background: rgba(200,168,75,0.16);
  border-color: var(--border-strong);
  color: var(--gold);
}
.cat-icon { font-size: 13px; }

.game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
@media (min-width: 400px) { .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
  transition: var(--transition);
}
.game-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.game-card-image { position: relative; display: block; aspect-ratio: 3 / 2; background: var(--bg); }
.game-card-image img { width: 100%; height: 100%; object-fit: cover; }
.game-card-fallback {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; font-size: 30px;
}
.badge-hot, .badge-new {
  position: absolute; top: 6px; left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9px; font-weight: 800; letter-spacing: 0.4px;
}
.badge-hot { background: var(--orange); color: #fff; }
.badge-new { background: var(--gold); color: #1a1400; }

.game-card-body { padding: 9px 10px 11px; }
.game-card-title {
  font-size: 12px; font-weight: 700; color: var(--white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.game-card-category { font-size: 10px; color: var(--muted); margin-top: 1px; }
.game-card-play {
  display: block; margin-top: 8px; padding: 6px;
  background: rgba(200,168,75,0.14);
  border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 700; color: var(--gold-soft);
  text-align: center;
}

.game-stage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
  text-align: center;
}
.game-stage-art { width: 100%; max-width: 320px; margin: 0 auto 10px; border-radius: var(--radius); }
.game-stage-cat {
  font-size: 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1.4px;
}

/* =========================================================
   16. BOTTOM NAV (player only)
   ========================================================= */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--shell-max);
  height: var(--nav-h);
  display: flex;
  align-items: stretch;
  background: rgba(10,10,10,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-strong);
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
  font-size: 10px; font-weight: 600; color: var(--muted);
  transition: var(--transition);
}
.nav-item.active { color: var(--gold); }
.nav-icon { font-size: 18px; line-height: 1; }
.nav-label { white-space: nowrap; }

/* =========================================================
   17. ADMIN SHELL
   -----------------------------------------------------------
   Admin reuses the same centered mobile-width shell as the player
   app. It has its own navigation and contains no game content.
   ========================================================= */
.admin-body { background: var(--bg-deep); }
.admin-shell { background: var(--bg-2); }
.admin-header { border-bottom-color: var(--border-strong); }

.admin-nav { margin: 0 -14px 16px; border-bottom: 1px solid var(--border); }
.admin-nav-scroll {
  display: flex; gap: 6px;
  padding: 0 14px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.admin-nav-scroll::-webkit-scrollbar { display: none; }
.admin-nav-item {
  position: relative;
  display: inline-flex; align-items: center; gap: 5px;
  flex-shrink: 0;
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--white-dim);
  white-space: nowrap;
  min-height: 36px;
}
.admin-nav-item.active {
  background: rgba(240,112,32,0.14);
  border-color: rgba(240,112,32,0.4);
  color: var(--orange-soft);
}
.admin-nav-icon { font-size: 13px; }
.admin-nav-badge {
  display: inline-block;
  min-width: 17px; padding: 1px 5px;
  background: var(--orange); color: #fff;
  border-radius: 999px;
  font-size: 9px; font-weight: 800; text-align: center;
}

/* =========================================================
   18. AUTH & PROFILE
   ========================================================= */
.auth-page { display: flex; flex-direction: column; justify-content: center; min-height: 100vh; }
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 7px; margin-bottom: 14px; }
.auth-logo .brand-mark { font-size: 26px; }
.auth-logo .brand-text { font-size: 15px; }
.auth-title { font-size: 21px; font-weight: 800; color: var(--white); }
.auth-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.auth-alt { text-align: center; font-size: 13px; color: var(--muted); margin-top: 6px; }
.auth-alt a { color: var(--gold); font-weight: 700; }

.profile-head { text-align: center; margin-bottom: 18px; }
.avatar {
  width: 70px; height: 70px; margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  border-radius: 50%;
  font-size: 30px; font-weight: 900; color: #1a1400;
}
.profile-name { font-size: 19px; font-weight: 800; overflow-wrap: anywhere; }
.profile-badges { display: flex; justify-content: center; gap: 7px; margin-top: 7px; flex-wrap: wrap; }

/* =========================================================
   19. INSTALL / ERROR PAGES
   ========================================================= */
.install-row {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.install-row:last-child { border-bottom: none; }
.install-row.ok span:first-child { color: var(--green); }
.install-row.fail { color: var(--red); }
.install-row.fail span:first-child { color: var(--red); }

.error-page {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  min-height: 100vh;
}
.error-code { font-size: 60px; font-weight: 900; color: var(--gold-dim); line-height: 1; }
.error-title { font-size: 19px; font-weight: 800; color: var(--orange); margin: 10px 0 8px; }
.error-message { font-size: 13px; color: var(--white-dim); max-width: 300px; margin-bottom: 22px; }
.error-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 280px; }

/* =========================================================
   19b. PAYMENT CHECKOUT
   ========================================================= */
.checkout-card {
  border-color: var(--border-strong);
  text-align: center;
}
.checkout-amount {
  font-size: 30px; font-weight: 900; color: var(--gold);
  margin: 4px 0 8px;
  overflow-wrap: anywhere;
}
.checkout-qr {
  width: 220px; max-width: 100%; height: auto;
  margin: 14px auto;
  background: #fff;
  padding: 10px;
  border-radius: var(--radius-sm);
}

/* Numbered remediation steps inside a card */
.how-to-list {
  list-style: decimal;
  padding-left: 20px;
  margin-top: 8px;
}
.how-to-list li {
  margin-bottom: 10px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

/* =========================================================
   20. FOOTER
   ========================================================= */
.site-footer {
  padding: 20px 14px 10px;
  margin-top: 12px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer-notice { font-size: 11px; color: var(--muted); line-height: 1.7; }
.footer-notice strong { color: var(--white-dim); }
.footer-link { font-size: 11px; margin-top: 10px; }
.footer-link a { color: var(--muted); text-decoration: underline; }
.footer-copy { font-size: 10px; color: var(--muted); margin-top: 8px; }
.admin-footer { margin-top: 20px; }

/* =========================================================
   21. NARROW-VIEWPORT REFINEMENTS
   -----------------------------------------------------------
   Verified at 320 / 360 / 375 / 390 / 414 / 430 / 480 and up.
   ========================================================= */
@media (max-width: 360px) {
  .page-content { padding-left: 11px; padding-right: 11px; }
  .page-title { font-size: 18px; }
  .hero-balance { font-size: 27px; }
  .balance-card-amount { font-size: 28px; }
  .metric-value { font-size: 16px; }
  .stat-value { font-size: 14px; }
  .data-card { padding: 11px 12px; }
  .data-card-side { max-width: 48%; }
  .btn { padding: 11px 13px; font-size: 13px; }
  .category-nav, .admin-nav { margin-left: -11px; margin-right: -11px; }
  .category-list, .admin-nav-scroll { padding-left: 11px; padding-right: 11px; }
}

@media (max-width: 320px) {
  .hero-title { font-size: 19px; }
  .hero-balance { font-size: 24px; }
  .balance-card-amount { font-size: 25px; }
  .game-grid { gap: 8px; }
  .hero-actions, .balance-card-actions, .decision-actions { flex-direction: column; }
  .stat-row { flex-wrap: wrap; }
  .stat-tile { min-width: calc(50% - 5px); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
