/* Between Us: deep, rotating colour themes (set by app.js as --a, --b, --glow, --acc), big serif type, one card. */
:root { --a: #3b0a45; --b: #14031c; --glow: #8e2a8e; --acc: #f1c27d; --ink: #fbf3ec; --serif: "Playfair Display", Georgia, serif; --sans: Inter, system-ui, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; color: var(--ink); font-family: var(--sans); background: var(--b); -webkit-tap-highlight-color: transparent; }
body { min-height: 100dvh; overflow-x: hidden;
  background: radial-gradient(120% 80% at 20% 10%, var(--glow) 0%, transparent 55%), radial-gradient(90% 70% at 85% 90%, var(--a) 0%, transparent 60%), linear-gradient(160deg, var(--a), var(--b));
  background-size: 160% 160%, 160% 160%, 100% 100%; animation: drift 24s ease-in-out infinite alternate;
  transition: background-color 1.2s ease; }
/* colours glide between cards */
@property --a { syntax: "<color>"; inherits: true; initial-value: #3b0a45; }
@property --b { syntax: "<color>"; inherits: true; initial-value: #14031c; }
@property --glow { syntax: "<color>"; inherits: true; initial-value: #8e2a8e; }
@property --acc { syntax: "<color>"; inherits: true; initial-value: #f1c27d; }
:root { transition: --a 1.4s ease, --b 1.4s ease, --glow 1.4s ease, --acc 1.4s ease; }
@keyframes drift { from { background-position: 0% 0%, 100% 100%, 0 0; } to { background-position: 100% 60%, 0% 40%, 0 0; } }
button, select { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.stage { min-height: 100dvh; display: flex; flex-direction: column; padding: calc(14px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom)); max-width: 980px; margin: 0 auto; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { font-family: var(--serif);  font-weight: 600; font-size: clamp(44px, 8vw, 64px); color: var(--acc); letter-spacing: .01em; text-shadow: 0 2px 30px rgba(0,0,0,.35); }
.logo.small { font-size: clamp(26px, 4vw, 34px); }
.catpick select { appearance: none; -webkit-appearance: none; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.22); border-radius: 99px; padding: 10px 36px 10px 16px; font-size: 15px; font-weight: 600; min-height: 44px; max-width: 58vw;
  background-image: linear-gradient(45deg, transparent 50%, var(--acc) 50%), linear-gradient(135deg, var(--acc) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.catpick option { color: #1a0a14; }

/* the card */
.table { flex: 1; display: flex; align-items: center; justify-content: center; padding: 12px 0; perspective: 1600px; }
.card { position: relative; width: min(100%, 600px); aspect-ratio: 3 / 4; max-height: 74dvh; cursor: pointer; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.2, .8, .2, 1); animation: deal .55s cubic-bezier(.2, .8, .2, 1); }
@media (min-width: 900px) { .card { aspect-ratio: 4 / 3; width: min(100%, 760px); } }
.card.flipped { transform: rotateY(180deg); }
@keyframes deal { from { opacity: 0; transform: translateY(26px) scale(.96) rotate(-1.5deg); } to { opacity: 1; transform: none; } }
.card.flipped { animation: none; }
.face { position: absolute; inset: 0; border-radius: 26px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: clamp(22px, 5vw, 56px); overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.14); }
.back { background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--glow) 70%, transparent), transparent 60%), linear-gradient(150deg, var(--a), var(--b));
  background-color: var(--a); }
.back::before { content: ""; position: absolute; inset: 14px; border: 1px solid color-mix(in srgb, var(--acc) 60%, transparent); border-radius: 18px; }
.ornament { font-size: clamp(64px, 12vw, 96px); color: var(--acc); line-height: 1; }
.back-title { font-family: var(--serif);  font-size: clamp(34px, 6vw, 52px); color: var(--acc); margin-top: 8px; }
.back-hint { margin-top: 18px; font-size: 14px; letter-spacing: .18em; text-transform: uppercase; opacity: .7; }
.front { transform: rotateY(180deg); background: linear-gradient(160deg, #fff9f2, #f6e7da); color: #26101c; }
.front::before { content: ""; position: absolute; inset: 14px; border: 1px solid color-mix(in srgb, var(--a) 45%, transparent); border-radius: 18px; pointer-events: none; }
.cat { font-size: 14px; letter-spacing: .22em; text-transform: uppercase; font-weight: 600; color: var(--a); margin-bottom: clamp(14px, 3vw, 26px); }
/* the question: as big as the card allows (app.js fits it); upright, no italics */
.q { font-family: var(--serif); font-weight: 600; font-size: 44px; line-height: 1.18; color: #26101c; max-width: 100%; overflow-wrap: break-word; hyphens: manual; }
.front-orn { position: absolute; bottom: clamp(18px, 3vw, 28px); font-size: 26px; color: var(--a); opacity: .55; }

/* controls */
.controls { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; gap: 12px; max-width: 560px; width: 100%; margin: 0 auto; }
.next { min-height: 62px; border-radius: 99px; border: 0; background: var(--acc); color: #1d0814; font-weight: 700; font-family: var(--serif); font-size: 24px; cursor: pointer; box-shadow: 0 12px 34px rgba(0,0,0,.35); transition: transform .15s; }
.next:active { transform: scale(.97); }
.ghost { width: 56px; height: 56px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.06); font-size: 30px; cursor: pointer; }
.ghost:disabled { opacity: .3; cursor: default; }
.count { text-align: center; font-size: 14px; opacity: .75; font-variant-numeric: tabular-nums; }

/* PIN */
.pinwrap { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; gap: 6px; }
.pinwrap .sub { font-family: var(--serif);  font-size: 22px; opacity: .8; margin-top: -6px; }
.dots { display: flex; gap: 16px; margin: 26px 0 6px; }
.dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--acc); }
.dots i.on { background: var(--acc); }
.err { min-height: 20px; font-size: 14px; color: #ffc9c9; }
.pin { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px; margin-top: 8px; }
.pin button { height: 72px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.07); font-size: 26px; cursor: pointer; }
.pin button:active { background: rgba(255,255,255,.18); }

@media (prefers-reduced-motion: reduce) { body { animation: none; } .card { transition: none; animation: none; } :root { transition: none; } }

/* deck button + chooser */
.deckbtn { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.22); border-radius: 99px; padding: 10px 16px; font-size: 15px; font-weight: 600; min-height: 44px; cursor: pointer; }
.deck-sum { opacity: .75; font-weight: 400; }
.spice { font-size: 14px; }
.level { position: absolute; bottom: clamp(18px, 3vw, 28px); display: flex; align-items: center; gap: 6px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--a); opacity: .75; }
.level i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--a); }
.level i.on { background: var(--a); }
.level span { margin-left: 4px; }
.sheet-back { position: fixed; inset: 0; z-index: 50; background: rgba(5, 0, 8, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease-out; }
@media (min-width: 700px) { .sheet-back { align-items: center; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet { width: 100%; max-width: 560px; max-height: 88dvh; overflow-y: auto; background: linear-gradient(170deg, var(--a), var(--b)); border: 1px solid rgba(255,255,255,.16); border-radius: 26px 26px 0 0; padding: 18px 18px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; box-shadow: 0 -20px 60px rgba(0,0,0,.4); }
@media (min-width: 700px) { .sheet { border-radius: 26px; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-title { font-family: var(--serif);  font-size: 32px; color: var(--acc); }
.ghost.x { width: 44px; height: 44px; font-size: 18px; }
.sheet-label { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; opacity: .75; margin-top: 6px; }
.linkish { background: none; border: 0; color: var(--acc); text-decoration: underline; text-transform: none; letter-spacing: 0; font-size: 13px; cursor: pointer; padding: 0 4px; }
.spicy-toggle { display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 16px; border-radius: 18px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06); cursor: pointer; }
.spicy-toggle b { display: block; font-size: 17px; }
.spicy-toggle small { opacity: .75; font-size: 13px; }
.sw { flex: none; width: 50px; height: 30px; border-radius: 99px; background: rgba(255,255,255,.2); position: relative; transition: background .2s; }
.sw i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.spicy-toggle.on .sw { background: #c9184a; }
.spicy-toggle.on .sw i { transform: translateX(20px); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 16px; border-radius: 99px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.05); font-size: 15px; font-weight: 600; cursor: pointer; }
.chip.on { background: var(--acc); color: #1d0814; border-color: var(--acc); }
.catlist { display: flex; flex-direction: column; gap: 6px; }
.cat-item { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; text-align: left; min-height: 48px; padding: 8px 14px; border-radius: 14px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.04); cursor: pointer; font-size: 15px; }
.cat-item.on { border-color: var(--acc); background: rgba(255,255,255,.12); }
.cat-item .tick { color: var(--acc); font-weight: 700; }
.cat-item .cn { opacity: .6; font-variant-numeric: tabular-nums; }
.next.wide { width: 100%; margin-top: 6px; }
.next:disabled { opacity: .4; }
.front { padding-bottom: clamp(52px, 8vw, 70px); padding-top: clamp(30px, 5vw, 56px); }
