/* Midas Golden Touch — Greek temple: white marble pillars,
   teal magical light, gold coins, gold-framed reels on dark
   blue. Own CSS, family layout. */
:root {
  --sky: #164e63;
  --wood: #b8860b;
  --wood-deep: #713f12;
  --roof: #0e7490;
  --lawn: #14b8a6;
  --gold: #f2c230;
  --gold-dim: #a8740a;
  --ink: #1c1917;
  --panel: #fffbeb;
  --panel2: #fef3c7;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(180deg, #082f3f 0%, #0e4a5f 40%, #155e75 75%, #0f766e 100%);
  color: var(--ink);
  min-height: 100vh;
}
#app { max-width: 560px; margin: 0 auto; padding: 10px 12px 28px; }
header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: space-between; padding: 6px 2px 10px; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 46px; height: 46px; }
h1 { font-size: 20px; margin: 0; color: #fde68a; text-shadow: 0 1px 0 #00000088, 0 2px 0 #f2c23055; letter-spacing: .3px; }
.sub { font-size: 12px; opacity: .9; color: #a5f3fc; font-weight: 600; }
.head-right { display: flex; align-items: center; gap: 8px; }
.badge { font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: 999px; background: #dcfce7; border: 1px solid #16a34a; color: #14532d; }
.badge.real { background: #fee2e2; border-color: #ef4444; color: #7f1d1d; }
.ghost { background: #fffbeb; color: var(--ink); border: 1px solid #b4530988; border-radius: 10px; padding: 7px 12px; cursor: pointer; font-weight: 700; }
.ghost.on { background: #fde68a; border-color: var(--gold-dim); }
.card, .stage-card {
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border: 1px solid #b4530955;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 10px 24px #00000055;
}
.stage-card { position: relative; }
.roof {
  text-align: center; font-weight: 900; letter-spacing: 1px; color: #fff;
  background: linear-gradient(180deg, #f8fafc, #cbd5e1);
  color: #713f12;
  border-radius: 10px 10px 4px 4px; padding: 6px 10px; margin: -4px -4px 10px;
  box-shadow: 0 3px 0 #64748b;
}
.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 12px;
  border-radius: 6px 6px 14px 14px;
  background: linear-gradient(180deg, #172554, #1e3a8a);
  border: 6px solid var(--gold-dim);
  outline: 2px solid var(--gold);
  box-shadow: inset 0 0 0 2px #451a03, inset 0 0 34px #00000044;
  position: relative;
}
/* Anticipation light-beam on the final reel. */
.grid.beam::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: 4px; width: 20%;
  background: linear-gradient(90deg, transparent, #fef08a99, transparent);
  animation: beamPulse .5s ease-in-out infinite alternate; pointer-events: none;
}
@keyframes beamPulse { from { opacity: .35; } to { opacity: 1; } }
.cell {
  position: relative; aspect-ratio: 1; border-radius: 10px; overflow: visible;
  background: #fef9c3; border: 2px solid #78350f66;
  display: flex; align-items: center; justify-content: center;
}
.cell .tile-glyph svg { width: 100%; height: 100%; display: block; border-radius: 8px; }
.cell.win { outline: 3px solid #ec4899; box-shadow: 0 0 0 2px #fff, 0 0 16px #ec4899; animation: bounce .5s ease infinite alternate; z-index: 2; }
.cell.dim { opacity: .45; }
.cell.sticky { outline: 3px solid var(--gold); box-shadow: 0 0 12px #f2c230; }
.cell.fresh { animation: bounce .45s ease 3; }
@keyframes bounce { from { transform: scale(1); } to { transform: scale(1.07); } }
.mul-badge {
  position: absolute; right: -4px; bottom: -4px; z-index: 3;
  background: var(--gold); color: #451a03; border: 2px solid #fff;
  font-size: 12px; font-weight: 900; border-radius: 999px; padding: 1px 6px;
  box-shadow: 0 2px 6px #0006;
}
.win-banner {
  position: absolute; left: 50%; bottom: 74px; transform: translateX(-50%);
  background: #fef08e; border: 3px solid var(--gold); color: #713f12;
  border-radius: 14px; padding: 8px 22px; text-align: center; z-index: 5;
  box-shadow: 0 8px 24px #0005; font-weight: 900;
}
.win-banner .wb-label { font-size: 13px; letter-spacing: 1px; }
.win-banner div:last-child { font-size: 24px; }
.hidden { display: none !important; }
.bigwin-overlay {
  position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column;
  align-items: center; justify-content: center; background: #451a03cc; border-radius: 16px;
}
.bw-title { font-size: 40px; font-weight: 900; color: var(--gold); text-shadow: 0 0 22px #f59e0b; letter-spacing: 2px; }
.bw-title.tier-mega { font-size: 48px; color: #f9a8d4; text-shadow: 0 0 26px #ec4899, 0 3px 0 #7c2d12; }
.bw-title.tier-epic { font-size: 56px; color: var(--gold); text-shadow: 0 0 34px #f2c230, 0 0 12px #f59e0b, 0 3px 0 #7c2d12; }
.bw-amt { font-size: 30px; font-weight: 900; color: #fff; }
.picker-overlay {
  position: absolute; inset: 0; z-index: 7; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  background: #14532dd9; border-radius: 16px; padding: 16px;
}
.picker-title { font-size: 20px; font-weight: 900; color: #fef08a; text-align: center; }
.picker-grid { display: grid; grid-template-columns: repeat(3, 64px); gap: 8px; }
.picker-cell {
  width: 64px; height: 64px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: #fef9c3; border: 3px solid var(--gold); font-size: 28px; font-weight: 900; color: #7f1d1d;
}
.picker-cell.spinning { animation: pickerShake .18s linear infinite; color: #a8740a; }
.picker-cell.revealed { animation: bounce .4s ease 2; background: #fef08a; }
@keyframes pickerShake { 0% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) scale(1.05); } 100% { transform: rotate(-3deg); } }
.picker-total { font-size: 18px; font-weight: 900; color: #fff; min-height: 24px; }
.picker-btn, .continue-btn {
  background: var(--gold); color: #451a03; border: 0; border-radius: 999px;
  font-size: 17px; font-weight: 900; padding: 12px 30px; cursor: pointer;
  box-shadow: 0 4px 0 var(--gold-dim);
}
.picker-btn:disabled { opacity: .5; }
.continue-overlay {
  position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; background: #14532dbb; border-radius: 16px;
}
.continue-text { font-size: 22px; font-weight: 900; color: #fef08a; text-align: center; padding: 0 12px; }
.orb-tray { min-height: 22px; text-align: center; font-weight: 800; color: #14532d; padding-top: 8px; font-size: 14px; }
.bottom-bar { display: flex; justify-content: space-between; gap: 8px; padding-top: 8px; }
.bb-item { display: flex; flex-direction: column; align-items: center; font-weight: 800; }
.bb-label { font-size: 11px; opacity: .7; font-weight: 700; }
.controls .bet-row { display: flex; flex-direction: column; gap: 8px; }
.controls label { font-weight: 800; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 2px solid #b45309; background: #fff; border-radius: 999px; padding: 6px 14px; font-weight: 800; cursor: pointer; }
.chip.on { background: var(--gold); }
.bet-input { display: flex; gap: 6px; align-items: center; }
.bet-input button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid #b45309; background: #fff; font-size: 18px; font-weight: 900; cursor: pointer; }
.bet-input input { flex: 1; padding: 9px; border-radius: 10px; border: 1px solid #b45309; font-size: 16px; font-weight: 800; text-align: center; }
.spin-btn {
  width: 100%; margin-top: 12px; padding: 15px; border: 0; border-radius: 999px;
  background: linear-gradient(180deg, #ef4444, var(--roof)); color: #fff;
  font-size: 20px; font-weight: 900; letter-spacing: 1px; cursor: pointer;
  box-shadow: 0 5px 0 #7f1d1d;
}
.spin-btn:disabled { opacity: .55; }
.quick-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.msg { min-height: 22px; text-align: center; font-weight: 800; padding-top: 10px; color: #14532d; }
.msg.err { color: #b91c1c; }
.paytable .prow { padding: 6px 0; border-bottom: 1px dashed #b4530955; font-size: 14px; }
.note { font-size: 13px; line-height: 1.55; opacity: .9; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed #b4530944; font-size: 14px; font-weight: 600; }
.history .win { color: #15803d; font-weight: 900; }
.fair-grid { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.fair-grid code { word-break: break-all; background: #fff; padding: 2px 6px; border-radius: 6px; border: 1px solid #b4530944; }
.seed-edit { display: flex; gap: 6px; }
.seed-edit input { flex: 1; padding: 7px; border-radius: 8px; border: 1px solid #b45309; }
.fair-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.fair-actions input { padding: 7px; border-radius: 8px; border: 1px solid #b45309; width: 110px; }
.verify-out { white-space: pre-wrap; font-size: 11px; max-height: 220px; overflow: auto; }
footer { text-align: center; font-size: 12px; font-weight: 700; color: #14532d; padding: 6px; }

/* Midas additions: reel row + golden-hand multiplier indicator */
.reel-row { display: flex; gap: 8px; align-items: stretch; }
.reel-row .grid { flex: 1; }
.mult-hand {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 58px; border-radius: 12px; padding: 8px 4px;
  background: linear-gradient(180deg, #fef3c7, #f2c230);
  border: 2px solid #a8740a; color: #713f12; font-size: 22px; font-weight: 900;
  box-shadow: 0 4px 14px #00000044;
}
.mult-hand #multHand { font-size: 20px; }
.picker-grid { grid-template-columns: repeat(3, 1fr); }

/* Compact short-viewport layout (finish-prep, doghouse pattern):
   at 360x640 the shipped layout cut SPIN off (602-656) and pushed
   the quick row below the fold (666-737). Tighten header, stage
   and controls on short screens only; desktop unchanged. */
@media (max-height: 700px) {
  #app { padding: 6px 10px 16px; }
  header { flex-wrap: nowrap; padding: 2px 0 6px; gap: 6px; }
  .brand { gap: 7px; min-width: 0; }
  .logo { width: 34px; height: 34px; }
  h1 { font-size: 17px; }
  .sub { font-size: 10.5px; line-height: 1.25; }
  .head-right { gap: 5px; flex-shrink: 0; }
  .card, .stage-card { padding: 10px; margin-bottom: 8px; }
  .roof { padding: 4px 8px; margin: -2px -2px 6px; }
  .grid { padding: 8px; gap: 5px; }
  .orb-tray { min-height: 17px; padding-top: 4px; font-size: 12.5px; }
  .bottom-bar { padding-top: 4px; }
  .controls .bet-row { gap: 5px; }
  .chip { padding: 4px 10px; }
  .bet-input button { width: 32px; height: 32px; }
  .bet-input input { padding: 6px; }
  .spin-btn { margin-top: 8px; padding: 11px; font-size: 17px; }
  .quick-row { margin-top: 7px; gap: 6px; }
  .quick-row .ghost, .controls .ghost { padding: 5px 9px; }
  .msg { min-height: 18px; padding-top: 6px; }
}
