/* Full Score Date: ice-stage visual system v3 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  letter-spacing: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  min-height: 100%;
}

html {
  background: var(--c-page-bg);
}

body {
  position: relative;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--c-ink);
  font-family: var(--font-sans);
  background-color: var(--c-paper);
  background-image:
    linear-gradient(90deg, var(--c-grid-strong) 1px, transparent 1px),
    linear-gradient(var(--c-grid-h-strong) 1px, transparent 1px),
    linear-gradient(150deg, var(--c-white) 0 64%, var(--c-mist) 64% 86%, var(--c-mist-deep) 86% 100%);
  background-size: 40px 40px, 40px 40px, 100% 100%;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

body::before { content: none; }

body::after {
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--c-blue) 0 76%, var(--c-cyan) 76% 100%);
  box-shadow: 0 2px 12px var(--c-glow-blue-18);
}

button,
input,
select {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.app {
  position: relative;
  z-index: 1;
  width: min(100%, 720px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(24px, calc(env(safe-area-inset-top) + 18px)) 20px calc(34px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.app::before {
  content: "";
  height: 6px;
  width: 96px;
  margin-bottom: 2px;
  background: linear-gradient(90deg, var(--c-blue) 0 72%, var(--c-cyan) 72% 100%);
  border-radius: var(--radius-pill);
  box-shadow: 0 0 18px var(--c-glow-cyan-soft);
}

h1,
h2 {
  color: var(--c-ink);
  text-wrap: balance;
}

h1 {
  font-size: clamp(36px, 8vw, 52px);
  line-height: 1.02;
  font-weight: 950;
}

h2 {
  font-size: clamp(22px, 5vw, 28px);
  line-height: 1.16;
  font-weight: 900;
}

.neon {
  color: var(--c-blue);
  text-shadow: 0 0 18px var(--c-glow-blue-16);
}

.brand-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 10px;
  box-shadow: 0 8px 20px var(--c-glow-blue-18);
}

.drink-choice-grid button {
  display: grid;
  min-width: 0;
  place-items: center;
  gap: 2px;
  font-size: 21px;
}

.drink-choice-grid small {
  font-size: 10px;
  font-weight: 850;
}

.amber {
  color: var(--c-purple);
}

.dim,
.progress,
.wait-list {
  color: var(--c-ink-dim);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 700;
}

.glass {
  position: relative;
  background: var(--c-card);
  border: var(--stroke-thin) solid var(--c-line-soft);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow-soft);
}

.app > .glass::after {
  content: "";
  position: absolute;
  inset: 5px 5px auto auto;
  width: 34px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--c-blue);
  border-left: 8px solid var(--c-cyan);
}

.app > .glass:nth-of-type(3n + 2)::after,
.app > .glass:nth-of-type(3n)::after {
  background: var(--c-blue);
  border-left-color: var(--c-cyan);
}

.phase-in > * {
  animation: rise 0.34s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.phase-in > *:nth-child(2) { animation-delay: 0.04s; }
.phase-in > *:nth-child(3) { animation-delay: 0.08s; }
.phase-in > *:nth-child(4) { animation-delay: 0.12s; }
.phase-in > *:nth-child(n + 5) { animation-delay: 0.16s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.btn {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 13px 16px;
  border: var(--stroke-thin) solid var(--c-blue-deep);
  border-radius: var(--radius-btn);
  background: var(--c-blue);
  color: var(--c-white);
  box-shadow: 0 4px 0 var(--c-blue-deep), 0 10px 22px var(--c-glow-blue-18);
  font-size: 18px;
  line-height: 1.2;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn:hover:not(:disabled) {
  background: var(--c-blue-deep);
  box-shadow: 0 4px 0 var(--c-blue-deep), 0 12px 25px var(--c-glow-blue-22);
}

.btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--c-blue-deep), 0 5px 12px var(--c-glow-blue-16);
}

.btn:disabled {
  color: var(--c-disabled-fg);
  background: var(--c-disabled-bg);
  border-color: var(--c-disabled-line);
  box-shadow: 0 var(--hs-3) 0 var(--c-disabled-line);
  cursor: not-allowed;
}

.btn.ghost {
  color: var(--c-ink);
  background: var(--c-white);
  border-color: var(--c-line-soft);
  box-shadow: var(--shadow-soft-sm);
}

.btn.ghost:hover:not(:disabled) {
  color: var(--c-blue-deep);
  background: var(--c-ice);
  border-color: var(--c-blue);
  box-shadow: 0 8px 20px var(--c-glow-blue-16);
}

.btn.small {
  display: inline-flex;
  width: auto;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 9px 13px;
  font-size: 15px;
}

input[type="text"],
select {
  width: 100%;
  min-height: 50px;
  padding: 12px 13px;
  border: var(--stroke-thin) solid var(--c-line-soft);
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--c-ink);
  background: var(--c-card-solid);
  box-shadow: 0 5px 15px var(--c-shade-card);
  font-size: 17px;
  font-weight: 750;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
select:focus {
  border-color: var(--c-blue);
  box-shadow: var(--focus-ring), 0 8px 20px var(--c-glow-blue-16);
}

input::placeholder {
  color: var(--c-placeholder);
  font-weight: 650;
}

select option {
  color: var(--c-ink);
  background: var(--c-white);
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.grow {
  flex: 1;
  min-width: 0;
}

.center { text-align: center; }

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hidden { display: none !important; }

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(48px, 1fr));
  gap: 8px;
}

.emoji-grid button {
  min-width: 48px;
  min-height: 50px;
  padding: 7px;
  border: var(--stroke) solid var(--c-line-soft);
  border-radius: var(--radius-sm);
  background: var(--c-tint-emoji);
  box-shadow: 0 var(--hs-3) 0 var(--c-silver);
  font-size: 25px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.emoji-grid button:active { transform: translateY(2px); }

.emoji-grid button.sel {
  border-color: var(--c-blue);
  color: var(--c-white);
  background: var(--c-blue);
  box-shadow: 0 0 0 3px var(--c-glow-blue-18);
}

.players {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.player {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  overflow: hidden;
  border: var(--stroke) solid var(--c-line-soft);
  border-left: 5px solid var(--c-blue);
  border-radius: var(--radius-sm);
  color: var(--c-ink);
  background: var(--c-white);
  box-shadow: 0 4px 12px var(--c-shade-card);
  font-size: 16px;
  font-weight: 800;
}

.player:nth-child(even) { border-left-color: var(--c-cyan); }
.player > span:first-child { font-size: 23px; }

.player b {
  max-width: 12em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player .tag {
  flex: none;
  padding: 3px 9px;
  border: var(--stroke-thin) solid var(--c-line);
  border-radius: var(--radius-pill);
  color: var(--c-white);
  background: var(--c-line);
  font-size: 12px;
  font-weight: 850;
}

.player .kickBtn,
.player .stats { margin-left: auto; }
.player .stats { color: var(--c-ink-dim); font-size: 13px; }
.player.offline { opacity: 0.57; border-left-color: var(--c-offline); }

.player.offline b::after {
  content: " / offline";
  color: var(--c-ink-dim);
  font-size: 11px;
  font-weight: 650;
}

.roomcode {
  padding: 14px 8px;
  border: var(--stroke) solid var(--c-line);
  border-radius: var(--radius-btn);
  color: var(--c-white);
  background:
    linear-gradient(90deg, transparent 49.6%, var(--c-white-a22) 49.6% 50.4%, transparent 50.4%),
    var(--c-blue);
  border-color: var(--c-blue-deep);
  box-shadow: 0 14px 32px var(--c-glow-blue-25);
  font-size: clamp(52px, 15vw, 76px);
  line-height: 1;
  font-weight: 950;
  text-align: center;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 var(--hs-3) 0 var(--c-blue-deep);
}

.qr-wrap {
  display: inline-block;
  margin: 4px auto;
  padding: 10px;
  border: var(--stroke) solid var(--c-line);
  border-radius: var(--radius-btn);
  background: var(--c-white);
  border-color: var(--c-line-soft);
  box-shadow: var(--shadow-soft-sm);
}

.qr-wrap canvas {
  display: block;
  max-width: 100%;
  border-radius: 2px;
}

.stick-stage {
  display: flex;
  flex-direction: column;
  min-height: 620px;
  padding: 30px 20px;
  overflow: hidden;
  align-items: center;
  gap: 20px;
  background:
    linear-gradient(90deg, var(--c-grid) 1px, transparent 1px),
    linear-gradient(var(--c-grid-h) 1px, transparent 1px),
    var(--c-card-frost);
  background-size: 24px 24px, 24px 24px, auto;
}

.stick-stage::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 84px;
  background: linear-gradient(105deg, var(--c-blue) 0 70%, var(--c-cyan) 70% 88%, var(--c-line) 88% 100%);
}

.stick-cup {
  position: relative;
  width: 138px;
  height: 174px;
  margin-top: 88px;
  border: var(--stroke-bold) solid var(--c-line);
  border-radius: 8px 8px 38px 38px;
  background:
    linear-gradient(90deg, transparent 0 14%, var(--c-white-a70) 14% 18%, transparent 18% 100%),
    linear-gradient(150deg, var(--c-tint-cup-top) 0%, var(--c-white) 27%, var(--c-blue-mid) 58%, var(--c-blue) 100%);
  box-shadow: inset -14px -16px 22px var(--c-cup-inner), 8px 10px 0 var(--c-line), 0 20px 40px var(--c-glow-blue-22);
  will-change: transform;
}

.stick-cup::before {
  content: "";
  position: absolute;
  inset: -13px 12px auto;
  height: 20px;
  border: var(--stroke-bold) solid var(--c-line);
  border-radius: 50%;
  background: linear-gradient(180deg, var(--c-white), var(--c-blue-pale));
}

.stick-cup::after {
  content: "100";
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  padding: 4px 8px;
  border: var(--stroke) solid var(--c-line);
  color: var(--c-white);
  background: var(--c-line);
  font-size: 24px;
  line-height: 1;
  font-weight: 950;
}

.stick-cup .stick {
  position: absolute;
  top: -70px;
  width: 10px;
  height: 92px;
  border: var(--stroke) solid var(--c-line);
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(90deg, var(--c-white), var(--c-cyan-soft) 48%, var(--c-blue));
}

.stick-cup .s1 { left: 24px; transform: rotate(-8deg); }
.stick-cup .s2 { left: 62px; top: -82px; }
.stick-cup .s3 { left: 100px; transform: rotate(7deg); }

.shaking { animation: shake 0.5s ease-in-out infinite; }

@keyframes shake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-9deg) translateX(-4px); }
  75% { transform: rotate(9deg) translateX(4px); }
}

.stick-out {
  max-width: 100%;
  padding: 16px 20px;
  overflow-wrap: anywhere;
  border: var(--stroke) solid var(--c-line);
  border-radius: var(--radius-sm);
  color: var(--c-ink);
  background: var(--c-yellow);
  box-shadow: var(--hs-7) var(--hs-7) 0 var(--c-line);
  font-size: 21px;
  line-height: 1.35;
  font-weight: 950;
  text-align: center;
  animation: stickPop 0.55s cubic-bezier(0.2, 1.6, 0.4, 1);
}

@keyframes stickPop {
  from { opacity: 0; transform: translateY(60px) scale(0.5); }
  to { opacity: 1; transform: none; }
}

@keyframes pop {
  from { opacity: 0; transform: translateY(16px) scale(0.94); }
  to { opacity: 1; transform: none; }
}

.progress-track {
  width: 100%;
  max-width: 300px;
  height: 14px;
  overflow: hidden;
  border: var(--stroke) solid var(--c-line);
  border-radius: var(--radius-pill);
  background: var(--c-white);
  box-shadow: 0 var(--hs-3) 0 var(--c-silver);
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--c-blue), var(--c-cyan));
  transition: width 0.15s ease;
}

.score-val {
  color: var(--c-blue);
  font-size: clamp(90px, 24vw, 132px);
  line-height: 0.98;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  text-align: center;
  text-shadow: var(--hs-5) var(--hs-5) 0 var(--c-cyan), var(--hs-8) var(--hs-8) 0 var(--c-ink-a16);
  transition: transform 0.1s ease;
}

.score-val.bump { animation: bump 0.18s ease; }

@keyframes bump { 40% { transform: scale(1.1); } }

input[type="range"] {
  width: 100%;
  height: 58px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
  touch-action: pan-x;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 18px;
  border: var(--stroke) solid var(--c-line);
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--c-tint-track) 0 18%, var(--c-blue) 52%, var(--c-cyan) 100%);
  box-shadow: 0 var(--hs-3) 0 var(--c-silver);
}

input[type="range"]::-webkit-slider-thumb {
  width: 46px;
  height: 46px;
  margin-top: -15px;
  appearance: none;
  -webkit-appearance: none;
  border: var(--stroke-bold) solid var(--c-line);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, var(--c-white) 0 20%, var(--c-cyan) 22% 100%);
  box-shadow: 0 var(--hs-3) 0 var(--c-blue-deep), 0 9px 18px var(--c-glow-blue-18);
}

input[type="range"]::-moz-range-track {
  height: 18px;
  border: var(--stroke) solid var(--c-line);
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--c-tint-track) 0 18%, var(--c-blue) 52%, var(--c-cyan) 100%);
}

input[type="range"]::-moz-range-thumb {
  width: 46px;
  height: 46px;
  border: var(--stroke-bold) solid var(--c-line);
  border-radius: 50%;
  background: var(--c-cyan);
  box-shadow: 0 var(--hs-3) 0 var(--c-blue-deep);
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: -4px;
  padding: 0 18px;
  color: var(--c-ink-dim);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.question-card {
  overflow: hidden;
  border-left: 8px solid var(--c-blue);
  font-size: clamp(20px, 5vw, 25px);
  line-height: 1.5;
  font-weight: 900;
}

.question-card::before {
  content: "Q";
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 12px;
  place-items: center;
  border: var(--stroke) solid var(--c-line);
  color: var(--c-white);
  background: var(--c-blue);
  box-shadow: var(--hs-2) var(--hs-2) 0 var(--c-cyan);
  font-size: 18px;
  font-weight: 950;
}

.question-card .spice {
  margin-top: 10px;
  color: var(--c-red);
  font-size: 14px;
}

.reveal-row {
  position: relative;
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: var(--stroke) solid var(--c-line-soft);
  border-radius: var(--radius-sm);
  color: var(--c-ink);
  background: var(--c-white);
  box-shadow: 0 4px 12px var(--c-shade-card);
  font-size: 16px;
  font-weight: 800;
}

.reveal-row b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reveal-row .g {
  flex: none;
  margin-left: auto;
  color: var(--c-ink);
  font-size: 25px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.reveal-row.drink {
  border-color: var(--c-red);
  background: var(--c-tint-drink);
  box-shadow: var(--hs-5) 0 0 var(--c-red) inset;
}

.reveal-row.exact {
  border-color: var(--c-line);
  background: var(--c-tint-exact);
  box-shadow: var(--hs-5) 0 0 var(--c-yellow) inset;
}

.badge {
  flex: none;
  padding: 3px 8px;
  border: var(--stroke-thin) solid var(--c-line);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 900;
}

.badge.drink { color: var(--c-white); background: var(--c-red); }
.badge.exact { color: var(--c-ink); background: var(--c-yellow); }

.big-score {
  color: var(--c-blue);
  font-size: clamp(82px, 22vw, 124px);
  line-height: 1;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  text-align: center;
  text-shadow: var(--hs-5) var(--hs-5) 0 var(--c-cyan);
}

.big-score .unit {
  margin-left: 5px;
  color: var(--c-ink);
  font-size: 28px;
  font-weight: 950;
  text-shadow: none;
}

.seq {
  opacity: 0;
  animation: rise 0.34s cubic-bezier(0.2, 0.9, 0.3, 1) both;
  animation-delay: var(--d, 0s);
}

.seq-pop {
  opacity: 0;
  animation: badgeIn 0.3s cubic-bezier(0.2, 1.5, 0.4, 1) both;
  animation-delay: var(--d, 0s);
}

@keyframes badgeIn {
  from { opacity: 0; transform: scale(0.3); }
  to { opacity: 1; transform: scale(1); }
}

.seq-score {
  opacity: 0;
  animation: scoreSlam 0.42s cubic-bezier(0.2, 1.4, 0.35, 1) both;
  animation-delay: var(--d, 0s);
}

@keyframes scoreSlam {
  from { opacity: 0; transform: scale(1.8); filter: blur(6px); }
  60% { opacity: 1; filter: none; }
  to { opacity: 1; transform: scale(1); }
}

.drink-shake {
  opacity: 1 !important;
  animation: drinkShake 0.45s ease both;
  animation-delay: 0s;
}

@keyframes drinkShake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-6px); }
  35% { transform: translateX(5px); }
  55% { transform: translateX(-4px); }
  75% { transform: translateX(3px); }
}

.float-txt {
  position: absolute;
  z-index: 5;
  top: 4px;
  right: 52px;
  color: var(--c-red);
  font-size: 16px;
  font-weight: 950;
  text-shadow: 0 var(--hs-2) 0 var(--c-white);
  pointer-events: none;
  animation: floatUp 0.6s ease-out both;
  animation-delay: var(--d, 0s);
}

@keyframes floatUp {
  from { opacity: 0; transform: translateY(6px) scale(0.7); }
  25% { opacity: 1; transform: translateY(-4px) scale(1.1); }
  to { opacity: 0; transform: translateY(-26px); }
}

.fx-layer {
  position: fixed;
  z-index: 200;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.fx-layer .confetti {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 15px;
  border: var(--stroke-thin) solid var(--c-ink-a45);
  border-radius: 2px;
  animation: confettiFall 0.6s cubic-bezier(0.3, 0.6, 0.6, 1) both;
  will-change: transform, opacity;
}

@keyframes confettiFall {
  from { opacity: 1; transform: translate(0, 0) rotate(0); }
  to { opacity: 0; transform: translate(var(--dx, 0), var(--dy, 80vh)) rotate(var(--rot, 540deg)); }
}

.fx-layer .cheer {
  position: absolute;
  font-size: 30px;
  animation: cheerPop 0.55s cubic-bezier(0.2, 1.2, 0.4, 1) both;
  will-change: transform, opacity;
}

@keyframes cheerPop {
  from { opacity: 0; transform: translate(0, 0) scale(0.4); }
  30% { opacity: 1; transform: translate(calc(var(--dx, 0) * 0.5), calc(var(--dy, 0) * 0.5)) scale(1.2); }
  to { opacity: 0; transform: translate(var(--dx, 0), var(--dy, 0)); }
}

.flip-scene {
  perspective: 1200px;
}

.flip-card {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4.15;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.35, 0.1, 0.25, 1.2);
}

.flip-card.flipped { transform: rotateY(180deg); }

.flip-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: var(--stroke) solid var(--c-line);
  border-radius: var(--radius-card);
  background: var(--c-white);
  border-color: var(--c-line-soft);
  box-shadow: 0 22px 58px var(--c-glow-blue-18), 0 2px 0 var(--c-cyan) inset;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flip-face.back {
  gap: 10px;
  padding: 20px;
  overflow-y: auto;
  background:
    linear-gradient(90deg, var(--c-grid) 1px, transparent 1px),
    linear-gradient(var(--c-grid-h) 1px, transparent 1px),
    var(--c-tint-flip-back);
  background-size: 24px 24px, 24px 24px, auto;
  box-shadow: 0 22px 58px var(--c-glow-blue-18), 0 2px 0 var(--c-cyan) inset;
  transform: rotateY(180deg);
}

.art-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-bottom: var(--stroke) solid var(--c-line);
  background: linear-gradient(110deg, var(--c-tint-shimmer-a) 38%, var(--c-white) 50%, var(--c-tint-shimmer-b) 62%);
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
}

.art-wrap.loaded {
  background: var(--c-ice);
  animation: none;
}

@keyframes shimmer {
  from { background-position: 130% 0; }
  to { background-position: -90% 0; }
}

.art-wrap::before {
  content: "ART LOADING";
  position: absolute;
  top: 50%;
  left: 50%;
  color: var(--c-ink-soft);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
  transform: translate(-50%, -50%);
}

.art-wrap.loaded::before { content: none; }

.art-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.art-wrap.loaded img { opacity: 1; }

.flip-face .caption {
  padding: 14px;
  border-top: 6px solid var(--c-cyan);
  text-align: center;
  background: var(--c-white);
}

.flip-face .caption b { font-size: 22px; }

.detail-item {
  padding: 12px;
  border: var(--stroke) solid var(--c-line-soft);
  border-left: 4px solid var(--c-blue);
  border-radius: var(--radius-sm);
  color: var(--c-ink);
  background: var(--c-white);
  box-shadow: 0 4px 10px var(--c-shade-card);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 700;
}

.flip-hint {
  color: var(--c-ink-soft);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 750;
  text-align: center;
}

.poster-img {
  /* 海报是 1080×1920 竖图，桌面端宽容器下按宽度铺满会拉得极高，改为限高等比缩放 */
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 78vh;
  margin: 0 auto;
  border: var(--stroke) solid var(--c-line);
  border-radius: var(--radius-btn);
  border-color: var(--c-line-soft);
  box-shadow: 0 22px 52px var(--c-glow-blue-18);
  animation: pop 0.35s ease;
}

.toast {
  position: fixed;
  z-index: 300;
  left: 50%;
  bottom: 90px;
  max-width: 84vw;
  padding: 12px 18px;
  border: var(--stroke) solid var(--c-white);
  border-radius: var(--radius-sm);
  color: var(--c-white);
  background: var(--c-ink);
  box-shadow: 0 0 0 2px var(--c-blue), 0 16px 34px var(--c-ink-a25);
  font-size: 15px;
  font-weight: 750;
  text-align: center;
  transform: translateX(-50%);
  animation: pop 0.3s ease;
}

/* 断线提示条：自动重连中为提示态，重连放弃后变成可点的手动重连按钮 */
.reconnect-bar {
  position: fixed;
  z-index: 320;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  left: 50%;
  max-width: 88vw;
  padding: 10px 16px;
  border: var(--stroke) solid var(--c-white);
  border-radius: var(--radius-sm);
  color: var(--c-white);
  background: var(--c-red);
  box-shadow: 0 12px 28px var(--c-ink-a25);
  font-size: 14px;
  font-weight: 800;
  font-family: inherit;
  transform: translateX(-50%);
  cursor: pointer;
}

.reconnect-bar.retrying {
  background: var(--c-ink);
  cursor: default;
}

.boot {
  margin-top: 40vh;
  color: var(--c-ink);
  font-weight: 800;
  text-align: center;
}

.light-panel {
  overflow: hidden;
  border-color: var(--c-line);
  background:
    linear-gradient(90deg, var(--c-grid) 1px, transparent 1px),
    var(--c-white);
  background-size: 24px 24px, auto;
}

.lamp-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
}

.lamp {
  width: 22px;
  height: 22px;
  border: var(--stroke) solid var(--c-line);
  border-radius: 50%;
  background: var(--c-disabled-bg);
  box-shadow: inset 0 -3px 0 var(--c-ink-a14);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.lamp.on {
  background: radial-gradient(circle at 34% 30%, var(--c-white) 0 18%, var(--c-cyan) 20% 52%, var(--c-blue) 74%);
  box-shadow: 0 0 15px var(--c-glow-cyan), var(--hs-2) var(--hs-2) 0 var(--c-line);
  animation: lampPulse 1.6s ease-in-out infinite;
}

.lamp.dead {
  background: var(--c-ink);
  opacity: 0.9;
}

@keyframes lampPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.16); }
}

.light-count {
  color: var(--c-ink);
  font-size: 18px;
  font-weight: 900;
}

.light-count .neon { font-size: 26px; }
.light-btns { width: 100%; }

.btn.light-burst {
  color: var(--c-ink);
  background: var(--c-yellow);
  box-shadow: 0 var(--hs-5) 0 var(--c-line), 0 12px 24px var(--c-glow-lime);
}

.btn.light-burst:hover:not(:disabled) { background: var(--c-yellow-deep); }

.btn.light-off {
  color: var(--c-white);
  background: var(--c-ink);
  box-shadow: 0 var(--hs-5) 0 var(--c-ink-dim);
}

.heart-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0 20%, var(--c-glow-cyan-soft) 20% 55%, var(--c-glow-blue-28) 55% 80%, transparent 80%);
  animation: glowFade 1.05s ease-out both;
}

@keyframes glowFade {
  from { opacity: 0; transform: scale(0.8); }
  25% { opacity: 1; }
  to { opacity: 0; transform: scale(1.08); }
}

.fx-heart {
  position: absolute;
  font-size: 32px;
  animation: heartFly 0.95s cubic-bezier(0.2, 1, 0.4, 1) both;
  will-change: transform, opacity;
}

@keyframes heartFly {
  from { opacity: 0; transform: translate(0, 0) scale(0.3); }
  25% { opacity: 1; transform: translate(calc(var(--dx) * 0.4), calc(var(--dy) * 0.4)) scale(1.25); }
  to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.8); }
}

.fx-layer.lamp-off {
  background: var(--c-ink);
  animation: lampOffCurtain 0.65s ease-in-out both;
}

@keyframes lampOffCurtain {
  from { opacity: 0; }
  35% { opacity: 0.86; }
  to { opacity: 0; }
}

.dm-layer {
  position: fixed;
  z-index: 250;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.dm-item {
  position: absolute;
  left: 100vw;
  padding: 7px 14px;
  border: var(--stroke) solid var(--c-line);
  border-radius: var(--radius-pill);
  color: var(--c-ink);
  background: var(--c-card);
  box-shadow: var(--hs-4) var(--hs-4) 0 var(--c-cyan);
  font-size: 15px;
  font-weight: 850;
  white-space: nowrap;
  animation: dmFly linear both;
  will-change: transform;
}

@keyframes dmFly {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-100vw - 100%)); }
}

.dm-item.dm-emoji {
  border: none;
  background: transparent;
  box-shadow: none;
  filter: drop-shadow(var(--hs-2) var(--hs-2) 0 var(--c-ink-a28));
  font-size: 34px;
}

.dm-item.dm-burst {
  color: var(--c-ink);
  background: var(--c-yellow);
  box-shadow: var(--hs-4) var(--hs-4) 0 var(--c-line), 0 0 22px var(--c-glow-yellow);
}

.dm-item.dm-off {
  color: var(--c-white);
  background: var(--c-ink);
  box-shadow: var(--hs-4) var(--hs-4) 0 var(--c-ink-mute);
}

.dm-bar {
  position: fixed;
  z-index: 260;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom));
  display: flex;
  width: min(660px, calc(100vw - 24px));
  align-items: center;
  gap: 8px;
  padding: 7px 8px 7px 10px;
  border: var(--stroke) solid var(--c-line);
  border-radius: var(--radius-pill);
  background: var(--c-card-bar);
  box-shadow: 0 var(--hs-8) 0 var(--c-glow-blue-22), 0 18px 40px var(--c-ink-a20);
  transform: translateX(-50%);
  backdrop-filter: blur(16px);
}

.dm-quick {
  display: flex;
  flex: none;
  gap: 2px;
}

.dm-q {
  min-width: 44px;
  min-height: 44px;
  padding: 3px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 21px;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.dm-q:active { transform: scale(1.25); }

.dm-bar input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 7px 4px;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 15px;
}

.dm-bar input:focus {
  border: 0;
  box-shadow: none;
}

.dm-send { flex: none; }

body.has-dmbar .app {
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

.chat-fab {
  position: fixed;
  z-index: 270;
  right: 14px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  width: 56px;
  height: 56px;
  border: var(--stroke) solid var(--c-line);
  border-radius: 50%;
  background: var(--c-blue);
  box-shadow: 0 var(--hs-5) 0 var(--c-line), 0 14px 26px var(--c-glow-blue-25);
  font-size: 25px;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.chat-fab:active { transform: translateY(3px); }

body:not(.has-dmbar) .chat-fab {
  bottom: calc(16px + env(safe-area-inset-bottom));
}

.chat-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 23px;
  height: 23px;
  padding: 0 5px;
  border: var(--stroke) solid var(--c-line);
  border-radius: var(--radius-pill);
  color: var(--c-ink);
  color: var(--c-white);
  background: var(--c-blue);
  font-size: 12px;
  line-height: 20px;
  font-weight: 950;
}

.chat-mask {
  position: fixed;
  z-index: 280;
  inset: 0;
  background: var(--c-ink-a52);
  backdrop-filter: blur(3px);
}

.chat-drawer {
  position: fixed;
  z-index: 290;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  width: min(380px, 92vw);
  flex-direction: column;
  border-left: var(--stroke) solid var(--c-line);
  background: var(--c-paper);
  box-shadow: calc(-1 * var(--hs-10)) 0 0 var(--c-blue), -22px 0 60px var(--c-ink-a25);
  transform: translateX(110%);
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.chat-drawer.open { transform: none; }

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(18px, env(safe-area-inset-top)) 16px 14px;
  border-bottom: var(--stroke) solid var(--c-line);
  color: var(--c-white);
  background: var(--c-blue);
  font-size: 18px;
}

.chat-close {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: var(--stroke) solid var(--c-line);
  border-radius: var(--radius-sm);
  color: var(--c-ink);
  background: var(--c-white);
  box-shadow: 0 var(--hs-3) 0 var(--c-line);
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
}

.chat-msgs {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 14px;
}

.chat-msg {
  max-width: 94%;
  padding: 9px 11px;
  border: var(--stroke) solid var(--c-line-soft);
  border-radius: var(--radius-sm);
  background: var(--c-white);
  box-shadow: 0 4px 10px var(--c-shade-card);
  cursor: pointer;
}

.chat-msg.mine {
  align-self: flex-end;
  border-color: var(--c-blue);
  background: var(--c-ice);
}

.cm-head {
  margin-bottom: 3px;
  color: var(--c-ink-soft);
  font-size: 12px;
  font-weight: 850;
}

.cm-text {
  overflow-wrap: anywhere;
  color: var(--c-ink);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 650;
}

.cm-reacts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.cm-reacts:empty { display: none; }

.react-chip {
  min-height: 44px;
  padding: 2px 8px;
  border: var(--stroke-thin) solid var(--c-line-soft);
  border-radius: var(--radius-pill);
  color: var(--c-ink);
  background: var(--c-tint-chip);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.react-chip.mine {
  border-color: var(--c-blue);
  color: var(--c-blue-deep);
  background: var(--c-ice);
}

.emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
  padding: 6px;
  border: var(--stroke) solid var(--c-line);
  border-radius: var(--radius-sm);
  background: var(--c-white);
  box-shadow: 0 6px 16px var(--c-shade-card-md);
  animation: pop 0.18s ease;
}

.picker-e {
  min-width: 44px;
  min-height: 44px;
  padding: 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 21px;
  cursor: pointer;
}

.picker-e:active { background: var(--c-ice); transform: scale(1.12); }

.chat-input {
  display: flex;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: var(--stroke) solid var(--c-line);
  background: var(--c-white);
}

.chat-input input {
  flex: 1;
  min-height: 44px;
  padding: 9px;
  font-size: 15px;
}

/* Aha report: portrait -> match file -> chemistry */
.aha-stage-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border: var(--stroke) solid var(--c-line);
  border-radius: var(--radius-btn);
  background: var(--c-card-glass);
  box-shadow: var(--shadow-soft-sm);
}

.aha-stage-nav button {
  display: flex;
  min-width: 0;
  min-height: 58px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  padding: 8px 10px;
  border: var(--stroke-thin) solid transparent;
  border-radius: var(--radius-sm);
  color: var(--c-ink-soft);
  background: transparent;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
}

.aha-stage-nav button span {
  color: var(--c-blue);
  font-size: 11px;
  font-weight: 950;
}

.aha-stage-nav button.active {
  border-color: var(--c-line);
  color: var(--c-white);
  background: var(--c-blue);
  box-shadow: 0 var(--hs-4) 0 var(--c-line);
}

.aha-stage-nav button.active span { color: var(--c-cyan); }

.aha-stage {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: var(--stroke) solid var(--c-line);
  border-radius: var(--radius-card);
  background: var(--c-white);
  border-color: var(--c-line-soft);
  box-shadow: 0 24px 58px var(--c-glow-blue-16), 0 2px 0 var(--c-cyan) inset;
}

.portrait-stage {
  display: flex;
  flex-direction: column;
}

.portrait-stage .art-wrap {
  flex: none;
  width: 100%;
  aspect-ratio: 3 / 3.72;
}

/* 桌面端容器很宽，竖图按 100% 宽会被 aspect-ratio 撑到超出视口，改按视口高度限宽 */
@media (min-width: 720px) {
  .portrait-stage {
    max-width: calc(58vh * 3 / 3.72);
    margin-inline: auto;
  }
}

.art-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--c-ink);
  background:
    linear-gradient(90deg, var(--c-grid-bold) 1px, transparent 1px),
    linear-gradient(var(--c-grid) 1px, transparent 1px),
    linear-gradient(140deg, var(--c-white) 0 42%, var(--c-ice) 42% 74%, var(--c-tint-sky) 74% 100%);
  background-size: 28px 28px, 28px 28px, 100% 100%;
}

.art-fallback::before {
  content: "100% MATCH";
  padding: 7px 10px;
  border: var(--stroke) solid var(--c-line);
  color: var(--c-white);
  background: var(--c-blue);
  box-shadow: var(--hs-4) var(--hs-4) 0 var(--c-cyan);
  font-size: 12px;
  font-weight: 950;
}

.art-fallback b {
  max-width: 80%;
  font-size: clamp(34px, 9vw, 48px);
  line-height: 1;
  font-weight: 950;
  text-align: center;
}

.art-fallback span {
  color: var(--c-ink-soft);
  font-size: 15px;
  font-weight: 800;
}

.art-wrap img { z-index: 1; }

.art-wrap.failed::before { content: none; }
.art-wrap.failed .archetype-chip { z-index: 2; }

.archetype-chip {
  position: absolute;
  z-index: 3;
  top: 14px;
  right: 14px;
  max-width: calc(100% - 28px);
  padding: 7px 11px;
  border: var(--stroke) solid var(--c-line);
  border-radius: var(--radius-pill);
  color: var(--c-ink);
  background: var(--c-card);
  box-shadow: var(--hs-4) var(--hs-4) 0 var(--profile-accent, var(--c-cyan));
  font-size: 13px;
  font-weight: 900;
}

.portrait-stage > .caption {
  position: relative;
  padding: 16px 18px 18px;
  border-top: 7px solid var(--profile-accent, var(--c-cyan));
  background: var(--c-white);
}

.portrait-stage > .caption::after {
  content: "";
  position: absolute;
  top: -7px;
  right: 0;
  width: 34%;
  height: 7px;
  background: var(--profile-primary, var(--c-blue));
}

.ideal-name {
  display: block;
  color: var(--c-ink);
  font-size: clamp(28px, 7vw, 38px);
  line-height: 1.04;
  font-weight: 950;
}

.ideal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 9px 0;
}

.ideal-meta span,
.keyword-row span,
.chemistry-tag {
  padding: 5px 9px;
  border: var(--stroke-thin) solid var(--c-line);
  border-radius: var(--radius-pill);
  color: var(--c-ink);
  background: var(--c-ice);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 900;
}

.ideal-meta span:first-child {
  color: var(--c-white);
  background: var(--profile-primary, var(--c-blue));
}

.profile-stage,
.relationship-stage {
  min-height: 520px;
  padding: 24px;
  background:
    linear-gradient(90deg, var(--c-grid-h-strong) 1px, transparent 1px),
    linear-gradient(var(--c-grid-h-soft) 1px, transparent 1px),
    var(--c-white);
  background-size: 26px 26px, 26px 26px, auto;
}

.profile-stage::before,
.relationship-stage::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 34%;
  height: 9px;
  background: var(--profile-accent, var(--c-cyan));
  border-left: 46px solid var(--profile-primary, var(--c-blue));
}

.profile-kicker {
  display: inline-flex;
  margin-bottom: 18px;
  padding: 6px 9px;
  border: var(--stroke) solid var(--c-line);
  color: var(--c-white);
  background: var(--c-ink);
  box-shadow: var(--hs-4) var(--hs-4) 0 var(--profile-accent, var(--c-cyan));
  font-size: 11px;
  font-weight: 950;
}

.profile-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: var(--stroke) solid var(--c-line);
}

.profile-title-row > div { min-width: 0; }

.mbti-badge {
  flex: none;
  padding: 9px 11px;
  border: var(--stroke) solid var(--c-line);
  border-radius: var(--radius-sm);
  color: var(--c-white);
  background: var(--profile-primary, var(--c-blue));
  box-shadow: var(--hs-4) var(--hs-4) 0 var(--profile-accent, var(--c-cyan));
  font-size: 16px;
  line-height: 1;
  font-weight: 950;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.profile-grid > div {
  min-width: 0;
  padding: 11px 12px;
  border: var(--stroke) solid var(--c-line-soft);
  border-left: 4px solid var(--profile-primary, var(--c-blue));
  border-radius: var(--radius-sm);
  background: var(--c-card);
  box-shadow: 0 4px 12px var(--c-shade-card);
}

.profile-grid > div.wide { grid-column: 1 / -1; }

.profile-grid span {
  display: block;
  margin-bottom: 3px;
  color: var(--c-ink-dim);
  font-size: 11px;
  font-weight: 800;
}

.profile-grid b {
  display: block;
  overflow-wrap: anywhere;
  color: var(--c-ink);
  font-size: 15px;
  line-height: 1.35;
  font-weight: 900;
}

.keyword-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.keyword-row span:nth-child(2n) { background: var(--c-ice); }

.profile-bio {
  margin-top: 14px;
  padding: 13px 14px;
  border: var(--stroke) solid var(--c-line);
  border-radius: var(--radius-sm);
  color: var(--c-ink);
  background: var(--c-white);
  border-color: var(--c-line-soft);
  box-shadow: var(--shadow-soft-sm);
  font-size: 15px;
  line-height: 1.65;
  font-weight: 700;
}

.fiction-note {
  margin-top: 14px;
  color: var(--c-ink-dim);
  font-size: 11px;
  line-height: 1.45;
  font-weight: 700;
}

.relationship-stage h2 {
  max-width: 90%;
  margin-bottom: 10px;
  font-size: clamp(26px, 7vw, 38px);
  line-height: 1.1;
}

.chemistry-tag {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--c-ink);
  border-color: var(--c-blue);
  color: var(--c-blue-deep);
  background: var(--c-ice);
  box-shadow: none;
}

.relationship-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.relationship-list .detail-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  padding: 13px;
  border-color: var(--c-line);
  border-left: var(--stroke) solid var(--c-line);
}

.relationship-list .detail-item > span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: var(--stroke) solid var(--c-line);
  color: var(--c-white);
  background: var(--profile-primary, var(--c-blue));
  box-shadow: var(--hs-3) var(--hs-3) 0 var(--profile-accent, var(--c-cyan));
  font-size: 12px;
  font-weight: 950;
}

.relationship-list .detail-item p {
  color: var(--c-ink);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 700;
}

.stage-next {
  display: flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 11px 11px 16px;
  border: var(--stroke) solid var(--c-line);
  border-radius: var(--radius-btn);
  color: var(--c-ink);
  background: var(--c-white);
  border-color: var(--c-line-soft);
  box-shadow: var(--shadow-soft-sm);
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.stage-next span {
  display: grid;
  width: 34px;
  height: 34px;
  flex: none;
  place-items: center;
  border: var(--stroke) solid var(--c-line);
  border-radius: var(--radius-sm);
  color: var(--c-white);
  background: var(--c-blue);
  box-shadow: var(--hs-3) var(--hs-3) 0 var(--c-cyan);
  font-size: 20px;
}

.stage-next:hover { background: var(--c-ice); }

.btn.light-burst.selected,
.btn.light-off.selected {
  outline: 4px solid var(--c-cyan);
  outline-offset: 2px;
  box-shadow: 0 var(--hs-5) 0 var(--c-line), 0 0 0 7px var(--c-glow-blue-18);
}

/* Drinking ceremony: clean studio base, loud only at the beat. */
.chug-stage {
  position: relative;
  display: flex;
  min-height: 600px;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  overflow: hidden;
  padding: clamp(24px, 5vw, 42px);
  border: var(--stroke-thin) solid var(--c-line-soft);
  border-radius: var(--radius-card);
  background:
    linear-gradient(90deg, var(--c-grid) 1px, transparent 1px),
    linear-gradient(var(--c-grid-h) 1px, transparent 1px),
    linear-gradient(150deg, var(--c-white) 0 70%, var(--c-mist) 70% 100%);
  background-size: 32px 32px, 32px 32px, 100% 100%;
  box-shadow: 0 24px 58px var(--c-glow-blue-16);
  isolation: isolate;
}

.chug-stage::before {
  content: "DRINKING CEREMONY";
  position: absolute;
  z-index: -1;
  top: 22px;
  left: 24px;
  color: var(--c-blue);
  font-size: 11px;
  font-weight: 950;
}

.chug-stage::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 6px;
  background: linear-gradient(90deg, var(--c-blue) 0 78%, var(--c-cyan) 78% 100%);
}

.chug-title {
  color: var(--c-ink);
  font-size: clamp(36px, 9vw, 66px);
  line-height: 0.95;
  font-weight: 950;
  text-align: center;
  text-transform: uppercase;
}

.chug-beat {
  align-self: center;
  padding: 10px 18px;
  border: var(--stroke) solid var(--c-line);
  border-radius: var(--radius-sm);
  color: var(--c-ink);
  background: var(--c-yellow);
  box-shadow: 0 0 0 5px var(--c-glow-yellow-soft), 0 10px 26px var(--c-glow-lime);
  font-size: clamp(22px, 6vw, 34px);
  line-height: 1;
  font-weight: 950;
  text-align: center;
  animation: chugBeat 0.72s ease-in-out infinite;
}

@keyframes chugBeat {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.06); }
}

.drinkers-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.drinker-card {
  display: grid;
  min-width: 0;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: var(--stroke-thin) solid var(--c-line-soft);
  border-radius: var(--radius-sm);
  color: var(--c-ink);
  background: var(--c-white);
  box-shadow: var(--shadow-soft-sm);
}

.drinker-card.done {
  border-color: var(--c-cyan);
  background: var(--c-ice);
}

.drink-cup {
  display: grid;
  width: 48px;
  height: 52px;
  place-items: center;
  border: var(--stroke) solid var(--c-line);
  border-radius: 5px 5px 14px 14px;
  color: var(--c-ink);
  background: var(--c-yellow);
  box-shadow: inset 0 -9px 0 var(--c-glow-yellow-soft);
  font-size: 24px;
}

.drinker-card.done .drink-cup {
  color: var(--c-white);
  background: var(--c-cyan);
  box-shadow: inset 0 -9px 0 var(--c-glow-blue-18);
}

.drink-progress {
  grid-column: 2;
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--c-silver);
}

.drink-progress > span,
.drink-progress::before {
  display: block;
  width: var(--drink-progress, 0%);
  height: 100%;
  background: linear-gradient(90deg, var(--c-blue), var(--c-cyan));
  transition: width 0.24s ease;
}

.drink-progress::before { content: ""; }

.chug-actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.chug-actions > * { flex: 1; }

@media (max-width: 520px) {
  body {
    background-image:
      linear-gradient(90deg, var(--c-grid-mobile) 1px, transparent 1px),
      linear-gradient(var(--c-grid-h-soft) 1px, transparent 1px),
      linear-gradient(128deg, var(--c-white) 0 62%, var(--c-mist-mobile) 62% 100%);
    background-size: 28px 28px, 28px 28px, 100% 100%;
  }

  body::before {
    content: none;
  }

  .app {
    width: 100%;
    padding-right: 14px;
    padding-left: 14px;
    gap: 12px;
  }

  .app::before {
    width: 76px;
    height: 5px;
  }

  .glass { padding: 16px; }

  .row { gap: 8px; }

  .emoji-grid {
    grid-template-columns: repeat(5, minmax(46px, 1fr));
    gap: 6px;
  }

  .player b { max-width: 8.5em; }

  body:not(.has-dmbar) .player .kickBtn {
    margin-right: 58px;
  }

  .roomcode {
    font-size: 58px;
    box-shadow: 0 12px 28px var(--c-glow-blue-25);
  }

  .stick-stage {
    min-height: 610px;
    padding: 26px 14px;
  }

  .question-card { font-size: 21px; }

  .reveal-row {
    flex-wrap: wrap;
  }

  .reveal-row b {
    max-width: calc(100% - 54px);
  }

  .reveal-row .g {
    position: absolute;
    top: 10px;
    right: 12px;
  }

  .badge { margin-left: 31px; }

  .flip-card {
    aspect-ratio: 3 / 4.35;
  }

  .dm-bar {
    width: calc(100vw - 20px);
    padding-left: 7px;
  }

  .dm-quick .dm-q:nth-child(n + 4) { display: none; }

  .chat-fab { right: 10px; }

  .aha-stage-nav button {
    min-height: 56px;
    padding: 7px 6px;
    font-size: 11px;
  }

  .portrait-stage .art-wrap { aspect-ratio: 3 / 3.65; }

  .profile-stage,
  .relationship-stage {
    min-height: 500px;
    padding: 20px 17px;
  }

  .profile-title-row { gap: 10px; }

  .profile-title-row .ideal-name { font-size: 29px; }

  .profile-grid > div { padding: 10px; }

  .relationship-list .detail-item {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
    padding: 11px;
  }

  .relationship-list .detail-item > span {
    width: 32px;
    height: 32px;
  }

  .chug-stage {
    min-height: 560px;
    padding: 38px 16px 22px;
  }

  .drinkers-grid { grid-template-columns: 1fr; }

  .chug-actions { flex-direction: column; }
}

@media (min-width: 900px) {
  .app {
    padding-top: 38px;
    padding-bottom: 54px;
  }

  .glass { padding: 24px; }

  .stick-stage { min-height: 650px; }

  .flip-scene {
    width: min(100%, 560px);
    margin: 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
