:root {
  --ink: #11233f;
  --muted: #637089;
  --cream: #fffaf0;
  --card: #fff;
  --orange: #ff9900;
  --orange2: #ffb84d;
  --cyan: #21c7df;
  --blue: #174b87;
  --line: #dfe6ee;
  --danger: #ff5d5d;
  --shadow: 0 18px 50px rgba(17, 35, 63, 0.12);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    radial-gradient(circle at 10% 0, #fff2d4 0, transparent 33%),
    linear-gradient(135deg, #f8fbff, #fffaf0);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  min-height: 100vh;
}
.topbar {
  height: 68px;
  padding: 0 clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(17, 35, 63, 0.08);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
}
.topbar a {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}
.brand {
  font-size: 20px;
}
.brand span {
  color: var(--orange);
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2 {
  font-family: Fredoka, sans-serif;
}
h1 {
  font-size: clamp(48px, 7vw, 88px);
  line-height: 0.94;
  letter-spacing: -0.04em;
  margin-bottom: 22px;
}
h2 {
  margin-bottom: 6px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 10px;
}
.lede {
  color: var(--muted);
  font-size: 18px;
  max-width: 620px;
  line-height: 1.6;
}
.player-shell,
.host-shell {
  max-width: 1500px;
  margin: auto;
  padding: clamp(28px, 4vw, 60px);
}
.join-panel {
  max-width: 840px;
  margin: 4vh auto;
  text-align: center;
}
.join-fields {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 12px;
  margin: 34px auto 12px;
  max-width: 760px;
}
input,
select,
button {
  font: inherit;
  border-radius: 14px;
  border: 1px solid var(--line);
  min-height: 52px;
  padding: 0 16px;
  background: #fff;
  color: var(--ink);
}
button {
  cursor: pointer;
  font-weight: 800;
  transition:
    0.18s transform,
    0.18s box-shadow,
    0.18s background;
}
button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(17, 35, 63, 0.12);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.join-fields button,
.primary,
.big-action {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.hint,
.host-note,
.category {
  color: var(--muted);
}
.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 24px;
}
.stage-card,
.vote-card,
.control-card,
.broadcast-card,
.roster-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(17, 35, 63, 0.08);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: clamp(22px, 3vw, 36px);
}
.stage-head,
.vote-head,
.lobby-title,
.host-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.room-pill,
.timer-pill {
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.word {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 24px 0 8px;
  min-height: 62px;
}
.letter-slot {
  width: 42px;
  height: 54px;
  border-bottom: 5px solid var(--ink);
  display: grid;
  place-items: center;
  font-family: Fredoka;
  font-size: 34px;
}
.letter-slot.space {
  border: 0;
  width: 20px;
}
.category {
  text-align: center;
}
.plunge-stage {
  position: relative;
  max-width: 470px;
  margin: 4px auto 0;
  text-align: center;
}
.stage-art {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  isolation: isolate;
}
.tank-layer {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 20px rgba(17, 35, 63, 0.14));
  position: relative;
  z-index: 1;
}
.peccy-layer {
  display: block;
  position: absolute;
  z-index: 2;
  width: 50%;
  height: auto;
  left: 25%;
  top: 1.5%;
  transform-origin: 50% 82%;
  filter: drop-shadow(0 10px 10px rgba(17, 35, 63, 0.18));
  will-change: transform, opacity;
}
.plunge-stage[data-danger="high"] .peccy-layer {
  animation: wobble 1.2s ease-in-out infinite;
}
.plunge-stage.splashed .peccy-layer {
  animation: peccy-fall 1.45s cubic-bezier(0.42, 0, 0.76, 1) both;
}
.water-impact {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 56%;
  width: 44%;
  height: 22%;
  pointer-events: none;
  transform: translateX(-50%);
  opacity: 0;
}
.water-impact i {
  position: absolute;
  left: 50%;
  bottom: 22%;
  width: 9%;
  aspect-ratio: 0.72;
  border-radius: 55% 45% 60% 40%;
  background: linear-gradient(145deg, #d9fbff, var(--cyan) 55%, #159ac6);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.6);
}
.water-impact i:nth-child(1) {
  --x: -155%;
  --y: -115%;
  --r: -30deg;
}
.water-impact i:nth-child(2) {
  --x: -82%;
  --y: -180%;
  --r: -12deg;
}
.water-impact i:nth-child(3) {
  --x: -50%;
  --y: -220%;
  --r: 5deg;
}
.water-impact i:nth-child(4) {
  --x: 38%;
  --y: -175%;
  --r: 18deg;
}
.water-impact i:nth-child(5) {
  --x: 118%;
  --y: -105%;
  --r: 34deg;
}
.water-impact span {
  position: absolute;
  left: 50%;
  bottom: 12%;
  width: 20%;
  height: 12%;
  border: 5px solid rgba(219, 251, 255, 0.95);
  border-radius: 50%;
  transform: translateX(-50%) scale(0.4);
}
.splashed .water-impact {
  animation: impact-show 1.15s 0.62s both;
}
.splashed .water-impact i {
  animation: droplet-burst 0.78s 0.68s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
.splashed .water-impact span {
  animation: water-ripple 0.9s 0.68s ease-out both;
}
.miss-meter {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 800;
  margin-top: 12px;
}
.miss-meter > div {
  height: 12px;
  border-radius: 99px;
  background: #e8eef4;
  overflow: hidden;
}
.miss-meter i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--cyan), var(--orange), var(--danger));
  border-radius: inherit;
  transition: 0.5s width;
}
.alphabet {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin: 20px 0;
}
.letter-btn {
  aspect-ratio: 1;
  border-radius: 12px;
  padding: 0;
  min-height: 42px;
  font-family: Fredoka;
  font-size: 19px;
}
.letter-btn.selected {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
  transform: translateY(-3px);
}
.letter-btn.used {
  background: #eef1f5;
  color: #9aa4b2;
  text-decoration: line-through;
}
.letter-btn .count {
  display: block;
  font: 700 10px "DM Sans";
  margin-top: -4px;
}
.your-vote {
  text-align: center;
  background: #f3f7fb;
  border-radius: 12px;
  padding: 11px;
  font-weight: 700;
  color: var(--muted);
}
.lobby {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 20px;
}
.players {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.player-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #f3f7fb;
  padding: 8px 11px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 13px;
}
.avatar {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  background: var(--orange);
  color: #fff;
  border-radius: 50%;
}
.result-banner {
  background: var(--ink);
  color: #fff;
  padding: 16px;
  border-radius: 16px;
  text-align: center;
  font-weight: 800;
}
.host-intro {
  align-items: center;
  margin-bottom: 28px;
}
.host-intro h1 {
  margin-bottom: 8px;
}
.big-action {
  padding: 0 28px;
}
.host-grid {
  display: grid;
  grid-template-columns: 320px minmax(500px, 1fr) 260px;
  gap: 22px;
  align-items: start;
}
.control-card,
.roster-card {
  position: sticky;
  top: 20px;
}
.room-block {
  background: var(--ink);
  color: #fff;
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 22px;
}
.room-block span {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.room-block strong {
  display: block;
  font-family: Fredoka;
  font-size: 40px;
  letter-spacing: 0.12em;
}
.room-block button {
  width: 100%;
  min-height: 42px;
}
.field {
  display: grid;
  gap: 7px;
  margin-bottom: 15px;
  font-weight: 700;
  font-size: 13px;
}
.split-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.host-actions {
  display: grid;
  gap: 9px;
}
.host-stage {
  max-width: 390px;
}
.live-votes {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.player-live-votes {
  margin-top: 18px;
}
.player-live-votes .lobby-title {
  align-items: center;
  margin-bottom: 12px;
}
.player-live-votes .lobby-title h3 {
  margin-bottom: 0;
}
.player-live-votes .lobby-title span,
.vote-rule {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.vote-rule {
  line-height: 1.5;
  margin: 12px 0 0;
}
.vote-bars {
  display: grid;
  gap: 8px;
}
.vote-bar {
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}
.vote-track {
  height: 24px;
  background: #eef2f7;
  border-radius: 7px;
  overflow: hidden;
}
.vote-track i {
  height: 100%;
  display: block;
  background: linear-gradient(90deg, var(--orange), var(--orange2));
  transition: 0.3s width;
}
.round-log {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 18px;
}
.guess-log {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.guess-token {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef2f7;
  font-weight: 800;
}
.guess-token.miss {
  background: #ffe4e4;
  color: #b72525;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 120px);
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  transition: 0.25s transform;
  z-index: 10;
}
.toast.show {
  transform: translate(-50%, 0);
}
@keyframes wobble {
  0%,
  100% {
    transform: rotate(-1deg);
  }
  50% {
    transform: rotate(1deg);
  }
}
@keyframes peccy-fall {
  0% {
    transform: translateY(0) rotate(0);
    opacity: 1;
    z-index: 2;
  }
  18% {
    transform: translateY(-2%) rotate(-8deg);
    opacity: 1;
    z-index: 2;
  }
  42% {
    transform: translateY(14%) rotate(18deg);
    opacity: 1;
    z-index: 2;
  }
  64% {
    transform: translateY(48%) rotate(34deg) scale(0.96);
    opacity: 1;
    z-index: 2;
  }
  65% {
    z-index: 0;
  }
  82% {
    transform: translateY(73%) rotate(42deg) scale(0.88);
    opacity: 0.75;
    z-index: 0;
  }
  100% {
    transform: translateY(92%) rotate(48deg) scale(0.8);
    opacity: 0;
    z-index: 0;
  }
}
@keyframes impact-show {
  0%,
  100% {
    opacity: 0;
  }
  12%,
  72% {
    opacity: 1;
  }
}
@keyframes droplet-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.25);
  }
  20% {
    opacity: 1;
  }
  78% {
    opacity: 1;
    transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--x), 10%) rotate(var(--r)) scale(0.7);
  }
}
@keyframes water-ripple {
  0% {
    opacity: 0;
    transform: translateX(-50%) scale(0.35);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) scale(4.2);
  }
}
@media (prefers-reduced-motion: reduce) {
  .plunge-stage[data-danger="high"] .peccy-layer {
    animation: none;
  }
  .plunge-stage.splashed .peccy-layer {
    animation: none;
    opacity: 0;
    transform: translateY(70%);
  }
  .splashed .water-impact,
  .splashed .water-impact i,
  .splashed .water-impact span {
    animation-duration: 0.01ms;
  }
}
@media (max-width: 1100px) {
  .host-grid {
    grid-template-columns: 300px 1fr;
  }
  .roster-card {
    grid-column: 1/-1;
    position: static;
  }
  .game-layout {
    grid-template-columns: 1fr;
  }
  .plunge-stage {
    max-width: 390px;
  }
}
@media (max-width: 700px) {
  .topbar {
    height: 58px;
  }
  .player-shell,
  .host-shell {
    padding: 22px 14px;
  }
  .join-fields {
    grid-template-columns: 1fr;
  }
  .stage-card,
  .vote-card,
  .control-card,
  .broadcast-card,
  .roster-card {
    border-radius: 20px;
    padding: 20px;
  }
  .host-intro {
    align-items: flex-start;
    flex-direction: column;
  }
  .host-grid {
    grid-template-columns: 1fr;
  }
  .control-card {
    position: static;
  }
  .alphabet {
    grid-template-columns: repeat(6, 1fr);
  }
  .letter-slot {
    width: 30px;
    height: 44px;
    font-size: 27px;
  }
  .game-layout {
    gap: 14px;
  }
}
