:root {
  --bg: #120e11;
  --bg-2: #1a1418;
  --card: #22191d;
  --card-2: #2a2024;
  --accent: #ff3d7f;
  --accent-2: #ff7aa8;
  --accent-deep: #c41a55;
  --text: #f7eef2;
  --text-dim: #b39aa4;
  --line: rgba(255, 247, 250, 0.08);
  --danger: #ff5a6a;
  --good: #f4f1ea;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --radius: 14px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --pad: 20px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  user-select: none;
  touch-action: none;
}

img, svg, button, canvas {
  user-select: none;
}

#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

#vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 42%, transparent 22%, rgba(8, 4, 6, 0.42) 58%, rgba(5, 2, 4, 0.82) 100%),
    linear-gradient(180deg, rgba(12, 8, 10, 0.38) 0%, transparent 16%, transparent 70%, rgba(8, 5, 7, 0.72) 100%);
}

#red-wash {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 30%, rgba(255, 40, 70, 0.28), rgba(80, 0, 16, 0.18));
}

.hidden {
  display: none !important;
}

.screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px 20px 28px;
  background: linear-gradient(180deg, rgba(18, 14, 17, 0.18) 0%, rgba(18, 14, 17, 0.55) 42%, rgba(18, 14, 17, 0.88) 100%);
  color: var(--text);
}

#screen-loading {
  z-index: 40;
  justify-content: center;
  align-items: center;
  background: var(--bg);
}

#screen-howto,
#screen-skins,
#screen-pause,
#screen-eliminated,
#screen-victory {
  background: rgba(10, 7, 9, 0.62);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.load-stack,
.title-top,
.sheet,
.intro-card {
  width: min(440px, 100%);
  margin: 0 auto;
}

.load-stack {
  text-align: center;
}

.load-blocks {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
}

.load-blocks span {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: linear-gradient(160deg, var(--accent-2), var(--accent-deep));
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18) inset;
  animation: blockPulse 1.1s var(--ease-out) infinite;
}

.load-blocks span:nth-child(2) {
  background: #f4f1ea;
  animation-delay: 0.12s;
}

.load-blocks span:nth-child(3) {
  animation-delay: 0.24s;
}

.load-blocks span:nth-child(4) {
  background: #f4f1ea;
  animation-delay: 0.36s;
}

@keyframes blockPulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.06); }
}

.wordmark {
  font-family: "Bebas Neue", sans-serif;
  font-size: 64px;
  line-height: 0.86;
  letter-spacing: -0.02em;
  margin: 8px 0 12px;
  color: var(--text);
}

.wordmark-lg {
  font-size: clamp(64px, 18vw, 92px);
}

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin: 0 0 8px;
  font-weight: 600;
}

.eyebrow.danger {
  color: var(--danger);
}

.lede, .sheet-copy, .caption {
  color: var(--text-dim);
  margin: 0;
}

.lede {
  font-size: 15px;
  max-width: 34ch;
}

.caption {
  font-size: 13px;
  margin-top: 12px;
}

.load-bar {
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 247, 250, 0.08);
  overflow: hidden;
  margin-top: 28px;
}

.load-bar i {
  display: block;
  height: 100%;
  width: 8%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent-2));
  transition: width 0.4s var(--ease-out);
}

.error-msg {
  color: #ffb3bc;
  background: rgba(255, 70, 90, 0.12);
  border: 1px solid rgba(255, 90, 106, 0.28);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 18px;
}

#screen-title {
  background: linear-gradient(180deg, rgba(8, 5, 7, 0.06) 0%, rgba(8, 5, 7, 0.12) 36%, rgba(8, 5, 7, 0.4) 100%);
}

.title-scrim {
  position: absolute;
  left: 50%;
  top: 6%;
  bottom: 0;
  width: min(720px, 146%);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse 55% 64% at 50% 58%,
    rgba(6, 3, 5, 0.92) 0%,
    rgba(8, 4, 6, 0.8) 26%,
    rgba(10, 6, 8, 0.46) 50%,
    rgba(10, 6, 8, 0.14) 72%,
    transparent 100%);
}

#screen-title > *:not(.title-scrim) {
  position: relative;
  z-index: 1;
}

.title-top {
  margin-bottom: 20px;
}

.title-stats {
  width: min(440px, 100%);
  margin: 0 auto 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 10px;
  min-width: 0;
}

.stat-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.stat strong, .hud-money strong, .intro-prize strong, .victory-prize {
  font-family: "Bebas Neue", sans-serif;
  font-size: 24px;
  letter-spacing: 0.02em;
  font-weight: 400;
  color: var(--text);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.title-stats .stat {
  background: rgba(10, 7, 10, 0.5);
  color: #fff8fb;
  border: 1px solid rgba(255, 247, 250, 0.08);
  border-top: 1.5px solid rgba(255, 122, 168, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.title-stats .stat strong {
  color: #fff9fb;
}

.title-actions {
  width: min(440px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  min-height: 52px;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-family: "DM Sans", sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform 0.12s ease-out, filter 0.2s var(--ease-out), background 0.2s;
  color: var(--text);
}

.btn:active {
  transform: scale(0.97);
}

.btn:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

.btn-primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #2a0814;
  box-shadow: 0 10px 28px rgba(255, 61, 127, 0.38), 0 0 20px rgba(255, 90, 140, 0.55);
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-primary:active {
  transform: scale(0.97);
  filter: none;
  background: linear-gradient(180deg, #d01e5c, #8a103e);
  color: #140308;
  box-shadow: 0 2px 10px rgba(80, 8, 28, 0.45);
}

.btn-ghost {
  background: rgba(42, 32, 36, 0.82);
  color: var(--text);
  border: 1px solid rgba(255, 236, 242, 0.28);
  box-shadow: 0 1px 0 rgba(255, 247, 250, 0.1) inset;
}

.btn-ghost:hover {
  background: #32262b;
  color: var(--text);
}

.btn-text {
  background: transparent;
  color: var(--text-dim);
  min-height: 44px;
}

.btn-text:hover {
  color: var(--text);
  background: transparent;
}

.btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

.sheet {
  background: linear-gradient(180deg, rgba(40, 30, 34, 0.92), rgba(24, 18, 21, 0.94));
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px 20px 20px;
  box-shadow: var(--shadow);
  max-height: min(92vh, 760px);
  overflow: auto;
}

.sheet-narrow {
  width: min(400px, 100%);
}

.sheet-title {
  font-family: "Bebas Neue", sans-serif;
  font-size: 40px;
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  color: var(--text);
}

.howto-list {
  list-style: none;
  margin: 18px 0 22px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.howto-list li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: start;
}

.howto-list h3 {
  margin: 0 0 4px;
  font-size: 16px;
  color: var(--text);
}

.howto-list p {
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
}

.tag {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 61, 127, 0.14);
  color: var(--accent-2);
  font-family: "Bebas Neue", sans-serif;
  font-size: 18px;
}

.skin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0 20px;
}

.skin-card {
  text-align: left;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  min-height: 92px;
  cursor: pointer;
  font-family: inherit;
}

.skin-card .swatch {
  width: 100%;
  height: 28px;
  border-radius: 8px;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.skin-card strong {
  display: block;
  font-size: 14px;
  color: var(--text);
}

.skin-card span {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

.skin-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.skin-card.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.intro-card {
  text-align: left;
  padding-bottom: 8px;
}

.intro-card .lede {
  max-width: 36ch;
}

.intro-prize {
  margin: 20px 0 18px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  width: fit-content;
  min-width: 160px;
}

#hud {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.hit {
  pointer-events: auto;
}

.hud-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px 0;
  max-width: 100%;
}

.icon-btn {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid var(--line);
  background: rgba(24, 18, 21, 0.78);
  color: var(--text);
  border-radius: 12px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.icon-btn:active {
  transform: scale(0.96);
}

.icon-btn:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.hud-pips {
  display: flex;
  gap: 6px;
  align-items: center;
  min-height: 44px;
  flex: 1 1 auto;
  justify-content: center;
}

.pip {
  width: 22px;
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 247, 250, 0.12);
}

.pip.on {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.pip.now {
  box-shadow: 0 0 0 2px rgba(255, 122, 168, 0.45);
}

.hud-money {
  background: rgba(24, 18, 21, 0.78);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  min-width: 0;
  max-width: 42vw;
}

.hud-money strong {
  font-size: 20px;
}

.hud-mid {
  padding: 8px 14px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hud-round {
  text-align: center;
}

.hud-round span {
  display: block;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.hud-round strong {
  font-family: "Bebas Neue", sans-serif;
  font-size: 34px;
  line-height: 1;
  color: var(--text);
  letter-spacing: 0.04em;
}

.hud-meter {
  width: min(240px, 70vw);
}

.meter-track {
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 247, 250, 0.1);
  overflow: hidden;
}

.meter-track i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f4f1ea, var(--accent));
  border-radius: 99px;
  transition: width 0.12s linear;
}

.meter-track.hot i {
  background: linear-gradient(90deg, #ffb36a, var(--danger));
}

.banner {
  position: absolute;
  left: 50%;
  top: 28%;
  transform: translateX(-50%);
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(40px, 12vw, 72px);
  letter-spacing: 0.06em;
  line-height: 0.9;
  text-align: center;
  pointer-events: none;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  color: var(--text);
}

.banner.red {
  color: #ff4d6d;
}

.banner.white {
  color: #f7f2ea;
}

.toast {
  position: absolute;
  left: 50%;
  top: 38%;
  transform: translateX(-50%);
  background: rgba(24, 18, 21, 0.86);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 8px 14px;
  font-size: 13px;
  pointer-events: none;
  white-space: nowrap;
}

.controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 16px;
  gap: 12px;
}

.stick-wrap, .action-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.ctrl-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.stick {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: rgba(24, 18, 21, 0.55);
  border: 1px solid rgba(255, 247, 250, 0.12);
  position: relative;
  touch-action: none;
}

.stick-ring {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 247, 250, 0.1);
}

.stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f7eef2, #d9c4cc);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.act-btn {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 1px solid rgba(255, 247, 250, 0.14);
  background: radial-gradient(circle at 35% 30%, var(--accent-2), var(--accent-deep));
  color: #2a0814;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(196, 26, 85, 0.35);
  font-family: "DM Sans", sans-serif;
}

.act-btn:active, .act-btn.held {
  transform: scale(0.95);
  filter: brightness(1.08);
}

.act-btn:focus-visible {
  outline: 2px solid #f7eef2;
  outline-offset: 3px;
}

.act-btn span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.act-btn.cooling {
  filter: grayscale(0.35) brightness(0.85);
}

.choice-wrap {
  display: flex;
  gap: 10px;
  flex: 1 1 auto;
  justify-content: center;
}

.choice-btn {
  min-height: 64px;
  min-width: 132px;
  flex: 1 1 0;
  max-width: 180px;
  border-radius: 16px;
  border: 1px solid rgba(255, 247, 250, 0.14);
  background: rgba(24, 18, 21, 0.78);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.choice-btn:active {
  transform: scale(0.97);
  background: #32262b;
  color: var(--text);
}

.choice-btn:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.elim-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 16px 0 18px;
}

.victory-prize {
  font-size: 48px;
  margin: 8px 0 6px;
  background: linear-gradient(180deg, #ffe7a3, #d7a441);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pulse-live {
  position: relative;
}

.pulse-live::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  box-shadow: 0 0 0 0 rgba(255, 61, 127, 0.7);
  animation: live 1.8s var(--ease-out) infinite;
}

@keyframes live {
  0% { box-shadow: 0 0 0 0 rgba(255, 61, 127, 0.55); }
  100% { box-shadow: 0 0 0 10px rgba(255, 61, 127, 0); }
}

@media (min-width: 900px) {
  .screen {
    padding: 40px 48px 44px;
  }
  .wordmark-lg {
    font-size: 110px;
  }
  .hud-money {
    max-width: 280px;
  }
}

@media (max-width: 390px) {
  .wordmark {
    font-size: 56px;
  }
  .hud-money strong {
    font-size: 16px;
  }
  .stick {
    width: 104px;
    height: 104px;
  }
  .act-btn {
    width: 76px;
    height: 76px;
  }
  .choice-btn {
    min-width: 0;
    min-height: 60px;
    font-size: 13px;
  }
  .banner {
    font-size: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .load-blocks span,
  .pulse-live::before {
    animation: none;
  }
  .btn, .act-btn, .choice-btn, .icon-btn {
    transition: none;
  }
}