:root {
  --bg: #090a0e;
  --bg-2: #12141b;
  --card: #1a1d27;
  --card-2: #222633;
  --line: rgba(255, 255, 255, 0.08);
  --ember: #ff6b2c;
  --ember-2: #ffb347;
  --lime: #c6ff4a;
  --mint: #3ee0a2;
  --ink: #f6f1e8;
  --muted: #9aa3b5;
  --danger: #ff5d73;
  --gold: #ffd36a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --radius: 22px;
  --safe-b: max(16px, env(safe-area-inset-bottom));
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
img { max-width: 100%; display: block; }

body {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(255, 107, 44, 0.18), transparent 50%),
    #05060a;
  color: var(--ink);
  min-height: 100%;
}

.phone {
  min-height: 100%;
  display: flex;
  justify-content: center;
}

#app {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(255, 107, 44, 0.22), transparent 55%),
    linear-gradient(180deg, #12131a 0%, #0b0c10 40%, #090a0e 100%);
  position: relative;
  overflow: clip;
  box-shadow: var(--shadow);
}

@media (min-width: 760px) {
  body { padding: 28px 0; }
  #app {
    min-height: 844px;
    height: min(900px, calc(100vh - 56px));
    border-radius: 36px;
    border: 1px solid var(--line);
    overflow: auto;
  }
}

.screen {
  padding: 22px 18px calc(92px + var(--safe-b));
  animation: rise 0.35s ease;
}

.screen.full { padding-bottom: 28px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  object-fit: cover;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
}

.chip.fire { color: var(--ember-2); }
.chip.xp { color: var(--gold); }
.chip.warn { color: var(--ember); background: rgba(255, 107, 44, 0.12); }

h1, h2, h3 {
  font-family: "Bricolage Grotesque", sans-serif;
  letter-spacing: -0.04em;
}

h1 { font-size: 34px; line-height: 1.05; }
h2 { font-size: 22px; }
p.lead { color: var(--muted); line-height: 1.5; margin-top: 8px; }

.hero-card {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  min-height: 210px;
  margin: 8px 0 16px;
  border: 1px solid var(--line);
}

.hero-card img.bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.1) contrast(1.05);
}

.hero-card .veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9,10,14,0.15), rgba(9,10,14,0.88));
}

.hero-card .copy {
  position: relative;
  padding: 88px 18px 18px;
}

.xp-wrap {
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin-top: 10px;
}

.xp-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--ember), var(--gold));
  box-shadow: 0 0 16px rgba(255, 107, 44, 0.7);
  transition: width 0.5s ease;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.card h3 { font-size: 15px; margin-bottom: 6px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.45; }
.stat-n {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.mission {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  margin-bottom: 8px;
  text-align: left;
  width: 100%;
}

.mission .ico {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255,107,44,0.12);
  font-size: 20px;
  flex: 0 0 auto;
}

.mission .grow { flex: 1; min-width: 0; }
.mission .title { font-weight: 700; font-size: 14px; }
.bar {
  height: 7px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 7px;
}
.bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--mint), var(--lime));
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  border-radius: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn:active { transform: scale(0.98); }
.btn.primary {
  background: linear-gradient(180deg, #ff8a4a, var(--ember));
  color: #1a0c06;
  box-shadow: 0 10px 24px rgba(255, 107, 44, 0.35);
}
.btn.lime {
  background: linear-gradient(180deg, #d8ff6a, var(--lime));
  color: #152000;
}
.btn.ghost {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
}
.btn.danger { background: var(--danger); color: white; }
.btn:disabled { opacity: 0.45; pointer-events: none; }

.nav {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 10px 12px var(--safe-b);
  background: linear-gradient(180deg, transparent, rgba(9,10,14,0.92) 30%);
  backdrop-filter: blur(14px);
}

.nav button {
  border-radius: 16px;
  padding: 8px 4px 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.nav button span { display: block; font-size: 18px; margin-bottom: 2px; }
.nav button.active { color: var(--ink); background: rgba(255,107,44,0.14); }

.splash {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px 20px 32px;
  position: relative;
}
.splash img.hero {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.splash .veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9,10,14,0.2) 20%, rgba(9,10,14,0.95) 70%);
}
.splash .copy { position: relative; z-index: 1; }
.mascot {
  width: 108px;
  height: 108px;
  border-radius: 32px;
  object-fit: cover;
  margin: 0 auto 16px;
  box-shadow: 0 16px 40px rgba(255,107,44,0.35);
}
.center { text-align: center; }

.dots { display: flex; gap: 6px; justify-content: center; margin: 16px 0; }
.dots i {
  width: 8px; height: 8px; border-radius: 99px; background: rgba(255,255,255,0.2);
}
.dots i.on { width: 22px; background: var(--ember); }

.field { margin: 10px 0; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 700; }
.field input, .field select {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 12px;
  outline: none;
}
.field input:focus { border-color: rgba(255,107,44,0.7); }

.class-pick {
  display: grid;
  gap: 8px;
}
.class-pick button {
  text-align: left;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card);
}
.class-pick button.on {
  border-color: var(--ember);
  background: rgba(255,107,44,0.12);
}

.q-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  min-height: 140px;
}
.choices { display: grid; gap: 8px; margin-top: 16px; }
.choices button {
  text-align: left;
  padding: 14px;
  border-radius: 16px;
  background: var(--card-2);
  border: 1px solid var(--line);
  font-weight: 600;
}
.choices button.ok { background: rgba(62,224,162,0.18); border-color: var(--mint); }
.choices button.bad { background: rgba(255,93,115,0.16); border-color: var(--danger); }

.combo {
  font-family: "Bricolage Grotesque", sans-serif;
  color: var(--gold);
  font-size: 18px;
  min-height: 24px;
}

.paywall {
  position: absolute;
  inset: 0;
  background: rgba(5,6,10,0.72);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: flex-end;
  z-index: 20;
}
.sheet {
  width: 100%;
  background: #161821;
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  padding: 18px 18px calc(20px + var(--safe-b));
  border-top: 1px solid var(--line);
}
.price {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 42px;
  letter-spacing: -0.05em;
}
.price small { font-size: 16px; color: var(--muted); }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.tabs button {
  padding: 10px;
  border-radius: 12px;
  background: var(--card);
  font-weight: 700;
}
.tabs button.on { background: rgba(255,107,44,0.16); color: var(--ember-2); }

.pix-box {
  background: #0d0f14;
  border-radius: 16px;
  padding: 12px;
  font-size: 12px;
  word-break: break-all;
  color: var(--muted);
  border: 1px dashed var(--line);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  background: #111;
  color: white;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  z-index: 40;
  border: 1px solid var(--line);
}

.confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 30;
}
.confetti i {
  position: absolute;
  top: -10px;
  width: 8px;
  height: 12px;
  animation: fall 1.1s linear forwards;
}
@keyframes fall {
  to { transform: translateY(110vh) rotate(260deg); opacity: 0.2; }
}

.wheel {
  width: 260px;
  height: 260px;
  margin: 10px auto;
  border-radius: 50%;
  border: 8px solid #2a1a12;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 6px rgba(255,107,44,0.25), var(--shadow);
}
.wheel .spin {
  width: 100%;
  height: 100%;
  background: conic-gradient(
    #ff6b2c 0 60deg,
    #ffd36a 60deg 120deg,
    #3ee0a2 120deg 180deg,
    #7aa2ff 180deg 240deg,
    #ff5d73 240deg 300deg,
    #c6ff4a 300deg 360deg
  );
  transition: transform 3.4s cubic-bezier(.12,.8,.2,1);
}
.pointer {
  width: 0; height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 16px solid white;
  margin: 0 auto -6px;
  position: relative;
  z-index: 2;
}

.lesson {
  width: 100%;
  text-align: left;
  padding: 14px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.disclaimer {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 14px;
}

.hearts { letter-spacing: 2px; color: var(--danger); font-size: 16px; }

.row { display: flex; gap: 8px; }
.row .btn { flex: 1; }

.badge-row { display: flex; gap: 8px; overflow: auto; padding-bottom: 4px; }
.badge {
  min-width: 86px;
  text-align: center;
  padding: 10px 8px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 12px;
}
.badge .b { font-size: 22px; }

.lock-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,107,44,0.1);
  border: 1px solid rgba(255,107,44,0.25);
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
}

.tiny { font-size: 11px; color: var(--muted); }

.day-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 14px 0 10px;
}
.ring { width: 80px; height: 80px; flex: 0 0 auto; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 8; }
.ring-fg { fill: none; stroke: url(#none); stroke: #ff6b2c; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 0.4s ease; }
.ring text { transform: rotate(90deg); transform-origin: 40px 40px; fill: #f6f1e8; font-size: 16px; font-weight: 800; font-family: "Bricolage Grotesque", sans-serif; }
.mission.done { opacity: 0.72; border-color: rgba(62,224,162,0.35); }
.m-side { text-align: right; flex: 0 0 auto; }
.m-cta {
  display: inline-block;
  margin-top: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,107,44,0.16);
  color: var(--ember-2);
  font-size: 11px;
  font-weight: 800;
}
.mission.done .m-cta { background: rgba(62,224,162,0.16); color: var(--mint); }
.bar.fat { height: 12px; margin-top: 16px; }
.train-screen { display: flex; flex-direction: column; min-height: 100dvh; }
.train-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
}
.train-stage.rest { filter: saturate(0.7); }
.train-e { font-size: 64px; margin-bottom: 8px; }
.train-sec {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 72px;
  letter-spacing: -0.06em;
  line-height: 1;
  margin: 8px 0;
}
.meal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.meal-pick { min-height: 110px; }

#app.mode-rush {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#app.juice-shake { animation: juice-shake 0.16s linear; }
@keyframes juice-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
#app.fever {
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 180, 50, 0.35), transparent 55%),
    linear-gradient(180deg, #2a1408, #0b0c10);
}

.btn.play-now {
  min-height: 64px;
  font-size: 18px;
  animation: pulse-play 1.5s ease-in-out infinite;
}
@keyframes pulse-play {
  0%, 100% { transform: scale(1); box-shadow: 0 10px 24px rgba(255, 107, 44, 0.35); }
  50% { transform: scale(1.035); box-shadow: 0 16px 44px rgba(255, 107, 44, 0.6); }
}

.rush-wrap {
  height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 10px 0 12px;
  user-select: none;
  touch-action: none;
}
.rush-hud {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 6px 12px 8px;
}
.rush-x {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  font-weight: 800;
}
.rush-score {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 28px;
  letter-spacing: -0.04em;
  line-height: 1;
}
.rush-score.big { font-size: 64px; }
.rush-combo {
  font-family: "Bricolage Grotesque", sans-serif;
  color: var(--gold);
  font-size: 22px;
  min-width: 48px;
  text-align: right;
}
.rush-arena {
  position: relative;
  flex: 1;
  margin: 0 12px;
  border-radius: 24px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,107,44,0.08), transparent 30%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 25%),
    #101218;
  border: 1px solid var(--line);
  box-shadow: inset 0 -40px 40px rgba(255, 107, 44, 0.08);
}
.lanes {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.lanes i { border-right: 1px solid rgba(255,255,255,0.05); }
.plate-line {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 10px;
  height: 44px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 211, 106, 0.45);
  display: grid;
  place-items: center;
  color: rgba(255, 211, 106, 0.7);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.28em;
  pointer-events: none;
}
.drop {
  position: absolute;
  top: 0;
  width: 25%;
  height: 74px;
  display: grid;
  place-items: center;
  font-size: 42px;
  background: none;
  z-index: 2;
  filter: drop-shadow(0 10px 10px rgba(0,0,0,0.45));
  will-change: transform;
  padding: 0;
}
.drop.boss { width: 50%; font-size: 64px; height: 90px; }
.drop.good { filter: drop-shadow(0 0 10px rgba(62, 224, 162, 0.45)); }
.drop.hit { transform: scale(0.86); }
.drop.boom { animation: boom 0.12s ease forwards; }
@keyframes boom {
  to { transform: scale(1.4); opacity: 0; }
}
.float-n {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: var(--gold);
  animation: upfade 0.7s ease forwards;
  text-shadow: 0 2px 8px #000;
}
.float-n.bad { color: var(--danger); }
.float-n.mint { color: var(--mint); }
.float-n.gold { color: #fff6c8; font-size: 22px; }
@keyframes upfade {
  to { transform: translateY(-46px); opacity: 0; }
}
.spark {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffd36a;
  pointer-events: none;
  z-index: 5;
  animation: spark 0.36s ease-out forwards;
}
@keyframes spark {
  to { transform: translate(var(--dx), var(--dy)); opacity: 0; }
}
.countdown {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 84px;
  letter-spacing: -0.06em;
  z-index: 8;
  text-shadow: 0 10px 40px rgba(255, 107, 44, 0.5);
}
.combo-pop {
  position: absolute;
  left: 50%;
  top: 28%;
  transform: translate(-50%, -50%);
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 34px;
  white-space: nowrap;
  color: var(--gold);
  z-index: 7;
  pointer-events: none;
  animation: comboIn 0.45s ease forwards;
  text-shadow: 0 8px 24px rgba(0,0,0,0.6);
}
@keyframes comboIn {
  0% { transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
  40% { transform: translate(-50%, -50%) scale(1.12); opacity: 1; }
  100% { transform: translate(-50%, -40%) scale(1); opacity: 0; }
}
.fever-tag {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%) scale(0.6);
  opacity: 0;
  background: linear-gradient(90deg, #ff6b2c, #ffd36a);
  color: #1a0c06;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.12em;
  font-size: 12px;
  z-index: 4;
  pointer-events: none;
}
.fever-tag.on { opacity: 1; transform: translateX(-50%) scale(1); }
.rush-hint {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 8px 16px 0;
}
.rush-end { padding-top: 48px; }

.league { margin: 12px 0; }
.league-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 4px;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}
.league-row.you { color: var(--gold); }

.goal-pick { display: grid; gap: 8px; }
.goal-pick button {
  text-align: left;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card);
}
.goal-pick button.on {
  border-color: var(--ember);
  background: rgba(255,107,44,0.12);
}
.goal-pick.mini {
  grid-template-columns: repeat(2, 1fr);
}
.goal-pick.mini button { text-align: center; font-weight: 700; padding: 12px; }

.card.kit { margin: 12px 0; }
.kit-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.plate-viz {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  margin: 12px auto;
  max-width: 160px;
  border: 4px solid rgba(255,255,255,0.12);
}
.plate-viz span {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  padding: 6px;
}
.plate-viz .veg { grid-column: 1 / 3; background: #2f6b3a; }
.plate-viz .pro { background: #8b3a2a; }
.plate-viz .carb { background: #b08a3a; }
.plate-viz.gain { border-radius: 22px; }
.plate-viz.gain .pro { grid-column: 1 / 3; }

.hunger-row {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
}
.hunger-row button {
  min-height: 32px;
  border-radius: 8px;
  background: var(--card-2);
  font-size: 11px;
  font-weight: 800;
}
.hunger-row button.on {
  background: var(--ember);
  color: #1a0c06;
}

.rush-score .tiny { font-size: 14px; font-weight: 700; color: var(--muted); margin-left: 4px; }
