@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Share+Tech+Mono&display=swap');

:root {
  --bg-color: #06080f;
  --panel-bg: rgba(11, 15, 26, 0.85);
  --border-neon: #182238;
  --cyan-glow: #00f0ff;
  --pink-glow: #ff0055;
  --magenta-btn: #ff007f;
  --lime-glow: #39ff14;
  --amber-glow: #ffb000;
  --purple-glow: #9d00ff;
  --font-pixel: 'Press Start 2P', monospace;
  --font-mono: 'Share Tech Mono', monospace;
}

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

html, body {
  height: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}

body {
  background-color: var(--bg-color);
  color: #e2e8f0;
  font-family: var(--font-mono);
  position: relative;
  background-image: 
    radial-gradient(circle at 50% 15%, rgba(0, 240, 255, 0.07) 0%, transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(255, 0, 85, 0.05) 0%, transparent 50%),
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px;
}

/* Custom Cyber Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #080b14;
}
::-webkit-scrollbar-thumb {
  background: #1f2d48;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--cyan-glow);
}


/* ================================================= */
/* CINEMATIC BORIS STAGE (CONCEPT 1 ARTWORK) */
/* ================================================= */
.boris-stage-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #080b15;
}

.stage-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0;
  transition: opacity 0.45s ease-in-out, transform 0.45s ease-out;
  transform: scale(1.015);
}

.stage-img.active {
  opacity: 1;
  transform: scale(1);
}


.stage-alarm-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 15%, rgba(255, 0, 0, 0.5), transparent 75%),
              linear-gradient(rgba(255, 0, 0, 0.25), transparent);
  opacity: 0;
  z-index: 6;
  transition: opacity 0.3s ease;
}

.stage-alarm-overlay.active {
  opacity: 1;
  animation: strobe-alarm 0.5s infinite alternate;
}

@keyframes strobe-alarm {
  0% { opacity: 0.2; }
  100% { opacity: 0.75; }
}

/* ================================================= */
/* SPLIT DECKER TERMINAL CONSOLE */
/* ================================================= */
.decker-console {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: rgba(10, 14, 25, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid #1a253d;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), inset 0 0 1px rgba(0, 240, 255, 0.25);
  overflow: hidden;
  position: relative;
}

.decker-console::before {
  content: '';
  position: absolute;
  top: -1px;
  right: 24px;
  width: 50px;
  height: 2px;
  background: var(--pink-glow);
  box-shadow: 0 0 8px var(--pink-glow);
}

.decker-header {
  padding: 12px 16px;
  border-bottom: 1px solid #19233c;
  background: rgba(13, 18, 32, 0.8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

/* Micro Gauges */
.vibe-bar-track {
  width: 90px;
  height: 6px;
  background: #0f1422;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid #1f2b44;
}

.vibe-bar-progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff0055, #ffb000, #00f0ff);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.strike-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #221217;
  border: 1px solid #481926;
  transition: all 0.3s ease;
}

.strike-dot.active {
  background: #ff0055;
  border-color: #ff4d88;
  box-shadow: 0 0 10px #ff0055;
  animation: pulse-dot 1s infinite alternate;
}

@keyframes pulse-dot {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1.2); opacity: 1; }
}

/* Scrollable Conversation Feed */
.dialogue-feed {
  flex: 1 1 0%;
  min-height: 0;
  background: rgba(6, 9, 17, 0.55);
  overflow-y: auto;
  overflow-x: hidden;
}

.decker-footer {
  margin-top: auto;
  flex-shrink: 0;
}

/* Conversation Messages & Bubbles */
.feed-msg {
  display: flex;
  margin-bottom: 16px;
  animation: fadeIn 0.25s ease;
}

.feed-msg.msg-boris {
  justify-content: flex-start;
  margin-right: auto;
  max-width: 92%;
}

.feed-msg.msg-player {
  justify-content: flex-end;
  margin-left: auto;
  max-width: 92%;
}

.boris-bubble {
  background: #0d1527;
  border: 1px solid #1e2c4d;
  border-left: 3px solid var(--cyan-glow);
  border-radius: 4px 12px 12px 12px;
  padding: 12px 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 1px rgba(0, 240, 255, 0.2);
  color: #f1f5f9;
}

.player-bubble {
  background: #1c1024;
  border: 1px solid #3c1a47;
  border-right: 3px solid var(--magenta-btn);
  border-radius: 12px 4px 12px 12px;
  padding: 12px 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 0, 127, 0.2);
  color: #ffffff;
}

.bubble-speech {
  font-size: 13.5px;
  line-height: 1.5;
  font-family: var(--font-mono);
  color: #f8fafc;
}

.bubble-pitch {
  font-size: 13.5px;
  line-height: 1.5;
  font-family: var(--font-mono);
  color: #ffffff;
  font-style: italic;
}

.msg-item-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.4);
  color: #00f0ff;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
}

.msg-meta-pill {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: #94a3b8;
}

.msg-reaction-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: bold;
  padding: 1px 7px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--font-mono);
}

.msg-reaction-badge.won {
  background: rgba(57, 255, 20, 0.18);
  color: var(--lime-glow);
  border: 1px solid var(--lime-glow);
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.35);
}

.msg-reaction-badge.strike {
  background: rgba(255, 0, 85, 0.18);
  color: var(--pink-glow);
  border: 1px solid var(--pink-glow);
  box-shadow: 0 0 10px rgba(255, 0, 85, 0.35);
}

.msg-reaction-badge.eject {
  background: rgba(255, 0, 0, 0.25);
  color: #ff3b30;
  border: 1px solid #ff3b30;
  box-shadow: 0 0 12px rgba(255, 0, 0, 0.5);
}

.msg-reaction-badge.bribe {
  background: rgba(255, 176, 0, 0.2);
  color: var(--amber-glow);
  border: 1px solid var(--amber-glow);
  box-shadow: 0 0 10px rgba(255, 176, 0, 0.35);
}

.dialogue-cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: var(--cyan-glow);
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 0.9s infinite;
}

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

/* Floating Reaction Stamp */
.reaction-stamp {
  display: inline-block;
  padding: 6px 14px;
  font-family: var(--font-pixel);
  font-size: 12px;
  letter-spacing: 1px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: bold;
  backdrop-filter: blur(8px);
}

.reaction-stamp.let-in {
  background: rgba(9, 26, 12, 0.85);
  border: 2px solid var(--lime-glow);
  color: var(--lime-glow);
  box-shadow: 0 0 20px rgba(57, 255, 20, 0.6);
}

.reaction-stamp.snark {
  background: rgba(26, 9, 16, 0.85);
  border: 2px solid var(--pink-glow);
  color: var(--pink-glow);
  box-shadow: 0 0 20px rgba(255, 0, 85, 0.6);
}

.reaction-stamp.bribe {
  background: rgba(26, 20, 9, 0.85);
  border: 2px solid var(--amber-glow);
  color: var(--amber-glow);
  box-shadow: 0 0 20px rgba(255, 176, 0, 0.6);
}

.reaction-stamp.eject {
  background: rgba(30, 6, 8, 0.9);
  border: 2px solid #ff0000;
  color: #ff0000;
  box-shadow: 0 0 30px rgba(255, 0, 0, 0.9);
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  20%, 60% { transform: translate(-4px, 2px); }
  40%, 80% { transform: translate(4px, -2px); }
}

/* Plausibility Meter Progress */
.plausibility-bar-bg {
  width: 100%;
  height: 12px;
  background: #0f1422;
  border: 1px solid #202b44;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.plausibility-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff0055, #ffb000, #39ff14);
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.6);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Quick Approaches Buttons (2-Row Grid) */
.archetype-btn,
.archetype-chip {
  background: rgba(14, 20, 36, 0.9);
  border: 1px solid #202e4d;
  color: #cbd5e1;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  width: 100%;
}

.archetype-btn:hover,
.archetype-chip:hover {
  border-color: var(--cyan-glow);
  color: #ffffff;
  background: rgba(0, 240, 255, 0.14);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.25);
  transform: translateY(-1px);
}

.archetype-btn:active,
.archetype-chip:active {
  transform: translateY(0);
  background: rgba(0, 240, 255, 0.22);
}

.archetype-btn .icon,
.archetype-chip .icon {
  font-size: 11px;
  flex-shrink: 0;
}

/* Action Buttons */
.cyber-button-send {
  background: var(--magenta-btn);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(255, 0, 127, 0.55);
  transition: all 0.2s ease;
}

.cyber-button-send:hover:not(:disabled) {
  background: #ff2d95;
  box-shadow: 0 0 24px rgba(255, 0, 127, 0.85);
  transform: translateY(-1px);
}

.cyber-button-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.cyber-button {
  background: linear-gradient(135deg, #00f0ff 0%, #0099ff 100%);
  color: #05060a;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.5px;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.4);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.cyber-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #70f7ff 0%, #00f0ff 100%);
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.7);
  transform: translateY(-1px);
}

.cyber-button-secondary {
  background: #111628;
  border: 1px solid #263353;
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.cyber-button-secondary:hover {
  border-color: var(--pink-glow);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(255, 0, 85, 0.35);
}

/* Neural Inspector Button */
.cyber-button-inspector {
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: #00f0ff;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.cyber-button-inspector:hover {
  background: rgba(0, 240, 255, 0.18);
  border-color: #00f0ff;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.4);
}

.inspector-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00f0ff;
  box-shadow: 0 0 6px #00f0ff;
  animation: pulse-dot 1.5s infinite;
}

/* ================================================= */
/* SLIDE-OUT NEURAL INSPECTOR DRAWER */
/* ================================================= */
.neural-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 10, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1040;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.neural-drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.neural-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 440px;
  max-width: 92vw;
  background: #090d19;
  border-left: 1px solid #1c2844;
  box-shadow: -10px 0 50px rgba(0, 0, 0, 0.85);
  z-index: 1050;
  padding: 22px;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.neural-drawer.active {
  transform: translateX(0);
}

.drawer-close-btn {
  background: #111728;
  border: 1px solid #232f4e;
  color: #8892b0;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
}

.drawer-close-btn:hover {
  color: #ff0055;
  border-color: #ff0055;
}

.stat-card {
  background: #0d1222;
  border: 1px solid #1e2a47;
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
}

.stat-card-label {
  font-size: 9px;
  text-transform: uppercase;
  color: #64748b;
  font-family: var(--font-mono);
}

.stat-card-val {
  font-size: 13px;
  font-weight: bold;
  font-family: var(--font-mono);
  margin-top: 2px;
}

.inspector-section {
  background: #0b0f1e;
  border: 1px solid #19243d;
  border-radius: 6px;
  padding: 12px;
}

/* Probability Distribution Bars */
.prob-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.prob-label {
  width: 105px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prob-bar-container {
  flex: 1;
  height: 7px;
  background: #0e1322;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.prob-bar-fill {
  height: 100%;
  background: var(--cyan-glow);
  box-shadow: 0 0 6px var(--cyan-glow);
  transition: width 0.3s ease;
}

.prob-val {
  width: 36px;
  text-align: right;
  color: #e2e8f0;
  font-weight: bold;
}

/* ================================================= */
/* WIN & LOSS OVERLAY SCREENS */
/* ================================================= */
.overlay-screen {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 12, 0.88);
  backdrop-filter: blur(10px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.overlay-screen.active {
  opacity: 1;
  pointer-events: auto;
}

.win-card {
  position: relative;
  background: #090d19;
  border: 2px solid var(--lime-glow);
  box-shadow: 0 0 60px rgba(57, 255, 20, 0.5), inset 0 0 30px rgba(57, 255, 20, 0.1);
  border-radius: 12px;
  padding: 32px;
  max-width: 500px;
  width: 100%;
  text-align: center;
  animation: zoom-in 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.loss-card {
  position: relative;
  background: #0d090c;
  border: 2px solid #ff0000;
  box-shadow: 0 0 60px rgba(255, 0, 0, 0.6), inset 0 0 30px rgba(255, 0, 0, 0.15);
  border-radius: 12px;
  padding: 32px;
  max-width: 500px;
  width: 100%;
  text-align: center;
  animation: zoom-in 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.credit-card-modal {
  position: relative;
  background: #0e0a05;
  border: 2px solid var(--amber-glow);
  box-shadow: 0 0 60px rgba(255, 176, 0, 0.5), inset 0 0 30px rgba(255, 176, 0, 0.12);
  border-radius: 12px;
  padding: 32px;
  max-width: 500px;
  width: 100%;
  text-align: center;
  animation: zoom-in 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.credit-card-modal .modal-close-btn:hover {
  color: var(--amber-glow);
  border-color: var(--amber-glow);
  background: rgba(255, 176, 0, 0.15);
  box-shadow: 0 0 14px rgba(255, 176, 0, 0.4);
}

.about-card {
  position: relative;
  background: #090e1b;
  border: 2px solid var(--cyan-glow);
  box-shadow: 0 0 60px rgba(0, 240, 255, 0.4), inset 0 0 30px rgba(0, 240, 255, 0.08);
  border-radius: 12px;
  padding: 28px;
  max-width: 580px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  text-align: left;
  animation: zoom-in 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.about-card .modal-close-btn:hover {
  color: var(--cyan-glow);
  border-color: var(--cyan-glow);
  background: rgba(0, 240, 255, 0.15);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.4);
}

.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  background: #0c1120;
  border: 1px solid #232d47;
  color: #8892b0;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.win-card .modal-close-btn:hover {
  color: var(--lime-glow);
  border-color: var(--lime-glow);
  background: rgba(57, 255, 20, 0.12);
  box-shadow: 0 0 14px rgba(57, 255, 20, 0.4);
}

.loss-card .modal-close-btn:hover {
  color: #ff0055;
  border-color: #ff0055;
  background: rgba(255, 0, 85, 0.12);
  box-shadow: 0 0 14px rgba(255, 0, 85, 0.4);
}

/* Rate limit warning toast */
.rate-limit-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(16, 12, 5, 0.96);
  border: 1px solid var(--amber-glow);
  box-shadow: 0 0 24px rgba(255, 176, 0, 0.45);
  color: #ffb000;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slide-down 0.3s ease;
}

@keyframes slide-down {
  from { opacity: 0; transform: translate(-50%, -12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

#endgame-banner {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes zoom-in {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Confetti Canvas for Victory */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 998;
}

/* Screen Shake Effect */
.screen-shake {
  animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
