/* Ovolo: an abstract game. Neutral dark interface, cards in light grey with three outlined shapes; the three game colours
   (dark blue, orange, white) are kept for the cards and their swatches only. One portrait view, no page scroll. */
:root {
  --bg: #15171C; --bg-2: #20242B; --bg-3: #2B3038; --line: #474D57; --text: #F2F3F5; --muted: #A9AFB9; --dim: #8A909A;
  --accent: #F2F3F5; --accent-ink: #15171C; --ok: #7FD1AE;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --safe-b: max(30px, env(safe-area-inset-bottom));
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; background: var(--bg); color: var(--text); font-family: var(--sans); -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; }
#app { height: 100svh; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; padding: max(12px, env(safe-area-inset-top)) 16px var(--safe-b); gap: 10px; }
h1, h2 { margin: 0; font-weight: 700; }
h1 { font-size: 40px; letter-spacing: .02em; text-align: center; }
h2 { font-size: 21px; }
h2.h3 { font-size: 17px; margin-top: 6px; }
p { margin: 0; line-height: 1.4; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; color: var(--dim); }
.big { font-size: 18px; font-weight: 600; text-align: center; }
.lot { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.grow { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.center { align-items: center; justify-content: center; text-align: center; }
.row { display: flex; gap: 8px; align-items: center; }
.between { justify-content: space-between; }
.logo { display: flex; gap: 12px; margin-bottom: 8px; }

.top { display: flex; justify-content: space-between; align-items: center; font-size: 14px; min-height: 30px; gap: 6px; white-space: nowrap; }
.coins { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.iconbtn { background: none; border: 1px solid var(--line); border-radius: 6px; padding: 4px 9px; color: var(--muted); font-size: 13px; }

.btn { display: block; width: 100%; min-height: 48px; border-radius: 8px; border: 1px solid var(--text); background: transparent; font-size: 17px; padding: 10px 14px; cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.quiet { border-color: var(--line); color: var(--muted); }
.btn:disabled { opacity: .4; cursor: default; }
.actions { display: flex; flex-direction: column; gap: 8px; }

/* indices: dark boxes, the price on the right */
.fiche { background: var(--bg-2); color: var(--text); border-radius: 8px; padding: 10px 12px; min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 2px solid var(--line); text-align: left; width: 100%; font-size: 16px; }
.fiche .price { font-size: 20px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fiche.hidden { color: var(--muted); border-style: dashed; }
.fiche.selected { border-color: var(--text); background: var(--bg-3); }
button.fiche { cursor: pointer; }
.announce { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; text-align: center; }
.panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.obj { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 15px; margin-top: 4px; }
.obj b { font-size: 18px; }

/* colours: the word is always beside its swatch */
.pig { white-space: nowrap; }
.chip { display: inline-block; width: 1em; height: 1em; border-radius: 50%; vertical-align: -0.15em; margin-right: 0.3em; border: 2px solid #111318; box-shadow: 0 0 0 1px var(--muted); }
.shape-ico { vertical-align: -0.2em; }

/* cards */
.stage { display: flex; justify-content: center; align-items: center; min-height: 0; }
.stage .card { width: min(78vw, 300px); height: auto; }
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.cards .card { width: 100%; height: auto; }

.seats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; overflow: auto; min-height: 0; }
.seats li { display: flex; justify-content: space-between; padding: 7px 10px; background: var(--bg-2); border-radius: 6px; font-size: 15px; }
.seats li.me { outline: 1px solid var(--text); }
.ok { color: var(--ok); }
.tiers { display: flex; gap: 6px; font-size: 13px; color: var(--dim); flex-wrap: wrap; }
.tiers .reached { color: var(--ok); font-weight: 600; }

.stepper { display: flex; align-items: center; gap: 10px; justify-content: center; }
.stepper button { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--text); background: none; font-size: 24px; }
.stepper .value { font-size: 34px; font-weight: 700; min-width: 90px; text-align: center; font-variant-numeric: tabular-nums; }
.stepper .small-value { font-size: 22px; min-width: 40px; }

.qr { background: #fff; padding: 10px; border-radius: 8px; width: 210px; height: 210px; margin: 0 auto; }
.qr svg { width: 100%; height: 100%; display: block; }

.sheet { position: fixed; inset: 0; background: var(--bg); z-index: 10; display: flex; justify-content: center; }
.sheet > div { width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 10px; padding: max(16px, env(safe-area-inset-top)) 16px var(--safe-b); height: 100svh; }
.scroll { overflow-y: auto; min-height: 0; flex: 1; display: flex; flex-direction: column; gap: 8px; }

input[type=text] { width: 100%; min-height: 48px; font-size: 18px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); }
#toast { position: fixed; left: 50%; top: calc(max(12px, env(safe-area-inset-top)) + 40px); transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-size: 15px; max-width: 90vw; opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 20; text-align: center; }
#toast.show { opacity: 1; }
.status { font-size: 12px; color: #F5B85C; text-align: center; min-height: 16px; }
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }
@media (max-height: 600px) { h1 { font-size: 32px; } .stage .card { width: min(64vw, 240px); } .btn { min-height: 44px; } }

/* the throw (seller) and the card in flight (everyone else, one second later) */
.throw { display: flex; justify-content: center; touch-action: none; cursor: grab; transition: transform .25s ease; }
.throw .card { width: min(70vw, 270px); height: auto; }
.throw.dragging { transition: none; cursor: grabbing; }
.throw.flying { transform: translateY(-120vh) rotate(-8deg); transition: transform .35s ease-in; }
.hint { text-align: center; font-size: 14px; color: var(--muted); }
#fly { position: fixed; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: rgba(21, 23, 28, .93); pointer-events: none; z-index: 15; padding: 16px; }
#fly.show { display: flex; }
#fly .card { width: min(72vw, 280px); height: auto; }
#fly .caption { font-size: 19px; font-weight: 700; text-align: center; }
#fly .incoming { animation: incoming 1s cubic-bezier(.2, .7, .3, 1) both; }
#fly .reveal { animation: reveal .45s ease-out both; }
#fly .landed { animation: landed .3s ease-out both; }
@keyframes incoming { from { transform: translateY(-75vh) rotate(-10deg) scale(.8); opacity: .5; } 70% { transform: translateY(6px) rotate(1deg); opacity: 1; } to { transform: none; opacity: 1; } }
@keyframes reveal { from { transform: rotateY(90deg) scale(.95); } to { transform: none; } }
@keyframes landed { from { transform: scale(1.04); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { #fly .incoming, #fly .reveal, #fly .landed { animation: none; } .throw.flying { transition: none; opacity: 0; } }
.offers { flex: 1 1 auto; overflow-y: auto; min-height: 0; justify-content: flex-start; }
.throw-zone { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; }
.offers .fiche { flex-shrink: 0; }
@media (max-height: 600px) { .throw .card { width: min(56vw, 200px); } }
