:root {
  --crimson: #EA1520;
  --gold: #EAB92D;
  --gold-deep: #CB9B14;
  --gold-bright: #FFC107;
  --ink: #000000;
  --panel: #1D2531;
  --cream: #FFF3E0;
  --accent: #EAB92D;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100dvh;
  background: #000 url("bg-wash.jpg") center / cover no-repeat fixed;
  color: #fff;
  font-family: "Noto Sans Devanagari", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}
button, input { font-family: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: 0.45; cursor: default; }
button:focus-visible, input:focus-visible, tr:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}
img { max-width: 100%; }
[hidden] { display: none !important; }
body.lock { overflow: hidden; }

#splash, #onboard, #shell {
  width: min(440px, 100%);
  margin: 0 auto;
  min-height: 100dvh;
}
#splash {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  background:
    linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.72)),
    url("bg-wash.jpg") center / cover;
  transition: opacity 0.35s ease;
}
#splash.out { opacity: 0; }
#splash img {
  width: 108px;
  height: 108px;
  border-radius: 24px;
  box-shadow: 0 0 0 2px var(--gold-deep), 0 16px 40px rgba(0, 0, 0, 0.45);
}
#splash strong {
  color: var(--gold);
  font-size: 34px;
  font-weight: 700;
}
#splash em {
  width: 92px;
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--crimson), var(--gold), transparent);
}

#onboard {
  padding: 22px 16px 32px;
  background:
    linear-gradient(rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.78)),
    url("bg-haze.jpg") center / cover;
}
.dots { display: flex; gap: 8px; justify-content: center; }
.dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5c5346;
}
.dots i.on { background: var(--crimson); box-shadow: 0 0 0 3px rgba(234, 21, 32, 0.35); }
.step { text-align: center; color: var(--gold-bright); margin: 8px 0 14px; }
.choices { display: flex; gap: 16px; justify-content: center; margin: 18px 0; }
.choice {
  width: 132px;
  border: 0;
  background: transparent;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--gold-bright);
  font-weight: 700;
  border-radius: 20px;
  padding: 8px;
}
.choice.on { box-shadow: inset 0 0 0 2px var(--crimson); background: rgba(234, 21, 32, 0.16); }
.disc { width: 74px; height: 74px; border-radius: 50%; display: block; }
.disc.gold { background: radial-gradient(circle at 35% 30%, #fff6c8, #EAB92D 46%, #CB9B14 72%, #5c430c); }
.disc.crimson { background: radial-gradient(circle at 35% 30%, #ffb3b8, #EA1520 48%, #6e0d16); }
#onboard h1, #view h1 { font-size: 26px; margin: 0 0 8px; }
#onboard .lead, .lead { color: #f3e2c2; margin: 0 0 12px; }
#nextBtn, .go, .primary {
  width: 100%;
  margin-top: 14px;
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  background: linear-gradient(#F0C85A, var(--gold) 40%, var(--gold-deep));
  color: #000;
  font-weight: 700;
  font-size: 16px;
}
.ghost {
  display: block;
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--gold-deep);
  background: transparent;
  color: var(--gold-bright);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
}
.pair { display: flex; gap: 10px; }
.pair .primary, .pair .ghost { width: auto; flex: 1; margin-top: 0; }
.paper .ghost { width: auto; display: inline-block; margin-top: 8px; }
.pick { width: 100%; text-align: left; border: 0; margin: 0 0 10px; }

#shell { background: rgba(0, 0, 0, 0.62); position: relative; }
.sticky-top {
  position: sticky;
  top: 0;
  z-index: 4;
  background: rgba(0, 0, 0, 0.94);
}
#top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 8px;
}
.mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
}
.brand { flex: 1; display: grid; }
.brand b { color: var(--gold); font-size: 18px; }
.brand small { color: #fff; }
.coin { width: 28px; height: 28px; object-fit: contain; }
.bell {
  position: relative;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--panel);
  padding: 0;
}
.bell img { width: 24px; height: 24px; object-fit: contain; }
.bell i {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  border-radius: 99px;
  background: var(--crimson);
  color: #fff;
  font-style: normal;
  font-size: 11px;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 2px #000;
}
#ticker {
  display: block;
  width: 100%;
  overflow: hidden;
  border: 0;
  border-top: 2px solid var(--crimson);
  border-bottom: 2px solid var(--gold);
  background: var(--panel);
  color: var(--gold-bright);
  padding: 7px 0;
  font-weight: 600;
}
#ticker.paused { box-shadow: inset 0 0 0 2px var(--crimson); }
.track { display: flex; width: max-content; animation: slide 16s linear infinite; }
#ticker.paused .track { animation-play-state: paused; }
.track span { white-space: nowrap; padding-right: 8px; }
@keyframes slide {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

main { padding: 14px 12px 168px; }
.hero {
  position: relative;
  min-height: 132px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--gold-deep);
  margin-bottom: 12px;
}
.hero .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero .veil { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.12)); }
.hero .copy { position: relative; display: flex; gap: 12px; align-items: center; padding: 16px; }
.hero .copy img { width: 78px; height: 78px; object-fit: contain; }
.hero h1 { margin: 0; color: var(--gold); }
.hero p { margin: 4px 0 0; }

.card {
  position: relative;
  background: var(--cream);
  color: #000;
  border-radius: 18px;
  padding: 12px 12px 12px 16px;
  margin: 0 0 12px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}
.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(var(--crimson), var(--gold));
}
.card h2 { margin: 6px 0; font-size: 18px; }
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #000;
  font-size: 12px;
  font-weight: 700;
}
body[data-chip="crimson"] { --accent: #EA1520; }
body[data-chip="crimson"] .tag { color: #fff; }
.lines p { margin: 0 0 4px; font-size: 14.5px; line-height: 1.45; }
.card.button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
}
.tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.tools button, .tiny {
  border: 1px solid var(--gold-deep);
  background: #14100c;
  color: var(--gold-bright);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
}
.tape .body { margin: 8px 0; }
.saved { box-shadow: inset 0 0 0 2px var(--crimson); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.board-card {
  background: var(--cream);
  color: #000;
  border: 0;
  border-radius: 16px;
  padding: 10px;
  text-align: left;
  min-height: 112px;
}
.board-card b { display: block; margin: 6px 0; }
.board-card small { color: #6a1a22; }
.plaque { position: relative; margin-bottom: 10px; }
.plaque img { width: 100%; display: block; }
.plaque p {
  position: absolute;
  inset: 22% 12% 18%;
  margin: 0;
  display: grid;
  place-items: center;
  text-align: center;
  color: #000;
  font-weight: 700;
}
.misses { display: flex; gap: 8px; align-items: center; }
.misses i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #3a332b;
  display: block;
}
.misses i.bad { background: var(--crimson); }
.answers { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 8px; }
.answers li {
  background: var(--cream);
  color: #000;
  border-radius: 12px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
}
.answers .bar {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}
.answers .bar::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright));
}
.answers li.open .bar::after { width: var(--w); }
.guess {
  display: flex;
  gap: 8px;
}
.guess input {
  flex: 1;
  border-radius: 12px;
  border: 1px solid var(--gold-deep);
  background: #fff;
  color: #000;
  padding: 12px;
  font-size: 16px;
}
.guess button, .replay {
  border: 0;
  border-radius: 12px;
  background: var(--crimson);
  color: #fff;
  font-weight: 700;
  padding: 12px 14px;
}
.flash { min-height: 1.4em; color: var(--gold-bright); font-weight: 700; }
.back {
  border: 0;
  background: transparent;
  color: var(--gold-bright);
  font-weight: 700;
  padding: 0 0 8px;
}

.stage { display: flex; gap: 16px; align-items: flex-end; justify-content: center; }
.stage .pot { width: 140px; height: 160px; object-fit: contain; }
.gauge {
  position: relative;
  width: 48px;
  height: 220px;
  border-radius: 16px;
  background: var(--panel);
  overflow: hidden;
  border: 2px solid var(--gold-deep);
}
.gauge .win {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 52%;
  height: 26%;
  background: rgba(234, 185, 45, 0.38);
  border-top: 1px solid var(--gold-bright);
  border-bottom: 1px solid var(--gold-bright);
}
.gauge .hot {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 22%;
  background: rgba(234, 21, 32, 0.55);
}
.gauge b {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  background: linear-gradient(#fff1a8, var(--gold));
}
.gauge b[data-z="red"] { background: linear-gradient(#ff8a80, var(--crimson)); }
.gauge b[data-z="gold"] { background: linear-gradient(#fff6c2, var(--gold-bright)); }
.pad {
  margin-top: 12px;
  width: 100%;
  border-radius: 20px;
  border: 1px solid var(--gold-deep);
  background: rgba(29, 37, 49, 0.72);
  color: #fff;
  padding: 12px;
  touch-action: none;
  user-select: none;
}
.pad strong { display: block; text-align: center; font-size: 28px; color: var(--gold); }
.pad em { display: block; text-align: center; color: #f3e2c2; }
.stats { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }
.stats span { color: var(--gold-bright); font-size: 14px; }
.token { width: 28px; height: 28px; object-fit: contain; vertical-align: middle; }
.token.used { filter: grayscale(1); opacity: 0.45; }

.streak { display: flex; gap: 6px; align-items: center; margin: 8px 0 12px; }
.streak i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2a241c;
  box-shadow: inset 0 0 0 2px var(--gold-deep);
}
.streak i.lit { background: radial-gradient(circle at 35% 35%, #fff6c2, var(--gold) 45%, var(--crimson)); }
.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 92px; }
.heat .cell {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
}
.heat b {
  display: block;
  width: 100%;
  border-radius: 8px 8px 2px 2px;
  background: #2a241c;
  min-height: 6px;
}
.heat .play b { background: linear-gradient(var(--gold-bright), var(--gold-deep)); }
.heat .skip b { background: #c8b49a; }
.heat .today b { box-shadow: 0 0 0 2px var(--crimson); }
.heat small { color: #f3e2c2; font-size: 11px; margin-top: 4px; }
.marks { display: flex; justify-content: space-between; color: var(--gold-bright); font-weight: 700; }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(90deg, #CB9B14, #EAB92D, #FFC107);
  margin: 12px 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--crimson);
  border: 2px solid var(--gold-bright);
}
.scale-num { font-size: 28px; color: var(--gold); margin: 0; }
.note { color: #f3e2c2; }

.log, .slots { width: 100%; }
table.log { width: 100%; border-collapse: collapse; color: #000; }
table.log th, table.log td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(203, 155, 20, 0.45);
}
table.log th { color: #7a101c; }
table.log tr[data-act] { cursor: pointer; }
.slots { display: grid; gap: 8px; }
.slot {
  background: var(--cream);
  color: #000;
  border-radius: 14px;
  padding: 10px 12px;
  min-height: 64px;
}
.slot.empty { background: transparent; color: #f3e2c2; border: 1px dashed var(--gold-deep); }
.pin-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  margin: 0 0 6px;
}
.slot button { margin-top: 4px; }

.arch {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(440px, 100%);
  height: 148px;
  z-index: 6;
  background: linear-gradient(rgba(0, 0, 0, 0), #000 22%);
  padding-bottom: env(safe-area-inset-bottom);
}
.arch svg { width: 100%; height: 112px; display: block; }
.apex {
  position: absolute;
  left: 50%;
  top: 0;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -6px);
  object-fit: contain;
}
.node {
  position: absolute;
  width: 68px;
  transform: translate(-50%, -8px);
  background: transparent;
  border: 0;
  color: var(--gold-bright);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0;
}
.node[data-tab="kalash"] { left: 13%; top: 54%; }
.node[data-tab="tape"] { left: 39%; top: 16%; }
.node[data-tab="quiz"] { left: 61%; top: 16%; }
.node[data-tab="day"] { left: 87%; top: 54%; }
.gem {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6c8, #EAB92D 45%, #CB9B14);
  box-shadow: 0 0 0 2px #000, 0 0 0 4px #CB9B14;
}
.node.active {
  color: #fff;
  border-radius: 14px;
  box-shadow: inset 0 0 0 2px var(--crimson);
  background: rgba(234, 21, 32, 0.16);
  padding: 0 0 2px;
}
.node.active .gem {
  box-shadow: 0 0 0 2px #1a0709, 0 0 0 4px #EA1520, 0 0 12px #EA1520;
}

#sheet {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  align-items: end;
  justify-items: center;
}
.dim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.62); }
.paper {
  position: relative;
  width: min(440px, 100%);
  max-height: 82dvh;
  overflow: auto;
  border-radius: 24px 24px 0 0;
  padding: 18px 16px 28px;
  color: #000;
  background:
    linear-gradient(rgba(255, 243, 224, 0.94), rgba(255, 243, 224, 0.97)),
    url("bg-haze.jpg") center / cover;
  border-top: 3px solid var(--gold);
}
.paper h2 { margin: 8px 0; }
.facts { margin: 8px 0 14px; padding-left: 18px; }
.facts li { margin: 0 0 6px; }
.shake { animation: shake 0.4s linear; }
@keyframes shake {
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
@media (max-width: 380px) {
  .node { width: 58px; font-size: 12px; }
  .grid { grid-template-columns: 1fr; }
}
