/* ==========================================================================
   StoryForge CRT Web Terminal Stylesheet
   Pure CSS3 Retro Cathode Ray Tube (CRT) Aesthetic
   ========================================================================== */

:root {
  /* Default: Matrix Green Phosphor (Matching mystoryforge.games) */
  --bg-dark: #070c08;
  --crt-bezel: #1b1f1c;
  --crt-screen: #0a140c;
  --term-primary: #33ff33;
  --term-glow: rgba(51, 255, 51, 0.45);
  --term-dim: #1e991e;
  --term-bright: #70ff70;
  --term-alert: #ff3344;
  --term-alert-glow: rgba(255, 51, 68, 0.4);
  --term-warning: #ffea00;
  --term-border: #1a3320;
  --term-highlight: rgba(51, 255, 51, 0.12);
  --font-mono: "VT323", "Share Tech Mono", "Courier New", Courier, monospace;
}

/* Color Themes */
body.theme-amber {
  --bg-dark: #0f0902;
  --crt-bezel: #201a14;
  --crt-screen: #180e03;
  --term-primary: #ffb000;
  --term-glow: rgba(255, 176, 0, 0.45);
  --term-dim: #8c5b00;
  --term-bright: #ffe07a;
  --term-alert: #ff3344;
  --term-alert-glow: rgba(255, 51, 68, 0.4);
  --term-warning: #ffec3d;
  --term-border: #523700;
  --term-highlight: rgba(255, 176, 0, 0.12);
}

body.theme-cyan {
  --bg-dark: #020b12;
  --crt-bezel: #141f24;
  --crt-screen: #051421;
  --term-primary: #00f0ff;
  --term-glow: rgba(0, 240, 255, 0.45);
  --term-dim: #006b7a;
  --term-bright: #8ff5ff;
  --term-alert: #ff0055;
  --term-alert-glow: rgba(255, 0, 85, 0.4);
  --term-warning: #ffd000;
  --term-border: #004d57;
  --term-highlight: rgba(0, 240, 255, 0.12);
}

body.theme-white {
  --bg-dark: #0d0d0d;
  --crt-bezel: #222222;
  --crt-screen: #171717;
  --term-primary: #f0f0f0;
  --term-glow: rgba(240, 240, 240, 0.35);
  --term-dim: #7a7a7a;
  --term-bright: #ffffff;
  --term-alert: #ff4757;
  --term-alert-glow: rgba(255, 71, 87, 0.4);
  --term-warning: #ffa502;
  --term-border: #444444;
  --term-highlight: rgba(255, 255, 255, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: var(--font-mono);
  color: var(--term-primary);
  font-size: 17px;
  line-height: 1.45;
  letter-spacing: 0.5px;
  user-select: text;
}

/* ==========================================================================
   Outer Monitor Bezel & Frame
   ========================================================================== */
.monitor-housing {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  padding: 10px;
  background: radial-gradient(circle at center, #232724 0%, var(--crt-bezel) 70%, #111412 100%);
  position: relative;
  overflow: hidden;
}

.bezel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 14px 6px;
  color: #7d8a80;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.monitor-brand {
  font-weight: bold;
  color: #9aa89e;
  text-shadow: 1px 1px 1px #000;
  display: flex;
  align-items: center;
  gap: 8px;
}

.led-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #33ff33;
  box-shadow: 0 0 8px #33ff33;
  animation: pulse-led 3s infinite ease-in-out;
}

.led-indicator.standby {
  background-color: #ff9900;
  box-shadow: 0 0 8px #ff9900;
  animation: blink 1.2s infinite;
}

@keyframes pulse-led {
  0%, 100% { opacity: 0.9; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.9); }
}

/* ==========================================================================
   CRT Glass Screen & Effects
   ========================================================================== */
.crt-screen-frame {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--crt-screen);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: 
    inset 0 0 60px rgba(0, 0, 0, 0.85),
    inset 0 0 15px var(--term-border),
    0 0 20px rgba(0, 0, 0, 0.7);
  border: 3px solid #1c221e;
}

/* Scanlines overlay */
.crt-screen-frame::before {
  content: " ";
  display: block;
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.35) 50%);
  background-size: 100% 4px;
  z-index: 10;
  pointer-events: none;
  opacity: 0.8;
}

/* Vignette / Tube Curvature overlay */
.crt-screen-frame::after {
  content: " ";
  display: block;
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: radial-gradient(circle at center, transparent 65%, rgba(0, 0, 0, 0.6) 100%);
  pointer-events: none;
  z-index: 11;
}

/* CRT Screen Flicker */
.flicker-layer {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(18, 16, 16, 0.03);
  opacity: 0;
  z-index: 12;
  pointer-events: none;
  animation: crt-flicker 0.15s infinite;
}

@keyframes crt-flicker {
  0% { opacity: 0.05; }
  50% { opacity: 0.01; }
  100% { opacity: 0.04; }
}

body.no-scanlines .crt-screen-frame::before {
  display: none;
}

body.no-flicker .flicker-layer {
  display: none;
}

/* Text phosphor bloom effect */
.crt-content, .crt-header-hud, .prompt-row {
  text-shadow: 0 0 3px var(--term-glow);
}

/* ==========================================================================
   CRT Power-On / Boot Screen Overlay (Audio Unlock Strategy)
   ========================================================================== */
.crt-boot-screen {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at center, rgba(8, 20, 14, 0.97) 20%, rgba(2, 5, 3, 0.99) 100%);
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.35s ease-out;
  padding: 20px;
}

.crt-boot-screen.powering-on {
  animation: crt-turn-on 0.45s ease-out forwards;
  pointer-events: none;
}

@keyframes crt-turn-on {
  0% {
    filter: brightness(1);
    opacity: 1;
  }
  25% {
    filter: brightness(3.5);
    transform: scaleY(0.04) scaleX(1);
    background: #fff;
    opacity: 1;
  }
  55% {
    filter: brightness(2);
    transform: scaleY(0.02) scaleX(0.5);
    background: var(--term-bright);
    opacity: 0.9;
  }
  100% {
    filter: brightness(1);
    transform: scale(1);
    opacity: 0;
    visibility: hidden;
  }
}

.boot-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  max-width: 580px;
  width: 90%;
  border: 1px solid var(--term-border);
  padding: 26px 20px;
  background: rgba(0, 20, 10, 0.45);
  border-radius: 6px;
  box-shadow: 0 0 35px rgba(0, 255, 100, 0.12), inset 0 0 15px rgba(0, 255, 100, 0.06);
}

.boot-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.boot-title {
  font-family: var(--font-mono);
  font-size: clamp(20px, 3.8vw, 32px);
  font-weight: bold;
  letter-spacing: 3px;
  color: var(--term-bright);
  text-shadow: 0 0 12px var(--term-glow);
}

.boot-subtitle {
  font-size: 13px;
  letter-spacing: 2.5px;
  color: var(--term-dim);
  opacity: 0.9;
}

.boot-prompt-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  width: 100%;
}

.boot-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: clamp(14px, 2vw, 18px);
  font-weight: bold;
  font-family: var(--font-mono);
  color: #000;
  background: var(--term-bright);
  border: 2px solid var(--term-bright);
  border-radius: 4px;
  box-shadow: 0 0 18px var(--term-glow);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  animation: boot-pulse 1.8s infinite ease-in-out;
}

.boot-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 0 28px var(--term-bright);
}

@keyframes boot-pulse {
  0%, 100% {
    box-shadow: 0 0 14px var(--term-glow);
    filter: brightness(1);
  }
  50% {
    box-shadow: 0 0 26px var(--term-bright);
    filter: brightness(1.18);
  }
}

.boot-cursor-blink {
  animation: blink 0.8s infinite steps(1);
}

.boot-action-hint {
  font-size: 11.5px;
  letter-spacing: 1.2px;
  color: var(--term-bright);
  opacity: 0.8;
}

.boot-footer {
  font-size: 11.5px;
  letter-spacing: 1px;
  color: var(--term-dim);
  border-top: 1px dashed var(--term-border);
  padding-top: 12px;
  width: 100%;
}

.boot-led {
  color: #ff9900;
  display: inline-block;
  margin-right: 4px;
  animation: blink 1.2s infinite;
}

/* ==========================================================================
   HUD Status Bar (Top of CRT)
   ========================================================================== */
.crt-header-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background-color: rgba(0, 0, 0, 0.45);
  border-bottom: 1px solid var(--term-border);
  z-index: 5;
  gap: 8px;
}

.hud-left, .hud-center, .hud-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hud-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  background: var(--term-highlight);
  border: 1px solid var(--term-border);
  border-radius: 4px;
  font-size: 14px;
}

.hud-hp-bar {
  letter-spacing: -1px;
  color: var(--term-bright);
}

.hud-button {
  background: transparent;
  color: var(--term-primary);
  border: 1px solid var(--term-border);
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-shadow: 0 0 3px var(--term-glow);
}

.hud-button:hover {
  background: var(--term-primary);
  color: var(--bg-dark);
  box-shadow: 0 0 8px var(--term-glow);
}

/* ==========================================================================
   Scrollable Terminal Output Log
   ========================================================================== */
.terminal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 5;
}

.terminal-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

/* Custom retro scrollbar */
.terminal-log::-webkit-scrollbar {
  width: 8px;
}
.terminal-log::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.5);
  border-left: 1px solid var(--term-border);
}
.terminal-log::-webkit-scrollbar-thumb {
  background: var(--term-dim);
  border-radius: 2px;
}
.terminal-log::-webkit-scrollbar-thumb:hover {
  background: var(--term-primary);
}

/* Terminal text entries */
.term-line {
  word-break: break-word;
  white-space: pre-wrap;
}

.term-banner {
  color: var(--term-bright);
  font-weight: bold;
  margin-bottom: 8px;
  line-height: 1.15;
  white-space: pre;
  font-family: var(--font-mono);
  font-size: clamp(7.5px, 1.35vw, 13.5px);
  overflow-x: auto;
  overflow-y: visible;
  flex-shrink: 0;
  min-height: fit-content;
  display: block;
  text-shadow: 0 0 6px var(--term-glow);
  -webkit-overflow-scrolling: touch;
}

.term-menu-block {
  white-space: normal;
}

.term-scene-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--term-bright);
  border-bottom: 1px dashed var(--term-border);
  padding-bottom: 4px;
  margin-top: 10px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.term-scene-desc {
  line-height: 1.5;
  color: var(--term-primary);
}

.term-lore-box {
  background: rgba(0, 0, 0, 0.35);
  border-left: 3px solid var(--term-dim);
  padding: 8px 12px;
  margin: 6px 0;
  font-size: 15px;
  color: var(--term-bright);
}

.term-choice-item {
  padding: 4px 8px;
  margin: 2px 0;
  border-radius: 3px;
  transition: background 0.15s;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.term-choice-item:hover {
  background: var(--term-highlight);
  cursor: pointer;
}

.choice-num {
  color: var(--term-bright);
  font-weight: bold;
}

.choice-command {
  color: var(--term-bright);
  font-family: var(--font-mono);
  font-weight: bold;
}

.term-dice-box {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--term-border);
  padding: 10px 14px;
  border-radius: 4px;
  margin: 8px 0;
}

.dice-success {
  border-color: var(--term-primary);
  color: var(--term-bright);
}

.dice-failure {
  border-color: var(--term-alert);
  color: var(--term-alert);
  text-shadow: 0 0 5px var(--term-alert-glow);
}

.term-alert-box {
  background: rgba(255, 51, 68, 0.12);
  border: 1px solid var(--term-alert);
  color: var(--term-alert);
  padding: 8px 12px;
  border-radius: 4px;
  margin: 6px 0;
  text-shadow: 0 0 5px var(--term-alert-glow);
}

.term-item-box {
  background: var(--term-highlight);
  border: 1px solid var(--term-primary);
  color: var(--term-bright);
  padding: 6px 12px;
  border-radius: 4px;
  margin: 6px 0;
}

.term-typo-suggestion {
  background: rgba(255, 204, 0, 0.1);
  border-left: 3px solid var(--term-warning);
  padding: 6px 12px;
  color: var(--term-warning);
  margin: 4px 0;
}

.term-ai-box {
  background: rgba(0, 40, 20, 0.45);
  border-left: 3px solid var(--term-bright);
  border-top: 1px solid rgba(51, 255, 51, 0.2);
  border-bottom: 1px solid rgba(51, 255, 51, 0.2);
  padding: 8px 12px;
  margin: 8px 0;
  border-radius: 0 4px 4px 0;
  color: var(--term-bright);
  line-height: 1.45;
  font-style: italic;
  text-shadow: 0 0 5px var(--term-glow);
}

.term-classic-box {
  background: rgba(0, 0, 0, 0.35);
  border-left: 3px solid var(--term-dim);
  padding: 8px 12px;
  margin: 8px 0;
  border-radius: 0 4px 4px 0;
  color: var(--term-primary);
  line-height: 1.45;
  font-style: italic;
}

.term-token-badge {
  font-size: 11px;
  color: var(--term-dim);
  font-family: var(--font-mono);
  font-style: normal;
  display: block;
  margin-top: 4px;
}

.hud-clickable {
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.hud-clickable:hover {
  background: var(--term-highlight);
  border-color: var(--term-bright);
}

.hud-button.active-ai, .hud-tag.active-ai {
  background: var(--term-highlight);
  border-color: var(--term-bright);
  color: var(--term-bright);
  box-shadow: 0 0 6px var(--term-glow);
}


/* ==========================================================================
   Command Input Line
   ========================================================================== */
.prompt-container {
  padding: 10px 20px 14px;
  background-color: rgba(0, 0, 0, 0.55);
  border-top: 1px solid var(--term-border);
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 5;
}

.prompt-prefix {
  color: var(--term-bright);
  font-weight: bold;
  white-space: nowrap;
}

.prompt-input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.cmd-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--term-primary);
  text-shadow: 0 0 3px var(--term-glow);
  caret-color: transparent;
}

.cmd-cursor {
  position: absolute;
  pointer-events: none;
  color: var(--term-bright);
  font-weight: bold;
  font-size: 18px;
  animation: blink 0.9s infinite step-end;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ==========================================================================
   Modals & Overlays (Stories Catalog, Saves, Drag & Drop)
   ========================================================================== */
.modal-overlay {
  display: none;
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 50;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-window {
  background: var(--crt-screen);
  border: 2px solid var(--term-primary);
  box-shadow: 0 0 25px var(--term-glow), inset 0 0 15px rgba(0, 0, 0, 0.8);
  border-radius: 8px;
  width: 100%;
  max-width: 750px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--term-border);
  background: var(--term-highlight);
  color: var(--term-bright);
  font-weight: bold;
}

.modal-close-btn {
  background: transparent;
  border: 1px solid var(--term-border);
  color: var(--term-primary);
  font-family: var(--font-mono);
  padding: 2px 8px;
  cursor: pointer;
}
.modal-close-btn:hover {
  background: var(--term-alert);
  color: #fff;
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Story catalog cards */
.story-card {
  border: 1px solid var(--term-border);
  padding: 12px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s;
}

.story-card:hover {
  border-color: var(--term-primary);
  background: var(--term-highlight);
}

.story-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.story-card-title {
  font-size: 18px;
  font-weight: bold;
  color: var(--term-bright);
}

.story-card-meta {
  font-size: 13px;
  color: var(--term-dim);
}

.story-card-desc {
  font-size: 14px;
  color: var(--term-primary);
}

.story-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

/* Drag and Drop Fullscreen Target */
.drop-overlay {
  display: none;
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(5, 20, 9, 0.92);
  border: 4px dashed var(--term-primary);
  z-index: 100;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 15px;
  color: var(--term-bright);
  font-size: 22px;
  text-align: center;
  padding: 30px;
  pointer-events: none;
}

.drop-overlay.active {
  display: flex;
}

/* ==========================================================================
   Creator Workshop & Studios Styling (Multiplayer, Art, Music, Story Wizard)
   ========================================================================== */

/* Modal Tabs Navigation */
.modal-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--term-border);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.modal-tab-btn {
  background: transparent;
  border: 1px solid var(--term-border);
  color: var(--term-dim);
  font-family: var(--font-mono);
  padding: 5px 12px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 14px;
}

.modal-tab-btn:hover {
  color: var(--term-bright);
  border-color: var(--term-primary);
}

.modal-tab-btn.active {
  background: var(--term-highlight);
  color: var(--term-bright);
  border-color: var(--term-primary);
  box-shadow: 0 0 8px var(--term-glow);
}

.studio-panel {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.studio-panel.active {
  display: flex;
}

/* Studio Form Controls */
.studio-input, .studio-select, .studio-textarea {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--term-border);
  color: var(--term-primary);
  font-family: var(--font-mono);
  font-size: 15px;
  padding: 6px 10px;
  border-radius: 4px;
  outline: none;
}

.studio-input:focus, .studio-select:focus, .studio-textarea:focus {
  border-color: var(--term-primary);
  box-shadow: 0 0 6px var(--term-glow);
}

.studio-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.studio-label {
  font-size: 14px;
  color: var(--term-bright);
  min-width: 110px;
}

/* --- Art Studio & Pixel Canvas --- */
.pixel-canvas-container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
  justify-content: center;
}

.pixel-grid-wrapper {
  background: rgba(0, 0, 0, 0.7);
  padding: 10px;
  border: 2px solid var(--term-border);
  border-radius: 6px;
  display: inline-block;
}

.pixel-grid {
  display: grid;
  gap: 1px;
  background-color: #111;
  user-select: none;
}

.pixel-cell {
  width: 16px;
  height: 16px;
  background-color: #051408;
  cursor: crosshair;
  transition: background 0.05s;
}

.pixel-cell:hover {
  outline: 1px solid var(--term-bright);
  z-index: 2;
}

.art-palette-bar {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.palette-swatch {
  width: 24px;
  height: 24px;
  border-radius: 3px;
  border: 1px solid #333;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

.palette-swatch:hover, .palette-swatch.active {
  transform: scale(1.18);
  box-shadow: 0 0 8px #fff;
  border-color: #fff;
}

/* --- Music Studio & Sequencer --- */
.music-sequencer-board {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--term-border);
  padding: 12px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-x: auto;
}

.seq-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.seq-note-label {
  width: 42px;
  font-size: 13px;
  font-weight: bold;
  color: var(--term-bright);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  border: 1px solid transparent;
}

.seq-note-label:hover {
  background: var(--term-highlight);
  border-color: var(--term-border);
}

.seq-step {
  width: 28px;
  height: 24px;
  background: rgba(20, 50, 25, 0.4);
  border: 1px solid var(--term-border);
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.1s;
}

.seq-step:hover {
  border-color: var(--term-bright);
}

.seq-step.active {
  background: var(--term-primary);
  box-shadow: 0 0 8px var(--term-glow);
}

.seq-step.playing {
  border-color: #fff;
  transform: scale(1.1);
}

/* --- Multiplayer Room View --- */
.mp-party-radar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--term-border);
  border-radius: 4px;
  margin-bottom: 6px;
  min-height: 28px;
  align-items: center;
}

.mp-player-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: 3px;
  background: rgba(0, 255, 102, 0.08);
  border: 1px solid var(--term-primary);
  color: var(--term-bright);
}

.mp-player-chip.is-dm {
  border-color: var(--term-warning);
  color: var(--term-warning);
  background: rgba(255, 204, 0, 0.08);
}

.mp-pending-roll {
  background: rgba(0, 40, 20, 0.85);
  border: 2px solid var(--term-bright);
  box-shadow: 0 0 15px var(--term-glow);
  padding: 10px 14px;
  border-radius: 4px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mp-active-scene-card {
  background: rgba(0, 20, 10, 0.65);
  border: 1px solid var(--term-primary);
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mp-scene-card-header {
  font-weight: bold;
  font-size: 15px;
  color: var(--term-bright);
  border-bottom: 1px dashed var(--term-border);
  padding-bottom: 4px;
}

.mp-scene-card-body {
  font-size: 13px;
  line-height: 1.4;
  color: var(--term-primary);
}

.mp-scene-card-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.mp-opt-btn {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--term-border);
  color: var(--term-bright);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mp-opt-btn:hover {
  background: var(--term-highlight);
  border-color: var(--term-primary);
  box-shadow: 0 0 6px var(--term-glow);
}

.mp-chat-box {
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--term-border);
  border-radius: 4px;
  height: 180px;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.mp-chat-msg {
  word-break: break-word;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .monitor-housing {
    padding: 2px;
  }
  .crt-screen-frame {
    border-radius: 0;
  }
  .hud-button span {
    display: none;
  }
  .hud-tag {
    font-size: 12px;
  }
  .pixel-cell {
    width: 12px;
    height: 12px;
  }
  .seq-step {
    width: 20px;
    height: 20px;
  }
  .term-banner {
    font-size: clamp(8px, 2.2vw, 12px);
    line-height: 1.12;
  }
}

@media (max-width: 480px) {
  .term-banner {
    font-size: 11px;
    line-height: 1.2;
  }
}



