* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; height: 100dvh; margin: 0; overflow: hidden;
  overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
body { background: #090e19; color: #edf6f7; font-family: system-ui, sans-serif; }
.game-shell { width: 100%; height: 100%; height: 100dvh; display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  justify-content: center; align-items: center; }
canvas { display: block; max-width: 100%; flex: 0 0 auto; background: #111a2a;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
@media (min-width: 720px) {
  canvas { box-shadow: 0 0 70px rgba(0, 0, 0, 0.42); }
}

.arena-toolbar { max-width: 100%; min-width: 0; padding: max(6px, env(safe-area-inset-top, 0px)) 6px 6px;
  flex: 0 0 auto; text-align: center; }
.arena-toolbar nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.arena-pill, .arena-quiet { min-height: 33px; padding: 4px clamp(6px, 2.1vw, 13px);
  border: 1px solid #435863; border-radius: 999px; background: #182532; color: #dcebf0;
  font: 700 12px/1.25 system-ui, sans-serif; white-space: nowrap; cursor: pointer; }
.arena-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 0;
  padding-inline: clamp(4px, 1.4vw, 10px); font-size: clamp(11px, 2.9vw, 12px); text-decoration: none; }
.arena-pill.arena-ai { color: #b7f6d7; background: #162c2a; border-color: #416357; }
.arena-pill.arena-duel { background: #4a3425; color: #ffedcc; border-color: #987251; }
.arena-pill:hover, .arena-quiet:hover:not(:disabled) { background: #2b414c; }
.arena-pill:disabled { opacity: 0.55; cursor: wait; }
.arena-status { display: block; max-width: min(92vw, 380px); margin: 5px auto 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arena-status, .arena-drawer-status { color: #b8e8d4; font-size: 12px; font-variant-numeric: tabular-nums; }
.arena-watching { pointer-events: none; }
.breakdown-overlay { position: fixed; z-index: 10; inset: 0; display: flex; align-items: flex-end;
  justify-content: center; background: rgba(5, 9, 15, 0.76); }
.breakdown-overlay [hidden], .breakdown-overlay[hidden], .arena-status[hidden] { display: none; }
.breakdown-panel { position: relative; width: min(100%, 560px); max-height: 95%; overflow: auto;
  padding: 22px 22px calc(22px + env(safe-area-inset-bottom)); border: 1px solid #38544f;
  border-radius: 22px 22px 0 0; background: #152331; box-shadow: 0 -20px 60px #0006; }
.breakdown-panel h2 { margin: 0 38px 14px 0; font-size: 22px; }
.breakdown-panel p { margin: 0 0 18px; color: #d1dce6; line-height: 1.7; }
.breakdown-close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px;
  border: 0; border-radius: 50%; background: #29394e; color: #edf6f7; font: 23px/1 system-ui, sans-serif;
  cursor: pointer; }
.arena-tabs { display: flex; gap: 4px; margin-bottom: 16px; padding: 3px; border-radius: 12px; background: #0c1823; }
.arena-tabs button { flex: 1; min-width: 0; padding: 8px 4px; border: 0; border-radius: 9px;
  color: #b7cad4; background: transparent; font: 700 12px/1.35 system-ui, sans-serif; cursor: pointer; }
.arena-tabs button[aria-selected=true] { background: #28483e; color: #c0f7dd; }
.arena-form, .arena-provider { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.arena-human-name { margin-bottom: 16px; }
.arena-form label { display: grid; gap: 5px; color: #c3d2de; font-size: 13px; font-weight: 650; }
.arena-form input, .arena-form select { width: 100%; min-width: 0; height: 38px; padding: 0 10px; color: #eef7fa;
  background: #0c1823; border: 1px solid #3d5262; border-radius: 9px; font: 16px system-ui, sans-serif; }
.arena-form-actions { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.breakdown-link, .arena-submit-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 40px;
  padding: 0 15px; border: 0; border-radius: 999px; background: #a5f3cf; color: #142a25;
  font: 800 14px system-ui, sans-serif; text-decoration: none; cursor: pointer; }
.breakdown-panel button:disabled { opacity: 0.5; cursor: default; }
.arena-example + .arena-example { margin-top: 12px; }
.arena-example pre { margin: 6px 0 0; padding: 9px; overflow: auto; background: #0c1823; color: #cde5ed;
  border-radius: 8px; font-size: 12px; line-height: 1.5; }
.arena-account-status { display: block; margin-top: 10px; color: #ffd6a2; font-size: 13px; }
.arena-profile h3, .arena-profile h4 { margin: 10px 0 5px; overflow-wrap: anywhere; }
.arena-profile p { margin-bottom: 8px; }
.arena-profile ul, .arena-account-list { padding-inline-start: 24px; color: #d1dce6;
  font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.arena-account-standings { margin-top: 14px; padding: 10px 12px; background: #0c1823; border-radius: 10px; }
.arena-account-standings summary { cursor: pointer; color: #c0f7dd; font-weight: 700; }
.arena-toolbar :focus-visible, .breakdown-panel :focus-visible { outline: 2px solid #f5fff9; outline-offset: 2px; }
@media (min-width: 720px) {
  .breakdown-overlay { align-items: center; }
  .breakdown-panel { border-radius: 22px; }
}
