:root {
  color-scheme: light;
  --bg: #08111f;
  --ink: #f8fbff;
  --muted: #9badc8;
  --panel: rgba(10, 24, 45, 0.92);
  --line: rgba(125, 166, 220, 0.26);
  --navy: #0d2240;
  --blue: #28a3ff;
  --sky: #1fd5ff;
  --orange: #ffb02e;
  --flame: #ff5a36;
  --red: #ff3154;
  --green: #39d98a;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(40, 163, 255, 0.24), transparent 28%),
    radial-gradient(circle at 84% 18%, rgba(255, 176, 46, 0.18), transparent 26%),
    radial-gradient(circle at 50% 100%, rgba(255, 49, 84, 0.14), transparent 30%),
    linear-gradient(180deg, #0a1527, #050914 68%),
    var(--bg);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  touch-action: manipulation;
}

.app-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 34px;
}

.brand-hero {
  display: grid;
  grid-template-columns: minmax(180px, 360px) 1fr auto;
  gap: 22px;
  align-items: center;
  min-height: 150px;
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(13, 34, 64, 0.96), rgba(8, 17, 31, 0.94));
  box-shadow: var(--shadow);
}

.brand-hero img {
  width: 100%;
  max-height: 116px;
  object-fit: contain;
  object-position: left center;
}

.eyebrow,
h1,
h2,
p {
  margin: 0;
}

.eyebrow {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
}

h1 {
  margin-top: 4px;
  font-size: clamp(2.6rem, 7vw, 6.4rem);
  line-height: 0.92;
  color: #ffffff;
  text-shadow: 0 0 22px rgba(31, 213, 255, 0.34);
}

.hero-subtitle {
  margin-top: 10px;
  color: var(--muted);
  font-size: clamp(0.95rem, 2vw, 1.12rem);
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(4, 11, 22, 0.82);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
  white-space: nowrap;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
}

.status-pill.is-live .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(21, 128, 61, 0.15);
}

.status-pill.is-warn .status-dot {
  background: var(--orange);
  box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.18);
}

.status-pill.is-foul .status-dot {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(199, 33, 47, 0.18);
}

.control-strip,
.arena-grid,
.status-grid,
.settings-grid {
  display: grid;
  gap: 12px;
}

.control-strip {
  grid-template-columns: minmax(460px, 1.42fr) minmax(240px, 0.76fr) minmax(220px, 0.68fr) auto auto;
  align-items: end;
  margin-bottom: 12px;
}

.mode-control,
.control,
.fighter-card,
.battle-center,
.stat,
.chart-panel,
.settings-grid,
.rule-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.mode-control,
.control {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.control-strip .mode-control {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 18, 35, 0.9);
}

.mode-control legend,
.control label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 11, 22, 0.72);
}

.mode-control:first-child .segmented {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.mode-control:nth-child(2) .segmented {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.segmented label {
  margin: 0;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  min-height: 38px;
  place-items: center;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
  cursor: pointer;
}

.segmented input:checked + span {
  background: linear-gradient(135deg, var(--blue), var(--sky));
  color: #fff;
  box-shadow: 0 0 22px rgba(40, 163, 255, 0.3);
}

.arena-grid {
  grid-template-columns: minmax(230px, 0.78fr) minmax(360px, 1.18fr) minmax(230px, 0.78fr);
  align-items: stretch;
}

.competition-individual .arena-grid {
  grid-template-columns: minmax(250px, 0.82fr) minmax(420px, 1.18fr);
}

.competition-individual .red-side {
  display: none;
}

.fighter-card,
.battle-center {
  box-shadow: var(--shadow);
  background: linear-gradient(180deg, rgba(12, 27, 51, 0.96), rgba(7, 15, 29, 0.96));
}

.fighter-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 12px;
  min-height: 520px;
  padding: 18px;
  overflow: hidden;
}

.fighter-card.is-active {
  outline: 4px solid rgba(255, 176, 46, 0.5);
  box-shadow:
    var(--shadow),
    0 0 34px rgba(255, 176, 46, 0.28);
}

.blue-side {
  border-top: 8px solid var(--blue);
}

.red-side {
  border-top: 8px solid var(--red);
}

.fighter-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
}

.belt-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 1000;
}

.blue-side .belt-mark {
  background: var(--blue);
}

.red-side .belt-mark {
  background: var(--red);
}

.fighter-card input[type="text"] {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(4, 11, 22, 0.72);
  color: #fff;
  font-size: 1.12rem;
  font-weight: 1000;
}

.score-value {
  align-self: center;
  display: block;
  color: #fff;
  text-shadow:
    0 0 18px rgba(40, 163, 255, 0.42),
    0 0 34px rgba(255, 176, 46, 0.14);
  font-size: clamp(4.6rem, 12vw, 8.5rem);
  font-weight: 1000;
  line-height: 0.86;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.fighter-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.fighter-meta span {
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 11, 22, 0.5);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.fighter-meta strong {
  display: block;
  margin-top: 3px;
  color: #fff;
  font-size: 1.05rem;
}

.attempt-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 112px;
  max-height: 156px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.attempt-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(4, 11, 22, 0.66);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.attempt-list strong {
  color: var(--navy);
}

.battle-center {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 14px;
  min-height: 520px;
  padding: 18px;
}

.round-banner {
  display: grid;
  min-height: 58px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(18, 99, 166, 0.96), rgba(255, 176, 46, 0.92), rgba(255, 49, 84, 0.9));
  color: #fff;
  font-size: clamp(1.6rem, 4vw, 3.2rem);
  font-weight: 1000;
  letter-spacing: 0;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.42);
}

.round-banner.is-grade-gold {
  background: linear-gradient(90deg, #f59e0b, #ffe08a, #ff6a2a);
  color: #1c1300;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.72);
  animation: medal-banner 1400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.round-banner.is-grade-silver {
  background: linear-gradient(90deg, #94a3b8, #f8fbff, #38bdf8);
  color: #08111f;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.62);
  animation: medal-banner 1400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.round-banner.is-grade-bronze {
  background: linear-gradient(90deg, #a8551d, #f59e0b, #ff5a36);
  color: #fff8ec;
  animation: medal-banner 1400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.meter {
  position: relative;
  align-self: center;
  justify-self: center;
  width: min(100%, 440px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 47%, transparent 48%),
    conic-gradient(
      from 230deg,
      var(--green) 0deg,
      var(--sky) calc(var(--level) * 1.05deg),
      var(--orange) calc(var(--level) * 1.62deg),
      var(--flame) calc(var(--level) * 2.1deg),
      #e6ecf3 calc(var(--level) * 2.36deg),
      #e6ecf3 260deg,
      transparent 260deg 360deg
    );
  box-shadow:
    inset 0 0 0 1px rgba(13, 34, 64, 0.09),
    inset 0 -16px 40px rgba(13, 34, 64, 0.08);
}

.meter::before {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  border: 1px solid rgba(13, 34, 64, 0.09);
}

.meter-scale {
  position: absolute;
  inset: 14px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 1000;
}

.meter-scale span {
  position: absolute;
}

.meter-scale span:nth-child(1) {
  left: 14%;
  bottom: 20%;
}

.meter-scale span:nth-child(2) {
  left: 21%;
  top: 18%;
}

.meter-scale span:nth-child(3) {
  right: 18%;
  top: 18%;
}

.meter-scale span:nth-child(4) {
  right: 14%;
  bottom: 20%;
}

.needle {
  position: absolute;
  bottom: 50%;
  left: 50%;
  z-index: 2;
  width: 4px;
  height: 37%;
  border-radius: 999px;
  background: #101828;
  transform: translateX(-50%) rotate(-118deg);
  transform-origin: 50% 100%;
  transition: transform 100ms ease-out;
}

.needle::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -14px;
  width: 25px;
  height: 25px;
  border: 5px solid #101828;
  border-radius: 50%;
  background: #fff;
  transform: translateX(-50%);
}

.meter-core {
  position: relative;
  z-index: 3;
  width: 50%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px solid rgba(13, 34, 64, 0.1);
  border-radius: 50%;
  background: radial-gradient(circle at center, #101c31, #07101f);
}

.current-label {
  max-width: 82%;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 1000;
  text-align: center;
  overflow-wrap: anywhere;
}

.db-value {
  font-size: clamp(3rem, 8vw, 5.8rem);
  font-weight: 1000;
  line-height: 0.88;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.db-unit {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
}

.score-live {
  margin-top: 6px;
  color: var(--orange);
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-variant-numeric: tabular-nums;
}

.result-line {
  min-height: 48px;
  display: grid;
  place-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 11, 22, 0.68);
  color: #fff;
  font-weight: 900;
  text-align: center;
}

.result-line.is-grade-result {
  min-height: 72px;
  border-width: 2px;
  color: #fff;
  font-size: clamp(1.05rem, 2.6vw, 1.55rem);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 0 30px rgba(255, 176, 46, 0.18);
  animation: result-pulse 1500ms ease-out;
}

.result-line.is-grade-gold {
  border-color: rgba(255, 224, 138, 0.86);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.92), rgba(255, 90, 54, 0.34));
}

.result-line.is-grade-silver {
  border-color: rgba(248, 251, 255, 0.86);
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.9), rgba(40, 163, 255, 0.3));
}

.result-line.is-grade-bronze {
  border-color: rgba(245, 158, 11, 0.74);
  background: linear-gradient(135deg, rgba(168, 85, 29, 0.9), rgba(255, 90, 54, 0.3));
}

.grade-track {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.competition-grade .grade-track {
  display: grid;
}

.grade-track span {
  min-height: 54px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 1000;
  text-align: center;
}

.grade-track strong {
  display: block;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.76rem;
}

.grade-bronze {
  background: linear-gradient(135deg, rgba(168, 85, 29, 0.9), rgba(255, 90, 54, 0.38));
}

.grade-silver {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.88), rgba(40, 163, 255, 0.28));
}

.grade-gold {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.92), rgba(255, 176, 46, 0.36));
}

.action-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.primary-button,
.secondary-button,
.icon-button,
.mini-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 1000;
}

.primary-button {
  min-height: 56px;
  background: linear-gradient(135deg, var(--orange), #ff6a2a);
  color: #151923;
  font-size: 1.05rem;
}

.primary-button:disabled,
.secondary-button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.secondary-button,
.icon-button,
.mini-button {
  min-height: 48px;
  border: 1px solid var(--line);
  background: rgba(4, 11, 22, 0.7);
  color: #fff;
}

.icon-button {
  width: 54px;
  font-size: 1.45rem;
}

.status-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
}

.stat {
  padding: 14px;
  background: linear-gradient(180deg, rgba(12, 27, 51, 0.92), rgba(6, 14, 27, 0.92));
}

.stat span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.stat strong {
  display: block;
  color: #fff;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-variant-numeric: tabular-nums;
}

.chart-panel,
.settings-grid,
.rule-panel {
  margin-top: 12px;
  padding: 16px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-title span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
}

canvas {
  display: block;
  width: 100%;
  height: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 11, 22, 0.72);
}

.settings-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.range-line,
.stepper-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

input[type="range"] {
  min-width: 0;
  width: 100%;
  accent-color: var(--blue);
}

.range-line output {
  width: 64px;
  color: #fff;
  font-weight: 1000;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.stepper-line input {
  width: 70px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--navy);
  font-weight: 1000;
  text-align: center;
}

.mini-button {
  width: 42px;
  font-size: 1.2rem;
}

.stepper-line span {
  color: var(--muted);
  font-weight: 900;
}

.rule-panel h2 {
  margin-bottom: 10px;
}

.rule-panel ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
  text-align: center;
}

.mode-lobby {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 10%, rgba(40, 163, 255, 0.24), transparent 30%),
    radial-gradient(circle at 82% 22%, rgba(255, 176, 46, 0.2), transparent 26%),
    linear-gradient(180deg, rgba(5, 9, 20, 0.96), rgba(3, 7, 15, 0.98));
}

.show-lobby .mode-lobby {
  display: grid;
}

.show-lobby .app-shell {
  display: none;
}

.lobby-panel {
  width: min(1120px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(13, 34, 64, 0.94), rgba(6, 13, 27, 0.94));
  box-shadow: var(--shadow);
}

.lobby-panel img {
  display: block;
  width: min(360px, 82%);
  max-height: 116px;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 20px;
}

.lobby-panel h1 {
  margin-bottom: 24px;
  font-size: clamp(3.4rem, 12vw, 8.4rem);
}

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

.mode-card {
  min-height: 190px;
  padding: 18px;
  border: 1px solid rgba(125, 166, 220, 0.28);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(8, 23, 46, 0.95), rgba(5, 12, 25, 0.95));
  color: #fff;
  text-align: left;
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.22);
}

.mode-card span {
  display: block;
  color: var(--sky);
  font-size: 0.8rem;
  font-weight: 1000;
}

.mode-card strong {
  display: block;
  margin-top: 14px;
  font-size: clamp(1.55rem, 3vw, 2.4rem);
  line-height: 1.05;
}

.mode-card.is-featured,
.mode-card:hover {
  border-color: rgba(255, 176, 46, 0.8);
  background: linear-gradient(145deg, rgba(18, 99, 166, 0.88), rgba(255, 176, 46, 0.28));
  transform: translateY(-2px);
}

.screen-flash,
.cue-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 24;
}

.screen-flash {
  opacity: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.92), transparent 58%);
}

.screen-flash.is-flashing {
  animation: flash-screen 540ms ease-out;
}

.cue-overlay {
  display: none;
  place-items: center;
}

.cue-overlay.is-showing {
  display: grid;
}

.cue-overlay span {
  padding: 0 28px;
  color: #fff;
  font-size: clamp(4rem, 18vw, 13rem);
  font-weight: 1000;
  line-height: 0.9;
  text-align: center;
  white-space: pre-line;
  text-shadow:
    0 0 26px rgba(31, 213, 255, 0.8),
    0 0 60px rgba(255, 176, 46, 0.42);
}

.cue-overlay.is-ready span {
  animation: ready-pop 760ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.cue-overlay.is-go span {
  animation: go-burst 720ms cubic-bezier(0.16, 1, 0.3, 1);
}

.cue-overlay.is-medal {
  z-index: 36;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.16), transparent 34%),
    rgba(1, 6, 14, 0.42);
}

.cue-overlay.is-medal span {
  padding: 22px 34px;
  border: 2px solid rgba(255, 255, 255, 0.44);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(13, 34, 64, 0.92), rgba(3, 8, 18, 0.82));
  color: #fff;
  font-size: clamp(4.7rem, 15vw, 13.8rem);
  line-height: 0.96;
  box-shadow:
    0 0 0 10px rgba(255, 176, 46, 0.12),
    0 0 80px rgba(31, 213, 255, 0.36),
    0 0 120px rgba(255, 176, 46, 0.34);
  text-shadow:
    0 0 4px rgba(255, 255, 255, 0.9),
    0 0 26px rgba(255, 176, 46, 0.92),
    0 0 72px rgba(31, 213, 255, 0.64);
  animation: medal-burst 1800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.battle-center.is-shaking {
  animation: arena-shake 420ms ease-out;
}

@keyframes ready-pop {
  0% {
    opacity: 0;
    transform: scale(0.76);
  }
  34% {
    opacity: 1;
    transform: scale(1.08);
  }
  100% {
    opacity: 0;
    transform: scale(1.18);
  }
}

@keyframes go-burst {
  0% {
    opacity: 0;
    transform: scale(0.42) rotate(-2deg);
  }
  24% {
    opacity: 1;
    transform: scale(1.18) rotate(1deg);
  }
  100% {
    opacity: 0;
    transform: scale(1.55) rotate(0deg);
  }
}

@keyframes medal-burst {
  0% {
    opacity: 0;
    transform: scale(0.24) rotate(-3deg);
    filter: saturate(1.8);
  }
  16% {
    opacity: 1;
    transform: scale(1.18) rotate(1deg);
  }
  38% {
    transform: scale(0.96) rotate(0deg);
  }
  72% {
    opacity: 1;
    transform: scale(1.03);
  }
  100% {
    opacity: 0;
    transform: scale(1.28);
  }
}

@keyframes medal-banner {
  0% {
    transform: scale(0.92);
    filter: brightness(1.55);
  }
  38% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes result-pulse {
  0% {
    transform: scale(0.98);
    filter: brightness(1.45);
  }
  35% {
    transform: scale(1.025);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes flash-screen {
  0% {
    opacity: 0;
  }
  18% {
    opacity: 0.75;
  }
  100% {
    opacity: 0;
  }
}

@keyframes arena-shake {
  0%,
  100% {
    transform: translate(0, 0);
  }
  20% {
    transform: translate(5px, -3px);
  }
  42% {
    transform: translate(-4px, 3px);
  }
  64% {
    transform: translate(3px, 2px);
  }
}

.screen-dojang .app-shell {
  width: min(1600px, calc(100% - 36px));
}

.screen-dojang .brand-hero {
  grid-template-columns: 420px 1fr auto;
}

.screen-dojang .arena-grid {
  grid-template-columns: minmax(280px, 0.74fr) minmax(560px, 1.28fr) minmax(280px, 0.74fr);
}

.screen-dojang.competition-individual .arena-grid {
  grid-template-columns: minmax(330px, 0.78fr) minmax(680px, 1.22fr);
}

.screen-dojang .fighter-card,
.screen-dojang .battle-center {
  min-height: 650px;
}

.screen-dojang .meter {
  width: min(100%, 560px);
}

.screen-dojang canvas {
  height: 250px;
}

button:focus-visible,
input:focus-visible,
.segmented span:focus-visible {
  outline: 3px solid rgba(18, 99, 166, 0.28);
  outline-offset: 3px;
}

@media (max-width: 1040px) {
  .brand-hero {
    grid-template-columns: minmax(160px, 300px) 1fr;
  }

  .status-pill {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .control-strip,
  .arena-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .mode-control:first-child .segmented,
  .mode-control:nth-child(2) .segmented,
  .lobby-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fighter-card {
    min-height: auto;
  }

  .battle-center {
    min-height: auto;
    order: -1;
  }

  .status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .attempt-list {
    max-height: 140px;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 22px, 1280px);
    padding-top: 12px;
  }

  .brand-hero {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
  }

  .brand-hero img {
    max-height: 86px;
  }

  h1 {
    font-size: 3.1rem;
  }

  .control-strip .mode-control {
    padding: 10px;
  }

  .meter {
    width: min(100%, 330px);
  }

  .db-value {
    font-size: 3.2rem;
  }

  .action-row {
    grid-template-columns: 1fr 54px;
  }

  .status-grid {
    gap: 8px;
  }

  .stat {
    padding: 12px;
  }

  canvas {
    height: 180px;
  }

  .rule-panel ul {
    font-size: 0.86rem;
  }

  .mode-control:first-child .segmented,
  .mode-control:nth-child(2) .segmented,
  .grade-track {
    grid-template-columns: 1fr;
  }

  .lobby-panel {
    padding: 18px;
  }

  .lobby-grid {
    grid-template-columns: 1fr;
  }

  .mode-card {
    min-height: 112px;
  }
}
