* {
  box-sizing: border-box;
}
:root {
  --ink: #493326;
  --muted: #8c7663;
  --cream: #fff8eb;
  --accent: #289e8d;
  --paper: #fffdf6;
  --shadow: 0 12px 36px #68411b14;
  --player: #37b6b0;
}
html,
body {
  margin: 0;
  min-height: 100%;
  font-family: 'Jua', 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
  color: var(--ink);
}
button,
input,
a {
  -webkit-tap-highlight-color: transparent;
}
button,
input {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.48;
}
[hidden] {
  display: none !important;
}
a {
  color: inherit;
  text-decoration: none;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #2c98cb;
  outline-offset: 5px;
}
.wall {
  overflow: hidden;
  background: #f4e1c6;
}
.cafe-backdrop,
.scene-tint {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.cafe-backdrop {
  background: url('/assets/cafe-bg.webp') center/cover;
}
.scene-tint {
  background: linear-gradient(180deg, #fff5e4a3 0%, #fff4dd55 68%, #fff4e4ec 94%);
  transition: background 2s;
}
.wall-shell {
  position: relative;
  height: 100dvh;
  padding: clamp(22px, 3vh, 40px) clamp(26px, 3.8vw, 80px) 16px;
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.8vh, 24px);
}
.wall-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 65px;
  flex-shrink: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 1.4px;
}
.brand small {
  display: block;
  font-size: 12px;
  letter-spacing: 1px;
  color: #8b7761;
  margin-top: 6px;
  font-weight: 600;
}
.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: var(--ink);
  color: #fff7e6;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -3px;
}
.brand-mark span {
  font-size: 24px;
  align-self: flex-start;
  margin-top: 4px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 18px;
}
.connection {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.connection i,
.tiny-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.connection.offline i {
  background: #e38564;
}
.room-label {
  padding: 10px 14px;
  border: 1px solid #805d3030;
  border-radius: 10px;
  font-size: 11px;
  letter-spacing: 1.2px;
}
.room-label b {
  font-size: 15px;
  letter-spacing: 2px;
  margin-left: 6px;
}
.icon-button {
  width: 40px;
  height: 40px;
  background: #fff9ecaa;
  border: 1px solid #805d3028;
  border-radius: 50%;
  font-size: 23px;
  color: var(--ink);
}
.icon-button.active {
  background: var(--ink);
  color: #fff;
}
.wall-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 0.95fr 1.35fr 0.76fr;
  gap: 1.8vw;
  align-items: center;
}
.story-panel {
  padding-bottom: 20px;
  z-index: 2;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #866a4f;
}
.english-title {
  font-size: clamp(12px, 1.1vw, 20px);
  font-weight: 900;
  letter-spacing: 4px;
  color: var(--accent);
  margin: 24px 0 12px;
}
h1 {
  font-size: clamp(45px, 4.65vw, 90px);
  font-weight: 1000;
  line-height: 1.13;
  letter-spacing: -4px;
  margin: 0;
  text-shadow: 0 3px #fff4dc;
}
h1 span {
  color: var(--accent);
}
.story-description {
  font-size: clamp(15px, 1.25vw, 24px);
  line-height: 1.7;
  color: #80664d;
  margin: 24px 0;
}
.rule-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.rule-pills span {
  padding: 9px 14px;
  border-radius: 24px;
  border: 1px solid #97734635;
  background: #fff8e89c;
  font-size: 13px;
  font-weight: 700;
}
.goal-note {
  border-left: 3px solid var(--accent);
  padding: 0 0 0 18px;
  margin-top: 32px;
}
.goal-note > span {
  display: block;
  font-size: 12px;
  color: #997c61;
  letter-spacing: 1px;
}
.goal-note strong {
  display: block;
  font-size: clamp(22px, 2.1vw, 38px);
  letter-spacing: -1px;
  margin-top: 6px;
}
.goal-note p {
  font-size: 13px;
  color: #8f735d;
  margin: 7px 0 0;
}
.howto {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-top: 34px;
  color: #8a725c;
}
.step-number {
  color: var(--accent);
  font-weight: 900;
  font-size: 10px;
  border: 1px solid #9b8a6938;
  border-radius: 50%;
  padding: 5px;
}
.howto b {
  opacity: 0.4;
  margin: 0 4px;
}
.stage {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}
.stage-halo {
  position: absolute;
  inset: 3%;
  border-radius: 50%;
  background: radial-gradient(ellipse, #fff9d5dc 0%, #ffc26c40 62%, #ffdf8900 72%);
  animation: halo-breathe 4s ease-in-out infinite;
  transition: background 2s;
}
.orbit {
  position: absolute;
  border: 1px solid #fff8e5b3;
  border-radius: 50%;
  inset: 2%;
  transform: rotate(-20deg) scaleY(0.82);
}
.orbit-two {
  inset: 0;
  transform: rotate(30deg) scaleY(0.85);
  border-style: dashed;
  opacity: 0.6;
}
.cup-rig {
  position: relative;
  width: 105%;
  aspect-ratio: 1;
  animation: cup-breathe 3.5s ease-in-out infinite;
  transform-origin: 48% 85%;
  z-index: 2;
  filter: drop-shadow(0 18px 12px #72492318);
}
.cup-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
}
.iced-art {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s;
}
.mug-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.face-eyes {
  transform-origin: 41% 50%;
  animation: blink 5s infinite;
}
.sweat-drop {
  animation: sweat 2s infinite;
}
.cup-shadow {
  position: absolute;
  width: 70%;
  height: 10%;
  bottom: 10%;
  left: 10%;
  background: #734f2c33;
  filter: blur(14px);
  border-radius: 50%;
  animation: shadow-breathe 3.5s infinite;
}
.floating-note {
  position: absolute;
  z-index: 4;
  top: 1%;
  left: 12%;
  background: var(--paper);
  padding: 14px 23px;
  border-radius: 22px 22px 22px 2px;
  transform: rotate(-7deg);
  font-size: clamp(14px, 1.5vw, 25px);
  font-weight: 800;
  box-shadow: var(--shadow);
  animation: note-float 3s infinite;
}
.temperature-tag {
  position: absolute;
  right: 0%;
  top: 11%;
  z-index: 4;
  transform: rotate(7deg);
  color: #d87643;
  font-size: clamp(42px, 4.7vw, 90px);
  font-weight: 1000;
  line-height: 1;
  letter-spacing: -3px;
  text-shadow:
    3px 3px 0 #fff9eb,
    -2px -2px 0 #fff9eb;
}
.temperature-tag sup {
  font-size: 0.42em;
  vertical-align: top;
  line-height: 1.5;
  letter-spacing: -1px;
}
.temperature-tag small {
  display: block;
  font-size: 12px;
  letter-spacing: 0;
  text-align: center;
  color: #9e7454;
  margin-top: 8px;
  text-shadow: none;
}
.stage-caption {
  position: absolute;
  bottom: -3%;
  left: 0;
  right: 0;
  text-align: center;
  font-size: clamp(14px, 1.3vw, 22px);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 5;
}
.sparkle {
  color: #d7a44a;
  font-size: 24px;
  animation: twinkle 2s infinite;
}
.steam {
  position: absolute;
  left: 22%;
  top: -5%;
  width: 42%;
  height: 38%;
  z-index: 1;
  transition: opacity 1s;
}
.steam i {
  position: absolute;
  width: 15%;
  height: 70%;
  border-left: 12px solid #fffdf1b8;
  border-radius: 50%;
  filter: blur(3px);
  animation: steam-rise 2.8s infinite;
  bottom: 0;
}
.steam i:nth-child(2) {
  left: 28%;
  animation-delay: -1.4s;
  height: 90%;
}
.steam i:nth-child(3) {
  left: 55%;
  animation-delay: -0.7s;
}
.steam i:nth-child(4) {
  left: 80%;
  animation-delay: -2.1s;
  height: 50%;
}
.side-panel {
  z-index: 3;
}
.join-card,
.play-card {
  background: #fffdf4ef;
  border: 1.5px solid #fff;
  box-shadow: 0 16px 50px #6e452019;
  border-radius: 28px;
  padding: clamp(18px, 1.6vw, 30px);
  text-align: center;
}
.card-kicker {
  font-size: 10px;
  letter-spacing: 2px;
  color: #aa8c6b;
  font-weight: 800;
}
.join-card h2 {
  font-size: clamp(24px, 2.1vw, 40px);
  line-height: 1.35;
  letter-spacing: -1.6px;
  margin: 15px 0;
}
.qr-wrap {
  background: #fff;
  border: 1px solid #e9dfcd;
  border-radius: 16px;
  padding: 7px;
  max-width: 240px;
  width: 100%;
  aspect-ratio: 1;
  margin: 0 auto;
}
.qr-wrap img {
  width: 100%;
  height: 100%;
  display: block;
}
.join-card p {
  font-size: 12px;
  color: #9a8065;
  margin: 13px 0 8px;
}
.join-card a {
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: #6f9486;
}
.joined-count {
  font-size: 13px;
  color: #987e65;
  margin: 16px 0 12px;
}
.joined-count span {
  font-weight: 900;
  font-size: 23px;
  color: var(--accent);
}
.primary-button {
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 5px 0 #164b4628;
  padding: 17px 20px;
  font-size: 15px;
  font-weight: 800;
  width: 100%;
  transition:
    transform 0.15s,
    filter 0.15s;
}
.primary-button:not(:disabled):active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #164b4628;
}
.primary-button:not(:disabled):hover {
  filter: brightness(1.05);
}
.join-card > small {
  font-size: 10px;
  color: #aa9278;
  display: block;
  margin-top: 13px;
}
.instruction-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border-top: 1px solid #94735225;
  border-bottom: 1px solid #94735225;
  background: #fff9ec92;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px #2b9e8b15;
}
.strip-extra {
  margin-left: auto;
  font-size: 11px;
  letter-spacing: 1px;
  color: #a4896b;
  font-weight: 500;
}
.player-dock {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  flex-shrink: 0;
}
.player-card {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  padding: 15px 17px;
  background: #fffdf4e8;
  border-radius: 20px;
  border: 1.5px solid #fff;
  min-height: 95px;
  box-shadow: 0 4px 16px #6e45200b;
  overflow: hidden;
}
.player-card.empty {
  background: #fff9e972;
  border: 1.5px dashed #8f745c3b;
  box-shadow: none;
}
.player-icon {
  color: var(--slot-color);
  background: color-mix(in srgb, var(--slot-color) 13%, #fff);
  border-radius: 50%;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.player-icon svg {
  width: 46px;
  height: 46px;
}
.player-icon img {
  width: 56px;
  height: 56px;
}
.player-card.empty .player-icon {
  background: #e9e0cf75;
  color: #b9a58d;
  font-size: 26px;
  font-weight: 300;
}
.player-details {
  min-width: 0;
  flex: 1;
}
.player-details strong {
  font-size: 15px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-details small {
  display: block;
  font-size: 11px;
  color: #a28c74;
  margin-top: 6px;
}
.player-badge {
  font-size: 10px;
  color: var(--slot-color);
  font-weight: 800;
  border: 1px solid color-mix(in srgb, var(--slot-color) 35%, transparent);
  padding: 5px 7px;
  border-radius: 8px;
  white-space: nowrap;
}
.player-card.acted {
  animation: card-pop 0.4s ease-out;
}
.fan-blades {
  transform-origin: 50px 40px;
  animation: fan-spin 4s linear infinite;
}
.acted .fan-blades {
  animation: fan-spin 0.22s linear infinite;
}
.bottom-line {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #9c8268;
  letter-spacing: 1.6px;
  flex-shrink: 0;
}
.bottom-line span:last-child {
  letter-spacing: 0;
}
.play-card {
  padding-top: 30px;
  padding-bottom: 28px;
}
.timer-ring {
  width: 150px;
  height: 150px;
  border: 8px solid #d9eee5;
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 22px auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.timer-ring b {
  font-size: 64px;
  line-height: 1;
  letter-spacing: -3px;
  font-variant-numeric: tabular-nums;
}
.timer-ring small {
  font-size: 10px;
  color: #9e8771;
  margin-top: 7px;
}
.thermometer {
  height: 100px;
  width: 27px;
  border: 3px solid #baa188;
  padding: 4px;
  border-radius: 20px;
  margin: 20px auto 12px;
  display: flex;
  align-items: end;
  position: relative;
}
.thermometer div {
  width: 100%;
  height: 100%;
  border-radius: 20px;
  background: #ed9b6f;
  transition:
    height 0.3s,
    background 1s;
}
.thermometer:after {
  content: '';
  position: absolute;
  inset: auto -8px -13px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  border: 4px solid #fff7e5;
  box-shadow: 0 0 0 2px #baa188;
}
.target-label {
  font-size: 12px;
  color: #a0886c;
  margin: 23px 0;
}
.target-label strong {
  font-size: 24px;
  color: var(--accent);
  display: block;
  margin-top: 5px;
}
.team-meter {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
}
.team-meter > b {
  color: var(--accent);
}
.team-meter > div {
  width: 100%;
  height: 8px;
  background: #eee8d9;
  border-radius: 8px;
  overflow: hidden;
}
.team-meter i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 8px;
  transition: width 0.2s;
}
.play-encouragement {
  font-size: 12px;
  margin: 22px 0 0;
  color: #9c8167;
}
.countdown {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  background: #fff9e89e;
  backdrop-filter: blur(3px);
  border-radius: 50%;
  z-index: 10;
}
.countdown > span {
  font-size: clamp(100px, 13vw, 240px);
  font-weight: 900;
  color: var(--accent);
  text-shadow: 6px 6px #fff;
}
.countdown p {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
}
.countdown.pop > span {
  animation: count-pop 0.5s ease-out;
}
#effects {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 12;
}
.team-toast {
  position: fixed;
  left: 50%;
  top: 20%;
  transform: translate(-50%, 30px) rotate(-5deg) scale(0.8);
  font-size: clamp(30px, 5vw, 76px);
  font-weight: 1000;
  color: #fff9db;
  text-shadow:
    3px 3px #246f60,
    -3px -3px #246f60,
    3px -3px #246f60,
    -3px 3px #246f60;
  z-index: 25;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  text-align: center;
}
.team-toast small {
  display: block;
  font-size: 0.3em;
  letter-spacing: 3px;
  margin-top: 8px;
}
.team-toast.show {
  opacity: 1;
  transform: translate(-50%, 0) rotate(-5deg) scale(1);
}
.toast {
  position: fixed;
  z-index: 60;
  bottom: 30px;
  left: 50%;
  transform: translate(-50%, 20px);
  opacity: 0;
  background: #493326ee;
  color: #fff5e3;
  padding: 14px 22px;
  border-radius: 14px;
  max-width: 90vw;
  text-align: center;
  font-size: 14px;
  pointer-events: none;
  transition: 0.25s;
}
.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.result-overlay {
  position: fixed;
  inset: 0;
  background: #224c3c65;
  backdrop-filter: blur(10px);
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow: auto;
}
.result-card {
  width: min(550px, 90vw);
  background: #fffaf0;
  border: 5px solid #fff7e5;
  box-shadow: 0 30px 100px #2c3b3733;
  border-radius: 38px;
  text-align: center;
  padding: 30px 40px;
  position: relative;
  animation: result-enter 0.6s cubic-bezier(0.2, 0.7, 0.2, 1.3);
}
.result-card > p {
  font-size: 14px;
  color: #967d62;
  line-height: 1.7;
  margin: 10px 0;
}
.result-card h2 {
  font-size: 55px;
  letter-spacing: -3px;
  color: var(--accent);
  margin: 8px 0 0;
}
.result-cup {
  width: 220px;
  height: 210px;
  margin: -5px auto -12px;
  position: relative;
}
.result-cup img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.result-temperature {
  font-size: 45px;
  font-weight: 1000;
  letter-spacing: -2px;
  color: var(--accent);
}
.result-contributions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 20px 0;
}
.result-contributions div {
  background: #f2ebdd;
  border-radius: 13px;
  padding: 10px;
  flex: 1;
  min-width: 0;
}
.result-contributions strong {
  font-size: 12px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.result-contributions span {
  display: block;
  color: var(--accent);
  font-weight: 800;
  margin-top: 6px;
  font-size: 16px;
}
.result-card > .primary-button {
  margin-top: 4px;
}
.result-cup .cup-rig {
  width: 100%;
  height: 100%;
}
.result-cup .cup-art {
  height: 100%;
}
.wall[data-game='ice'] {
  --accent: #278dbe;
}
.wall[data-game='ice'] .scene-tint {
  background: linear-gradient(180deg, #f2faffbb, #e4f9ff6b 68%, #eaf6f9ec 94%);
}
.wall[data-game='ice'] .stage-halo {
  background: radial-gradient(ellipse, #f6fbffec, #7dd6ed54 60%, #c4eaff00 73%);
}
.wall[data-game='ice'] .temperature-tag {
  color: #e17b48;
}
.wall[data-game='ice'] .cup-rig {
  width: 99%;
}
.wall[data-game='ice'] .mug-face {
  display: none;
}
.wall[data-game='ice'] .floating-note {
  color: #905735;
}
.wall[data-phase='playing'] .stage-halo {
  background: radial-gradient(ellipse, #fffcebdc, #88ddca50 60%, #c8f0d600 73%);
}
.wall[data-phase='playing'] .story-description {
  color: #6d8975;
}
.wall[data-phase='playing'] .howto {
  display: none;
}
.wall[data-phase='playing'] .temperature-tag {
  color: var(--accent);
}
@keyframes cup-breathe {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-10px) rotate(1deg);
  }
}
@keyframes shadow-breathe {
  50% {
    transform: scale(0.91);
    opacity: 0.65;
  }
}
@keyframes halo-breathe {
  50% {
    transform: scale(1.04);
    opacity: 0.8;
  }
}
@keyframes note-float {
  50% {
    transform: translateY(-9px) rotate(-3deg);
  }
}
@keyframes blink {
  0%,
  42%,
  46%,
  100% {
    transform: scaleY(1);
  }
  44% {
    transform: scaleY(0.12);
  }
}
@keyframes steam-rise {
  0% {
    transform: translateY(20px) rotate(-8deg) scale(0.7);
    opacity: 0;
  }
  30% {
    opacity: 0.85;
  }
  100% {
    transform: translateY(-55px) rotate(15deg) scale(1.2);
    opacity: 0;
  }
}
@keyframes sweat {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  70% {
    transform: translateY(35px);
    opacity: 0;
  }
}
@keyframes twinkle {
  50% {
    transform: scale(0.7) rotate(30deg);
    opacity: 0.5;
  }
}
@keyframes fan-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes card-pop {
  40% {
    transform: translateY(-7px);
    box-shadow: 0 8px 25px color-mix(in srgb, var(--slot-color) 35%, transparent);
  }
}
@keyframes count-pop {
  from {
    transform: scale(1.4);
    opacity: 0.4;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes result-enter {
  from {
    transform: translateY(30px) scale(0.9);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@media (min-aspect-ratio: 16/8) {
  .wall-shell {
    gap: 10px;
    padding-top: 18px;
  }
  .wall-header {
    min-height: 52px;
  }
  .story-description {
    margin: 16px 0;
  }
  .goal-note {
    margin-top: 20px;
  }
  .howto {
    margin-top: 18px;
  }
  .stage {
    max-height: 63vh;
  }
  .join-card {
    padding: 18px;
  }
  .qr-wrap {
    max-width: 180px;
  }
  .join-card h2 {
    margin: 8px 0;
    font-size: 28px;
  }
  .player-card {
    min-height: 75px;
    padding: 10px 14px;
  }
  .player-icon {
    width: 48px;
    height: 48px;
  }
  .play-card {
    padding: 18px;
  }
  .timer-ring {
    width: 120px;
    height: 120px;
    margin: 10px auto;
  }
  .thermometer {
    height: 70px;
    margin: 10px auto;
  }
  .target-label {
    margin: 20px 0 12px;
  }
  .brand-mark {
    width: 45px;
    height: 45px;
  }
}
@media (max-width: 1250px) and (min-aspect-ratio: 1/1) {
  .wall-shell {
    padding: 20px 28px 12px;
    gap: 13px;
  }
  .wall-main {
    gap: 16px;
    grid-template-columns: 0.9fr 1.15fr 0.8fr;
  }
  .brand {
    font-size: 12px;
  }
  .brand small {
    font-size: 10px;
  }
  .header-right {
    gap: 8px;
  }
  .connection {
    font-size: 10px;
  }
  .story-description {
    font-size: 15px;
  }
  .goal-note {
    margin-top: 20px;
  }
  .howto {
    font-size: 10px;
    gap: 4px;
    margin-top: 20px;
  }
  .join-card {
    padding: 18px;
  }
  .join-card h2 {
    font-size: 27px;
  }
  .qr-wrap {
    max-width: 170px;
  }
  .join-card p {
    font-size: 10px;
  }
  .player-card {
    gap: 8px;
    padding: 12px 10px;
    min-height: 78px;
  }
  .player-icon {
    width: 44px;
    height: 44px;
  }
  .player-icon svg {
    width: 37px;
    height: 37px;
  }
  .player-details strong {
    font-size: 12px;
  }
  .player-details small {
    font-size: 10px;
  }
  .player-badge {
    font-size: 9px;
    padding: 4px;
  }
  .player-dock {
    gap: 10px;
  }
  .instruction-strip {
    font-size: 12px;
  }
  .temperature-tag {
    font-size: 52px;
  }
}
@media (max-aspect-ratio: 1/1) {
  .wall-shell {
    padding: 40px 45px 25px;
    gap: 24px;
  }
  .wall-header {
    min-height: 65px;
  }
  .brand {
    font-size: 15px;
  }
  .header-right {
    gap: 12px;
  }
  .wall-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 15px;
  }
  .story-panel {
    text-align: center;
    padding: 8px 0 0;
  }
  .eyebrow {
    justify-content: center;
  }
  .english-title {
    margin: 18px 0 10px;
    font-size: 20px;
  }
  h1 {
    font-size: clamp(44px, 8.5vw, 94px);
    line-height: 1.1;
    letter-spacing: -4px;
  }
  h1 br {
    display: none;
  }
  h1 br:after {
    content: ' ';
  }
  .story-description {
    font-size: 22px;
    margin: 14px 0;
  }
  .story-description br {
    display: none;
  }
  .rule-pills {
    justify-content: center;
  }
  .rule-pills span {
    font-size: 15px;
    padding: 9px 18px;
  }
  .goal-note,
  .howto {
    display: none;
  }
  .stage {
    height: 100%;
    width: auto;
    max-width: 100%;
    aspect-ratio: 1;
    justify-self: center;
  }
  .cup-rig {
    width: 100%;
    height: 100%;
  }
  .temperature-tag {
    font-size: clamp(48px, 10vw, 105px);
    right: -3%;
  }
  .temperature-tag small {
    font-size: 15px;
  }
  .floating-note {
    font-size: 26px;
  }
  .stage-caption {
    font-size: 25px;
    bottom: -1%;
  }
  .side-panel {
    padding: 5px 0 0;
  }
  .join-card {
    display: grid;
    grid-template-columns: 180px 1fr 1fr;
    grid-template-rows: auto auto auto;
    column-gap: 22px;
    padding: 25px 30px;
    border-radius: 25px;
    align-items: center;
    text-align: left;
  }
  .join-card .card-kicker {
    grid-column: 2;
    grid-row: 1;
  }
  .join-card h2 {
    grid-column: 2;
    grid-row: 2;
    font-size: 32px;
    margin: 8px 0;
  }
  .qr-wrap {
    grid-row: 1/4;
    grid-column: 1;
    max-width: 180px;
  }
  .join-card > p {
    grid-column: 2;
    grid-row: 3;
    margin: 0;
    font-size: 12px;
  }
  .join-card > a {
    grid-column: 3;
    grid-row: 3;
    text-align: center;
  }
  .joined-count {
    grid-column: 3;
    grid-row: 1;
    text-align: center;
    margin: 0;
  }
  .join-card .primary-button {
    grid-column: 3;
    grid-row: 2;
    padding: 18px 12px;
    font-size: 14px;
  }
  .join-card > small {
    display: none;
  }
  .play-card {
    display: grid;
    grid-template-columns: 180px 1fr 1fr;
    gap: 10px 30px;
    align-items: center;
    padding: 22px 35px;
  }
  .play-card > .card-kicker {
    display: none;
  }
  .timer-ring {
    grid-column: 1;
    grid-row: 1/4;
    margin: 0;
    width: 150px;
    height: 150px;
  }
  .thermometer {
    display: none;
  }
  .target-label {
    grid-column: 2;
    grid-row: 1/3;
    margin: 0;
    font-size: 17px;
  }
  .target-label strong {
    font-size: 45px;
  }
  .team-meter {
    grid-column: 3;
    grid-row: 1/3;
    font-size: 14px;
  }
  .play-encouragement {
    grid-column: 2/4;
    grid-row: 3;
    margin: 0;
    font-size: 16px;
  }
  .player-dock {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .player-card {
    min-height: 100px;
    padding: 15px 22px;
  }
  .player-icon {
    width: 60px;
    height: 60px;
  }
  .player-details strong {
    font-size: 18px;
  }
  .player-details small {
    font-size: 13px;
  }
  .player-badge {
    font-size: 12px;
  }
  .instruction-strip {
    font-size: 18px;
    padding: 14px 20px;
  }
  .strip-extra {
    font-size: 12px;
  }
  .bottom-line {
    font-size: 10px;
  }
  .result-card {
    width: min(650px, 90vw);
    padding: 45px;
  }
  .result-card h2 {
    font-size: 70px;
  }
  .result-cup {
    width: 300px;
    height: 280px;
  }
  .result-card > p {
    font-size: 18px;
  }
  .result-temperature {
    font-size: 60px;
  }
  .result-contributions strong {
    font-size: 15px;
  }
  .result-contributions span {
    font-size: 23px;
  }
  .result-card .primary-button {
    font-size: 20px;
    padding: 22px;
  }
}
@media (max-width: 600px) and (max-aspect-ratio: 1/1) {
  .wall-shell {
    padding: 14px 16px 10px;
    gap: 10px;
  }
  .wall-header {
    min-height: 40px;
  }
  .brand {
    font-size: 9px;
    gap: 7px;
    letter-spacing: 0.5px;
  }
  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    font-size: 25px;
  }
  .brand-mark span {
    font-size: 17px;
  }
  .brand small {
    font-size: 8px;
    letter-spacing: 0;
  }
  .connection,
  .room-label {
    display: none;
  }
  .icon-button {
    width: 30px;
    height: 30px;
    font-size: 18px;
  }
  .header-right {
    gap: 6px;
  }
  .story-panel {
    padding: 0;
  }
  .eyebrow {
    font-size: 8px;
  }
  .english-title {
    font-size: 11px;
    margin: 10px 0 5px;
    letter-spacing: 2px;
  }
  h1 {
    font-size: 38px;
    letter-spacing: -2px;
  }
  .story-description {
    font-size: 12px;
    margin: 7px 0;
  }
  .rule-pills span {
    font-size: 9px;
    padding: 5px 10px;
  }
  .wall-main {
    gap: 5px;
  }
  .floating-note {
    font-size: 13px;
    padding: 9px 13px;
  }
  .temperature-tag {
    font-size: 42px;
    top: 11%;
    right: -1%;
  }
  .temperature-tag small {
    font-size: 8px;
  }
  .stage-caption {
    font-size: 12px;
    gap: 8px;
  }
  .sparkle {
    font-size: 15px;
  }
  .join-card {
    grid-template-columns: 86px 1fr 1fr;
    padding: 11px;
    gap: 2px 10px;
    border-radius: 16px;
  }
  .qr-wrap {
    max-width: 86px;
    padding: 2px;
    border-radius: 10px;
  }
  .join-card .card-kicker {
    font-size: 6px;
    letter-spacing: 1px;
  }
  .join-card h2 {
    font-size: 19px;
    margin: 2px 0;
    letter-spacing: -0.5px;
  }
  .join-card > p {
    font-size: 7px;
  }
  .join-card > a {
    font-size: 8px;
  }
  .joined-count {
    font-size: 9px;
  }
  .joined-count span {
    font-size: 17px;
  }
  .join-card .primary-button {
    font-size: 9px;
    padding: 12px 5px;
    border-radius: 8px;
  }
  .player-dock {
    gap: 6px;
  }
  .player-card {
    min-height: 52px;
    padding: 7px 8px;
    border-radius: 12px;
    gap: 7px;
  }
  .player-icon {
    width: 32px;
    height: 32px;
  }
  .player-icon svg {
    width: 29px;
    height: 29px;
  }
  .player-icon img {
    width: 32px;
    height: 32px;
  }
  .player-details strong {
    font-size: 10px;
  }
  .player-details small {
    font-size: 8px;
    margin-top: 3px;
  }
  .player-badge {
    font-size: 7px;
    padding: 3px;
  }
  .instruction-strip {
    font-size: 10px;
    padding: 8px 10px;
    gap: 8px;
  }
  .strip-extra {
    font-size: 7px;
  }
  .bottom-line {
    font-size: 6px;
    letter-spacing: 0.7px;
  }
  .bottom-line span:last-child {
    max-width: 48%;
    text-align: right;
  }
  .play-card {
    grid-template-columns: 80px 1fr 1fr;
    padding: 12px;
    gap: 5px 13px;
  }
  .timer-ring {
    width: 75px;
    height: 75px;
    border-width: 4px;
  }
  .timer-ring b {
    font-size: 35px;
    letter-spacing: -1px;
  }
  .timer-ring small {
    font-size: 7px;
    margin-top: 2px;
  }
  .target-label {
    font-size: 9px;
  }
  .target-label strong {
    font-size: 27px;
  }
  .team-meter {
    font-size: 8px;
    gap: 7px;
  }
  .play-encouragement {
    font-size: 9px;
  }
  .result-card {
    padding: 24px;
    border-radius: 24px;
  }
  .result-card h2 {
    font-size: 43px;
  }
  .result-card > p {
    font-size: 12px;
  }
  .result-cup {
    width: 190px;
    height: 180px;
  }
  .result-temperature {
    font-size: 40px;
  }
  .result-contributions strong {
    font-size: 9px;
  }
  .result-contributions span {
    font-size: 17px;
  }
  .result-card .primary-button {
    font-size: 15px;
    padding: 16px;
  }
}
@font-face {
  font-family: Jua;
  src: url('/assets/Jua-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
.wall[data-phase='result'] #effects {
  z-index: 30;
}
.brand,
.english-title,
.eyebrow,
.card-kicker,
.room-label,
.bottom-line,
.phone-eyebrow,
.phone-footer {
  font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
}
@media (max-height: 900px) and (min-aspect-ratio: 1/1) {
  .wall-shell {
    padding: 18px 36px 12px;
    gap: 12px;
  }
  .wall-header {
    min-height: 48px;
  }
  .brand-mark {
    width: 44px;
    height: 44px;
    font-size: 30px;
  }
  .brand {
    font-size: 12px;
  }
  .brand small {
    font-size: 9px;
  }
  .wall-main {
    gap: 22px;
  }
  .stage {
    width: min(100%, calc(100dvh - 280px));
    height: auto;
    max-height: none;
    justify-self: center;
  }
  .english-title {
    margin: 12px 0 8px;
    font-size: 14px;
  }
  .eyebrow {
    font-size: 9px;
  }
  h1 {
    font-size: clamp(40px, 4.4vw, 72px);
  }
  .story-panel {
    padding-bottom: 0;
  }
  .story-description {
    font-size: 16px;
    margin: 12px 0;
    line-height: 1.5;
  }
  .rule-pills span {
    font-size: 10px;
    padding: 7px 11px;
  }
  .goal-note {
    margin-top: 18px;
    padding-left: 12px;
  }
  .goal-note strong {
    font-size: 26px;
  }
  .goal-note > span {
    font-size: 10px;
  }
  .goal-note p {
    font-size: 10px;
  }
  .howto {
    margin-top: 18px;
    font-size: 9px;
  }
  .join-card {
    padding: 18px;
    border-radius: 23px;
  }
  .join-card h2 {
    font-size: 27px;
    margin: 10px 0;
  }
  .qr-wrap {
    max-width: 150px;
  }
  .join-card p {
    font-size: 10px;
    margin: 10px 0 6px;
  }
  .joined-count {
    margin: 11px 0 9px;
  }
  .join-card .primary-button {
    font-size: 12px;
    padding: 14px;
  }
  .join-card > small {
    font-size: 9px;
    margin-top: 9px;
  }
  .stage-caption {
    font-size: 15px;
    bottom: -3%;
  }
  .floating-note {
    font-size: 17px;
    padding: 12px 18px;
  }
  .temperature-tag {
    font-size: 59px;
  }
  .temperature-tag small {
    font-size: 10px;
  }
  .player-card {
    min-height: 74px;
    padding: 10px 13px;
  }
  .player-icon {
    width: 45px;
    height: 45px;
  }
  .player-icon svg {
    width: 38px;
    height: 38px;
  }
  .player-details strong {
    font-size: 13px;
  }
  .player-details small {
    font-size: 10px;
  }
  .player-badge {
    font-size: 9px;
  }
  .instruction-strip {
    font-size: 12px;
    padding: 10px 15px;
  }
  .play-card {
    padding: 20px;
  }
  .timer-ring {
    width: 120px;
    height: 120px;
    margin: 14px auto;
  }
  .timer-ring b {
    font-size: 52px;
  }
  .thermometer {
    height: 65px;
    margin: 15px auto;
  }
  .target-label {
    margin: 20px 0 15px;
  }
  .play-encouragement {
    margin-top: 15px;
    font-size: 11px;
  }
}
/* Controller */
.controller {
  background: #f8f2e6;
  min-height: 100dvh;
  overflow-x: hidden;
}
.controller:before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(
    ellipse at 100% 0%,
    color-mix(in srgb, var(--player) 20%, transparent),
    transparent 60%
  );
  pointer-events: none;
}
.phone-shell {
  position: relative;
  max-width: 520px;
  min-height: 100dvh;
  margin: auto;
  padding: max(22px, env(safe-area-inset-top)) 26px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}
.phone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.phone-header .brand {
  font-size: 10px;
  letter-spacing: 1px;
  gap: 9px;
}
.phone-header .brand-mark {
  width: 37px;
  height: 37px;
  border-radius: 13px;
  font-size: 26px;
}
.phone-header .brand-mark span {
  font-size: 18px;
}
.phone-connection {
  font-size: 10px;
  letter-spacing: 1px;
  color: #95806c;
}
.phone-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 26px 0 12px;
}
.phone-eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 800;
  color: #9c8165;
  margin: 0 0 12px;
}
.phone-main h1 {
  font-size: 40px;
  letter-spacing: -2px;
  line-height: 1.25;
}
.phone-main .phone-desc {
  font-size: 14px;
  line-height: 1.8;
  color: #937b62;
  margin: 14px 0;
}
.phone-art {
  height: 200px;
  position: relative;
  margin: 7px 0;
}
.phone-art > img {
  height: 100%;
  max-width: 90%;
  object-fit: contain;
  animation: cup-breathe 3s infinite;
  filter: drop-shadow(0 14px 9px #8963331a);
}
.phone-art:before {
  content: '';
  position: absolute;
  inset: 10% 17%;
  border-radius: 50%;
  background: #ede2c9;
  z-index: -1;
}
.name-field {
  text-align: left;
  display: block;
  margin: 14px 0 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.name-field input {
  width: 100%;
  border: 1px solid #ddcebb;
  background: #fffdf7;
  border-radius: 13px;
  padding: 15px;
  color: var(--ink);
  font-size: 16px;
  margin-top: 8px;
  outline-offset: 2px;
}
.phone-main .primary-button {
  padding: 19px;
  font-size: 17px;
  --accent: var(--player);
}
.phone-note {
  font-size: 11px;
  color: #aa947b;
  line-height: 1.7;
  margin: 15px 0 0;
}
.slot-tag {
  align-self: center;
  background: var(--player);
  color: white;
  padding: 7px 15px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 16px;
}
.phone-controller-art {
  position: relative;
  width: 210px;
  height: 220px;
  margin: 18px auto;
  display: grid;
  place-items: center;
}
.phone-controller-art:before {
  content: '';
  position: absolute;
  inset: 6%;
  background: color-mix(in srgb, var(--player) 17%, white);
  border: 2px solid color-mix(in srgb, var(--player) 25%, white);
  border-radius: 50%;
  animation: halo-breathe 2.5s infinite;
}
.phone-controller-art > svg {
  position: relative;
  width: 155px;
  height: 155px;
  color: var(--player);
  filter: drop-shadow(0 8px 0 #5940280d);
  animation: fan-demo 1.5s ease-in-out infinite;
}
.phone-controller-art > img {
  position: relative;
  width: 190px;
  animation: throw-demo 1.6s ease-in-out infinite;
}
.phone-mates {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin: 20px 0;
}
.phone-mates span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e9dfcf;
  color: #b5a28c;
  font-size: 13px;
  display: grid;
  place-items: center;
  border: 2px solid transparent;
}
.phone-mates span.present {
  background: var(--mate);
  color: white;
}
.phone-mates span.ready {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--mate);
}
.phone-secondary {
  border: 1px solid #cfbfaa;
  background: #fffaf0;
  color: #8a735b;
  padding: 13px;
  border-radius: 12px;
  font-size: 13px;
  width: 100%;
  margin-top: 12px;
}
.sensor-status {
  font-size: 11px;
  color: #a38d76;
  margin: 12px 0;
  min-height: 30px;
  line-height: 1.6;
}
.sensor-status.good {
  color: #319080;
}
.phone-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 15px 0 0;
  border: 1px solid #e4d6bf;
  border-radius: 16px;
  padding: 16px 20px;
  background: #fffaf1;
}
.phone-stats span {
  font-size: 10px;
  color: #a18a70;
  display: block;
}
.phone-stats strong {
  font-size: 31px;
  display: block;
  letter-spacing: -1px;
  margin-top: 4px;
}
.phone-stats div:last-child strong {
  color: var(--player);
}
.phone-action {
  position: relative;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  border: 6px solid #fff9ed;
  background: var(--player);
  box-shadow:
    0 9px 0 color-mix(in srgb, var(--player) 60%, #69513a),
    0 0 0 2px color-mix(in srgb, var(--player) 40%, white);
  color: white;
  margin: 30px auto 24px;
  font-weight: 800;
  font-size: 23px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  user-select: none;
  touch-action: manipulation;
}
.phone-action > svg {
  width: 83px;
  height: 83px;
}
.phone-action > img {
  width: 100px;
  height: 100px;
}
.phone-action small {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.85;
}
.phone-action:active,
.phone-action.pulse {
  transform: translateY(6px) scale(0.98);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--player) 60%, #69513a);
}
.phone-action.cooldown {
  filter: saturate(0.6);
}
.phone-action-hint {
  font-size: 12px;
  line-height: 1.8;
  color: #9d8267;
  margin: 0;
}
.phone-progress {
  height: 8px;
  border-radius: 8px;
  background: #e9deca;
  overflow: hidden;
  margin: 24px 0 8px;
}
.phone-progress > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--player);
  transition: width 0.2s;
}
.phone-footer {
  text-align: center;
  font-size: 9px;
  letter-spacing: 2px;
  color: #b39b7e;
  margin-top: 20px;
}
.phone-count {
  font-size: 125px;
  font-weight: 900;
  letter-spacing: -6px;
  color: var(--player);
  animation: halo-breathe 1s infinite;
  margin: 40px 0;
}
.phone-error {
  background: #fff6e6;
  border: 1px solid #dfbfa2;
  border-radius: 15px;
  padding: 20px;
  font-size: 14px;
  line-height: 1.7;
  margin: 20px 0;
  color: #a06445;
}
.phone-result-number {
  font-size: 70px;
  font-weight: 900;
  color: var(--player);
  letter-spacing: -3px;
  margin: 12px 0;
}
.leave-button {
  background: none;
  border: 0;
  color: #aa9277;
  text-decoration: underline;
  text-underline-offset: 4px;
  font-size: 11px;
  margin-top: 18px;
}
.phone-help {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #49332666;
  display: grid;
  place-items: center;
  padding: 22px;
  backdrop-filter: blur(5px);
}
.phone-help > div {
  max-width: 400px;
  border-radius: 26px;
  padding: 25px;
  background: #fffaf0;
  text-align: center;
}
.phone-help h2 {
  font-size: 24px;
  letter-spacing: -1px;
}
.phone-help p {
  font-size: 13px;
  line-height: 1.8;
  color: #94795f;
}
.reconnecting {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: #f0c96e;
  color: #573e23;
  text-align: center;
  font-size: 12px;
  padding: 10px;
}
.phone-main .secondary-start {
  margin-top: 14px;
  background: #493326;
}
.phone-result-art {
  width: 210px;
  height: 200px;
  margin: auto;
  object-fit: contain;
  animation: cup-breathe 3s infinite;
}
@keyframes fan-demo {
  0%,
  100% {
    transform: rotate(-19deg);
  }
  50% {
    transform: rotate(19deg);
  }
}
@keyframes throw-demo {
  0%,
  100% {
    transform: translateY(13px) rotate(-10deg) scale(0.95);
  }
  50% {
    transform: translateY(-20px) rotate(12deg) scale(1.05);
  }
}
.controller h1 br {
  display: initial;
}
.phone-main h1 {
  word-break: keep-all;
  font-weight: 400;
  text-shadow: none;
}
.phone-controller-art {
  width: 180px;
  height: 180px;
  margin: 12px auto;
}
.phone-controller-art > svg {
  width: 135px;
  height: 135px;
}
.phone-action > svg {
  color: color-mix(in srgb, var(--player) 72%, #412d23);
}
.phone-mates {
  margin: 15px 0;
}
.controller .slot-tag {
  display: inline-block;
}
@media (max-height: 740px) {
  .phone-shell {
    padding-top: 16px;
  }
  .phone-main {
    padding: 18px 0 8px;
  }
  .phone-art {
    height: 150px;
  }
  .phone-controller-art {
    width: 150px;
    height: 150px;
    margin: 8px auto;
  }
  .phone-controller-art > svg {
    width: 115px;
    height: 115px;
  }
  .phone-controller-art > img {
    width: 140px;
  }
  .phone-main h1 {
    font-size: 34px;
  }
  .phone-main .phone-desc {
    font-size: 12px;
    margin: 8px 0;
  }
  .phone-mates {
    margin: 13px 0;
  }
  .phone-action {
    width: 165px;
    height: 165px;
    margin: 23px auto 18px;
    font-size: 20px;
  }
  .phone-action > img {
    width: 80px;
    height: 80px;
  }
  .phone-action > svg {
    width: 66px;
    height: 66px;
  }
  .phone-footer {
    margin-top: 12px;
  }
  .phone-stats {
    padding: 12px 18px;
  }
}
