/* Operator console (admin.html). */

.auth {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: var(--gutter);
}
.auth-card {
  position: relative;
  width: min(420px, 100%);
  display: grid;
  gap: 18px;
  padding: 36px 30px 30px;
  overflow: hidden;
}
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--red);
}
.auth-card h1 { font-size: 2.1rem; }
.auth-card p { margin: 0; color: var(--muted); }
.auth-card form { display: grid; gap: 14px; }
.credit { margin: 0; color: var(--faint); font-size: .8rem; }
.credit b { color: var(--text); font-family: var(--display); letter-spacing: .04em; }
.auth { align-content: center; gap: 18px; }
.auth-card .error { color: #ffc2c9; font-size: .9rem; }

/* Shell */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  padding: 20px 14px;
  background: rgba(6, 10, 18, .72);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.side .brand { padding: 0 8px; }
.side nav { display: grid; gap: 2px; }
.side nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  color: var(--muted);
  border-radius: 8px;
  font-size: .95rem;
}
.side nav a svg { width: 18px; height: 18px; flex: none; }
.side nav a:hover { color: var(--text); background: rgba(117, 199, 255, .07); }
.side nav a[aria-current="page"] { color: #fff; background: rgba(190, 36, 44, .16); box-shadow: inset 3px 0 0 var(--red); }
.side nav a .badge { margin-left: auto; color: var(--faint); font-family: var(--display); font-size: .8rem; }
.side .brand { flex-wrap: wrap; }
.side nav .group { margin: 12px 10px 4px; color: var(--faint); font-size: .78rem; }
.side-foot { margin-top: auto; display: grid; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--line); font-size: .85rem; }
.side-foot .who { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.content { padding: 24px var(--gutter) 64px; min-width: 0; }
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 22px;
}
.page-head h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 70ch; }
.page-head .tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.conn { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .85rem; }

.section { display: grid; gap: 12px; margin-top: 28px; }
.section > h2 { font-size: 1.4rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* Overview */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { display: grid; gap: 4px; padding: 16px 18px; }
.kpi span { color: var(--muted); font-size: .85rem; }
.kpi b { font-family: var(--display); font-size: 2.3rem; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--faint); }
.sparks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.spark { display: grid; gap: 8px; padding: 14px 16px; }
.spark header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; color: var(--muted); font-size: .85rem; }
.spark header b { color: var(--text); font-family: var(--display); font-size: 1.3rem; font-weight: 600; }
.spark svg { width: 100%; height: 48px; display: block; }
.spark path.area { fill: rgba(98, 197, 255, .1); }
.spark path.line { fill: none; stroke: var(--signal); stroke-width: 1.6; vector-effect: non-scaling-stroke; }

/* Match rows */
.match { overflow: hidden; }
.match > summary {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
}
.match > summary::-webkit-details-marker { display: none; }
.match > summary > svg { width: 18px; height: 18px; color: var(--faint); transition: transform .15s ease; }
.match[open] > summary > svg { transform: rotate(90deg); }
.match-title { display: grid; gap: 2px; min-width: 0; }
.match-title b { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 1.1rem; font-weight: 800; text-transform: uppercase; }
.match-title .mode-icon { width: 20px; height: 20px; object-fit: contain; }
.match-thumb { width: 120px; aspect-ratio: 16 / 9; object-fit: cover; clip-path: var(--cut-sm); }
td img.gun { height: 30px; width: 120px; object-fit: contain; object-position: left center; filter: brightness(1.55) contrast(1.08); }
.match-title span { color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-score { font-family: var(--display); font-size: 1.4rem; white-space: nowrap; }
.match-score .a { color: var(--alpha); }
.match-score .b { color: var(--bravo); }
.match-body { display: grid; gap: 14px; padding: 0 18px 18px; }
.match-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stack { display: grid; gap: 10px; }
.team-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--alpha); }
.team-dot.bravo { background: var(--bravo); }
.hp { display: inline-block; width: 70px; height: 5px; margin-right: 8px; vertical-align: middle; background: var(--panel-3); border-radius: 999px; overflow: hidden; }
.hp i { display: block; height: 100%; background: var(--ok); }

/* Forms on pages */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; align-items: end; padding: 18px; }
.option-group { display: grid; gap: 0; }
.option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 240px);
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.option:last-child { border-bottom: 0; }
.option b { display: block; font-weight: 600; }
.option span { color: var(--muted); font-size: .85rem; }
.option .control { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.option .control input:not([type="checkbox"]) { max-width: 160px; }
.restart-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-color: rgba(242, 179, 91, .35);
  background: rgba(242, 179, 91, .07);
}

/* Server settings and weapon workshop */
.settings-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 18px 0 8px; }
.settings-tab { display: grid; gap: 4px; min-height: 82px; padding: 14px 16px; text-align: left; color: var(--muted); background: var(--panel); border: 1px solid var(--line); cursor: pointer; }
.settings-tab.selected { color: var(--text); border-color: var(--red-hot); box-shadow: inset 3px 0 0 var(--red); background: rgba(190, 36, 44, .12); }
.settings-tab b { font: 800 1.15rem/1 var(--display); text-transform: uppercase; }
.settings-tab span { font-size: .82rem; }
.settings-workshop-link { margin-top: 18px; }
.settings-layout { display: grid; grid-template-columns: minmax(190px, 230px) minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 18px; }
.settings-layout .settings-tabs { position: sticky; top: 18px; display: grid; grid-template-columns: 1fr; gap: 4px; max-height: calc(100vh - 36px); overflow: auto; margin: 0; }
.settings-layout .settings-tab { min-height: 0; padding: 10px 12px; border-radius: 4px; }
.settings-layout .settings-tab b { font-size: .93rem; }
.settings-layout .settings-tab span { font-size: .74rem; }
.settings-content { min-width: 0; }
.settings-section-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin: 0 0 14px; }
.settings-section-head h2 { margin: 3px 0; text-transform: capitalize; }
.settings-section-head p { margin-bottom: 0; }
.setting-input { display: flex; gap: 8px; align-items: center; width: 100%; }
.setting-input input, .setting-input textarea { width: 100%; min-width: 0; }
.setting-input textarea { resize: vertical; font-family: ui-monospace, monospace; }
.option .control { min-width: 0; }
.option .control input:not([type="checkbox"]) { max-width: none; }
.option small { display: block; margin-top: 5px; }
.weapon-workshop { display: grid; grid-template-columns: minmax(225px, 280px) minmax(0, 1fr); gap: 16px; align-items: start; }
.weapon-rail { position: sticky; top: 20px; overflow: hidden; }
.weapon-rail-head { display: grid; gap: 9px; padding: 14px; border-bottom: 1px solid var(--line); }
.weapon-rail-head input, .weapon-rail-head select { width: 100%; }
.weapon-list { max-height: calc(100vh - 230px); overflow: auto; }
.weapon-list-item { display: grid; gap: 2px; width: 100%; padding: 10px 14px; text-align: left; color: var(--text); background: transparent; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.weapon-list-item:hover { background: rgba(203, 213, 222, .07); }
.weapon-list-item.selected { background: rgba(190, 36, 44, .17); box-shadow: inset 3px 0 0 var(--red-hot); }
.weapon-list-item span { font: 600 .9rem/1.2 var(--display); }
.weapon-list-item small { color: var(--muted); }
.weapon-detail { display: grid; gap: 14px; min-width: 0; }
.weapon-hero { position: relative; min-height: 208px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 26px; overflow: hidden; background: linear-gradient(110deg, #171b23 50%, #292b32); }
.weapon-hero::before { content: ''; position: absolute; inset: auto -40px -110px auto; width: 250px; height: 250px; transform: rotate(45deg); border: 20px solid rgba(226, 54, 63, .16); pointer-events: none; }
.weapon-hero > div { position: relative; z-index: 1; max-width: 470px; }
.weapon-hero h2 { font-size: clamp(1.8rem, 4vw, 3rem); margin: 8px 0; }
.weapon-hero p { color: var(--muted); margin: 0; max-width: 45ch; }
.weapon-class { color: #ff858b; font: 600 .85rem var(--body); }
.weapon-hero img { position: relative; z-index: 1; display: block; width: min(42%, 320px); max-height: 170px; object-fit: contain; filter: drop-shadow(0 14px 10px rgba(0, 0, 0, .6)) brightness(1.2); }
.weapon-hero > svg { width: 100px; height: 100px; opacity: .25; }
.weapon-editor { padding: 22px; }
.weapon-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.weapon-editor h2 { font-size: 1.5rem; }
.weapon-editor > p { max-width: 70ch; }
.weapon-form { display: grid; gap: 20px; }
.weapon-stat-section { display: grid; gap: 10px; }
.weapon-stat-section h3 { color: var(--steel); font-size: 1.14rem; }
.weapon-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 9px; }
.weapon-stat { display: grid; gap: 5px; padding: 12px; background: rgba(203, 213, 222, .04); border: 1px solid var(--line); }
.weapon-stat.is-edited { border-color: rgba(226, 54, 63, .55); }
.weapon-stat span { color: var(--text); font-size: .88rem; }
.weapon-stat input { width: 100%; font: 600 1.2rem var(--display); }
.weapon-stat small { color: var(--faint); }
.weapon-form-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Bot match controls */
.playlist-workshop { display: grid; grid-template-columns: minmax(210px, 250px) minmax(0, 1fr); gap: 16px; align-items: start; }
.playlist-rail { position: sticky; top: 18px; overflow: hidden; }
.playlist-rail-head { padding: 18px; border-bottom: 1px solid var(--line); }
.playlist-rail-head h2 { font-size: 1.25rem; }
.playlist-rail-head p { margin: 6px 0 0; font-size: .85rem; }
.playlist-rail-list { max-height: calc(100vh - 230px); overflow-y: auto; }
.playlist-rail-item { display: grid; gap: 3px; width: 100%; padding: 11px 15px; text-align: left; color: var(--text); background: transparent; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.playlist-rail-item:hover { background: rgba(203, 213, 222, .07); }
.playlist-rail-item.selected { background: rgba(190, 36, 44, .17); box-shadow: inset 3px 0 0 var(--red-hot); }
.playlist-rail-item strong { font: 700 .93rem var(--display); }
.playlist-rail-item span { color: var(--muted); font-size: .77rem; }
.playlist-editor { min-width: 0; }
.playlist-lead { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px; }
.playlist-lead h2 { font-size: clamp(1.6rem, 3vw, 2.5rem); }
.playlist-lead p { margin: 6px 0 0; max-width: 58ch; color: var(--muted); }
.playlist-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.playlist-seats { display: grid; gap: 6px; }
.playlist-seats label { color: var(--muted); font: 700 .78rem var(--display); letter-spacing: .06em; text-transform: uppercase; }
.playlist-seats-row { display: flex; gap: 8px; align-items: center; }
.playlist-seats input { width: 84px; font: 600 1.1rem var(--display); }
.playlist-seats small { color: var(--faint); font-size: .75rem; }
.playlist-stage { display: grid; grid-template-columns: minmax(145px, 180px) minmax(0, 1fr); gap: 12px; align-items: start; margin-top: 14px; }
.playlist-mode-rail { position: sticky; top: 18px; overflow: hidden; }
.playlist-mode-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 7px; align-items: center; width: 100%; padding: 9px; text-align: left; color: var(--muted); background: transparent; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.playlist-mode-item:hover { color: var(--text); background: rgba(203, 213, 222, .07); }
.playlist-mode-item.selected { color: var(--text); background: rgba(190, 36, 44, .17); box-shadow: inset 3px 0 0 var(--red-hot); }
.playlist-mode-item img { width: 26px; height: 26px; object-fit: contain; }
.playlist-mode-item span { font: 700 .8rem/1.15 var(--display); }
.playlist-mode-item small { color: var(--faint); }
.playlist-mode-content { min-width: 0; }
.playlist-filter { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.playlist-filter h3 { margin: 0; font: 800 1.4rem/1 var(--display); }
.playlist-filter span { font-size: .8rem; }
.playlist-filter input { width: min(100%, 290px); }
.playlist-picker { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.playlist-picker h3 { margin: 0 0 12px; }
.playlist-map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 12px; }
.playlist-map { overflow: hidden; }
.playlist-map.is-active { border-color: rgba(226, 54, 63, .38); }
.playlist-map-art { position: relative; height: 142px; background: var(--panel-3); overflow: hidden; }
.playlist-map-art::after { content: ''; position: absolute; inset: 35% 0 0; background: linear-gradient(transparent, rgba(3, 7, 13, .94)); pointer-events: none; }
.playlist-map-art img { width: 100%; height: 100%; display: block; object-fit: cover; }
.playlist-map-art > div { position: absolute; z-index: 1; bottom: 12px; left: 16px; right: 16px; display: flex; align-items: end; justify-content: space-between; gap: 8px; }
.playlist-map-art h3 { margin: 0; font: 800 1.35rem/1 var(--display); text-shadow: 0 2px 6px #000; }
.playlist-map-art span { flex: 0 0 auto; color: #fff; font-size: .78rem; text-shadow: 0 2px 6px #000; }
.playlist-mode-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 10px; }
.playlist-mode { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; gap: 0 7px; min-height: 42px; padding: 6px 8px; text-align: left; color: var(--muted); background: var(--panel-3); border: 1px solid var(--line); cursor: pointer; }
.playlist-mode:hover:not(:disabled) { border-color: var(--steel); color: var(--text); }
.playlist-mode.is-selected { color: var(--text); border-color: var(--red-hot); background: rgba(190, 36, 44, .2); }
.playlist-mode:disabled { opacity: .4; cursor: not-allowed; }
.playlist-mode img { grid-row: span 2; width: 25px; height: 25px; object-fit: contain; }
.playlist-mode span { min-width: 0; font: 700 .82rem/1.1 var(--display); }
.playlist-mode small { color: var(--faint); font-size: .68rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.playlist-mode:focus-visible, .playlist-rail-item:focus-visible, .playlist-mode-item:focus-visible { outline: 2px solid var(--signal); outline-offset: -2px; }

.bot-command-center { display: grid; gap: 18px; padding: 20px; }
.bot-control-head { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.bot-control-head h2 { font-size: 1.6rem; }
.bot-control-head p { margin: 5px 0 0; }
.bot-control-head select { min-width: 220px; }
.bot-control-grid { display: grid; grid-template-columns: minmax(100px, 140px) minmax(130px, 1fr) minmax(130px, 1fr) auto; align-items: end; gap: 10px; }
.bot-control-grid .field { margin: 0; }
.bot-equipment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; }
.bot-command-row input { max-width: 160px; }
.bot-control-grid select, .bot-control-grid input { width: 100%; }
.bot-command-row { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); }
.bot-command-row select { width: auto; }
.bot-output { min-height: 140px; }
.match-actions { padding-top: 12px; border-top: 1px solid var(--line); }
.match-team-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.match-team { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: baseline; padding: 12px 14px; background: rgba(75, 163, 255, .08); border-left: 3px solid var(--alpha); }
.match-team.bravo { background: rgba(255, 138, 61, .08); border-color: var(--bravo); }
.match-team strong { font: 600 1rem var(--display); text-transform: uppercase; }
.match-team span { justify-self: end; color: var(--muted); font-size: .8rem; }
.match-seat-dots { grid-column: 1 / -1; display: flex; gap: 4px; }
.match-seat-dots i { flex: 1; height: 4px; background: var(--panel-3); }
.match-team.alpha .match-seat-dots i.filled { background: var(--alpha); }
.match-team.bravo .match-seat-dots i.filled { background: var(--bravo); }

@media (max-width: 900px) {
	.playlist-workshop { grid-template-columns: 1fr; }
	.playlist-rail { position: static; }
	.playlist-rail-list { display: flex; max-height: none; overflow-x: auto; }
	.playlist-rail-item { flex: 0 0 170px; }
	.playlist-mode-rail { position: static; }
	.playlist-mode-item { min-width: 140px; }
	.settings-layout { grid-template-columns: 1fr; }
	.settings-layout .settings-tabs { position: static; display: flex; overflow-x: auto; max-height: none; }
	.settings-layout .settings-tab { flex: 0 0 auto; min-width: 125px; }
  .weapon-workshop { grid-template-columns: 1fr; }
  .weapon-rail { position: static; }
  .weapon-list { display: flex; max-height: 132px; overflow: auto; }
  .weapon-list-item { flex: 0 0 170px; }
  .bot-control-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .playlist-stage { grid-template-columns: 1fr; }
  .playlist-mode-rail { display: flex; overflow-x: auto; }
  .playlist-mode-item { flex: 0 0 145px; }
  .playlist-filter input { width: 100%; }
  .settings-tabs { grid-template-columns: 1fr; }
  .settings-tab { min-height: 56px; }
  .weapon-hero { min-height: 170px; padding: 18px; }
  .weapon-hero img { width: 37%; }
  .weapon-editor { padding: 15px; }
  .bot-control-grid { grid-template-columns: 1fr; }
  .match-team-bar { grid-template-columns: 1fr; }
}

/* Logs */
.log-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.log-tools input[type="search"] { width: 220px; }
.log-tools select { width: auto; }
.match-seats { color: var(--muted); font-family: var(--display); font-size: 1rem; white-space: nowrap; }
.log {
  height: calc(100vh - 250px);
  min-height: 320px;
  overflow: auto;
  padding: 10px 0;
  font: 12.5px/1.55 var(--mono);
  background: rgba(3, 7, 13, .75);
}
.log-line { display: grid; grid-template-columns: 70px 66px 150px minmax(0, 1fr); gap: 10px; padding: 1px 14px; white-space: pre-wrap; word-break: break-word; }
.log-line:hover { background: rgba(101, 190, 249, .06); }
.log-line .t { color: var(--faint); }
.log-line .lvl { color: var(--muted); }
.log-line .lab { color: #9fc2e6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-line.WARN .lvl { color: var(--amber); }
.log-line.ERROR .lvl, .log-line.CRITICAL .lvl { color: var(--danger); }
.log-line.ERROR, .log-line.CRITICAL { background: rgba(255, 107, 122, .05); }

/* Bots / profile console */
.console-out {
  min-height: 180px;
  max-height: 420px;
  overflow: auto;
  margin: 0;
  padding: 14px 18px;
  font: 13px/1.55 var(--mono);
  white-space: pre-wrap;
  background: rgba(3, 7, 13, .75);
  border-radius: var(--r-md);
}
.console-out .cmd { color: var(--signal); }
.console-row { display: flex; gap: 8px; flex-wrap: wrap; }
.console-row select { width: auto; }
.console-row input { flex: 1 1 240px; font-family: var(--mono); }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side {
    position: sticky;
    z-index: 5;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .side .brand span:last-child { display: none; }
  .side nav { display: flex; gap: 2px; }
  .side nav .group, .side nav a .label, .side nav a .badge { display: none; }
  .side-foot { margin: 0 0 0 auto; padding: 0; border: 0; }
  .side-foot .who span { display: none; }
  .option { grid-template-columns: 1fr; }
  .option .control { justify-content: flex-start; }
  .log-line { grid-template-columns: 62px minmax(0, 1fr); }
  .log-line .lvl, .log-line .lab { display: none; }
  .match > summary { grid-template-columns: auto minmax(0, 1fr); }
  .match > summary .chip, .match-score, .match-seats { grid-column: 2; justify-self: start; }
  .match-thumb { display: none; }
}

/* Map viewer, Waypoint editor, Collision editor (js/admin/map_workspace.js, world*.js) */
.world-viewer { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.world-stage-wrap { position: relative; }
.world-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-bottom: 10px; }
.world-stage { position: relative; height: calc(100vh - 200px); min-height: 420px; overflow: hidden; background: #0e1014; border: 1px solid var(--line); clip-path: var(--cut); }
.world-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.world-stage canvas.dragging { cursor: grabbing; }
.world-message { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px; color: var(--muted); text-align: center; }
.world-progress { width: min(320px, 70vw); height: 4px; background: var(--panel-3); }
.world-progress i { display: block; width: 0; height: 100%; background: var(--red-hot); transition: width .2s; }
.world-loading { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at center, #202a3e, #0e1014 80%); }
.world-loading[hidden] { display: none; }
.world-loading-card { width: min(390px, 100%); padding: 30px; text-align: center; background: var(--panel, #171b22); border: 1px solid var(--line, #394254); border-top: 3px solid var(--red-hot, #e2363f); border-radius: 12px; box-shadow: 0 16px 60px #0005; }
.world-loading-mark { display: block; color: var(--red-hot, #e2363f); font: 52px/1.2 var(--mono, monospace); }
.world-loading-card h2 { margin: 12px 0; font-size: 1.2rem; }
.world-loading-card p { min-height: 2.8em; color: var(--steel, #aab4c0); font-size: .85rem; }
.world-loading-card progress { display: block; width: 100%; height: 10px; margin-top: 20px; accent-color: var(--red-hot, #e2363f); }
.world-loading-percent { display: block; margin: 8px 0 16px; font: .8rem var(--mono, monospace); }
.world-loading-card small { color: var(--steel, #aab4c0); font-size: .75rem; }
.world-readout { position: absolute; left: 12px; right: 12px; bottom: 12px; width: fit-content; max-width: calc(100% - 24px); padding: 4px 9px; overflow: hidden; color: var(--steel); font: .78rem/1.5 var(--mono); white-space: nowrap; text-overflow: ellipsis; background: rgba(11, 12, 15, .82); border: 1px solid var(--line); pointer-events: none; }
.world-mode { display: inline-flex; gap: 2px; padding: 3px; background: rgba(0, 0, 0, .5); border: 1px solid var(--line); border-radius: var(--r-sm); }
.world-mode button { min-height: 32px; padding: 0 14px; color: var(--muted); background: none; border: 0; border-radius: 2px; font: 600 .74rem/1 var(--display); letter-spacing: .08em; cursor: pointer; }
.world-mode button:hover { color: #fff; }
.world-mode button[aria-pressed="true"] { color: #fff; background: var(--red); }
.world-side { display: grid; gap: 12px; }
.world-side .panel { padding: 14px; }
.world-side h2 { margin: 0 0 10px; font-size: 1rem; }
.world-layers { display: grid; gap: 9px; }
.world-layer { width: 100%; }
.world-layer span { display: grid; flex: 1; line-height: 1.25; }
.world-layer small { color: var(--faint); font-size: .75rem; }
.world-layer b { color: var(--muted); font: .78rem var(--mono); }
.world-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: .85rem; }
.world-facts dt { color: var(--faint); }
.world-facts dd { margin: 0; overflow-wrap: anywhere; }
.world-help { margin: 12px 0 0; font-size: .82rem; }
.world-legend { display: grid; gap: 6px; font-size: .85rem; color: var(--muted); }
.world-legend p { margin: 4px 0 0; font-size: .8rem; }
.world-swatch { display: inline-block; width: 11px; height: 11px; margin-right: 8px; vertical-align: -1px; border-radius: 2px; }
@media (max-width: 1000px) {
  .world-viewer { grid-template-columns: 1fr; }
  .world-stage { height: 62vh; }
}
.world-art-status { position: absolute; top: 12px; left: 12px; padding: 4px 9px; color: var(--steel); font: .78rem/1.5 var(--mono); background: rgba(11, 12, 15, .82); border: 1px solid var(--line); pointer-events: none; }
.world-cut { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.world-cut span { display: grid; line-height: 1.25; }
.world-cut small { color: var(--faint); font-size: .75rem; }
.world-cut b { color: var(--muted); font: .78rem var(--mono); }
.world-cut input { grid-column: 1 / -1; width: 100%; accent-color: var(--red); }
.world-cut-presets { grid-column: 1 / -1; display: flex; gap: 6px; }
.world-nav { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.world-nav span { display: grid; line-height: 1.25; }
.world-nav small { color: var(--faint); font-size: .75rem; }
.world-edit { display: grid; gap: 10px; }
.world-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.world-tools .btn[aria-pressed="true"] { --fg: #fff; --bd: #ff3b30; --bg: rgba(255, 59, 48, .22); }
.world-note { margin: 0; font-size: .8rem; line-height: 1.4; }
.world-note.bad { color: #ffb4b9; }
.world-note.mono { font-family: var(--mono); }
.world-props { display: grid; gap: 8px; padding: 10px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-left: 3px solid #ff3b30; }
.world-props select { width: 100%; }
.world-flags { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: .82rem; }
.world-flags small { width: 100%; color: var(--faint); font-size: .75rem; }
.world-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.world-field { display: grid; gap: 2px; font-size: .75rem; color: var(--faint); }
.world-field input { width: 100%; min-width: 0; padding: 4px 6px; font: .8rem var(--mono); }
.world-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.world-stage[data-tool="box"] canvas, .world-stage[data-tool="wall"] canvas,
.world-stage[data-tool="eraser"] canvas, .world-stage[data-tool="route"] canvas { cursor: crosshair; }

/* Recordings */
.rec-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.rec-list { display: grid; gap: 8px; align-content: start; }
.rec-row { display: grid; gap: 4px; padding: 10px 12px; text-align: left; background: rgba(13, 15, 18, .8); border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; }
.rec-row:hover, .rec-row:focus-visible { border-color: var(--line-2); }
.rec-row-main { display: flex; justify-content: space-between; gap: 10px; }
.rec-row-sub { font-size: .8rem; }
.rec-detail { display: grid; gap: 12px; }
.rec-summary p { margin: 6px 0 0; }
.rec-summary .chip { margin: 2px 4px 0 0; }
.rec-summary .chip.rec-team-alpha { border-left: 3px solid var(--alpha); }
.rec-summary .chip.rec-team-bravo { border-left: 3px solid var(--bravo); }
.rec-map .world-stage { height: 62vh; }
.rec-map .world-readout, .rec-map .world-art-status { bottom: 66px; }
.rec-transport { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: rgba(11, 12, 15, .82); border: 1px solid var(--line); }
.rec-transport input[type="range"] { flex: 1; min-width: 80px; width: auto; }
.rec-transport select { flex: none; width: auto; }
.rec-transport .mono { white-space: nowrap; }
.rec-kills { display: grid; gap: 4px; max-height: 50vh; overflow-y: auto; }
.rec-kill { display: flex; gap: 8px; padding: 6px 8px; font-size: .82rem; text-align: left; background: none; border: 1px solid transparent; border-radius: var(--r-sm); cursor: pointer; }
.rec-kill:hover, .rec-kill:focus-visible { border-color: var(--line-2); }
.rec-kill.active { background: rgba(226, 54, 63, .14); border-color: rgba(226, 54, 63, .4); }
@media (max-width: 1000px) {
  .rec-layout { grid-template-columns: 1fr; }
}

/* Loadout allow-list (weapons.js's "Allowed weapons / attachments" section) */
.allow-list { display: grid; gap: 14px; padding: 22px; margin-top: 16px; }
.allow-list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.allow-list-head h2 { font-size: 1.5rem; margin: 0; }
.allow-list-section { display: grid; gap: 10px; }
.allow-list-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.allow-list-section-head h3 { color: var(--steel); font-size: 1.05rem; margin: 0; }
.allow-list-section-head input[type="search"] { width: 220px; }
.allow-list-group { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.allow-list-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.allow-list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 10px; max-height: 260px; overflow-y: auto; padding: 2px 4px; }
.allow-list-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: .86rem; }
.allow-list-item input { flex: none; }
.allow-list-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 700px) {
  .allow-list-section-head input[type="search"] { width: 100%; }
}
