/**
 * Beta Styles - OS Boot Sequence Aesthetic
 * Combines Pip-Boy (Retro), Ready Player One (Gamified), Jony Ive (Clean/Functional)
 */

:root {
  /* PALETTE */
  --hex-black: #050505;
  --hex-green: #00ff41;
  --hex-dim: rgba(0, 255, 65, 0.1);
  --hex-cyan: #00f3ff;
  --hex-amber: #ffaa00;
  --hex-red: #ff0033;
  --glass: rgba(10, 10, 10, 0.85);

  /* SPACING */
  --pad: 1.5rem;
  --radius: 4px; /* Slight roundness, not full pill */
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background-color: var(--hex-black);
  color: var(--hex-green);
  font-family: "Inter", sans-serif;
  height: 100vh;
  overflow: hidden; /* App-like feel */
  display: flex;
  flex-direction: column;
}

/* TYPOGRAPHY */
h1,
h2,
h3,
.mono {
  font-family: "JetBrains Mono", monospace;
  letter-spacing: -0.5px;
}

.accent {
  color: var(--hex-cyan);
}

.warn {
  color: var(--hex-amber);
}

.error {
  color: var(--hex-red);
}

/* --- BOOT SEQUENCE --- */
.beta-boot-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--hex-black);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align: center;
  transition: opacity 0.5s ease;
  opacity: 1;
}

.beta-boot-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--hex-green);
}

.beta-boot-log {
  font-size: 0.8rem;
  opacity: 0.7;
  margin-top: 1rem;
  color: var(--hex-green);
  font-family: "JetBrains Mono", monospace;
}

/* --- APP SHELL (Responsive Grid) --- */
.beta-app-shell {
  display: grid;
  height: 100vh;
  width: 100vw;
  position: relative;
  /* Default Mobile: 1 col, HUD at bottom */
  grid-template-rows: auto 1fr auto;
  grid-template-columns: 1fr;
  opacity: 1;
  visibility: visible;
  transition: opacity 1s ease;
  background: var(--hex-black);
  color: var(--hex-green);
  overflow: hidden;
}

.beta-screen-active {
  display: grid !important;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: 1fr;
  height: 100%;
  width: 100%;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* Mobile: Compact tab bar at bottom */
@media (max-width: 767px) {
  .beta-screen-active {
    padding-bottom: calc(
      60px + env(safe-area-inset-bottom, 0)
    ); /* Space for compact mobile tab bar */
  }

  .beta-stage-area {
    padding-bottom: 1rem;
  }

  /* Hide desktop HUD on mobile */
  #beta-desktop-hud {
    display: none !important;
  }

  /* Mobile HUD - Horizontal Tab Bar */
  .beta-hud-panel {
    position: fixed !important;
    bottom: 0;
    left: 0;
    right: 0;
    min-height: auto !important;
    height: auto;
    padding: 0 !important;
    padding-bottom: env(safe-area-inset-bottom, 0) !important;
    background: var(--hex-black);
    border-top: 1px solid var(--hex-cyan);
    z-index: 1000;
    display: flex !important;
    flex-direction: row !important;
    gap: 0;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.8);
  }

  /* Hide header and spacer on mobile */
  .beta-hud-panel .beta-hud-header,
  .beta-hud-panel .beta-spacer,
  .beta-hud-panel > div:not(.beta-quick-actions) {
    display: none !important;
  }

  /* Quick actions become horizontal tabs */
  .beta-hud-panel .beta-quick-actions {
    display: flex !important;
    flex-direction: row !important;
    width: 100%;
    gap: 0 !important;
    padding: 0;
    margin: 0;
  }

  /* Each button becomes a tab */
  .beta-hud-panel .beta-quick-actions button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px 6px;
    background: transparent;
    border: none;
    border-right: 1px solid rgba(0, 243, 255, 0.15);
    border-radius: 0;
    color: var(--hex-green);
    font-family: "JetBrains Mono", monospace;
    transition:
      background 0.2s,
      color 0.2s;
    min-width: 0;
    width: 20%;
  }

  .beta-hud-panel .beta-quick-actions button:last-child {
    border-right: none;
  }

  .beta-hud-panel .beta-quick-actions button:active {
    background: rgba(0, 243, 255, 0.2);
    color: var(--hex-cyan);
  }

  /* Icon styling in tab bar */
  .beta-hud-panel .beta-quick-actions button i {
    font-size: 1.3rem;
    margin-right: 0;
    display: block;
    line-height: 1;
  }

  /* Text label below icon */
  .beta-hud-panel .beta-quick-actions button span {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
    white-space: nowrap;
  }

  /* Very small screens - icons only */
  @media (max-width: 360px) {
    .beta-hud-panel .beta-quick-actions button span {
      display: none;
    }
    .beta-hud-panel .beta-quick-actions button {
      padding: 10px 4px;
    }
    .beta-hud-panel .beta-quick-actions button i {
      font-size: 1.5rem;
    }
  }
}

.beta-screen-hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Ensure screens don't stack - only one active at a time */
#beta-app-shell > .beta-screen-active ~ .beta-screen-active {
  /* If multiple screens somehow both have beta-screen-active, hide later ones */
  display: none !important;
}

/* --- UNIFIED HEADER --- */
.beta-app-header {
  padding: 0.75rem var(--pad);
  border-bottom: 1px solid var(--hex-green);
  background: var(--glass);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  backdrop-filter: blur(10px);
  z-index: 10;
}

.beta-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.beta-header-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(0, 243, 255, 0.1);
  border: 1px solid var(--hex-cyan);
  border-radius: 4px;
  color: var(--hex-cyan);
  cursor: pointer;
  transition: all 0.2s;
}

.beta-header-back:hover {
  background: rgba(0, 243, 255, 0.2);
}

.beta-header-back:active {
  transform: scale(0.95);
}

.beta-header-center {
  text-align: center;
}

.beta-header-title {
  font-size: 0.85rem;
  color: var(--hex-cyan);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.beta-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.beta-header-stats {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.beta-stat-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(0, 255, 65, 0.3);
  border-radius: 12px;
  font-size: 0.75rem;
  font-family: "JetBrains Mono", monospace;
}

.beta-stat-pill.credits {
  color: var(--hex-amber);
  border-color: rgba(255, 170, 0, 0.3);
}

.beta-stat-pill.health {
  color: var(--hex-green);
  border-color: rgba(0, 255, 65, 0.3);
}

.beta-stat-pill.stress {
  color: var(--hex-red);
  border-color: rgba(255, 0, 51, 0.3);
  animation: pulse-stress 2s infinite;
}

@keyframes pulse-stress {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.beta-stat-pill i {
  font-size: 0.9rem;
}

.beta-logo {
  font-weight: 700;
  font-size: 1.1rem;
  font-family: "JetBrains Mono", monospace;
}

.beta-step-indicator {
  font-size: 0.8rem;
  opacity: 0.6;
  font-family: "JetBrains Mono", monospace;
}

/* Mobile header adjustments */
@media (max-width: 767px) {
  .beta-app-header {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
  }

  .beta-logo {
    font-size: 0.9rem;
  }

  .beta-header-title {
    font-size: 0.7rem;
  }

  .beta-stat-pill {
    padding: 3px 6px;
    font-size: 0.65rem;
  }

  .beta-stat-pill i {
    font-size: 0.8rem;
  }

  .beta-header-back {
    width: 32px;
    height: 32px;
  }
}

/* Very small screens - compact header */
@media (max-width: 380px) {
  .beta-stat-pill span {
    display: none;
  }

  .beta-stat-pill {
    padding: 4px;
    border-radius: 50%;
  }
}

/* --- MAIN CONTENT AREA --- */
.beta-stage-area {
  overflow-y: auto;
  padding: var(--pad);
  padding-bottom: 180px; /* Space for bottom HUD on mobile */
  -webkit-overflow-scrolling: touch;
  min-height: 0; /* Important for grid children */
}

/* --- CATEGORY HEADERS --- */
.beta-category-header {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--hex-dim);
  padding-bottom: 0.5rem;
  color: var(--hex-cyan);
  font-family: "JetBrains Mono", monospace;
}

.beta-category-header:first-child {
  margin-top: 0;
}

/* --- CARD GRID --- */
.beta-card-grid {
  display: grid;
  grid-template-columns: 1fr; /* Mobile default */
  gap: 1rem;
  margin-bottom: 2rem;
}

/* --- ARCHETYPE CARD (Jony Ive + Pip Boy) --- */
.beta-archetype-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #333;
  padding: 1.25rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.beta-archetype-card:hover {
  border-color: var(--hex-green);
  background: var(--hex-dim);
}

.beta-archetype-card.selected {
  border-color: var(--hex-cyan);
  background: rgba(0, 243, 255, 0.1);
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.1);
}

.beta-card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: block;
  color: var(--hex-green);
}

.beta-card-title {
  font-size: 1.1rem;
  margin: 0 0 0.5rem 0;
  font-weight: 600;
  font-family: "JetBrains Mono", monospace;
  color: var(--hex-green);
}

.beta-card-desc {
  font-size: 0.85rem;
  opacity: 0.7;
  line-height: 1.4;
  color: var(--hex-green);
}

.beta-card-stats {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  opacity: 0.5;
  font-family: "JetBrains Mono", monospace;
}

/* --- HUD PANEL (Tab Bar on Mobile, Sidebar on Desktop) --- */
.beta-hud-panel {
  background: var(--glass);
  border-top: 1px solid var(--hex-cyan);
  padding: 1rem var(--pad);
  backdrop-filter: blur(15px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Quick actions default styling */
.beta-quick-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.beta-quick-actions button {
  width: 100%;
}

.beta-hud-header {
  font-family: "JetBrains Mono", monospace;
  color: var(--hex-cyan);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  font-weight: 600;
}

.beta-hud-stats {
  display: flex;
  justify-content: space-around;
  text-align: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.beta-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
  padding: 0.5rem;
}

.beta-stat-box .beta-stat-val {
  font-size: 1.8rem;
  font-weight: 700;
  display: block;
  font-family: "JetBrains Mono", monospace;
  color: var(--hex-green);
  text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
  transition: all 0.3s ease;
}

.beta-stat-box .beta-stat-val.updating {
  color: var(--hex-cyan);
  text-shadow: 0 0 15px rgba(0, 243, 255, 0.8);
}

.beta-stat-box .beta-stat-lbl {
  font-size: 0.7rem;
  opacity: 0.6;
  text-transform: uppercase;
  color: var(--hex-green);
}

/* --- BUTTONS --- */
.beta-btn-main {
  width: 100%;
  background: var(--hex-green);
  color: var(--hex-black);
  border: none;
  padding: 1rem;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px);
  transition: all 0.2s ease;
}

.beta-btn-main:hover:not(:disabled) {
  background: var(--hex-cyan);
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
}

.beta-btn-main:disabled,
.beta-btn-main.disabled {
  background: #333;
  color: #666;
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none;
}

.beta-btn-main:not(:disabled):not(.disabled) {
  opacity: 1;
  pointer-events: auto;
}

.beta-btn-secondary {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: 1px solid var(--hex-green);
  color: var(--hex-green);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.beta-btn-secondary:hover {
  background: var(--hex-dim);
  border-color: var(--hex-cyan);
}

/* --- CHARACTER SETUP --- */
.beta-char-setup {
  max-width: 600px;
  margin: 0 auto;
}

.beta-name-input {
  margin-bottom: 2rem;
}

.beta-name-input label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--hex-cyan);
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
}

.beta-name-input input {
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--hex-green);
  color: var(--hex-green);
  font-family: "JetBrains Mono", monospace;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.beta-name-input input:focus {
  outline: none;
  border-color: var(--hex-cyan);
  background: rgba(0, 243, 255, 0.05);
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

.beta-char-counter {
  margin-top: 0.5rem;
  text-align: right;
  color: var(--hex-green);
  font-size: 0.8rem;
  opacity: 0.6;
  font-family: "JetBrains Mono", monospace;
}

/* --- STATS ALLOCATION --- */
.beta-stats-allocation {
  margin-bottom: 2rem;
}

.beta-stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.beta-stats-total {
  font-size: 1.2rem;
  color: var(--hex-green);
  font-family: "JetBrains Mono", monospace;
}

.beta-stats-total.valid {
  color: var(--hex-green);
}

.beta-stats-total.invalid {
  color: var(--hex-red);
}

.beta-stat-control {
  margin-bottom: 1.5rem;
}

.beta-stat-control label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--hex-cyan);
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
}

.beta-stat-slider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.beta-stat-slider button {
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--hex-green);
  color: var(--hex-green);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: "JetBrains Mono", monospace;
}

.beta-stat-slider button:hover {
  background: var(--hex-green);
  color: var(--hex-black);
}

.beta-stat-value {
  min-width: 60px;
  text-align: center;
  font-size: 1.5rem;
  color: var(--hex-green);
  font-family: "JetBrains Mono", monospace;
}

.beta-stat-bar {
  width: 100%;
  height: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--hex-green);
  overflow: hidden;
}

.beta-stat-fill {
  height: 100%;
  background: var(--hex-green);
  transition: width 0.3s ease;
}

/* --- MISSION BOARD --- */
.beta-mission-board {
  padding: var(--pad);
  max-width: 1200px;
  margin: 0 auto;
}

.beta-board-header {
  text-align: center;
  margin-bottom: 2rem;
}

.beta-board-header h1 {
  font-size: 2rem;
  text-shadow: 0 0 20px var(--hex-green);
  margin-bottom: 0.5rem;
  font-family: "JetBrains Mono", monospace;
}

.beta-contracts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.beta-contract-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--hex-green);
  padding: 1.5rem;
  position: relative;
  transition: all 0.3s ease;
}

.beta-contract-card:hover {
  background: var(--hex-dim);
  box-shadow: 0 0 20px var(--hex-green);
  transform: translateY(-2px);
}

.beta-contract-card.tutorial {
  border-color: var(--hex-amber);
}

.beta-tutorial-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--hex-amber);
  color: var(--hex-black);
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: bold;
  font-family: "JetBrains Mono", monospace;
}

.beta-contract-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: var(--hex-green);
  font-family: "JetBrains Mono", monospace;
}

.beta-contract-card p {
  color: var(--hex-green);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  opacity: 0.8;
}

.beta-contract-rewards {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  font-family: "JetBrains Mono", monospace;
  align-items: center;
}

.beta-contract-rewards i {
  margin-right: 0.25rem;
}

.beta-contract-risk {
  margin-bottom: 1rem;
  font-size: 0.85rem;
  opacity: 0.7;
}

.beta-contract-risk .risk-low {
  color: var(--hex-green);
}

.beta-contract-risk .risk-medium {
  color: var(--hex-amber);
}

.beta-contract-risk .risk-high {
  color: var(--hex-red);
}

/* --- ENCOUNTER SYSTEM --- */
.beta-encounter {
  padding: var(--pad);
  max-width: 800px;
  margin: 0 auto;
}

.beta-encounter-header {
  text-align: center;
  margin-bottom: 2rem;
}

.beta-encounter-header h2 {
  font-size: 2rem;
  text-shadow: 0 0 20px var(--hex-green);
  font-family: "JetBrains Mono", monospace;
}

.beta-encounter-choices {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.beta-encounter-choice {
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--hex-green);
  color: var(--hex-green);
  font-family: "JetBrains Mono", monospace;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
}

.beta-encounter-choice:hover {
  background: var(--hex-dim);
  box-shadow: 0 0 20px var(--hex-green);
  transform: translateX(5px);
}

/* --- MISSION COMPLETE --- */
.beta-mission-complete {
  padding: 3rem var(--pad);
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.beta-complete-header h1 {
  font-size: 2.5rem;
  text-shadow: 0 0 30px var(--hex-green);
  margin-bottom: 2rem;
  font-family: "JetBrains Mono", monospace;
  animation: beta-glow 2s infinite;
}

.beta-complete-rewards {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.beta-reward-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.beta-reward-icon {
  font-size: 3rem;
}

.beta-reward-amount {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--hex-green);
  font-family: "JetBrains Mono", monospace;
}

/* --- RESPONSIVE BREAKPOINTS --- */

/* TABLET & UP (2 Columns: Content + Sidebar) */
@media (min-width: 768px) {
  .beta-app-shell {
    grid-template-rows: 1fr;
    grid-template-columns: 1fr 320px; /* Sidebar takes 320px */
  }

  /* Desktop: Screen is a 2-column layout with content + sidebar */
  .beta-screen-active {
    grid-column: 1 / -1; /* Span all columns of app shell */
    grid-row: 1;
    display: grid !important;
    grid-template-rows: auto 1fr;
    grid-template-columns: 1fr 320px; /* Content + Sidebar */
    height: 100vh;
    overflow: hidden;
  }

  /* Header spans both columns */
  .beta-screen-active > header.beta-app-header {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  /* Main content area */
  .beta-screen-active > main.beta-stage-area {
    grid-column: 1;
    grid-row: 2;
    overflow-y: auto;
    padding: 1rem 2rem;
    padding-bottom: 2rem;
  }

  /* Sidebar HUD panel */
  .beta-screen-active > .beta-hud-panel {
    display: flex !important;
    flex-direction: column;
    grid-column: 2;
    grid-row: 2;
    background: var(--glass);
    border-left: 2px solid var(--hex-cyan);
    box-shadow: -5px 0 20px rgba(0, 243, 255, 0.1);
    padding: 1rem;
    overflow-y: auto;
  }

  /* Desktop HUD Panel (separate element) - HIDE since we use in-screen HUD */
  #beta-desktop-hud {
    display: none !important;
  }

  /* Visual separator line for desktop HUD */
  #beta-desktop-hud::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(
      to bottom,
      transparent 0%,
      var(--hex-cyan) 5%,
      var(--hex-cyan) 95%,
      transparent 100%
    );
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.6);
    z-index: 1;
  }

  /* Add separator line after header in HUD */
  #beta-desktop-hud .beta-hud-header {
    position: relative;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
  }

  #beta-desktop-hud .beta-hud-header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
      to right,
      transparent 0%,
      var(--hex-cyan) 10%,
      var(--hex-cyan) 90%,
      transparent 100%
    );
    opacity: 0.6;
    box-shadow: 0 0 8px rgba(0, 243, 255, 0.4);
  }

  /* Add separator before stats section */
  #beta-desktop-hud .beta-hud-stats {
    position: relative;
    padding-top: 1rem;
    margin-top: 1rem;
  }

  #beta-desktop-hud .beta-hud-stats::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
      to right,
      transparent 0%,
      var(--hex-cyan) 10%,
      var(--hex-cyan) 90%,
      transparent 100%
    );
    opacity: 0.3;
  }

  /* HUD panel is styled via grid on desktop - no need to hide */

  .beta-app-header {
    grid-column: 1;
    grid-row: 1;
    background: var(--glass);
    border-bottom: 1px solid var(--hex-green);
    position: relative;
    z-index: 10;
  }

  .beta-stage-area {
    grid-column: 1;
    grid-row: 2;
    padding-top: 1rem;
    padding-bottom: 2rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0; /* Important for grid children */
    padding-bottom: 2rem; /* No extra padding needed on desktop */
  }

  .beta-card-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 cards wide */
  }

  .beta-contracts-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .beta-hud-stats {
    flex-direction: column;
    gap: 2rem;
    text-align: left;
  }

  .beta-stat-box {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
  }

  .beta-btn-main {
    margin-top: auto; /* Push button to bottom */
  }
}

/* DESKTOP & UP (3 Columns or Wide 2-Column) */
@media (min-width: 1024px) {
  .beta-card-grid {
    grid-template-columns: repeat(3, 1fr); /* 3 cards wide */
  }

  .beta-contracts-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .beta-app-shell {
    grid-template-columns: 1fr 360px; /* Wider sidebar on desktop */
  }

  .beta-hud-panel {
    grid-column: 2;
  }
}

/* --- UTILITY CLASSES --- */
.beta-char-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
}

.beta-spacer {
  flex-grow: 1;
}

/* --- HISTORY DECRYPT SCREEN --- */
.beta-history-decrypt {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.beta-decrypt-header {
  margin-bottom: 2rem;
}

.beta-decrypt-header h2 {
  font-size: 2rem;
  text-shadow: 0 0 20px var(--hex-green);
  margin-bottom: 0.5rem;
  font-family: "JetBrains Mono", monospace;
}

.beta-matrix-canvas {
  width: 100%;
  height: 400px;
  background: var(--hex-black);
  border: 1px solid var(--hex-cyan);
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.beta-decrypt-content {
  text-align: left;
  animation: beta-fade-in 0.5s ease;
}

.beta-history-item {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(0, 243, 255, 0.05);
  border-left: 2px solid var(--hex-cyan);
  transition: all 0.3s ease;
}

.beta-history-item:hover {
  background: rgba(0, 243, 255, 0.1);
  border-left-color: var(--hex-green);
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

.beta-history-label {
  font-size: 0.8rem;
  color: var(--hex-cyan);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.beta-history-value {
  font-size: 1rem;
  color: var(--hex-green);
  line-height: 1.6;
  font-family: "Inter", sans-serif;
}

.beta-decrypt-status {
  font-size: 0.9rem;
  color: var(--hex-cyan);
  text-align: center;
  padding: 0.5rem;
  border: 1px solid var(--hex-cyan);
  background: rgba(0, 243, 255, 0.05);
}

@keyframes beta-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- POST-CREATION CHOICE SCREEN --- */
.beta-post-creation-choice {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  padding: 2rem;
}

.beta-choice-header {
  margin-bottom: 3rem;
}

.beta-choice-header h2 {
  font-size: 2.5rem;
  text-shadow: 0 0 20px var(--hex-green);
  margin-bottom: 0.5rem;
}

.beta-choice-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.beta-choice-card {
  padding: 2rem;
  background: rgba(0, 243, 255, 0.05);
  border: 2px solid var(--hex-cyan);
  border-radius: var(--radius);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.beta-choice-card:hover {
  background: rgba(0, 243, 255, 0.1);
  border-color: var(--hex-green);
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
  transform: translateY(-5px);
}

.beta-choice-card h3 {
  margin: 1rem 0;
  color: var(--hex-cyan);
}

.beta-choice-card p {
  opacity: 0.7;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.beta-choice-card button {
  width: 100%;
}

/* --- OPEN WORLD STYLES --- */
.beta-open-world-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.beta-location-info {
  margin-bottom: 3rem;
}

.beta-current-location {
  margin-bottom: 2rem;
}

.beta-location-card {
  padding: 1.5rem;
  background: rgba(0, 243, 255, 0.05);
  border: 1px solid var(--hex-cyan);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.beta-location-card h3 {
  color: var(--hex-cyan);
  margin-bottom: 0.5rem;
}

.beta-location-services {
  margin-top: 1rem;
  font-size: 0.85rem;
  opacity: 0.7;
}

.beta-location-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.beta-location-actions button {
  flex: 1;
  min-width: 200px;
}

.beta-available-locations h2 {
  margin-bottom: 1.5rem;
  color: var(--hex-cyan);
}

.beta-locations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.beta-location-card {
  position: relative;
}

.beta-location-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.beta-location-type {
  font-size: 0.75rem;
  color: var(--hex-amber);
  padding: 0.25rem 0.5rem;
  background: rgba(255, 170, 0, 0.1);
  border-radius: var(--radius);
}

.beta-location-meta {
  margin: 1rem 0;
  font-size: 0.85rem;
  opacity: 0.7;
  display: flex;
  justify-content: space-between;
}

.beta-service-tag {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  margin: 0.25rem;
  background: rgba(0, 255, 65, 0.1);
  border: 1px solid var(--hex-green);
  border-radius: var(--radius);
  font-size: 0.75rem;
}

.beta-travel-btn {
  width: 100%;
  margin-top: 1rem;
}

/* --- TRAVEL SCREEN --- */
.beta-travel-screen {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
}

.beta-travel-header h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--hex-cyan);
}

.beta-travel-progress {
  margin: 2rem 0;
}

.beta-travel-bar {
  width: 100%;
  height: 30px;
  background: rgba(0, 243, 255, 0.1);
  border: 2px solid var(--hex-cyan);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  margin-bottom: 1rem;
}

.beta-travel-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--hex-cyan), var(--hex-green));
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px var(--hex-cyan);
}

.beta-travel-time {
  font-size: 1.5rem;
  color: var(--hex-green);
}

.beta-travel-encounters {
  max-height: 300px;
  overflow-y: auto;
  text-align: left;
  margin-top: 2rem;
  padding: 1rem;
  background: rgba(0, 243, 255, 0.05);
  border: 1px solid var(--hex-cyan);
  border-radius: var(--radius);
}

.beta-travel-encounter {
  padding: 0.5rem;
  margin: 0.5rem 0;
  font-family: "JetBrains Mono", monospace;
  color: var(--hex-green);
  opacity: 0.8;
}

/* --- QUESTS SCREEN --- */
.beta-quests-screen {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

.beta-quests-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.beta-quests-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.beta-quest-card {
  padding: 1.5rem;
  background: rgba(0, 243, 255, 0.05);
  border: 1px solid var(--hex-cyan);
  border-radius: var(--radius);
  transition: all 0.3s ease;
}

.beta-quest-card:hover {
  background: rgba(0, 243, 255, 0.1);
  border-color: var(--hex-green);
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
}

.beta-quest-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.beta-quest-type {
  font-size: 0.75rem;
  color: var(--hex-amber);
  padding: 0.25rem 0.5rem;
  background: rgba(255, 170, 0, 0.1);
  border-radius: var(--radius);
}

.beta-quest-rewards {
  margin: 1rem 0;
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
}

.beta-quest-rewards i {
  margin-right: 0.25rem;
}

.beta-quest-risk {
  margin: 1rem 0;
  font-size: 0.85rem;
}

.beta-accept-quest {
  width: 100%;
  margin-top: 1rem;
}

/* --- MAP SCREEN --- */
.beta-map-screen {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.beta-map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.beta-map-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.beta-map-location {
  padding: 1.5rem;
  background: rgba(0, 243, 255, 0.05);
  border: 2px solid var(--hex-cyan);
  border-radius: var(--radius);
  text-align: center;
  transition: all 0.3s ease;
}

.beta-map-location.current {
  border-color: var(--hex-green);
  background: rgba(0, 255, 65, 0.1);
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
}

.beta-map-location-name {
  font-size: 1.2rem;
  color: var(--hex-cyan);
  margin-bottom: 0.5rem;
  font-family: "JetBrains Mono", monospace;
}

.beta-map-location-type {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 1rem;
}

.beta-map-current-badge {
  color: var(--hex-green);
  font-size: 0.9rem;
  margin-top: 1rem;
  padding: 0.5rem;
  background: rgba(0, 255, 65, 0.1);
  border-radius: var(--radius);
}

.beta-map-travel {
  width: 100%;
  margin-top: 1rem;
}

/* --- ENHANCED HUD STYLES --- */
.beta-hud-section {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 243, 255, 0.2);
}

.beta-hud-section:last-child {
  border-bottom: none;
}

.beta-hud-stat-group {
  margin-top: 1rem;
}

.beta-hud-stat-item {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.beta-hud-label {
  font-size: 0.75rem;
  color: var(--hex-cyan);
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.beta-hud-value {
  font-size: 1rem;
  color: var(--hex-green);
  font-family: "JetBrains Mono", monospace;
}

.beta-hud-bar {
  width: 100%;
  height: 8px;
  background: rgba(0, 243, 255, 0.1);
  border: 1px solid var(--hex-cyan);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.beta-hud-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--hex-cyan), var(--hex-green));
  transition: width 0.3s ease;
  box-shadow: 0 0 5px var(--hex-cyan);
}

.beta-hud-list {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  max-height: 150px;
  overflow-y: auto;
}

.beta-crew-member-mini,
.beta-inventory-item-mini {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem;
  margin: 0.25rem 0;
  background: rgba(0, 243, 255, 0.05);
  border-left: 2px solid var(--hex-cyan);
  border-radius: 2px;
}

.beta-crew-name,
.beta-item-name {
  color: var(--hex-green);
  flex: 1;
}

.beta-crew-role,
.beta-item-count {
  color: var(--hex-cyan);
  opacity: 0.7;
  font-size: 0.75rem;
}

@keyframes beta-pulse {
  0%,
  100% {
    opacity: 1;
    text-shadow: 0 0 10px var(--hex-red);
  }
  50% {
    opacity: 0.7;
    text-shadow: 0 0 20px var(--hex-red);
  }
}

/* --- MARKETPLACE STYLES --- */
.beta-marketplace {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.beta-marketplace-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.beta-marketplace-credits {
  font-size: 1.2rem;
  color: var(--hex-green);
}

.beta-marketplace-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--hex-cyan);
  padding-bottom: 0.5rem;
}

.beta-tab {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  color: var(--hex-cyan);
  font-family: "JetBrains Mono", monospace;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.beta-tab:hover {
  color: var(--hex-green);
  background: rgba(0, 255, 65, 0.1);
}

.beta-tab.active {
  color: var(--hex-green);
  border-bottom-color: var(--hex-green);
}

.beta-marketplace-content {
  min-height: 400px;
}

.beta-marketplace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.beta-marketplace-item {
  padding: 1.5rem;
  background: rgba(0, 243, 255, 0.05);
  border: 1px solid var(--hex-cyan);
  border-radius: var(--radius);
  transition: all 0.3s ease;
}

.beta-marketplace-item:hover {
  background: rgba(0, 243, 255, 0.1);
  border-color: var(--hex-green);
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
}

.beta-marketplace-item.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.beta-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.beta-item-header h3 {
  color: var(--hex-cyan);
  margin: 0;
  font-size: 1.2rem;
}

.beta-item-type {
  font-size: 0.75rem;
  color: var(--hex-amber);
  padding: 0.25rem 0.5rem;
  background: rgba(255, 170, 0, 0.1);
  border-radius: var(--radius);
}

.beta-item-description {
  opacity: 0.8;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.beta-item-meta {
  margin: 1rem 0;
  font-size: 0.85rem;
  opacity: 0.7;
  display: flex;
  justify-content: space-between;
}

.beta-crew-stats {
  font-size: 0.85rem;
  opacity: 0.8;
}

.beta-upgrade-level {
  margin: 0.5rem 0;
  color: var(--hex-amber);
  font-size: 0.85rem;
}

.beta-crew-hire-info {
  font-size: 0.9rem;
}

.beta-empty-state {
  text-align: center;
  padding: 3rem;
  opacity: 0.5;
  font-family: "JetBrains Mono", monospace;
}

/* --- SHIP MANAGEMENT STYLES --- */
.beta-ship-management {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.beta-ship-header {
  text-align: center;
  margin-bottom: 2rem;
}

.beta-ship-header h1 {
  font-size: 2.5rem;
  color: var(--hex-cyan);
  margin-bottom: 0.5rem;
}

.beta-ship-type {
  font-size: 1rem;
  color: var(--hex-amber);
  opacity: 0.7;
}

.beta-ship-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.beta-ship-stat-card {
  padding: 1.5rem;
  background: rgba(0, 243, 255, 0.05);
  border: 1px solid var(--hex-cyan);
  border-radius: var(--radius);
}

.beta-stat-label {
  font-size: 0.85rem;
  color: var(--hex-cyan);
  opacity: 0.7;
  margin-bottom: 0.5rem;
}

.beta-stat-value {
  font-size: 1.5rem;
  color: var(--hex-green);
  font-family: "JetBrains Mono", monospace;
  margin-bottom: 1rem;
}

.beta-stat-bar {
  width: 100%;
  height: 10px;
  background: rgba(0, 243, 255, 0.1);
  border: 1px solid var(--hex-cyan);
  border-radius: 2px;
  overflow: hidden;
}

.beta-stat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--hex-cyan), var(--hex-green));
  transition: width 0.3s ease;
}

.beta-ship-systems {
  margin-bottom: 2rem;
}

.beta-ship-systems h2 {
  color: var(--hex-cyan);
  margin-bottom: 1.5rem;
}

.beta-systems-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.beta-system-card {
  padding: 1.5rem;
  background: rgba(0, 243, 255, 0.05);
  border: 1px solid var(--hex-cyan);
  border-radius: var(--radius);
}

.beta-system-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.beta-system-header h3 {
  color: var(--hex-cyan);
  margin: 0;
  font-size: 1.1rem;
}

.beta-system-level {
  color: var(--hex-amber);
  font-size: 0.85rem;
}

.beta-system-stats {
  font-size: 0.85rem;
  opacity: 0.8;
}

.beta-ship-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.beta-ship-actions button {
  flex: 1;
  max-width: 300px;
}

/* --- INVENTORY MANAGEMENT STYLES --- */
.beta-inventory-management {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.beta-inventory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.beta-inventory-slots {
  font-size: 1.2rem;
  color: var(--hex-green);
}

.beta-inventory-category {
  margin-bottom: 3rem;
}

.beta-inventory-category h2 {
  color: var(--hex-cyan);
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.beta-inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.beta-inventory-item-card {
  padding: 1.5rem;
  background: rgba(0, 243, 255, 0.05);
  border: 1px solid var(--hex-cyan);
  border-radius: var(--radius);
  transition: all 0.3s ease;
}

.beta-inventory-item-card:hover {
  background: rgba(0, 243, 255, 0.1);
  border-color: var(--hex-green);
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
}

.beta-item-quantity {
  color: var(--hex-amber);
  font-size: 0.9rem;
  margin-left: 0.5rem;
}

.beta-marketplace-item button {
  width: 100%;
  margin-top: 1rem;
}

/* === GAMEPLAY LOOP STYLES === */

#beta-gameplay {
  display: block;
  padding: 1rem;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  box-sizing: border-box;
}

/* Mobile gameplay adjustments */
@media (max-width: 767px) {
  #beta-gameplay {
    padding: 1rem;
    padding-bottom: 150px; /* Space for mobile HUD */
    max-width: 100%;
  }

  #beta-gameplay.beta-screen-active {
    display: contents !important;
    position: relative;
    z-index: 5;
  }

  .beta-mission-active {
    padding-bottom: 2rem;
  }

  .beta-terminal-output {
    max-height: 200px;
    min-height: 150px;
  }

  .beta-choice-btn {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }

  .beta-dice-value {
    font-size: 3rem;
  }

  .beta-complete-rewards {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .beta-reward-item {
    font-size: 1rem;
  }
}

/* Tablet+ gameplay */
@media (min-width: 768px) {
  #beta-gameplay {
    padding: 2rem;
    grid-column: 1;
    grid-row: 1;
  }

  #beta-gameplay.beta-screen-active {
    display: contents !important;
  }
}

.beta-mission-active {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: 100%;
}

.beta-mission-header {
  text-align: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--hex-dim);
}

.beta-mission-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(0, 243, 255, 0.2);
  border: 1px solid var(--hex-cyan);
  border-radius: 3px;
  font-size: 0.75rem;
  color: var(--hex-cyan);
  margin-bottom: 0.5rem;
}

/* Terminal-style log */
.beta-terminal-output {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--hex-dim);
  border-radius: var(--radius);
  padding: 1rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  overflow-y: auto;
  max-height: 300px;
  min-height: 200px;
}

.beta-log-entry {
  display: flex;
  gap: 0.5rem;
  padding: 0.25rem 0;
  animation: beta-log-fade-in 0.3s ease;
}

@keyframes beta-log-fade-in {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.beta-log-prefix {
  color: var(--hex-green);
  opacity: 0.7;
}

.beta-log-text {
  color: var(--hex-green);
}

.beta-log-success .beta-log-text {
  color: var(--hex-green);
}

.beta-log-warning .beta-log-text {
  color: var(--hex-amber);
}

.beta-log-error .beta-log-text {
  color: var(--hex-red, #ff4444);
}

/* LLM Enhancement indicator */
.beta-log-enhanced {
  border-left: 2px solid var(--hex-cyan);
  padding-left: 0.5rem;
  margin-left: -0.5rem;
}

.beta-log-text {
  transition: opacity 0.15s ease;
}

.beta-llm-badge {
  font-size: 0.7em;
  opacity: 0.6;
  margin-left: 0.25rem;
}

/* Subtle pulse animation when LLM enhances */
@keyframes beta-llm-pulse {
  0% {
    border-color: var(--hex-cyan);
  }
  50% {
    border-color: var(--hex-green);
  }
  100% {
    border-color: var(--hex-cyan);
  }
}

.beta-log-enhanced {
  animation: beta-llm-pulse 0.6s ease;
}

/* DM Foley / System Messages */
.beta-log-system .beta-log-text {
  color: var(--hex-cyan, #00ffff);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85em;
  opacity: 0.8;
}

.beta-log-system .beta-log-prefix {
  color: var(--hex-cyan, #00ffff);
}

/* Atmospheric foley - subtle italic */
.beta-log-info .beta-log-text {
  font-style: italic;
  opacity: 0.9;
}

/* Typewriter animation for system messages */
@keyframes beta-typewriter {
  from {
    opacity: 0;
    transform: translateX(-5px);
  }
  to {
    opacity: 0.8;
    transform: translateX(0);
  }
}

.beta-log-system {
  animation: beta-typewriter 0.2s ease-out;
}

/* Dramatic pause styling */
.beta-log-pause .beta-log-text {
  letter-spacing: 0.5em;
  color: var(--hex-amber, #ffaa00);
}

/* Encounter choices */
.beta-encounter-choices {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.beta-choice-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1rem 1.25rem;
  background: rgba(0, 255, 65, 0.05);
  border: 1px solid var(--hex-green);
  border-radius: var(--radius);
  color: var(--hex-green);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.beta-choice-btn:hover:not(:disabled) {
  background: rgba(0, 255, 65, 0.15);
  box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
  transform: translateX(5px);
}

.beta-choice-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.beta-choice-btn.selected {
  background: rgba(0, 255, 65, 0.2);
  border-color: var(--hex-cyan);
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
}

.beta-stat-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: rgba(0, 243, 255, 0.2);
  border: 1px solid var(--hex-cyan);
  border-radius: 3px;
  font-size: 0.7rem;
  color: var(--hex-cyan);
  text-transform: uppercase;
  min-width: 60px;
  text-align: center;
}

.beta-stat-badge.beta-stat-safe {
  background: rgba(0, 255, 65, 0.2);
  border-color: var(--hex-green);
  color: var(--hex-green);
}

.beta-choice-text {
  flex: 1;
}

/* Dice result animation */
.beta-dice-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: beta-dice-pop 0.5s ease;
}

@keyframes beta-dice-pop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.beta-dice-value {
  font-size: 4rem;
  font-family: "JetBrains Mono", monospace;
  font-weight: bold;
  text-shadow: 0 0 20px currentColor;
}

.beta-dice-result.success .beta-dice-value {
  color: var(--hex-green);
}

.beta-dice-result.failure .beta-dice-value {
  color: var(--hex-red, #ff4444);
}

.beta-dice-label {
  font-size: 1.25rem;
  margin-top: 0.5rem;
  opacity: 0.8;
}

.beta-dice-result.success .beta-dice-label {
  color: var(--hex-green);
}

.beta-dice-result.failure .beta-dice-label {
  color: var(--hex-red, #ff4444);
}

/* Mission complete screen */
.beta-mission-complete {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 3rem;
  text-align: center;
  animation: beta-complete-fade 0.5s ease;
}

@keyframes beta-complete-fade {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.beta-complete-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.beta-complete-header h1 {
  font-size: 2rem;
  text-shadow: 0 0 20px var(--hex-green);
}

.beta-complete-rewards {
  display: flex;
  gap: 2rem;
  padding: 1.5rem 2rem;
  background: rgba(0, 255, 65, 0.1);
  border: 1px solid var(--hex-green);
  border-radius: var(--radius);
}

.beta-reward-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-family: "JetBrains Mono", monospace;
}

.beta-reward-item i {
  font-size: 1.5rem;
}

.beta-reward-amount {
  color: var(--hex-green);
}

#beta-continue-btn {
  margin-top: 1rem;
  padding: 1rem 3rem;
  font-size: 1.1rem;
}

/* Mission actions area */
.beta-mission-actions {
  padding: 1rem;
  min-height: 150px;
}

/* === COMPANION UI STYLES === */

.beta-companion-screen {
  padding: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.beta-companion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--hex-dim);
}

.beta-companion-header h1 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.beta-companion-tabs {
  display: flex;
  gap: 0.5rem;
}

.beta-tab {
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--hex-dim);
  color: var(--hex-green);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.beta-tab:hover {
  background: rgba(0, 255, 65, 0.1);
  border-color: var(--hex-green);
}

.beta-tab.active {
  background: rgba(0, 243, 255, 0.2);
  border-color: var(--hex-cyan);
  color: var(--hex-cyan);
}

.beta-companion-roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.beta-companion-card {
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--hex-dim);
  border-radius: var(--radius);
  transition: all 0.3s ease;
}

.beta-companion-card.active {
  border-color: var(--hex-cyan);
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.2);
}

.beta-companion-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.beta-companion-icon {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 243, 255, 0.1);
  border: 1px solid var(--hex-cyan);
  border-radius: 50%;
  font-size: 1.5rem;
  color: var(--hex-cyan);
}

.beta-companion-info h3 {
  margin: 0 0 0.25rem 0;
  color: var(--hex-green);
}

.beta-companion-type {
  font-size: 0.75rem;
  opacity: 0.7;
}

.beta-active-badge {
  margin-left: auto;
  padding: 0.25rem 0.5rem;
  background: var(--hex-cyan);
  color: #000;
  font-size: 0.7rem;
  border-radius: 3px;
}

.beta-companion-desc {
  opacity: 0.7;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.beta-companion-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.beta-stat-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
  background: rgba(0, 255, 65, 0.05);
  border: 1px solid var(--hex-dim);
  border-radius: 4px;
  min-width: 50px;
}

.beta-stat-mini .stat-label {
  font-size: 0.7rem;
  opacity: 0.6;
}

.beta-stat-mini .stat-value {
  font-size: 1.1rem;
  color: var(--hex-cyan);
}

.beta-companion-abilities,
.beta-companion-passives {
  margin-bottom: 1rem;
}

.beta-abilities-label,
.beta-passives-label {
  font-size: 0.75rem;
  opacity: 0.6;
  margin-bottom: 0.5rem;
}

.beta-ability {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem;
  background: rgba(0, 243, 255, 0.05);
  border: 1px solid var(--hex-dim);
  margin-bottom: 0.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.beta-ability:hover:not(.on-cooldown) {
  background: rgba(0, 243, 255, 0.15);
  border-color: var(--hex-cyan);
}

.beta-ability.on-cooldown {
  opacity: 0.5;
  cursor: not-allowed;
}

.ability-name {
  font-size: 0.85rem;
}

.ability-ready {
  color: var(--hex-green);
  font-size: 0.75rem;
}

.ability-cooldown {
  color: var(--hex-amber);
  font-size: 0.75rem;
}

.beta-passive {
  padding: 0.5rem;
  background: rgba(0, 255, 65, 0.05);
  border: 1px solid var(--hex-dim);
  margin-bottom: 0.25rem;
}

.passive-name {
  display: block;
  font-size: 0.85rem;
  color: var(--hex-green);
}

.passive-desc {
  font-size: 0.75rem;
  opacity: 0.6;
}

.beta-companion-loyalty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.8rem;
}

.beta-loyalty-bar {
  flex: 1;
  height: 6px;
  background: rgba(0, 243, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.beta-loyalty-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--hex-amber), var(--hex-green));
  transition: width 0.3s ease;
}

.beta-companion-card-actions {
  display: flex;
  gap: 0.5rem;
}

.beta-btn-danger {
  padding: 0.5rem 1rem;
  background: rgba(255, 0, 51, 0.2);
  border: 1px solid var(--hex-red, #ff0033);
  color: var(--hex-red, #ff0033);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.beta-btn-danger:hover {
  background: rgba(255, 0, 51, 0.4);
}

/* Shop grid */
.beta-shop-grid,
.beta-marketplace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.beta-shop-item,
.beta-marketplace-item {
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--hex-dim);
  border-radius: var(--radius);
  transition: all 0.3s ease;
}

.beta-shop-item:hover:not(.cannot-afford),
.beta-marketplace-item:hover:not(.cannot-afford) {
  border-color: var(--hex-green);
  box-shadow: 0 0 15px rgba(0, 255, 65, 0.2);
}

.beta-shop-item.cannot-afford,
.beta-marketplace-item.cannot-afford {
  opacity: 0.6;
}

.beta-shop-item-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.beta-shop-item-header i {
  font-size: 1.5rem;
  color: var(--hex-cyan);
}

.beta-shop-item-stats {
  display: flex;
  gap: 1rem;
  margin: 0.75rem 0;
  font-size: 0.85rem;
}

.ability-tag {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  background: rgba(0, 243, 255, 0.1);
  border: 1px solid var(--hex-cyan);
  font-size: 0.7rem;
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
}

.beta-shop-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hex-dim);
}

.beta-price {
  font-size: 1rem;
  color: var(--hex-cyan);
}

.beta-price.too-expensive {
  color: var(--hex-red, #ff0033);
}

/* Crew UI */
.beta-crew-screen {
  padding: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.beta-crew-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.beta-crew-bonuses {
  padding: 1rem;
  background: rgba(0, 255, 65, 0.1);
  border: 1px solid var(--hex-green);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.bonuses-header {
  margin-bottom: 0.5rem;
  color: var(--hex-green);
}

.bonuses-list {
  display: flex;
  gap: 1.5rem;
}

.bonus-item {
  display: flex;
  gap: 0.5rem;
}

.bonus-stat {
  opacity: 0.7;
}

.bonus-value {
  color: var(--hex-green);
}

.beta-crew-roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.beta-crew-card {
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--hex-dim);
  border-radius: var(--radius);
}

.beta-crew-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.beta-crew-avatar {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 243, 255, 0.1);
  border: 1px solid var(--hex-cyan);
  border-radius: 50%;
  font-size: 1.25rem;
  color: var(--hex-cyan);
}

.beta-crew-role {
  font-size: 0.75rem;
  opacity: 0.7;
}

.beta-crew-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.crew-stat {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
}

.beta-crew-bonus {
  padding: 0.5rem;
  background: rgba(0, 255, 65, 0.05);
  border: 1px solid var(--hex-dim);
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.bonus-text {
  color: var(--hex-green);
}

.beta-crew-morale {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.8rem;
}

.beta-morale-bar {
  flex: 1;
  height: 6px;
  background: rgba(0, 243, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.beta-morale-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--hex-red, #ff0033),
    var(--hex-amber),
    var(--hex-green)
  );
  transition: width 0.3s ease;
}

.beta-hire-prompt {
  margin-top: 1.5rem;
  text-align: center;
}

.beta-crew-full {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(255, 200, 0, 0.1);
  border: 1px solid var(--hex-amber);
  text-align: center;
}

/* Empty state */
.beta-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
  gap: 1rem;
}

/* Mobile adjustments for companion/crew screens */
@media (max-width: 767px) {
  .beta-companion-tabs {
    flex-wrap: wrap;
  }

  .beta-tab {
    flex: 1 1 auto;
    justify-content: center;
    font-size: 0.75rem;
    padding: 0.5rem;
  }

  .beta-companion-roster,
  .beta-crew-roster,
  .beta-shop-grid,
  .beta-marketplace-grid {
    grid-template-columns: 1fr;
  }

  .beta-companion-stats {
    flex-wrap: wrap;
  }
}
