/* JINX! — candy-coated chaos. Comic-thick borders, hard offset shadows,
   Bungee for shouting, Rubik for reading. Numerals always render in Rubik
   (--font-num / .num), never in the display face. */

:root {
  --ink: #221133;
  --paper: #fffdf7;
  --pink: #ff3d7f;
  --pink-deep: #d61c5f;
  --yellow: #ffd517;
  --yellow-deep: #e0a800;
  --cyan: #19d3ff;
  --cyan-deep: #00a3cf;
  --purple: #8a2bff;
  --lime: #7ef74a;
  --red: #ff4d4d;
  --green: #36e36b;
  --font-display: 'Bungee', 'Rubik', sans-serif;
  --font-body: 'Rubik', system-ui, sans-serif;
  --font-num: 'Rubik', system-ui, sans-serif;
  --border: 4px solid var(--ink);
  --shadow: 0 6px 0 rgba(34, 17, 51, 0.55);
  --radius: 22px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.num {
  font-family: var(--font-num);
  font-weight: 800;
  letter-spacing: 0.02em;
}

#bg {
  position: fixed;
  inset: 0;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hidden {
  display: none !important;
}

/* ---------------- topbar ---------------- */

#topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 1080px;
  padding: 10px 14px 0;
}

#topbar .spacer {
  flex: 1;
}

.chip {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 4px 14px;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 3px 0 rgba(34, 17, 51, 0.5);
}

.code-chip {
  cursor: pointer;
  letter-spacing: 0.18em;
}

.code-chip:hover {
  background: var(--yellow);
}

.iconbtn {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 999px;
  width: 38px;
  height: 38px;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(34, 17, 51, 0.5);
}

.iconbtn:active {
  transform: translateY(2px);
  box-shadow: none;
}

/* ---------------- screens ---------------- */

#screens {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px;
  overflow-y: auto;
}

/* ---------------- buttons ---------------- */

.btn {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--paper);
  border: var(--border);
  border-radius: 16px;
  padding: 12px 22px;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--ink);
  transition:
    transform 0.06s,
    box-shadow 0.06s;
}

.btn:hover {
  transform: translateY(-1px) rotate(-1deg);
}

.btn:active {
  transform: translateY(5px);
  box-shadow: 0 1px 0 var(--ink);
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.btn-big {
  font-size: 1.5rem;
  padding: 16px 34px;
  border-radius: 20px;
}

.btn-pink {
  background: var(--pink);
  color: #fff;
  text-shadow: 2px 2px 0 var(--pink-deep);
}

.btn-yellow {
  background: var(--yellow);
}

.btn-cyan {
  background: var(--cyan);
}

.btn-mini {
  font-family: var(--font-num);
  font-weight: 800;
  font-size: 1rem;
  padding: 7px 14px;
  border-width: 3px;
  border-radius: 12px;
  box-shadow: 0 4px 0 var(--ink);
}

.btn-mini.is-on {
  background: var(--yellow);
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

/* ---------------- home ---------------- */

.home-card,
.lobby-card,
.results-card,
.jinx-card,
.podium-card {
  background: var(--paper);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow:
    var(--shadow),
    0 24px 60px rgba(34, 17, 51, 0.35);
  padding: 26px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: min(94vw, 560px);
  max-height: calc(100dvh - 30px);
  overflow-y: auto;
}

.home-card {
  transform: rotate(-1.2deg);
}

.logo {
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 13vw, 5.6rem);
  line-height: 1;
  color: var(--pink);
  text-shadow:
    4px 4px 0 var(--ink),
    8px 8px 0 var(--yellow);
  transform: rotate(-2deg);
  animation: logo-bounce 2.6s ease-in-out infinite;
}

.logo-bang {
  color: var(--yellow);
  text-shadow:
    4px 4px 0 var(--ink),
    8px 8px 0 var(--pink);
  display: inline-block;
  animation: bang-wiggle 1.3s ease-in-out infinite;
}

@keyframes logo-bounce {
  0%,
  100% {
    transform: rotate(-2deg) translateY(0);
  }
  50% {
    transform: rotate(-2deg) translateY(-6px);
  }
}

@keyframes bang-wiggle {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
  }
  40% {
    transform: rotate(8deg) scale(1.15);
  }
}

.tagline {
  font-size: 1.06rem;
  font-weight: 600;
  text-align: center;
}

.tagline em {
  color: var(--purple);
  font-style: normal;
  font-weight: 800;
}

.jinx-marquee {
  display: flex;
  gap: 10px;
  font-size: 1.5rem;
}

.jinx-marquee span {
  animation: marq-hop 1.8s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.15s);
}

.jinx-marquee span:nth-child(1) {
  --i: 0;
}
.jinx-marquee span:nth-child(2) {
  --i: 1;
}
.jinx-marquee span:nth-child(3) {
  --i: 2;
}
.jinx-marquee span:nth-child(4) {
  --i: 3;
}
.jinx-marquee span:nth-child(5) {
  --i: 4;
}
.jinx-marquee span:nth-child(6) {
  --i: 5;
}
.jinx-marquee span:nth-child(7) {
  --i: 6;
}
.jinx-marquee span:nth-child(8) {
  --i: 7;
}

@keyframes marq-hop {
  0%,
  60%,
  100% {
    transform: translateY(0) rotate(0);
  }
  30% {
    transform: translateY(-9px) rotate(12deg);
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  max-width: 320px;
}

.field-label {
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
}

input {
  font-family: var(--font-num);
  font-size: 1.15rem;
  font-weight: 700;
  border: 3px solid var(--ink);
  border-radius: 12px;
  padding: 10px 14px;
  background: #fff;
  color: var(--ink);
  outline: none;
  width: 100%;
}

input:focus {
  box-shadow: 0 0 0 4px var(--cyan);
}

.join-row {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 320px;
}

.code-input {
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-align: center;
  flex: 1;
}

.home-hint,
.lobby-hint {
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.65;
  text-align: center;
}

/* ---------------- lobby ---------------- */

.lobby-label {
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: 0.85rem;
  opacity: 0.7;
}

.lobby-code {
  font-family: var(--font-num);
  font-weight: 800;
  font-size: clamp(2.6rem, 9vw, 4rem);
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  color: var(--ink);
  background: var(--yellow);
  border: var(--border);
  border-radius: 18px;
  padding: 6px 22px;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--ink);
  transition: transform 0.06s;
}

.lobby-code:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--ink);
}

.lobby-players {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  min-height: 56px;
  max-width: 460px;
}

.pchip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 5px 14px 5px 6px;
  font-weight: 700;
  box-shadow: 0 3px 0 rgba(34, 17, 51, 0.4);
  animation: chip-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes chip-in {
  from {
    transform: scale(0.3);
    opacity: 0;
  }
}

.pchip-emoji {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--pc, #ddd);
  border: 2.5px solid var(--ink);
  font-size: 1.05rem;
}

.pchip-you {
  background: var(--yellow);
}

.pchip-off {
  opacity: 0.45;
}

.pchip-host {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  background: var(--pink);
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
}

.lobby-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.rounds-pick {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rounds-label {
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
}

/* ---------------- round / stage ---------------- */

#s-round {
  gap: 8px;
  justify-content: center;
}

.rivals {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  min-height: 40px;
}

.rival {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 3px 10px 3px 4px;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 3px 0 rgba(34, 17, 51, 0.4);
}

.rival-off {
  opacity: 0.4;
}

.rival-emoji {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--pc, #ddd);
  border: 2px solid var(--ink);
  font-size: 0.85rem;
}

.rival-name {
  max-width: 84px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rival-bar {
  width: 54px;
  height: 9px;
  border: 2px solid var(--ink);
  border-radius: 99px;
  overflow: hidden;
  background: #eee;
}

.rival-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--lime));
  transition: width 0.25s;
}

.rival-state {
  min-width: 18px;
  text-align: center;
}

#stage-frame {
  position: relative;
  border: var(--border);
  border-radius: 18px;
  background: var(--paper);
  box-shadow:
    var(--shadow),
    0 22px 50px rgba(34, 17, 51, 0.4);
  overflow: hidden;
}

#stage-scale {
  position: absolute;
  left: 0;
  top: 0;
  width: 800px;
  height: 500px;
  transform-origin: 0 0;
}

#wrapA,
#wrapB,
#wrapC {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
}

#stage {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 14% 16%, rgba(255, 61, 127, 0.22), transparent 38%),
    radial-gradient(circle at 88% 80%, rgba(25, 211, 255, 0.24), transparent 40%),
    radial-gradient(circle at 80% 12%, rgba(255, 213, 23, 0.28), transparent 30%),
    radial-gradient(circle at 10% 86%, rgba(138, 43, 255, 0.16), transparent 32%),
    repeating-linear-gradient(45deg, rgba(34, 17, 51, 0.05) 0 26px, rgba(34, 17, 51, 0) 26px 52px),
    #fffaef;
  box-shadow: inset 0 0 70px rgba(138, 43, 255, 0.14);
  overflow: hidden;
}

#tracker {
  position: absolute;
  inset: 0;
  z-index: 40;
  touch-action: none;
  cursor: crosshair;
}

#jinx-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
}

.spr {
  position: absolute;
  left: 0;
  top: 0;
  line-height: 1;
  will-change: transform;
}

.g-tap {
  cursor: pointer;
}

/* ---------------- splash ---------------- */

.splash {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: repeating-conic-gradient(
    from 0deg at 50% 50%,
    rgba(255, 213, 23, 0.95) 0deg 14deg,
    rgba(255, 170, 0, 0.95) 14deg 28deg
  );
  animation: splash-spin-bg 14s linear infinite;
  text-align: center;
}

@keyframes splash-spin-bg {
  to {
    background-position: 0 0;
  }
}

.splash-round {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  background: var(--ink);
  color: var(--yellow);
  padding: 6px 22px;
  border-radius: 999px;
}

.splash-verb {
  font-family: var(--font-display);
  font-size: clamp(3rem, 14vw, 8rem);
  line-height: 1.05;
  color: #fff;
  text-shadow:
    4px 4px 0 var(--ink),
    -4px -4px 0 var(--ink),
    4px -4px 0 var(--ink),
    -4px 4px 0 var(--ink),
    9px 9px 0 rgba(34, 17, 51, 0.35);
  animation: verb-pop 0.5s cubic-bezier(0.34, 1.8, 0.64, 1);
}

@keyframes verb-pop {
  from {
    transform: scale(0.2) rotate(-14deg);
  }
}

.splash-desc {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 6px 20px;
  box-shadow: 0 4px 0 rgba(34, 17, 51, 0.4);
}

.splash-jinxed {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  background: var(--ink);
  border-radius: 999px;
  padding: 8px 18px;
  animation: jinxed-throb 0.7s ease-in-out infinite;
}

@keyframes jinxed-throb {
  0%,
  100% {
    transform: scale(1) rotate(-1deg);
  }
  50% {
    transform: scale(1.07) rotate(1deg);
  }
}

.splash-jinxed-label {
  color: var(--red);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
}

.splash-jinx-icon {
  font-size: 1.5rem;
}

/* ---------------- fuse ---------------- */

#fuse-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(92vw, 560px);
}

.fuse-bomb {
  font-size: 1.6rem;
  filter: drop-shadow(2px 2px 0 rgba(34, 17, 51, 0.4));
}

#fuse {
  flex: 1;
  height: 20px;
  border: 3px solid var(--ink);
  border-radius: 99px;
  background: var(--paper);
  overflow: hidden;
  box-shadow: 0 3px 0 rgba(34, 17, 51, 0.4);
}

#fuse-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--red), var(--yellow) 40%, var(--lime));
}

.fuse-rushed #fuse-fill {
  background: var(--red);
}

.fuse-rushed .fuse-bomb {
  animation: bomb-panic 0.3s linear infinite;
}

@keyframes bomb-panic {
  0%,
  100% {
    transform: rotate(-12deg);
  }
  50% {
    transform: rotate(12deg);
  }
}

/* ---------------- stamp ---------------- */

.stamp {
  position: absolute;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 5.2rem;
  pointer-events: none;
}

.stamp-win {
  color: var(--lime);
  text-shadow:
    4px 4px 0 var(--ink),
    -4px -4px 0 var(--ink),
    4px -4px 0 var(--ink),
    -4px 4px 0 var(--ink);
}

.stamp-fail {
  color: var(--red);
  text-shadow:
    4px 4px 0 var(--ink),
    -4px -4px 0 var(--ink),
    4px -4px 0 var(--ink),
    -4px 4px 0 var(--ink);
}

.stamp-in {
  animation: stamp-in 0.45s cubic-bezier(0.34, 1.9, 0.64, 1) forwards;
}

@keyframes stamp-in {
  0% {
    transform: scale(3.4) rotate(18deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotate(-8deg);
    opacity: 1;
  }
}

.waitveil,
#netveil {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(34, 17, 51, 0.72);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.4rem;
  text-align: center;
}

#netveil {
  position: fixed;
  z-index: 200;
}

/* ---------------- results ---------------- */

.results-card {
  width: min(94vw, 620px);
}

.results-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--purple);
  text-shadow: 3px 3px 0 rgba(34, 17, 51, 0.18);
}

.results-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.rrow {
  display: grid;
  grid-template-columns: 30px 36px minmax(70px, 1fr) auto auto auto minmax(40px, 110px) 56px;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 7px 12px;
  font-weight: 700;
  animation: rrow-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
  animation-delay: var(--d, 0ms);
}

@keyframes rrow-in {
  from {
    transform: translateX(-40px) scale(0.85);
    opacity: 0;
  }
}

.rrow-fail {
  opacity: 0.75;
  background: #f3eef7;
}

.rrow-you {
  outline: 4px solid var(--yellow);
  outline-offset: -1px;
}

.rrow-medal {
  font-size: 1.25rem;
}

.rrow-emoji {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--pc, #ddd);
  border: 2.5px solid var(--ink);
}

.rrow-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rrow-ms {
  font-size: 0.82rem;
  opacity: 0.7;
}

.rrow-streak {
  font-size: 0.82rem;
  color: var(--pink-deep);
}

.rrow-gain {
  color: var(--green);
  font-size: 0.95rem;
}

.rrow-barwrap {
  height: 12px;
  border: 2px solid var(--ink);
  border-radius: 99px;
  background: #eee;
  overflow: hidden;
}

.rrow-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--yellow));
  transition: width 0.8s cubic-bezier(0.22, 1.2, 0.4, 1);
}

.rrow-score {
  text-align: right;
  font-size: 1.05rem;
}

/* ---------------- jinx phase ---------------- */

.jinx-card {
  width: min(94vw, 640px);
}

.jinx-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--pink);
  text-shadow: 3px 3px 0 rgba(34, 17, 51, 0.18);
}

.jinx-sub {
  font-weight: 700;
  opacity: 0.8;
  text-align: center;
}

.jinx-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.jinx-target {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.95rem;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 6px 16px 6px 7px;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(34, 17, 51, 0.45);
  transition: transform 0.07s;
}

.jinx-target:hover:not([disabled]) {
  transform: translateY(-2px) rotate(-1deg);
}

.jt-on {
  background: var(--yellow);
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(34, 17, 51, 0.45);
}

.jinx-target-full {
  opacity: 0.45;
  cursor: not-allowed;
}

.jt-emoji {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--pc, #ddd);
  border: 2.5px solid var(--ink);
}

.jt-pend {
  font-size: 0.95rem;
}

.jinx-kinds {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
}

.jinx-kind {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 10px 6px;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(34, 17, 51, 0.45);
  transition: transform 0.07s;
  font-family: var(--font-body);
  color: var(--ink);
}

.jinx-kind:hover {
  transform: translateY(-3px) rotate(-1.5deg);
  background: var(--yellow);
}

.jk-icon {
  font-size: 1.7rem;
}

.jk-name {
  font-family: var(--font-display);
  font-size: 0.78rem;
}

.jk-desc {
  font-size: 0.62rem;
  font-weight: 600;
  opacity: 0.7;
  text-align: center;
  line-height: 1.25;
}

.jinx-feed {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  max-height: 140px;
  overflow-y: auto;
}

.jfeed-row {
  background: #f6f1ff;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 0.88rem;
  animation: chip-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------------- podium ---------------- */

.podium-card {
  width: min(94vw, 600px);
}

.podium-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--yellow);
  text-shadow:
    3px 3px 0 var(--ink),
    -3px -3px 0 var(--ink),
    3px -3px 0 var(--ink),
    -3px 3px 0 var(--ink);
  animation: logo-bounce 2s ease-in-out infinite;
}

.podium-steps {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

.pod {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.pod-emoji {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--pc, #ddd);
  border: 3px solid var(--ink);
  font-size: 1.6rem;
}

.pod-winner .pod-emoji {
  animation: winner-hop 0.9s ease-in-out infinite;
}

@keyframes winner-hop {
  0%,
  100% {
    transform: translateY(0) rotate(-4deg);
  }
  50% {
    transform: translateY(-10px) rotate(4deg);
  }
}

.pod-name {
  font-weight: 800;
  font-size: 0.85rem;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pod-step {
  width: 104px;
  border: var(--border);
  border-radius: 12px 12px 6px 6px;
  background: linear-gradient(180deg, var(--yellow), var(--yellow-deep));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  animation: step-grow 0.7s cubic-bezier(0.34, 1.4, 0.64, 1) backwards;
}

.pod:nth-child(1) .pod-step {
  background: linear-gradient(180deg, #e8e8ee, #c9c9d4);
  animation-delay: 0.25s;
}

.pod:nth-child(3) .pod-step {
  background: linear-gradient(180deg, #ffb480, #e08a50);
  animation-delay: 0.5s;
}

@keyframes step-grow {
  from {
    height: 0;
  }
}

.pod-medal {
  font-size: 1.7rem;
}

.pod-score {
  font-size: 1.15rem;
}

.podium-rest {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  max-width: 330px;
}

.pod-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  padding: 5px 12px;
}

.pod-row-score {
  margin-left: auto;
}

/* ---------------- toasts ---------------- */

#toasts {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 12px;
  padding: 9px 16px;
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: 0 4px 0 rgba(34, 17, 51, 0.45);
  animation: toast-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 78vw;
}

.toast-bad {
  background: var(--ink);
  color: #fff;
}

.toast-out {
  transition:
    opacity 0.4s,
    transform 0.4s;
  opacity: 0;
  transform: translateX(30px);
}

@keyframes toast-in {
  from {
    transform: translateX(60px) scale(0.8);
    opacity: 0;
  }
}

/* ---------------- jinx visual effects ---------------- */

.jx-dizzy {
  animation: jx-dizzy-spin 9s linear infinite;
}

@keyframes jx-dizzy-spin {
  to {
    transform: rotate(360deg);
  }
}

.jx-quake {
  animation: jx-quake-rattle 0.22s linear infinite;
}

@keyframes jx-quake-rattle {
  0% {
    transform: translate(3px, -2px) rotate(0.5deg);
  }
  25% {
    transform: translate(-4px, 3px) rotate(-0.7deg);
  }
  50% {
    transform: translate(2px, 4px) rotate(0.4deg);
  }
  75% {
    transform: translate(-3px, -3px) rotate(-0.4deg);
  }
  100% {
    transform: translate(3px, -2px) rotate(0.5deg);
  }
}

.jx-bee {
  position: absolute;
  left: 0;
  top: 0;
  font-size: 34px;
  filter: drop-shadow(2px 2px 0 rgba(34, 17, 51, 0.35));
  will-change: transform;
}

.jx-bee-cursor {
  position: absolute;
  left: 14px;
  top: 12px;
  font-size: 17px;
}

.jx-goo {
  position: absolute;
  background: radial-gradient(circle at 35% 30%, #b06df5, #7c2bd9 70%);
  border: 4px solid rgba(34, 17, 51, 0.55);
  opacity: 0.93;
  animation: jx-goo-throb 4s ease-in-out infinite;
}

@keyframes jx-goo-throb {
  0%,
  100% {
    transform: scale(1) rotate(-2deg);
  }
  50% {
    transform: scale(1.07) rotate(2deg);
  }
}

.g-boom {
  animation: g-boom-flash 0.3s linear 2;
}

@keyframes g-boom-flash {
  50% {
    background: var(--red);
  }
}

/* ---------------- shared game bits ---------------- */

.g-counter {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--ink);
  color: var(--yellow);
  border-radius: 999px;
  padding: 4px 16px;
  z-index: 30;
}

.g-hole {
  position: absolute;
  width: 120px;
  height: 70px;
  background: radial-gradient(ellipse at 50% 60%, #3a2350 0 58%, transparent 60%);
  border-radius: 50%;
}

.g-mole {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  font-size: 52px;
  line-height: 1;
  animation: mole-up 0.14s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes mole-up {
  from {
    transform: translateX(-50%) translateY(40px) scale(0.6);
  }
}

.g-mole-hit {
  animation: mole-hit 0.16s ease-out;
}

@keyframes mole-hit {
  to {
    transform: translateX(-50%) scale(1.5);
    opacity: 0;
  }
}

.g-mash {
  position: absolute;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: var(--pink);
  border: 6px solid var(--ink);
  box-shadow:
    0 10px 0 var(--ink),
    inset 0 -12px 0 rgba(0, 0, 0, 0.18);
  display: grid;
  place-items: center;
  font-size: 3.4rem;
  color: #fff;
  cursor: pointer;
}

.g-mash .num {
  text-shadow: 3px 3px 0 rgba(34, 17, 51, 0.5);
}

.g-mash-hit {
  animation: mash-hit 0.1s ease-out;
}

@keyframes mash-hit {
  50% {
    scale: 0.9;
  }
}

.g-numbubble {
  position: absolute;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 4px solid var(--ink);
  display: grid;
  place-items: center;
  font-size: 1.9rem;
  color: #fff;
  text-shadow: 2px 2px 0 rgba(34, 17, 51, 0.55);
  box-shadow: 0 5px 0 rgba(34, 17, 51, 0.45);
}

.g-numbubble-done {
  opacity: 0.18;
  pointer-events: none;
  transition: opacity 0.15s;
}

.g-holdwrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.g-holdbar {
  position: relative;
  width: 120px;
  height: 330px;
  border: 5px solid var(--ink);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}

.g-holdzone {
  position: absolute;
  left: 0;
  right: 0;
  background: rgba(54, 227, 107, 0.55);
  border-top: 3px dashed var(--ink);
  border-bottom: 3px dashed var(--ink);
  z-index: 2;
}

.g-holdfill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  background: linear-gradient(180deg, var(--yellow), var(--pink));
  z-index: 1;
}

.g-holdhint {
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.g-light {
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  border: 8px solid var(--ink);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 3rem;
  color: #fff;
  text-shadow: 3px 3px 0 rgba(34, 17, 51, 0.5);
}

.g-light-red {
  background: radial-gradient(circle at 35% 30%, #ff8080, var(--red) 70%);
}

.g-light-green {
  background: radial-gradient(circle at 35% 30%, #7dffa9, var(--green) 70%);
  animation: go-pulse 0.3s ease-in-out infinite;
}

@keyframes go-pulse {
  50% {
    scale: 1.08;
  }
}

.g-light-dead {
  background: #555;
}

.g-trail {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: rgba(25, 211, 255, 0.85);
  pointer-events: none;
  animation: trail-fade 0.22s linear forwards;
  z-index: 20;
}

@keyframes trail-fade {
  to {
    transform: scale(0.2);
    opacity: 0;
  }
}

.g-gunk {
  position: absolute;
  z-index: 10;
  transition:
    opacity 0.25s,
    transform 0.25s;
}

.g-gunk-gone {
  opacity: 0;
  transform: scale(0.6) rotate(20deg);
  pointer-events: none;
}

.g-coin-in {
  animation: coin-in 0.18s cubic-bezier(0.34, 1.8, 0.64, 1);
}

@keyframes coin-in {
  from {
    transform: scale(0.2) rotate(-30deg);
  }
}

.g-odd-found {
  animation: odd-found 0.4s ease-out;
}

@keyframes odd-found {
  40% {
    transform: scale(1.6) rotate(10deg);
  }
}

/* ---------------- fx ---------------- */

.fx-shake {
  animation: fx-shake 0.3s linear;
}

.fx-shake-big {
  animation: fx-shake-big 0.42s linear;
}

@keyframes fx-shake {
  25% {
    transform: translateX(-6px);
  }
  50% {
    transform: translateX(6px);
  }
  75% {
    transform: translateX(-4px);
  }
}

@keyframes fx-shake-big {
  20% {
    transform: translate(-10px, 4px) rotate(-1deg);
  }
  40% {
    transform: translate(10px, -4px) rotate(1deg);
  }
  60% {
    transform: translate(-8px, -3px);
  }
  80% {
    transform: translate(8px, 3px);
  }
}

.fx-float {
  position: absolute;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--green);
  text-shadow: 2px 2px 0 rgba(34, 17, 51, 0.4);
  pointer-events: none;
  animation: float-up 0.9s ease-out forwards;
  z-index: 60;
}

@keyframes float-up {
  to {
    transform: translateY(-60px);
    opacity: 0;
  }
}

/* ---------------- responsive ---------------- */

@media (max-width: 700px) {
  .jinx-kinds {
    grid-template-columns: repeat(2, 1fr);
  }
  .splash-verb {
    font-size: 3rem;
  }
  .rrow {
    grid-template-columns: 26px 32px minmax(60px, 1fr) auto auto 50px;
  }
  .rrow-ms,
  .rrow-barwrap {
    display: none;
  }
  .rival-name {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash,
  .logo,
  .logo-bang,
  .jinx-marquee span,
  .splash-jinxed,
  .jx-dizzy,
  .jx-quake {
    animation: none !important;
  }
}
