@font-face {
  font-family: "Luckiest Guy";
  src: url("/fonts/luckiest-guy.woff2") format("woff2");
  font-display: swap;
  font-weight: 400;
}

:root {
  --sea1: #22c4c4;
  --sea2: #0b8a9c;
  --deep: #07566b;
  --sand: #fff6e6;
  --card: #fffdf8;
  --ink: #2a1840;
  --ink2: #5a4a6c;
  --line: #e9dcc6;
  --sun: #ffc93c;
  --sun2: #ffb000;
  --coral: #f2545b;
  --coral2: #d63f47;
  --mint: #2fbf86;
  --brand: "Luckiest Guy", "Arial Black", system-ui, sans-serif;
  --text: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  --r: 18px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgb(255 255 255 / 0.18) 0 6px, transparent 7px),
    radial-gradient(circle at 86% 9%, rgb(255 255 255 / 0.16) 0 9px, transparent 10px),
    radial-gradient(circle at 74% 34%, rgb(255 255 255 / 0.12) 0 5px, transparent 6px),
    linear-gradient(180deg, var(--sea1) 0, var(--sea2) 620px, var(--deep) 1400px, var(--deep));
  background-color: var(--deep);
  min-height: 100vh;
}
a {
  color: var(--coral2);
  font-weight: 700;
}
a:hover {
  color: var(--ink);
}
:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 2px;
  border-radius: 6px;
}
.sr,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--sun);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 10px;
  z-index: 50;
}
.skip:focus {
  left: 8px;
}

/* ---------- header ---------- */
.top {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #fff;
  font-family: var(--brand);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: 0.5px;
  line-height: 1;
  text-shadow: 0 3px 0 var(--ink);
  white-space: nowrap;
}
.logo:hover {
  color: var(--sun);
}
.logo .pip-icon {
  filter: drop-shadow(0 2px 0 var(--ink));
}
.nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 15px;
  padding: 6px 10px;
  border-radius: 999px;
}
.nav a:hover,
.nav a[aria-current="page"] {
  background: rgb(255 255 255 / 0.2);
  color: #fff;
}
.langs {
  position: relative;
}
.langs summary {
  list-style: none;
  cursor: pointer;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  border: 2px solid rgb(255 255 255 / 0.7);
  border-radius: 999px;
  padding: 4px 10px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.langs summary::-webkit-details-marker {
  display: none;
}
.langs ul {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 6px 0 var(--ink);
  list-style: none;
  margin: 0;
  padding: 6px;
  columns: 2;
  width: 330px;
  max-width: 86vw;
}
.langs li a {
  display: block;
  padding: 5px 8px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
}
.langs li a:hover,
.langs li a[aria-current="page"] {
  background: var(--sand);
}
@media (max-width: 720px) {
  .top {
    flex-wrap: wrap;
    padding: 10px 12px 4px;
  }
  .logo {
    font-size: 22px;
  }
  .nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    margin: 0 -6px;
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .nav a {
    font-size: 14px;
    white-space: nowrap;
  }
  .langs {
    margin-left: auto;
  }
}

/* ---------- layout ---------- */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 12px 40px;
}
.intro {
  text-align: center;
  color: #fff;
  margin: 6px auto 14px;
  max-width: 760px;
}
.intro h1 {
  font-size: clamp(22px, 4.4vw, 34px);
  line-height: 1.15;
  margin: 0;
  font-weight: 900;
  text-shadow: 0 2px 0 rgb(42 24 64 / 0.55);
}
.intro p {
  margin: 6px 0 0;
  font-size: 16px;
  opacity: 0.95;
}

#game {
  min-height: 640px;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 26px;
  box-shadow: 0 8px 0 var(--ink);
  padding: 18px;
  scroll-margin-top: 10px;
}
@media (max-width: 560px) {
  #game {
    padding: 14px 12px;
    border-radius: 22px;
    min-height: 600px;
  }
}
.loading {
  text-align: center;
  padding: 80px 0;
  color: var(--ink2);
}

/* ---------- buttons and fields ---------- */
.btn {
  font: inherit;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.3px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 11px 18px;
  min-height: 48px;
  cursor: pointer;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 0.08s, box-shadow 0.08s;
  touch-action: manipulation;
}
.btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn.big {
  font-size: 19px;
  padding: 13px 22px;
  min-height: 56px;
}
.btn-sun {
  background: var(--sun);
}
.btn-sun:hover:not(:disabled) {
  background: #ffd665;
}
.btn-coral {
  background: var(--coral);
  color: #fff;
  text-shadow: 0 1px 0 rgb(0 0 0 / 0.25);
}
.btn-coral:hover:not(:disabled) {
  background: var(--coral2);
}
.btn-ink {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 4px 0 #0f0719;
}
.btn-ghost {
  background: #fff;
}
.btn-link {
  background: none;
  border-color: transparent;
  box-shadow: none;
  text-decoration: underline;
  color: var(--ink2);
  font-weight: 800;
}
.btn-link.small {
  min-height: 36px;
  padding: 4px 8px;
  font-size: 14px;
}
.icon-btn {
  font-size: 22px;
  width: 50px;
  min-height: 50px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
}
input[type="text"],
input:not([type]),
#pp-nick,
#pp-code,
.answer input,
.link,
textarea {
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 10px 14px;
  min-height: 50px;
  width: 100%;
  min-width: 0;
}
input::placeholder {
  color: #9a8ea7;
  font-weight: 600;
}
.err {
  color: var(--coral2);
  font-weight: 800;
  min-height: 1.4em;
  margin: 6px 0 0;
}
.muted {
  color: var(--ink2);
}
.label {
  display: block;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink2);
  margin: 0 0 6px;
}
h2.minor {
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 22px 0 10px;
  color: var(--ink2);
}

/* ---------- Pip ---------- */
.pip,
.pip-icon {
  width: var(--pip-size);
  height: var(--pip-size);
  display: inline-block;
  flex: none;
}
.pip svg,
.pip-icon svg,
.pip-icon img {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.pip {
  --puff: 0;
  --pip-fill: hsl(46 96% 60%);
  position: relative;
}
.pip-swim {
  transform-origin: 0 0;
  transform: scale(calc(0.78 + var(--puff) * 0.3));
  animation: bob 2.6s ease-in-out infinite;
  transition: transform 0.25s;
}
.pip[data-mood="nervous"] .pip-swim {
  animation-duration: 1.2s;
}
.pip[data-mood="panic"] .pip-swim {
  animation: jitter 0.28s linear infinite;
}
@keyframes bob {
  0%,
  100% {
    translate: 0 0;
    rotate: -3deg;
  }
  50% {
    translate: 0 -4px;
    rotate: 3deg;
  }
}
@keyframes jitter {
  0% {
    translate: -1.5px 0;
  }
  50% {
    translate: 1.5px -1px;
  }
  100% {
    translate: -1.5px 0;
  }
}
.pip-body {
  fill: var(--pip-fill, #ffc93c);
  stroke: var(--ink);
  stroke-width: 3.5;
}
.pip-icon .pip-body {
  fill: var(--sun);
}
.pip-spikes {
  fill: #ffe9a8;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linejoin: round;
  transform: scale(calc(0.86 + var(--puff, 0) * 0.22));
}
.pip-tail,
.pip-fin {
  fill: var(--coral);
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linejoin: round;
}
.pip-belly {
  fill: #fff6dc;
  opacity: 0.9;
}
.pip-eye {
  fill: #fff;
  stroke: var(--ink);
  stroke-width: 2.6;
}
.pip-pupil {
  fill: var(--ink);
}
.pip-brow {
  fill: none;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0;
}
.pip-cheek {
  fill: #ff8a8f;
  opacity: 0.75;
}
.pip-mouth {
  fill: var(--ink);
  transform-origin: 20px 10px;
  transform: scale(0.75, 0.55);
}
.pip-sweat {
  fill: #8fe3ff;
  stroke: var(--ink);
  stroke-width: 1.6;
  opacity: 0;
}
.pip[data-mood="nervous"] .pip-brow,
.pip[data-mood="panic"] .pip-brow {
  opacity: 1;
}
.pip[data-mood="nervous"] .pip-sweat,
.pip[data-mood="panic"] .pip-sweat {
  opacity: 1;
}
.pip[data-mood="panic"] .pip-mouth {
  transform: scale(1.1, 1.25);
}
.pip[data-mood="panic"] .pip-pupil {
  r: 3;
}
.pip.gone .pip-swim {
  transform: scale(0.1);
  opacity: 0;
}
.pip.hop {
  animation: hop 0.45s ease-out;
}
@keyframes hop {
  0% {
    transform: translateX(-26px) rotate(-14deg);
  }
  60% {
    transform: translateX(6px) rotate(6deg);
  }
  100% {
    transform: none;
  }
}

/* ---------- start screen ---------- */
.start {
  display: grid;
  gap: 8px;
}
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.tagline {
  font-weight: 900;
  font-size: 20px;
  margin: 0;
  max-width: 260px;
  line-height: 1.25;
}
.nick {
  display: grid;
  gap: 6px;
  max-width: 460px;
  margin: 0 auto;
}
.nick label {
  font-weight: 900;
}
.nick small {
  color: var(--ink2);
  font-size: 14px;
}
.nick-row {
  display: flex;
  gap: 8px;
}
.panel {
  display: grid;
}
.panel > .err {
  text-align: center;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 4px;
}
@media (max-width: 860px) {
  .cards {
    grid-template-columns: 1fr;
  }
}
.card {
  background: var(--sand);
  border: 3px solid var(--ink);
  border-radius: var(--r);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card p {
  margin: 0;
  color: var(--ink2);
  font-size: 15.5px;
}
.card h2 {
  font-size: 21px;
  margin: 0;
  line-height: 1.2;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-emoji {
  font-size: 28px;
  line-height: 1;
}
.card .btn {
  margin-top: auto;
}
.card-bots {
  background: #fff1c2;
}
.card-room {
  background: #ffe1df;
}
.card-join {
  background: #d9f6f3;
}
.card-invite {
  background: #fff1c2;
  max-width: 520px;
  margin: 0 auto 6px;
  width: 100%;
  text-align: center;
  align-items: center;
}
.opts {
  display: grid;
  gap: 10px;
}
.opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.opt-label {
  font-weight: 900;
  font-size: 15px;
}
.stepper {
  display: flex;
  align-items: center;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.stepper button {
  font: inherit;
  font-size: 22px;
  font-weight: 900;
  width: 44px;
  height: 42px;
  border: 0;
  background: #fff;
  cursor: pointer;
  color: var(--ink);
}
.stepper button:hover {
  background: var(--sand);
}
.stepper .count {
  min-width: 34px;
  text-align: center;
  font-family: var(--brand);
  font-size: 22px;
  padding-top: 3px;
}
.seg {
  display: flex;
  border: 3px solid var(--ink);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.seg button {
  font: inherit;
  font-weight: 800;
  font-size: 14px;
  border: 0;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
  min-height: 42px;
  cursor: pointer;
}
.seg button + button {
  border-left: 2px solid var(--ink);
}
.seg button[aria-checked="true"] {
  background: var(--ink);
  color: #fff;
}
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
.check input {
  width: 22px;
  height: 22px;
  accent-color: var(--ink);
  margin: 1px 0 0;
  flex: none;
}
.join-row {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
#pp-code {
  font-family: var(--brand);
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 22px;
  padding-top: 12px;
}
.rooms ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.room-btn {
  font: inherit;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  color: var(--ink);
}
.room-btn:hover {
  background: var(--sand);
}
.stats {
  text-align: center;
  color: var(--ink2);
  font-size: 14px;
  min-height: 1.5em;
  margin: 14px 0 0;
}

/* ---------- avatars, lives, chips ---------- */
.av {
  position: relative;
  width: 58px;
  height: 58px;
  display: inline-grid;
  place-items: center;
  flex: none;
}
.av svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.av .mt-bg {
  fill: none;
  stroke: #eadfcd;
  stroke-width: 5;
}
.av .mt {
  fill: none;
  stroke: var(--mint);
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.4s;
}
.av-face {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 20px;
  color: #fff;
  background: hsl(var(--hue) 70% 46%);
  border: 3px solid var(--ink);
  text-shadow: 0 1px 0 rgb(0 0 0 / 0.3);
}
.av.bot .av-face {
  background: #d8d2e2;
  font-size: 22px;
}
.av.empty {
  border: 3px dashed #c9bba5;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  margin: 7px;
}
.lives {
  display: inline-flex;
  gap: 2px;
}
.life {
  width: 17px;
  height: 17px;
}
.life circle {
  stroke: #d8cdbb;
}
.life path {
  stroke: #efe7da;
}
.life.on circle {
  stroke: var(--coral);
}
.life.on path {
  stroke: #fff;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}
.chip {
  display: inline-block;
  font-size: 14px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: #fff;
  color: var(--ink);
  white-space: nowrap;
}
.chip.t-plankton {
  background: #ece6dc;
}
.chip.t-school {
  background: #cfe8ff;
}
.chip.t-clever {
  background: #ffe0b8;
}
.chip.t-rare {
  background: #ffc6c3;
}
.chip.t-deep {
  background: #e2cdfb;
}
.chip.t-gem {
  background: linear-gradient(135deg, #fff 0, #ffe6f3 45%, #d9f6ff 100%);
  box-shadow: 0 0 0 2px var(--sun) inset;
}

/* ---------- lobby ---------- */
.lobby {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 860px) {
  .lobby {
    grid-template-columns: 1fr;
  }
}
.codecard {
  background: #fff1c2;
  text-align: center;
  align-items: center;
}
.code {
  font-family: var(--brand);
  font-weight: 400;
  font-size: 52px;
  letter-spacing: 6px;
  line-height: 1;
  padding-top: 6px;
}
.kind {
  font-weight: 800;
  color: var(--ink2);
}
.copyrow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}
.copyrow .link {
  flex: 1 1 100%;
  font-size: 14px;
  min-height: 44px;
}
.copyrow .btn {
  flex: 1;
}
.seatcard {
  background: #fff;
}
.seats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.seat {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border-radius: 16px;
  background: var(--sand);
  min-height: 66px;
  position: relative;
}
.seat.me {
  background: #fff1c2;
}
.seat.empty {
  background: none;
  border: 2px dashed #e0d3bd;
  color: #9a8ea7;
}
.seat .nick-name {
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-left: auto;
}
.badges small {
  font-size: 12px;
  font-weight: 800;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0 7px;
}
.badges .you {
  background: var(--sun);
}
.kick {
  border: 0;
  background: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--ink2);
  width: 32px;
  height: 32px;
  border-radius: 50%;
}
.kick:hover {
  background: #ffd8d6;
}
.note {
  font-weight: 800;
  color: var(--ink2);
  min-height: 1.5em;
  margin: 0;
}
.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
@media (max-width: 420px) {
  .seats {
    grid-template-columns: 1fr;
  }
  .seat {
    min-height: 58px;
  }
}

/* ---------- table ---------- */
.table {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 860px) {
  .table {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}
.table-main,
.table-side {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.topbar {
  display: flex;
  gap: 8px;
  align-items: center;
}
.round-tag,
.code-tag {
  font-family: var(--brand);
  font-size: 17px;
  padding: 5px 12px 2px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--sun);
  line-height: 1.2;
}
.code-tag {
  background: #fff;
  letter-spacing: 2px;
}
.topbar .btn-link {
  margin-left: auto;
}
.prompt-card {
  background: var(--ink);
  color: #fff;
  border-radius: var(--r);
  padding: 16px 18px;
  min-height: 84px;
  display: flex;
  align-items: center;
}
.prompt {
  margin: 0;
  font-size: clamp(21px, 3.4vw, 28px);
  line-height: 1.2;
  font-weight: 900;
}
.stage {
  position: relative;
  height: 190px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 88%, rgb(11 138 156 / 0.18) 0 38%, transparent 40%),
    linear-gradient(180deg, #dff8f6, #bdeeea);
  border-radius: var(--r);
  border: 3px solid var(--ink);
  overflow: hidden;
}
@media (min-width: 861px) {
  .stage {
    height: 250px;
  }
  .stage-pip {
    --pip-size: 200px !important;
  }
}
.table.mine .stage {
  background:
    radial-gradient(ellipse at 50% 88%, rgb(242 84 91 / 0.2) 0 38%, transparent 40%),
    linear-gradient(180deg, #fff3cc, #ffe08a);
  animation: glow 1.2s ease-in-out infinite alternate;
}
@keyframes glow {
  to {
    box-shadow: 0 0 0 5px rgb(255 201 60 / 0.6) inset;
  }
}
.burst {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.burst b {
  font-family: var(--brand);
  font-weight: 400;
  font-size: 64px;
  color: var(--coral);
  -webkit-text-stroke: 3px var(--ink);
  opacity: 0;
}
.burst i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px;
  background: var(--sun);
  border: 2px solid var(--ink);
  transform: rotate(var(--a)) translateY(0) rotate(45deg);
  opacity: 0;
}
.burst.bang b {
  animation: popword 1.6s ease-out;
}
.burst.bang i {
  animation: shard 1s ease-out;
}
@keyframes popword {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  15% {
    opacity: 1;
    transform: scale(1.15);
  }
  70% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
  }
}
@keyframes shard {
  0% {
    opacity: 1;
    transform: rotate(var(--a)) translateY(0) rotate(45deg);
  }
  100% {
    opacity: 0;
    transform: rotate(var(--a)) translateY(-120px) rotate(45deg);
  }
}
.banner {
  margin: 0;
  text-align: center;
  font-weight: 900;
  font-size: 18px;
  min-height: 1.6em;
}
.banner.mine {
  color: var(--coral2);
  font-size: 20px;
}
.answer {
  display: flex;
  gap: 8px;
}
.answer input {
  flex: 1;
}
.answer input[readonly] {
  background: #f3eee6;
  border-color: #b9aec6;
}
.answer .pass {
  min-width: 96px;
}
.msg {
  margin: 0;
  font-weight: 800;
  min-height: 1.5em;
}
.msg.ok {
  color: #157a52;
}
.msg.bad {
  color: var(--coral2);
}
.shake {
  animation: shake 0.35s;
}
@keyframes shake {
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}
.lineup {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}
.player {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px 6px;
  border-radius: 16px;
  background: var(--sand);
  border: 3px solid transparent;
  text-align: center;
  min-width: 0;
}
.player .nick-name {
  font-size: 14px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player.me {
  background: #fff1c2;
}
.player.holder {
  border-color: var(--coral);
  background: #fff;
  box-shadow: 0 4px 0 var(--coral);
}
.player.out {
  opacity: 0.45;
  filter: grayscale(1);
}
.holder-pip {
  position: absolute;
  top: -10px;
  right: -4px;
  animation: bob 1s ease-in-out infinite;
}
.player.life-up {
  animation: lifeup 1.2s ease-out;
}
@keyframes lifeup {
  0% {
    box-shadow: 0 0 0 0 rgb(47 191 134 / 0.8);
  }
  100% {
    box-shadow: 0 0 0 16px rgb(47 191 134 / 0);
  }
}
.ticker {
  margin: 0;
  font-weight: 700;
  color: var(--ink2);
  min-height: 1.5em;
  font-size: 15px;
}
.usedbox {
  background: var(--sand);
  border-radius: var(--r);
  padding: 12px;
  min-height: 92px;
}
@media (max-width: 860px) {
  .stage {
    height: 168px;
  }
  .table-side {
    order: -1;
  }
  .table-main {
    display: contents;
  }
  .table {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  .topbar {
    order: -3;
  }
  .prompt-card {
    order: -2;
  }
  .lineup {
    order: -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .table-side {
    display: contents;
  }
  .stage {
    order: 0;
  }
  .banner {
    order: 1;
  }
  .answer {
    order: 2;
  }
  .msg {
    order: 3;
  }
  .ticker {
    order: 4;
  }
  .usedbox {
    order: 5;
  }
  .player {
    padding: 6px 2px 4px;
  }
  .player .av {
    width: 50px;
    height: 50px;
  }
  .player .av-face {
    width: 38px;
    height: 38px;
    font-size: 17px;
  }
  .player .life {
    width: 14px;
    height: 14px;
  }
}

/* ---------- results ---------- */
.over {
  display: grid;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
}
.over-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.win-head {
  font-size: clamp(26px, 5vw, 38px);
  font-weight: 900;
  margin: 0;
  line-height: 1.1;
}
.podium,
.rest {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.podium li,
.rest li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "av nick place" "av stat place" "av best best";
  column-gap: 10px;
  align-items: center;
  padding: 8px 14px 8px 8px;
  border-radius: var(--r);
  background: var(--sand);
  border: 3px solid var(--ink);
}
.podium li .av,
.rest li .av {
  grid-area: av;
}
.podium .nick-name,
.rest .nick-name {
  grid-area: nick;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.podium .place,
.rest .place {
  grid-area: place;
  font-family: var(--brand);
  font-size: 30px;
  padding-top: 4px;
}
.podium .stat,
.rest .stat {
  grid-area: stat;
  color: var(--ink2);
  font-weight: 700;
}
.podium .best,
.rest .best {
  grid-area: best;
  color: var(--ink2);
  font-weight: 700;
}
.podium .step-1 {
  background: #fff1c2;
  box-shadow: 0 5px 0 var(--sun2);
}
.rest li {
  border-width: 2px;
  background: #fff;
}
.podium li.me,
.rest li.me {
  outline: 3px solid var(--coral);
  outline-offset: 2px;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  padding: 10px 18px;
  border-radius: 999px;
  z-index: 60;
}

/* ---------- text pages and the text under the game ---------- */
.text {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 26px;
  padding: 22px clamp(16px, 4vw, 40px) 26px;
  margin-top: 26px;
}
.text h1 {
  font-size: clamp(26px, 4.6vw, 38px);
  line-height: 1.15;
  margin: 4px 0 10px;
}
.text h2 {
  font-size: 23px;
  margin: 28px 0 8px;
  line-height: 1.25;
}
.text h3 {
  font-size: 19px;
  margin: 18px 0 6px;
}
.text p,
.text li {
  max-width: 72ch;
}
.text .lede {
  font-size: 19px;
  color: var(--ink2);
}
.text ol,
.text ul {
  padding-left: 22px;
}
.text li {
  margin: 6px 0;
}
.steps {
  list-style: none;
  padding: 0 !important;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  counter-reset: s;
}
.steps li {
  counter-increment: s;
  background: var(--sand);
  border-radius: var(--r);
  padding: 14px 16px 14px 56px;
  position: relative;
  margin: 0;
}
.steps li::before {
  content: counter(s);
  position: absolute;
  left: 12px;
  top: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--sun);
  border: 3px solid var(--ink);
  font-family: var(--brand);
  font-size: 18px;
  display: grid;
  place-items: center;
  padding-top: 3px;
}
.tiers {
  border-collapse: collapse;
  width: 100%;
  max-width: 620px;
  margin: 8px 0;
}
.tiers th,
.tiers td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid var(--line);
  vertical-align: top;
}
.tiers th {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--ink2);
}
.faq details {
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: #fff;
  margin: 10px 0;
  max-width: 820px;
}
.faq summary {
  cursor: pointer;
  font-weight: 900;
  padding: 12px 16px;
  list-style: none;
  position: relative;
  padding-right: 44px;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "+";
  position: absolute;
  right: 16px;
  top: 8px;
  font-size: 24px;
  font-weight: 900;
}
.faq details[open] summary::after {
  content: "−";
}
.faq details p {
  margin: 0;
  padding: 0 16px 14px;
}
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  list-style: none;
}
.links a {
  display: inline-block;
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 6px 14px;
  background: var(--sand);
  color: var(--ink);
  text-decoration: none;
}
.links a:hover {
  background: var(--sun);
}
.cta {
  display: inline-block;
  text-decoration: none;
  margin: 8px 0;
}

/* contact form (the form script comes from /api/feedback/form.js) */
form[data-feedback-form] {
  display: grid;
  gap: 12px;
  max-width: 640px;
}
.fb-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 560px) {
  .fb-row {
    grid-template-columns: 1fr;
  }
}
.fb-field {
  display: grid;
  gap: 4px;
}
.fb-field label {
  font-weight: 800;
}
.fb-field input,
.fb-field textarea {
  font: inherit;
  border: 3px solid var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  width: 100%;
}
.fb-field textarea {
  min-height: 150px;
}
.fb-hint {
  font-weight: 600;
  color: var(--ink2);
}
form[data-feedback-form] button[type="submit"] {
  font: inherit;
  font-weight: 900;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 11px 18px;
  background: var(--sun);
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
  justify-self: start;
}

/* ---------- footer ---------- */
.foot {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 16px 36px;
  color: #e4fbfb;
  font-size: 14.5px;
  text-align: center;
}
.foot a {
  color: #fff;
}
.foot p {
  margin: 6px 0;
}

/* ---------- 404 ---------- */
.lost {
  text-align: center;
}
.lost .pip {
  margin: 10px auto;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .burst.bang b {
    animation: popfade 1.6s linear !important;
  }
}
@keyframes popfade {
  0%,
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* <tutorial> js/tutorial.js; every rule stays inside the game container */
.puffer-party-tut {
  position: relative;
  scroll-margin-top: 12px;
}
.puffer-party-tut-scrim {
  position: absolute;
  inset: -6px;
  border-radius: 20px;
  background: rgb(42 24 64 / 0.58);
  z-index: 2;
}
.puffer-party-tut-focus {
  position: relative;
  z-index: 3;
  border-radius: var(--r);
  box-shadow:
    0 0 0 4px var(--sun),
    0 0 0 9px rgb(255 201 60 / 0.35);
}
.puffer-party-tut .msg.puffer-party-tut-focus,
.puffer-party-tut .prompt-card.puffer-party-tut-focus {
  box-shadow: 0 0 0 4px var(--sun);
}
.puffer-party-tut .msg.puffer-party-tut-focus {
  background: var(--card);
  padding: 2px 8px;
}
.puffer-party-tut .msg.puffer-party-tut-focus:empty {
  box-shadow: none;
  background: none;
}
.puffer-party-tut .answer.puffer-party-tut-focus {
  background: var(--card);
  padding: 6px;
}
.puffer-party-tut-coach {
  position: relative;
  z-index: 4;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: var(--r);
  box-shadow: 0 5px 0 var(--ink);
  padding: 12px 14px 12px;
  margin-bottom: 10px;
  scroll-margin-top: 12px;
}
.puffer-party-tut-coach::after {
  content: "";
  position: absolute;
  left: 34px;
  bottom: -16px;
  border: 10px solid transparent;
  border-top: 12px solid var(--ink);
}
.puffer-party-tut-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.puffer-party-tut-count {
  font-size: 13px;
  font-weight: 900;
  color: var(--ink2);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
}
.puffer-party-tut-dots {
  display: flex;
  gap: 5px;
}
.puffer-party-tut-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: #fff;
}
.puffer-party-tut-dots i.past {
  background: var(--ink2);
}
.puffer-party-tut-dots i.on {
  background: var(--sun);
}
.puffer-party-tut-skip {
  margin-left: auto;
}
.puffer-party-tut-h {
  margin: 4px 0 2px;
  font-size: 21px;
  line-height: 1.2;
}
.puffer-party-tut-h:focus {
  outline: none;
}
.puffer-party-tut-text {
  margin: 0;
  line-height: 1.4;
}
.puffer-party-tut-hint {
  margin: 6px 0 0;
  font-weight: 800;
  color: var(--coral2);
}
.puffer-party-tut-hint:empty {
  display: none;
}
.puffer-party-tut-nav {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}
.puffer-party-tut-nav .btn {
  min-height: 44px;
  padding: 8px 18px;
  font-size: 15px;
}
.puffer-party-tut-pip {
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  touch-action: manipulation;
}
.puffer-party-tut-pip:disabled {
  cursor: default;
}
.puffer-party-tut-pip:not(:disabled) {
  animation: puffer-party-tut-wiggle 0.9s ease-in-out infinite;
}
@keyframes puffer-party-tut-wiggle {
  50% {
    transform: rotate(-6deg) scale(1.04);
  }
}
.puffer-party-tut-rarity,
.puffer-party-tut-room {
  background: var(--sand);
  border-radius: var(--r);
  padding: 10px 12px;
}
.puffer-party-tut-ladder {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
}
.puffer-party-tut-ladder li {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  border-radius: 999px;
}
.puffer-party-tut-ladder small {
  font-weight: 900;
  color: var(--ink2);
}
.puffer-party-tut-ladder li.hit .chip {
  outline: 3px solid var(--coral);
  outline-offset: 1px;
}
.puffer-party-tut-meter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  font-weight: 800;
  font-size: 15px;
}
.puffer-party-tut-meter .av {
  width: 44px;
  height: 44px;
}
.puffer-party-tut-meter .av-face {
  width: 32px;
  height: 32px;
  font-size: 15px;
}
.puffer-party-tut-room {
  display: grid;
  gap: 8px;
}
.puffer-party-tut [hidden] {
  display: none;
}
.puffer-party-tut-prompt {
  margin: 8px 0 2px;
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 900;
  font-size: 18px;
  line-height: 1.25;
}
.puffer-party-tut-code {
  text-align: center;
}
.puffer-party-tut-code .code {
  font-size: 40px;
}
.puffer-party-tut-join {
  display: grid;
  gap: 4px;
}
.puffer-party-tut-join input {
  flex: 1;
  min-width: 0;
}
.puffer-party-tut-join .btn {
  flex: none;
  white-space: nowrap;
}
.puffer-party-tut-help {
  font: inherit;
  font-weight: 800;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 4px 14px 4px 6px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  justify-self: center;
}
.puffer-party-tut-help b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sun);
  border: 2px solid var(--ink);
  font-size: 16px;
}
@media (max-width: 860px) {
  .puffer-party-tut-rarity {
    order: 2;
  }
  .puffer-party-tut-room {
    order: 3;
  }
}
@media (prefers-reduced-motion: reduce) {
  .puffer-party-tut-pip:not(:disabled) {
    animation: none;
  }
}
/* </tutorial> */
