/* Lantern Scratch — Sakura Nights. Self-contained styles for this game route. */

.game-page {
  --theme: #8e3a63;
  --theme-ink: #fff1f6;
  --theme-tint: #fbeef4;
  --theme-deep: #6d2a4b;
}

/* --- shared game-route shell --- */

.game-head {
  padding: var(--s-8) 0;
  background-image:
    linear-gradient(to bottom, rgba(252, 248, 241, 0.5), rgba(252, 248, 241, 0.92) 70%, var(--ivory)),
    url("/assets/img/bg-aurora-band.webp");
  background-size: cover;
  background-position: center 25%;
  border-bottom: 1px solid var(--line-soft);
}

.game-head__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--s-7);
  align-items: center;
}

.game-head h1 { margin: var(--s-3) 0 var(--s-4); }
.game-head p { max-width: 46ch; margin-bottom: 0; }

.game-head__art {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: var(--frame);
  box-shadow: var(--sink), var(--float);
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: var(--s-7);
  padding: var(--s-7) 0 var(--s-8);
  align-items: start;
}

.stage { min-width: 0; }

.board {
  border: var(--frame);
  border-radius: var(--radius-lg);
  box-shadow: var(--sink), var(--float);
  padding: var(--s-6);
  margin-bottom: var(--s-5);
  background:
    radial-gradient(70% 60% at 50% 0%, rgba(232, 164, 0, 0.16), transparent 70%),
    linear-gradient(180deg, var(--theme-tint), #fffdf8);
}

.result {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  background: var(--surface);
  border: 2px solid var(--line-soft);
  border-radius: var(--radius);
  padding: var(--s-4) var(--s-5);
  margin: 0 0 var(--s-5);
  font-weight: 600;
  color: var(--purple);
}

.result.is-win { border-color: var(--gold); background: var(--gold-tint); }
.result.is-loss { border-color: var(--line); }

.controls {
  background: var(--surface);
  border: var(--frame);
  border-radius: var(--radius);
  box-shadow: var(--sink);
  padding: var(--s-5);
  margin-bottom: var(--s-5);
}

.controls fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 var(--s-5);
}

.controls legend {
  padding: 0;
  margin-bottom: var(--s-3);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--purple);
}

.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }

.chip { position: relative; }

.chip input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  margin: 0;
  cursor: pointer;
}

.chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 var(--s-4);
  border: 2px solid var(--line-soft);
  border-radius: var(--radius-pill);
  color: var(--purple);
  font-weight: 700;
  font-size: 0.95rem;
  background: var(--surface);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.chip input:checked + span { border-color: var(--gold); background: var(--gold-tint); color: var(--gold-ink); }
.chip input:focus-visible + span { outline: 3px solid var(--purple-mid); outline-offset: 2px; }
.chip:hover span { border-color: var(--purple-mid); }

.chips--numbers .chip span { min-width: 52px; font-variant-numeric: tabular-nums; }

.stake-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
}

.stake-field {
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--line-soft);
  border-radius: var(--radius-pill);
  background: var(--surface);
  overflow: hidden;
}

.stake-field button {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--purple);
  font: inherit;
  font-size: 1.3rem;
  font-weight: 800;
  cursor: pointer;
}

.stake-field button:hover { background: var(--purple-soft); }

.stake-field input {
  width: 110px;
  height: 44px;
  border: 0;
  text-align: center;
  font: inherit;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--purple);
  background: transparent;
  -moz-appearance: textfield;
}

.stake-field input::-webkit-outer-spin-button,
.stake-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.actions { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }

.bank {
  background: var(--surface);
  border: var(--frame);
  border-radius: var(--radius);
  box-shadow: var(--sink);
  padding: var(--s-5);
  display: grid;
  gap: var(--s-3);
}

.bank__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}

.bank__balance {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--purple);
  font-variant-numeric: tabular-nums;
}

.bank__label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: block;
}

.bank__note { font-size: 0.85rem; color: var(--ink-soft); margin: 0; }
.bank__topup { font-size: 0.85rem; color: var(--gold-ink); font-weight: 700; margin: 0; }

.side { display: grid; gap: var(--s-5); }

.side section {
  background: var(--surface);
  border: var(--frame);
  border-radius: var(--radius);
  box-shadow: var(--sink);
  padding: var(--s-5);
}

.side h2 { font-size: 1.1rem; margin-bottom: var(--s-3); }
.side p, .side li { font-size: 0.92rem; }
.side p:last-child, .side ol:last-child, .side ul:last-child { margin-bottom: 0; }
.side ol, .side ul { padding-left: var(--s-5); margin-bottom: var(--s-4); }

.paytable { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin: 0; }

.paytable caption {
  caption-side: bottom;
  text-align: left;
  padding-top: var(--s-3);
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.paytable th, .paytable td {
  padding: var(--s-2) var(--s-2);
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.paytable thead th {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.paytable td + td, .paytable th + th { text-align: right; font-variant-numeric: tabular-nums; }
.paytable tbody tr:last-child th, .paytable tbody tr:last-child td { border-bottom: 0; }
.paytable tbody th { font-weight: 700; color: var(--purple); }

.more { padding: 0 0 var(--s-8); }
.more h2 { font-size: 1.25rem; margin-bottom: var(--s-5); }

.more__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--s-5);
}

.more__card {
  display: block;
  border: var(--frame);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--sink);
  color: var(--ink);
  font-weight: 600;
}

.more__card:hover { text-decoration: none; border-color: var(--purple-mid); }
.more__card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.more__card span { display: block; padding: var(--s-3) var(--s-4); color: var(--purple); font-weight: 700; }
.more__card em { display: block; font-style: normal; font-size: 0.85rem; color: var(--ink-soft); font-weight: 400; }

@media (max-width: 940px) {
  .game-layout { grid-template-columns: 1fr; gap: var(--s-6); }
  .game-head__grid { grid-template-columns: 1fr; }
  .game-head__art { order: -1; }
}

/* --- the scratch card itself --- */

.card-frame {
  width: min(420px, 100%);
  margin: 0 auto;
  background: linear-gradient(180deg, #4d2247, var(--theme-deep));
  border: 3px solid rgba(232, 164, 0, 0.75);
  border-radius: var(--radius-lg);
  padding: var(--s-4);
  box-shadow: 0 20px 34px -24px rgba(58, 29, 99, 0.85);
}

.card-frame__title {
  margin: 0 0 var(--s-3);
  color: #ffe6f1;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.panel {
  position: relative;
  aspect-ratio: 1;
  border: 2px solid rgba(232, 164, 0, 0.4);
  border-radius: 14px;
  background: linear-gradient(160deg, #fffdfa, var(--theme-tint));
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  touch-action: none;
}

.panel__symbol {
  display: block;
  width: 64%;
  height: 64%;
}

.panel__symbol svg, .prize-row svg { display: block; width: 100%; height: 100%; }

.panel__cover {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(118deg, #efedf1 0%, #c8c5cd 38%, #f2f0f4 52%, #b8b5be 76%, #dedbe2 100%);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.panel__cover::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 8px;
  border: 1px dashed rgba(109, 42, 75, 0.28);
}

.panel.is-open .panel__cover { opacity: 0; transform: scale(1.08); }
.panel.is-open { cursor: default; }

.panel.is-match {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 3px rgba(232, 164, 0, 0.55);
}

.card-hint {
  margin: var(--s-4) 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.card-frame + .card-hint { color: var(--ink-soft); }
