/* Balloon Bingo: parade morning. Deep parade-sky blue up top, warm cream card, cranberry, pumpkin and gold. */
:root {
  --sky: #14306b;
  --sky-2: #1f4aa0;
  --cream: #fff6e8;
  --paper: #ffffff;
  --ink: #1f1a2e;
  --ink-2: #5b5470;
  --cran: #d7263d;
  --cran-dark: #a8172b;
  --pumpkin: #f4841f;
  --gold: #ffc53d;
  --leaf: #2a9d6f;
  --berry: #7b2cbf;
  --line: #eadfcc;
  --shadow: 0 6px 18px rgba(31, 26, 46, .16);
  --r: 14px;
  --display: 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --ui: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* the board is as big as fits: never wider than the screen, never taller than what's left under the bar */
  --board: min(calc(100vw - 20px), calc(100svh - 190px), 760px);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--ui);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(244, 132, 31, .10) 0 3px, transparent 4px) 0 0 / 46px 46px,
    radial-gradient(circle at 70% 60%, rgba(215, 38, 61, .08) 0 3px, transparent 4px) 0 0 / 58px 58px,
    var(--cream);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 8px) 10px 8px;
  background: linear-gradient(180deg, var(--sky) 0%, var(--sky-2) 100%);
  color: #fff;
  box-shadow: 0 3px 12px rgba(20, 48, 107, .35);
}
.brand { font-family: var(--display); font-size: 20px; letter-spacing: .3px; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.b-ball { width: 16px; height: 20px; border-radius: 50% 50% 48% 48%; background: radial-gradient(circle at 35% 30%, #ff8a98, var(--cran) 60%, var(--cran-dark)); position: relative; }
.b-ball::after { content: ''; position: absolute; left: 50%; top: 100%; width: 1px; height: 8px; background: rgba(255,255,255,.7); }
.players { flex: 1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; min-width: 0; }
.players::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 0; border-radius: 999px; padding: 7px 13px;
  background: rgba(255, 255, 255, .14); color: #fff; font-weight: 800; font-size: 15px;
  display: flex; align-items: center; gap: 6px; max-width: 46vw;
}
.chip .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip[aria-selected="true"] { background: var(--gold); color: var(--ink); box-shadow: 0 2px 0 #c98f0d; }
.chip .wins { font-size: 12px; background: var(--cran); color: #fff; border-radius: 999px; padding: 1px 6px; }
.chip.add { background: transparent; border: 2px dashed rgba(255, 255, 255, .45); padding: 5px 11px; }
.icon-btn { flex: none; width: 40px; height: 40px; border-radius: 12px; border: 0; background: rgba(255, 255, 255, .14); display: grid; place-items: center; }
.icon-btn svg { width: 22px; height: 22px; fill: #fff; }
@media (max-width: 420px) { .brand { display: none; } }

/* ---------- the card ---------- */
.play { display: flex; flex-direction: column; align-items: center; padding: 8px 10px calc(env(safe-area-inset-bottom) + 14px); }
.status {
  margin: 4px 0 8px; min-height: 28px; font-weight: 900; font-size: clamp(17px, 4.6vw, 22px); text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
}
.status .pill { background: var(--cran); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: .8em; }
.status .pill.gold { background: var(--gold); color: var(--ink); }
.board-wrap { width: var(--board); }
.letters { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 6px; }
.letters span {
  font-family: var(--display); color: #fff; text-align: center; font-size: calc(var(--board) / 11);
  line-height: 1.25; border-radius: 50% 50% 46% 46% / 55% 55% 45% 45%; margin: 0 18%;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .18); position: relative;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .55), transparent 32%), var(--c);
  box-shadow: inset -4px -6px 0 rgba(0, 0, 0, .12);
}
.letters span:nth-child(1) { --c: var(--cran); }
.letters span:nth-child(2) { --c: var(--pumpkin); }
.letters span:nth-child(3) { --c: #e9a800; }
.letters span:nth-child(4) { --c: var(--leaf); }
.letters span:nth-child(5) { --c: var(--sky-2); }
.board {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
  background: var(--paper); padding: 6px; border-radius: 18px; box-shadow: var(--shadow), 0 0 0 3px var(--gold);
}
.sq {
  position: relative; aspect-ratio: 1; border: 0; padding: 0; border-radius: 10px; overflow: hidden;
  background: #e9e3d8; box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
  transition: transform .12s;
}
.sq:active { transform: scale(.95); }
.sq img { width: 100%; height: 100%; object-fit: cover; display: block; transition: filter .3s; }
.sq .lbl {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 3px 3px;
  font-size: clamp(8.5px, calc(var(--board) / 52), 14px); font-weight: 800; line-height: 1.1; color: #fff; text-align: center;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .72));
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sq.santa { box-shadow: 0 0 0 3px var(--cran), 0 1px 2px rgba(0, 0, 0, .15); }
.sq .tag {
  position: absolute; top: 3px; left: 3px; font-size: clamp(7.5px, calc(var(--board) / 60), 12px); font-weight: 900;
  background: var(--cran); color: #fff; border-radius: 6px; padding: 1px 5px; letter-spacing: .3px;
}
.sq.free .tag { background: var(--gold); color: var(--ink); }
/* the stamp */
.sq .stamp {
  position: absolute; inset: 20% 20% 26%; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, rgba(255, 120, 135, .8), rgba(215, 38, 61, .78) 60%, rgba(168, 23, 43, .85));
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .85), 0 4px 10px rgba(0, 0, 0, .3);
  transform: scale(0) rotate(-30deg); opacity: 0; transition: transform .35s cubic-bezier(.2, 1.6, .4, 1), opacity .2s;
}
.sq .stamp svg { width: 55%; height: 55%; fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.sq.on img { filter: saturate(.8) brightness(.92); }
.sq.on .stamp { transform: scale(1) rotate(0); opacity: 1; }
.sq.free .stamp { background: radial-gradient(circle at 35% 30%, rgba(255, 230, 150, .9), rgba(255, 197, 61, .85) 60%, rgba(220, 150, 20, .9)); }
.sq.win { box-shadow: 0 0 0 3px var(--gold), 0 0 14px 2px rgba(255, 197, 61, .9); animation: glow 1.6s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 3px var(--gold), 0 0 4px 0 rgba(255, 197, 61, .5); } }
.sq.pop { animation: pop .45s ease-out; }
@keyframes pop { 30% { transform: scale(1.14); } 100% { transform: scale(1); } }
.hint { color: var(--ink-2); font-weight: 700; font-size: 14px; margin: 12px 0 0; text-align: center; }

/* ---------- buttons ---------- */
.btn {
  border: 0; border-radius: 14px; padding: 12px 20px; font-weight: 900; font-size: 17px;
  background: var(--cran); color: #fff; box-shadow: 0 4px 0 var(--cran-dark); transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--cran-dark); }
.btn.big { font-size: 21px; padding: 15px 26px; width: 100%; }
.btn.small { font-size: 15px; padding: 9px 14px; box-shadow: 0 3px 0 var(--cran-dark); }
.btn.ghost { background: #efe6d6; color: var(--ink); box-shadow: 0 3px 0 #d8cbb4; }
.btn.danger { color: var(--cran-dark); }

/* ---------- welcome ---------- */
.screen { position: fixed; inset: 0; z-index: 20; overflow-y: auto; }
.welcome { background: linear-gradient(180deg, #6fb6ff 0%, #bfe1ff 46%, var(--cream) 78%); }
.sky { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.sky i {
  position: absolute; bottom: -120px; width: var(--w); height: calc(var(--w) * 1.22); border-radius: 50% 50% 47% 47% / 55% 55% 45% 45%;
  background: radial-gradient(circle at 33% 28%, rgba(255, 255, 255, .6), transparent 30%), var(--c);
  box-shadow: inset -6px -10px 0 rgba(0, 0, 0, .12); animation: rise var(--t) linear var(--d) infinite; opacity: .9;
}
.sky i::after { content: ''; position: absolute; left: 50%; top: 100%; width: 1.5px; height: 70px; background: rgba(60, 60, 80, .35); }
@keyframes rise { from { transform: translate(0, 0) rotate(-4deg); } 50% { transform: translate(18px, -60vh) rotate(4deg); } to { transform: translate(-10px, -125vh) rotate(-3deg); } }
.welcome-card {
  position: relative; max-width: 460px; margin: calc(env(safe-area-inset-top) + 28px) auto 40px; padding: 22px 20px 24px;
  background: rgba(255, 255, 255, .94); border-radius: 26px; box-shadow: 0 14px 40px rgba(20, 48, 107, .25); text-align: center;
  width: calc(100% - 28px);
}
.kicker { margin: 0; font-weight: 900; color: var(--sky-2); font-size: 14px; letter-spacing: .4px; text-transform: uppercase; }
.logo { font-family: var(--display); font-weight: 400; margin: 6px 0 2px; line-height: .95; font-size: clamp(54px, 17vw, 80px); }
.logo span { display: block; color: var(--cran); text-shadow: 0 4px 0 var(--cran-dark), 0 8px 14px rgba(0, 0, 0, .15); }
.logo span + span { color: var(--pumpkin); text-shadow: 0 4px 0 #b65a0a, 0 8px 14px rgba(0, 0, 0, .15); }
.when { font-weight: 800; color: var(--ink-2); margin: 10px 0 14px; }
.how { text-align: left; margin: 0 0 18px; padding: 0 0 0 4px; list-style: none; counter-reset: h; }
.how li { counter-increment: h; position: relative; padding: 6px 0 6px 40px; font-size: 16px; line-height: 1.35; }
.how li::before {
  content: counter(h); position: absolute; left: 0; top: 4px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--gold); font-weight: 900;
}
#who label { display: block; font-family: var(--display); font-size: 24px; margin-bottom: 8px; }
.who-row { display: flex; gap: 8px; }
input {
  font: inherit; font-weight: 800; font-size: 18px; width: 100%; padding: 11px 14px; border-radius: 14px;
  border: 2px solid var(--line); background: #fff; color: var(--ink); min-width: 0;
}
input:focus { border-color: var(--sky-2); outline: none; }
.who-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0 4px; min-height: 8px; }
.who-list .person { background: var(--sky); color: #fff; border-radius: 999px; padding: 6px 6px 6px 14px; font-weight: 800; display: flex; align-items: center; gap: 4px; }
.who-list .person button { border: 0; background: rgba(255, 255, 255, .2); color: #fff; width: 26px; height: 26px; border-radius: 50%; font-size: 16px; line-height: 1; }
.who-tip { font-size: 14px; color: var(--ink-2); margin: 8px 0 16px; }

/* ---------- sheets ---------- */
.sheet { position: fixed; inset: 0; z-index: 30; background: rgba(15, 20, 40, .55); display: grid; place-items: center; padding: 14px; animation: fade .18s; }
@keyframes fade { from { opacity: 0; } }
.look-card, .panel-card, .ask-card {
  background: var(--paper); border-radius: 24px; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); width: min(100%, 480px);
  animation: up .25s cubic-bezier(.2, 1.3, .4, 1);
}
@keyframes up { from { transform: translateY(30px) scale(.96); opacity: 0; } }
.look-card { padding: 12px 12px 16px; text-align: center; max-height: calc(100svh - 28px); overflow-y: auto; }
.look-img { position: relative; border-radius: 16px; overflow: hidden; background: #e9e3d8; aspect-ratio: 1; }
.look-img img { width: 100%; height: 100%; object-fit: contain; display: block; background: #1b1b24; }
.look-kind { position: absolute; top: 10px; left: 10px; background: var(--sky); color: #fff; border-radius: 999px; padding: 3px 12px; font-weight: 900; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }
.look-card h2 { font-family: var(--display); font-weight: 400; font-size: clamp(28px, 8vw, 40px); margin: 12px 4px 12px; line-height: 1.05; }
.look-btns { display: grid; gap: 10px; }
@media (max-height: 640px) { .look-img { aspect-ratio: 4 / 3; } }
.panel-card { max-height: calc(100svh - 28px); display: flex; flex-direction: column; }
.panel-card header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; }
.panel-card h2 { font-family: var(--display); font-weight: 400; margin: 0; font-size: 28px; }
.x { border: 0; background: #efe6d6; width: 40px; height: 40px; border-radius: 50%; font-size: 26px; line-height: 1; }
.set-body, .all-list { overflow-y: auto; padding: 0 18px 20px; }
.set-body h3 { margin: 18px 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-2); }
.toggle { display: flex; align-items: center; gap: 12px; padding: 9px 0; font-weight: 800; font-size: 17px; }
.toggle input { width: 22px; height: 22px; accent-color: var(--cran); flex: none; }
.toggle small { color: var(--ink-2); font-weight: 700; }
.prow { display: flex; align-items: center; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.prow .nm { flex: 1; font-weight: 900; font-size: 18px; min-width: 90px; }
.prow button { border: 0; background: #efe6d6; border-radius: 10px; padding: 7px 10px; font-weight: 800; font-size: 14px; }
.prow button.rm { color: var(--cran-dark); }
.about { color: var(--ink-2); font-size: 14px; line-height: 1.45; margin: 0 0 10px; }
.version { font-size: 12px; }
.all-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.mini { border: 0; background: var(--cream); border-radius: 16px; padding: 10px; text-align: center; box-shadow: 0 2px 0 var(--line); }
.mini.cur { box-shadow: 0 0 0 3px var(--gold); }
.mini .nm { font-weight: 900; font-size: 18px; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .dots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; width: 100px; margin: 0 auto 8px; }
.mini .dots i { aspect-ratio: 1; border-radius: 50%; background: #e2d8c6; }
.mini .dots i.on { background: var(--cran); }
.mini .dots i.win { background: var(--gold); }
.mini .need { font-weight: 800; font-size: 14px; color: var(--ink-2); }
.mini .need b { color: var(--cran); }
.ask-card { padding: 20px; }
.ask-card h2 { font-family: var(--display); font-weight: 400; margin: 0 0 6px; font-size: 26px; }
.ask-card p { margin: 0 0 12px; color: var(--ink-2); font-weight: 700; }
.ask-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }

/* ---------- BINGO party ---------- */
.party { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: radial-gradient(circle at 50% 45%, rgba(60, 100, 190, .94), rgba(14, 32, 78, .97) 75%); animation: fade .2s; }
.party canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.party-card { position: relative; text-align: center; padding: 20px; width: min(100%, 520px); }
.party-word { display: flex; justify-content: center; gap: 1px; flex-wrap: nowrap; }
.party-word span {
  font-family: var(--display); font-size: min(12.5vw, 110px); line-height: 1; color: #fff; display: inline-block;
  padding: .14em .1em .22em; min-width: 1.05em; border-radius: 50% 50% 46% 46% / 56% 56% 44% 44%;
  background: radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .55), transparent 30%), var(--c);
  box-shadow: inset -8px -12px 0 rgba(0, 0, 0, .14), 0 10px 24px rgba(0, 0, 0, .3); text-shadow: 0 3px 0 rgba(0, 0, 0, .2);
  animation: bounce-in .7s cubic-bezier(.2, 1.6, .4, 1) backwards, bob 2.4s ease-in-out infinite;
  animation-delay: calc(var(--i) * .09s), calc(.8s + var(--i) * .15s);
}
.party-word.long span { font-size: min(8.4vw, 84px); min-width: 1em; padding: .14em .06em .22em; }
@keyframes bounce-in { from { transform: translateY(80vh) scale(.6); } }
@keyframes bob { 50% { transform: translateY(-10px) rotate(var(--rot, 3deg)); } }
.party-who { font-family: var(--display); color: #fff; font-size: clamp(26px, 8vw, 44px); margin: 18px 0 2px; text-shadow: 0 3px 8px rgba(0, 0, 0, .4); }
.party-sub { color: #fff; font-weight: 800; font-size: 18px; margin: 0 0 22px; text-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.party .btn.big { max-width: 320px; background: var(--gold); color: var(--ink); box-shadow: 0 5px 0 #c98f0d; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 18px); transform: translateX(-50%); z-index: 50;
  background: var(--ink); color: #fff; border-radius: 14px; padding: 11px 16px; font-weight: 800; box-shadow: var(--shadow);
  display: flex; gap: 12px; align-items: center; max-width: calc(100vw - 24px); animation: up .25s;
}
.toast button { border: 0; background: var(--gold); color: var(--ink); border-radius: 10px; padding: 6px 12px; font-weight: 900; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* tablets in landscape: card on the left would be nice, but a big centred card is simplest and reads from the couch */
@media (min-width: 900px) { .board { gap: 9px; padding: 9px; } .letters { gap: 9px; } }
