*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  color: #2A160C;
  font-family: "Noto Sans Devanagari", sans-serif;
  line-height: 1.55;
  background: #E8772E url("bg-saffron.jpg") center/cover fixed;
}
button { font-family: inherit; font-size: 16px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 3px solid #F2C14E; outline-offset: 2px; }
img { max-width: 100%; }
.app {
  width: min(480px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: #FFFFFF url("bg-cream.jpg") center/cover;
  position: relative;
}
.band { background: #E8772E url("bg-saffron.jpg") center/cover; }
.brand { display: flex; gap: 10px; align-items: center; padding: 14px 14px 12px; }
.brand img { width: 52px; height: 52px; object-fit: contain; filter: drop-shadow(0 4px 0 rgba(42, 22, 12, 0.18)); }
.brand strong { display: block; color: #FFFFFF; font-size: 20px; letter-spacing: 0.2px; }
.brand span { color: #F2C14E; font-weight: 700; }
#ticker {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border: 0;
  padding: 9px 0;
  background: #2A160C;
  color: #F2C14E;
  text-align: left;
}
.ticker-move { display: inline-flex; white-space: nowrap; min-width: 200%; animation: tick 18s linear infinite; }
.ticker-move span { flex: 0 0 50%; }
#ticker.is-paused .ticker-move { animation-play-state: paused; }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }
#pauseTag {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: #F2C14E;
  color: #2A160C;
  border-radius: 999px;
  padding: 2px 8px;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}
.garland { position: relative; background: rgba(255, 255, 255, 0.9); padding-bottom: 8px; }
.vine { position: absolute; left: 0; top: 0; width: 100%; height: 84px; }
.blooms { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; padding: 0 4px; }
.bloom {
  width: 25%;
  border: 0;
  background: transparent;
  color: #2A160C;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.bloom:nth-child(1) { margin-top: 22px; }
.bloom:nth-child(2) { margin-top: 40px; }
.bloom:nth-child(3) { margin-top: 16px; }
.bloom:nth-child(4) { margin-top: 36px; }
.petals { width: 74px; height: 74px; position: relative; display: block; }
.petals > i {
  position: absolute;
  left: 25px;
  top: 2px;
  width: 24px;
  height: 36px;
  border-radius: 50%;
  background: #E8772E;
  transform-origin: 12px 35px;
}
.petals > i:nth-child(1) { transform: rotate(0deg); }
.petals > i:nth-child(2) { transform: rotate(45deg); }
.petals > i:nth-child(3) { transform: rotate(90deg); }
.petals > i:nth-child(4) { transform: rotate(135deg); }
.petals > i:nth-child(5) { transform: rotate(180deg); }
.petals > i:nth-child(6) { transform: rotate(225deg); }
.petals > i:nth-child(7) { transform: rotate(270deg); }
.petals > i:nth-child(8) { transform: rotate(315deg); }
.bloom.is-on .petals > i { background: #F2C14E; }
.bloom.is-on .petals { animation: sway 3.2s ease-in-out infinite; transform-origin: 50% 0; }
@keyframes sway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.petals img {
  position: absolute;
  z-index: 2;
  left: 14px;
  top: 14px;
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 50%;
  background: #FFFFFF;
}
.bloom.is-on .petals img { box-shadow: 0 0 0 3px #F2C14E; }
.petals b {
  position: absolute;
  z-index: 3;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #E8772E;
  color: #FFFFFF;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}
.bloom-name { font-size: 13px; font-weight: 700; background: #FFFFFF; border-radius: 999px; padding: 1px 8px; }
.bloom.is-on .bloom-name { background: #F2C14E; }
main { padding: 8px 14px 32px; }
h2 { margin: 0 0 8px; font-size: 28px; }
h3 { margin: 6px 0; font-size: 20px; }
p { margin: 0 0 10px; }
.lede { font-weight: 700; }
.center { text-align: center; font-weight: 700; }
.stack { display: grid; gap: 12px; }
.card, .tape, .slot, .switch, .pin-row, .draft-slot, .stats div, .rule {
  background: #FFFFFF;
  border-radius: 18px;
}
.card { padding: 12px 12px 14px; box-shadow: 0 8px 0 rgba(42, 22, 12, 0.06); }
.card.pinned { box-shadow: inset 0 0 0 3px #F2C14E; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tag { display: inline-block; background: #E8772E; color: #FFFFFF; border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 700; }
.card ul { margin: 0 0 8px; padding-left: 18px; }
.pin { border: 0; border-radius: 999px; padding: 8px 12px; font-weight: 700; background: #FFFFFF; color: #2A160C; box-shadow: inset 0 0 0 2px #E8772E; }
.pin.on { background: #F2C14E; box-shadow: none; }
.leaf { border: 0; min-width: 76px; min-height: 42px; padding: 8px 14px; font-weight: 700; color: #FFFFFF; background: #E8772E; border-radius: 2px 28px 2px 28px; }
.leaf.on { background: #F2C14E; color: #2A160C; }
.btn { width: 100%; margin-top: 8px; border: 0; border-radius: 999px; padding: 12px 16px; font-weight: 700; background: #E8772E; color: #FFFFFF; }
.btn.gold { background: #F2C14E; color: #2A160C; }
.btn:disabled { opacity: 0.45; }
.row { display: flex; gap: 8px; margin-top: 8px; }
.row .btn { margin-top: 0; flex: 1; width: auto; }
.text-back { border: 0; background: transparent; color: #E8772E; font-weight: 700; padding: 0 0 6px; }
.slim, .hero, .utils button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  border: 0;
  border-radius: 16px;
  padding: 10px;
  margin: 0 0 12px;
  background: #FFFFFF;
  color: #2A160C;
  font-weight: 700;
  box-shadow: inset 0 0 0 2px #F2C14E;
}
.slim img, .hero img, .utils button img, .switch img { width: 46px; height: 46px; object-fit: contain; }
.hero span, .switch span { display: flex; flex-direction: column; }
.utils { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.utils button { margin: 0; }
.utils .wide { grid-column: 1 / -1; }
.streak { display: flex; justify-content: center; gap: 8px; margin: 8px 0 4px; }
.streak i { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; background: #FFFFFF; box-shadow: inset 0 0 0 3px #E8772E; }
.streak i.lit { background: #F2C14E; }
.tape { padding: 10px 12px; }
.tape button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 0; background: transparent; color: inherit; font-weight: 700; text-align: left; padding: 0; }
.tape p { margin: 8px 0 0; }
.quiz-head { display: flex; align-items: center; gap: 8px; }
.quiz-head img, .spot { width: 64px; height: 64px; object-fit: contain; }
.spot { display: block; margin: 0 auto 8px; }
.quiz-board { background: #2A160C; color: #FFFFFF; border-radius: 20px; padding: 12px; }
.quiz-q { color: #F2C14E; font-weight: 700; }
.ans { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 44px; margin: 6px 0; padding: 0 12px; border-radius: 10px; background: #E8772E; color: #FFFFFF; font-weight: 700; }
.ans.open { background: #F2C14E; color: #2A160C; }
.misses { display: flex; align-items: center; gap: 6px; color: #F2C14E; font-weight: 700; }
.misses i { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 2px #F2C14E; display: block; }
.misses i.on { background: #E8772E; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip { border: 2px solid #E8772E; background: #FFFFFF; color: #2A160C; border-radius: 999px; padding: 8px 12px; font-weight: 700; }
.chip.good { background: #F2C14E; border-color: #F2C14E; }
.chip.bad { background: #2A160C; color: #FFFFFF; border-color: #2A160C; }
.chip:disabled { opacity: 1; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.stats div { text-align: center; padding: 8px 4px; }
.stats strong { display: block; color: #E8772E; font-size: 20px; }
.stats span { font-size: 12px; font-weight: 700; }
.reel-grid, .edit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: #2A160C; padding: 10px; border-radius: 18px; }
.cell, .edit-grid button, .mini-grid span { aspect-ratio: 1; background: #FFFFFF; border-radius: 12px; display: grid; place-items: center; border: 0; }
.cell img, .edit-grid img, .mini-grid img { width: 74%; height: 74%; object-fit: contain; }
.tika-mark { width: 34px; height: 34px; border-radius: 50%; background: #F2C14E; box-shadow: 0 0 0 7px #E8772E; display: block; }
.mini-grid .tika-mark, .legend .tika-mark { width: 16px; height: 16px; box-shadow: 0 0 0 3px #E8772E; }
.result, .rule, .warn { border-radius: 12px; padding: 10px 12px; font-weight: 700; text-align: center; }
.result, .warn { background: #F2C14E; color: #2A160C; }
.rule { margin-top: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.legend span { display: flex; align-items: center; gap: 4px; background: #FFFFFF; border-radius: 999px; padding: 3px 8px; font-size: 12px; font-weight: 700; }
.legend img { width: 20px; height: 20px; object-fit: contain; }
.table-wrap { overflow-x: auto; background: #FFFFFF; border-radius: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px; text-align: left; border-bottom: 1px solid rgba(42, 22, 12, 0.12); }
th { background: #E8772E; color: #FFFFFF; }
.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 240px; background: #FFFFFF; border-radius: 18px; padding: 12px 8px 8px; }
.col { display: flex; flex-direction: column; align-items: center; height: 100%; gap: 4px; }
.track { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.track i { display: block; width: 100%; background: #E8772E; border-radius: 8px 8px 3px 3px; }
.col.today .track i { background: #F2C14E; box-shadow: inset 0 0 0 2px #2A160C; }
.col span, .col em { font-size: 11px; font-weight: 700; font-style: normal; }
.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.slot { min-height: 92px; padding: 8px; border: 2px dashed rgba(42, 22, 12, 0.28); }
.slot.filled { border-style: solid; border-color: #F2C14E; }
.slot button { margin-top: 6px; border: 0; border-radius: 999px; padding: 4px 8px; background: #E8772E; color: #FFFFFF; font-weight: 700; }
.pin-list { margin-top: 8px; }
.pin-row { width: 100%; display: flex; justify-content: space-between; align-items: center; border: 0; color: inherit; font-weight: 700; padding: 10px 12px; margin-top: 8px; }
.pin-row em { font-style: normal; background: #E8772E; color: #FFFFFF; border-radius: 999px; padding: 2px 8px; }
.pin-row.on em { background: #F2C14E; color: #2A160C; }
.switches { display: grid; gap: 8px; }
.switch { width: 100%; display: flex; gap: 8px; align-items: center; border: 0; color: inherit; text-align: left; padding: 8px; margin-bottom: 8px; }
.switch.on { box-shadow: inset 0 0 0 3px #F2C14E; }
.switch b { background: #E8772E; color: #FFFFFF; border-radius: 999px; padding: 4px 8px; font-size: 12px; }
.switch.on b { background: #F2C14E; color: #2A160C; }
.drafts { display: grid; gap: 8px; margin-bottom: 10px; }
.draft-slot { width: 100%; display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: center; border: 2px solid transparent; color: inherit; text-align: left; padding: 8px; font-weight: 700; }
.draft-slot.on { border-color: #F2C14E; }
.mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.edit-grid { margin-bottom: 8px; }
#splash {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #E8772E url("bg-saffron.jpg") center/cover;
  transition: opacity .4s ease;
}
#splash.hide { opacity: 0; pointer-events: none; }
.splash-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(340px, 92vw);
  padding: 22px 28px 26px;
  border-radius: 28px;
  background: rgba(232, 119, 46, 0.9);
  text-align: center;
}
.splash-card img { width: 120px; height: 120px; border-radius: 28px; }
.splash-card h1 { margin: 0; color: #FFFFFF; font-size: 32px; }
.splash-card p { margin: 0; color: #F2C14E; font-weight: 700; font-size: 18px; }
#onboard {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
  background: #E8772E url("bg-saffron.jpg") center/cover;
}
.on-card {
  width: min(440px, 100%);
  max-height: min(92vh, 780px);
  overflow: auto;
  background: #FFFFFF url("bg-cream.jpg") center/cover;
  border-radius: 24px;
  padding: 16px;
}
.dots { display: flex; gap: 8px; justify-content: center; margin-bottom: 8px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: #FFFFFF; box-shadow: inset 0 0 0 2px #E8772E; }
.dots i.done { background: #E8772E; }
.dots i.now { background: #F2C14E; }
.picks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.pick { border: 3px solid transparent; background: #FFFFFF; border-radius: 16px; padding: 8px; color: inherit; font-weight: 700; }
.pick.on { border-color: #F2C14E; background: #F2C14E; }
.pick img { width: 72px; height: 72px; object-fit: contain; display: block; margin: 0 auto; }
#toast {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%) translateY(10px);
  background: #2A160C;
  color: #F2C14E;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  z-index: 80;
  transition: .2s ease;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .ticker-move, .bloom.is-on .petals { animation: none; }
}
