/* =====================================================================
   CYBER HACKER SIMULATOR — style.css
   A fictional, puzzle-based cyber challenge game (no real hacking).
   Dark cyberpunk theme · neon green/blue · terminal aesthetic.
   Mobile-first, optimized for Telegram Mini App WebView.
   ===================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Palette */
  --bg-0:        #04080b;   /* deepest background            */
  --bg-1:        #060d13;   /* app background                */
  --panel:       #0a1620;   /* card / panel surface          */
  --panel-2:     #0d1e2b;   /* raised surface                */
  --line:        #143244;   /* hairline borders              */

  --neon:        #00ffa3;   /* primary neon green            */
  --neon-dim:    #0bbf7d;   /* dimmer green                  */
  --cyan:        #26d7ff;   /* secondary neon blue           */
  --amber:       #ffb733;   /* energy / warning              */
  --danger:      #ff466e;   /* failure / danger              */
  --purple:      #b06bff;   /* rare / mystery                */

  --text:        #d6fff0;   /* primary text                  */
  --text-dim:    #6f9a8f;   /* muted text                    */
  --text-faint:  #3f5f57;   /* very muted                    */

  /* Effects */
  --glow-neon:  0 0 10px rgba(0,255,163,.55), 0 0 22px rgba(0,255,163,.25);
  --glow-cyan:  0 0 10px rgba(38,215,255,.55), 0 0 22px rgba(38,215,255,.25);
  --radius:     14px;
  --radius-sm:  10px;
  --shell-max:  480px;

  --font-display: 'Orbitron', system-ui, sans-serif;
  --font-mono:    'Share Tech Mono', ui-monospace, 'Courier New', monospace;
}

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
input { font: inherit; }
ul { list-style: none; }

body {
  font-family: var(--font-mono);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(0,255,163,.08), transparent 60%),
    radial-gradient(900px 500px at 100% 10%, rgba(38,215,255,.07), transparent 55%),
    var(--bg-1);
  min-height: 100%;
  overflow-x: hidden;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* Faint animated grid + scanlines behind everything */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(0,255,163,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,163,.045) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 80%);
  pointer-events: none;
  z-index: 0;
  animation: gridDrift 24s linear infinite;
}
body::after {
  content: "";
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    to bottom, rgba(0,0,0,0) 0, rgba(0,0,0,0) 2px, rgba(0,0,0,.18) 3px);
  pointer-events: none;
  z-index: 999;
  opacity: .35;
}
@keyframes gridDrift { to { background-position: 40px 40px, 40px 40px; } }

/* ---------- App shell ---------- */
.app {
  position: relative;
  z-index: 1;
  max-width: var(--shell-max);
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: 78px; /* room for bottom nav */
}

/* ---------- Top status bar ---------- */
.topbar {
  position: sticky; top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(6,13,19,.96), rgba(6,13,19,.78));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex; align-items: center; gap: 8px;
  margin-right: auto;
  min-width: 0;
}
.brand-logo {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 1px solid var(--neon);
  border-radius: 8px;
  color: var(--neon);
  box-shadow: var(--glow-neon);
  font-size: 15px;
  flex: none;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.brand-name span { color: var(--neon); }

.stat-pill {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: 12px;
  white-space: nowrap;
}
.stat-pill b { color: var(--text); font-weight: 400; }
.stat-pill .ico { font-size: 13px; }
.stat-pill.coins  { color: var(--amber); box-shadow: inset 0 0 12px rgba(255,183,51,.12); }
.stat-pill.energy { color: var(--cyan);  box-shadow: inset 0 0 12px rgba(38,215,255,.12); }
.stat-pill.level  { color: var(--neon);  box-shadow: inset 0 0 12px rgba(0,255,163,.12); }

/* ---------- Screens ---------- */
.screen { display: none; padding: 16px 14px 10px; flex: 1; animation: fadeIn .3s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1.5px;
  color: var(--text);
  text-transform: uppercase;
  margin: 4px 0 12px;
  display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: "▸"; color: var(--neon); text-shadow: var(--glow-neon);
}
.section-sub { color: var(--text-dim); font-size: 12px; margin: -6px 0 14px; }

/* ---------- Panels / cards ---------- */
.panel {
  position: relative;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  overflow: hidden;
}
.panel::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(0,255,163,.5), transparent 40%, rgba(38,215,255,.4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
  opacity: .5;
}

/* ---------- Terminal hero (home) ---------- */
.terminal {
  background: #030a0d;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 12.5px;
  box-shadow: inset 0 0 40px rgba(0,255,163,.05);
  margin-bottom: 14px;
}
.terminal .bar {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 8px; color: var(--text-dim); font-size: 11px;
}
.terminal .dot { width: 9px; height: 9px; border-radius: 50%; }
.terminal .dot.r { background: #ff5f57; } .terminal .dot.y { background: #febc2e; } .terminal .dot.g { background: #28c840; }
.terminal .path { margin-left: auto; letter-spacing: 1px; }
.term-line { white-space: pre-wrap; color: var(--neon-dim); min-height: 18px; }
.term-line .u { color: var(--cyan); }
.term-line .ok { color: var(--neon); }
.caret { display: inline-block; width: 8px; height: 15px; background: var(--neon);
  margin-left: 2px; vertical-align: -2px; animation: blink 1s steps(1) infinite; box-shadow: var(--glow-neon); }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Quick tiles (home) ---------- */
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.quick {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px;
  display: flex; flex-direction: column; gap: 4px;
  transition: transform .12s ease, box-shadow .2s ease, border-color .2s ease;
}
.quick:active { transform: scale(.97); }
.quick .qi { font-size: 20px; }
.quick .qt { font-family: var(--font-display); font-size: 12px; letter-spacing: .5px; }
.quick .qd { font-size: 11px; color: var(--text-dim); }
.quick.hl { border-color: var(--neon); box-shadow: var(--glow-neon); }
.quick.hl .qt { color: var(--neon); }
.quick .badge-new {
  align-self: flex-start; font-size: 9px; letter-spacing: 1px;
  color: var(--bg-0); background: var(--neon); padding: 1px 6px; border-radius: 6px; margin-top: 2px;
}

/* Progress bars */
.bar-wrap { margin-top: 10px; }
.bar-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-dim); margin-bottom: 5px; }
.bar {
  height: 9px; border-radius: 999px;
  background: #06121a; border: 1px solid var(--line); overflow: hidden;
}
.bar > i {
  display: block; height: 100%; width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--neon-dim), var(--neon));
  box-shadow: 0 0 10px rgba(0,255,163,.6);
  transition: width .5s cubic-bezier(.2,.8,.2,1);
  position: relative;
}
.bar.cyan > i { background: linear-gradient(90deg, #14889f, var(--cyan)); box-shadow: 0 0 10px rgba(38,215,255,.6); }
.bar.amber > i { background: linear-gradient(90deg, #b57d13, var(--amber)); box-shadow: 0 0 10px rgba(255,183,51,.6); }
.bar > i::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  animation: shimmer 2.2s linear infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--neon);
  color: var(--neon);
  background: linear-gradient(180deg, rgba(0,255,163,.10), rgba(0,255,163,.02));
  font-family: var(--font-display);
  font-weight: 700; font-size: 12px; letter-spacing: 1.2px;
  text-transform: uppercase;
  box-shadow: var(--glow-neon);
  transition: transform .1s ease, box-shadow .2s ease, filter .2s ease;
  width: 100%;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:hover { filter: brightness(1.12); }
.btn.cyan { border-color: var(--cyan); color: var(--cyan); background: linear-gradient(180deg, rgba(38,215,255,.10), rgba(38,215,255,.02)); box-shadow: var(--glow-cyan); }
.btn.ghost { border-color: var(--line); color: var(--text-dim); background: var(--panel); box-shadow: none; }
.btn.ghost:hover { color: var(--text); border-color: var(--neon-dim); }
.btn.amber { border-color: var(--amber); color: var(--amber); background: linear-gradient(180deg, rgba(255,183,51,.10), rgba(255,183,51,.02)); box-shadow: 0 0 10px rgba(255,183,51,.4); }
.btn.sm { padding: 9px 12px; font-size: 11px; width: auto; }
.btn[disabled] { opacity: .4; filter: grayscale(.5); box-shadow: none; pointer-events: none; }
.btn .ad-tag { font-size: 8px; padding: 1px 5px; border: 1px solid currentColor; border-radius: 5px; letter-spacing: 1px; opacity: .85; }

/* ---------- Mission list ---------- */
.mission-list { display: grid; gap: 12px; }
.mission {
  display: flex; align-items: center; gap: 12px;
  padding: 13px;
  position: relative;
  overflow: hidden;
}
.mission .m-icon {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
  font-size: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #06131b;
}
.mission .m-main { min-width: 0; flex: 1; }
.mission .m-name { font-family: var(--font-display); font-size: 13px; letter-spacing: .4px; }
.mission .m-desc { font-size: 11px; color: var(--text-dim); margin: 2px 0 6px; }
.mission .m-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 10px; letter-spacing: .5px;
  padding: 2px 7px; border-radius: 6px;
  border: 1px solid var(--line); color: var(--text-dim);
}
.chip.g { color: var(--neon); border-color: rgba(0,255,163,.4); }
.chip.c { color: var(--cyan); border-color: rgba(38,215,255,.4); }
.chip.a { color: var(--amber); border-color: rgba(255,183,51,.4); }
.diff-dots { display: inline-flex; gap: 3px; }
.diff-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.diff-dots i.on { background: var(--neon); box-shadow: 0 0 6px var(--neon); }
.mission .m-go { flex: none; }
.mission.locked { opacity: .6; }
.cooldown-overlay {
  position: absolute; inset: 0;
  background: rgba(3,8,11,.82);
  display: none; align-items: center; justify-content: center; flex-direction: column;
  gap: 4px; backdrop-filter: blur(2px);
  font-size: 12px; color: var(--cyan);
}
.mission.cooling .cooldown-overlay { display: flex; }
.cooldown-overlay small { color: var(--text-dim); font-size: 10px; }

/* ---------- Puzzle screen ---------- */
.puzzle-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.puzzle-head .p-icon { font-size: 26px; }
.puzzle-head .p-title { font-family: var(--font-display); font-size: 14px; letter-spacing: .5px; }
.puzzle-head .p-type { font-size: 11px; color: var(--text-dim); }
.attempts { margin-left: auto; display: flex; gap: 4px; }
.attempts i { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 6px var(--danger); }
.attempts i.lost { background: #221; box-shadow: none; }

.puzzle-status {
  text-align: center; font-size: 13px; color: var(--cyan);
  min-height: 20px; margin: 6px 0 14px; letter-spacing: .5px;
}
.puzzle-stage { min-height: 240px; display: grid; place-items: center; }

/* Symbol / tile grids shared */
.grid-6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; }
.grid-9 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; max-width: 320px; }
.cell {
  aspect-ratio: 1;
  display: grid; place-items: center;
  font-size: 30px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #0a1a24, #071219);
  color: var(--text-dim);
  transition: transform .1s ease, box-shadow .18s ease, border-color .18s ease, color .18s ease, background .18s ease;
  user-select: none;
}
.cell:active { transform: scale(.94); }
.cell.flash {
  color: var(--neon); border-color: var(--neon);
  background: radial-gradient(circle, rgba(0,255,163,.35), #071219);
  box-shadow: var(--glow-neon); transform: scale(1.04);
}
.cell.flash.cyan {
  color: var(--cyan); border-color: var(--cyan);
  background: radial-gradient(circle, rgba(38,215,255,.35), #071219);
  box-shadow: var(--glow-cyan);
}
.cell.picked { border-color: var(--cyan); color: var(--cyan); box-shadow: var(--glow-cyan); }
.cell.good { border-color: var(--neon); color: var(--neon); box-shadow: var(--glow-neon); }
.cell.bad  { border-color: var(--danger); color: var(--danger); box-shadow: 0 0 10px var(--danger); animation: shake .3s; }
@keyframes shake { 25%{transform:translateX(-5px);} 75%{transform:translateX(5px);} }

/* Code cracking */
.code-slots { display: flex; gap: 10px; justify-content: center; margin-bottom: 4px; }
.slot {
  width: 52px; height: 60px;
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 28px; font-weight: 700;
  border: 1px solid var(--line); border-radius: 12px;
  background: #06131b; color: var(--neon);
  box-shadow: inset 0 0 18px rgba(0,255,163,.08);
}
.slot.active { border-color: var(--neon); box-shadow: var(--glow-neon); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 300px; margin: 4px auto 0; }
.key {
  padding: 15px 0; text-align: center;
  font-family: var(--font-display); font-size: 18px;
  border: 1px solid var(--line); border-radius: 12px;
  background: linear-gradient(180deg, #0a1a24, #071219); color: var(--text);
}
.key:active { transform: scale(.95); border-color: var(--neon); color: var(--neon); box-shadow: var(--glow-neon); }
.key.wide { grid-column: span 1; }
.key.fn { color: var(--cyan); }
.guess-log { width: 100%; max-width: 320px; margin: 12px auto 0; display: grid; gap: 6px; }
.guess-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: #06131b;
  font-size: 15px; letter-spacing: 4px;
}
.guess-row .res { margin-left: auto; letter-spacing: 0; font-size: 11px; display: flex; gap: 8px; }
.guess-row .res .ex { color: var(--neon); } .guess-row .res .pa { color: var(--amber); }

/* Logic firewall */
.logic-box { text-align: center; width: 100%; }
.logic-expr {
  font-family: var(--font-display); font-size: 20px; letter-spacing: 2px;
  padding: 22px 10px; margin-bottom: 18px;
  border: 1px solid var(--line); border-radius: 14px; background: #06131b;
  box-shadow: inset 0 0 30px rgba(38,215,255,.06);
}
.logic-expr .gate { color: var(--cyan); }
.logic-expr .q { color: var(--amber); }
.logic-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.logic-choices .btn { font-size: 20px; padding: 18px; }
.logic-progress { display: flex; gap: 6px; justify-content: center; margin-bottom: 14px; }
.logic-progress i { width: 22px; height: 6px; border-radius: 3px; background: var(--line); }
.logic-progress i.on { background: var(--neon); box-shadow: 0 0 6px var(--neon); }

/* Puzzle action row */
.puzzle-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.puzzle-actions .full { grid-column: 1 / -1; }

/* ---------- Inventory / rewards ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab {
  flex: 1; padding: 9px; text-align: center;
  font-family: var(--font-display); font-size: 11px; letter-spacing: 1px;
  border: 1px solid var(--line); border-radius: 10px; color: var(--text-dim);
}
.tab.active { color: var(--neon); border-color: var(--neon); box-shadow: var(--glow-neon); }
.inv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.inv-card {
  aspect-ratio: 3/4;
  border: 1px solid var(--line); border-radius: 12px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  padding: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 6px; position: relative;
}
.inv-card .ii { font-size: 30px; }
.inv-card .in { font-size: 10px; color: var(--text); letter-spacing: .3px; }
.inv-card .iq { position: absolute; top: 6px; right: 8px; font-size: 10px; color: var(--neon); }
.inv-card.locked { opacity: .4; filter: grayscale(.6); }
.inv-card.locked::after { content: "🔒"; position: absolute; font-size: 22px; }
.inv-card.rare { border-color: var(--purple); box-shadow: 0 0 12px rgba(176,107,255,.4); }
.inv-card.rare .in { color: var(--purple); }
.inv-card.equipped { border-color: var(--neon); box-shadow: var(--glow-neon); }
.inv-empty { color: var(--text-dim); text-align: center; font-size: 12px; padding: 30px 0; }

/* ---------- Leaderboard ---------- */
.lb-list { display: grid; gap: 8px; }
.lb-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
}
.lb-row .rank { width: 26px; font-family: var(--font-display); font-size: 14px; color: var(--text-dim); text-align: center; }
.lb-row .av { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 18px; border: 1px solid var(--line); background: #06131b; }
.lb-row .nm { font-size: 13px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row .sc { color: var(--neon); font-size: 13px; }
.lb-row.me { border-color: var(--neon); box-shadow: var(--glow-neon); background: rgba(0,255,163,.05); }
.lb-row.top1 .rank { color: #ffd24a; text-shadow: 0 0 8px #ffd24a; }
.lb-row.top2 .rank { color: #cfe3ff; }
.lb-row.top3 .rank { color: #ff9f5a; }

/* ---------- Profile ---------- */
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.profile-av {
  width: 74px; height: 74px; border-radius: 18px; flex: none;
  display: grid; place-items: center; font-size: 38px;
  border: 1px solid var(--neon); box-shadow: var(--glow-neon); background: #06131b;
}
.profile-name { font-family: var(--font-display); font-size: 17px; letter-spacing: .5px; }
.profile-rank { font-size: 12px; color: var(--cyan); margin-top: 2px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.stat-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--panel); }
.stat-box .sv { font-family: var(--font-display); font-size: 20px; color: var(--neon); }
.stat-box .sl { font-size: 11px; color: var(--text-dim); letter-spacing: .5px; margin-top: 2px; }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px; font-size: 11px;
  border: 1px solid var(--line); color: var(--text-dim);
}
.badge.on { color: var(--amber); border-color: rgba(255,183,51,.5); box-shadow: 0 0 8px rgba(255,183,51,.25); }

/* ---------- Bottom nav ---------- */
.nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0;
  width: 100%; max-width: var(--shell-max);
  display: flex; z-index: 45;
  background: linear-gradient(180deg, rgba(6,13,19,.85), rgba(4,8,11,.98));
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
}
.nav button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--text-faint); font-size: 9px; letter-spacing: .5px;
  padding: 4px 0; transition: color .18s ease;
}
.nav button .ni { font-size: 19px; filter: grayscale(1) brightness(.8); transition: filter .18s ease; }
.nav button.active { color: var(--neon); }
.nav button.active .ni { filter: none; text-shadow: var(--glow-neon); }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; left: 50%; transform: translateX(-50%); top: 64px; z-index: 200; display: grid; gap: 8px; width: min(92%, 420px); }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 12px;
  background: rgba(6,15,20,.96);
  border: 1px solid var(--neon);
  box-shadow: var(--glow-neon);
  font-size: 12.5px; color: var(--text);
  animation: toastIn .3s ease, toastOut .3s ease forwards; animation-delay: 0s, 2.6s;
}
.toast.cyan   { border-color: var(--cyan);   box-shadow: var(--glow-cyan); }
.toast.amber  { border-color: var(--amber);  box-shadow: 0 0 12px rgba(255,183,51,.5); }
.toast.danger { border-color: var(--danger); box-shadow: 0 0 12px rgba(255,70,110,.5); }
.toast .ti { font-size: 16px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-12px); } }

/* ---------- Modal ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(2,6,9,.8); backdrop-filter: blur(5px);
  display: none; align-items: center; justify-content: center; padding: 18px;
}
.modal-back.show { display: flex; animation: fadeIn .2s ease; }
.modal {
  width: min(100%, 380px);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--neon);
  box-shadow: var(--glow-neon);
  border-radius: 18px; padding: 20px 18px; text-align: center;
  animation: modalPop .3s cubic-bezier(.2,1.2,.3,1);
}
@keyframes modalPop { from { opacity: 0; transform: scale(.9) translateY(10px); } }
.modal h3 { font-family: var(--font-display); font-size: 16px; letter-spacing: 1px; margin-bottom: 8px; }
.modal p { font-size: 13px; color: var(--text-dim); margin-bottom: 16px; }
.modal .modal-actions { display: grid; gap: 10px; }

/* Ad simulation */
.ad-sim { text-align: center; }
.ad-spinner {
  width: 54px; height: 54px; margin: 6px auto 14px;
  border: 3px solid var(--line); border-top-color: var(--neon);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ad-note { font-size: 10px; color: var(--text-faint); margin-top: 10px; letter-spacing: .5px; }

/* Reward summary */
.reward-list { display: grid; gap: 8px; margin: 4px 0 16px; }
.reward-item {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  font-size: 15px; color: var(--text);
  animation: rewardPop .4s backwards;
}
.reward-item .ri { font-size: 20px; }
.reward-item b { color: var(--neon); }
@keyframes rewardPop { from { opacity: 0; transform: scale(.6); } }

/* Mission complete banner */
.complete-badge { font-size: 54px; margin-bottom: 6px; animation: successPop .6s cubic-bezier(.2,1.4,.4,1); }
@keyframes successPop { 0%{transform:scale(0) rotate(-20deg);} 60%{transform:scale(1.2) rotate(6deg);} 100%{transform:scale(1);} }
.complete-title { font-family: var(--font-display); color: var(--neon); text-shadow: var(--glow-neon); font-size: 18px; letter-spacing: 2px; margin-bottom: 4px; }

/* Daily rewards */
.daily-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 6px 0 16px; }
.daily-day {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: #06131b; position: relative;
}
.daily-day .dd-label { font-size: 9px; color: var(--text-dim); letter-spacing: .5px; }
.daily-day .dd-ico { font-size: 20px; }
.daily-day .dd-amt { font-size: 10px; color: var(--amber); }
.daily-day.claimed { opacity: .5; }
.daily-day.claimed::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; color: var(--neon); background: rgba(3,8,11,.6); border-radius: 12px; }
.daily-day.today { border-color: var(--neon); box-shadow: var(--glow-neon); }
.daily-day.today .dd-label { color: var(--neon); }

/* Mystery crate */
.crate-stage { display: grid; place-items: center; min-height: 130px; }
.crate {
  font-size: 72px;
  animation: crateShake 1s ease-in-out;
  filter: drop-shadow(0 0 16px rgba(176,107,255,.6));
}
@keyframes crateShake {
  0%,100% { transform: rotate(0) scale(1); }
  15% { transform: rotate(-6deg) scale(1.03); } 30% { transform: rotate(6deg); }
  45% { transform: rotate(-8deg) scale(1.05); } 60% { transform: rotate(8deg); }
  80% { transform: rotate(-3deg) scale(1.08); }
}
.crate.open { animation: crateBurst .5s ease forwards; }
@keyframes crateBurst { to { transform: scale(1.3); opacity: 0; filter: drop-shadow(0 0 40px var(--purple)); } }

/* Disclaimer footer */
.disclaimer {
  margin-top: 18px; padding: 10px 12px;
  border: 1px dashed var(--line); border-radius: 12px;
  font-size: 10.5px; color: var(--text-faint); text-align: center; line-height: 1.5;
}
.disclaimer b { color: var(--text-dim); }

/* Utility */
.mt { margin-top: 14px; }
.center { text-align: center; }
.hide { display: none !important; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  body::after { display: none; }
}
