:root {
  --bg: #070b14;
  --card: #0f1628;
  --text: #e8eef8;
  --sub: #8fa3bf;
  --cyan: #22d3ee;
  --violet: #a78bfa;
  --gold: #fbbf24;
  --red: #f87171;
  --border: rgba(148, 163, 184, 0.18);
  --font: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
#root { min-height: 100%; }

.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(34, 211, 238, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(167, 139, 250, 0.1), transparent),
    var(--bg);
}

.card {
  width: min(720px, 100%);
  background: linear-gradient(180deg, rgba(15, 22, 40, 0.98), rgba(8, 12, 22, 0.98));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.brand {
  text-align: center;
  margin-bottom: 28px;
}
.brand-kicker {
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--cyan);
  font-weight: 700;
}
.brand-title {
  margin: 10px 0 6px;
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-sub {
  color: var(--sub);
  font-size: 15px;
  line-height: 1.5;
}

.btn-row { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.btn {
  border: none;
  border-radius: 14px;
  padding: 16px 20px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.12s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  color: #041018;
  background: linear-gradient(135deg, var(--cyan), #38bdf8);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.25);
}
.btn-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}
.btn-ghost {
  color: var(--sub);
  background: transparent;
  border: 1px dashed var(--border);
}

.field-label { font-size: 13px; color: var(--sub); margin-bottom: 8px; font-weight: 600; }
.field-display {
  font-size: 28px;
  letter-spacing: 0.12em;
  font-weight: 800;
  min-height: 42px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.field-display.empty { color: #4b5563; font-size: 16px; letter-spacing: normal; font-weight: 600; }

.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 360px;
  margin: 0 auto;
}
.numpad button {
  aspect-ratio: 1.4;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
}
.numpad .wide { grid-column: span 3; aspect-ratio: auto; padding: 14px; font-size: 16px; }

.msg { margin-top: 14px; font-size: 14px; line-height: 1.5; }
.msg.error { color: var(--red); }
.msg.ok { color: var(--cyan); }
.msg.sub { color: var(--sub); }

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: rgba(7, 11, 20, 0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  z-index: 10;
}
.topbar-title { font-size: 13px; font-weight: 800; color: var(--cyan); letter-spacing: 0.16em; text-transform: uppercase; }
.topbar-meta { font-size: 12px; color: var(--sub); text-align: right; }

.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--border); margin-top: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--sub); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
tr:last-child td { border-bottom: none; }
.pick-btn {
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  background: rgba(34, 211, 238, 0.15);
  color: var(--cyan);
  font-weight: 700;
  cursor: pointer;
}

.hub-grid {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}
.hub-tile {
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 18px;
  background: rgba(255,255,255,0.03);
}
.hub-tile h3 { margin: 0 0 8px; color: var(--violet); font-size: 16px; }
.hub-tile p { margin: 0; color: var(--sub); font-size: 14px; line-height: 1.5; }

.splash-steps {
  display: grid;
  gap: 14px;
  margin: 24px 0;
}
.splash-step {
  border-radius: 16px;
  border: 1px solid rgba(34, 211, 238, 0.25);
  padding: 18px;
  text-align: left;
  background: rgba(34, 211, 238, 0.06);
}
.splash-step strong { display: block; font-size: 18px; margin-bottom: 6px; }
.splash-step span { color: var(--sub); font-size: 14px; line-height: 1.45; }

.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.overlay-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  max-width: 320px;
}

.hub-wide { width: min(960px, 100%); }

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.game-card {
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s;
  text-align: center;
}
.game-card:hover {
  border-color: rgba(34, 211, 238, 0.5);
  transform: translateY(-2px);
}
.game-card h4 { margin: 0 0 6px; color: var(--cyan); font-size: 15px; }
.game-card p { margin: 0; color: var(--sub); font-size: 12px; }

.game-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: #000;
}
.game-overlay-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(7, 11, 20, 0.95);
  border-bottom: 1px solid var(--border);
}
.game-overlay-title { font-size: 14px; font-weight: 700; color: var(--cyan); }
.game-overlay-close {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
}
.game-overlay-frame { flex: 1; border: none; width: 100%; }

.hub-policy {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(167, 139, 250, 0.25);
  background: rgba(167, 139, 250, 0.06);
  font-size: 13px;
  color: var(--sub);
  line-height: 1.5;
}
.hub-policy strong { color: var(--violet); }

.wallet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.wallet-row .btn { padding: 10px 14px; font-size: 13px; margin: 0; }

.topbar-back {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
  margin-right: 12px;
}

.add-money-screen { justify-content: flex-start; padding-top: 12px; }
.add-money-card { width: min(560px, 100%); }
.add-money-body { margin-top: 8px; }
.add-money-balance {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(34, 211, 238, 0.25);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.08), rgba(167, 139, 250, 0.05));
}
.add-money-balance-label { font-size: 14px; color: var(--sub); }
.add-money-balance-val { font-size: 1.6rem; font-weight: 800; color: #4ade80; }

.btn.add-money-mega {
  width: 100%;
  padding: 28px 22px;
  min-height: 96px;
  border-radius: 24px;
  border: 3px solid rgba(251, 191, 36, 0.75);
  font-size: clamp(19px, 5vw, 26px);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #031008;
  background: linear-gradient(165deg, #fffde7 0%, #b9f6ca 18%, #00e676 42%, #00c853 72%, #008a3e 100%);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.add-money-insert-banner {
  text-align: center;
  font-size: clamp(2.2rem, 8vw, 3.4rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c8ffd5;
  margin: 8px 0 16px;
  animation: amPulse 1.6s ease-in-out infinite;
}
.add-money-timer-label {
  text-align: center;
  font-size: 14px;
  color: var(--sub);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.add-money-timer {
  text-align: center;
  font-size: clamp(4rem, 18vw, 7rem);
  font-weight: 900;
  line-height: 1;
  color: var(--cyan);
  margin: 8px 0 4px;
}

.add-money-toast-layer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.add-money-toast {
  min-width: 220px;
  max-width: 92vw;
  padding: 14px 18px;
  border-radius: 16px;
  border: 2px solid rgba(251, 191, 36, 0.55);
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.92), rgba(34, 211, 238, 0.82));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.34);
  text-align: center;
  color: #04150c;
}
.add-money-toast-amt { font-weight: 900; font-size: 1.5rem; line-height: 1; margin-bottom: 6px; }
.add-money-toast-sub { font-size: 13px; font-weight: 700; }

@keyframes amPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.88; transform: scale(1.02); }
}

@media (min-width: 900px) {
  .splash-steps { grid-template-columns: repeat(3, 1fr); }
  .hub-grid { grid-template-columns: repeat(2, 1fr); }
}
