:root {
  color-scheme: dark;
  --bg: #111217;
  --panel: #20242b;
  --line: rgba(255, 255, 255, 0.13);
  --text: #f5f1e8;
  --muted: #bdc3cb;
  --red: #f05a50;
  --blue: #4aa7ff;
  --gold: #f0c86a;
  --steel: #aab4c0;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 2%, rgba(240, 200, 106, 0.18), transparent 34%),
    linear-gradient(90deg, rgba(240, 90, 80, 0.2), transparent 30%, transparent 70%, rgba(74, 167, 255, 0.18)),
    #111217;
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.game-shell {
  width: min(1220px, 100vw);
  height: min(820px, 100dvh);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  padding: 14px;
  position: relative;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.fighter-panel,
.round-panel,
.controls {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(32, 36, 43, 0.93);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.3);
}

.fighter-panel {
  padding: 10px 12px;
}

.name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.name-row strong {
  font-size: clamp(16px, 2.5vw, 24px);
  white-space: nowrap;
}

.name-row span {
  min-width: 34px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold);
  font-weight: 900;
}

.bar {
  height: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
}

.bar + .bar {
  margin-top: 7px;
}

.bar i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  transition: width 120ms ease;
}

.hp i {
  background: linear-gradient(90deg, #da3f45, #f0c86a);
}

.energy {
  height: 10px;
}

.energy i {
  background: linear-gradient(90deg, #52d7ff, #846cff);
}

.azure {
  text-align: right;
}

.round-panel {
  display: grid;
  place-items: center;
  padding: 8px;
  text-align: center;
}

.round-panel strong {
  display: block;
  color: var(--gold);
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1;
}

.round-panel span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

#game {
  width: 100%;
  height: 100%;
  min-height: 430px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #1b2028;
  box-shadow: 0 22px 62px rgba(0, 0, 0, 0.42);
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.controls b {
  color: var(--text);
}

button {
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--gold);
  color: #171717;
  font-weight: 900;
  cursor: pointer;
}

button:active {
  transform: translateY(1px);
}

.select-screen {
  position: absolute;
  inset: 14px;
  z-index: 5;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(9, 11, 16, 0.74);
  backdrop-filter: blur(6px);
}

.select-screen.hidden {
  display: none;
}

.select-panel {
  width: min(860px, calc(100vw - 38px));
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(29, 34, 43, 0.96);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
  padding: 18px;
}

.select-panel header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.select-panel header strong {
  color: var(--gold);
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1;
}

.select-panel header span {
  color: var(--muted);
  font-size: 14px;
}

.select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.select-side {
  min-width: 0;
}

.select-side h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.choice-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.choice {
  height: auto;
  min-height: 124px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #242a34;
  color: var(--text);
  text-align: left;
}

.choice b {
  font-size: 22px;
}

.choice span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.choice.active {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(240, 200, 106, 0.26), rgba(74, 167, 255, 0.16)), #242a34;
  box-shadow: inset 0 0 0 1px rgba(240, 200, 106, 0.28);
}

.start-btn {
  width: 100%;
  margin-top: 16px;
  height: 48px;
  font-size: 17px;
}

@media (max-width: 820px) {
  body {
    overflow: auto;
  }

  .game-shell {
    height: auto;
    min-height: 100dvh;
  }

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

  .round-panel {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  #game {
    min-height: 460px;
  }

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

  .select-grid,
  .choice-row {
    grid-template-columns: 1fr;
  }

  .select-panel header {
    display: block;
  }

  .select-panel header span {
    display: block;
    margin-top: 8px;
  }
}
