/* Raw Pup — layout of the game page. Colours, fonts, buttons, pills and the slider come from ../styles.css. */
html, body.play { height: 100%; overflow: hidden; overscroll-behavior: none; }
body.play { background-color: var(--lime-mist); touch-action: manipulation; }
[hidden] { display: none !important; }
.game { height: 100dvh; display: grid; grid-template-rows: minmax(0, 54fr) minmax(0, 46fr); transition: grid-template-rows 0.35s var(--ease-out); }
.game.roomy { grid-template-rows: minmax(0, 36fr) minmax(0, 64fr); }
.game.roomy .stats { display: none; }   /* screens with a lot to read or choose: setup and the result */
.stage { position: relative; min-height: 0; background: radial-gradient(120% 90% at 50% 100%, var(--lime-soft), transparent 70%); }
#stage { width: 100%; height: 100%; display: block; touch-action: none; cursor: pointer; }

.hud { position: absolute; inset: calc(10px + env(safe-area-inset-top)) 12px auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-btn { border: 0; background: #fff; color: var(--navy); font: 700 0.95rem var(--display); text-decoration: none; padding: 9px 14px; border-radius: 999px; box-shadow: var(--shadow-soft); min-height: 40px; display: inline-flex; align-items: center; }
.hud-btn.back span { color: var(--lime-deep); }
.meter { position: absolute; left: 12px; right: 12px; top: calc(60px + env(safe-area-inset-top)); display: flex; align-items: center; gap: 8px; font: 700 0.78rem var(--body); color: var(--navy); }
.meter .bar { flex: 1; height: 12px; background: linear-gradient(90deg, #D8B48A, #C9C36A); }
.meter .bar i { background: linear-gradient(90deg, #C3B94A, var(--lime)); }
.bar { border-radius: 999px; background: rgba(14, 59, 106, 0.12); overflow: hidden; height: 7px; }
.bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--lime); transition: width 0.6s var(--ease-out); }
.stats { position: absolute; left: 12px; right: 12px; top: calc(84px + env(safe-area-inset-top)); display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; font: 700 0.66rem var(--body); color: var(--navy); }
.stats .bar { margin-top: 2px; }
.bubble { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); max-width: min(86%, 420px); background: #fff; color: var(--navy-ink); font: 600 0.92rem/1.35 var(--body); padding: 10px 16px; border-radius: 18px; box-shadow: var(--shadow-soft); text-align: center; animation: pop 0.35s var(--ease-bounce); z-index: 2; }
@keyframes pop { from { transform: translateX(-50%) scale(0.6); opacity: 0; } }

.sheet { min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; background: #fff; border-radius: 28px 28px 0 0; box-shadow: 0 -14px 40px -22px rgba(11, 44, 82, 0.45); padding: 20px 20px calc(22px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.sheet > * { flex-shrink: 0; }
.sheet h1 { font-size: clamp(2.6rem, 11vw, 3.6rem); }
.sheet h2 { font-size: clamp(1.4rem, 5.4vw, 1.9rem); line-height: 1.12; }
.sheet .lead { font-size: 1rem; }
.sheet .btn { width: 100%; justify-content: center; text-align: center; }
.sheet .btn.wa { font-size: 1rem; padding: 16px 18px; }
.row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-top: 4px; }
.fine { font-size: 0.86rem; color: var(--muted); }
.fine a { color: var(--navy); font-weight: 700; }
.field { display: grid; gap: 6px; font: 700 0.82rem var(--body); color: var(--navy); }
.field input:not(.range) { border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 11px 14px; font: 600 1rem var(--body); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 13px; font: 700 0.85rem var(--body); color: var(--navy); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.swatches { display: flex; flex-wrap: wrap; gap: 9px; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); }
.sheet .range { background: linear-gradient(90deg, var(--lime) var(--fill, 20%), var(--lime-soft) var(--fill, 20%)); margin: 10px 0 4px; }
.opts { display: grid; gap: 9px; }
.opt { border: 2px solid var(--line); background: #fff; border-radius: var(--radius-sm); padding: 13px 16px; font: 700 0.98rem var(--body); color: var(--navy); text-align: left; transition: transform 0.2s var(--ease-bounce), background 0.2s; }
.opt:active { transform: scale(0.97); }
.opt.yes { background: var(--lime-soft); border-color: var(--lime); opacity: 1; }
.opt.no { background: #FDE9E4; border-color: var(--danger); animation: shake 0.3s; }
.opt:disabled:not(.yes):not(.no) { opacity: 0.45; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.learn { background: var(--lime-mist); border-left: 5px solid var(--lime); border-radius: 12px; padding: 11px 14px; font: 600 0.93rem/1.4 var(--body); color: var(--navy-ink); }
.learn.no { background: #FDE9E4; border-color: var(--danger); }
.mixrow { display: flex; justify-content: space-between; gap: 10px; font: 600 0.92rem var(--body); color: var(--muted); }
.mixrow b { color: var(--navy); }
.scale { position: relative; height: 34px; border-radius: 999px; background: var(--sky); margin-top: 6px; }
.scale .zone { position: absolute; top: 0; bottom: 0; background: var(--lime); border-radius: 8px; }
.scale .needle { position: absolute; top: -7px; bottom: -7px; width: 6px; margin-left: -3px; background: var(--navy); border-radius: 4px; }
.scale-read { display: flex; align-items: baseline; gap: 12px; font-size: 0.86rem; color: var(--muted); }
.scale-read b { font: 600 1.7rem var(--display); color: var(--navy); min-width: 4.6ch; white-space: nowrap; }
.cards { display: grid; gap: 8px; }
.card { background: var(--navy); color: #fff; border-radius: var(--radius-sm); padding: 12px 16px; animation: pop2 0.45s var(--ease-bounce) both; }
.card small { display: block; color: var(--gold); font: 800 0.7rem var(--body); letter-spacing: 0.12em; text-transform: uppercase; }
.card b { font: 600 1.08rem var(--display); }
@keyframes pop2 { from { transform: scale(0.7); opacity: 0; } }
.stars { color: var(--gold); white-space: nowrap; } .stars i { color: var(--line); font-style: normal; }
.order { background: var(--lime-mist); border-radius: var(--radius-sm); padding: 12px 16px; display: grid; gap: 2px; color: var(--navy-ink); }
.order small { color: var(--lime-deep); font: 800 0.72rem var(--body); letter-spacing: 0.1em; text-transform: uppercase; }
.order b { font: 600 1.15rem var(--display); color: var(--navy); }
.order s { color: var(--muted); } .order em { font-style: normal; font-weight: 800; color: var(--navy); }

/* end-of-game confetti: a few dots falling, pure CSS */
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; opacity: 0; }
.party .confetti { opacity: 1; background-image: radial-gradient(circle, var(--gold) 5px, transparent 6px), radial-gradient(circle, var(--navy) 5px, transparent 6px), radial-gradient(circle, #fff 5px, transparent 6px), radial-gradient(circle, var(--lime-deep) 6px, transparent 7px);
  background-size: 97px 131px, 143px 173px, 113px 149px, 167px 197px; animation: fall 1.6s linear infinite; }
@keyframes fall { from { background-position: 0 -131px, 40px -173px, 80px -149px, 20px -197px; } to { background-position: 0 0, 40px 0, 80px 0, 20px 0; } }

@media (min-width: 900px), (orientation: landscape) and (max-height: 520px) {      /* wide screens and phones held sideways: pup left, text right */
  .game, .game.roomy { grid-template-rows: none; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); }
  .sheet { border-radius: 0; padding: 40px 36px; justify-content: center; box-shadow: -14px 0 40px -22px rgba(11, 44, 82, 0.45); }
  .meter, .stats { left: 24px; right: auto; width: 420px; }
  .stats { font-size: 0.74rem; }
}
@media (prefers-reduced-motion: reduce) { .party .confetti, .bubble, .card, .opt.no { animation: none; } }
