.arena-entry-link { display: block; width: fit-content; margin: 12px auto 0; color: #91bcff; font: 0.65rem "Orbitron", sans-serif; text-underline-offset: 4px; }
#modal.game-over-state .arena-entry-link { display: none; }
html[data-test-arena] body { flex-direction: column; padding: 10px; box-sizing: border-box; gap: 10px; }
.arena-header { width: 100%; max-width: 1320px; display: flex; flex-direction: row; justify-content: space-between; align-items: center; gap: 12px; font-family: "Segoe UI", sans-serif; }
.arena-header h1 { margin: 0; font: bold 1rem "Orbitron", sans-serif; color: #ffbf47; }
.arena-header p { margin: 4px 0 0; font-size: 0.8rem; color: #b8c8e3; }
.arena-header a { color: #91bcff; font-size: 0.8rem; }
.arena-header-actions { display: contents; }
.arena-layout { display: flex; width: 100%; max-width: 1320px; flex: 1; min-height: 0; gap: 14px; }
html[data-test-arena] #game-container { width: auto; max-width: none; height: 100%; min-width: 0; flex: 1; border: none; border-radius: 12px; overflow: hidden; }
.arena-tools { display: flex; flex-direction: column; width: 300px; flex: 0 0 300px; min-height: 0; overflow: hidden; box-sizing: border-box; padding: 0; background: #090e1c; border: 2px solid var(--primary-color); border-radius: 12px; font: 0.85rem/1.5 "Segoe UI", sans-serif; touch-action: pan-y; }
.arena-tools h2 { color: #91bcff; margin: 0 0 12px; font: 0.9rem "Orbitron", sans-serif; }
.arena-tools-header { display: flex; flex: 0 0 auto; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; }
.arena-tools-quick { flex: 0 0 auto; padding: 0 14px 8px; border-bottom: 1px solid #233554; }
.arena-tools-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 16px 16px; }
.arena-section { border-top: 1px solid #233554; }
.arena-section summary { position: relative; list-style: none; min-height: 44px; box-sizing: border-box; padding: 12px 22px 12px 0; cursor: pointer; }
.arena-section summary::-webkit-details-marker { display: none; }
.arena-section summary::after { content: ''; position: absolute; top: 19px; right: 3px; width: 6px; height: 6px; border-right: 2px solid #91bcff; border-bottom: 2px solid #91bcff; transform: rotate(-45deg); }
.arena-section[open] summary::after { transform: rotate(45deg); }
.arena-section summary > span { color: #91bcff; font-weight: 600; }
.arena-section summary > small { margin-top: 2px; font-size: 0.75rem; color: #a8bbd9; }
.arena-tools .arena-section fieldset { border: 0; padding: 0 0 14px; }
.arena-tools-header h2 { margin: 0; }
.arena-tools #arenaToolsClose { width: 44px; height: 44px; min-width: 44px; padding: 0; border: 0; background: transparent; color: #fff; }
#arenaToolsClose svg { width: 22px; height: 22px; vertical-align: middle; }
.arena-tools fieldset { min-width: 0; border: 0; border-top: 1px solid #233554; padding: 12px 0; margin: 0; }
.arena-tools legend { color: #91bcff; font-weight: 600; padding: 0; }
.arena-tools label { display: block; margin: 5px 0; }
.arena-tools input[type="number"], .arena-tools select { display: block; box-sizing: border-box; width: 100%; min-height: 38px; padding: 6px 8px; background: #020713; color: #fff; border: 1px solid #35517b; border-radius: 4px; font: inherit; }
.arena-tools input[type="checkbox"] { accent-color: #ffbf47; margin-right: 6px; }
.arena-tools button, #arenaToolsBtn { min-height: 44px; border: 1px solid #476ba4; border-radius: 4px; background: #0b172b; color: #fff; padding: 7px 10px; font: 0.8rem "Segoe UI", sans-serif; cursor: pointer; }
#arenaToolsBtn { border: 2px solid var(--primary-color); border-radius: 6px; }
.arena-tools button:hover { background: #17325a; }
.arena-tools button:disabled { opacity: 0.4; cursor: default; }
.arena-tools :focus-visible, .arena-header :focus-visible, #arenaToolsBtn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.arena-row { display: flex; gap: 8px; margin: 7px 0; }
.arena-row > * { flex: 1; min-width: 0; }
.arena-tools small { display: block; color: #a8bbd9; }
#arenaMessage { min-height: 2em; color: #ffdf8a; }
#arenaReadout { font-size: 0.78rem; color: #a8bbd9; }
#arenaToolsBtn, #arenaToolsClose { display: none; }
html[data-test-arena] #pause-overlay { display: none !important; }
html[data-test-arena] #level-overlay:not(.overheat-warning) { transition: none; }
#arenaStateBadge { display: inline-block; margin-left: 8px; color: #91bcff; font: 0.7rem "Segoe UI", sans-serif; }
html[data-test-arena] #recordPanel, html[data-test-arena] #recordsBtn, html[data-test-arena] #sysOverrideTrigger, html[data-test-arena] .arena-entry-link { display: none; }
@media (max-width: 700px) {
  .arena-header { align-items: flex-start; flex-wrap: wrap; gap: 8px; padding-bottom: 8px; border-bottom: 2px solid rgba(0, 136, 255, 0.4); }
  .arena-header > div:first-child { width: 100%; }
  .arena-header-actions { display: flex; width: 100%; gap: 8px; }
  .arena-header h1 { font-size: 0.8rem; }
  .arena-header p { font-size: 0.7rem; }
  #arenaToolsBtn, .arena-header-actions a { display: flex; flex: 1; align-items: center; justify-content: center; box-sizing: border-box; min-height: 44px; padding: 7px 10px; border: 2px solid var(--primary-color); border-radius: 6px; background: #0b172b; color: #fff; font: 0.8rem "Segoe UI", sans-serif; text-decoration: none; }
  #arenaToolsBtn:hover, .arena-header-actions a:hover { background: #17325a; }
  .arena-layout { gap: 0; }
  .arena-tools { display: none; position: fixed; inset: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) auto max(8px, env(safe-area-inset-left)); z-index: 200; width: auto; height: calc(var(--app-height) - max(8px, env(safe-area-inset-top)) - max(8px, env(safe-area-inset-bottom))); padding: 0; overflow: hidden; box-shadow: 0 0 0 100vmax rgba(0,0,0,0.82); }
  .arena-tools.is-open { display: flex; flex-direction: column; }
  .arena-tools-header { flex: 0 0 auto; padding: 10px 14px; background: #090e1c; border-bottom: 1px solid #233554; }
  .arena-tools-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 16px 16px; }
  #arenaToolsClose { display: block; margin-left: auto; }
}
