:root {
  --bg: #102820;
  --bg-2: #16352c;
  --panel: #1c4338;
  --panel-2: #234e42;
  --line: #2d6556;
  --text: #f6f0de;
  --muted: #b7cfc4;
  --accent: #f4c430;
  --accent-2: #ffe38a;
  --mint: #3ecf8e;
  --ice: #8ee3d4;
  --coral: #e36b4a;
  --pink: #f0a3b0;
  --good: #6ee7a8;
  --warn: #f0c14b;
  --bad: #ef7a62;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  --radius: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Segoe UI", "Trebuchet MS", "Avenir Next", system-ui, sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, #2a6b4e 0%, transparent 55%),
    radial-gradient(900px 500px at -10% 110%, #1a4a3c 0%, transparent 50%),
    var(--bg);
  color: var(--text);
  min-height: 100%;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100%;
  padding: calc(12px + var(--safe-top)) 14px calc(18px + var(--safe-bot));
}

h1, h2, h3 { font-weight: 750; letter-spacing: -0.02em; }
button, input { font: inherit; }

.screen { animation: rise 0.28s ease; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 15px;
}
.brand .mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: #24785c;
  display: grid; place-items: center;
  font-size: 16px;
}
.day-chip, .cash-chip {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
}
.cash-chip { justify-self: end; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }

.hero-card, .card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}

.loc-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.loc-name { font-size: 22px; line-height: 1.1; }
.loc-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.weather {
  text-align: right;
  font-size: 13px;
  color: var(--accent-2);
  font-weight: 700;
}
.meters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.meter {
  background: rgba(0,0,0,0.18);
  border-radius: 12px;
  padding: 8px 10px;
}
.meter label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.bar {
  height: 8px;
  background: #0c1f19;
  border-radius: 99px;
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--mint), var(--ice));
}
.bar.warn > i { background: linear-gradient(90deg, #d9a441, #f4c430); }
.bar.bad > i { background: linear-gradient(90deg, #c45a40, #ef7a62); }

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 12px;
  font-weight: 750;
  cursor: pointer;
  min-height: 48px;
}
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(180deg, #f4c430, #e0a81c);
  color: #2a2208;
  border-color: #c99614;
}
.btn.mint {
  background: linear-gradient(180deg, #47d49a, #2aa873);
  color: #062418;
  border-color: #1e8a5e;
}
.btn.ghost { background: transparent; }
.btn.danger {
  background: #5a2b24;
  border-color: #8a4338;
  color: #ffd4cb;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.wide { grid-column: 1 / -1; }
.btn.small { min-height: 36px; padding: 7px 10px; font-size: 13px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  background: rgba(0,0,0,0.16);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
}
.row.route {
  grid-template-columns: 1fr;
  align-items: start;
}
.row.route > button { justify-self: start; }
.row .title { font-weight: 750; }
.row .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.fresh {
  height: 6px;
  background: #0c1f19;
  border-radius: 99px;
  margin-top: 6px;
  overflow: hidden;
}
.fresh > i { display: block; height: 100%; background: var(--mint); }
.fresh.mid > i { background: var(--warn); }
.fresh.low > i { background: var(--bad); }

.qty {
  display: flex;
  align-items: center;
  gap: 6px;
}
.qty button {
  width: 34px; height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}
.price-edit {
  width: 72px;
  background: #0c1f19;
  border: 1px solid var(--line);
  color: var(--accent);
  border-radius: 10px;
  padding: 6px 8px;
  text-align: right;
  font-weight: 700;
}

.toast-log {
  max-height: 160px;
  overflow: auto;
  font-size: 13px;
  color: var(--muted);
}
.toast-log p { margin-bottom: 6px; }
.toast-log .good { color: var(--good); }
.toast-log .bad { color: var(--bad); }
.toast-log .warn { color: var(--warn); }

.modal-back {
  position: fixed; inset: 0;
  background: rgba(6, 16, 13, 0.72);
  display: grid; place-items: end center;
  padding: 12px;
  z-index: 20;
}
.modal {
  width: min(480px, 100%);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 20px 20px 16px 16px;
  padding: 16px;
  max-height: 86vh;
  overflow: auto;
  animation: rise 0.22s ease;
}

.title-screen {
  min-height: calc(100dvh - 40px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 8px;
}
.logo {
  font-size: 42px;
  line-height: 0.95;
  margin: 18px 0 8px;
}
.tag { color: var(--muted); font-size: 16px; margin-bottom: 18px; }
.how li { margin: 0 0 8px 18px; color: var(--muted); font-size: 14px; }

.install-hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.stat {
  background: rgba(0,0,0,0.16);
  border-radius: 12px;
  padding: 10px;
}
.stat b { display: block; font-size: 18px; }
.stat span { color: var(--muted); font-size: 12px; }

.event-banner {
  background: linear-gradient(90deg, #3a2a12, #4a3618);
  border: 1px solid #8a6a2a;
  color: var(--accent-2);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  margin-top: 10px;
}

.hidden { display: none !important; }

.mode-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}
.mode-card {
  text-align: left;
  appearance: none;
  width: 100%;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  padding: 14px;
  cursor: pointer;
}
.mode-card:active { transform: scale(0.99); }
.mode-card.experienced { border-color: #8a6a2a; }
.mode-card .kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mint);
  margin-bottom: 4px;
}
.mode-card.experienced .kicker { color: var(--accent); }
.mode-card h3 { font-size: 20px; margin-bottom: 4px; }
.mode-card p { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.mode-card ul { margin: 0 0 0 16px; color: var(--muted); font-size: 13px; }
.mode-card li { margin-bottom: 3px; }

.coach {
  background: linear-gradient(90deg, #1a3a30, #244a3c);
  border: 1px solid #3d7a64;
  color: var(--accent-2);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 650;
  margin-bottom: 12px;
  line-height: 1.35;
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(62, 207, 142, 0.18);
  color: var(--mint);
  margin-left: 6px;
}
.mode-pill.xp {
  background: rgba(244, 196, 48, 0.18);
  color: var(--accent);
}

.chip {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.22);
  color: var(--muted);
}
.chip.good { color: #062418; background: var(--mint); border-color: #1e8a5e; }
.chip.warn { color: #2a2208; background: var(--warn); border-color: #c9a227; }
.chip.bad { color: #ffd4cb; background: #5a2b24; border-color: #8a4338; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 12px;
}
.wd {
  text-align: center;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 0 4px;
  border-radius: 8px;
  background: rgba(0,0,0,0.18);
  color: var(--muted);
}
.wd small {
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-top: 2px;
  letter-spacing: 0;
  text-transform: none;
}
.wd.today { background: var(--accent); color: #2a2208; }
.wd.we { color: var(--ice); }
.wd.today.we { color: #2a2208; }
.wd.gm::after, .wd.fest::after {
  display: block;
  font-size: 8px;
  margin-top: 1px;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 700;
}
.wd.gm::after { content: "game"; color: var(--accent); }
.wd.fest::after { content: "fest"; color: var(--pink); }
.wd.today.gm::after, .wd.today.fest::after { color: #2a2208; }

.hero-card.slim { padding-bottom: 10px; }
.hero-card.slim .loc-sub { display: none; }
.week { margin-top: 8px; }
.forecast {
  font-size: 11px;
  margin-top: 4px;
  font-weight: 700;
  opacity: 0.9;
}
.forecast-banner {
  background: linear-gradient(90deg, #16352c, #1c4338);
  border: 1px solid var(--line);
  color: var(--ice);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  margin-top: 8px;
}
.mute {
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  font-size: 16px;
  min-width: 32px;
  min-height: 32px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.mode-card.locked { cursor: default; opacity: 0.95; }
.mode-card.locked:active { transform: none; }
.star-line {
  color: #c99614;
  font-weight: 800;
  margin: 8px 0 12px;
}
.brand .mute { margin-left: auto; }

.opening { min-height: calc(100dvh - 40px); display: flex; flex-direction: column; justify-content: flex-end; }
.opening-scene {
  position: relative;
  height: 210px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.opening-scene .sky {
  position: absolute; inset: 0 0 36% 0;
  background: linear-gradient(#7ec4d8, #cfe7c4);
}
.opening-scene .ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 42%;
  background: linear-gradient(#3d6b48, #244a32);
}
.opening-scene.loc-beach .sky { background: linear-gradient(#6ec3e8, #f2d48a); }
.opening-scene.loc-beach .ground { background: linear-gradient(#e8d39a, #c9a45a); }
.opening-scene.loc-school .sky { background: linear-gradient(#8ec5e8, #d9e7a8); }
.opening-scene.loc-depot .sky { background: linear-gradient(#6d7d86, #b9c3b0); }
.opening-scene.loc-depot .ground { background: linear-gradient(#4a4f4c, #2c302e); }
.opening-scene.loc-downtown .sky { background: linear-gradient(#7aa0c4, #d8c9a4); }
.opening-scene.loc-downtown .ground { background: linear-gradient(#4a4a52, #2c2c32); }
.opening-scene.wx-hot .sky { filter: saturate(1.2) brightness(1.08); }
.opening-scene.wx-rain .sky { background: linear-gradient(#5b6d78, #8a9aa4); }
.opening-scene.wx-rain .ground { filter: brightness(0.85); }
.opening-scene.wx-cloudy .sky { filter: saturate(0.6); }
.queue {
  position: absolute;
  left: 14px;
  bottom: 34px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.person {
  display: block;
  width: 14px;
  height: 28px;
  border-radius: 7px 7px 3px 3px;
  background: #2a2a32;
  position: relative;
  opacity: 0;
  transform: translateX(-24px);
  animation: walkup 700ms cubic-bezier(0.2, 0, 0, 1) forwards;
}
.person::before {
  content: "";
  position: absolute;
  top: -9px; left: 2px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: inherit;
  filter: brightness(1.2);
}
.person::after {
  content: "";
  position: absolute;
  left: 2px; right: 2px; bottom: -6px;
  height: 6px;
  border-radius: 0 0 4px 4px;
  background: inherit;
  opacity: 0.85;
}
.person.p1 { background: #3b3b46; }
.person.p2 { background: #5a4638; height: 42px; }
.person.p3 { background: #2e4a44; height: 34px; }
.person.p4 { background: #4a3856; }
@keyframes walkup {
  to { opacity: 1; transform: none; }
}
.cart-mark {
  position: absolute;
  right: 22px;
  bottom: 28px;
  width: 92px;
  height: 64px;
  animation: cartpop 500ms 200ms cubic-bezier(0.2, 0, 0, 1) both;
}
.cart-mark .awning {
  position: absolute;
  left: 4px; right: 4px; top: 0;
  height: 16px;
  background: repeating-linear-gradient(90deg, #f4c430 0 10px, #24785c 10px 20px);
  border-radius: 4px 4px 0 0;
}
.cart-mark .body {
  position: absolute;
  left: 8px; right: 8px; top: 16px;
  height: 28px;
  background: #faf6e8;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 6px 0 #1c4338;
}
.cart-mark .wheel {
  position: absolute;
  bottom: 0;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #2d2d32;
  box-shadow: inset 0 0 0 4px #c8c8cd;
}
.cart-mark .w1 { left: 14px; }
.cart-mark .w2 { right: 14px; }
.cart-mark .lemon {
  position: absolute;
  left: 18px; top: 6px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #ffd640;
  box-shadow: 22px 2px 0 #ffce54;
}
@keyframes cartpop {
  from { opacity: 0; transform: translateY(10px) scale(0.92); }
  to { opacity: 1; transform: none; }
}
.opening-kicker {
  font-size: 20px;
  font-weight: 800;
  text-align: center;
}
.opening-sub {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 8px;
}

.paper {
  background: linear-gradient(180deg, #f4ead0, #e7d7b0);
  color: #2a2208;
  border-radius: 16px;
  padding: 16px 16px 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  border: 1px solid #cbb888;
}
.paper-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6a5a32;
}
.paper-weather { font-size: 14px; font-weight: 700; margin-top: 4px; }
.paper-cash {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 8px 0 4px;
}
.paper-cash.up { color: #1d6b45; }
.paper-cash.down { color: #9a3a28; }
.paper-sub { font-size: 13px; color: #6a5a32; }

.row .title.up { color: var(--good); }
.row .title.down { color: var(--bad); }
.card.melt { border-color: #8a6a2a; }
.next-tip {
  color: var(--accent-2);
  font-size: 14px;
  font-weight: 650;
  margin: -4px 0 12px;
}

.stagger {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 380ms ease-out forwards;
}
.stagger:nth-child(1) { animation-delay: 40ms; }
.stagger:nth-child(2) { animation-delay: 100ms; }
.stagger:nth-child(3) { animation-delay: 160ms; }
.stagger:nth-child(4) { animation-delay: 220ms; }
.stagger:nth-child(5) { animation-delay: 280ms; }
.stagger:nth-child(6) { animation-delay: 340ms; }
.stagger:nth-child(7) { animation-delay: 400ms; }
.stagger:nth-child(8) { animation-delay: 460ms; }
@keyframes fadeInUp {
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .screen, .stagger, .person, .cart-mark { animation: none !important; opacity: 1; transform: none; }
}


