/* Shared by hoot.html ("Which Hoot are you?", the shop) and trivia.html (gin trivia, the bar).
   Each page sets its own colours on body; everything here uses them. */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: Inter, Arial, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; min-height: 100dvh; overflow-x: hidden; }
main { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; padding: 22px 16px calc(40px + env(safe-area-inset-bottom)); }
h1, h2 { font-family: var(--display); font-weight: 400; }
h1 { font-size: 46px; line-height: .98; margin: 10px 0 12px; }
h2 { font-size: 28px; line-height: 1.12; margin: 6px 0 18px; }
p { line-height: 1.5; color: var(--soft); }
.kicker { font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.center { text-align: center; }
.small { font-size: 13px; color: var(--muted); line-height: 1.45; margin-top: 12px; }
.small a { color: inherit; }
.hide { display: none !important; }

/* Buttons and fields */
.btn { display: block; width: 100%; border: 0; border-radius: 16px; padding: 18px; font: 800 18px Inter, Arial, sans-serif; background: var(--accent); color: var(--on-accent); cursor: pointer; text-align: center; text-decoration: none; margin-top: 12px; box-shadow: 0 6px 0 var(--accent-deep); transition: transform .08s ease, box-shadow .08s ease; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--accent-deep); }
.btn.ghost { background: var(--tile); color: var(--text); box-shadow: 0 4px 0 var(--line); }
.btn:disabled { opacity: .5; }
.btn.begin { font-size: 22px; padding: 20px; margin-top: 22px; animation: nudge 2.6s ease-in-out 1.2s infinite; }
.fields { margin-top: 18px; padding: 16px; border-radius: 18px; background: var(--tile); border: 2px solid var(--line); }
label.field { display: block; font-weight: 700; font-size: 14px; }
label.field span { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email] { width: 100%; margin-top: 8px; padding: 15px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--input); color: var(--text); font: 600 17px Inter, Arial, sans-serif; }
input:focus { outline: none; border-color: var(--accent); }
.check { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; font-size: 15px; line-height: 1.4; color: var(--soft); }
.check input { width: 22px; height: 22px; flex: none; accent-color: var(--accent); margin-top: 1px; }
.err { background: var(--err-bg); color: var(--err); border-radius: 12px; padding: 12px 14px; margin-top: 14px; font-size: 15px; animation: shake .4s ease; }

/* Top bar during play: progress + Cancel */
.playbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; min-height: 40px; }
.playbar .grow { flex: 1; min-width: 0; }
.cancel { border: 2px solid var(--line); background: var(--tile); color: var(--text); border-radius: 999px; padding: 8px 14px; font: 700 14px Inter, Arial, sans-serif; cursor: pointer; flex: none; }
.dots { display: flex; gap: 6px; }
.dots i { flex: 1; height: 8px; border-radius: 99px; background: var(--line); transition: background .3s ease; }
.dots i.done { background: var(--accent); }
.dots i.now { background: var(--accent); opacity: .45; animation: pulse 1s ease-in-out infinite; }

/* Answer tiles */
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opts.list { grid-template-columns: 1fr; }
.opts:not(.list) .opt:last-child:nth-child(odd) { grid-column: span 2; min-height: 76px; }
.opt { position: relative; background: var(--tile); border: 2px solid var(--line); color: var(--text); border-radius: 18px; padding: 16px 12px; font: 600 16px Inter, Arial, sans-serif; cursor: pointer; min-height: 104px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; line-height: 1.3;
  animation: pop .45s cubic-bezier(.2, 1.4, .4, 1) both; animation-delay: calc(var(--d, 0) * 60ms); -webkit-tap-highlight-color: transparent; transition: transform .12s ease, opacity .25s ease, border-color .15s ease; }
.opts.list .opt { min-height: 0; flex-direction: row; justify-content: flex-start; text-align: left; padding: 17px 16px; font-size: 17px; }
.opt .e { font-size: 38px; line-height: 1; transition: transform .2s ease; }
.opt:active { transform: scale(.96); }
.opt.on { border-color: var(--accent); background: var(--picked); animation: picked .35s ease both; }
.opt.on .e { transform: scale(1.25) rotate(-8deg); }
.opts.chosen .opt:not(.on) { opacity: .35; }
.letter { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: var(--line); color: var(--text); margin-right: 6px; }
.view { animation: slidein .35s ease both; }
.qimg { width: 100%; border-radius: 16px; margin-bottom: 14px; max-height: 220px; object-fit: cover; }

/* Results */
.result { text-align: center; padding: 26px 18px 22px; border-radius: 24px; background: var(--result-bg); border: 2px solid var(--line); position: relative; overflow: hidden; }
.result .big { font-size: 96px; line-height: 1; display: inline-block; animation: bounce-in .8s cubic-bezier(.2, 1.6, .4, 1) both .15s; }
.result h1 { animation: rise .5s ease both .45s; }
.result p { animation: rise .5s ease both .6s; }
.product { display: flex; gap: 14px; align-items: center; background: #FFF8F1; color: #1F2623; border-radius: 18px; padding: 12px; margin-top: 18px; text-decoration: none; text-align: left; animation: rise .5s ease both .8s; box-shadow: 0 10px 30px rgba(0, 0, 0, .12); }
.product img { width: 78px; height: 100px; object-fit: contain; flex: none; animation: wobble 3s ease-in-out 1.5s infinite; transform-origin: 50% 90%; }
.product b { display: block; font-size: 16px; }
.product span { font-size: 14px; color: #9D572C; font-weight: 700; }
.product .go { margin-left: auto; font-size: 22px; color: #9D572C; }
.card { margin-top: 20px; padding: 20px 18px; border-radius: 20px; background: var(--tile); border: 2px solid var(--line); animation: rise .5s ease both 1s; }
.code { font: 800 30px/1 ui-monospace, Menlo, monospace; letter-spacing: .06em; background: #FFF8F1; color: #1F2623; padding: 18px; border-radius: 14px; text-align: center; margin: 14px 0 8px; word-break: break-all; animation: bounce-in .6s cubic-bezier(.2, 1.6, .4, 1) both; border: 3px dashed var(--accent); }

/* Cancel sheet */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .45); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease both; }
.sheet > div { width: 100%; max-width: 520px; background: var(--bg); color: var(--text); border-radius: 24px 24px 0 0; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); animation: up .25s ease both; }

/* Confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.confetti i { position: absolute; top: -20px; left: var(--x); width: 10px; height: 14px; background: var(--c); border-radius: 2px; transform: rotate(var(--r)); animation: fall var(--t) cubic-bezier(.3, .6, .5, 1) var(--w) both; }

/* Floating background bits */
.floaters { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.floaters span { position: absolute; bottom: -60px; left: var(--x); font-size: var(--s); opacity: .5; animation: drift var(--t) linear var(--w) infinite; }

@keyframes pop { from { opacity: 0; transform: scale(.7) translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes picked { 0% { transform: scale(1); } 40% { transform: scale(1.07); } 100% { transform: scale(1.02); } }
@keyframes slidein { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes bounce-in { 0% { opacity: 0; transform: scale(.2) rotate(-25deg); } 70% { transform: scale(1.15) rotate(6deg); } 100% { opacity: 1; transform: none; } }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-5deg); } 75% { transform: rotate(5deg); } }
@keyframes nudge { 0%, 88%, 100% { transform: none; } 92% { transform: translateY(-4px) scale(1.02); } 96% { transform: translateY(1px); } }
@keyframes pulse { 50% { opacity: 1; } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fall { 0% { opacity: 1; transform: translate(0, 0) rotate(var(--r)); } 100% { opacity: .9; transform: translate(var(--dx), 110vh) rotate(calc(var(--r) + 720deg)); } }
@keyframes drift { 0% { transform: translateY(0) rotate(0); opacity: 0; } 10% { opacity: .16; } 90% { opacity: .16; } 100% { transform: translateY(-115vh) rotate(200deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; } .floaters { display: none; } }

/* Our logo, as drawn — only its eyes blink, and it floats a little. Tap it for a hop. */
.logo { width: 200px; margin: 0 auto; animation: hover 5s ease-in-out infinite; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.logo.hero { width: 230px; }
.logo svg { display: block; width: 100%; height: auto; }
.logo .eye { transform-box: fill-box; transform-origin: 50% 50%; animation: blink 4.5s infinite; }
.logo.dark .st0 { fill: #FFF8F1; }
.logo.hop { animation: hop .6s ease; }
@keyframes hover { 50% { transform: translateY(-6px); } }
@keyframes blink { 0%, 90%, 100% { transform: scaleY(1); } 93% { transform: scaleY(.1); } 96% { transform: scaleY(1); } }
@keyframes hop { 40% { transform: translateY(-16px) rotate(-3deg); } 70% { transform: translateY(2px); } }

/* The code to scan at the till */
.scan { width: 220px; margin: 14px auto 4px; background: #fff; padding: 12px; border-radius: 16px; animation: bounce-in .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.scan svg { display: block; width: 100%; height: auto; }
