:root {
  color-scheme: dark;
  font-family:
    ui-rounded, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #fff3df;
  background: #031723;
  font-synthesis: none;
  -webkit-tap-highlight-color: transparent;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at 50% 30%, #124b5c88, transparent 65%), #03131e;
}
body::before {
  content: "";
  position: fixed;
  inset: -30px;
  background:
    linear-gradient(#021c30aa, #00111ce6),
    url(assets/carnival.png) center/cover;
  filter: blur(18px);
  z-index: -1;
}
button {
  font: inherit;
  color: inherit;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}
button:focus-visible {
  outline: 3px solid #72ffed;
  outline-offset: 5px;
}
button:disabled {
  cursor: default;
}
svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.svg-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.game {
  isolation: isolate;
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100dvh;
  min-height: 690px;
  max-height: 1000px;
  padding: 12px 16px 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    linear-gradient(180deg, #03212a8c, transparent 50%, #05233377),
    url(assets/carnival.png) center/cover;
  box-shadow: 0 0 100px #0008;
}
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  height: 76px;
}
.icon-button {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 14px;
  background: linear-gradient(145deg, #26546bba, #061e34);
  border: 1px solid #a6e5ff88;
  box-shadow:
    inset 0 2px 3px #b6f2ff44,
    0 4px 8px #00111c77;
}
.icon-button svg {
  width: 24px;
  height: 24px;
}
.icon-button:active {
  transform: translateY(2px);
}
.brand {
  position: relative;
  text-align: center;
  padding: 0 12px 8px;
}
.brand h1 {
  font-size: 43px;
  font-weight: 1000;
  font-style: italic;
  line-height: 1;
  margin: 0;
  letter-spacing: 1px;
  color: #fff3d3;
  -webkit-text-stroke: 1px #fff0c2;
  text-shadow:
    2px 3px 0 #a14010,
    3px 5px 0 #502106,
    0 0 16px #ff9e4344;
  filter: drop-shadow(0 -2px 0 #954013);
}
.brand-sub {
  display: block;
  font-size: 8px;
  letter-spacing: 4px;
  color: #ffc77b;
  margin-top: 7px;
}
.spark {
  position: absolute;
  top: 16px;
  width: 6px;
  height: 14px;
  background: #ffb64f;
  border-radius: 3px;
  transform: rotate(-35deg);
}
.s1 {
  left: -2px;
}
.s2 {
  right: -2px;
  transform: rotate(35deg);
}
.match-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 39px;
  padding: 0 12px;
  border: 1px solid #80c3d85c;
  border-radius: 22px;
  background: #001a24a8;
  box-shadow: inset 0 1px 3px #a7eaff11;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.round-label b {
  color: #ffcf6b;
  font-size: 16px;
  margin: 0 3px;
}
.dim {
  opacity: 0.6;
}
.timer {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #ffce69;
  font-size: 21px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}
.timer svg {
  width: 20px;
  height: 20px;
}
.timer.urgent {
  color: #ff775e;
  animation: pulse 0.6s infinite alternate;
}
.mode {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #d5e4e5;
}
.signal {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}
.signal i {
  width: 3px;
  background: #13e8c1;
  border-radius: 2px;
  height: 6px;
}
.signal i:nth-child(2) {
  height: 10px;
}
.signal i:nth-child(3) {
  height: 14px;
}
.players {
  display: flex;
  gap: 7px;
  margin-top: 12px;
  flex-shrink: 0;
}
.player {
  --accent: #ffb733;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 7px;
  border: 1px solid #92cbe786;
  border-radius: 19px;
  background: linear-gradient(135deg, #173c51db, #082534e6);
  box-shadow: inset 0 2px 3px #9dd5f72b;
}
.player.you {
  border: 1.5px solid #ffce6e;
  box-shadow:
    0 0 12px #ffb13944,
    inset 0 0 11px #f5aa2244;
  background: linear-gradient(130deg, #62502b9c, #152c35e3);
}
.player.blue {
  --accent: #4cceff;
}
.player.purple {
  --accent: #c872ff;
}
.avatar {
  width: 30px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 25px;
  background: radial-gradient(circle at 40% 30%, #54768d, #182b41);
  border: 1px solid #cde9f8a1;
  flex-shrink: 0;
}
.avatar-you {
  background: linear-gradient(140deg, #faaf64, #885b6e);
}
.player-data {
  flex: 1;
  min-width: 0;
}
.player-name {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.player-tag {
  color: #c7dae0;
  font-size: 8px;
  font-weight: 400;
}
.player-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
  gap: 2px;
}
.player-value b {
  font-size: 21px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.player-value b span {
  font-size: 13px;
}
.mini-balloon {
  width: 12px;
  height: 15px;
  border-radius: 50% 50% 47% 47%;
  background: radial-gradient(circle at 30% 20%, #fff9, var(--accent) 50%);
  position: relative;
  box-shadow: inset -2px -2px 4px #0002;
}
.mini-balloon::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 5px;
  border-bottom: 3px solid var(--accent);
  border-left: 2px solid transparent;
  border-right: 2px solid transparent;
}
.progress-track {
  height: 5px;
  background: #ffffff15;
  border-radius: 5px;
  margin-top: 4px;
  overflow: hidden;
}
.progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--accent), var(--accent));
  box-shadow: 0 0 8px var(--accent);
  transition: width 0.13s linear;
}
.arena {
  position: relative;
  flex: 1;
  min-height: 240px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stage-caption {
  position: absolute;
  top: 9px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 10px;
  letter-spacing: 2px;
  color: #d3e7e5b0;
  z-index: 4;
}
.stage-caption span {
  height: 1px;
  width: 21px;
  background: linear-gradient(90deg, transparent, #b2e1df88);
}
.stage-caption span:last-child {
  transform: rotate(180deg);
}
.balloon-wrap {
  position: absolute;
  width: 95%;
  height: 95%;
  display: flex;
  justify-content: center;
  align-items: center;
  transform-origin: 50% 70%;
  transform: translateY(-6%) scale(0.66);
  transition: transform 0.16s linear;
  will-change: transform;
  z-index: 2;
}
.balloon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(-6px 1px 10px #3edbff25)
    drop-shadow(5px 4px 13px #ff720a22);
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
.ribbon {
  position: absolute;
  width: 15%;
  height: 28%;
  top: 92%;
  left: 43%;
  z-index: -1;
  transform-origin: top;
  animation: sway 4s ease-in-out infinite alternate;
}
.balloon-shadow {
  position: absolute;
  bottom: 7%;
  width: 48%;
  height: 4%;
  border-radius: 50%;
  background: #25120dbb;
  filter: blur(10px);
  opacity: 0.6;
  transition: transform 0.2s;
}
.gauge {
  position: absolute;
  width: 142px;
  height: 92px;
  left: 50%;
  top: 53%;
  transform: translate(-50%, -10%);
  z-index: 3;
  filter: drop-shadow(0 3px 8px #61290988);
  text-align: center;
  pointer-events: none;
}
.gauge > svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.gauge-bg,
.gauge-fill {
  stroke-width: 11;
  fill: none;
}
.gauge-bg {
  stroke: #ffdc8555;
}
.gauge-fill {
  stroke: #ffd05a;
  stroke-dasharray: 0 100;
  transition:
    stroke-dasharray 0.15s,
    stroke 0.3s;
}
.gauge-ticks {
  stroke: #fff1daaa;
  stroke-width: 2;
}
.gauge-number {
  position: absolute;
  top: 34px;
  left: 0;
  right: 0;
  line-height: 1;
  font-size: 26px;
  font-weight: 850;
  text-shadow: 0 2px 10px #883b1d66;
}
.gauge-number b {
  font-size: 48px;
  letter-spacing: -2px;
}
.gauge-label {
  position: absolute;
  top: 84px;
  left: 0;
  right: 0;
  font-size: 11px;
  letter-spacing: 2px;
  color: #fff1e0;
  text-shadow: 0 2px 4px #5a231c;
}
.floating-score {
  position: absolute;
  top: 22%;
  right: 5%;
  font-size: 33px;
  font-weight: 1000;
  font-style: italic;
  color: #ffd978;
  text-shadow:
    2px 2px 0 #b54413,
    -1px -1px 0 #fff3a8;
  transform: rotate(-12deg);
  opacity: 0;
  z-index: 4;
  pointer-events: none;
}
.floating-score.show {
  animation: score-float 1s ease-out forwards;
}
.danger {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  background: #57180fc9;
  border: 1px solid #ff977555;
  border-radius: 20px;
  color: #ffce9f;
  font-size: 12px;
  white-space: nowrap;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.2s;
}
.arena.is-danger .danger {
  opacity: 1;
}
.arena.is-danger .balloon {
  animation: tremble 0.12s infinite alternate;
}
.arena.is-burst .balloon-wrap {
  opacity: 0;
  transform: scale(1.2) !important;
  transition: opacity 0.06s;
}
.arena.is-burst .gauge {
  opacity: 0;
}
.console {
  flex-shrink: 0;
  position: relative;
  padding: 13px 17px 10px;
  border: 1px solid #86e6edbb;
  border-radius: 24px;
  background: linear-gradient(125deg, #153f50dc, #062635ec 50%, #163949e8);
  box-shadow:
    inset 0 2px 5px #d3ffff4d,
    inset 0 -3px 6px #2cc8ff33,
    0 0 20px #05d6d51f;
  z-index: 5;
}
.input-heading {
  display: flex;
  gap: 11px;
  align-items: center;
}
.mic-button {
  position: relative;
  flex-shrink: 0;
  width: 41px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid #19b6c3aa;
  background: linear-gradient(130deg, #06434a, #042732);
  border-radius: 12px;
  box-shadow: inset 0 1px 4px #2afff522;
}
.mic-button svg {
  width: 24px;
  height: 24px;
  color: #c6eef0;
}
.mic-button i {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #67858a;
}
.mic-button[aria-pressed="true"] i {
  background: #12efd3;
  box-shadow: 0 0 8px #12efd3;
}
.mic-button[aria-pressed="true"] {
  border-color: #36ecd5;
}
.input-heading h2 {
  font-size: 16px;
  letter-spacing: 0.5px;
  margin: 0 0 3px;
  font-weight: 750;
}
.input-heading p {
  font-size: 9px;
  color: #b0c8cd;
  margin: 0;
}
.help-button {
  margin-left: auto;
  background: transparent;
  padding: 4px;
  color: #92b9c4;
}
.help-button svg {
  width: 19px;
  height: 19px;
}
.waveform {
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin: 7px 0 9px;
  overflow: hidden;
  mask-image: linear-gradient(
    90deg,
    transparent,
    #000 12%,
    #000 88%,
    transparent
  );
}
.waveform i {
  display: block;
  width: 4px;
  height: var(--h);
  min-height: 3px;
  max-height: 32px;
  border-radius: 4px;
  background: #2de7d8;
  box-shadow: 0 0 8px #16efd466;
  opacity: 0.45;
  transition:
    height 0.07s linear,
    opacity 0.1s;
}
.primary-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 92%;
  margin: 0 auto;
  height: 60px;
  border-radius: 35px;
  border: 1.5px solid #ffe9b3;
  background: linear-gradient(
    170deg,
    #ffd85d 0%,
    #ffab27 25%,
    #ff8d1a 55%,
    #ff5e22 100%
  );
  box-shadow:
    inset 0 3px 5px #ffffd5d9,
    inset 0 -5px 3px #c94c2280,
    0 5px 0 #9c350c,
    0 7px 0 #3e2113,
    0 0 20px #ffb83744;
  text-shadow:
    0 2px 0 #bd5617,
    1px 3px 1px #a74a19;
  font-size: 26px;
  font-weight: 950;
  letter-spacing: 3px;
  isolation: isolate;
  transition:
    filter 0.15s,
    transform 0.1s;
}
.primary-button:active {
  transform: translateY(3px);
  box-shadow:
    inset 0 3px 5px #ffffd5d9,
    inset 0 -5px 3px #c94c2280,
    0 2px 0 #9c350c;
}
.button-shine {
  position: absolute;
  top: 7px;
  left: 18px;
  width: 22px;
  height: 8px;
  background: #fff8cf;
  filter: blur(2px);
  border-radius: 50%;
  transform: rotate(-20deg);
  pointer-events: none;
}
.hold-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: #03232c88;
  border: 1px solid #78aab34d;
  border-radius: 20px;
  width: 72%;
  height: 29px;
  margin: 15px auto 0;
  font-size: 11px;
  color: #bce2e3;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.hold-button svg {
  width: 15px;
  height: 15px;
}
.hold-button:disabled {
  opacity: 0.35;
}
.hold-button.holding {
  background: #1bb7a540;
  border-color: #4cf6d5;
  color: white;
  box-shadow: 0 0 12px #20e6c333;
}
.key-hint {
  font-size: 7px;
  letter-spacing: 1px;
  opacity: 0.5;
  border: 1px solid #a4bfc866;
  padding: 1px 3px;
  border-radius: 3px;
  margin-left: 6px;
}
.risk-tip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 9px 0 0;
  color: #bed0cf;
  font-size: 10px;
  letter-spacing: 1px;
}
.risk-tip span {
  width: 17px;
  height: 1px;
  background: #afc1c955;
}
.footer {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 28px;
  font-size: 10px;
  color: #a6c1c8;
  padding: 0 4px;
  gap: 10px;
}
.footer > span {
  display: flex;
  gap: 5px;
  align-items: center;
}
.footer svg {
  width: 12px;
  height: 12px;
  color: #e8bf6c;
}
.footer b {
  color: #f3dba6;
  font-variant-numeric: tabular-nums;
}
.offline-label {
  font-size: 9px;
}
.offline-label i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #4fe0b9;
}
.desktop-note {
  position: fixed;
  top: 35px;
  left: 36px;
  font-size: 12px;
  letter-spacing: 3px;
  color: #c6e7e47d;
  display: flex;
  gap: 12px;
  align-items: center;
}
.tiny-balloon {
  width: 15px;
  height: 19px;
  border-radius: 50%;
  background: linear-gradient(130deg, #ffcb70, #ff6c3b);
  transform: rotate(-15deg);
}
.desktop-footer {
  position: fixed;
  bottom: 30px;
  left: 36px;
  font-size: 11px;
  color: #aacac96b;
  letter-spacing: 2px;
  line-height: 2;
}
.desktop-footer span {
  display: block;
  font-size: 9px;
  letter-spacing: 1px;
  color: #89b1ba77;
}
.toast {
  position: absolute;
  left: 50%;
  bottom: 265px;
  transform: translate(-50%, 10px);
  background: #071f2bf2;
  border: 1px solid #b8edf55c;
  border-radius: 15px;
  padding: 11px 18px;
  font-size: 12px;
  line-height: 1.6;
  max-width: 90%;
  width: max-content;
  z-index: 20;
  text-align: center;
  opacity: 0;
  transition:
    opacity 0.2s,
    transform 0.2s;
  pointer-events: none;
}
.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
dialog {
  padding: 0;
  max-width: min(90vw, 370px);
  width: 370px;
  border: 1px solid #7bd4d59c;
  border-radius: 27px;
  color: #fff0d8;
  background: linear-gradient(145deg, #164353, #062636);
  box-shadow:
    inset 0 2px 5px #c9ffff33,
    0 20px 80px #0009;
}
dialog::backdrop {
  background: #00101cd1;
  backdrop-filter: blur(9px);
}
.dialog-content {
  padding: 27px 24px 23px;
  text-align: center;
}
.dialog-emoji {
  font-size: 48px;
  display: block;
  margin-bottom: 8px;
}
.dialog-content h2 {
  font-size: 26px;
  margin: 8px 0 12px;
  letter-spacing: 2px;
  color: #ffe2a5;
}
.dialog-content p {
  font-size: 13px;
  line-height: 1.9;
  color: #bad5da;
  margin: 8px 0 19px;
}
.dialog-content .primary-button {
  font-size: 18px;
  letter-spacing: 1px;
  height: 48px;
  margin-top: 20px;
  width: 100%;
}
.dialog-secondary {
  background: transparent;
  color: #9bc1cc;
  font-size: 12px;
  margin-top: 19px;
}
.result-score {
  font-size: 55px;
  color: #ffd16e;
  font-weight: 900;
  line-height: 1.1;
  text-shadow: 0 3px 0 #8b4e24;
  margin: 20px 0 5px;
}
.result-note {
  font-size: 11px;
  color: #d5c08d;
}
.result-list {
  margin: 18px 0 0;
  display: grid;
  gap: 8px;
}
.result-row {
  display: flex;
  justify-content: space-between;
  padding: 9px 12px;
  background: #00192366;
  border-radius: 11px;
  font-size: 12px;
  color: #a8cbd0;
}
.result-row.me {
  border: 1px solid #ffca6c77;
  color: #ffe0a5;
}
.result-row b {
  font-variant-numeric: tabular-nums;
}
.rules {
  padding: 0;
  list-style: none;
  text-align: left;
  display: grid;
  gap: 14px;
  margin: 20px 0;
}
.rules li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  line-height: 1.8;
  color: #bad5da;
}
.rules li > span {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: #1d505b;
  color: #ffd486;
  font-weight: 700;
}
.rules strong {
  color: #fff0ce;
}
.particles {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: visible;
}
.particle {
  position: absolute;
  left: 50%;
  top: 45%;
  width: 12px;
  height: 18px;
  border-radius: 3px;
  animation: burst-particle 1s cubic-bezier(0.1, 0.5, 0.5, 1) forwards;
  background: var(--color);
}
.pop-word {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%) rotate(-12deg);
  font-size: 65px;
  font-weight: 1000;
  color: #fff0ba;
  text-shadow:
    3px 4px #e95a27,
    -3px -2px #df5e28,
    5px 7px #77260c;
  animation: pop-in 0.5s both;
}
.game.shake {
  animation: screen-shake 0.3s;
}
.saved-ring .balloon {
  filter: drop-shadow(0 0 20px #ffd76b88);
}
@keyframes sway {
  from {
    transform: rotate(-8deg);
  }
  to {
    transform: rotate(8deg);
  }
}
@keyframes pulse {
  to {
    opacity: 0.5;
  }
}
@keyframes tremble {
  from {
    transform: translate(-1px, 0) rotate(-0.3deg);
  }
  to {
    transform: translate(1px, 1px) rotate(0.3deg);
  }
}
@keyframes score-float {
  0% {
    opacity: 0;
    transform: translateY(20px) rotate(-12deg) scale(0.7);
  }
  20%,
  70% {
    opacity: 1;
    transform: translateY(0) rotate(-12deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-30px) rotate(-12deg);
  }
}
@keyframes burst-particle {
  to {
    transform: translate(var(--x), var(--y)) rotate(var(--rotation));
    opacity: 0;
  }
}
@keyframes pop-in {
  0% {
    opacity: 0;
    scale: 0.3;
  }
  50% {
    scale: 1.3;
  }
  100% {
    opacity: 1;
    scale: 1;
  }
}
@keyframes screen-shake {
  20% {
    translate: 5px -3px;
  }
  50% {
    translate: -5px 3px;
  }
  80% {
    translate: 3px 0;
  }
}
@media (min-width: 700px) {
  .game {
    border-left: 1px solid #76d0dc33;
    border-right: 1px solid #76d0dc33;
  }
  .key-hint {
    display: inline;
  }
}
@media (max-width: 800px) {
  .desktop-note,
  .desktop-footer {
    display: none;
  }
}
@media (max-width: 390px) {
  .game {
    padding-left: 11px;
    padding-right: 11px;
  }
  .player {
    gap: 5px;
    padding-left: 5px;
    padding-right: 5px;
  }
  .avatar {
    width: 26px;
    font-size: 22px;
  }
  .player-name {
    font-size: 11px;
  }
  .player-tag {
    font-size: 7px;
  }
  .mode {
    font-size: 10px;
  }
  .match-bar {
    padding: 0 9px;
  }
  .input-heading h2 {
    font-size: 15px;
  }
}
@media (max-height: 750px) {
  .game {
    min-height: 620px;
    padding-top: 5px;
  }
  .header {
    height: 65px;
  }
  .brand h1 {
    font-size: 37px;
  }
  .players {
    margin-top: 8px;
  }
  .player {
    padding-top: 7px;
    padding-bottom: 7px;
  }
  .console {
    padding: 10px 13px 9px;
  }
  .waveform {
    height: 24px;
    margin: 5px 0 7px;
  }
  .primary-button {
    height: 51px;
    font-size: 23px;
  }
  .hold-button {
    margin-top: 12px;
    height: 27px;
  }
  .risk-tip {
    font-size: 9px;
    margin-top: 7px;
  }
  .gauge {
    width: 124px;
    height: 80px;
  }
  .gauge-number {
    top: 30px;
    font-size: 22px;
  }
  .gauge-number b {
    font-size: 42px;
  }
  .gauge-label {
    top: 74px;
    font-size: 10px;
  }
  .stage-caption {
    font-size: 9px;
    top: 3px;
  }
}
@supports (padding: max(0px)) {
  .game {
    padding-top: max(5px, env(safe-area-inset-top));
    padding-bottom: max(5px, env(safe-area-inset-bottom));
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
/* 逐口与轮流玩法：保留写实舞台，突出共享气球及当前玩家。 */
.mode-switch {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  background: #001a2599;
  border: 1px solid #528b9c66;
  border-radius: 18px;
  padding: 4px;
  margin: 2px 0 8px;
}
.mode-switch button {
  flex: 1;
  padding: 7px 5px;
  border-radius: 13px;
  background: transparent;
  font-size: 11px;
  color: #98bdc6;
}
.mode-switch button[aria-pressed="true"] {
  color: #ffe5a9;
  background: linear-gradient(130deg, #69502d, #3e3d32);
  box-shadow: inset 0 1px 2px #ffdf9144;
  border: 1px solid #ebbe7266;
}
.players {
  overflow-x: auto;
  min-height: 66px;
  scrollbar-width: thin;
  scrollbar-color: #346475 transparent;
}
.player {
  min-width: 115px;
  flex: 1;
}
.player-name {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}
.player.you {
  border-color: #759faba8;
  box-shadow: inset 0 1px 4px #a5d7e722;
  background: linear-gradient(135deg, #234455df, #0a2a39ed);
}
.player.current {
  border-color: #ffce6e;
  box-shadow:
    0 0 12px #ffb13944,
    inset 0 0 11px #f5aa2244;
  background: linear-gradient(130deg, #62502b9c, #152c35e3);
}
.player.inactive {
  opacity: 0.45;
}
.player-value b {
  font-size: 18px;
}
.player-value b span {
  font-size: 9px;
  font-weight: 400;
}
.player-tag {
  font-size: 8px;
}
.turn-banner {
  flex-shrink: 0;
  text-align: center;
  color: #ffe1a4;
  font-size: 12px;
  line-height: 1.5;
  padding: 8px 5px 0;
  min-height: 26px;
}
.turn-banner.waiting {
  color: #a5d7e2;
}
.shared-operator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 5px 0 0;
  flex-shrink: 0;
  font-size: 10px;
  color: #9ec1ca;
}
.shared-operator[hidden] {
  display: none;
}
select {
  font: inherit;
  color: #ffe2a6;
  background: #0d3543;
  border: 1px solid #759da96b;
  border-radius: 8px;
  padding: 3px 8px;
  max-width: 150px;
}
.arena {
  margin-top: 0;
}
.stage-caption {
  top: 5px;
  font-size: 9px;
}
.input-heading h2 {
  font-size: 15px;
}
.input-heading p {
  max-width: 280px;
  line-height: 1.5;
}
.primary-button.breathing {
  filter: brightness(1.15);
  transform: translateY(3px);
  box-shadow:
    inset 0 2px 9px #ffffcebb,
    0 2px 0 #9c350c,
    0 0 30px #ffbe5066;
}
.primary-button:disabled {
  background: linear-gradient(150deg, #425c62, #263e4c);
  border-color: #8babb177;
  box-shadow:
    inset 0 2px 3px #acd2d733,
    0 4px 0 #102833;
  text-shadow: none;
  color: #adc6cc;
  font-size: 18px;
  letter-spacing: 1px;
  filter: none;
}
.primary-button {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.hold-button {
  height: 28px;
  touch-action: manipulation;
  opacity: 1;
  width: 90%;
  margin-top: 12px;
}
.hold-button:disabled {
  opacity: 0.5;
}
.hold-button svg {
  width: 14px;
  height: 14px;
}
.vote-area {
  text-align: center;
  margin-top: 10px;
}
.vote-area[hidden] {
  display: none;
}
.vote-button {
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid #ff9e7966;
  color: #ffcfb3;
  background: #74312155;
  font-size: 12px;
}
.vote-button:disabled {
  opacity: 0.6;
}
.vote-area p {
  font-size: 9px;
  color: #a8bdc8;
  margin: 6px 0 0;
  line-height: 1.4;
}
.footer button {
  background: transparent;
  color: #b8dedb;
  font-size: 10px;
  padding: 5px;
}
.footer {
  height: 30px;
}
.risk-tip {
  font-size: 9px;
  letter-spacing: 0.5px;
}
.mode {
  max-width: 125px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.timer {
  font-size: 16px;
}
.dialog-content {
  text-align: center;
}
.dialog-content input,
.dialog-content textarea {
  font: inherit;
  width: 100%;
  padding: 11px;
  border: 1px solid #608f9d;
  border-radius: 12px;
  color: #edf9f8;
  background: #031f2d;
  outline: none;
  margin: 7px 0 10px;
  font-size: 12px;
  resize: vertical;
}
.dialog-content textarea.code {
  font-family: monospace;
  min-height: 85px;
  max-height: 120px;
  font-size: 10px;
  word-break: break-all;
}
.dialog-content input:focus,
.dialog-content textarea:focus {
  border-color: #58efdb;
}
.field-label {
  display: block;
  text-align: left;
  color: #c3dfe1;
  font-size: 11px;
  margin-top: 9px;
}
.dialog-content .form-note {
  font-size: 11px;
  line-height: 1.7;
  margin: 8px 0;
  color: #9fbec7;
}
.dialog-content .primary-button {
  font-size: 16px;
  touch-action: manipulation;
}
.dialog-tabs {
  display: flex;
  gap: 8px;
  margin: 15px 0;
}
.dialog-tabs button {
  flex: 1;
  background: #184553;
  border: 1px solid #77a6b166;
  border-radius: 12px;
  padding: 9px 5px;
  font-size: 12px;
}
.dialog-tabs button.active {
  border-color: #eac477;
  color: #ffe2a3;
}
.connection-status {
  margin: 12px 0;
  font-size: 11px;
  color: #5fedd1;
  min-height: 17px;
}
.room-leave {
  color: #f9ab97;
}
.result-row {
  align-items: center;
  gap: 10px;
  text-align: left;
}
.result-row .contribution-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.result-row small {
  font-size: 9px;
  color: #8eb5be;
  font-weight: 400;
}
.result-row.loser {
  border: 1px solid #ff996c99;
  background: #6d302944;
  color: #ffcfac;
}
.result-row b {
  white-space: nowrap;
  font-size: 13px;
}
.result-score {
  font-size: 31px;
  margin: 14px 0 8px;
  overflow-wrap: anywhere;
}
.dialog-content h2 {
  font-size: 24px;
}
.dialog-content .tiny-note {
  font-size: 10px;
  line-height: 1.6;
  margin: 12px 0 0;
  color: #93b9c4;
}
.contribution-bar {
  height: 3px;
  background: #07212b;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 2px;
}
.contribution-bar i {
  display: block;
  background: #ffbc5a;
  height: 100%;
}
.game .arena.is-burst .gauge {
  opacity: 0;
}
.game .arena.is-burst .balloon-shadow {
  opacity: 0;
}
.game.waiting-for-player .console {
  border-color: #79a7b1a1;
}
.breath-hint {
  color: #ffd38c;
}
@media (max-height: 750px) {
  .header {
    height: 58px;
  }
  .brand h1 {
    font-size: 34px;
  }
  .brand-sub {
    font-size: 7px;
    letter-spacing: 3px;
  }
  .mode-switch {
    margin-bottom: 6px;
  }
  .mode-switch button {
    padding: 5px 4px;
  }
  .players {
    min-height: 60px;
    margin-top: 8px;
  }
  .turn-banner {
    font-size: 11px;
    padding-top: 5px;
    min-height: 22px;
  }
  .arena {
    min-height: 175px;
  }
  .console {
    padding: 10px 12px 8px;
  }
  .input-heading h2 {
    font-size: 13px;
  }
  .input-heading p {
    font-size: 8px;
  }
  .waveform {
    height: 20px;
    margin: 4px 0 6px;
  }
  .primary-button {
    height: 49px;
    font-size: 22px;
  }
  .hold-button {
    margin-top: 10px;
    height: 25px;
    font-size: 10px;
  }
  .vote-button {
    padding: 6px 11px;
    font-size: 10px;
  }
  .vote-area {
    margin-top: 8px;
  }
  .vote-area p {
    font-size: 8px;
  }
  .risk-tip {
    margin-top: 6px;
    font-size: 8px;
  }
  .game {
    min-height: 680px;
  }
  .toast {
    bottom: 250px;
  }
  .gauge {
    width: 110px;
    height: 72px;
  }
  .gauge-number {
    top: 27px;
    font-size: 20px;
  }
  .gauge-number b {
    font-size: 36px;
  }
  .gauge-label {
    top: 65px;
    font-size: 9px;
  }
}
@media (max-width: 390px) {
  .player {
    min-width: 102px;
  }
  .player-name {
    font-size: 11px;
  }
  .player-tag {
    font-size: 7px;
  }
  .mode {
    font-size: 9px;
  }
  .timer {
    font-size: 15px;
  }
  .gauge-number b {
    letter-spacing: -1px;
  }
}
.volume-unit {
  font-size: 12px;
  font-weight: 600;
  margin-left: 4px;
}
.gauge-number b {
  font-size: 43px;
}
.gauge-number {
  top: 36px;
}
.gauge-label {
  font-size: 9px;
}
@media (max-height: 750px) {
  .gauge-number {
    top: 29px;
  }
  .gauge-number b {
    font-size: 31px;
  }
  .volume-unit {
    font-size: 9px;
  }
}
.players:has(.player:only-child) {
  justify-content: center;
}
.player:only-child {
  max-width: 230px;
}
.player:only-child .player-data {
  min-width: 120px;
}
.player:only-child .avatar {
  width: 34px;
}
.player-name:has(.player-tag) {
  gap: 5px;
}
/* 等待面板增加投票区域后，让舞台收缩以保留全部操作与页脚。 */
.arena {
  min-height: 120px;
}
/* 原生发现列表沿用派对面板风格，无需复制长连接码。 */
.nearby-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #ffdfa2;
  margin-top: 22px;
}
.nearby-heading button {
  font: inherit;
  font-size: 10px;
  background: transparent;
  color: #91d8db;
  padding: 8px;
}
.native-rooms {
  max-height: 180px;
  overflow: auto;
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.nearby-room {
  padding: 13px 10px;
  border: 1px solid #8ecbd877;
  border-radius: 13px;
  background: #164452;
  font-size: 12px;
  text-align: left;
  color: #e8f3ed;
}
/* 本地 WebView 的弹层避开刘海和底部手势区，长连接码可在层内滚动。 */
dialog {
  max-height: calc(
    100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) -
      32px
  );
  overflow: auto;
}

/* 添加朋友入口跟随自己的卡片，连接方式不再占用模式栏。 */
.add-player {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  margin-left: 8px;
  border: 1px dashed #ffc16a;
  border-radius: 50%;
  background: #fff2d8;
  color: #b45b15;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}
.player:has(.add-player) {
  min-width: 170px;
}

/* 白色静区确保相机能稳定识别邀请二维码。 */
.invitation-qr {
  width: 236px;
  min-height: 236px;
  margin: 20px auto;
  padding: 18px;
  border-radius: 18px;
  background: white;
  color: #755c43;
  display: grid;
  place-items: center;
}
.invitation-qr img {
  display: block;
  width: 200px;
  height: 200px;
  image-rendering: pixelated;
}

/* 吹气示意直接融入舞台，辅助长按没有独立按钮或面板。 */
.game {
  min-height: min(690px, 100dvh);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.game .console {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  min-height: 34px;
}
.breath-guide {
  position: relative;
  width: min(100%, 340px);
  margin: 0 auto;
  height: clamp(155px, 27dvh, 255px);
  pointer-events: none;
}
.breath-guide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.guide-touch-pulse {
  position: absolute;
  left: 72%;
  top: 53%;
  width: 22px;
  height: 22px;
  border: 1px solid #ffce7666;
  border-radius: 50%;
  animation: guide-press 2.8s ease-out infinite;
}
@keyframes guide-press {
  0%,
  30% {
    opacity: 0;
    transform: scale(0.6);
  }
  45% {
    opacity: 0.6;
  }
  85%,
  100% {
    opacity: 0;
    transform: scale(1.8);
  }
}
.game .permission-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 4px auto 8px;
  padding: 8px 14px;
  min-height: 44px;
  background: #062632a8;
  border-radius: 22px;
  color: #ffdfa4;
  font-size: 13px;
}
.permission-prompt svg {
  width: 17px;
  height: 17px;
}
.game .console .help-button {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 44px;
  height: 44px;
  opacity: 0.65;
}
.game .console .vote-area {
  padding-bottom: 28px;
}
.touch-feedback {
  display: none;
  pointer-events: none;
  position: absolute;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  z-index: 8;
  border: 1px solid #ffd07e;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    #ffd47c44,
    #55e1d41a 50%,
    transparent 70%
  );
  box-shadow: 0 0 22px #5ee5d744;
}
.touch-feedback.visible {
  display: block;
  animation: touch-charge 0.9s ease-in-out infinite alternate;
}
@keyframes touch-charge {
  to {
    transform: scale(1.25);
    border-color: #68e1d8;
  }
}
.game.breathing .balloon {
  filter: drop-shadow(0 0 20px #ffc25a55);
}
.rules-guide {
  display: block;
  width: 100%;
  max-height: 200px;
  object-fit: contain;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.game [hidden] {
  display: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .guide-touch-pulse,
  .touch-feedback.visible {
    animation: none;
  }
}
