:root {
  color-scheme: dark;
  --bg: #101114;
  --panel: #1b1d22;
  --panel-2: #23262d;
  --line: #343945;
  --text: #f2efe7;
  --muted: #a9b0bd;
  --red: #ef6351;
  --teal: #4ecdc4;
  --gold: #f6c85f;
  --green: #74c69d;
  --arcane-card-frame: url("assets/ui/arcane-character-card-frame-v2.png");
  --arcane-panel-frame: url("assets/ui/arcane-select-panel-frame-v2.png");
  --arcane-select-frame: url("assets/ui/arcane-select-panel-frame-elegant.png");
  --arcane-combatant-frame: url("assets/ui/arcane-combatant-frame-slim-gpt2.png");
  --skill-inspect-frame: url("assets/ui/skill-inspect-frame-gpt2.png?v=1.7-skill-inspect");
  --card-frame-outset-x: 18px;
  --card-frame-outset-y: 28px;
  --outer-frame-line: rgba(130, 232, 255, 0.72);
  --outer-frame-node: rgba(246, 200, 95, 0.9);
  --ui-button-gold: url("assets/ui/ui-button-gold-gpt2.png");
  --ui-button-teal: url("assets/ui/ui-button-teal-gpt2.png");
  --ui-button-dark: url("assets/ui/ui-button-dark-gpt2.png");
  --ui-panel-lobby: url("assets/ui/ui-panel-lobby-gpt2.png");
  --lobby-control-console-art: url("assets/ui/lobby-control-console-user-clean-fast.webp");
  --lobby-control-console-ratio: 1122 / 1402;
  --ui-panel-select: url("assets/ui/ui-panel-select-gpt2.png");
  --ui-panel-dialog: url("assets/ui/ui-panel-dialog-gpt2.png");
  --ui-panel-side: url("assets/ui/ui-panel-side-gpt2.png");
  --room-seat-frame-art: url("assets/ui/room-seat-frame-minimal-gpt2.png");
  --lobby-action-panel-art: url("assets/ui/lobby-action-panel-shaped.png");
  --room-action-panel-art: url("assets/ui/lobby-action-panel-shaped.png");
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 20% 0%, rgba(78, 205, 196, 0.16), transparent 28rem),
    radial-gradient(circle at 80% 20%, rgba(246, 200, 95, 0.14), transparent 24rem),
    var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

.enter-screen {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(5, 7, 13, 0.2), rgba(5, 7, 13, 0.74)),
    linear-gradient(90deg, rgba(5, 7, 13, 0.75), rgba(5, 7, 13, 0.24), rgba(5, 7, 13, 0.78)),
    url("assets/cover/luminary-cover-gpt2.webp") center / cover no-repeat,
    #080a0f;
}

.enter-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(246, 200, 95, 0.16), transparent 34%, rgba(78, 205, 196, 0.12)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.48), transparent 24%, transparent 76%, rgba(0, 0, 0, 0.5));
}

.enter-gate {
  z-index: 1;
  width: min(520px, 88vw);
  min-height: 220px;
  padding: 48px 54px 52px;
  border: 0;
  overflow: visible;
  color: #fff8df;
  background: var(--lobby-action-panel-art) center / contain no-repeat;
  box-shadow: none;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.86);
}

.enter-gate span,
.enter-gate strong,
.enter-gate small {
  display: block;
}

.enter-gate span {
  color: rgba(126, 239, 235, 0.9);
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.enter-gate strong {
  margin-top: 8px;
  color: #fff4cf;
  font-size: 42px;
  line-height: 1.05;
  font-weight: 1000;
}

.enter-gate small {
  margin-top: 14px;
  color: rgba(246, 200, 95, 0.92);
  font-size: 15px;
  font-weight: 850;
}

.enter-gate:hover,
.enter-gate:focus-visible {
  transform: translateY(-3px) scale(1.015);
  filter: saturate(1.08) brightness(1.08);
}

@media (max-width: 640px) {
  .enter-screen {
    padding: 18px;
    background-position: center top;
  }

  .enter-gate {
    width: min(380px, 92vw);
    min-height: 168px;
    padding: 34px 34px 38px;
  }

  .enter-gate strong {
    font-size: 30px;
  }
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
}

button:focus-visible {
  outline: 2px solid rgba(246, 200, 95, 0.88);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
}

.button-spark {
  position: absolute;
  z-index: 3;
  width: 9px;
  height: 9px;
  left: 50%;
  top: 50%;
  pointer-events: none;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  color: #fff4cf;
  background: #fff4cf;
  box-shadow:
    0 0 0 0 rgba(255, 244, 207, 0.68),
    0 0 18px rgba(246, 200, 95, 0.58);
  animation: buttonSpark 620ms ease-out forwards;
}

.button-spark.attack {
  color: #ff7d66;
  background: #ff7d66;
  box-shadow: 0 0 0 0 rgba(239, 99, 81, 0.64), 0 0 20px rgba(239, 99, 81, 0.62);
}

.button-spark.defend {
  color: #7df6ec;
  background: #7df6ec;
  box-shadow: 0 0 0 0 rgba(78, 205, 196, 0.64), 0 0 20px rgba(78, 205, 196, 0.6);
}

.button-spark.charge,
.button-spark.skill,
.button-spark.lock {
  color: #ffe19a;
  background: #ffe19a;
  box-shadow: 0 0 0 0 rgba(246, 200, 95, 0.68), 0 0 20px rgba(246, 200, 95, 0.62);
}

.button-spark.control,
.button-spark.deny {
  color: #ff8f7d;
  background: #ff8f7d;
  box-shadow: 0 0 0 0 rgba(239, 99, 81, 0.68), 0 0 20px rgba(239, 99, 81, 0.62);
}

.version-badge {
  position: fixed;
  z-index: 20;
  left: 16px;
  bottom: 14px;
  pointer-events: none;
  padding: 5px 10px 6px;
  border: 1px solid rgba(246, 200, 95, 0.34);
  border-radius: 8px;
  color: rgba(255, 244, 207, 0.82);
  background:
    linear-gradient(135deg, rgba(246, 200, 95, 0.13), rgba(78, 205, 196, 0.06)),
    rgba(16, 17, 20, 0.58);
  box-shadow:
    inset 0 0 14px rgba(246, 200, 95, 0.08),
    0 8px 24px rgba(0, 0, 0, 0.28);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.06em;
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.82),
    0 0 14px rgba(246, 200, 95, 0.18);
}

.music-toggle,
.language-toggle {
  position: fixed;
  z-index: 140;
  bottom: 12px;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}

.music-toggle {
  right: 14px;
}

.language-toggle {
  right: 76px;
}

.music-toggle img,
.language-toggle img {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  filter:
    drop-shadow(0 3px 8px rgba(0, 0, 0, 0.72))
    drop-shadow(0 0 10px rgba(78, 205, 196, 0.28));
  transition: transform 140ms ease, opacity 140ms ease, filter 140ms ease;
}

.language-toggle img {
  filter:
    drop-shadow(0 3px 8px rgba(0, 0, 0, 0.72))
    drop-shadow(0 0 12px rgba(246, 200, 95, 0.26));
}

.language-code {
  position: absolute;
  right: 3px;
  bottom: 4px;
  min-width: 24px;
  padding: 2px 5px;
  border: 1px solid rgba(255, 246, 208, 0.38);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 244, 207, 0.26), rgba(8, 10, 15, 0.78)),
    rgba(8, 10, 15, 0.82);
  color: #fff4cf;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 12px rgba(78, 205, 196, 0.18);
  pointer-events: none;
}

.music-toggle:hover img,
.music-toggle:focus-visible img,
.language-toggle:hover img,
.language-toggle:focus-visible img {
  transform: translateY(-1px) scale(1.06);
  filter:
    drop-shadow(0 4px 10px rgba(0, 0, 0, 0.78))
    drop-shadow(0 0 16px rgba(246, 200, 95, 0.34));
}

.music-toggle.is-paused img {
  opacity: 0.78;
  filter:
    saturate(0.82)
    drop-shadow(0 3px 8px rgba(0, 0, 0, 0.72))
    drop-shadow(0 0 8px rgba(246, 200, 95, 0.2));
}

@keyframes buttonSpark {
  0% {
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(0.4);
    box-shadow: 0 0 0 0 currentColor, 0 0 16px currentColor;
  }

  72% {
    opacity: 0.32;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(18);
    box-shadow: 0 0 0 2px transparent, 0 0 0 transparent;
  }
}

@keyframes arcaneDrift {
  0% {
    background-position: 0 0, 0 0, 0 0;
    opacity: 0.42;
  }

  50% {
    opacity: 0.72;
  }

  100% {
    background-position: 70px -44px, -54px 48px, 0 0;
    opacity: 0.42;
  }
}

@keyframes frameBreath {
  0%,
  100% {
    filter: drop-shadow(0 0 6px rgba(78, 205, 196, 0.16)) drop-shadow(0 0 12px rgba(246, 200, 95, 0.1));
  }

  50% {
    filter: drop-shadow(0 0 11px rgba(78, 205, 196, 0.34)) drop-shadow(0 0 20px rgba(246, 200, 95, 0.22));
  }
}

@keyframes characterPreviewBackdropIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes characterPreviewInspectIn {
  from {
    opacity: 0;
    filter: brightness(0.82) saturate(0.82);
    transform: translate3d(-50%, -47%, 0) scale(0.92);
  }

  to {
    opacity: 1;
    filter: brightness(1) saturate(1);
    transform: translate3d(-50%, -50%, 0) scale(1);
  }
}

@keyframes energyOrbit {
  to {
    transform: rotate(1turn);
  }
}

@keyframes battleEnergyOrbit {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  to {
    transform: translate(-50%, -50%) rotate(1turn);
  }
}

@keyframes targetFramePulse {
  0%,
  100% {
    opacity: 0.82;
    transform: none;
  }

  50% {
    opacity: 1;
    transform: none;
  }
}

@keyframes glintSweep {
  0% {
    transform: translateX(-120%) skewX(-18deg);
    opacity: 0;
  }

  28% {
    opacity: 0.68;
  }

  100% {
    transform: translateX(160%) skewX(-18deg);
    opacity: 0;
  }
}

.app {
  width: min(2060px, calc(100% - 32px));
  height: 100dvh;
  min-height: 0;
  margin: 0 auto;
  padding: 16px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(250px, 16vw, 300px);
  gap: 16px;
  align-items: stretch;
}

.app.solo {
  grid-template-columns: minmax(0, 1fr);
}

.arena,
.side section {
  background:
    linear-gradient(135deg, rgba(15, 20, 31, 0.9), rgba(5, 7, 12, 0.92)),
    rgba(27, 29, 34, 0.88);
  border: 1px solid rgba(246, 200, 95, 0.28);
  border-radius: 8px;
  box-shadow:
    0 22px 70px rgba(0, 0, 0, 0.34),
    inset 0 0 0 1px rgba(255, 246, 208, 0.05),
    inset 0 0 42px rgba(78, 205, 196, 0.06);
}

.arena {
  position: relative;
  overflow: hidden;
  min-height: 0;
  height: 100%;
  padding: clamp(14px, 1.6vw, 20px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(10px, 1.2vw, 16px);
}

.arena::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.52;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 46%, rgba(78, 205, 196, 0.12) 48%, transparent 51%),
    radial-gradient(circle at 18% 28%, rgba(78, 205, 196, 0.2), transparent 22%),
    radial-gradient(circle at 78% 23%, rgba(246, 200, 95, 0.18), transparent 24%),
    repeating-linear-gradient(90deg, rgba(78, 205, 196, 0.055) 0 1px, transparent 1px 58px),
    repeating-linear-gradient(0deg, rgba(246, 200, 95, 0.042) 0 1px, transparent 1px 54px);
  mix-blend-mode: screen;
  animation: arcaneDrift 12s linear infinite;
}

.arena > * {
  position: relative;
  z-index: 1;
}

.side section {
  position: relative;
  overflow: hidden;
}

.side section::before {
  content: "";
  position: absolute;
  inset: -12px;
  z-index: 0;
  opacity: 0.28;
  pointer-events: none;
  background: var(--arcane-panel-frame) center / 100% 100% no-repeat;
  filter: drop-shadow(0 0 12px rgba(78, 205, 196, 0.26));
}

.side section > * {
  position: relative;
  z-index: 1;
}

.fx-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
}

.screen-flash {
  position: absolute;
  inset: -16%;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 244, 207, 0.24), transparent 26%),
    linear-gradient(110deg, transparent 0 38%, rgba(255, 244, 207, 0.16) 48%, transparent 60%);
  animation: screenFlash 620ms ease-out forwards;
}

.screen-flash.attack {
  background:
    radial-gradient(circle at 50% 48%, rgba(239, 99, 81, 0.34), transparent 24%),
    linear-gradient(110deg, transparent 0 36%, rgba(255, 125, 102, 0.24) 48%, transparent 61%);
}

.screen-flash.defend {
  background:
    radial-gradient(circle at 50% 48%, rgba(78, 205, 196, 0.28), transparent 25%),
    linear-gradient(90deg, rgba(78, 205, 196, 0.14), transparent 22%, transparent 78%, rgba(78, 205, 196, 0.14));
}

.screen-flash.charge,
.screen-flash.skill,
.screen-flash.lock {
  background:
    radial-gradient(circle at 50% 52%, rgba(246, 200, 95, 0.34), transparent 28%),
    conic-gradient(from 220deg at 50% 52%, transparent, rgba(255, 225, 154, 0.18), transparent, rgba(78, 205, 196, 0.12), transparent);
}

.screen-flash.control,
.screen-flash.deny {
  background:
    radial-gradient(circle at 50% 50%, rgba(239, 99, 81, 0.28), transparent 25%),
    repeating-linear-gradient(135deg, rgba(239, 99, 81, 0.14) 0 2px, transparent 2px 18px);
}

@keyframes screenFlash {
  0% {
    opacity: 0;
    transform: scale(0.96) rotate(0deg);
  }

  18% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: scale(1.06) rotate(1deg);
  }
}

.settlement-reveal {
  position: absolute;
  z-index: 18;
  left: 50%;
  top: clamp(82px, 11vh, 126px);
  width: min(540px, calc(100% - 42px));
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 16px 20px 18px;
  border: 1px solid rgba(255, 246, 208, 0.48);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(3, 5, 10, 0.9), rgba(3, 5, 10, 0.58) 50%, rgba(3, 5, 10, 0.86)),
    linear-gradient(180deg, rgba(255, 244, 207, 0.12), rgba(0, 0, 0, 0.32)),
    var(--ui-panel-dialog) center / cover no-repeat,
    rgba(8, 10, 15, 0.96);
  color: #fff4cf;
  text-align: center;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 24px 58px rgba(0, 0, 0, 0.48),
    0 0 34px rgba(246, 200, 95, 0.14);
  transform: translateX(-50%);
  animation: settlementReveal 820ms ease-out forwards;
  backdrop-filter: blur(10px);
}

.settlement-reveal span,
.settlement-reveal b {
  color: rgba(130, 232, 255, 0.92);
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settlement-reveal strong {
  color: #fff8df;
  font-size: clamp(22px, 3.2vw, 34px);
  line-height: 1.08;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.92),
    0 0 20px rgba(246, 200, 95, 0.28);
}

.settlement-reveal small {
  color: rgba(255, 244, 207, 0.74);
  font-size: 12px;
  font-weight: 900;
}

.settlement-reveal.attack {
  border-color: rgba(239, 99, 81, 0.66);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 24px 58px rgba(0, 0, 0, 0.48),
    0 0 38px rgba(239, 99, 81, 0.22);
}

.settlement-reveal.defend {
  border-color: rgba(130, 232, 255, 0.66);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 24px 58px rgba(0, 0, 0, 0.48),
    0 0 38px rgba(78, 205, 196, 0.2);
}

.settlement-reveal.charge {
  border-color: rgba(246, 200, 95, 0.72);
}

.settlement-reveal.skill {
  border-color: rgba(141, 209, 255, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 24px 58px rgba(0, 0, 0, 0.48),
    0 0 40px rgba(141, 209, 255, 0.26);
}

.settlement-reveal.deny {
  border-color: rgba(255, 134, 134, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 24px 58px rgba(0, 0, 0, 0.48),
    0 0 40px rgba(255, 134, 134, 0.22);
}

.battle-action-trail {
  position: absolute;
  z-index: 17;
  height: 5px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 244, 207, 0.86), rgba(239, 99, 81, 0.94), transparent);
  box-shadow:
    0 0 14px rgba(239, 99, 81, 0.5),
    0 0 28px rgba(246, 200, 95, 0.28);
  transform-origin: left center;
  transform: rotate(var(--trail-angle));
  pointer-events: none;
  animation: battleActionTrail 820ms ease-out forwards;
}

.battle-action-trail.skill {
  background:
    linear-gradient(90deg, transparent, rgba(220, 246, 255, 0.92), rgba(108, 182, 255, 0.96), transparent);
  box-shadow:
    0 0 14px rgba(108, 182, 255, 0.56),
    0 0 28px rgba(130, 232, 255, 0.32);
}

.settlement-actor {
  --settlement-glow: rgba(246, 200, 95, 0.32);
  z-index: 8;
  animation: settlementActorPulse 820ms ease-out;
  filter:
    saturate(1.22)
    brightness(1.08)
    drop-shadow(0 0 18px var(--settlement-glow));
}

.settlement-target {
  z-index: 7;
  animation: settlementTargetPulse 820ms ease-out;
  filter:
    saturate(1.1)
    brightness(1.04)
    drop-shadow(0 0 15px rgba(239, 99, 81, 0.26));
}

.settlement-attack {
  --settlement-glow: rgba(239, 99, 81, 0.38);
}

.settlement-defend {
  --settlement-glow: rgba(78, 205, 196, 0.38);
}

.settlement-charge {
  --settlement-glow: rgba(246, 200, 95, 0.42);
}

.settlement-skill {
  --settlement-glow: rgba(108, 182, 255, 0.42);
}

.settlement-deny {
  --settlement-glow: rgba(255, 134, 134, 0.38);
}

@keyframes settlementReveal {
  0% {
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.96);
  }

  18%,
  72% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -8px) scale(0.985);
  }
}

@keyframes settlementActorPulse {
  0% {
    transform: translateY(0) scale(1);
  }

  34% {
    transform: translateY(-6px) scale(1.035);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes settlementTargetPulse {
  0% {
    transform: scale(1);
  }

  38% {
    transform: scale(1.025);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes battleActionTrail {
  0% {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
  }

  22% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }

  100% {
    opacity: 0;
    clip-path: inset(0 0 0 100%);
  }
}

.app.solo .arena {
  background:
    linear-gradient(90deg, rgba(8, 10, 16, 0.74) 0%, rgba(12, 16, 24, 0.28) 42%, rgba(8, 10, 16, 0.62) 100%),
    linear-gradient(180deg, rgba(8, 10, 16, 0.08) 0%, rgba(8, 10, 16, 0.7) 100%),
    url("assets/cover/luminary-cover-gpt2.webp") center / cover no-repeat;
  border-color: rgba(246, 200, 95, 0.32);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42), inset 0 0 0 1px rgba(255, 230, 160, 0.08);
}

.app.solo .arena::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 57%, rgba(246, 200, 95, 0.18), transparent 20%),
    linear-gradient(180deg, rgba(255, 241, 188, 0.08), transparent 28%, rgba(0, 0, 0, 0.34));
}

.app:not(.solo) .arena {
  background:
    linear-gradient(90deg, rgba(8, 10, 16, 0.82) 0%, rgba(12, 16, 24, 0.48) 42%, rgba(8, 10, 16, 0.82) 100%),
    linear-gradient(180deg, rgba(255, 241, 188, 0.08) 0%, rgba(8, 10, 16, 0.72) 42%, rgba(4, 6, 10, 0.94) 100%),
    url("assets/cover/luminary-cover-gpt2.webp") center / cover no-repeat;
  border-color: rgba(246, 200, 95, 0.36);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.44),
    inset 0 0 0 1px rgba(255, 230, 160, 0.08);
}

.app:not(.solo) .arena::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 52%, rgba(246, 200, 95, 0.16), transparent 24%),
    radial-gradient(circle at 17% 35%, rgba(78, 205, 196, 0.12), transparent 24%),
    radial-gradient(circle at 82% 35%, rgba(239, 99, 81, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(255, 241, 188, 0.08), transparent 24%, rgba(0, 0, 0, 0.42));
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 0;
  min-height: 0;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(25px, 3.5vw, 40px);
  line-height: 1.14;
  letter-spacing: 0;
  margin-bottom: 6px;
  width: fit-content;
  background: linear-gradient(180deg, #fff9d9 0%, #f6c85f 42%, #8fefff 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.85)) drop-shadow(0 0 16px rgba(246, 200, 95, 0.26));
}

.app.solo h1 {
  color: #fff4cf;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.86),
    0 0 22px rgba(246, 200, 95, 0.4);
}

.app:not(.solo) h1 {
  color: #fff4cf;
  font-size: clamp(23px, 2.9vw, 34px);
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.86),
    0 0 22px rgba(246, 200, 95, 0.34);
}

.app.solo #subtitle,
.app:not(.solo) #subtitle {
  color: #d8d4cb;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.app:not(.solo) .topbar {
  align-items: center;
}

.app:not(.solo) h1 {
  margin-bottom: 2px;
}

.app:not(.solo) #subtitle {
  font-size: 13px;
  line-height: 1.2;
}

.app:not(.solo) .room-pill {
  padding: 7px 9px;
}

.app:not(.solo) .room-pill strong {
  font-size: 20px;
}

h2 {
  font-size: 18px;
  margin-bottom: 12px;
}

#subtitle,
.hint,
.rules p,
.choice,
.log small {
  color: var(--muted);
}

.room-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background:
    linear-gradient(90deg, rgba(78, 205, 196, 0.08), transparent 42%, rgba(246, 200, 95, 0.1)),
    var(--panel-2);
  border: 1px solid rgba(246, 200, 95, 0.36);
  border-radius: 8px;
  padding: 9px 10px;
}

.app.solo .room-pill,
.app:not(.solo) .room-pill {
  background: rgba(14, 18, 27, 0.78);
  border-color: rgba(246, 200, 95, 0.34);
  box-shadow: inset 0 0 0 1px rgba(255, 244, 207, 0.08), 0 12px 34px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
}

.room-pill strong {
  font-size: 22px;
  letter-spacing: 2px;
  color: #fff8dd;
  text-shadow:
    0 0 12px rgba(246, 200, 95, 0.42),
    0 0 18px rgba(78, 205, 196, 0.18);
}

.room-pill button,
.utility button,
.lobby button,
.preview-copy button,
.rules-head button {
  --ui-button-art: var(--ui-button-teal);
  --ui-button-tint: rgba(78, 205, 196, 0.24);
  background:
    linear-gradient(90deg, rgba(2, 3, 6, 0.72), rgba(2, 3, 6, 0.16) 50%, rgba(2, 3, 6, 0.72)),
    linear-gradient(180deg, rgba(255, 244, 207, 0.18), rgba(0, 0, 0, 0.18) 68%),
    var(--ui-button-art) center / 100% 100% no-repeat,
    linear-gradient(180deg, #142332, #071016);
  color: #fff8df;
  border: 1px solid rgba(255, 246, 208, 0.42);
  border-radius: 6px;
  padding: 10px 14px;
  font-weight: 900;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 0 18px var(--ui-button-tint),
    0 0 16px color-mix(in srgb, var(--teal) 16%, transparent),
    0 10px 22px rgba(0, 0, 0, 0.28);
  text-shadow:
    0 2px 3px rgba(0, 0, 0, 0.9),
    0 0 12px color-mix(in srgb, var(--teal) 34%, transparent);
}

.room-pill button:hover:not(:disabled),
.utility button:hover:not(:disabled),
.lobby button:hover:not(:disabled),
.preview-copy button:hover:not(:disabled),
.rules-head button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08) saturate(1.08);
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 208, 0.18),
    inset 0 0 22px var(--ui-button-tint),
    0 0 22px color-mix(in srgb, var(--teal) 24%, transparent),
    0 12px 24px rgba(0, 0, 0, 0.28);
}

.lobby {
  min-height: 0;
  height: 100%;
  display: grid;
  place-items: center;
}

.app.solo .lobby {
  min-height: 0;
  place-items: center;
  padding: clamp(10px, 2vh, 24px) 0;
}

.lobby-shell {
  width: min(560px, 100%, max(360px, calc((100dvh - 150px) * 1122 / 1402)));
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: center;
  justify-items: center;
}

.lobby-copy {
  display: none;
}

.lobby-copy > span {
  width: fit-content;
  color: #78f1e8;
  border: 1px solid rgba(78, 205, 196, 0.36);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(8, 14, 18, 0.66);
  box-shadow: inset 0 0 0 1px rgba(255, 246, 208, 0.05);
  font-size: 13px;
  font-weight: 900;
}

.lobby-copy > strong {
  max-width: 580px;
  color: #fff4cf;
  font-size: clamp(34px, 4vw, 64px);
  line-height: 1.02;
  letter-spacing: 0;
  text-shadow:
    0 3px 0 rgba(0, 0, 0, 0.82),
    0 0 30px rgba(246, 200, 95, 0.28);
}

.lobby-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.lobby-badges i {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  color: #f7edcf;
  border: 1px solid rgba(246, 200, 95, 0.28);
  border-radius: 999px;
  padding: 6px 11px;
  background:
    linear-gradient(180deg, rgba(246, 200, 95, 0.14), transparent),
    rgba(10, 12, 17, 0.68);
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.lobby-panel {
  width: 100%;
  aspect-ratio: var(--lobby-control-console-ratio);
  min-height: min(660px, calc(100dvh - 150px));
  display: grid;
  gap: 16px;
  align-content: center;
  background:
    linear-gradient(90deg, rgba(3, 5, 10, 0.86), rgba(3, 5, 10, 0.42) 50%, rgba(3, 5, 10, 0.72)),
    linear-gradient(180deg, rgba(255, 244, 207, 0.08), rgba(0, 0, 0, 0.24)),
    var(--lobby-control-console-art) center / contain no-repeat,
    linear-gradient(180deg, rgba(23, 30, 44, 0.98), rgba(6, 8, 13, 0.98));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.app.solo .lobby-panel {
  background:
    linear-gradient(90deg, rgba(3, 5, 10, 0.86), rgba(3, 5, 10, 0.36) 50%, rgba(3, 5, 10, 0.72)),
    linear-gradient(180deg, rgba(255, 244, 207, 0.1), rgba(0, 0, 0, 0.26)),
    var(--lobby-control-console-art) center / contain no-repeat,
    linear-gradient(180deg, rgba(23, 30, 44, 0.98), rgba(6, 8, 13, 0.98));
  border-color: rgba(246, 200, 95, 0.42);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.5),
    0 0 46px rgba(246, 200, 95, 0.08),
    inset 0 0 0 1px rgba(255, 244, 207, 0.08);
  backdrop-filter: blur(10px);
}

.panel-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 4px;
}

.panel-title span {
  color: #78f1e8;
  font-size: 13px;
  font-weight: 900;
}

.panel-title strong {
  color: #fff4cf;
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1;
  text-shadow: 0 0 16px rgba(246, 200, 95, 0.22);
}

.app.solo label {
  color: #d7d2c5;
}

.app.solo input {
  background: rgba(8, 10, 16, 0.8);
  border-color: rgba(246, 200, 95, 0.28);
}

.app.solo input:focus {
  border-color: #f6c85f;
  box-shadow: 0 0 0 3px rgba(246, 200, 95, 0.16);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

input {
  width: 100%;
  background: #111318;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 6px;
  padding: 12px 13px;
  outline: none;
}

input:focus {
  border-color: var(--teal);
}

.lobby-actions,
.join-row {
  display: grid;
  gap: 10px;
}

.mode-select {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mode-select button {
  --mode-art: none;
  min-height: clamp(70px, 9vh, 92px);
  display: grid;
  align-content: center;
  gap: 5px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(255, 226, 151, 0.46);
  border-radius: 8px;
  padding: 14px 14px;
  text-align: left;
  background:
    linear-gradient(90deg, rgba(3, 5, 10, 0.88), rgba(3, 5, 10, 0.5) 52%, rgba(3, 5, 10, 0.2)),
    linear-gradient(180deg, rgba(255, 244, 207, 0.1), rgba(0, 0, 0, 0.18)),
    var(--mode-art) center / cover no-repeat,
    linear-gradient(180deg, rgba(23, 30, 44, 0.98), rgba(6, 8, 13, 0.98));
  color: #fff4cf;
  font-weight: 900;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.95),
    0 0 14px rgba(246, 200, 95, 0.34);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 -20px 38px rgba(0, 0, 0, 0.32),
    0 12px 26px rgba(0, 0, 0, 0.28);
}

.mode-select button[data-mode="1v1"] {
  --mode-art: url("assets/ui/mode-1v1-gpt2-fast.webp");
}

.mode-select button[data-mode="2v2"] {
  --mode-art: url("assets/ui/mode-2v2-gpt2-fast.webp");
}

.mode-select button[data-mode="3v3"] {
  --mode-art: url("assets/ui/mode-3v3-gpt2-fast.webp");
}

.mode-select button[data-mode="identity"] {
  --mode-art: url("assets/ui/mode-identity-gpt2-fast.webp");
}

.mode-select button span,
.mode-select button small {
  position: relative;
  z-index: 1;
}

.mode-select button span {
  font-size: clamp(18px, 2vw, 22px);
}

.mode-select button small {
  color: rgba(255, 244, 207, 0.78);
  font-size: 11px;
}

.mode-select button.selected {
  color: #fffbe5;
  border-color: rgba(255, 246, 208, 0.78);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    inset 0 -20px 38px rgba(0, 0, 0, 0.26),
    0 0 24px rgba(246, 200, 95, 0.28),
    0 14px 30px rgba(0, 0, 0, 0.34);
}

.lobby-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.lobby-actions > .primary {
  grid-column: 1 / -1;
}

.lobby-actions > button {
  min-height: clamp(78px, 10vh, 104px);
  display: grid;
  align-content: center;
  gap: 7px;
  text-align: left;
  padding: 20px 18px;
  font-size: 18px;
  line-height: 1.25;
}

.app.solo .lobby-actions > button {
  min-height: 0;
  border: 0;
  box-shadow: none;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.92),
    0 0 10px rgba(246, 200, 95, 0.36);
}

.app.solo .lobby-actions > .primary {
  background:
    linear-gradient(135deg, rgba(255, 244, 207, 0.28), transparent 44%),
    linear-gradient(180deg, #ffe08a, #d79a34 58%, #9b641e);
  color: #211408;
}

.app.solo .lobby-actions > .secondary {
  background:
    linear-gradient(135deg, rgba(78, 205, 196, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(30, 44, 68, 0.94), rgba(13, 18, 30, 0.96));
  color: #f2efe7;
  border-color: rgba(246, 200, 95, 0.32);
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.7);
}

.lobby-actions > button span {
  position: relative;
  z-index: 1;
  font-size: clamp(20px, 2.4vw, 24px);
  font-weight: 900;
}

.lobby-actions > button small {
  position: relative;
  z-index: 1;
  color: inherit;
  opacity: 0.78;
  font-size: 12px;
  font-weight: 900;
}

.lobby-actions > button::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 246, 208, 0.3);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 244, 207, 0.36), transparent 62%),
    rgba(10, 12, 17, 0.18);
  box-shadow: 0 0 18px rgba(246, 200, 95, 0.2);
}

.app.solo #lobbyHint {
  color: #d4cabb;
}

.join-row {
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: stretch;
}

.join-row input {
  align-self: center;
  min-height: 44px;
  border-color: rgba(130, 232, 255, 0.22);
  background: rgba(5, 8, 13, 0.52);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 0 18px rgba(0, 0, 0, 0.34);
}

.join-row button {
  min-width: 112px;
  white-space: nowrap;
  border: 0;
  background:
    linear-gradient(90deg, rgba(2, 3, 6, 0.74), rgba(2, 3, 6, 0.24) 50%, rgba(2, 3, 6, 0.74)),
    var(--lobby-action-panel-art) center / cover no-repeat,
    rgba(8, 10, 15, 0.98);
}

.app.solo .lobby-actions > button,
.join-row button {
  --lobby-action-art: var(--lobby-action-panel-art);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 0;
  background:
    var(--lobby-action-art) center / contain no-repeat;
  color: #fff4cf;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.95),
    0 0 14px rgba(246, 200, 95, 0.42);
  box-shadow: none;
}

.app.solo .lobby-actions > button::after {
  content: none;
}

.app.solo #createRoom {
  --lobby-action-art: url("assets/ui/lobby-create-room-gpt2.png");
}

.app.solo #createBotRoom {
  --lobby-action-art: url("assets/ui/lobby-bot-practice-cutout-fast.webp");
}

.app.solo #showRules {
  --lobby-action-art: url("assets/ui/lobby-rules-cutout-fast.webp");
}

.app.solo .lobby-actions > #createRoom,
.app.solo .lobby-actions > #createBotRoom,
.app.solo .lobby-actions > #showRules {
  aspect-ratio: auto;
  min-height: clamp(88px, 12vh, 122px);
  max-height: 138px;
  align-content: center;
  justify-items: center;
  padding: 0 18px;
  text-align: center;
  background:
    var(--lobby-action-art) center / contain no-repeat;
  color: #fff4cf;
  border: 0;
  box-shadow: none;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.95),
    0 0 14px rgba(246, 200, 95, 0.42);
}

.app.solo .lobby-actions > #createBotRoom,
.app.solo .lobby-actions > #showRules {
  min-height: clamp(112px, 13vh, 132px);
  background-position: center;
  background-size: auto 94%;
}

.join-row #joinRoom {
  --lobby-action-art: var(--lobby-action-panel-art);
  min-width: 112px;
  padding-inline: 18px;
  border: 0;
  background:
    var(--lobby-action-art) center / contain no-repeat;
  box-shadow: none;
}

.room-pill #copyRoom {
  min-width: 104px;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(3, 5, 10, 0.82), rgba(3, 5, 10, 0.38) 50%, rgba(3, 5, 10, 0.82)),
    linear-gradient(180deg, rgba(255, 244, 207, 0.08), rgba(0, 0, 0, 0.16)),
    var(--lobby-action-panel-art) center / contain no-repeat,
    rgba(8, 10, 15, 0.98);
  box-shadow:
    inset 0 -18px 32px rgba(0, 0, 0, 0.3),
    0 10px 22px rgba(0, 0, 0, 0.28);
}

.join-row #joinRoom:hover:not(:disabled),
.room-pill #copyRoom:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: none;
}

.lobby button.secondary {
  background: #111318;
  color: var(--text);
  border: 1px solid var(--line);
}

.room-lobby {
  --room-mode-art: url("assets/ui/mode-1v1-gpt2.png");
  width: min(900px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  justify-self: center;
  align-self: center;
  display: grid;
  gap: 16px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid rgba(246, 200, 95, 0.42);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(5, 7, 12, 0.16), rgba(5, 7, 12, 0.4) 42%, rgba(5, 7, 12, 0.66)),
    linear-gradient(90deg, rgba(3, 5, 10, 0.34), rgba(3, 5, 10, 0.08) 50%, rgba(3, 5, 10, 0.34)),
    var(--room-mode-art) center / cover no-repeat,
    rgba(13, 16, 24, 0.96);
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 208, 0.07),
    0 28px 72px rgba(0, 0, 0, 0.42);
  overflow-y: auto;
}

.room-lobby[data-mode="1v1"] {
  --room-mode-art: url("assets/ui/mode-1v1-gpt2.png");
}

.room-lobby[data-mode="2v2"] {
  --room-mode-art: url("assets/ui/mode-2v2-gpt2.png");
}

.room-lobby[data-mode="3v3"] {
  --room-mode-art: url("assets/ui/mode-3v3-gpt2.png");
}

.room-lobby[data-mode="identity"] {
  --room-mode-art: url("assets/ui/mode-identity-gpt2.png");
}

.room-lobby[hidden] {
  display: none !important;
}

.room-lobby-head {
  display: grid;
  gap: 6px;
  text-align: center;
}

.room-lobby-head span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.room-lobby-head strong {
  color: var(--gold);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
  text-shadow: 0 0 22px rgba(246, 200, 95, 0.24);
}

.room-lobby-head small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.identity-rules {
  border: 1px solid rgba(130, 232, 255, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(5, 7, 12, 0.48), rgba(5, 7, 12, 0.78)),
    linear-gradient(135deg, rgba(78, 205, 196, 0.1), transparent 46%),
    var(--ui-panel-dialog) center / cover no-repeat,
    rgba(6, 8, 12, 0.58);
  color: var(--text);
  overflow: hidden;
}

.identity-rules[hidden] {
  display: none !important;
}

.identity-rules summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 15px;
  color: #82e8ff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  list-style: none;
}

.identity-rules summary::-webkit-details-marker {
  display: none;
}

.identity-rules summary::after {
  content: "+";
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(130, 232, 255, 0.28);
  border-radius: 999px;
  color: var(--gold);
  font-size: 18px;
  line-height: 1;
}

.identity-rules[open] summary::after {
  content: "-";
}

.identity-rules-body {
  display: grid;
  gap: 9px;
  padding: 0 15px 15px;
  color: rgba(255, 244, 207, 0.86);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.identity-rules-body p,
.identity-rules-body ul {
  margin: 0;
}

.identity-rules-body ul {
  display: grid;
  gap: 7px;
  padding-left: 18px;
}

.identity-rules-body b {
  color: var(--gold);
}

.room-seat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  padding: 12px;
  overflow: visible;
}

.room-lobby[data-mode="3v3"] .room-seat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.room-seat {
  --card-frame-outset-x: 12px;
  --card-frame-outset-y: 14px;
  --position-frame-opacity: 0.62;
  --position-frame-glow: rgba(78, 205, 196, 0.16);
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 7px;
  position: relative;
  isolation: isolate;
  overflow: visible;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 15px;
  background: transparent;
}

.room-seat[data-team="blue"] {
  background: transparent;
}

.room-seat.occupied {
  border-color: transparent;
  box-shadow: none;
}

.room-seat.self {
  --position-frame-opacity: 0.9;
  --position-frame-glow: rgba(78, 205, 196, 0.34);
  border-color: transparent;
  box-shadow: none;
}

.room-seat.empty {
  --position-frame-opacity: 0.46;
  --position-frame-glow: rgba(246, 200, 95, 0.12);
  border-style: solid;
  opacity: 0.76;
}

.room-seat::before {
  content: "";
  position: absolute;
  inset:
    calc(var(--card-frame-outset-y) * -1)
    calc(var(--card-frame-outset-x) * -1);
  z-index: -1;
  pointer-events: none;
  border-radius: 10px;
  border: clamp(14px, 1.9vw, 22px) solid transparent;
  border-image-source: var(--room-seat-frame-art);
  border-image-slice: 148 186;
  border-image-repeat: stretch;
  opacity: var(--position-frame-opacity);
  filter:
    drop-shadow(0 0 8px var(--position-frame-glow))
    drop-shadow(0 0 12px rgba(246, 200, 95, 0.12));
}

.room-seat span {
  color: #82e8ff;
  font-size: 11px;
  font-weight: 900;
}

.room-seat[data-team="blue"] span {
  color: var(--gold);
}

.room-seat strong {
  min-width: 0;
  overflow: hidden;
  color: #fff4cf;
  font-size: 18px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.room-seat small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.room-seat-actions {
  display: flex;
  justify-content: center;
  gap: 6px;
  min-height: 28px;
  margin-top: 2px;
}

.room-seat-action {
  aspect-ratio: 2.38 / 1;
  min-width: 76px;
  min-height: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  padding: 6px 8px;
  background: var(--room-action-panel-art) center / contain no-repeat;
  color: #fff8df;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
  text-shadow:
    0 2px 3px rgba(0, 0, 0, 0.9),
    0 0 12px color-mix(in srgb, var(--teal) 32%, transparent);
}

.room-seat-action.kick {
  color: #ffe1dc;
  text-shadow:
    0 2px 3px rgba(0, 0, 0, 0.9),
    0 0 12px rgba(239, 99, 81, 0.34);
}

.room-seat-action:hover:not(:disabled),
.room-seat-action:focus-visible:not(:disabled) {
  outline: none;
  transform: translateY(-1px);
  filter: brightness(1.08) saturate(1.08);
}

.player-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  vertical-align: middle;
}

.player-name .player-name-text {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.player-name .afk-badge {
  flex: 0 0 auto;
  min-width: 32px;
  padding: 2px 6px;
  border: 1px solid rgba(218, 222, 230, 0.28);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(178, 184, 194, 0.38), rgba(82, 87, 96, 0.58)),
    rgba(70, 75, 84, 0.84);
  color: #e4e6eb;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.13),
    0 0 10px rgba(0, 0, 0, 0.28);
}

.seat-fighter .player-name {
  gap: 3px;
}

.seat-fighter .player-name .afk-badge {
  min-width: 25px;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 7px;
}

.room-lobby-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(68px, 1fr));
  gap: clamp(6px, 1vw, 10px);
  padding: 0;
  overflow: visible;
}

.room-lobby-actions button,
#leaveCharacterSelect,
#lockCharacter,
#leaveRoom {
  aspect-ratio: 2.38 / 1;
  min-height: 0;
  display: grid;
  place-items: center;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  padding: 8px 6px;
  font-size: clamp(11px, 1.55vh, 15px);
  font-weight: 900;
  line-height: 1.05;
  white-space: nowrap;
  color: #fff8df;
  background:
    var(--room-action-panel-art) center / contain no-repeat;
  box-shadow: none;
  text-shadow:
    0 2px 3px rgba(0, 0, 0, 0.9),
    0 0 12px color-mix(in srgb, var(--teal) 32%, transparent);
}

.room-lobby-actions button::before,
#leaveCharacterSelect::before,
#lockCharacter::before,
#leaveRoom::before {
  content: none;
}

.room-lobby-actions #startGame {
  color: #fff8df;
}

.room-lobby-actions #copyRoomLobby {
  color: #fff8df;
}

.room-lobby-actions #refreshRoomLobby {
  color: #fff8df;
}

.room-lobby-actions #leaveRoomLobby {
  color: #fff8df;
}

.room-lobby-actions button:not(:disabled):hover,
.room-lobby-actions button:not(:disabled):focus-visible,
#leaveCharacterSelect:not(:disabled):hover,
#leaveCharacterSelect:not(:disabled):focus-visible,
#lockCharacter:not(:disabled):hover,
#lockCharacter:not(:disabled):focus-visible,
#leaveRoom:not(:disabled):hover,
#leaveRoom:not(:disabled):focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: none;
}

.room-lobby-actions button:disabled,
.room-lobby-actions #startGame:disabled,
.room-lobby-actions #copyRoomLobby:disabled,
.room-lobby-actions #refreshRoomLobby:disabled,
.room-lobby-actions #leaveRoomLobby:disabled,
#leaveCharacterSelect:disabled,
#lockCharacter:disabled,
#leaveRoom:disabled {
  background:
    var(--room-action-panel-art) center / contain no-repeat;
  border: 0;
  color: rgba(255, 244, 207, 0.42);
  box-shadow: none;
  filter: grayscale(0.8);
}

.identity-select {
  width: min(980px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  justify-self: center;
  align-self: center;
  display: grid;
  gap: 16px;
  padding: clamp(18px, 2.6vw, 28px);
  border: 1px solid rgba(246, 200, 95, 0.42);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(5, 7, 12, 0.5), rgba(5, 7, 12, 0.82)),
    radial-gradient(circle at 22% 10%, rgba(246, 200, 95, 0.16), transparent 26rem),
    radial-gradient(circle at 78% 20%, rgba(78, 205, 196, 0.12), transparent 24rem),
    var(--ui-panel-select) center / cover no-repeat,
    linear-gradient(180deg, rgba(13, 16, 24, 0.94), rgba(5, 7, 12, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 208, 0.08),
    0 28px 74px rgba(0, 0, 0, 0.44);
  overflow-y: auto;
}

.identity-select[hidden] {
  display: none !important;
}

.identity-select-head {
  display: grid;
  gap: 6px;
  text-align: center;
}

.identity-select-head span,
.identity-card-copy span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.identity-select-head strong {
  color: var(--gold);
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.05;
  text-shadow: 0 0 24px rgba(246, 200, 95, 0.28);
}

.identity-select-head small,
.identity-action-panel p,
.identity-card-copy p {
  margin: 0;
  color: rgba(255, 244, 207, 0.78);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

.identity-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(300px, 1.1fr);
  gap: 18px;
  align-items: stretch;
}

.identity-card-display,
.identity-action-panel {
  border: 1px solid rgba(255, 246, 208, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(5, 7, 12, 0.38), rgba(5, 7, 12, 0.7)),
    linear-gradient(135deg, rgba(78, 205, 196, 0.12), transparent 48%),
    var(--ui-panel-dialog) center / cover no-repeat,
    rgba(6, 8, 12, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 246, 208, 0.06);
}

.identity-card-display {
  overflow: hidden;
}

.identity-card-art {
  min-height: clamp(280px, 46vh, 500px);
  background:
    linear-gradient(180deg, rgba(255, 244, 207, 0.04), rgba(5, 7, 12, 0.16)),
    var(--identity-art, none) center 22% / cover no-repeat,
    rgba(9, 12, 18, 0.92);
}

.identity-card-copy {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.identity-card-copy strong {
  color: #fff4cf;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
}

.identity-action-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 18px;
}

.identity-action-panel > strong {
  color: var(--gold);
  font-size: 22px;
  line-height: 1.2;
}

.identity-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-content: start;
}

.identity-option {
  min-height: 88px;
  display: grid;
  gap: 6px;
  align-content: center;
  padding: 12px;
  border: 1px solid rgba(255, 246, 208, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(246, 200, 95, 0.12), transparent 46%),
    rgba(11, 14, 20, 0.84);
  color: #fff4cf;
  text-align: left;
}

.identity-option strong {
  overflow: hidden;
  font-size: 16px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.identity-option small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.identity-option.selected {
  border-color: rgba(130, 232, 255, 0.82);
  background:
    linear-gradient(135deg, rgba(78, 205, 196, 0.25), transparent 48%),
    rgba(10, 20, 24, 0.9);
  box-shadow: 0 0 22px rgba(78, 205, 196, 0.22);
}

.identity-confirm {
  --ui-button-art: var(--ui-button-gold);
  min-height: 52px;
  border: 1px solid rgba(255, 232, 168, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(2, 3, 6, 0.58), rgba(2, 3, 6, 0.12) 50%, rgba(2, 3, 6, 0.58)),
    linear-gradient(180deg, rgba(255, 244, 207, 0.18), rgba(0, 0, 0, 0.16) 68%),
    var(--ui-button-art) center / 100% 100% no-repeat,
    rgba(8, 10, 15, 0.98);
  color: #fff8df;
  font-size: 15px;
  font-weight: 900;
  text-shadow:
    0 2px 3px rgba(0, 0, 0, 0.9),
    0 0 12px rgba(246, 200, 95, 0.34);
}

.identity-confirm:disabled {
  background:
    linear-gradient(90deg, rgba(2, 3, 6, 0.84), rgba(2, 3, 6, 0.56) 50%, rgba(2, 3, 6, 0.84)),
    var(--ui-button-dark) center / 100% 100% no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(42, 45, 52, 0.72));
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 244, 207, 0.42);
  box-shadow: none;
  filter: grayscale(0.8);
}

.identity-rules-during {
  margin-top: 2px;
}

.identity-event-toast {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.18);
}

.identity-event-toast[hidden] {
  display: none !important;
}

.identity-event-card {
  width: min(360px, calc(100vw - 44px));
  overflow: hidden;
  border: 1px solid rgba(255, 246, 208, 0.36);
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 0%, rgba(246, 200, 95, 0.18), transparent 50%),
    linear-gradient(180deg, rgba(18, 22, 32, 0.98), rgba(5, 7, 12, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 208, 0.08),
    0 28px 82px rgba(0, 0, 0, 0.68),
    0 0 40px rgba(246, 200, 95, 0.18);
  text-align: center;
  animation: identityEventIn 360ms ease-out both;
}

.identity-event-art {
  height: 270px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(5, 7, 12, 0.5)),
    var(--identity-event-art, none) center 24% / cover no-repeat,
    #0b0e14;
}

.identity-event-card span {
  display: block;
  margin-top: 14px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.identity-event-card strong {
  display: block;
  margin-top: 5px;
  color: var(--gold);
  font-size: 32px;
  line-height: 1;
}

.identity-event-card p {
  margin: 10px 18px 18px;
  color: rgba(255, 244, 207, 0.82);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.48;
}

@keyframes identityEventIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.return-lobby {
  --ui-button-art: var(--ui-button-dark);
  justify-self: end;
  min-width: 108px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(246, 200, 95, 0.36);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(2, 3, 6, 0.74), rgba(2, 3, 6, 0.2) 50%, rgba(2, 3, 6, 0.74)),
    var(--ui-button-art) center / 100% 100% no-repeat,
    rgba(12, 15, 22, 0.78);
  color: #fff4cf;
  font-size: 13px;
  font-weight: 900;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.9);
}

.return-lobby:hover,
.return-lobby:focus-visible {
  border-color: rgba(246, 200, 95, 0.58);
  color: var(--gold);
}

.result-overlay {
  position: absolute;
  z-index: 80;
  left: 50%;
  top: 50%;
  width: min(420px, calc(100% - 40px));
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 24px 26px;
  border: 1px solid rgba(255, 246, 208, 0.34);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(5, 7, 12, 0.54), rgba(5, 7, 12, 0.86)),
    radial-gradient(circle at 50% 0%, rgba(246, 200, 95, 0.22), transparent 56%),
    var(--ui-panel-dialog) center / cover no-repeat,
    linear-gradient(180deg, rgba(18, 22, 32, 0.96), rgba(5, 7, 12, 0.96));
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 208, 0.08),
    0 28px 80px rgba(0, 0, 0, 0.6),
    0 0 38px rgba(246, 200, 95, 0.18);
  text-align: center;
  transform: translate(-50%, -50%);
}

.result-overlay[hidden] {
  display: none !important;
}

.result-overlay.victory {
  border-color: rgba(246, 200, 95, 0.7);
}

.result-overlay.defeat {
  border-color: rgba(239, 99, 81, 0.62);
  background:
    linear-gradient(180deg, rgba(5, 7, 12, 0.54), rgba(5, 7, 12, 0.88)),
    radial-gradient(circle at 50% 0%, rgba(239, 99, 81, 0.22), transparent 56%),
    var(--ui-panel-dialog) center / cover no-repeat,
    linear-gradient(180deg, rgba(22, 17, 20, 0.96), rgba(5, 7, 12, 0.96));
}

.result-overlay span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.result-overlay strong {
  color: var(--gold);
  font-size: clamp(42px, 7vw, 68px);
  line-height: 0.95;
  text-shadow: 0 0 30px rgba(246, 200, 95, 0.34);
}

.result-overlay.defeat strong {
  color: #ff8f7d;
  text-shadow: 0 0 30px rgba(239, 99, 81, 0.32);
}

.result-overlay small {
  color: rgba(255, 244, 207, 0.82);
  font-size: 14px;
  font-weight: 800;
}

@media (max-width: 680px) {
  .room-lobby-actions {
    grid-template-columns: repeat(4, minmax(58px, 1fr));
    gap: 6px;
  }

  .identity-layout {
    grid-template-columns: 1fr;
  }

  .identity-card-art {
    min-height: 300px;
  }
}

.character-select {
  --select-gap: clamp(12px, 1.55vh, 18px);
  --select-frame-outset-x: clamp(16px, 2.15vh, 22px);
  --select-frame-outset-y: clamp(28px, 3.45vh, 36px);
  --select-shell-frame-x: clamp(64px, 7vw, 96px);
  --select-shell-frame-y: clamp(74px, 9.2vh, 108px);
  --select-padding: clamp(16px, 2.1vh, 22px);
  --select-card-h: clamp(176px, calc((100dvh - 248px) / 2), 260px);
  --select-card-w: calc(var(--select-card-h) * 5 / 7);
  --select-card-outer-w: calc(var(--select-card-w) + var(--select-frame-outset-x) * 2);
  --select-card-outer-h: calc(var(--select-card-h) + var(--select-frame-outset-y) * 2);
  --preview-w: clamp(300px, 23vw, 360px);
  position: relative;
  isolation: isolate;
  width: min(
    calc(var(--select-card-outer-w) * 4 + var(--select-gap) * 3 + 40px),
    calc(100% - 32px)
  );
  max-height: min(100%, calc(100dvh - 34px));
  justify-self: center;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  align-self: center;
  gap: var(--select-gap);
  background:
    linear-gradient(180deg, rgba(5, 7, 12, 0.42), rgba(5, 7, 12, 0.78)),
    radial-gradient(circle at 50% 0%, rgba(78, 205, 196, 0.15), transparent 24%),
    radial-gradient(circle at 86% 18%, rgba(246, 200, 95, 0.13), transparent 22%),
    linear-gradient(180deg, rgba(246, 200, 95, 0.06), rgba(7, 10, 16, 0.14) 34%),
    var(--ui-panel-select) center / cover no-repeat,
    linear-gradient(135deg, rgba(18, 26, 42, 0.96), rgba(27, 29, 34, 0.96));
  border: 1px solid rgba(64, 187, 255, 0.16);
  border-radius: 8px;
  padding: var(--select-padding);
  overflow: visible;
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.42),
    0 0 52px rgba(34, 177, 255, 0.12),
    inset 0 0 0 1px rgba(255, 246, 208, 0.08),
    inset 0 0 76px rgba(246, 200, 95, 0.07),
    inset 0 0 54px rgba(52, 172, 255, 0.08);
}

.character-select::before {
  content: "";
  position: absolute;
  inset: calc(var(--select-shell-frame-y) * -1) calc(var(--select-shell-frame-x) * -1);
  z-index: 1;
  opacity: 0.88;
  pointer-events: none;
  background: var(--arcane-select-frame) center / 100% 100% no-repeat;
  filter:
    drop-shadow(0 0 10px rgba(78, 205, 196, 0.18))
    drop-shadow(0 0 18px rgba(246, 200, 95, 0.12))
    drop-shadow(0 18px 24px rgba(0, 0, 0, 0.34));
}

.character-select::after {
  content: "";
  position: absolute;
  inset: 12px;
  z-index: 0;
  opacity: 0.48;
  pointer-events: none;
  border-radius: 6px;
  background:
    repeating-linear-gradient(90deg, rgba(78, 205, 196, 0.08) 0 1px, transparent 1px 42px),
    repeating-linear-gradient(0deg, rgba(246, 200, 95, 0.055) 0 1px, transparent 1px 38px),
    radial-gradient(circle at 50% 46%, rgba(246, 200, 95, 0.12), transparent 32%);
  mix-blend-mode: screen;
  animation: arcaneDrift 14s linear infinite reverse;
}

.character-select > * {
  position: relative;
  z-index: 2;
}

.character-select.preview-open {
  width: min(
    calc(var(--select-card-outer-w) * 4 + var(--select-gap) * 3 + 40px),
    calc(100% - 32px)
  );
  justify-self: center;
}

.character-select.preview-open .status-line,
.character-select.preview-open .select-identity-card,
.character-select.preview-open .character-scroll,
.character-select.preview-open > .hint {
  opacity: 0.42;
  filter: blur(5px) brightness(0.64) saturate(0.82);
}

.character-select.preview-open .select-identity-card,
.character-select.preview-open .character-scroll,
.character-select.preview-open > .hint {
  pointer-events: none;
}

.character-select > p {
  color: #c9d2e0;
  font-family: "Copperplate Gothic Bold", "Trajan Pro", "Cinzel", "Impact", "Arial Black", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-weight: 800;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.8);
  transform: translateY(clamp(-10px, -1.15vh, -7px));
}

.select-identity-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 92px;
  padding: 10px 14px;
  border: 1px solid rgba(246, 200, 95, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(5, 7, 12, 0.46), rgba(5, 7, 12, 0.72)),
    linear-gradient(135deg, rgba(246, 200, 95, 0.12), transparent 42%),
    var(--ui-panel-dialog) center / cover no-repeat,
    rgba(6, 8, 12, 0.72);
}

.select-identity-card[hidden] {
  display: none !important;
}

.select-identity-art {
  width: 74px;
  height: 74px;
  border: 1px solid rgba(255, 246, 208, 0.18);
  border-radius: 6px;
  background:
    var(--select-identity-art, none) center 20% / cover no-repeat,
    rgba(10, 12, 18, 0.9);
}

.select-identity-card span {
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.select-identity-card strong {
  display: block;
  margin-top: 3px;
  color: var(--gold);
  font-size: 22px;
  line-height: 1.05;
}

.select-identity-card p {
  margin: 6px 0 0;
  color: rgba(255, 244, 207, 0.78);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.character-select-layout {
  position: relative;
  display: block;
  min-height: 0;
  overflow: visible;
}

.character-preview-backdrop {
  position: absolute;
  inset: calc(var(--select-gap) * -0.5) 0;
  z-index: 70;
  display: none;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 38%, rgba(78, 205, 196, 0.14), transparent 34%),
    radial-gradient(circle at 52% 58%, rgba(246, 200, 95, 0.12), transparent 40%),
    rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(7px) saturate(0.78);
  pointer-events: auto;
}

.character-select.preview-open .character-preview-backdrop {
  display: block;
  animation: characterPreviewBackdropIn 180ms ease-out both;
}

.character-scroll {
  height: 100%;
  max-height: min(
    calc(var(--select-card-outer-h) * 2 + var(--select-gap)),
    calc(100dvh - var(--select-shell-frame-y) * 2 - var(--select-padding) * 2 - 116px)
  );
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 0;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  overscroll-behavior: contain;
}

.character-scroll::-webkit-scrollbar {
  width: 9px;
}

.character-scroll::-webkit-scrollbar-track {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
}

.character-scroll::-webkit-scrollbar-thumb {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
}

.character-scroll.is-scrolling {
  scrollbar-color: transparent transparent;
}

.character-scroll.is-scrolling::-webkit-scrollbar-track {
  background: transparent;
  border-color: transparent;
}

.character-scroll.is-scrolling::-webkit-scrollbar-thumb {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

@media (max-height: 760px) {
  .character-scroll {
    max-height: var(--select-card-outer-h);
  }
}

.character-options {
  display: grid;
  grid-template-columns: repeat(4, var(--select-card-outer-w));
  grid-auto-rows: var(--select-card-outer-h);
  justify-content: center;
  gap: var(--select-gap);
  align-content: start;
  overflow: visible;
}

.character-option {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: var(--select-frame-outset-y) var(--select-frame-outset-x);
  text-align: left;
  color: var(--text);
  background: transparent;
  border: 0;
  cursor: pointer;
  isolation: isolate;
  overflow: visible;
}

.character-option:hover,
.character-option:focus-within {
  z-index: 40;
}

.character-option span {
  aspect-ratio: 2.5 / 3.5;
  height: 100%;
  width: 100%;
  min-height: 0;
  display: grid;
  align-content: end;
  position: relative;
  z-index: 1;
  isolation: isolate;
  background: #111318;
  border: 1px solid rgba(246, 200, 95, 0.38);
  border-radius: 8px;
  padding: 0;
  overflow: visible;
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 208, 0.05),
    0 12px 28px rgba(0, 0, 0, 0.24);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.character-option span::before {
  content: "";
  position: absolute;
  inset:
    calc(var(--select-frame-outset-y) * -1)
    calc(var(--select-frame-outset-x) * -1);
  z-index: 3;
  border: 0;
  background: var(--arcane-card-frame) center / 100% 100% no-repeat;
  opacity: 0.72;
  filter: drop-shadow(0 0 6px rgba(78, 205, 196, 0.16));
  pointer-events: none;
  transform: translateZ(0);
  transition: opacity 160ms ease, filter 160ms ease, transform 160ms ease;
}

.character-option span::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, transparent 18%, rgba(0, 0, 0, 0.1) 42%, rgba(0, 0, 0, 0.86) 100%);
  border-radius: inherit;
}

.character-option:hover span,
.character-option.previewed span,
.character-option.selected span {
  border-color: var(--gold);
  background: #171b21;
  box-shadow:
    0 0 0 1px rgba(246, 200, 95, 0.42) inset,
    0 0 22px rgba(246, 200, 95, 0.18),
    0 16px 34px rgba(0, 0, 0, 0.36);
}

.character-option:hover span::before,
.character-option.previewed span::before,
.character-option.selected span::before {
  opacity: 0.94;
  filter:
    drop-shadow(0 0 9px rgba(78, 205, 196, 0.38))
    drop-shadow(0 0 16px rgba(246, 200, 95, 0.24));
  animation: frameBreath 2.8s ease-in-out infinite;
}

.character-option:hover span {
  transform: translateY(-2px);
}

.character-option:disabled {
  cursor: default;
}

.character-option:disabled:not(.selected) span {
  opacity: 0.45;
}

.character-option.placeholder span,
.character-option.placeholder:disabled:not(.selected) span {
  opacity: 1;
}

.character-option.placeholder {
  cursor: default;
}

.character-option.placeholder:hover span {
  transform: none;
}

.character-option.placeholder span {
  border-style: dashed;
  border-color: rgba(246, 200, 95, 0.32);
  background:
    linear-gradient(180deg, rgba(246, 200, 95, 0.08), rgba(7, 10, 16, 0.86)),
    #111318;
}

.character-option.placeholder span::after {
  background:
    radial-gradient(circle at 50% 42%, rgba(246, 200, 95, 0.16), transparent 22%),
    linear-gradient(180deg, transparent 18%, rgba(0, 0, 0, 0.22) 52%, rgba(0, 0, 0, 0.88) 100%);
}

.character-option.placeholder .mini-art {
  background:
    radial-gradient(circle at 50% 36%, rgba(246, 200, 95, 0.34), transparent 17%),
    radial-gradient(circle at 50% 56%, rgba(78, 205, 196, 0.14), transparent 28%),
    linear-gradient(135deg, rgba(255, 244, 207, 0.1), transparent 38%),
    linear-gradient(160deg, rgba(24, 32, 48, 0.96), rgba(7, 10, 16, 0.96));
}

.character-option.placeholder .card-inscription strong {
  color: rgba(255, 243, 194, 0.72);
  -webkit-text-fill-color: rgba(255, 243, 194, 0.72);
  font-size: clamp(24px, 4vh, 34px);
}

.character-option.placeholder .card-inscription small,
.character-option.placeholder b {
  color: rgba(246, 200, 95, 0.78);
  -webkit-text-fill-color: rgba(246, 200, 95, 0.78);
}

.character-option em {
  display: grid;
  gap: clamp(3px, 0.7vh, 5px);
  align-self: end;
  position: relative;
  z-index: 4;
  min-height: 24%;
  transform: translateY(calc(clamp(-14px, -1.85vh, -10px) - 4px));
  padding:
    clamp(8px, 1.25vh, 11px)
    clamp(8px, 1.4vh, 12px)
    clamp(10px, 1.55vh, 14px);
  font-style: normal;
}

.character-option b {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #ffd56b;
  font-size: clamp(14px, 1.9vh, 16px);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", "PingFang SC", "Arial Black", sans-serif;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0;
  width: fit-content;
  padding: 3px 9px 4px 7px;
  background:
    linear-gradient(90deg, rgba(246, 200, 95, 0.28), rgba(7, 10, 16, 0.88) 72%),
    linear-gradient(180deg, rgba(255, 244, 188, 0.18), rgba(92, 58, 17, 0.24));
  border-left: 2px solid rgba(246, 200, 95, 0.95);
  clip-path: polygon(0 0, 100% 0, 91% 100%, 0 100%);
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.86),
    0 0 8px rgba(246, 200, 95, 0.32);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.skill-inline-icon {
  width: 1.35em;
  height: 1.35em;
  min-width: 16px;
  min-height: 16px;
  object-fit: contain;
  flex: 0 0 auto;
  filter:
    drop-shadow(0 1px 2px rgba(0, 0, 0, 0.72))
    drop-shadow(0 0 5px rgba(78, 205, 196, 0.18));
  user-select: none;
  pointer-events: none;
}

.skill-inline-text {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.character-option small {
  color: var(--muted);
  line-height: 1.35;
}

.card-inscription {
  position: absolute;
  top: 50%;
  right: clamp(7px, 1.2vh, 10px);
  z-index: 4;
  width: clamp(92px, 13vh, 108px);
  display: grid;
  justify-items: end;
  gap: clamp(7px, 1.1vh, 10px);
  pointer-events: none;
  writing-mode: horizontal-tb;
  text-align: right;
  font-style: normal;
  line-height: 0.95;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", "PingFang SC", "Arial Black", sans-serif;
  transform: translateY(-50%);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.card-inscription small,
.card-inscription strong {
  display: block;
  letter-spacing: 0;
}

.card-inscription small {
  color: #f2c15a;
  font-size: clamp(11px, 1.55vh, 13px);
  font-weight: 900;
  padding: 4px 8px 4px 9px;
  background:
    linear-gradient(90deg, rgba(9, 11, 16, 0.82), rgba(9, 11, 16, 0.94)),
    rgba(9, 11, 16, 0.9);
  border-right: 2px solid rgba(246, 200, 95, 0.95);
  border-radius: 5px 0 0 5px;
  -webkit-text-fill-color: #f2c15a;
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.9);
  box-shadow:
    0 2px 7px rgba(0, 0, 0, 0.34),
    inset 0 0 0 1px rgba(255, 244, 207, 0.04);
}

.card-inscription strong {
  color: #fff3c2;
  font-size: clamp(21px, 3vh, 25px);
  font-weight: 900;
  padding: 2px 0;
  -webkit-text-fill-color: #fff3c2;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.9);
}

.character-option[data-character="Rhasta"] .card-inscription strong {
  transform: scaleX(1.32);
  transform-origin: right center;
  letter-spacing: 0;
}

.character-option[data-character="Lollipopz"] .card-inscription small {
  color: #9be8ff;
  -webkit-text-fill-color: #9be8ff;
  border-right-color: rgba(130, 232, 255, 0.98);
  background:
    linear-gradient(90deg, rgba(7, 12, 20, 0.84), rgba(7, 15, 24, 0.94)),
    rgba(7, 12, 20, 0.9);
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.9);
}

.character-option[data-character="Lollipopz"] .card-inscription strong {
  color: #f3fdff;
  -webkit-text-fill-color: #f3fdff;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.9);
}

.character-option[data-character="Jisoo"] .card-inscription small,
.character-option[data-character="Jisoo"] .card-inscription strong {
  -webkit-text-fill-color: #d8b8ff;
  color: #d8b8ff;
}

.character-option[data-character="Jisoo"] .card-inscription small {
  border-right-color: rgba(191, 130, 255, 0.95);
  background:
    linear-gradient(90deg, rgba(12, 8, 20, 0.84), rgba(24, 12, 42, 0.94)),
    rgba(12, 8, 20, 0.9);
}

.character-option[data-character="Letmetalk"] .card-inscription small {
  border-right-color: rgba(210, 231, 255, 0.95);
}

.character-option[data-character="\767D\6CFD"] .card-inscription small {
  border-right-color: rgba(255, 216, 128, 0.95);
  background:
    linear-gradient(90deg, rgba(18, 12, 8, 0.84), rgba(45, 27, 12, 0.94)),
    rgba(18, 12, 8, 0.9);
}

.character-option[data-character="白泽"] .card-inscription small {
  border-right-color: rgba(255, 216, 128, 0.95);
}

.character-option[data-character="Maoye"] {
  --character-title-color: #ff7c0a;
}

.character-option[data-character="Qizong"] {
  --character-title-color: #8788ee;
}

.character-option[data-character="Xiaofan"] {
  --character-title-color: #a330c9;
}

.character-option[data-character="Lollipopz"] {
  --character-title-color: #fff468;
}

.character-option[data-character="Rhasta"] {
  --character-title-color: #0070dd;
}

.character-option[data-character="Jisoo"] {
  --character-title-color: #c41e3a;
}

.character-option[data-character="Letmetalk"] {
  --character-title-color: #c69b6d;
}

.character-option[data-character="Saoge"] {
  --character-title-color: #00ff98;
}

.character-option[data-character="Mike"] {
  --character-title-color: #c79c6e;
}

.character-option[data-character="Guming"] {
  --character-title-color: #f48cba;
}

.character-option[data-character="TY"] {
  --character-title-color: #c79c6e;
}

.character-option[data-character="Tiantian"] {
  --character-title-color: #3fc7eb;
}

.character-option[data-character="Anai"] {
  --character-title-color: #00ff98;
}

.character-option[data-character="Jiego"] {
  --character-title-color: #8788ee;
}

.character-option[data-character="Imba"] {
  --character-title-color: #ff7c0a;
}

.character-option[data-character="\767D\6CFD"] {
  --character-title-color: #f48cba;
}

.character-option[data-character] .card-inscription small {
  color: var(--character-title-color, #f2c15a);
  -webkit-text-fill-color: var(--character-title-color, #f2c15a);
  border-right-color: var(--character-title-color, rgba(246, 200, 95, 0.95));
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.9);
}

.character-option[data-character] .card-inscription strong {
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.9);
}

.skill-tip {
  position: relative;
  z-index: 90;
}

.skill-tip::after {
  content: attr(data-description);
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 80;
  width: min(220px, 72vw);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  background:
    linear-gradient(180deg, rgba(246, 200, 95, 0.08), rgba(8, 10, 15, 0.98) 34%),
    #111318;
  border: 1px solid rgba(246, 200, 95, 0.42);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 10px;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-weight: 700;
  line-height: 1.4;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
  transition: opacity 120ms ease, transform 120ms ease;
}

.skill-tip:hover::after,
.skill-tip:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.mini-art {
  position: absolute;
  inset: 0;
  z-index: -2;
  display: block;
  background:
    var(--character-art, none),
    linear-gradient(180deg, rgba(255, 244, 207, 0.04), rgba(3, 5, 9, 0.18) 42%, rgba(2, 3, 6, 0.76)),
    #070a10;
  background-size: var(--art-size, cover), cover, cover;
  background-position: var(--art-position, center top), center, center;
  background-repeat: no-repeat;
  border-radius: inherit;
  contain: paint;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.character-preview {
  --card-frame-outset-x: 16px;
  --card-frame-outset-y: 16px;
  width: min(var(--preview-w), calc(100% - 42px));
  height: min(
    calc(var(--select-card-h) * 2 + var(--select-gap)),
    calc(100dvh - var(--select-shell-frame-y) * 2 - var(--select-padding) * 2 - 108px)
  );
  min-width: 0;
  max-height: calc(100dvh - var(--select-shell-frame-y) * 2 - 34px);
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 80;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  transform: translate3d(-50%, -50%, 0);
  background:
    linear-gradient(180deg, rgba(78, 205, 196, 0.08), transparent 28%),
    #111318;
  border: 1px solid rgba(246, 200, 95, 0.48);
  border-radius: 8px;
  overflow: visible;
  box-shadow:
    0 22px 54px rgba(0, 0, 0, 0.46),
    0 0 30px rgba(78, 205, 196, 0.1),
    inset 0 0 0 1px rgba(255, 246, 208, 0.08);
}

#characterPreview {
  --card-frame-outset-x: clamp(30px, 4.1vh, 44px);
  --card-frame-outset-y: clamp(46px, 6vh, 64px);
  z-index: 90;
  width: min(clamp(330px, 27vw, 440px), calc(100% - var(--card-frame-outset-x) * 2 - 22px));
  height: auto;
  max-height: calc(100dvh - var(--select-shell-frame-y) * 2 - 24px);
  grid-template-rows: auto auto;
  background: transparent;
  border: 0;
  box-shadow: none;
  will-change: opacity, filter, transform;
  animation: characterPreviewInspectIn 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.character-preview::before {
  content: "";
  position: absolute;
  inset:
    calc(var(--card-frame-outset-y) * -1)
    calc(var(--card-frame-outset-x) * -1);
  z-index: 1;
  opacity: 0.72;
  pointer-events: none;
  background: var(--arcane-card-frame) center / 100% 100% no-repeat;
  animation: frameBreath 3.6s ease-in-out infinite;
}

#characterPreview::before {
  content: none;
}

.character-preview > * {
  position: relative;
  z-index: 3;
}

.character-preview[hidden] {
  display: none;
}

.character-preview[data-character="Maoye"] {
  --preview-title-color: #ff7c0a;
}

.character-preview[data-character="Qizong"] {
  --preview-title-color: #8788ee;
}

.character-preview[data-character="Xiaofan"] {
  --preview-title-color: #a330c9;
}

.character-preview[data-character="Lollipopz"] {
  --preview-title-color: #fff468;
}

.character-preview[data-character="Rhasta"] {
  --preview-title-color: #0070dd;
}

.character-preview[data-character="Jisoo"] {
  --preview-title-color: #c41e3a;
}

.character-preview[data-character="Letmetalk"] {
  --preview-title-color: #c69b6d;
}

.character-preview[data-character="Saoge"] {
  --preview-title-color: #00ff98;
}

.character-preview[data-character="Mike"] {
  --preview-title-color: #c79c6e;
}

.character-preview[data-character="Guming"] {
  --preview-title-color: #f48cba;
}

.character-preview[data-character="TY"] {
  --preview-title-color: #c79c6e;
}

.character-preview[data-character="Anai"] {
  --preview-title-color: #00ff98;
}

.character-preview[data-character="Jiego"] {
  --preview-title-color: #8788ee;
}

.character-preview[data-character="Imba"] {
  --preview-title-color: #ff7c0a;
}

.character-preview[data-character="\767D\6CFD"] {
  --preview-title-color: #f48cba;
}

.preview-art {
  min-height: 0;
  background:
    var(--character-art, none),
    linear-gradient(180deg, rgba(255, 244, 207, 0.04), rgba(3, 5, 9, 0.18) 42%, rgba(2, 3, 6, 0.8)),
    #070a10;
  background-size: var(--art-size, cover), cover, cover;
  background-position: var(--art-position, center top), center, center;
  background-repeat: no-repeat;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
}

#characterPreview .preview-art {
  position: relative;
  z-index: 3;
  aspect-ratio: 2.5 / 3.5;
  width: 100%;
  display: grid;
  align-content: end;
  border: 1px solid rgba(246, 200, 95, 0.48);
  border-radius: 8px;
  overflow: visible;
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 208, 0.05),
    0 28px 64px rgba(0, 0, 0, 0.58),
    0 0 38px rgba(78, 205, 196, 0.18),
    0 0 28px rgba(246, 200, 95, 0.1);
}

#characterPreview .preview-art::before {
  content: "";
  position: absolute;
  inset:
    calc(var(--card-frame-outset-y) * -1)
    calc(var(--card-frame-outset-x) * -1);
  z-index: 3;
  opacity: 0.86;
  pointer-events: none;
  background: var(--arcane-card-frame) center / 100% 100% no-repeat;
  filter:
    drop-shadow(0 0 10px rgba(78, 205, 196, 0.18))
    drop-shadow(0 18px 28px rgba(0, 0, 0, 0.38));
  animation: frameBreath 3.6s ease-in-out infinite;
}

#characterPreview .preview-art::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, transparent 18%, rgba(0, 0, 0, 0.1) 42%, rgba(0, 0, 0, 0.86) 100%);
  border-radius: inherit;
  pointer-events: none;
}

#characterPreview .preview-art > * {
  position: relative;
  z-index: 4;
}

.mini-art[data-character="Saoge"],
.preview-art[data-character="Saoge"],
.avatar[data-character="Saoge"] {
  --art-size: auto 94%;
  --art-position: center 50%;
}

.mini-art[data-character="Mike"],
.preview-art[data-character="Mike"],
.avatar[data-character="Mike"] {
  --art-size: 138% auto;
  --art-position: center 4%;
}

.mini-art[data-character="Guming"],
.preview-art[data-character="Guming"],
.avatar[data-character="Guming"] {
  --art-size: auto 113%;
  --art-position: center 39%;
}

.mini-art[data-character="TY"],
.preview-art[data-character="TY"],
.avatar[data-character="TY"] {
  --art-size: auto 108%;
  --art-position: center 46%;
}

.mini-art[data-character="Qizong"],
.preview-art[data-character="Qizong"],
.avatar[data-character="Qizong"] {
  --art-size: auto 108%;
  --art-position: center 36%;
}

.preview-art[data-character="Qizong"],
.preview-art[data-character="Saoge"],
.preview-art[data-character="TY"],
.preview-art[data-character="Guming"],
.preview-art[data-character="Tiantian"],
.preview-art[data-character="Anai"],
.preview-art[data-character="Jiego"],
.preview-art[data-character="Imba"] {
  --art-size: cover;
  --art-position: center top;
}

.mini-art[data-character="Qizong"],
.mini-art[data-character="Saoge"],
.mini-art[data-character="TY"],
.mini-art[data-character="Guming"],
.mini-art[data-character="Tiantian"],
.mini-art[data-character="Anai"],
.mini-art[data-character="Jiego"],
.mini-art[data-character="Imba"] {
  --art-size: cover;
  --art-position: center top;
}

.avatar[data-character="Saoge"],
.avatar[data-character="Guming"],
.avatar[data-character="TY"],
.avatar[data-character="Qizong"],
.avatar[data-character="Tiantian"],
.avatar[data-character="Anai"],
.avatar[data-character="Jiego"],
.avatar[data-character="Imba"] {
  --art-size: cover;
}

.preview-art[data-character="Qizong"],
.mini-art[data-character="Qizong"] {
  --art-size: auto 128%;
  --art-position: center 22%;
}

.avatar[data-character="Qizong"] {
  --art-size: auto 134%;
  --art-position: center 22%;
}

.preview-art[data-character="Guming"],
.mini-art[data-character="Guming"] {
  --art-size: auto 124%;
  --art-position: center 22%;
}

.avatar[data-character="Guming"] {
  --art-size: auto 130%;
  --art-position: center 23%;
}

.avatar[data-character="Saoge"] {
  --art-size: auto 132%;
  --art-position: center 26%;
}

.avatar[data-character="TY"] {
  --art-size: auto 132%;
  --art-position: center 23%;
}

.avatar[data-character="Tiantian"] {
  --art-size: auto 130%;
  --art-position: center 22%;
}

.avatar[data-character="Anai"] {
  --art-size: auto 130%;
  --art-position: center 20%;
}

.avatar[data-character="Jiego"] {
  --art-size: auto 132%;
  --art-position: center 22%;
}

.avatar[data-character="Imba"] {
  --art-size: auto 132%;
  --art-position: center 24%;
}

.preview-copy {
  display: grid;
  gap: clamp(6px, 1vh, 9px);
  padding: clamp(10px, 1.4vh, 14px);
  background:
    linear-gradient(180deg, rgba(5, 7, 11, 0.34), rgba(5, 7, 11, 0.98) 30%),
    linear-gradient(135deg, rgba(17, 26, 42, 0.5), rgba(7, 9, 14, 0.2)),
    #0f1116;
}

#characterPreview .preview-copy {
  margin-top: calc(var(--card-frame-outset-y, 16px) * 0.62);
}

.preview-title {
  color: var(--preview-title-color, var(--gold));
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", "PingFang SC", "Arial Black", sans-serif;
  width: fit-content;
  padding: 5px 11px;
  background:
    linear-gradient(90deg, rgba(246, 200, 95, 0.22), rgba(10, 12, 17, 0.78));
  border-left: 2px solid var(--preview-title-color, rgba(246, 200, 95, 0.95));
  clip-path: polygon(0 0, 100% 0, 88% 100%, 0 100%);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
  -webkit-text-fill-color: var(--preview-title-color, var(--gold));
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.86),
    0 0 8px var(--preview-title-color, rgba(246, 200, 95, 0.24));
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.preview-title,
.preview-copy h2 {
  display: none;
}

.preview-inscription small {
  color: var(--preview-title-color, #f2c15a);
  -webkit-text-fill-color: var(--preview-title-color, #f2c15a);
  border-right-color: var(--preview-title-color, rgba(246, 200, 95, 0.95));
}

.preview-inscription strong {
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
}

.preview-copy h2 {
  margin: 0;
  color: #ffffff;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", "PingFang SC", "Arial Black", sans-serif;
  font-size: clamp(25px, 3.4vh, 31px);
  font-weight: 900;
  line-height: 1;
  -webkit-text-fill-color: #ffffff;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.9),
    0 0 9px rgba(255, 255, 255, 0.2);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.preview-skill {
  display: grid;
  gap: 5px;
}

.preview-skill > strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #ffd56b;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", "PingFang SC", "Arial Black", sans-serif;
  font-size: clamp(17px, 2.4vh, 20px);
  font-weight: 900;
  width: fit-content;
  padding: 4px 10px 5px 8px;
  background:
    linear-gradient(90deg, rgba(246, 200, 95, 0.22), rgba(9, 12, 18, 0.84));
  border-left: 2px solid rgba(246, 200, 95, 0.95);
  clip-path: polygon(0 0, 100% 0, 91% 100%, 0 100%);
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.86),
    0 0 8px rgba(246, 200, 95, 0.28);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.preview-skill span {
  color: var(--muted);
  line-height: 1.45;
  font-size: clamp(12px, 1.7vh, 14px);
}

.rich-description strong {
  display: inline;
  margin: 0;
  color: #fff0bc;
  font: inherit;
  font-weight: 900;
  padding: 0;
  background: none;
  border: 0;
  clip-path: none;
  text-shadow: 0 0 8px rgba(246, 200, 95, 0.18);
}

.preview-copy button {
  --ui-button-art: var(--ui-button-gold);
  min-height: clamp(38px, 5vh, 44px);
  margin-top: 4px;
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(2, 3, 6, 0.62), rgba(2, 3, 6, 0.12) 50%, rgba(2, 3, 6, 0.62)),
    linear-gradient(180deg, rgba(255, 244, 207, 0.18), rgba(0, 0, 0, 0.18) 68%),
    var(--ui-button-art) center / 100% 100% no-repeat,
    rgba(8, 10, 15, 0.98);
  color: #fff8df;
  font-weight: 900;
  text-shadow:
    0 2px 3px rgba(0, 0, 0, 0.9),
    0 0 12px rgba(246, 200, 95, 0.34);
}

.preview-copy button:disabled {
  opacity: 0.55;
  cursor: default;
}

.guard-art,
.art-1 {
  filter: saturate(0.8) hue-rotate(22deg);
}

.sage-art,
.art-2 {
  filter: hue-rotate(84deg);
}

.medic-art,
.art-3 {
  filter: hue-rotate(145deg) saturate(0.9);
}

.art-4 {
  filter: hue-rotate(210deg) saturate(1.1);
}

.battle {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: clamp(8px, 1vh, 12px);
  align-content: start;
  min-height: 0;
  height: 100%;
  position: relative;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(246, 200, 95, 0.46) rgba(7, 9, 14, 0.42);
}

.battle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: clamp(250px, 43%, 390px);
  z-index: 0;
  width: min(760px, 92%);
  aspect-ratio: 1;
  pointer-events: none;
  opacity: 0.46;
  background:
    radial-gradient(circle, transparent 0 48%, rgba(246, 200, 95, 0.18) 49%, transparent 52%),
    conic-gradient(from 0deg, transparent 0 9%, rgba(78, 205, 196, 0.28) 10%, transparent 14%, transparent 30%, rgba(246, 200, 95, 0.24) 33%, transparent 37%, transparent 58%, rgba(239, 99, 81, 0.18) 62%, transparent 66%, transparent 100%);
  border-radius: 50%;
  filter: blur(0.2px) drop-shadow(0 0 18px rgba(78, 205, 196, 0.18));
  transform: translate(-50%, -50%);
  animation: battleEnergyOrbit 28s linear infinite;
}

.battle > * {
  position: relative;
  z-index: 1;
}

.status-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  overflow: hidden;
  padding: clamp(7px, 0.9vh, 10px) 14px;
  background:
    linear-gradient(115deg, transparent 0 45%, rgba(78, 205, 196, 0.13) 49%, transparent 53%),
    linear-gradient(90deg, rgba(246, 200, 95, 0.16), rgba(12, 16, 26, 0.94) 34%, rgba(20, 31, 48, 0.94)),
    rgba(12, 15, 22, 0.92);
  border: 1px solid rgba(246, 200, 95, 0.48);
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 208, 0.06),
    inset 0 0 22px rgba(78, 205, 196, 0.06),
    0 12px 28px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(8px);
}

.status-line::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(78, 205, 196, 0.08) 0 1px, transparent 1px 36px),
    linear-gradient(90deg, transparent, rgba(255, 244, 207, 0.09), transparent);
  opacity: 0.46;
  mix-blend-mode: screen;
}

.status-line > * {
  position: relative;
  z-index: 1;
}

.battle .status-line span,
.battle .status-line strong {
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", "PingFang SC", "Arial Black", sans-serif;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.68);
}

.battle .status-line span {
  color: #ffe7a2;
}

.battle .status-line strong {
  color: #f8f4e8;
}

.battle-status {
  align-items: center;
  min-height: 62px;
  padding: 10px 12px;
  margin-bottom: 2px;
}

.battle-status span,
.battle-status strong {
  display: block;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", "PingFang SC", "Arial Black", sans-serif;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.68);
}

.battle-status span {
  color: #ffe7a2;
}

.battle-status strong {
  color: #f8f4e8;
  text-align: right;
  line-height: 1.3;
}

.character-select .status-line {
  width: min(690px, calc(100% - clamp(68px, 12vw, 150px)));
  justify-self: center;
  transform: translateY(clamp(5px, 0.7vh, 8px));
  background:
    linear-gradient(90deg, rgba(246, 200, 95, 0.16), rgba(12, 16, 26, 0.94) 34%, rgba(20, 31, 48, 0.94));
  border-color: rgba(246, 200, 95, 0.38);
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 208, 0.06),
    0 12px 28px rgba(0, 0, 0, 0.24);
}

.character-select .status-line span,
.character-select .status-line strong {
  font-family: "Copperplate Gothic Bold", "Trajan Pro", "Cinzel", "Impact", "Arial Black", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-weight: 900;
  letter-spacing: 0;
  -webkit-text-stroke: 0.45px rgba(4, 5, 8, 0.9);
  text-shadow:
    1px 1px 0 rgba(0, 0, 0, 0.9),
    0 0 10px rgba(246, 200, 95, 0.24);
}

.character-select .status-line span {
  color: #ffe7a2;
}

.character-select .status-line strong {
  color: #f6f1e4;
}

.fighters {
  --fighter-gap: clamp(30px, 2.8vw, 52px);
  --fighter-inner-gap: clamp(7px, 0.8vw, 13px);
  --combatant-pad: clamp(16px, 2.2vh, 22px);
  --fighters-shift-y: clamp(60px, 7.4vh, 92px);
  --combatant-frame-outset-x: clamp(30px, 3.7vh, 40px);
  --combatant-frame-outset-y: clamp(50px, 5.9vh, 62px);
  --fighter-panel-w: clamp(102px, 10.8vw, 190px);
  --versus-size: clamp(56px, 7.4vh, 68px);
  --fighter-card-w: clamp(178px, 16.8vw, 274px);
  --fighter-card-h: clamp(470px, 60vh, 544px);
  --combatant-w: calc(var(--fighter-panel-w) + var(--fighter-card-w) + var(--fighter-inner-gap) + var(--combatant-pad) * 2);
  display: grid;
  grid-template-columns:
    minmax(0, var(--combatant-w))
    var(--versus-size)
    minmax(0, var(--combatant-w));
  gap: var(--fighter-gap);
  align-items: start;
  justify-items: center;
  justify-content: center;
  width: min(100%, calc(var(--combatant-w) * 2 + var(--versus-size) + var(--fighter-gap) * 2));
  height: var(--fighter-card-h);
  min-height: 0;
  align-self: start;
  justify-self: center;
  margin-top: var(--fighters-shift-y);
}

.combatant {
  --fighter-accent: var(--gold);
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--fighter-panel-w) var(--fighter-card-w);
  gap: var(--fighter-inner-gap);
  align-items: stretch;
  padding: var(--combatant-pad);
  position: relative;
  isolation: isolate;
  overflow: visible;
}

.combatant::before {
  content: "";
  position: absolute;
  inset:
    calc(var(--combatant-pad) - var(--combatant-frame-outset-y))
    calc(var(--combatant-pad) - var(--combatant-frame-outset-x));
  z-index: 4;
  pointer-events: none;
  opacity: 0.98;
  background: var(--arcane-combatant-frame) center / 100% 100% no-repeat;
  filter:
    drop-shadow(0 0 18px color-mix(in srgb, var(--fighter-accent) 30%, transparent))
    drop-shadow(0 24px 34px rgba(0, 0, 0, 0.42));
}

.combatant::after {
  content: "";
  position: absolute;
  inset: calc(var(--combatant-pad) + 2px);
  z-index: 0;
  pointer-events: none;
  border-radius: 7px;
  background:
    radial-gradient(circle at 50% 4%, color-mix(in srgb, var(--fighter-accent) 13%, transparent), transparent 30%),
    linear-gradient(180deg, rgba(255, 244, 207, 0.06), transparent 24%, rgba(0, 0, 0, 0.22));
  border: 1px solid color-mix(in srgb, var(--fighter-accent) 18%, transparent);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.22);
}

.combatant > * {
  position: relative;
  z-index: 2;
}

.you-combatant {
  --fighter-accent: #82e8ff;
}

.opponent-combatant {
  --fighter-accent: #f6c85f;
  grid-template-columns: var(--fighter-card-w) var(--fighter-panel-w);
}

.fighter-panel {
  --fighter-accent: var(--gold);
  --fighter-glow: rgba(246, 200, 95, 0.13);
  width: 100%;
  height: 100%;
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto auto auto auto 1fr;
  gap: 9px;
  align-content: start;
  padding: 10px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 244, 207, 0.07), transparent 22%),
    linear-gradient(145deg, rgba(15, 18, 26, 0.94), rgba(6, 8, 12, 0.96));
  border: 1px solid color-mix(in srgb, var(--fighter-accent) 56%, #11151d 44%);
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 208, 0.05),
    inset 0 0 36px var(--fighter-glow),
    0 0 24px color-mix(in srgb, var(--fighter-accent) 12%, transparent),
    0 18px 38px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(8px);
}

.fighter-panel .meter-row {
  order: 1;
}

.fighter-panel .energy {
  order: 2;
}

.fighter-panel .fatigue-row {
  order: 3;
}

.fighter-panel .status-bar {
  order: 4;
}

.fighter-panel .equipment-slots {
  order: 5;
}

.fighter-panel .choice {
  order: 6;
}

.fighter-panel::before {
  display: none;
}

.fighter-panel > * {
  position: relative;
  z-index: 1;
}

.battle.team-mode .fighters {
  display: none;
}

.team-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 1.2vw, 16px);
  min-height: 0;
  align-self: stretch;
}

.team-board[hidden] {
  display: none !important;
}

.team-column {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 9px;
}

.team-column h3 {
  margin: 0;
  color: #fff0bc;
  font-size: clamp(15px, 1.8vh, 18px);
  line-height: 1;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.team-slots {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  align-content: start;
}

.team-fighter {
  --team-art: none;
  --team-art-size: cover;
  --team-art-position: center top;
  --card-frame-outset-x: 10px;
  --card-frame-outset-y: 12px;
  --target-frame-line: #ff594d;
  --target-frame-soft: rgba(239, 38, 38, 0.2);
  --target-frame-glow: rgba(239, 38, 38, 0.72);
  --position-frame-opacity: 0.58;
  --position-frame-glow: rgba(246, 200, 95, 0.14);
  --outer-frame-line: rgba(246, 200, 95, 0.5);
  --outer-frame-node: rgba(130, 232, 255, 0.72);
  position: relative;
  min-height: var(--seat-card-h, 188px);
  display: grid;
  grid-template-rows: var(--seat-art-h, minmax(88px, 1fr)) minmax(0, 1fr);
  overflow: visible;
  border: 1px solid rgba(246, 200, 95, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 244, 207, 0.08), rgba(7, 9, 14, 0.94)),
    rgba(13, 16, 24, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 208, 0.06),
    0 16px 36px rgba(0, 0, 0, 0.28);
}

.team-fighter.targetable {
  cursor: pointer;
}

.team-fighter.attackable {
  border-color: rgba(130, 232, 255, 0.5);
}

.team-fighter.attackable::before {
  content: "距离 1";
  position: absolute;
  z-index: 5;
  top: 8px;
  right: 8px;
  padding: 4px 7px;
  border: 1px solid rgba(130, 232, 255, 0.4);
  border-radius: 999px;
  background: rgba(3, 9, 14, 0.72);
  color: #82e8ff;
  font-size: 10px;
  font-weight: 900;
}

.team-fighter.target-candidate[data-target-kind="enemy"]:not(.attackable)::before {
  content: "敌方目标";
}

.team-fighter.target-candidate[data-target-kind="ally"]::before {
  content: "友方目标";
  border-color: rgba(104, 212, 255, 0.5);
  color: #bff4ff;
}

.team-fighter.target-candidate[data-target-kind="self"]::before {
  content: "自身目标";
  border-color: rgba(116, 255, 234, 0.5);
  color: #d8fff9;
}

.team-fighter.target-candidate[data-target-kind="ally"] {
  --target-frame-line: #73d8ff;
  --target-frame-soft: rgba(84, 194, 255, 0.2);
  --target-frame-glow: rgba(84, 194, 255, 0.78);
  --position-frame-glow: rgba(84, 194, 255, 0.34);
  --outer-frame-line: rgba(115, 216, 255, 0.68);
  --outer-frame-node: rgba(246, 200, 95, 0.82);
}

.team-fighter.target-candidate[data-target-kind="self"],
.team-fighter.self-seat {
  --target-frame-line: #79fff0;
  --target-frame-soft: rgba(80, 255, 235, 0.18);
  --target-frame-glow: rgba(80, 255, 235, 0.66);
  --position-frame-glow: rgba(80, 255, 235, 0.28);
  --outer-frame-line: rgba(121, 255, 240, 0.72);
  --outer-frame-node: rgba(246, 200, 95, 0.86);
}

.team-fighter.out-of-range {
  border-style: dashed;
}

.team-fighter.out-of-range .team-art {
  filter: saturate(0.78) brightness(0.82);
}

.team-fighter.targetable:hover,
.team-fighter.targetable:focus-visible,
.team-fighter.selected-target {
  --position-frame-opacity: 0.96;
  --position-frame-glow: rgba(246, 200, 95, 0.34);
  border-color: #fff0bc;
  outline: none;
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 208, 0.14),
    0 0 26px rgba(246, 200, 95, 0.22),
    0 16px 36px rgba(0, 0, 0, 0.32);
}

.team-fighter::after,
.fighter.inspectable::after,
.fighter.target-candidate::after,
.fighter.selected-target::after {
  content: "";
  display: block;
  position: absolute;
  z-index: 12;
  inset:
    calc(var(--card-frame-outset-y) * -1)
    calc(var(--card-frame-outset-x) * -1);
  pointer-events: none;
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 0, var(--outer-frame-node) 0 2px, transparent 4px),
    radial-gradient(circle at 50% 100%, var(--outer-frame-node) 0 2px, transparent 4px),
    radial-gradient(circle at 0 50%, var(--outer-frame-node) 0 2px, transparent 4px),
    radial-gradient(circle at 100% 50%, var(--outer-frame-node) 0 2px, transparent 4px),
    linear-gradient(var(--outer-frame-line) 0 0) left top / 34px 2px no-repeat,
    linear-gradient(var(--outer-frame-line) 0 0) right top / 34px 2px no-repeat,
    linear-gradient(var(--outer-frame-line) 0 0) left bottom / 34px 2px no-repeat,
    linear-gradient(var(--outer-frame-line) 0 0) right bottom / 34px 2px no-repeat,
    linear-gradient(var(--outer-frame-line) 0 0) left top / 2px 28px no-repeat,
    linear-gradient(var(--outer-frame-line) 0 0) right top / 2px 28px no-repeat,
    linear-gradient(var(--outer-frame-line) 0 0) left bottom / 2px 28px no-repeat,
    linear-gradient(var(--outer-frame-line) 0 0) right bottom / 2px 28px no-repeat,
    linear-gradient(90deg, transparent 7px, color-mix(in srgb, var(--outer-frame-line) 44%, transparent) 7px calc(100% - 7px), transparent calc(100% - 7px)) top / 100% 1px no-repeat,
    linear-gradient(90deg, transparent 7px, color-mix(in srgb, var(--outer-frame-line) 36%, transparent) 7px calc(100% - 7px), transparent calc(100% - 7px)) bottom / 100% 1px no-repeat,
    linear-gradient(180deg, transparent 7px, color-mix(in srgb, var(--outer-frame-line) 32%, transparent) 7px calc(100% - 7px), transparent calc(100% - 7px)) left / 1px 100% no-repeat,
    linear-gradient(180deg, transparent 7px, color-mix(in srgb, var(--outer-frame-line) 32%, transparent) 7px calc(100% - 7px), transparent calc(100% - 7px)) right / 1px 100% no-repeat;
  opacity: var(--position-frame-opacity);
  filter:
    drop-shadow(0 0 7px var(--position-frame-glow))
    drop-shadow(0 0 12px var(--target-frame-glow, rgba(246, 200, 95, 0.18)));
}

.team-fighter.target-candidate,
.team-fighter.self-seat:not(.target-candidate) {
  --position-frame-opacity: 0.86;
}

.fighter.inspectable,
.fighter.target-candidate,
.fighter.selected-target {
  --position-frame-opacity: 0.86;
}

.fighter.attack-target-candidate {
  --outer-frame-line: rgba(255, 125, 102, 0.92);
  --outer-frame-node: rgba(246, 200, 95, 1);
  --position-frame-glow: rgba(239, 99, 81, 0.34);
  --target-frame-glow: rgba(239, 99, 81, 0.42);
  cursor: crosshair;
}

.fighter.attack-target-candidate.selected-target {
  --position-frame-opacity: 1;
  filter:
    saturate(1.18)
    brightness(1.08)
    drop-shadow(0 0 18px rgba(239, 99, 81, 0.24));
}

.team-fighter.target-candidate::after,
.fighter.target-candidate::after,
.fighter.selected-target::after {
  --position-frame-opacity: 0.96;
  animation: frameBreath 2.8s ease-in-out infinite;
}

.team-fighter.inspectable,
.fighter.inspectable {
  cursor: pointer;
}

.seat-ring.targeting .seat-ring-core {
  border-color: rgba(239, 99, 81, 0.66);
  box-shadow:
    inset 0 0 28px rgba(239, 99, 81, 0.16),
    0 0 26px rgba(239, 99, 81, 0.2);
}

.seat-ring.targeting .seat-ring-core strong {
  color: #ff8074;
}

.team-fighter.down {
  opacity: 0.48;
  filter: grayscale(0.5);
}

.team-art {
  min-height: 0;
  height: var(--seat-art-h, 88px);
  border-radius: 7px 7px 0 0;
  background:
    linear-gradient(180deg, transparent 52%, rgba(5, 7, 11, 0.76)),
    var(--team-art) var(--team-art-position) / var(--team-art-size) no-repeat;
}

.team-art[data-character="Qizong"],
.team-art[data-character="Saoge"],
.team-art[data-character="TY"],
.team-art[data-character="Guming"],
.team-art[data-character="Tiantian"],
.team-art[data-character="Anai"],
.team-art[data-character="Jiego"],
.team-art[data-character="Imba"] {
  --team-art-position: center 20%;
}

.team-info {
  display: grid;
  gap: 5px;
  padding: 9px;
  background:
    linear-gradient(180deg, rgba(6, 9, 14, 0.72), rgba(6, 8, 12, 0.94)),
    rgba(6, 8, 12, 0.88);
  border-top: 1px solid rgba(255, 244, 207, 0.08);
}

.team-skill {
  min-width: 0;
  position: absolute;
  left: 9px;
  top: calc(var(--seat-art-h, 88px) - 34px);
  z-index: 9;
  max-width: calc(100% - 72px);
}

.team-skill-label {
  width: 100%;
}

.seat-fighter .team-card-inscription {
  top: calc(var(--seat-art-h, 88px) - clamp(78px, 8vh, 90px));
  right: 7px;
  bottom: auto;
  width: clamp(72px, 8.2vw, 96px);
  gap: 5px;
}

.seat-fighter .team-card-inscription small {
  font-size: clamp(8px, 0.86vw, 10px);
  padding: 3px 6px 3px 7px;
}

.seat-fighter .team-card-inscription strong {
  font-size: clamp(15px, 1.58vw, 21px);
}

.team-skill-label .inline-skill-name,
.team-skill-label .inline-skill-action {
  width: 100%;
  max-width: 100%;
  min-height: 20px;
  padding: 3px 7px;
  font-size: 10px;
}

.team-info header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.team-info strong {
  min-width: 0;
  overflow: hidden;
  color: #fff4cf;
  font-size: 15px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.team-info small {
  color: var(--muted);
  font-weight: 900;
}

.team-mini-bars {
  display: grid;
  gap: 6px;
}

.team-mini-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 28px;
  gap: 6px;
  align-items: center;
  color: #d8d2c2;
  font-size: 11px;
  font-weight: 900;
}

.team-mini-meter {
  height: 7px;
  overflow: hidden;
  border: 1px solid rgba(246, 200, 95, 0.24);
  border-radius: 999px;
  background: rgba(5, 7, 11, 0.76);
}

.team-mini-meter i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--gold), var(--red));
}

.team-choice {
  min-height: 18px;
  color: #c8ced8;
  font-size: 11px;
  font-weight: 900;
}

.seat-fighter .team-stat-stack {
  display: grid;
  gap: 4px;
}

.seat-fighter .team-stat {
  --stat-mark-size: 8px;
  min-height: 20px;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 3px;
  padding: 2px 4px;
  border: 1px solid rgba(255, 244, 207, 0.08);
  border-radius: 5px;
  background: rgba(3, 6, 10, 0.34);
}

.seat-fighter .team-stat > .stat-label {
  min-width: 0;
  gap: 2px;
  overflow: hidden;
  font-size: 9px;
  white-space: nowrap;
}

.seat-fighter .team-stat .stat-label-icon {
  width: 13px;
  height: 13px;
  flex-basis: 13px;
  border-radius: 4px;
}

.seat-fighter .team-stat .stat-marks {
  gap: 2px;
}

.seat-fighter .team-stat.fatigue .stat-marks {
  grid-template-columns: repeat(2, var(--stat-mark-size));
}

.seat-fighter .team-stat.laziness .stat-marks {
  grid-template-columns: repeat(4, var(--stat-mark-size));
}

.seat-fighter .team-stat i {
  width: var(--stat-mark-size);
  height: var(--stat-mark-size);
}

.battle.team-mode .team-board {
  display: grid;
  grid-template-columns: 1fr;
  place-items: start center;
  min-height: clamp(650px, calc(100dvh - 160px), 840px);
  padding: clamp(70px, 8vh, 92px) 0 clamp(82px, 9vh, 118px);
  align-self: stretch;
  overflow: visible;
}

.seat-ring {
  --seat-size: clamp(140px, 12.6vw, 184px);
  --seat-card-h: clamp(224px, 25vh, 268px);
  --seat-art-h: clamp(104px, 12vh, 132px);
  position: relative;
  width: min(1080px, calc(100% - 20px));
  height: clamp(520px, 62vh, 700px);
  border: 1px solid rgba(130, 232, 255, 0.18);
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(246, 200, 95, 0.16), transparent 15%),
    radial-gradient(ellipse at 50% 50%, transparent 39%, rgba(130, 232, 255, 0.11) 39.4%, transparent 41.2%),
    radial-gradient(ellipse at 50% 50%, transparent 67%, rgba(246, 200, 95, 0.15) 67.5%, transparent 69.2%),
    rgba(4, 7, 12, 0.36);
  box-shadow:
    inset 0 0 80px rgba(78, 205, 196, 0.08),
    0 22px 54px rgba(0, 0, 0, 0.22);
}

.seat-ring[data-seats="6"] {
  --seat-size: clamp(126px, 10.4vw, 160px);
  --seat-card-h: clamp(232px, 25vh, 278px);
  --seat-art-h: clamp(110px, 12vh, 136px);
}

.seat-ring[data-seats="10"] {
  --seat-size: clamp(100px, 8.4vw, 124px);
  --seat-card-h: clamp(184px, 21vh, 218px);
  --seat-art-h: clamp(78px, 9.3vh, 96px);
}

.seat-ring[data-seats="6"] .seat-fighter {
  min-height: var(--seat-card-h);
  grid-template-rows: var(--seat-art-h) minmax(0, 1fr);
}

.seat-ring[data-seats="6"] .seat-fighter .team-art {
  min-height: 0;
  height: var(--seat-art-h);
}

.seat-ring[data-seats="10"] .seat-fighter {
  min-height: var(--seat-card-h);
  grid-template-rows: var(--seat-art-h) minmax(0, 1fr);
}

.seat-ring[data-seats="10"] .seat-fighter .team-art {
  min-height: 0;
  height: var(--seat-art-h);
}

.seat-ring[data-seats="10"] .seat-fighter .team-status-bar {
  max-height: 32px;
}

.seat-ring[data-seats="10"] .seat-fighter .team-equipment {
  min-height: 26px;
}

.seat-ring-core {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: clamp(96px, 10vw, 132px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  border: 1px solid rgba(246, 200, 95, 0.34);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 244, 207, 0.14), transparent 45%),
    rgba(7, 10, 15, 0.88);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  transform: translate(-50%, -50%);
}

.seat-ring-core strong {
  color: #82e8ff;
  font-size: 14px;
}

.seat-fighter {
  position: absolute;
  left: var(--seat-x);
  top: var(--seat-y);
  z-index: 2;
  width: var(--seat-size);
  min-height: var(--seat-card-h);
  height: var(--seat-card-h);
  grid-template-rows: var(--seat-art-h) minmax(0, 1fr);
  transform: translate(-50%, -50%);
}

.seat-fighter[data-team="red"] {
  border-color: rgba(130, 232, 255, 0.34);
}

.seat-fighter[data-team="blue"] {
  border-color: rgba(246, 200, 95, 0.36);
}

.seat-fighter.self-seat {
  border-color: rgba(255, 244, 207, 0.86);
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 208, 0.18),
    0 0 30px rgba(130, 232, 255, 0.28),
    0 16px 34px rgba(0, 0, 0, 0.3);
}

.seat-fighter.empty-seat {
  opacity: 0.42;
  border-style: dashed;
  filter: saturate(0.65);
}

.seat-fighter.empty-seat .team-art {
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 246, 208, 0.08), transparent 58%),
    rgba(255, 255, 255, 0.03);
}

.seat-fighter .team-info {
  gap: 4px;
  padding: 6px;
  min-height: 0;
  overflow: hidden;
}

.seat-fighter .team-info header {
  display: grid;
  gap: 2px;
}

.seat-fighter .team-info strong {
  font-size: 12px;
}

.seat-fighter .team-info small {
  min-width: 0;
  overflow: hidden;
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.seat-fighter .team-art {
  min-height: 0;
  height: var(--seat-art-h);
  background:
    linear-gradient(180deg, transparent 68%, rgba(5, 7, 11, 0.76)),
    var(--team-art) var(--team-art-position) / var(--team-art-size) no-repeat;
}

.seat-fighter .team-skill-label .inline-skill-name,
.seat-fighter .team-skill-label .inline-skill-action {
  min-height: 18px;
  padding: 2px 6px;
  font-size: 9px;
}

.seat-fighter .team-status-bar {
  min-height: 30px;
  max-height: 58px;
  padding: 3px;
  gap: 3px;
  overflow: auto;
}

.seat-fighter .team-status-bar .status-token {
  min-height: 24px;
  padding: 2px 5px 2px 2px;
  gap: 4px;
}

.seat-fighter .team-status-bar .status-token i {
  width: 20px;
  height: 20px;
}

.seat-fighter .team-status-bar .status-token b {
  font-size: 10px;
}

.seat-fighter .team-equipment {
  min-height: 32px;
  gap: 4px;
  padding: 3px;
}

.seat-fighter .team-equipment .equipment-slot {
  min-height: 26px;
  font-size: 15px;
  border-radius: 5px;
}

.seat-fighter .team-mini-bars {
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 244, 207, 0.08);
  border-radius: 6px;
  background: rgba(3, 6, 10, 0.32);
}

.seat-fighter .team-mini-row {
  grid-template-columns: 28px minmax(0, 1fr) 22px;
  gap: 4px;
  font-size: 10px;
}

.seat-fighter .team-choice {
  min-height: 15px;
  overflow: hidden;
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.seat-ring[data-seats="6"] .seat-fighter .team-card-inscription {
  width: clamp(66px, 7vw, 84px);
}

.seat-ring[data-seats="10"] .seat-fighter .team-card-inscription {
  top: calc(var(--seat-art-h) - 62px);
  right: 5px;
  width: 58px;
  gap: 3px;
}

.seat-ring[data-seats="10"] .seat-fighter .team-card-inscription small {
  max-width: 54px;
  padding: 2px 4px;
  font-size: 7px;
}

.seat-ring[data-seats="10"] .seat-fighter .team-card-inscription strong {
  max-width: 58px;
  overflow: hidden;
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.seat-ring[data-seats="10"] .seat-fighter .team-skill {
  left: 5px;
  top: calc(var(--seat-art-h) - 26px);
  max-width: calc(100% - 44px);
}

.seat-ring[data-seats="10"] .seat-fighter .team-skill-label .inline-skill-name,
.seat-ring[data-seats="10"] .seat-fighter .team-skill-label .inline-skill-action {
  min-height: 16px;
  padding: 2px 4px;
  font-size: 7px;
}

.seat-ring[data-seats="10"] .seat-fighter .team-info {
  gap: 3px;
  padding: 4px;
}

.seat-ring[data-seats="10"] .seat-fighter .team-info header {
  display: none;
}

.seat-ring[data-seats="10"] .seat-fighter .team-mini-bars {
  gap: 2px;
  padding: 3px;
}

.seat-ring[data-seats="10"] .seat-fighter .team-mini-row {
  grid-template-columns: 22px minmax(0, 1fr) 18px;
  gap: 3px;
  font-size: 8px;
}

.seat-ring[data-seats="10"] .seat-fighter .team-status-bar .status-token b,
.seat-ring[data-seats="10"] .seat-fighter .team-choice {
  display: none;
}

.fighter-panel.you-panel {
  --fighter-accent: #82e8ff;
  --fighter-glow: rgba(78, 205, 196, 0.1);
}

.fighter-panel.opponent-panel {
  --fighter-accent: #f6c85f;
  --fighter-glow: rgba(246, 200, 95, 0.12);
}

.fighter {
  --fighter-accent: var(--gold);
  --fighter-glow: rgba(246, 200, 95, 0.16);
  --card-frame-outset-x: 10px;
  --card-frame-outset-y: 12px;
  --position-frame-opacity: 0.58;
  --position-frame-glow: color-mix(in srgb, var(--fighter-accent) 28%, transparent);
  --target-frame-glow: color-mix(in srgb, var(--fighter-accent) 42%, transparent);
  --outer-frame-line: color-mix(in srgb, var(--fighter-accent) 60%, transparent);
  --outer-frame-node: rgba(246, 200, 95, 0.86);
  width: 100%;
  height: 100%;
  max-width: none;
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(6px, 0.78vh, 9px);
  background:
    linear-gradient(180deg, rgba(255, 244, 207, 0.08), transparent 18%),
    linear-gradient(145deg, rgba(21, 24, 32, 0.96), rgba(7, 9, 14, 0.97)),
    var(--panel-2);
  border: 1px solid color-mix(in srgb, var(--fighter-accent) 62%, #101216 38%);
  border-radius: 8px;
  padding: clamp(8px, 1vh, 10px);
  position: relative;
  isolation: isolate;
  overflow: visible;
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 208, 0.06),
    inset 0 0 44px var(--fighter-glow),
    0 0 28px color-mix(in srgb, var(--fighter-accent) 16%, transparent),
    0 20px 44px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(8px);
}

.fighter.you {
  --fighter-accent: #82e8ff;
  --fighter-glow: rgba(78, 205, 196, 0.12);
}

.fighter.opponent {
  --fighter-accent: #f6c85f;
  --fighter-glow: rgba(246, 200, 95, 0.13);
}

.fighter::before {
  content: "";
  position: absolute;
  inset: 6px;
  z-index: 0;
  opacity: 0.86;
  border: 1px solid color-mix(in srgb, var(--fighter-accent) 22%, transparent);
  border-radius: 6px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--fighter-accent) 16%, transparent), transparent 18%, transparent 82%, color-mix(in srgb, var(--fighter-accent) 12%, transparent)),
    linear-gradient(180deg, rgba(255, 244, 207, 0.06), transparent 24%, rgba(0, 0, 0, 0.16));
  pointer-events: none;
}

.fighter::after {
  display: none;
}

.fighter.inspectable::after,
.fighter.target-candidate::after,
.fighter.selected-target::after {
  content: "";
  display: block;
  position: absolute;
  z-index: 12;
  inset:
    calc(var(--card-frame-outset-y) * -1)
    calc(var(--card-frame-outset-x) * -1);
  pointer-events: none;
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 0, var(--outer-frame-node) 0 2px, transparent 4px),
    radial-gradient(circle at 50% 100%, var(--outer-frame-node) 0 2px, transparent 4px),
    radial-gradient(circle at 0 50%, var(--outer-frame-node) 0 2px, transparent 4px),
    radial-gradient(circle at 100% 50%, var(--outer-frame-node) 0 2px, transparent 4px),
    linear-gradient(var(--outer-frame-line) 0 0) left top / 34px 2px no-repeat,
    linear-gradient(var(--outer-frame-line) 0 0) right top / 34px 2px no-repeat,
    linear-gradient(var(--outer-frame-line) 0 0) left bottom / 34px 2px no-repeat,
    linear-gradient(var(--outer-frame-line) 0 0) right bottom / 34px 2px no-repeat,
    linear-gradient(var(--outer-frame-line) 0 0) left top / 2px 28px no-repeat,
    linear-gradient(var(--outer-frame-line) 0 0) right top / 2px 28px no-repeat,
    linear-gradient(var(--outer-frame-line) 0 0) left bottom / 2px 28px no-repeat,
    linear-gradient(var(--outer-frame-line) 0 0) right bottom / 2px 28px no-repeat,
    linear-gradient(90deg, transparent 7px, color-mix(in srgb, var(--outer-frame-line) 44%, transparent) 7px calc(100% - 7px), transparent calc(100% - 7px)) top / 100% 1px no-repeat,
    linear-gradient(90deg, transparent 7px, color-mix(in srgb, var(--outer-frame-line) 36%, transparent) 7px calc(100% - 7px), transparent calc(100% - 7px)) bottom / 100% 1px no-repeat,
    linear-gradient(180deg, transparent 7px, color-mix(in srgb, var(--outer-frame-line) 32%, transparent) 7px calc(100% - 7px), transparent calc(100% - 7px)) left / 1px 100% no-repeat,
    linear-gradient(180deg, transparent 7px, color-mix(in srgb, var(--outer-frame-line) 32%, transparent) 7px calc(100% - 7px), transparent calc(100% - 7px)) right / 1px 100% no-repeat;
  opacity: var(--position-frame-opacity);
  filter:
    drop-shadow(0 0 7px var(--position-frame-glow))
    drop-shadow(0 0 12px var(--target-frame-glow));
}

.fighter.target-candidate::after,
.fighter.selected-target::after {
  --position-frame-opacity: 0.96;
  animation: frameBreath 2.8s ease-in-out infinite;
}

.fighter > * {
  position: relative;
  z-index: 3;
}

.fighter-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
  align-items: center;
  padding: 4px 9px;
  color: rgba(242, 239, 231, 0.72);
  font-size: clamp(12px, 1.45vh, 14px);
  font-weight: 900;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--fighter-accent) 16%, transparent), rgba(10, 12, 17, 0.28) 42%, color-mix(in srgb, var(--fighter-accent) 10%, transparent)),
    rgba(8, 10, 15, 0.48);
  border: 1px solid color-mix(in srgb, var(--fighter-accent) 22%, transparent);
  border-radius: 6px;
}

.fighter-head strong {
  color: #fff5d2;
  font-size: clamp(16px, 2vh, 19px);
  text-shadow: 0 0 10px color-mix(in srgb, var(--fighter-accent) 24%, transparent);
}

.fighter-side {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.result-badge {
  display: inline-grid;
  place-items: center;
  min-height: 20px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #0c1015;
  border: 1px solid rgba(255, 246, 208, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 0 18px rgba(246, 200, 95, 0.24);
}

.result-badge[hidden] {
  display: none;
}

.result-badge.victory {
  background: linear-gradient(180deg, #fff2a8, #f6c85f 52%, #c99025);
}

.result-badge.defeat {
  color: #fff2e8;
  border-color: rgba(255, 124, 97, 0.58);
  background: linear-gradient(180deg, #b84b42, #6f2324 58%, #281014);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 0 16px rgba(239, 99, 81, 0.24);
}

.character-face {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0;
  min-height: 0;
  position: relative;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--fighter-accent) 9%, transparent), transparent 34%),
    #090b10;
  border: 1px solid color-mix(in srgb, var(--fighter-accent) 44%, #0d1017 56%);
  border-radius: 8px;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 208, 0.05),
    inset 0 -40px 64px rgba(0, 0, 0, 0.26),
    0 12px 28px rgba(0, 0, 0, 0.28);
}

.avatar {
  min-height: 0;
  border-radius: 8px;
  border: 0;
  background:
    var(--character-art, none),
    linear-gradient(180deg, rgba(255, 244, 207, 0.04), rgba(3, 5, 9, 0.18) 42%, rgba(2, 3, 6, 0.8)),
    #070a10;
  background-size: var(--art-size, cover), cover, cover;
  background-position: var(--art-position, center 34%), center, center;
  background-repeat: no-repeat;
  clip-path: none;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 244, 207, 0.04);
}

.avatar-right {
  transform: scaleX(-1);
}

.role-card {
  display: grid;
  place-items: center start;
  gap: 0;
  min-height: clamp(42px, 5.2vh, 50px);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--fighter-accent) 15%, transparent), rgba(12, 14, 19, 0.96) 30%),
    rgba(11, 13, 18, 0.97);
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--fighter-accent) 44%, transparent);
  border-radius: 0;
  padding: clamp(8px, 1vh, 11px) clamp(9px, 1.1vh, 12px);
  backdrop-filter: blur(8px);
}

.role-card b {
  display: none;
  color: color-mix(in srgb, var(--fighter-accent) 72%, #fff4ce 28%);
  font-size: clamp(15px, 1.9vh, 17px);
  text-shadow: 0 0 10px color-mix(in srgb, var(--fighter-accent) 20%, transparent);
}

.role-card > span {
  color: #c9ced8;
  font-size: clamp(10.5px, 1.34vh, 12px);
  line-height: 1.32;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 0;
  overflow: visible;
}

.battle-card-inscription {
  position: absolute;
  right: clamp(8px, 1.2vh, 12px);
  bottom: clamp(60px, 7.6vh, 72px);
  z-index: 6;
  width: clamp(92px, 13vh, 108px);
  display: grid;
  justify-items: end;
  gap: clamp(6px, 0.9vh, 9px);
  pointer-events: none;
  text-align: right;
  font-style: normal;
  line-height: 0.95;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", "PingFang SC", "Arial Black", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.battle-card-inscription small,
.battle-card-inscription strong {
  display: block;
  letter-spacing: 0;
}

.battle-card-inscription small {
  color: var(--battle-title-color, color-mix(in srgb, var(--fighter-accent) 76%, #f2c15a 24%));
  font-size: clamp(10px, 1.42vh, 12px);
  font-weight: 900;
  padding: 4px 8px 4px 9px;
  background:
    linear-gradient(90deg, rgba(9, 11, 16, 0.82), rgba(9, 11, 16, 0.94)),
    rgba(9, 11, 16, 0.9);
  border-right: 2px solid var(--battle-title-color, color-mix(in srgb, var(--fighter-accent) 86%, #f2c15a 14%));
  border-radius: 5px 0 0 5px;
  -webkit-text-fill-color: var(--battle-title-color, color-mix(in srgb, var(--fighter-accent) 76%, #f2c15a 24%));
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  box-shadow:
    0 2px 7px rgba(0, 0, 0, 0.34),
    inset 0 0 0 1px rgba(255, 244, 207, 0.04);
}

.battle-card-inscription strong {
  color: #ffffff;
  font-size: clamp(20px, 2.72vh, 24px);
  font-weight: 900;
  padding: 2px 0;
  -webkit-text-fill-color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

.battle-card-inscription[data-character="Maoye"] {
  --battle-title-color: #ff7c0a;
}

.battle-card-inscription[data-character="Qizong"] {
  --battle-title-color: #8788ee;
}

.battle-card-inscription[data-character="Xiaofan"] {
  --battle-title-color: #a330c9;
}

.battle-card-inscription[data-character="Lollipopz"] {
  --battle-title-color: #fff468;
}

.battle-card-inscription[data-character="Rhasta"] {
  --battle-title-color: #0070dd;
}

.battle-card-inscription[data-character="Jisoo"] {
  --battle-title-color: #c41e3a;
}

.battle-card-inscription[data-character="Letmetalk"] {
  --battle-title-color: #c69b6d;
}

.battle-card-inscription[data-character="Saoge"] {
  --battle-title-color: #00ff98;
}

.battle-card-inscription[data-character="Anai"] {
  --battle-title-color: #00ff98;
}

.battle-card-inscription[data-character="Jiego"] {
  --battle-title-color: #8788ee;
}

.battle-card-inscription[data-character="Imba"] {
  --battle-title-color: #ff7c0a;
}

.battle-card-inscription[data-character="Mike"],
.battle-card-inscription[data-character="TY"] {
  --battle-title-color: #c79c6e;
}

.battle-card-inscription[data-character="Guming"],
.battle-card-inscription[data-character="\767D\6CFD"],
.battle-card-inscription[data-character="白泽"] {
  --battle-title-color: #f48cba;
}

.skill-label {
  display: inline-flex;
  align-items: center;
  align-self: start;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  position: relative;
  overflow: visible;
}

.inline-skill-name,
.inline-skill-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 24px;
  max-width: 138px;
  padding: 3px 10px 4px;
  color: #fff3c2;
  font: inherit;
  font-size: clamp(11px, 1.34vh, 12px);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--fighter-accent) 62%, #2a2112 38%);
  border-radius: 6px;
  background:
    linear-gradient(120deg, transparent 0 38%, rgba(255, 255, 255, 0.22) 43%, transparent 49%),
    linear-gradient(180deg, rgba(255, 239, 172, 0.2), rgba(106, 70, 22, 0.32) 54%, rgba(8, 10, 14, 0.92)),
    linear-gradient(90deg, color-mix(in srgb, var(--fighter-accent) 26%, #10131a 74%), rgba(9, 11, 16, 0.95));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -1px 0 rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 246, 208, 0.06),
    0 0 13px color-mix(in srgb, var(--fighter-accent) 18%, transparent);
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.86),
    0 0 8px color-mix(in srgb, var(--fighter-accent) 28%, transparent);
  overflow: hidden;
  text-overflow: ellipsis;
}

.inline-skill-action {
  appearance: none;
  cursor: pointer;
  position: relative;
}

.inline-skill-action::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 4px;
  pointer-events: none;
  border: 1px solid rgba(255, 246, 208, 0.12);
  background:
    linear-gradient(90deg, transparent, rgba(78, 205, 196, 0.22), transparent);
  opacity: 0.38;
}

.inline-skill-action:hover:not(:disabled),
.inline-skill-action:focus-visible:not(:disabled) {
  color: #ffffff;
  border-color: color-mix(in srgb, var(--fighter-accent) 82%, #fff4ce 18%);
  outline: 1px solid color-mix(in srgb, var(--fighter-accent) 50%, transparent);
  outline-offset: 2px;
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    inset 0 -1px 0 rgba(0, 0, 0, 0.52),
    0 0 18px color-mix(in srgb, var(--fighter-accent) 34%, transparent);
}

.inline-skill-action:disabled {
  color: rgba(224, 220, 210, 0.62);
  border-color: rgba(110, 116, 132, 0.45);
  cursor: not-allowed;
  filter: saturate(0.66);
  opacity: 0.82;
  transform: none;
}

.skill-label.has-tooltip::before {
  content: "";
  position: absolute;
  left: 18px;
  bottom: calc(100% + 3px);
  z-index: 25;
  width: 10px;
  height: 10px;
  background: rgba(16, 20, 30, 0.98);
  border-right: 1px solid rgba(246, 200, 95, 0.45);
  border-bottom: 1px solid rgba(246, 200, 95, 0.45);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px) rotate(45deg);
  transition: opacity 120ms ease, transform 120ms ease;
}

.skill-label.has-tooltip::after {
  content: attr(data-description);
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 24;
  width: max-content;
  max-width: min(280px, calc(100vw - 24px));
  padding: 9px 11px;
  color: #f6f1e4;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  background:
    linear-gradient(135deg, rgba(246, 200, 95, 0.16), transparent 44%),
    linear-gradient(180deg, rgba(16, 20, 30, 0.98), rgba(6, 8, 12, 0.98));
  border: 1px solid rgba(246, 200, 95, 0.52);
  border-radius: 7px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 208, 0.06),
    0 0 20px rgba(246, 200, 95, 0.16),
    0 14px 34px rgba(0, 0, 0, 0.42);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
  backdrop-filter: blur(10px);
}

.skill-label.has-tooltip:hover::before,
.skill-label.has-tooltip:focus-within::before,
.skill-label.has-tooltip:hover::after,
.skill-label.has-tooltip:focus-within::after {
  opacity: 1;
  transform: translateY(0);
}

.skill-label.has-tooltip:hover::before,
.skill-label.has-tooltip:focus-within::before {
  transform: translateY(0) rotate(45deg);
}

.inline-skill-cooldown {
  display: inline-grid;
  place-items: center;
  min-height: 18px;
  padding: 2px 6px;
  color: #ffdfb4;
  border: 1px solid rgba(239, 99, 81, 0.52);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(239, 99, 81, 0.24), rgba(65, 21, 22, 0.78)),
    rgba(9, 10, 14, 0.86);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 10px rgba(239, 99, 81, 0.18);
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.status-bar {
  min-height: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 7px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(246, 200, 95, 0.55) rgba(7, 9, 14, 0.4);
  border: 1px solid color-mix(in srgb, var(--fighter-accent) 20%, #171b24 80%);
  border-radius: 7px;
  background: rgba(6, 8, 12, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 246, 208, 0.03);
}

.status-bar[hidden] {
  display: none;
}

.status-bar::before {
  content: none;
}

.status-token {
  min-width: 0;
  max-width: 188px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  overflow: hidden;
  color: #efe8d6;
  border: 1px solid rgba(255, 244, 207, 0.18);
  border-radius: 999px;
  padding: 2px 9px 2px 3px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    rgba(19, 22, 29, 0.86);
  box-shadow:
    inset 0 0 12px rgba(255, 244, 207, 0.04),
    0 6px 14px rgba(0, 0, 0, 0.18);
}

.status-bar::-webkit-scrollbar {
  height: 5px;
}

.status-bar::-webkit-scrollbar-track {
  background: rgba(7, 9, 14, 0.42);
  border-radius: 999px;
}

.status-bar::-webkit-scrollbar-thumb {
  background:
    linear-gradient(90deg, rgba(78, 205, 196, 0.78), rgba(246, 200, 95, 0.86));
  border-radius: 999px;
}

.equipment-slots {
  min-height: 52px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(246, 200, 95, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 244, 207, 0.07), rgba(3, 5, 9, 0.62)),
    rgba(7, 9, 14, 0.58);
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, 0.28),
    0 0 16px color-mix(in srgb, var(--fighter-accent) 9%, transparent);
}

.equipment-slot {
  min-width: 0;
  min-height: 42px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  color: rgba(246, 200, 95, 0.58);
  font-size: 22px;
  font-weight: 900;
  border: 1px dashed color-mix(in srgb, var(--fighter-accent) 34%, rgba(255, 255, 255, 0.08));
  border-radius: 7px;
  background:
    radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--fighter-accent) 10%, transparent), transparent 54%),
    rgba(4, 6, 10, 0.7);
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.38);
}

.equipment-slot.filled {
  color: transparent;
  border-style: solid;
  border-color: color-mix(in srgb, var(--fighter-accent) 54%, rgba(255, 255, 255, 0.08));
  background:
    linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.76)),
    radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--fighter-accent) 18%, transparent), transparent 62%),
    var(--equipment-art, none) center / contain no-repeat,
    #05070b;
}

.equipment-slot.filled::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 208, 0.1),
    inset 0 0 18px color-mix(in srgb, var(--fighter-accent) 16%, transparent);
  pointer-events: none;
}

.equipment-slot b {
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 2px;
  overflow: hidden;
  color: #fff5d2;
  font-size: 8px;
  line-height: 1.05;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
}

.status-token i {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 244, 207, 0.24);
  border-radius: 7px;
  color: #0a0d12;
  background: rgba(8, 10, 14, 0.82);
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 10px rgba(246, 200, 95, 0.14);
}

.status-icon-img,
.stat-label-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}

.status-token em {
  flex: 0 0 auto;
  color: rgba(255, 244, 207, 0.66);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.status-token b {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: clamp(10px, 1.35vh, 12px);
  font-weight: 900;
  letter-spacing: 0;
}

.status-token.buff {
  border-color: rgba(116, 198, 157, 0.38);
  color: #dff9ec;
  background:
    linear-gradient(180deg, rgba(116, 198, 157, 0.18), transparent),
    rgba(11, 24, 20, 0.9);
}

.status-token.buff i {
  border-color: rgba(116, 198, 157, 0.54);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 0 12px rgba(116, 198, 157, 0.22);
}

.status-token.debuff {
  border-color: rgba(239, 99, 81, 0.42);
  color: #ffe0db;
  background:
    linear-gradient(180deg, rgba(239, 99, 81, 0.18), transparent),
    rgba(28, 13, 14, 0.9);
}

.status-token.debuff i {
  border-color: rgba(239, 99, 81, 0.58);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 0 12px rgba(239, 99, 81, 0.24);
}

.status-token.cooldown {
  border-color: rgba(246, 200, 95, 0.44);
  color: #fff0bc;
  background:
    linear-gradient(180deg, rgba(246, 200, 95, 0.18), transparent),
    rgba(27, 21, 8, 0.9);
}

.status-token.cooldown i {
  border-color: rgba(246, 200, 95, 0.58);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 0 12px rgba(246, 200, 95, 0.24);
}

.status-token.neutral i {
  border-color: rgba(184, 192, 207, 0.48);
}

.meter-row {
  display: grid;
  grid-template-columns: minmax(58px, auto) 1fr auto;
  gap: 9px;
  align-items: center;
  min-height: 30px;
  padding: 4px 8px;
  color: #ded8c8;
  font-size: clamp(12px, 1.55vh, 14px);
  font-weight: 900;
  background:
    linear-gradient(90deg, rgba(255, 244, 207, 0.05), transparent 36%),
    rgba(6, 8, 12, 0.46);
  border: 1px solid rgba(255, 244, 207, 0.1);
  border-radius: 7px;
}

.meter-row > b {
  min-width: 28px;
  color: #fff2ce;
  text-align: right;
  font-size: clamp(16px, 2.2vh, 20px);
  text-shadow: 0 0 10px rgba(246, 200, 95, 0.2);
}

.stat-label {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #f1e6cb;
  white-space: nowrap;
}

.stat-label-icon {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  overflow: hidden;
  border: 1px solid rgba(255, 244, 207, 0.2);
  border-radius: 7px;
  background: rgba(8, 10, 14, 0.82);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 12px rgba(246, 200, 95, 0.16);
}

.fighter-panel .meter-row {
  grid-template-columns: minmax(72px, auto) auto;
}

.fighter-panel .meter-row > b {
  min-width: 0;
}

.fighter-panel .meter {
  grid-column: 1 / -1;
}

.meter {
  height: 10px;
  background: rgba(5, 7, 11, 0.82);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(246, 200, 95, 0.28);
  box-shadow:
    inset 0 0 9px rgba(0, 0, 0, 0.52),
    0 0 12px rgba(116, 198, 157, 0.14);
}

.meter i {
  display: block;
  height: 100%;
  width: 100%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent 48%),
    linear-gradient(90deg, var(--green), var(--gold), var(--red));
  transition: width 180ms ease;
}

.energy,
.fatigue,
.laziness {
  --stat-token-active: url("assets/icons/status/momentum.png");
  --stat-token-empty: url("assets/icons/status/stat-empty-token-gpt2.png");
  --stat-token-glow: rgba(246, 200, 95, 0.46);
  --stat-mark-size: clamp(11px, 1.55vh, 15px);
  min-height: clamp(21px, 2.8vh, 28px);
  display: grid;
  grid-template-columns: minmax(60px, 68px) minmax(0, 1fr);
  align-items: center;
  gap: 5px 7px;
  padding: 3px 8px;
  background: rgba(6, 8, 12, 0.24);
  border-radius: 7px;
}

.energy > .stat-label,
.fatigue > .stat-label,
.laziness > .stat-label {
  flex: 0 0 auto;
  color: #d9d2c2;
  font-size: clamp(12px, 1.7vh, 14px);
  font-weight: 900;
  line-height: 1;
  margin-right: 2px;
}

.stat-marks {
  display: grid;
  grid-template-columns: repeat(5, var(--stat-mark-size));
  grid-auto-rows: var(--stat-mark-size);
  align-items: center;
  align-content: center;
  justify-content: start;
  gap: 3px 4px;
  min-width: 0;
  line-height: 0;
}

.fatigue .stat-marks {
  grid-template-columns: repeat(2, var(--stat-mark-size));
}

.laziness .stat-marks {
  grid-template-columns: repeat(4, var(--stat-mark-size));
}

.energy .stat-label {
  color: #fff0bc;
}

.fatigue .stat-label {
  color: #ffd0cb;
}

.laziness .stat-label {
  color: #f0d69d;
}

.energy i,
.fatigue i,
.laziness i {
  flex: 0 0 auto;
  width: var(--stat-mark-size);
  height: var(--stat-mark-size);
  border-radius: 50%;
  background: var(--stat-token-empty) center / cover no-repeat;
  opacity: 0.44;
  filter: blur(0.35px) saturate(0.7);
  box-shadow: 0 0 8px rgba(160, 200, 220, 0.14);
}

.energy i.filled,
.fatigue i.filled,
.laziness i.filled {
  background: var(--stat-token-active) center / cover no-repeat;
  opacity: 1;
  filter: none;
  box-shadow:
    0 0 10px var(--stat-token-glow),
    0 0 2px rgba(255, 255, 255, 0.42);
}

.fatigue-row {
  min-height: clamp(24px, 3vh, 30px);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 8px;
  color: #d5cdbc;
  font-size: clamp(12px, 1.65vh, 14px);
  font-weight: 900;
  background: rgba(6, 8, 12, 0.24);
  border-radius: 7px;
}

.fighter-panel .fatigue-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.fighter-panel .fatigue-row .stat-label {
  white-space: nowrap;
}

.fighter-panel .energy,
.fighter-panel .fatigue,
.fighter-panel .laziness {
  grid-template-columns: minmax(58px, 64px) minmax(0, 1fr);
  gap: 3px 5px;
  min-width: 0;
  padding-inline: 5px;
}

.fighter-panel .energy i,
.fighter-panel .fatigue i,
.fighter-panel .laziness i {
  --stat-mark-size: clamp(10px, 1.38vh, 13px);
}

.fatigue {
  --stat-token-active: url("assets/icons/status/fatigue-token-gpt2.png");
  --stat-token-glow: rgba(239, 99, 81, 0.54);
}

.laziness {
  --stat-token-active: url("assets/icons/status/laziness-token-gpt2.png");
  --stat-token-glow: rgba(176, 116, 255, 0.46);
}

.choice {
  min-height: 22px;
  margin: 0;
  padding: 2px 8px;
  color: rgba(242, 239, 231, 0.72);
  font-size: clamp(12px, 1.65vh, 14px);
  font-weight: 800;
}

.versus {
  align-self: center;
  display: grid;
  place-items: center;
  width: var(--versus-size);
  height: var(--versus-size);
  position: relative;
  z-index: 8;
  isolation: isolate;
  color: #fff1c0;
  font-weight: 900;
  font-size: clamp(20px, 3.1dvh, 28px);
  line-height: 1;
  background:
    linear-gradient(180deg, rgba(255, 244, 207, 0.08), transparent),
    #0c0f15;
  border: 1px solid rgba(246, 200, 95, 0.52);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 208, 0.08),
    inset 0 -14px 22px rgba(0, 0, 0, 0.36),
    0 0 28px rgba(246, 200, 95, 0.18);
  text-shadow: 0 0 12px rgba(246, 200, 95, 0.34);
}

.versus::before {
  content: "";
  position: absolute;
  inset: -18px;
  z-index: -1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 244, 207, 0.16), transparent 48%),
    conic-gradient(from 0deg, rgba(78, 205, 196, 0.1), rgba(246, 200, 95, 0.72), rgba(239, 99, 81, 0.12), rgba(78, 205, 196, 0.1));
  filter: blur(0.2px);
  animation: energyOrbit 8s linear infinite;
}

.versus::after {
  content: "";
  position: absolute;
  inset: -8px;
  z-index: -1;
  border: 1px solid rgba(255, 244, 207, 0.22);
  border-radius: 50%;
  box-shadow:
    0 0 18px rgba(246, 200, 95, 0.28),
    inset 0 0 16px rgba(78, 205, 196, 0.18);
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
  gap: 9px;
  align-self: start;
  justify-self: center;
  width: min(560px, 100%);
  box-sizing: border-box;
  margin-top: clamp(0px, 0.4vh, 5px);
}

.battle-libraries {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: clamp(38px, 4.6vh, 46px);
  align-items: stretch;
  justify-self: center;
  gap: 7px;
  width: min(380px, 74%);
  min-height: 38px;
  margin-top: -2px;
}

.control-banner {
  position: absolute;
  left: 50%;
  top: clamp(76px, 12vh, 132px);
  z-index: 12;
  width: min(430px, calc(100% - 32px));
  display: grid;
  gap: 6px;
  place-items: center;
  min-height: 104px;
  padding: 18px 20px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(5, 7, 12, 0.5), rgba(5, 7, 12, 0.82)),
    linear-gradient(135deg, rgba(239, 99, 81, 0.2), rgba(246, 200, 95, 0.12)),
    var(--ui-panel-dialog) center / cover no-repeat,
    rgba(12, 14, 20, 0.96);
  border: 1px solid rgba(239, 99, 81, 0.62);
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 208, 0.06),
    0 22px 58px rgba(0, 0, 0, 0.44),
    0 0 32px rgba(239, 99, 81, 0.14);
  pointer-events: none;
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

.control-banner strong {
  color: var(--red);
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1;
}

.control-banner span {
  color: var(--muted);
  font-weight: 800;
}

.action-card {
  --action-art: none;
  aspect-ratio: 2.5 / 1;
  min-height: 50px;
  display: grid;
  place-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: var(--action-art) center / 100% 100% no-repeat;
  color: var(--text);
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  transition: transform 140ms ease, filter 140ms ease;
}

.action-card::before {
  content: none;
}

.action-card::after {
  content: none;
}

.action-icon {
  display: none;
}

.action-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-card > * {
  position: relative;
}

.action-card > .action-icon {
  position: absolute;
}

.action-card.attack {
  --action-glow: var(--red);
  --action-art: url("assets/ui/action-attack-melee-cutout.png");
}

.cards[data-attack-style="warrior"] .action-card.attack {
  --action-glow: #e04f42;
  --action-art: url("assets/ui/action-attack-warrior-cutout.png");
}

.cards[data-attack-style="death-knight"] .action-card.attack {
  --action-glow: #65dfff;
  --action-art: url("assets/ui/action-attack-death-knight-cutout.png");
}

.cards[data-attack-style="demon-hunter"] .action-card.attack {
  --action-glow: #55ff72;
  --action-art: url("assets/ui/action-attack-demon-hunter-cutout.png");
}

.cards[data-attack-style="paladin"] .action-card.attack {
  --action-glow: #ffe37a;
  --action-art: url("assets/ui/action-attack-paladin-cutout.png");
}

.cards[data-attack-style="rogue"] .action-card.attack {
  --action-glow: #d66bff;
  --action-art: url("assets/ui/action-attack-rogue-cutout.png");
}

.cards[data-attack-style="monk"] .action-card.attack {
  --action-glow: #60e8b8;
  --action-art: url("assets/ui/action-attack-monk-cutout.png");
}

.cards[data-attack-style="druid"] .action-card.attack {
  --action-glow: #65dd74;
  --action-art: url("assets/ui/action-attack-druid-cutout.png");
}

.cards[data-attack-style="shaman"] .action-card.attack {
  --action-glow: #58dfff;
  --action-art: url("assets/ui/action-attack-shaman-cutout.png");
}

.cards[data-attack-style="warlock"] .action-card.attack {
  --action-glow: #bd72ff;
  --action-art: url("assets/ui/action-attack-warlock-cutout.png");
}

.cards[data-attack-style="mage"] .action-card.attack {
  --action-glow: #72e8ff;
  --action-art: url("assets/ui/action-attack-mage-cutout.png");
}

.cards[data-attack-style="caster"] .action-card.attack {
  --action-glow: #72e8ff;
  --action-art: url("assets/ui/action-attack-caster-cutout.png");
}

.cards[data-attack-style="hunter"] .action-card.attack {
  --action-glow: #91ff7b;
  --action-art: url("assets/ui/action-attack-hunter-cutout.png");
}

.action-card.attack::after {
  content: none;
}

.action-card.attack .action-icon {
  color: #ffd6cf;
}

.action-card.defend {
  --action-glow: var(--teal);
  --action-art: url("assets/ui/action-defend-cutout.png");
}

.action-card.defend::after {
  content: none;
}

.action-card.defend .action-icon {
  color: #baf8f3;
}

.action-card.charge {
  --action-glow: var(--gold);
  --action-art: url("assets/ui/action-charge-cutout.png");
}

.action-card.charge::after {
  content: none;
}

.action-card.charge .action-icon {
  color: #ffe19a;
}

.action-card:hover:not(:disabled) {
  transform: none;
  filter: brightness(1.12) saturate(1.08);
}

.action-card:hover:not(:disabled) span,
.action-card:focus-visible:not(:disabled) span {
  transform: none;
}

.action-card:hover:not(:disabled)::before {
  animation: none;
}

.action-card:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.action-card span {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: clamp(16px, 1.95vh, 18px);
  font-weight: 900;
  color: #fff8df;
  line-height: 1;
  margin: 0;
  pointer-events: none;
  transform: none;
  transition: text-shadow 140ms ease, color 140ms ease;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.92),
    0 0 10px color-mix(in srgb, var(--action-glow, var(--gold)) 44%, transparent),
    1px 0 0 rgba(0, 0, 0, 0.75),
    -1px 0 0 rgba(0, 0, 0, 0.75);
}

.action-card b {
  color: #ffe19a;
}

.action-card small {
  color: var(--muted);
}

.utility {
  position: absolute;
  right: clamp(10px, 1.1vw, 18px);
  bottom: clamp(10px, 1.15vh, 18px);
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-items: stretch;
  gap: 6px;
  width: clamp(190px, 16vw, 218px);
  min-height: 0;
}

.utility button {
  --ui-button-art: var(--ui-button-dark);
  min-height: 32px;
  flex: none;
  padding: 0 10px;
  border-radius: 8px;
  font-weight: 900;
  background:
    linear-gradient(90deg, rgba(2, 3, 6, 0.72), rgba(2, 3, 6, 0.18) 50%, rgba(2, 3, 6, 0.72)),
    linear-gradient(180deg, rgba(255, 244, 207, 0.08), transparent),
    var(--ui-button-art) center / 100% 100% no-repeat,
    rgba(18, 21, 29, 0.96);
  color: #f5eedb;
  border: 1px solid rgba(246, 200, 95, 0.28);
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 208, 0.08),
    0 14px 32px rgba(0, 0, 0, 0.32);
}

.battle-libraries .library-action {
  --library-art: none;
  --library-glow: #4ecdc4;
  min-height: 38px;
  padding: 0 13px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid color-mix(in srgb, var(--library-glow) 42%, rgba(255, 246, 208, 0.18));
  border-radius: 8px;
  font-weight: 900;
  border-color: color-mix(in srgb, var(--library-glow) 42%, rgba(255, 246, 208, 0.18));
  color: #fff8df;
  text-align: left;
  background:
    linear-gradient(90deg, rgba(3, 5, 10, 0.92), rgba(3, 5, 10, 0.54) 48%, rgba(3, 5, 10, 0.18)),
    linear-gradient(180deg, rgba(255, 244, 207, 0.1), rgba(0, 0, 0, 0.18)),
    var(--library-art) center / cover no-repeat,
    rgba(8, 10, 15, 0.98);
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 208, 0.08),
    inset 0 -16px 30px rgba(0, 0, 0, 0.3),
    inset 0 0 18px color-mix(in srgb, var(--library-glow) 10%, transparent),
    0 0 14px color-mix(in srgb, var(--library-glow) 14%, transparent),
    0 10px 18px rgba(0, 0, 0, 0.24);
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.92),
    0 0 12px color-mix(in srgb, var(--library-glow) 42%, transparent);
}

.battle-libraries .library-action::before {
  content: none;
}

.battle-libraries .library-action span {
  position: relative;
  display: block;
  padding: 0;
  font-size: clamp(12px, 1.4vh, 13px);
  letter-spacing: 0;
}

.battle-libraries .library-action:hover:not(:disabled),
.battle-libraries .library-action:focus-visible:not(:disabled) {
  border-color: #fff0bc;
  color: #fff7d6;
  outline: none;
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 208, 0.12),
    inset 0 0 22px color-mix(in srgb, var(--library-glow) 18%, transparent),
    0 0 20px color-mix(in srgb, var(--library-glow) 26%, transparent),
    0 10px 20px rgba(0, 0, 0, 0.28);
}

.battle-libraries .opportunity-library-action {
  --library-art: url("assets/ui/library-opportunity-mode-gpt2.png?v=1.7-library-mode");
  --library-glow: #4ecdc4;
}

.battle-libraries .artifact-library-action {
  --library-art: url("assets/ui/library-artifact-mode-gpt2.png?v=1.7-library-mode");
  --library-glow: #f6c85f;
}

.utility button:not([hidden]) + button {
  margin-left: 0;
}

.utility button:last-child {
  grid-column: 1 / -1;
  min-height: 34px;
  background:
    linear-gradient(90deg, rgba(2, 3, 6, 0.72), rgba(2, 3, 6, 0.18) 50%, rgba(2, 3, 6, 0.72)),
    linear-gradient(180deg, rgba(255, 244, 207, 0.1), transparent),
    var(--ui-button-dark) center / 100% 100% no-repeat,
    rgba(28, 29, 34, 0.96);
  color: #f8f0da;
  border-color: rgba(246, 200, 95, 0.34);
}

.utility #rematch {
  grid-column: 1 / -1;
}

#leaveCharacterSelect {
  width: clamp(116px, 13vw, 142px);
  min-width: 0;
  min-height: 0;
  padding: 7px 8px;
  justify-self: end;
  font-size: clamp(12px, 1.45vh, 14px);
}

#lockCharacter {
  width: clamp(138px, 48%, 168px);
  min-height: 0;
  margin-top: 2px;
  padding: 6px 8px;
  justify-self: center;
  font-size: clamp(12px, 1.45vh, 14px);
}

#leaveRoom {
  width: 100%;
  min-height: 0;
  padding: 8px 10px;
  font-size: clamp(12px, 1.55vh, 15px);
}

.side {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 12px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.side section {
  padding: 14px;
  min-width: 0;
  min-height: 0;
  background:
    linear-gradient(180deg, rgba(5, 7, 12, 0.54), rgba(5, 7, 12, 0.82)),
    linear-gradient(180deg, rgba(255, 244, 207, 0.07), transparent 18%),
    var(--ui-panel-side) center / cover no-repeat,
    linear-gradient(180deg, rgba(20, 22, 29, 0.94), rgba(7, 9, 14, 0.94));
  border-color: rgba(246, 200, 95, 0.28);
  box-shadow:
    0 22px 62px rgba(0, 0, 0, 0.34),
    inset 0 0 0 1px rgba(255, 246, 208, 0.06);
  backdrop-filter: blur(8px);
}

.side section:first-child {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
}

.side h2 {
  margin: 0;
  color: #fff1c0;
  font-size: 16px;
  font-weight: 900;
  text-shadow: 0 0 12px rgba(246, 200, 95, 0.2);
}

.log {
  display: grid;
  gap: 9px;
  align-content: start;
  max-height: none;
  min-height: 0;
  overflow: auto;
}

.log article {
  background:
    linear-gradient(180deg, rgba(5, 7, 12, 0.48), rgba(5, 7, 12, 0.76)),
    linear-gradient(90deg, rgba(246, 200, 95, 0.08), rgba(10, 12, 17, 0.88) 32%),
    var(--ui-panel-side) center / cover no-repeat,
    rgba(10, 12, 17, 0.88);
  border: 1px solid rgba(246, 200, 95, 0.2);
  border-left-color: rgba(246, 200, 95, 0.5);
  border-radius: 8px;
  padding: 10px 11px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 208, 0.035),
    0 10px 22px rgba(0, 0, 0, 0.18);
}

.log article > strong {
  display: block;
  margin-bottom: 4px;
  color: #fff0bc;
  font-size: 13px;
  line-height: 1.35;
}

.log small {
  line-height: 1.45;
}

.side .rules {
  background:
    linear-gradient(180deg, rgba(5, 7, 12, 0.58), rgba(5, 7, 12, 0.86)),
    linear-gradient(180deg, rgba(246, 200, 95, 0.1), rgba(8, 10, 15, 0.92) 42%),
    var(--ui-panel-side) center / cover no-repeat,
    rgba(10, 12, 17, 0.92);
}

.side .rules p {
  margin: 0;
  color: #c4cad4;
  line-height: 1.42;
  font-size: 13px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--text);
  color: #111318;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 800;
}

.rules-dialog,
.control-dialog {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(0, 0, 0, 0.62);
}

.control-dialog {
  z-index: 24;
}

.rules-box {
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 44px));
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(5, 7, 12, 0.48), rgba(5, 7, 12, 0.84)),
    radial-gradient(circle at 50% 0%, rgba(246, 200, 95, 0.12), transparent 46%),
    var(--ui-panel-dialog) center / cover no-repeat,
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
}

.control-box {
  width: min(680px, 100%);
  background:
    linear-gradient(180deg, rgba(5, 7, 12, 0.48), rgba(5, 7, 12, 0.84)),
    radial-gradient(circle at 50% 0%, rgba(78, 205, 196, 0.12), transparent 46%),
    var(--ui-panel-dialog) center / cover no-repeat,
    var(--panel);
  border: 1px solid rgba(246, 200, 95, 0.45);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
}

.control-box h2 {
  margin-bottom: 6px;
}

.control-box p {
  color: var(--muted);
  margin-bottom: 16px;
}

.control-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.control-actions button {
  --ui-button-art: var(--ui-button-teal);
  min-height: 118px;
  display: grid;
  gap: 8px;
  align-content: center;
  text-align: left;
  background:
    linear-gradient(90deg, rgba(2, 3, 6, 0.76), rgba(2, 3, 6, 0.28) 50%, rgba(2, 3, 6, 0.76)),
    linear-gradient(145deg, rgba(246, 200, 95, 0.1), transparent 44%),
    var(--ui-button-art) center / 100% 100% no-repeat,
    #111318;
  color: var(--text);
  border: 1px solid rgba(255, 246, 208, 0.28);
  border-radius: 8px;
  padding: 16px;
  padding-right: 54px;
  position: relative;
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 208, 0.06),
    0 12px 24px rgba(0, 0, 0, 0.24);
}

.control-actions button:hover:not(:disabled),
.control-actions button:focus-visible:not(:disabled) {
  border-color: var(--gold);
  outline: none;
}

.control-actions button::before {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(246, 200, 95, 0.32);
  border-radius: 50%;
  color: #fff0bc;
  font-weight: 900;
  background:
    radial-gradient(circle, rgba(246, 200, 95, 0.2), rgba(8, 10, 15, 0.84) 64%);
}

.control-actions button[data-control-action="attack"]::before {
  content: "攻";
  border-color: rgba(239, 99, 81, 0.42);
}

.control-actions button[data-control-action="attack"] {
  --ui-button-art: var(--ui-button-dark);
}

.control-actions button[data-control-action="defend"]::before {
  content: "守";
  border-color: rgba(78, 205, 196, 0.42);
}

.control-actions button[data-control-action="charge"]::before {
  content: "势";
}

.control-actions button[data-control-action="charge"] {
  --ui-button-art: var(--ui-button-gold);
}

.control-actions button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.control-actions span {
  color: var(--gold);
  font-size: 22px;
  font-weight: 900;
}

.control-actions small {
  color: var(--muted);
}

.rules-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.rules-head h2 {
  margin: 0;
}

.rules-head button {
  --ui-button-art: var(--ui-button-teal);
  background:
    linear-gradient(90deg, rgba(2, 3, 6, 0.64), rgba(2, 3, 6, 0.16) 50%, rgba(2, 3, 6, 0.64)),
    linear-gradient(180deg, rgba(255, 244, 207, 0.18), rgba(0, 0, 0, 0.18) 68%),
    var(--ui-button-art) center / 100% 100% no-repeat,
    rgba(8, 10, 15, 0.98);
  color: #fff8df;
  border-radius: 6px;
  padding: 9px 12px;
  font-weight: 900;
  text-shadow:
    0 2px 3px rgba(0, 0, 0, 0.9),
    0 0 12px rgba(78, 205, 196, 0.32);
}

.rules-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.rules-points article {
  min-height: 96px;
  display: grid;
  gap: 6px;
  align-content: start;
  background:
    linear-gradient(180deg, rgba(5, 7, 12, 0.42), rgba(5, 7, 12, 0.72)),
    var(--ui-panel-dialog) center / cover no-repeat,
    #111318;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.rules-points strong {
  color: var(--gold);
}

.rule-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rule-library-button {
  --ui-button-art: var(--ui-button-teal);
  min-height: 30px;
  border: 1px solid rgba(78, 205, 196, 0.34);
  border-radius: 999px;
  padding: 6px 10px;
  background:
    linear-gradient(90deg, rgba(2, 3, 6, 0.7), rgba(2, 3, 6, 0.2) 50%, rgba(2, 3, 6, 0.7)),
    linear-gradient(180deg, rgba(255, 244, 207, 0.14), transparent 48%),
    var(--ui-button-art) center / 100% 100% no-repeat,
    linear-gradient(180deg, rgba(37, 64, 83, 0.96), rgba(12, 19, 30, 0.96));
  color: #ecfffb;
  font-size: 12px;
  font-weight: 900;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 16px rgba(78, 205, 196, 0.14);
}

.rule-library-button:hover:not(:disabled),
.rule-library-button:focus-visible:not(:disabled) {
  border-color: rgba(246, 200, 95, 0.62);
  color: #fff3c9;
  outline: none;
  transform: translateY(-1px);
}

.artifact-rule-button {
  --ui-button-art: var(--ui-button-gold);
  border-color: rgba(246, 200, 95, 0.4);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 16px rgba(246, 200, 95, 0.14);
}

.rules-points span {
  color: var(--muted);
  line-height: 1.45;
}

.opportunity-dialog {
  position: fixed;
  inset: 0;
  z-index: 28;
  display: grid;
  place-items: center;
  padding: clamp(14px, 3vw, 32px);
  background:
    radial-gradient(circle at 50% 42%, rgba(246, 200, 95, 0.18), transparent 42%),
    rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.opportunity-box {
  width: min(980px, 100%);
  max-height: min(780px, calc(100dvh - 36px));
  overflow: auto;
  border: 1px solid rgba(246, 200, 95, 0.5);
  border-radius: 14px;
  padding: clamp(16px, 2.4vw, 24px);
  background:
    linear-gradient(180deg, rgba(5, 7, 12, 0.5), rgba(5, 7, 12, 0.84)),
    radial-gradient(circle at 50% 0%, rgba(246, 200, 95, 0.14), transparent 50%),
    var(--ui-panel-dialog) center / cover no-repeat,
    linear-gradient(180deg, rgba(255, 244, 207, 0.08), rgba(7, 9, 14, 0.96) 34%),
    var(--panel);
  box-shadow:
    0 34px 100px rgba(0, 0, 0, 0.62),
    inset 0 0 36px rgba(246, 200, 95, 0.08);
}

.opportunity-head {
  display: grid;
  gap: 5px;
  margin-bottom: 16px;
  text-align: center;
}

.opportunity-head span,
.opportunity-copy em {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.opportunity-head h2 {
  margin: 0;
  color: var(--gold);
  font-size: clamp(26px, 4vw, 42px);
  text-shadow: 0 0 24px rgba(246, 200, 95, 0.36);
}

.opportunity-head p,
.opportunity-library-note {
  margin: 0;
  color: var(--muted);
}

.opportunity-options,
.opportunity-library-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 18px);
}

.opportunity-card {
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(210px, 1fr) auto;
  overflow: hidden;
  position: relative;
  text-align: left;
  color: var(--text);
  border: 1px solid rgba(246, 200, 95, 0.34);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 244, 207, 0.1), rgba(6, 8, 12, 0.96)),
    #0c0f16;
  box-shadow:
    inset 0 0 22px rgba(246, 200, 95, 0.06),
    0 18px 40px rgba(0, 0, 0, 0.36);
}

.opportunity-card.interactive {
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.opportunity-card.interactive:hover,
.opportunity-card.interactive:focus-visible {
  outline: none;
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow:
    inset 0 0 26px rgba(246, 200, 95, 0.12),
    0 22px 54px rgba(0, 0, 0, 0.48),
    0 0 34px rgba(246, 200, 95, 0.2);
}

.artifact-dialog {
  background:
    radial-gradient(circle at 50% 42%, rgba(88, 177, 255, 0.16), transparent 42%),
    radial-gradient(circle at 50% 54%, rgba(246, 200, 95, 0.12), transparent 46%),
    rgba(0, 0, 0, 0.72);
}

.artifact-box {
  border-color: rgba(130, 232, 255, 0.5);
  box-shadow:
    0 34px 100px rgba(0, 0, 0, 0.62),
    inset 0 0 36px rgba(130, 232, 255, 0.08);
}

.artifact-card {
  border-color: rgba(130, 232, 255, 0.34);
  box-shadow:
    inset 0 0 22px rgba(130, 232, 255, 0.06),
    0 18px 40px rgba(0, 0, 0, 0.36);
}

.artifact-card.interactive:hover,
.artifact-card.interactive:focus-visible {
  border-color: #82e8ff;
  box-shadow:
    inset 0 0 26px rgba(130, 232, 255, 0.14),
    0 22px 54px rgba(0, 0, 0, 0.48),
    0 0 34px rgba(130, 232, 255, 0.22);
}

.opportunity-art {
  min-height: 210px;
  background:
    linear-gradient(180deg, transparent 62%, rgba(4, 6, 10, 0.72)),
    var(--opportunity-art, none) center / cover no-repeat;
}

.opportunity-copy {
  display: grid;
  gap: 7px;
  padding: 13px 14px 15px;
}

.opportunity-copy strong {
  color: var(--gold);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.1;
}

.opportunity-copy small {
  color: var(--muted);
  line-height: 1.45;
}

.opportunity-library-dialog {
  z-index: 26;
}

.opportunity-library-box {
  width: min(1040px, 100%);
}

.opportunity-library-grid:not(.artifact-library-grid) .opportunity-card {
  grid-template-rows: minmax(clamp(300px, 44vh, 430px), 1fr) auto;
}

.opportunity-library-grid:not(.artifact-library-grid) .opportunity-art {
  min-height: clamp(300px, 44vh, 430px);
  background-position: center 42%;
}

.opportunity-library-note {
  margin-bottom: 14px;
}

.skill-inspect-dialog {
  z-index: 32;
  backdrop-filter: blur(6px);
}

.skill-inspect-box {
  --preview-w: min(420px, calc(100vw - 42px));
  --card-frame-outset-x: clamp(38px, 4.8vh, 58px);
  --card-frame-outset-y: clamp(56px, 7vh, 78px);
  max-height: min(760px, calc(100dvh - 44px));
  background:
    linear-gradient(180deg, rgba(12, 18, 32, 0.78), rgba(5, 7, 13, 0.96) 42%, rgba(5, 7, 12, 0.98)),
    rgba(8, 10, 15, 0.96);
  border: 0;
  box-shadow:
    0 26px 58px rgba(0, 0, 0, 0.5),
    0 0 34px rgba(78, 205, 196, 0.14);
}

.skill-inspect-box::before {
  inset:
    calc(var(--card-frame-outset-y) * -1)
    calc(var(--card-frame-outset-x) * -1);
  z-index: 5;
  opacity: 1;
  background: var(--skill-inspect-frame) center / 100% 100% no-repeat;
  filter:
    drop-shadow(0 0 12px rgba(78, 205, 196, 0.2))
    drop-shadow(0 20px 28px rgba(0, 0, 0, 0.42));
  animation: none;
}

.skill-inspect-box > * {
  z-index: 3;
}

.skill-inspect-box .preview-copy {
  padding-top: clamp(12px, 1.6vh, 16px);
}

.skill-inspect-box .preview-title,
.skill-inspect-box .preview-copy h2 {
  display: block;
}

.skill-inspect-box .preview-title {
  max-width: calc(100% - 78px);
}

.skill-inspect-close {
  position: absolute;
  right: clamp(10px, 1.4vh, 14px);
  top: clamp(10px, 1.4vh, 14px);
  z-index: 8;
  aspect-ratio: 2.38 / 1;
  min-width: 82px;
  min-height: 0;
  display: grid;
  place-items: center;
  isolation: isolate;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  padding: 8px 6px;
  background: var(--room-action-panel-art) center / contain no-repeat;
  color: #fff8df;
  font-size: clamp(11px, 1.45vh, 13px);
  font-weight: 900;
  line-height: 1.05;
  white-space: nowrap;
  box-shadow: none;
  text-shadow:
    0 2px 3px rgba(0, 0, 0, 0.9),
    0 0 12px color-mix(in srgb, var(--teal) 32%, transparent);
}

.skill-inspect-close:hover,
.skill-inspect-close:focus-visible {
  outline: none;
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.skill-inspect-action {
  --fighter-accent: #f6c85f;
}

@media (max-width: 900px) {
  html,
  body {
    overflow: auto;
  }

  .app {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100dvh;
  }

  .arena,
  .side {
    min-height: auto;
    height: auto;
  }

  .lobby-shell {
    grid-template-columns: 1fr;
    width: min(560px, 100%);
  }

  .lobby-copy {
    display: none;
  }

  .lobby-copy > strong {
    font-size: clamp(32px, 8vw, 48px);
  }

  .character-select {
    width: min(760px, 100%);
    justify-self: center;
  }

  .character-select-layout {
    display: block;
  }

  .character-preview {
    width: min(360px, calc(100% - 34px));
    height: min(
      calc(var(--select-card-h) * 2 + var(--select-gap)),
      calc(100dvh - var(--select-shell-frame-y) * 2 - var(--select-padding) * 2 - 96px)
    );
    position: absolute;
    left: 50%;
    top: 50%;
    margin-top: 0;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    transform: translate3d(-50%, -50%, 0);
  }

  .preview-art {
    min-height: 0;
  }
}

@media (max-width: 680px) {
  .app {
    width: min(100%, calc(100% - 12px));
    padding: 6px 0 12px;
    gap: 8px;
  }

  .arena {
    padding: 8px;
    gap: 8px;
    overflow: visible;
  }

  .topbar,
  .status-line,
  .battle-status {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar {
    gap: 7px;
  }

  .app:not(.solo) h1 {
    font-size: clamp(22px, 6.4vw, 26px);
    line-height: 1.08;
  }

  .app:not(.solo) #subtitle {
    font-size: 12px;
  }

  .app:not(.solo) .room-pill,
  .room-pill {
    gap: 7px;
    padding: 7px 8px;
  }

  .room-pill strong,
  .app:not(.solo) .room-pill strong {
    font-size: 19px;
    letter-spacing: 1px;
  }

  .room-pill button {
    min-height: 36px;
    padding: 7px 10px;
  }

  .battle {
    grid-template-rows: auto auto auto;
    gap: 8px;
    overflow: auto;
  }

  .battle::before {
    top: 39%;
    width: min(440px, 120%);
    opacity: 0.3;
  }

  .fighters {
    --fighter-gap: 8px;
    --fighter-inner-gap: 6px;
    --combatant-pad: 0px;
    --combatant-frame-outset-x: 0px;
    --combatant-frame-outset-y: 0px;
    --fighter-panel-w: 100%;
    --fighter-card-w: 100%;
    --fighter-card-h: auto;
    --versus-size: 42px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--versus-size) minmax(0, 1fr);
    width: 100%;
    height: auto;
    margin-top: 0;
    align-items: stretch;
    justify-content: stretch;
  }

  .combatant,
  .opponent-combatant {
    height: auto;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(285px, 43vh) auto;
    gap: 6px;
    padding: 0;
  }

  .combatant::before {
    display: none;
  }

  .combatant::after {
    inset: 0;
    border-radius: 8px;
    opacity: 0.72;
  }

  .you-panel,
  .opponent-panel {
    order: 2;
  }

  .fighter.you,
  .fighter.opponent {
    order: 1;
  }

  .fighter-panel {
    height: auto;
    min-height: 0;
    grid-template-rows: auto auto auto auto auto auto;
    align-content: start;
    gap: 5px;
    padding: 6px;
    overflow: hidden;
  }

  .fighter-panel .status-bar {
    order: 1;
  }

  .fighter-panel .equipment-slots {
    order: 2;
  }

  .fighter-panel .meter-row {
    order: 3;
  }

  .fighter-panel .energy {
    order: 4;
  }

  .fighter-panel .fatigue-row {
    order: 5;
  }

  .fighter-panel .choice {
    order: 6;
  }

  .fighter {
    min-height: 0;
    height: 100%;
    padding: 6px;
    gap: 5px;
    border-radius: 8px;
  }

  .fighter::before {
    inset: 4px;
  }

  .fighter-head {
    min-height: 26px;
    gap: 4px;
    padding: 4px 6px;
    font-size: 10px;
  }

  .fighter-head strong {
    min-width: 0;
    overflow: hidden;
    font-size: 14px;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .fighter-side {
    gap: 4px;
  }

  .character-face {
    min-height: 0;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .avatar {
    min-height: 0;
    background-position: var(--art-position, center 30%), center, center;
  }

  .role-card {
    min-height: 36px;
    padding: 7px 6px;
  }

  .role-card > span {
    font-size: 10px;
    line-height: 1.2;
  }

  .skill-label {
    width: 100%;
  }

  .inline-skill-name,
  .inline-skill-action {
    max-width: 100%;
    min-height: 23px;
    padding: 3px 7px;
    font-size: 10px;
  }

  .inline-skill-cooldown {
    min-height: 17px;
    padding: 2px 5px;
    font-size: 9px;
  }

  .skill-label.has-tooltip::after {
    max-width: min(260px, calc(100vw - 24px));
  }

  .battle-card-inscription {
    right: 6px;
    bottom: 42px;
    width: 78px;
    gap: 5px;
  }

  .battle-card-inscription small {
    padding: 3px 6px;
    font-size: 9px;
  }

  .battle-card-inscription strong {
    font-size: 18px;
  }

  .fighter-panel .meter-row {
    grid-template-columns: 1fr auto;
    gap: 5px;
    min-height: 27px;
    padding: 4px 6px;
    font-size: 11px;
  }

  .fighter-panel .meter-row > b {
    font-size: 15px;
  }

  .fighter-panel .meter {
    height: 8px;
  }

  .stat-label {
    gap: 3px;
  }

  .stat-label-icon {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
    border-radius: 6px;
  }

  .energy,
  .fatigue,
  .laziness {
    grid-template-columns: minmax(52px, 58px) minmax(0, 1fr);
    --stat-mark-size: 10px;
    min-height: 22px;
    gap: 3px 4px;
    padding: 2px 5px;
  }

  .energy > .stat-label,
  .fatigue > .stat-label,
  .laziness > .stat-label {
    font-size: 11px;
  }

  .stat-marks {
    gap: 2px 3px;
  }

  .fighter-panel .fatigue-row {
    grid-template-columns: 1fr;
    gap: 5px;
    min-height: 0;
    padding: 0;
    background: transparent;
    font-size: 10px;
  }

  .fighter-panel .energy i,
  .fighter-panel .fatigue i,
  .fighter-panel .laziness i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
  }

  .status-bar {
    min-height: 24px;
    gap: 4px;
    padding: 2px;
  }

  .fighter-panel .status-bar:not(.has-status) {
    display: none;
  }

  .equipment-slots {
    min-height: 39px;
    gap: 4px;
    padding: 4px;
  }

  .equipment-slot {
    min-height: 31px;
    border-radius: 6px;
    font-size: 16px;
  }

  .equipment-slot b {
    display: none;
  }

  .status-token {
    max-width: 118px;
    height: 24px;
    gap: 4px;
    padding: 2px 7px 2px 2px;
  }

  .status-token i {
    width: 20px;
    height: 20px;
    border-radius: 6px;
  }

  .status-token b {
    font-size: 9px;
  }

  .choice {
    min-height: 18px;
    padding: 0 5px;
    font-size: 11px;
    line-height: 1.25;
  }

  .versus {
    align-self: start;
    width: var(--versus-size);
    height: var(--versus-size);
    margin-top: clamp(126px, 22vh, 166px);
    font-size: 18px;
    text-align: center;
  }

  .versus::before {
    inset: -10px;
  }

  .versus::after {
    inset: -5px;
  }

  .battle.team-mode .team-board {
    min-height: 780px;
    overflow: visible;
  }

  .seat-ring {
    --seat-size: clamp(142px, 27vw, 166px);
    --seat-card-h: clamp(184px, 27vh, 210px);
    --seat-art-h: clamp(76px, 12vh, 94px);
    width: min(680px, calc(100% - 8px));
    height: 650px;
  }

  .seat-ring[data-seats="6"] {
    --seat-size: clamp(134px, 25vw, 158px);
    --seat-card-h: clamp(172px, 26vh, 198px);
    --seat-art-h: clamp(70px, 11vh, 86px);
  }

  .seat-ring[data-seats="10"] {
    --seat-size: clamp(96px, 18vw, 116px);
    --seat-card-h: clamp(136px, 22vh, 164px);
    --seat-art-h: clamp(52px, 9vh, 68px);
  }

  .seat-fighter {
    min-height: var(--seat-card-h);
    height: var(--seat-card-h);
    grid-template-rows: var(--seat-art-h) minmax(0, 1fr);
  }

  .seat-fighter .team-art {
    min-height: 0;
    height: var(--seat-art-h);
  }

  .seat-fighter .team-info {
    gap: 3px;
    padding: 4px;
  }

  .seat-fighter .team-choice {
    display: none;
  }

  .seat-fighter .team-mini-row {
    grid-template-columns: 25px minmax(0, 1fr) 20px;
    font-size: 9px;
  }

  .seat-fighter .team-stat {
    --stat-mark-size: 5px;
    grid-template-columns: 42px minmax(0, 1fr);
    min-height: 15px;
    padding: 1px 3px;
  }

  .seat-fighter .team-stat > .stat-label {
    gap: 2px;
    font-size: 8px;
  }

  .seat-fighter .team-stat .stat-label-icon {
    width: 10px;
    height: 10px;
    flex-basis: 10px;
  }

  .seat-fighter .team-stat .stat-marks {
    justify-content: end;
    gap: 2px;
  }

  .seat-fighter .team-status-bar {
    min-height: 20px;
    max-height: 28px;
  }

  .seat-fighter .team-equipment {
    min-height: 22px;
  }

  .seat-fighter .team-equipment .equipment-slot {
    min-height: 18px;
  }

  .seat-ring[data-seats="6"] .seat-fighter {
    min-height: var(--seat-card-h);
    height: var(--seat-card-h);
    grid-template-rows: var(--seat-art-h) minmax(0, 1fr);
  }

  .seat-ring[data-seats="6"] .seat-fighter .team-art {
    min-height: 0;
    height: var(--seat-art-h);
  }

  .seat-ring[data-seats="10"] .seat-fighter {
    min-height: var(--seat-card-h);
    height: var(--seat-card-h);
    grid-template-rows: var(--seat-art-h) minmax(0, 1fr);
  }

  .seat-ring[data-seats="10"] .seat-fighter .team-art {
    min-height: 0;
    height: var(--seat-art-h);
  }

  .seat-ring[data-seats="10"] .seat-fighter .team-choice {
    display: none;
  }

  .cards {
    width: 100%;
    gap: 7px;
    padding-right: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .action-card {
    min-height: 54px;
    padding: 0;
  }

  .action-card::after {
    content: none;
  }

  .action-icon {
    display: none;
  }

  .action-icon svg {
    width: 14px;
    height: 14px;
  }

  .action-card span {
    font-size: 14px;
  }

  .battle-libraries {
    width: min(100%, 320px);
    grid-auto-rows: 36px;
  }

  .battle-libraries .library-action {
    min-height: 36px;
  }

  .utility {
    position: static;
    flex-direction: column;
    align-items: stretch;
  }

  .utility button {
    min-height: 42px;
  }

  .cards,
  .control-actions,
  .opportunity-options,
  .opportunity-library-grid,
  .lobby-actions,
  .rules-points {
    grid-template-columns: 1fr;
  }

  .app.solo .lobby-actions > #createBotRoom,
  .app.solo .lobby-actions > #showRules {
    min-height: clamp(128px, 15.6vh, 146px);
    background-size: auto 106%;
  }

  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .side {
    gap: 8px;
  }

  .side section {
    padding: 10px;
  }

  .side section:first-child {
    grid-template-rows: auto auto minmax(0, 210px);
    gap: 8px;
    max-height: 330px;
  }

  .side .rules {
    display: none;
  }

  .battle-status {
    min-height: 0;
    padding: 8px 10px;
  }

  .battle-status strong {
    text-align: left;
  }

  .log {
    gap: 7px;
  }

  .log article {
    padding: 8px 9px;
  }

  .character-preview {
    grid-template-columns: 1fr;
  }

  .character-select,
  .character-select.preview-open {
    --select-gap: clamp(8px, 2.2vw, 12px);
    --select-frame-outset-x: clamp(10px, 3vw, 14px);
    --select-frame-outset-y: clamp(16px, 4.2vw, 22px);
    --select-shell-frame-x: clamp(28px, 7vw, 44px);
    --select-shell-frame-y: clamp(42px, 9vw, 62px);
    --select-padding: clamp(9px, 2.4vw, 12px);
    --select-card-outer-w: min(42vw, 168px);
    --select-card-w: calc(var(--select-card-outer-w) - var(--select-frame-outset-x) * 2);
    --select-card-h: calc(var(--select-card-w) * 7 / 5);
    --select-card-outer-h: calc(var(--select-card-h) + var(--select-frame-outset-y) * 2);
    --preview-w: min(86vw, 360px);
    width: min(
      calc(var(--select-card-outer-w) * 2 + var(--select-gap) + var(--select-padding) * 2),
      calc(100% - 10px)
    );
  }

  .character-scroll {
    max-height: min(
      calc(var(--select-card-outer-h) * 3 + var(--select-gap) * 2),
      calc(100dvh - var(--select-shell-frame-y) * 2 - var(--select-padding) * 2 - 104px)
    );
    scrollbar-gutter: stable both-edges;
  }

  .character-options {
    grid-template-columns: repeat(2, var(--select-card-outer-w));
    grid-auto-rows: var(--select-card-outer-h);
  }

  .character-preview {
    width: min(var(--preview-w), calc(100% - 24px));
    height: min(
      calc(var(--select-card-outer-h) * 2 + var(--select-gap)),
      calc(100dvh - var(--select-shell-frame-y) * 2 - var(--select-padding) * 2 - 84px)
    );
  }

  #characterPreview {
    --card-frame-outset-x: clamp(20px, 5vw, 30px);
    --card-frame-outset-y: clamp(30px, 7vw, 44px);
    width: min(var(--preview-w), calc(100% - var(--card-frame-outset-x) * 2 - 18px));
    top: 50%;
    height: auto;
    max-height: calc(100dvh - var(--card-frame-outset-y) * 2 - 48px);
  }
}

@media (max-width: 430px) {
  .fighters {
    --fighter-gap: 6px;
    --versus-size: 40px;
  }

  .combatant,
  .opponent-combatant {
    grid-template-rows: minmax(270px, 41vh) auto;
  }

  .fighter-panel {
    padding: 5px;
  }

  .battle-card-inscription {
    width: 70px;
  }

  .battle-card-inscription strong {
    font-size: 17px;
  }
}
