.spectral-console {
  position: relative; isolation: isolate; display: grid;
  grid-template-columns: minmax(0, 1fr) 84px 28px 28px;
  gap: 5px; align-items: center; min-width: 0;
  min-height: 52px; height: 52px; margin: 0; padding: 5px 6px 5px 12px;
  overflow: hidden; box-sizing: border-box; border: 1px solid #8e45bd; border-radius: 4px;
  background: linear-gradient(90deg, rgba(111,36,145,.27), transparent 45%), repeating-linear-gradient(0deg, rgba(219,163,255,.035) 0 1px, transparent 1px 4px), #0c0712;
  box-shadow: inset 3px 0 #b95aeb, inset 0 0 22px rgba(140,50,183,.18), 0 0 13px rgba(137,48,179,.15);
  color: #eadcf5;
}
.spectral-console::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(115deg, transparent 20%, rgba(192,102,238,.1) 48%, transparent 70%);
  transform: translateX(-80%); animation: spectral-scan 5s ease-in-out infinite;
}
.spectral-console > div { display: grid; min-width: 0; line-height: 1; }
.spectral-console small, .spectral-console > b { display: none; }
.spectral-console strong {
  overflow: hidden; color: #e8bcff; font: 800 11px/1.1 monospace; letter-spacing: .65px;
  text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 0 9px rgba(199,105,245,.58);
}
.spectral-console span {
  margin-top: 4px; color: #66ddff; font: 800 8px/1 monospace; letter-spacing: 1px; white-space: nowrap;
}
.spectral-console select, .spectral-console button {
  min-width: 0; height: 32px; margin: 0; border: 1px solid #70408a; border-radius: 2px;
  background: linear-gradient(#1c1027, #0d0913); color: #e7cef5;
  font: 800 8px monospace; letter-spacing: .7px; cursor: pointer;
}
.spectral-console select {
  color-scheme: dark;
  background-color: #100918;
  color: #f0dafa;
}
.spectral-console select option {
  background: #100918;
  color: #f0dafa;
  font-weight: 800;
}
.spectral-console select option:checked {
  background: #6e238e;
  color: #fff;
}
.spectral-console button { color: transparent; font-size: 0; }
.spectral-console button::before { color: #d89afa; font: 900 12px/1 monospace; }
#spectral-arm::before { content: '◆'; }
#spectral-disarm::before { content: '◇'; }
.spectral-console select:hover, .spectral-console button:hover { border-color: #d071ff; box-shadow: 0 0 9px rgba(190,86,239,.3); }
.spectral-console.is-paused { border-color: #a43a54; box-shadow: inset 3px 0 #d54964, inset 0 0 20px rgba(180,35,66,.16); }
.spectral-console.is-paused span { color: #ff7089; }
.spectral-console.is-armed { border-color: #35d6ef; box-shadow: inset 3px 0 #35d6ef, inset 0 0 24px rgba(53,214,239,.14), 0 0 14px rgba(53,214,239,.14); }
.spectral-console.is-armed #spectral-arm { border-color:#35d6ef; background:linear-gradient(#123341,#09151b); }
@keyframes spectral-scan { 0%,55% { transform:translateX(-90%); } 80%,100% { transform:translateX(90%); } }
@media (min-width: 901px) {
  body:is(.room-mode-battle,.room-mode-battle-armed,.room-mode-recount) #battle-controls-panel > .spectral-console { grid-column: auto !important; order: 1 !important; width: 100% !important; }
  body:is(.room-mode-battle,.room-mode-battle-armed,.room-mode-recount) #battle-controls-panel .battle-controls-host-slot { order: 2 !important; }
  body:is(.room-mode-battle,.room-mode-battle-armed,.room-mode-recount) #battle-controls-panel #nema-asoc-btn { order: 3 !important; }
  body:is(.room-mode-battle,.room-mode-battle-armed,.room-mode-recount) #battle-controls-panel #bice-asoc-btn { order: 4 !important; }

  /* One command deck, one physical tile size. This deliberately overrides
     older per-control density rules that left AMUSE/ABUSE shorter. */
  body:is(.room-mode-battle,.room-mode-battle-armed,.room-mode-recount) #battle-controls-panel :is(
    .spectral-console,
    .battle-controls-host-slot,
    .battle-controls-host-slot .room-mode-toggle,
    #nema-asoc-btn,
    #bice-asoc-btn,
    #shame-gm-button,
    #poison-gm-button,
    #black-market-gm-button,
    #quests-btn,
    #library-btn-footer,
    #reset-board-btn,
    #sound-toggle-btn,
    .master-access-wrap,
    .master-access-wrap .master-access-btn,
    #broker-transmog-btn,
    #dragon-raid-setup-btn,
    #load-shell-btn
  ) {
    width: 100% !important;
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  body:is(.room-mode-battle,.room-mode-battle-armed,.room-mode-recount) #battle-controls-panel .battle-controls-host-slot {
    padding: 0 !important;
  }
  body:is(.room-mode-battle,.room-mode-battle-armed,.room-mode-recount) #battle-controls-panel .battle-controls-host-slot .room-mode-toggle {
    padding: 5px !important;
  }
  body:is(.room-mode-battle,.room-mode-battle-armed,.room-mode-recount) #battle-controls-panel .battle-controls-host-slot .room-mode-segment {
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
  }
  body:is(.room-mode-battle,.room-mode-battle-armed,.room-mode-recount) #battle-controls-panel #load-shell-btn { order: 15 !important; }
}
.load-shell-btn {
  position: relative; overflow: hidden; display: flex !important; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid #55758b !important;
  background: linear-gradient(135deg, #101922, #080d12 62%, #15202a) !important;
  color: #b9ddf2 !important; letter-spacing: 2px !important;
  box-shadow: inset 3px 0 #63c7ef, inset 0 0 18px rgba(75,174,214,.1) !important;
}
.load-shell-btn::after { content:''; position:absolute; inset:5px; border:1px solid rgba(117,201,235,.13); pointer-events:none; }
.load-shell-btn:hover { border-color:#75d8ff !important; color:#e4f7ff !important; box-shadow:inset 3px 0 #75d8ff,0 0 16px rgba(77,190,235,.24) !important; }
.load-shell-mark { color:#6fdcff; font-size:18px; text-shadow:0 0 10px #52c8f5; }
@media (max-width: 900px) { .spectral-console { grid-template-columns: minmax(0,1fr) 88px 30px 30px; width: 100%; } }
@media (prefers-reduced-motion: reduce) { .spectral-console::before { animation: none; } }
/* Console fit: the status line and the mode select no longer clip when the rail is narrow. */
@media (min-width: 901px) {
  .spectral-console { grid-template-columns: minmax(0, 1fr) 84px 26px 26px; gap: 4px; padding: 5px 6px 5px 10px; }
}
.spectral-console > div { overflow: hidden; align-content: center; gap: 5px; }
.spectral-console strong { font-size: 10px; letter-spacing: .2px; line-height: 1.15; }
.spectral-console span { display: block; margin-top: 0; overflow: hidden; text-overflow: ellipsis; font-size: 8px; letter-spacing: .3px; }
.spectral-console select { padding: 0 2px 0 6px; letter-spacing: .3px; }

/* Outside the clipped command tile: pending reviews must remain visible. */
#spectral-review-toggle, #spectral-review-panel { position: fixed; z-index: 15000; color: #f3e7ff; font: 700 13px/1.5 monospace; border: 1px solid #c67aff; border-radius: 8px; background: #170e21; box-shadow: 0 8px 30px #000b; }
#spectral-review-toggle { right: 20px; bottom: 22px; padding: 12px 18px; cursor: pointer; }
#spectral-review-panel { right: 20px; bottom: 80px; width: min(440px, calc(100vw - 40px)); max-height: min(580px, calc(100dvh - 120px)); overflow: auto; padding: 16px; box-sizing: border-box; }
#spectral-review-panel[hidden], #spectral-review-toggle[hidden] { display: none !important; }
#spectral-review-panel header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#spectral-review-panel article { border-top: 1px solid #694582; padding: 12px 0; overflow-wrap: anywhere; }
#spectral-review-panel blockquote { margin: 8px 0; padding: 8px; background: #08060c; white-space: pre-wrap; }
#spectral-review-panel button, #spectral-review-panel select { color: #f3e7ff; border: 1px solid #9461b4; background: #2c173d; padding: 8px; margin: 4px; border-radius: 4px; cursor: pointer; }
#spectral-review-panel button:disabled { opacity: .45; cursor: not-allowed; }
#spectral-review-panel :focus-visible, #spectral-review-toggle:focus-visible { outline: 2px solid #ffc96a; outline-offset: 2px; }
