/* Bankaa: the Internsive swiper, redrawn as a comic. Thick ink lines, hard shadows, halftone dots,
   and the page colour changes with every card. */
:root {
  color-scheme: light;
  --ink: #111111;
  --ink-2: #3a3a3a;
  --paper: #fffdf6;
  --bg: #ffd23f;
  --red: #ff4f6d;
  --hot: #fff26b;
  --font: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --comic: 'Bangers', Impact, 'Arial Black', sans-serif;
  --outline: 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 2px 0 var(--ink), 0 -2px 0 var(--ink),
    2px 2px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink);
  --pop: cubic-bezier(.3, 1.35, .5, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font: 500 16px/1.4 var(--font);
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(rgba(17, 17, 17, .14) 1.3px, transparent 1.8px);
  background-size: 16px 16px;
  transition: background-color .5s ease;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, ul, fieldset { margin: 0; }
ul { padding: 0; list-style: none; }
fieldset { border: 0; padding: 0; min-width: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px dashed var(--ink); outline-offset: 3px; }
.boot { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; margin: 0; font: 400 56px var(--comic); letter-spacing: .04em; color: #fff; text-shadow: var(--outline), 6px 6px 0 var(--ink); }

/* ---------- shared comic parts ---------- */
.panel { background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 6px 6px 0 var(--ink); padding: 18px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 60px; padding: 10px 22px 7px;
  font: 400 30px/1 var(--comic); letter-spacing: .05em; color: #fff;
  text-shadow: var(--outline), 3px 3px 0 var(--ink);
  background: var(--red); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 6px 6px 0 var(--ink);
  transition: transform .1s, box-shadow .1s, background .2s;
}
.btn:not(:disabled):hover { transform: translate(-1px, -1px); box-shadow: 7px 7px 0 var(--ink); }
.btn:not(:disabled):active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--ink); }
.btn:disabled { cursor: progress; background: #a9a9a9; }
.btn-full { width: 100%; }
.mini { font-weight: 800; font-size: 15px; padding: 0 14px; background: var(--ink); color: #fff; border: 3px solid var(--ink); border-radius: 12px; }
.fine { font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--ink-2); }
.center { text-align: center; }
.note { font-weight: 700; color: var(--ink-2); }
.err { font-weight: 800; color: #c4002a; background: #ffe1e6; border: 2.5px solid var(--ink); border-radius: 10px; padding: 8px 11px; }
.err:empty { display: none; }
.burst svg { display: block; width: 100%; height: 100%; overflow: visible; }
.burst polygon, .pow polygon { stroke: var(--ink); stroke-width: 5; stroke-linejoin: round; }
.burst text, .pow text { font-family: var(--comic); fill: #fff; stroke: var(--ink); stroke-width: 6px; paint-order: stroke; letter-spacing: 1px; }

/* ---------- start, join ---------- */
.gate { width: 100%; max-width: 480px; margin: 0 auto; padding: 26px 16px 44px; display: grid; gap: 20px; }
.gate-top { position: relative; }
.logo { font: 400 clamp(76px, 25vw, 116px)/.84 var(--comic); letter-spacing: .03em; color: #fff; text-shadow: var(--outline), 3px 3px 0 var(--ink), 8px 8px 0 var(--ink); transform: rotate(-4deg); transform-origin: left bottom; width: max-content; }
.logo span { color: var(--red); }
.logo.small { font-size: 54px; }
.gate-top .burst { position: absolute; right: 0; top: -10px; width: 104px; height: 104px; animation: wobble 2.4s ease-in-out infinite; }
.gate-top .burst text { font-size: 34px; }
@keyframes wobble { 0%, 100% { transform: rotate(8deg) scale(1); } 50% { transform: rotate(-4deg) scale(1.06); } }
.tagline { margin-top: 16px; font-size: 19px; font-weight: 800; line-height: 1.3; letter-spacing: -.01em; }
.tagline em { font-style: normal; display: inline-block; background: #fff; border: 2.5px solid var(--ink); padding: 0 6px; border-radius: 6px; box-shadow: 2px 2px 0 var(--ink); transform: rotate(-2deg); }
.form { display: grid; gap: 15px; }
.form-title { font: 400 34px/1 var(--comic); letter-spacing: .04em; }
.field { display: grid; gap: 6px; font-weight: 800; font-size: 15px; }
.field input, .adder input {
  width: 100%; min-width: 0; font-weight: 700; font-size: 18px; padding: 12px 14px;
  border: 3px solid var(--ink); border-radius: 12px; background: #fff; box-shadow: 3px 3px 0 var(--ink);
  outline: none; transition: transform .1s, box-shadow .1s, background .1s;
}
.field input:focus, .adder input:focus { background: #fffbe0; transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.field input[aria-invalid='true'], .adder input[aria-invalid='true'] { background: #ffe1e6; }
.field input::placeholder, .adder input::placeholder { color: #8a8a8a; font-weight: 600; }
.adder { display: flex; gap: 8px; }
.hint { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips:empty { display: none; }
.chips li { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 11px; background: var(--hot); border: 2.5px solid var(--ink); border-radius: 99px; box-shadow: 2px 2px 0 var(--ink); font-weight: 800; font-size: 15px; animation: pop-in .25s var(--pop); }
.chips button { width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--ink); color: #fff; font-size: 16px; line-height: 1; }
@keyframes pop-in { from { transform: scale(.4); } to { transform: scale(1); } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.human { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.human i { flex: none; width: 15px; height: 15px; border: 2.5px solid var(--ink); border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.human.ok i { animation: none; border-color: var(--ink); background: #3ccf6e; }
.human.bad i { animation: none; background: var(--red); }
@keyframes spin { to { transform: rotate(360deg); } }
.circle-line { text-align: center; font-weight: 800; font-size: 14px; }
.circle-line a { color: var(--ink); }
.invite { text-align: center; transform: rotate(-1deg); }
.invite-k { font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
.invite-name { font: 400 clamp(40px, 12vw, 56px)/.95 var(--comic); letter-spacing: .03em; margin: 4px 0; overflow-wrap: anywhere; }
.invite-n { font-weight: 800; }
.whoami legend { font-weight: 800; font-size: 15px; margin-bottom: 8px; padding: 0; }
.who-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.who-chip { position: relative; display: inline-flex; align-items: center; padding: 8px 14px; background: #fff; border: 2.5px solid var(--ink); border-radius: 99px; box-shadow: 3px 3px 0 var(--ink); font-weight: 800; cursor: pointer; transition: transform .1s, box-shadow .1s, background .1s; }
.who-chip input { position: absolute; opacity: 0; pointer-events: none; }
.who-chip.on { background: var(--hot); transform: translate(-1px, -1px) rotate(-2deg); box-shadow: 5px 5px 0 var(--ink); }
.who-chip:has(input:focus-visible) { outline: 3px dashed var(--ink); outline-offset: 3px; }
.who-chip.done { cursor: not-allowed; background: #e6e6e6; color: #666; box-shadow: none; border-style: dashed; }
.missing { text-align: center; }

/* ---------- the deck (the swiper, comic edition) ---------- */
body[data-view='deck'] { overflow: hidden; }
.swipe { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 500px; height: 100vh; height: 100dvh; margin: 0 auto; padding: 14px 16px 12px; }
.swipe-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.who { min-width: 0; font: 400 26px/1 var(--comic); letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.count { flex: none; font: 400 22px/1 var(--comic); letter-spacing: .04em; padding: 6px 12px 3px; background: #fff; border: 3px solid var(--ink); border-radius: 99px; box-shadow: 3px 3px 0 var(--ink); }
.progress { flex: none; height: 16px; border: 3px solid var(--ink); border-radius: 99px; background: #fff; overflow: hidden; box-shadow: 3px 3px 0 var(--ink); }
.progress i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(45deg, var(--red) 0 10px, #ff8197 10px 20px); transition: width .45s var(--pop); }
.deck { position: relative; flex: 1; min-height: 0; }
.q-card {
  position: absolute; inset: 0 6px 28px 0;
  display: flex; flex-direction: column; gap: 10px; padding: 16px;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 22px; box-shadow: 8px 8px 0 var(--ink);
  transition: transform .34s var(--pop); touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; overflow: hidden;
}
.q-card[data-pos='1'] { transform: translateY(12px) scale(.955) rotate(1.6deg); pointer-events: none; }
.q-card[data-pos='2'] { transform: translateY(24px) scale(.91) rotate(-1.6deg); pointer-events: none; }
.q-card[data-pos='1'] > *, .q-card[data-pos='2'] > * { visibility: hidden; }
.q-card.dragging { transition: none; cursor: grabbing; }
.q-card.flying { transition: transform .42s ease-in; pointer-events: none; }
.q-card.shake { animation: shake .42s; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-12px) rotate(-2deg); } 40% { transform: translateX(10px) rotate(2deg); } 60% { transform: translateX(-7px); } 80% { transform: translateX(4px); } }
.q-top { flex: none; display: flex; align-items: center; justify-content: space-between; }
.q-num { font: 400 22px/1 var(--comic); letter-spacing: .04em; padding: 5px 12px 2px; background: var(--ink); color: #fff; border-radius: 8px; transform: rotate(-3deg); }
.q-emoji { font-size: 38px; line-height: 1; filter: drop-shadow(2px 2px 0 var(--ink)); transform: rotate(8deg); }
.q-title { flex: none; font: 400 clamp(30px, 8.6vw, 40px)/.95 var(--comic); letter-spacing: .025em; }
.bubble { flex: none; position: relative; padding: 10px 14px; font-weight: 800; font-size: 17px; line-height: 1.25; background: #fff; border: 3px solid var(--ink); border-radius: 16px; margin-bottom: 8px; }
.bubble::before, .bubble::after { content: ''; position: absolute; left: 26px; width: 0; height: 0; border-style: solid; }
.bubble::before { bottom: -16px; border-width: 16px 14px 0 0; border-color: var(--ink) transparent transparent; }
.bubble::after { bottom: -10px; left: 29px; border-width: 10px 9px 0 0; border-color: #fff transparent transparent; }
.picks { flex: 1; min-height: 0; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; overflow-y: auto; touch-action: pan-y; padding: 2px 4px 6px 2px; }
.pick {
  flex: 1 1 calc(50% - 4px); min-width: 0; min-height: 46px;
  display: flex; align-items: center; gap: 8px; padding: 7px 10px 7px 7px; text-align: left;
  font-weight: 800; font-size: 16px; line-height: 1.15;
  background: #fff; border: 3px solid var(--ink); border-radius: 13px; box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s, background .12s, box-shadow .12s;
}
.picks.few { align-content: center; gap: 10px; }
.few .pick { flex-basis: 100%; min-height: 54px; font-size: 18px; }
.pick .k { flex: none; width: 24px; height: 24px; display: grid; place-items: center; font-size: 13px; color: #fff; background: var(--ink); border-radius: 50%; }
.pick .pn { min-width: 0; overflow-wrap: anywhere; }
.pick:hover { background: #fff8c9; }
.pick[aria-checked='true'] { background: var(--hot); transform: translate(-1px, -1px) rotate(-1.5deg) scale(1.03); box-shadow: 5px 5px 0 var(--ink); }
.pick[aria-checked='true'] .k { background: var(--red); }
.stamp {
  position: absolute; z-index: 3; top: 26px; right: 14px; max-width: 70%;
  padding: 4px 12px 1px; font: 400 30px/1 var(--comic); letter-spacing: .05em; color: var(--red);
  background: #fff; border: 4px solid var(--red); border-radius: 10px; transform: rotate(10deg) scale(.6);
  opacity: 0; transition: opacity .15s, transform .2s var(--pop); pointer-events: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.q-card.lean .stamp, .q-card.flying .stamp { opacity: 1; transform: rotate(10deg) scale(1); }
.swipe-actions { flex: none; display: flex; justify-content: center; }
.lock { width: min(100%, 340px); min-height: 58px; font-size: 28px; }
.lock svg { width: 26px; height: 26px; filter: drop-shadow(2px 2px 0 var(--ink)); }
.swipe-keys { flex: none; text-align: center; font-size: 13px; font-weight: 800; }
.crunch { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; text-align: center; font-weight: 800; font-size: 18px; }
.crunch .burst { width: 230px; height: 230px; animation: wobble 1s ease-in-out infinite; }
.crunch .burst text { font-size: 40px; }

/* the comic burst on every vote */
.pow { position: fixed; z-index: 20; left: 50%; top: 40%; width: 210px; height: 210px; pointer-events: none; animation: pow .65s var(--pop) forwards; }
.pow svg { width: 100%; height: 100%; overflow: visible; }
.pow text { font-size: 50px; }
@keyframes pow {
  0% { transform: translate(-50%, -50%) scale(.2) rotate(-24deg); opacity: 1; }
  45% { transform: translate(-50%, -50%) scale(1.08) rotate(-8deg); opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1) rotate(-6deg); opacity: 0; }
}
.toast { position: fixed; z-index: 40; left: 50%; top: max(14px, env(safe-area-inset-top)); max-width: calc(100% - 32px); transform: translateX(-50%); padding: 11px 16px; font-weight: 800; text-align: center; background: var(--ink); color: #fff; border-radius: 12px; box-shadow: 4px 4px 0 rgba(17, 17, 17, .35); animation: pop-in .25s var(--pop); }
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(17, 17, 17, .45); }
.modal-card { width: min(100%, 400px); display: grid; gap: 14px; text-align: center; }
.modal-card h2 { font: 400 40px/1 var(--comic); letter-spacing: .04em; }
.modal-card p { font-weight: 700; }

/* ---------- results ---------- */
.result { width: 100%; max-width: 640px; margin: 0 auto; padding: 24px 16px 48px; display: grid; gap: 20px; }
.kicker { font: 400 26px/1 var(--comic); letter-spacing: .04em; overflow-wrap: anywhere; }
.big-title { font: 400 clamp(48px, 14vw, 78px)/.9 var(--comic); letter-spacing: .02em; color: #fff; text-shadow: var(--outline), 3px 3px 0 var(--ink), 7px 7px 0 var(--ink); transform: rotate(-2deg); margin: 0 0 4px; }
.ph { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; font: 400 32px/1 var(--comic); letter-spacing: .04em; }
.ph small { font: 800 14px/1 var(--font); letter-spacing: 0; padding: 5px 10px; color: #fff; background: var(--ink); border-radius: 99px; }
.ph-out { color: #fff; text-shadow: var(--outline), 4px 4px 0 var(--ink); margin: 6px 0 14px; font-size: 40px; }
.locked { display: grid; gap: 12px; text-align: center; }
.big-count { font: 400 96px/.9 var(--comic); letter-spacing: .02em; }
.big-count span { font-size: 48px; color: var(--ink-2); }
.locked-t { font-size: 18px; font-weight: 800; line-height: 1.3; }
.share-row { display: flex; gap: 8px; }
.share-row input { flex: 1; min-width: 0; font-weight: 700; font-size: 15px; padding: 10px 12px; border: 3px solid var(--ink); border-radius: 12px; background: #fff; }
.crown-h { font-weight: 800; font-size: 18px; margin-bottom: 8px; }
.crowns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.crowns li { padding: 6px 12px; font-weight: 800; background: var(--hot); border: 2.5px solid var(--ink); border-radius: 12px; box-shadow: 3px 3px 0 var(--ink); transform: rotate(-1deg); }
.crowns li:nth-child(even) { transform: rotate(1.5deg); }
.pie-wrap { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px; align-items: center; }
.pie-wrap.sm { grid-template-columns: 124px minmax(0, 1fr); gap: 14px; }
.pie { display: block; width: 100%; height: auto; overflow: visible; }
.slice { cursor: pointer; transition: opacity .15s; }
.slice:focus { outline: none; }
.pie.dim .slice:not(.on) { opacity: .25; }
.pl rect { fill: #fff; stroke: var(--ink); stroke-width: 2; }
.pl text { font: 800 13px var(--font); fill: var(--ink); }
.legend { display: grid; gap: 4px; min-width: 0; }
.legend li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 4px 7px; border-radius: 9px; font-weight: 700; font-size: 15px; line-height: 1.2; }
.legend li.on { background: var(--hot); }
.legend .sw { width: 16px; height: 16px; border: 2.5px solid var(--ink); border-radius: 5px; }
.legend .lb { min-width: 0; overflow-wrap: anywhere; }
.legend .vl { font-weight: 800; white-space: nowrap; }
.legend .vl small { font-weight: 600; color: var(--ink-2); }
.legend .you, .aw-win .you { display: inline-block; white-space: nowrap; font-style: normal; font-size: 12px; font-weight: 800; padding: 1px 6px; margin-left: 4px; color: #fff; background: var(--red); border-radius: 99px; vertical-align: 1px; }
.sm .legend li { font-size: 14px; padding: 2px 6px; }
.award-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.award { display: grid; gap: 10px; align-content: start; padding: 15px; }
.award:nth-child(4n + 1) { transform: rotate(-.6deg); }
.award:nth-child(4n + 3) { transform: rotate(.6deg); }
.award-top { display: flex; align-items: flex-start; gap: 9px; }
.aw-e { font-size: 28px; line-height: 1; filter: drop-shadow(2px 2px 0 var(--ink)); }
.award h3 { font: 400 22px/1 var(--comic); letter-spacing: .03em; }
.aw-win { font-weight: 800; font-size: 18px; line-height: 1.2; overflow-wrap: anywhere; }
.aw-n { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.people { display: grid; gap: 10px; }
.mini-h { font-weight: 800; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.mini-h small { font-size: 13px; padding: 1px 8px; color: #fff; background: var(--ink); border-radius: 99px; }
.members { display: flex; flex-wrap: wrap; gap: 8px; }
.members li { padding: 5px 12px; font-weight: 800; font-size: 14px; background: #fff; border: 2.5px solid var(--ink); border-radius: 99px; box-shadow: 2px 2px 0 var(--ink); }
.members li.you { background: var(--hot); }
.members.waiting li { border-style: dashed; box-shadow: none; color: var(--ink-2); }
.tip { position: fixed; z-index: 30; pointer-events: none; padding: 7px 10px; font-weight: 700; font-size: 13px; color: #fff; background: var(--ink); border-radius: 9px; transform: translate(-50%, calc(-100% - 12px)); white-space: nowrap; }
.tip[hidden] { display: none; }

/* ---------- admin ---------- */
.admin { width: 100%; max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; display: grid; gap: 18px; }
.admin table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin th, .admin td { text-align: left; padding: 6px 8px 6px 0; border-bottom: 2px solid #e2ddcc; vertical-align: top; }
.admin th { border-bottom: 3px solid var(--ink); }
.admin .tw { overflow-x: auto; }

@media (max-width: 520px) {
  .pie-wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .pie-wrap > svg { max-width: 220px; }
  .pie-wrap.sm { grid-template-columns: 112px minmax(0, 1fr); justify-items: stretch; }
  .award-grid { grid-template-columns: minmax(0, 1fr); }
  .legend { width: 100%; }
}
@media (max-height: 700px) {
  .swipe { gap: 8px; padding-top: 10px; }
  .q-card { gap: 8px; padding: 13px; }
  .q-emoji { font-size: 30px; }
  .q-title { font-size: clamp(26px, 7.4vw, 34px); }
  .bubble { font-size: 15.5px; padding: 8px 12px; }
  .pick { min-height: 42px; font-size: 15px; }
  .lock { min-height: 52px; font-size: 25px; }
  .swipe-keys { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
