:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  background: #101218;
  color: #f5f6fa;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  background: radial-gradient(circle at top right, rgba(111, 76, 255, .24), transparent 34rem), #101218;
}
.shell { width: min(1040px, calc(100% - 32px)); margin: 0 auto; padding: 54px 0; }
.hero { margin-bottom: 24px; }
.eyebrow { color: #ab9aff; text-transform: uppercase; letter-spacing: .15em; font-size: .72rem; margin: 0 0 8px; }
h1 { margin: 0 0 10px; font-size: clamp(2.1rem, 5vw, 4.4rem); letter-spacing: -.04em; }
h2 { margin: 0; font-size: 1.2rem; }
p { color: #b8beca; line-height: 1.55; }
.panel { margin-top: 16px; padding: 20px; border: 1px solid #2e3442; border-radius: 18px; background: rgba(25, 28, 37, .9); box-shadow: 0 18px 50px rgba(0, 0, 0, .2); }
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { display: grid; gap: 8px; color: #cbd0da; font-size: .86rem; }
input { width: 100%; padding: 12px 14px; border: 1px solid #3b4252; border-radius: 10px; background: #11141b; color: #f5f6fa; font: inherit; }
button { padding: 11px 14px; border: 0; border-radius: 10px; background: #765cff; color: white; font: inherit; font-weight: 750; cursor: pointer; }
button:disabled { opacity: .42; cursor: not-allowed; }
button.secondary { background: #343a49; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.status, .caption { font-size: .87rem; margin: 14px 0 0; }
.scoreboard { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: stretch; margin-top: 16px; }
.player-card { min-width: 0; padding: 22px; border: 1px solid #37634b; border-radius: 18px; background: linear-gradient(150deg, rgba(31, 75, 52, .95), rgba(18, 35, 28, .96)); }
.player-card--red { border-color: #754448; background: linear-gradient(150deg, rgba(102, 43, 48, .95), rgba(42, 23, 28, .96)); }
.player-card.is-lost { filter: grayscale(.7); opacity: .7; }
.player-card__heading, .panel-heading { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.player-label { margin: 0 0 4px; color: #c7d0cc; font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; }
.player-card h2 { font-size: 1.5rem; }
.badge { padding: 6px 8px; border-radius: 999px; background: rgba(152, 255, 184, .14); color: #a8f8bd; font-size: .65rem; font-weight: 800; letter-spacing: .08em; }
.badge--lost { background: rgba(255, 160, 160, .16); color: #ffb0b0; }
.life-line { display: flex; align-items: baseline; gap: 8px; margin-top: 26px; }
.life-line strong { font-size: clamp(4rem, 9vw, 6.6rem); line-height: .9; letter-spacing: -.08em; }
.life-line span { color: #bdc8c0; font-size: 1rem; }
.guards { display: flex; gap: 8px; margin-top: 22px; }
.guard { position: relative; height: 56px; flex: 1; overflow: hidden; border: 1px solid #6f9b7d; border-radius: 7px; background: rgba(0, 0, 0, .25); }
.player-card--red .guard { border-color: #b67778; }
.guard span { position: absolute; right: 0; bottom: 0; left: 0; background: #a3edb7; transition: height .2s ease; }
.player-card--red .guard span { background: #ff9292; }
.guard.is-broken { background: repeating-linear-gradient(135deg, rgba(0,0,0,.22), rgba(0,0,0,.22) 5px, rgba(255,255,255,.08) 5px, rgba(255,255,255,.08) 10px); }
.guard.is-broken span { display: none; }
.guard.is-active { box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }
.versus { display: grid; place-items: center; align-self: center; color: #8d96a8; font-size: .8rem; font-weight: 800; letter-spacing: .12em; }
.controls-panel { border-color: #51468a; }
.action-grid { display: grid; grid-template-columns: 150px repeat(3, 1fr); gap: 10px; align-items: end; margin-top: 18px; }
.connection-count { color: #aab3c1; font-size: .8rem; }
pre { min-height: 170px; max-height: 340px; overflow: auto; margin: 16px 0 0; padding: 14px; border-radius: 10px; background: #0b0d12; color: #c9f6d3; white-space: pre-wrap; word-break: break-word; }

@media (max-width: 760px) {
  .setup-grid, .scoreboard, .action-grid { grid-template-columns: 1fr; }
  .versus { display: none; }
  .action-grid label { grid-column: 1; }
  .life-line strong { font-size: 5rem; }
}
