/* ============================================================
   DalaoBet — dark + gold theme
   ============================================================ */
:root {
  --bg: #0d0b07;
  --bg-card: #17130c;
  --bg-elevated: #1f1a10;
  --border: #2e2718;
  --gold: #f0b90b;
  --gold-bright: #ffd75e;
  --gold-dim: #a8820a;
  --text: #f5efe0;
  --text-muted: #9a8f78;
  --danger: #ff5c5c;
  --success: #4ade80;
  --radius: 14px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Ethiopic", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: baseline; gap: 2px; font-weight: 800; letter-spacing: -0.5px; text-decoration: none; }
.logo .d1 { color: var(--text); font-size: 24px; }
.logo .d2 { color: var(--gold); font-size: 24px; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 8px; margin-right: 8px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  display: inline-flex; align-items: center; justify-content: center;
  color: #0d0b07; font-weight: 900; font-size: 18px;
  box-shadow: 0 0 18px rgba(240, 185, 11, 0.35);
}

/* ---------- auth pages ---------- */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(1200px 500px at 50% -10%, rgba(240,185,11,0.08), transparent); }
.auth-card { width: 100%; max-width: 400px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.auth-card h1 { font-size: 20px; margin: 18px 0 6px; }
.auth-card p.sub { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.field input {
  width: 100%; padding: 13px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text); font-size: 15px; outline: none;
}
.field input:focus { border-color: var(--gold-dim); box-shadow: 0 0 0 3px rgba(240,185,11,0.12); }
.btn {
  width: 100%; padding: 14px; border: none; border-radius: 10px; cursor: pointer;
  font-size: 15px; font-weight: 800;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  color: #14100a;
}
.btn:active { transform: scale(0.99); }
.btn.secondary { background: var(--bg-elevated); color: var(--text); border: 1px solid var(--border); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.auth-links { display: flex; justify-content: space-between; margin-top: 16px; font-size: 13px; }
.auth-links a { color: var(--gold); text-decoration: none; font-weight: 600; }
.err { color: var(--danger); font-size: 13px; margin: 10px 0 0; min-height: 18px; }
.ok { color: var(--success); font-size: 13px; margin: 10px 0 0; }

/* ---------- app shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: rgba(13,11,7,0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.wallet-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 12px; padding: 8px 6px 8px 14px;
}
.wallet-chip .amt { font-weight: 800; font-size: 15px; }
.wallet-chip .dep {
  background: var(--gold); color: #14100a; border: none; border-radius: 9px;
  width: 32px; height: 32px; font-size: 20px; font-weight: 800; cursor: pointer;
}
.section-title { padding: 18px 16px 10px; font-size: 15px; font-weight: 800; color: var(--gold-bright); text-transform: uppercase; letter-spacing: 1px; }

/* ---------- game grids ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 16px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(6, 1fr); } }
.tile {
  position: relative; border-radius: 12px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg-card);
  aspect-ratio: 3/4; display: flex; flex-direction: column; justify-content: flex-end;
  transition: transform 0.12s, border-color 0.12s;
}
.tile:hover { transform: translateY(-2px); border-color: var(--gold-dim); }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile .name {
  position: relative; padding: 8px; font-size: 12px; font-weight: 700; text-align: center;
  background: linear-gradient(transparent, rgba(0,0,0,0.85) 40%);
}
.tile.own { background: linear-gradient(160deg, #241d0e 0%, #17130c 100%); align-items: center; justify-content: center; }
.tile.own .big { font-size: 34px; margin-bottom: 6px; }
.tile.own .name { background: none; }

/* ---------- game overlay ---------- */
.game-overlay { position: fixed; inset: 0; z-index: 100; background: #0d0b07; display: flex; flex-direction: column; }
.game-overlay .bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.game-overlay .close-btn { background: rgba(255,255,255,0.08); color: var(--text); border: none; border-radius: 9px; padding: 8px 16px; font-weight: 700; cursor: pointer; }
.game-overlay iframe { flex: 1; width: 100%; border: none; background: #0d0b07; }
.hidden { display: none !important; }

/* ---------- bottom nav ---------- */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  display: flex; justify-content: space-around; padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  background: rgba(13,11,7,0.95); backdrop-filter: blur(10px); border-top: 1px solid var(--border);
}
.bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--text-muted); text-decoration: none; font-size: 11px; font-weight: 600; }
.bottomnav a.active { color: var(--gold); }
.bottomnav .ico { font-size: 20px; }
.page-pad { padding-bottom: 76px; }

/* ---------- modals ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,0.75); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; }

.modal-card { width: calc(100% - 32px); max-width: 360px; margin: 0 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; max-height: 82vh; overflow-y: auto; }

.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; font-size: 18px; font-weight: 800; }
.modal-x { background: none; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; }
.m-note { color: var(--text-muted); font-size: 13px; }
.pay-to { display: flex; align-items: center; gap: 10px; margin-top: 8px; background: var(--bg-elevated); border: 1px solid var(--gold-dim); border-radius: 10px; padding: 12px 14px; }
.pay-to span { font-size: 20px; font-weight: 800; color: var(--gold-bright); letter-spacing: 1px; flex: 1; }
.copy-btn { background: var(--gold); color: #14100a; border: none; border-radius: 8px; padding: 7px 14px; font-weight: 700; cursor: pointer; }
.modal-card textarea { width: 100%; margin-top: 8px; margin-bottom: 12px; padding: 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text); font-size: 14px; resize: vertical; font-family: inherit; }
.acct-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.acct-row span { color: var(--text-muted); }
