:root {
  --felt: #042616;
  --felt-2: #0b4a2c;
  --felt-3: #083422;
  --gold: #f0c14a;
  --gold-2: #fff1c2;
  --gold-deep: #a87408;
  --red: #d31f26;
  --violet: #b06cff;
  --cream: #f7f3e6;
  --dim: #d9cba8;
  --line: rgba(240, 193, 74, 0.78);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(900px 320px at 50% -8%, rgba(240, 193, 74, 0.16), transparent 60%),
    var(--felt);
  color: var(--cream);
  font-family: "Noto Sans Bengali", "Noto Sans", "Hind Siliguri", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

img, canvas, svg { max-width: 100%; }

button { font-family: inherit; touch-action: manipulation; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.shell {
  width: min(640px, 100%);
  margin: 0 auto;
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

.mast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 0;
}

.lockup {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.omg {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: #0b7a3b;
  color: #fff;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 18px;
  letter-spacing: -0.04em;
  border-radius: 8px;
  padding: 4px 7px 2px 6px;
  line-height: 1;
}

.omg i {
  width: 12px;
  height: 12px;
  margin-right: 1px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #e23b32 0 58%, transparent 60%),
    #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.bd {
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 22px;
  line-height: 1;
  background: linear-gradient(#fff6d0, #f0c14a 42%, #a87408);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.titles {
  min-width: 0;
  flex: 1;
}

.titles p, .kicker {
  margin: 0;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.titles strong {
  display: block;
  font-size: clamp(15px, 4.4vw, 22px);
  line-height: 1.2;
}

.mute {
  flex: none;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold-2);
  border-radius: 999px;
  min-height: 36px;
  padding: 0 10px;
  font-size: 12px;
}

.lamps {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 18px 0;
}

.lamps i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
  animation: pulse 1.8s ease-in-out infinite;
}

.lamps i:nth-child(odd) {
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  animation-delay: 0.45s;
}

@keyframes pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.rail {
  display: flex;
  gap: 4px;
  margin: 10px 10px 0;
  padding: 8px 6px 8px;
  background:
    linear-gradient(180deg, rgba(255, 241, 194, 0.08), transparent 30%),
    linear-gradient(#0e5a36, #06351f);
  border: 1px solid var(--gold);
  border-radius: 26px;
  box-shadow:
    inset 0 0 0 3px rgba(4, 38, 22, 0.85),
    0 12px 24px rgba(0, 0, 0, 0.35);
}

.chip {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 2px 0 0;
  border: 0;
  background: transparent;
  color: var(--cream);
}

.disc {
  width: clamp(40px, 11vw, 54px);
  height: clamp(40px, 11vw, 54px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #3a2504;
  font-weight: 800;
  background: radial-gradient(circle at 35% 28%, #fff6d0 0 10%, #f3d78a 22%, #e0b03a 52%, #8a6414 80%);
  box-shadow:
    0 0 0 2px #042616,
    0 0 0 4px #d7b25a,
    inset 0 0 0 5px rgba(211, 31, 38, 0.92);
}

.chip.on .disc {
  box-shadow:
    0 0 0 2px #042616,
    0 0 0 4px #f0c14a,
    0 0 14px 3px rgba(176, 108, 255, 0.85),
    inset 0 0 0 5px rgba(211, 31, 38, 1);
  transform: translateY(-2px);
}

.cap {
  width: 100%;
  font-size: clamp(10px, 2.8vw, 13px);
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel { display: none; }
.panel.on { display: block; }

.sheet {
  position: relative;
  margin: 12px 10px;
  padding: 14px 12px 16px;
  background:
    linear-gradient(180deg, rgba(240, 193, 74, 0.16), transparent 46px),
    linear-gradient(165deg, #0d5232, #062818 46%, #03180f);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 244, 210, 0.2),
    inset 0 0 0 4px rgba(4, 38, 22, 0.55),
    0 16px 28px rgba(0, 0, 0, 0.32);
  overflow: hidden;
}

.sheet h1, .sheet h2, .sheet h3 { margin: 0 0 8px; line-height: 1.3; }
.sheet h1 { font-size: clamp(22px, 6vw, 30px); }
.sheet h2 { font-size: clamp(20px, 5.4vw, 28px); }
.sheet h3 { font-size: 18px; }
.sheet p { margin: 0 0 10px; }
.lead { color: var(--dim); }

.play { padding-bottom: 14px; }

.hud { display: flex; flex-direction: column; gap: 8px; }

.meters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.meters div {
  min-width: 0;
  padding: 6px 4px;
  text-align: center;
  background: rgba(3, 20, 12, 0.45);
  border: 1px solid rgba(240, 193, 74, 0.35);
  border-radius: 12px;
}

.meters span, .phase {
  display: block;
  color: var(--gold);
  font-size: 11px;
  line-height: 1.2;
}

.meters strong {
  display: block;
  margin-top: 2px;
  font-size: clamp(13px, 3.4vw, 16px);
  overflow-wrap: anywhere;
}

.phase {
  margin: 8px 0 0;
  text-align: center;
}

.picks {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.pick {
  flex: 1 1 0;
  min-width: 0;
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(240, 193, 74, 0.5);
  background: #06351f;
  color: var(--cream);
  font-weight: 700;
}

.pick.on {
  background: linear-gradient(#fff1c2, #f0c14a);
  color: #1a1404;
  border-color: #fff6d2;
}

.pick.shut { opacity: 0.4; }

.stage {
  width: min(100%, 460px);
  margin: 10px auto 0;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  background: #02140c;
  box-shadow: inset 0 0 0 2px rgba(240, 193, 74, 0.45);
}

.note {
  min-height: 1.6em;
  margin: 8px 0;
  text-align: center;
  color: var(--gold-2);
}

.pad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 460px);
  margin: 0 auto;
}

.pad button, .solid, .ghost {
  min-height: 48px;
  border-radius: 14px;
  font-weight: 700;
}

.pad button {
  background: linear-gradient(#126b40, #083822);
  color: var(--cream);
  border: 1px solid var(--gold);
}

.pad b {
  display: block;
  color: var(--gold);
  font-size: 18px;
  line-height: 1;
}

.pad span { font-size: 12px; }

.solid, .ghost {
  border-radius: 999px;
  padding: 10px 16px;
}

.solid {
  color: #1a1404;
  background: linear-gradient(#fff1c2, #f0c14a 46%, #c4922a);
  border: 1px solid #fff6d2;
  box-shadow: inset 0 -3px 0 rgba(120, 70, 10, 0.35);
  max-width: 100%;
}

.temple .solid { width: 100%; }

.ghost {
  color: var(--cream);
  background: transparent;
  border: 1px solid var(--gold);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  color: var(--dim);
  font-size: 13px;
}

.legend li { display: flex; align-items: center; gap: 6px; }

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.swatch.violet { background: var(--violet); }
.swatch.amber { background: var(--gold); }
.swatch.green { background: #3dffb0; }
.swatch.stone { background: #6e624c; border-radius: 3px; }
.swatch.seal { background: var(--red); }
.swatch.moon { background: #d5dcc8; }

.help { margin-top: 12px; }
.help summary { cursor: pointer; color: var(--gold); }
.help ol { margin: 8px 0 0; padding-left: 18px; }
.help li { margin: 0 0 6px; }

.veil {
  position: fixed;
  z-index: 6;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100% - 28px));
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 20px 16px;
  background: rgba(3, 18, 12, 0.96);
  border: 1px solid var(--gold);
  border-radius: 18px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

.veil[hidden] { display: none; }

.stars {
  letter-spacing: 0.4em;
  color: var(--gold);
  font-size: 22px;
}

.veil-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.temple, .gear, .split {
  display: grid;
  gap: 10px;
}

.temple img, .gear img, .hero-copy img, .split img, .sheet > img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.status { color: var(--gold); font-size: 14px; }

.seal-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.seal-list li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(240, 193, 74, 0.25);
}

.seal-list span { overflow-wrap: anywhere; }

.seal-list span, .seal-list strong {
  min-width: 0;
}

.seal-list strong {
  flex: none;
  color: var(--gold-2);
  font-size: 14px;
}

.wipe { margin-top: 12px; }

@media (min-width: 520px) {
  .temple, .gear, .split {
    grid-template-columns: 168px minmax(0, 1fr);
    align-items: center;
  }
  .temple img, .gear img, .split img {
    aspect-ratio: 1;
    height: 100%;
  }
}

@media (max-width: 360px) {
  .mast { padding-left: 8px; padding-right: 8px; }
  .sheet { margin-left: 8px; margin-right: 8px; padding: 12px 10px; }
  .rail { margin-left: 8px; margin-right: 8px; }
  .meters { gap: 4px; }
  .pad { gap: 6px; }
  .omg { font-size: 15px; }
  .bd { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .lamps i { animation: none; }
}
