/* ==========================================================================
   ORACLE DU RATON // SNOOT TERMINAL - DESIGN SYSTEM CYBERPUNK NEON
   ========================================================================== */

:root {
  --bg-deep: #05080e;
  --bg-card: rgba(10, 18, 30, 0.78);
  --bg-card-border: rgba(0, 210, 255, 0.25);
  
  --neon-cyan: #00d2ff;
  --neon-cyan-glow: rgba(0, 210, 255, 0.55);
  --neon-amber: #ff9d00;
  --neon-amber-glow: rgba(255, 157, 0, 0.6);
  --neon-green: #00ffaa;
  --neon-purple: #b537f2;
  --neon-crimson: #ff3366;

  --text-main: #e8f4fc;
  --text-muted: #809bb3;
  --text-dim: #44596b;

  --font-display: 'Orbitron', monospace, sans-serif;
  --font-tech: 'Rajdhani', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 50% 15%, rgba(0, 210, 255, 0.12), transparent 50%),
    radial-gradient(circle at 85% 75%, rgba(255, 157, 0, 0.08), transparent 45%),
    linear-gradient(to bottom, #05080e 0%, #080e18 100%);
  background-attachment: fixed;
}

/* Background Cyber Grid */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(0, 210, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 210, 255, 0.035) 1px, transparent 1px);
  pointer-events: none;
  z-index: 0;
}

/* Scanline Overlay Effect */
.scanlines {
  position: fixed;
  inset: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
  background-size: 100% 4px;
  z-index: 99;
  pointer-events: none;
  opacity: 0.6;
}

/* Ambient glow light following mouse or breathing */
.ambient-glow {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 350px;
  background: radial-gradient(ellipse, rgba(0, 210, 255, 0.18) 0%, rgba(255, 157, 0, 0.05) 50%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 1;
  animation: ambientBreath 8s ease-in-out infinite alternate;
}

@keyframes ambientBreath {
  0% { opacity: 0.4; transform: translate(-50%, -50%) scale(0.9); }
  100% { opacity: 0.85; transform: translate(-50%, -50%) scale(1.1); }
}

/* Container */
.app-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--bg-card-border);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(0, 210, 255, 0.08);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 8px var(--neon-cyan));
  animation: logoFloat 3s ease-in-out infinite alternate;
}

@keyframes logoFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-3px); }
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(90deg, #ffffff, var(--neon-cyan), var(--neon-amber));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(0, 210, 255, 0.3);
}

.brand-subtitle {
  font-family: var(--font-tech);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--neon-cyan);
  text-transform: uppercase;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: rgba(0, 210, 255, 0.08);
  border: 1px solid rgba(0, 210, 255, 0.3);
  border-radius: 20px;
  font-family: var(--font-tech);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--neon-cyan);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon-green);
  box-shadow: 0 0 10px var(--neon-green);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-icon-tech {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 210, 255, 0.25);
  color: var(--text-main);
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-tech);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: var(--transition-smooth);
}

.btn-icon-tech:hover {
  background: rgba(0, 210, 255, 0.15);
  border-color: var(--neon-cyan);
  color: #fff;
  box-shadow: 0 0 12px var(--neon-cyan-glow);
  transform: translateY(-1px);
}

.btn-icon-tech.active {
  background: rgba(0, 210, 255, 0.2);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

.btn-icon-tech.muted {
  opacity: 0.45;
  border-color: rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   MAIN HUD DISPLAY
   ========================================================================== */
.hud-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--bg-card-border);
  border-radius: 16px;
  padding: 1rem;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(0, 210, 255, 0.05);
}

/* Tech Corner Brackets */
.hud-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  z-index: 10;
}

.hud-corner.tl { top: 6px; left: 6px; border-top: 2px solid var(--neon-cyan); border-left: 2px solid var(--neon-cyan); }
.hud-corner.tr { top: 6px; right: 6px; border-top: 2px solid var(--neon-cyan); border-right: 2px solid var(--neon-cyan); }
.hud-corner.bl { bottom: 6px; left: 6px; border-bottom: 2px solid var(--neon-cyan); border-left: 2px solid var(--neon-cyan); }
.hud-corner.br { bottom: 6px; right: 6px; border-bottom: 2px solid var(--neon-cyan); border-right: 2px solid var(--neon-cyan); }

.hud-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 786 / 334;
  border-radius: 10px;
  overflow: hidden;
  background: #020408;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.9);
  user-select: none;
}

.hud-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease, filter 0.3s ease;
}

/* Raccoon Face Shock recoil animation */
.hud-viewport.booped .hud-image {
  animation: boopImpact 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes boopImpact {
  0% { transform: scale(1); filter: brightness(1); }
  25% { transform: scale(0.985) translateY(2px); filter: brightness(1.3) drop-shadow(0 0 15px var(--neon-amber)); }
  50% { transform: scale(1.015) translateY(-2px); filter: brightness(1.15); }
  100% { transform: scale(1); filter: brightness(1); }
}

/* ==========================================================================
   THE NOSE HOTSPOT & TARGETING RETICLE
   ========================================================================== */
.snoot-hotspot {
  position: absolute;
  /* Coordinates: Center X=49.55%, Center Y=77.40% */
  left: 49.55%;
  top: 77.40%;
  transform: translate(-50%, -50%);
  width: 7.2%;
  height: 9.5%;
  border-radius: 50%;
  cursor: pointer;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

/* Invisible click cushion */
.snoot-hotspot::before {
  content: '';
  position: absolute;
  inset: -15px;
  border-radius: 50%;
}

/* Continuous breathing beacon on the nose */
.snoot-beacon {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 46%;
  border: 1.5px solid var(--neon-amber);
  box-shadow: 0 0 10px var(--neon-amber), inset 0 0 6px var(--neon-amber);
  opacity: 0.8;
  animation: snootPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  pointer-events: none;
  transition: var(--transition-smooth);
}

@keyframes snootPulse {
  0%, 100% {
    transform: scale(0.95);
    opacity: 0.6;
    box-shadow: 0 0 8px var(--neon-amber);
  }
  50% {
    transform: scale(1.35);
    opacity: 1;
    box-shadow: 0 0 20px var(--neon-amber), 0 0 35px var(--neon-amber);
  }
}

/* Targeting Reticle on Hover */
.snoot-reticle {
  position: absolute;
  width: 170%;
  height: 170%;
  pointer-events: none;
  opacity: 0;
  transform: scale(1.4) rotate(0deg);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.snoot-reticle .bracket {
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: var(--neon-amber);
}

.snoot-reticle .bracket.top-left { top: 0; left: 0; border-top: 2px solid var(--neon-amber); border-left: 2px solid var(--neon-amber); }
.snoot-reticle .bracket.top-right { top: 0; right: 0; border-top: 2px solid var(--neon-amber); border-right: 2px solid var(--neon-amber); }
.snoot-reticle .bracket.bottom-left { bottom: 0; left: 0; border-bottom: 2px solid var(--neon-amber); border-left: 2px solid var(--neon-amber); }
.snoot-reticle .bracket.bottom-right { bottom: 0; right: 0; border-bottom: 2px solid var(--neon-amber); border-right: 2px solid var(--neon-amber); }

.snoot-hotspot:hover .snoot-reticle,
.snoot-hotspot:focus-visible .snoot-reticle {
  opacity: 1;
  transform: scale(1) rotate(90deg);
}

.snoot-hotspot:hover .snoot-beacon {
  border-color: #fff;
  background: rgba(255, 157, 0, 0.3);
  box-shadow: 0 0 25px var(--neon-amber), 0 0 45px #fff;
  transform: scale(1.15);
}

/* SNOOT TOOLTIP */
.snoot-tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(8, 14, 24, 0.94);
  border: 1px solid var(--neon-amber);
  color: var(--neon-amber);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-family: var(--font-tech);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 0 15px rgba(255, 157, 0, 0.4);
  transition: all 0.25s ease;
  z-index: 30;
}

.snoot-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--neon-amber);
}

.snoot-hotspot:hover .snoot-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Shockwave ripple when clicked */
.ripple-wave {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--neon-amber);
  box-shadow: 0 0 20px var(--neon-amber), inset 0 0 10px var(--neon-amber);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  opacity: 1;
  animation: rippleSpread 0.75s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes rippleSpread {
  0% {
    width: 20px;
    height: 20px;
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.2);
  }
  100% {
    width: 600px;
    height: 600px;
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.5);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 35px var(--neon-cyan);
  }
}

/* ==========================================================================
   RACCOON EYE GLOW OVERLAYS
   Coordinates: Left (40.69%, 55.62%), Right (58.81%, 55.65%)
   ========================================================================== */
.eye-glow {
  position: absolute;
  width: 4.8%;
  height: 5.5%;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle, #fff 0%, var(--neon-amber) 60%, transparent 100%);
  filter: blur(2px);
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease;
}

.eye-glow.left { left: 40.69%; top: 55.62%; }
.eye-glow.right { left: 58.81%; top: 55.65%; }

.eye-glow.active {
  opacity: 0.95;
  filter: blur(1px) drop-shadow(0 0 15px var(--neon-amber));
  animation: eyeBlink 0.5s ease;
}

@keyframes eyeBlink {
  0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
  50% { transform: translate(-50%, -50%) scale(1.4); opacity: 1; filter: drop-shadow(0 0 25px #fff); }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
}

/* Audio Visualizer Waves over the HUD */
.hud-audio-bars {
  position: absolute;
  bottom: 12px;
  left: 20px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 24px;
  pointer-events: none;
  opacity: 0.7;
}

.audio-bar {
  width: 3px;
  background: var(--neon-cyan);
  border-radius: 2px;
  box-shadow: 0 0 6px var(--neon-cyan);
  transition: height 0.1s ease;
  height: 4px;
}

.hud-audio-bars.speaking .audio-bar {
  animation: barBounce 0.4s ease-in-out infinite alternate;
}

.hud-audio-bars.speaking .audio-bar:nth-child(1) { animation-delay: 0.05s; }
.hud-audio-bars.speaking .audio-bar:nth-child(2) { animation-delay: 0.15s; }
.hud-audio-bars.speaking .audio-bar:nth-child(3) { animation-delay: 0.25s; }
.hud-audio-bars.speaking .audio-bar:nth-child(4) { animation-delay: 0.1s; }
.hud-audio-bars.speaking .audio-bar:nth-child(5) { animation-delay: 0.2s; }
.hud-audio-bars.speaking .audio-bar:nth-child(6) { animation-delay: 0.3s; }
.hud-audio-bars.speaking .audio-bar:nth-child(7) { animation-delay: 0.18s; }
.hud-audio-bars.speaking .audio-bar:nth-child(8) { animation-delay: 0.08s; }

@keyframes barBounce {
  0% { height: 4px; background: var(--neon-cyan); }
  100% { height: 22px; background: var(--neon-amber); box-shadow: 0 0 10px var(--neon-amber); }
}

/* Interactive Hint Badge on the image */
.hud-hint-pill {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(5, 10, 20, 0.85);
  border: 1px solid rgba(0, 210, 255, 0.35);
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  font-family: var(--font-tech);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--neon-cyan);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.hud-hint-pill span.hotspot-icon {
  color: var(--neon-amber);
  animation: bounceMini 1.5s infinite;
}

@keyframes bounceMini {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

/* ==========================================================================
   ORACLE SPEECH & TRUTH HOLOGRAM CARD
   ========================================================================== */
.oracle-output-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--bg-card-border);
  border-radius: 16px;
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 25px rgba(0, 210, 255, 0.06);
  transition: var(--transition-smooth);
}

.oracle-output-card.speaking {
  border-color: var(--neon-cyan);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 35px var(--neon-cyan-glow);
}

.oracle-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding-bottom: 0.75rem;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-family: var(--font-tech);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  background: rgba(0, 210, 255, 0.12);
  color: var(--neon-cyan);
  border: 1px solid currentColor;
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.2);
}

.transmission-status {
  font-family: var(--font-tech);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.transmission-status.active {
  color: var(--neon-amber);
}

/* Quote Main Text */
.oracle-speech-content {
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.quote-quote-marks {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--neon-cyan);
  opacity: 0.4;
  line-height: 0.8;
  margin-bottom: 0.2rem;
}

.oracle-truth-text {
  font-size: 1.35rem;
  line-height: 1.55;
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.3px;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
}

.oracle-truth-text.placeholder {
  color: var(--text-muted);
  font-style: italic;
  font-size: 1.15rem;
}

/* Blinking terminal cursor during typing */
.typing-cursor {
  display: inline-block;
  width: 9px;
  height: 1.2em;
  background: var(--neon-cyan);
  margin-left: 4px;
  vertical-align: middle;
  box-shadow: 0 0 8px var(--neon-cyan);
  animation: cursorBlink 0.8s infinite;
}

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

.oracle-author-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.oracle-author {
  font-family: var(--font-tech);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--neon-amber);
  text-shadow: 0 0 10px rgba(255, 157, 0, 0.4);
}

/* Output Card Action Buttons */
.oracle-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.boop-counter {
  font-family: var(--font-tech);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.boop-counter span.count-val {
  color: var(--neon-cyan);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.action-buttons-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-cyber-primary {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.25), rgba(0, 150, 220, 0.35));
  border: 1px solid var(--neon-cyan);
  color: #fff;
  padding: 0.55rem 1.15rem;
  border-radius: 8px;
  font-family: var(--font-tech);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 0 15px rgba(0, 210, 255, 0.25);
  transition: var(--transition-smooth);
}

.btn-cyber-primary:hover {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.4), rgba(0, 180, 255, 0.5));
  box-shadow: 0 0 25px var(--neon-cyan-glow);
  transform: translateY(-2px);
}

.btn-cyber-primary:active {
  transform: translateY(0);
}

/* ==========================================================================
   CATEGORY SELECTOR BAR
   ========================================================================== */
.category-controls-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem;
}

.category-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  padding: 0.45rem 0.9rem;
  border-radius: 20px;
  font-family: var(--font-tech);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.category-tab:hover {
  color: #fff;
  border-color: rgba(0, 210, 255, 0.4);
  background: rgba(0, 210, 255, 0.08);
}

.category-tab.active {
  background: rgba(0, 210, 255, 0.18);
  border-color: var(--neon-cyan);
  color: #fff;
  box-shadow: 0 0 15px rgba(0, 210, 255, 0.35);
}

/* ==========================================================================
   MODALS / DRAWERS (Archives & Add Custom)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 5, 10, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-window {
  background: #09111c;
  border: 1px solid var(--neon-cyan);
  border-radius: 16px;
  width: 100%;
  max-width: 650px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8), 0 0 35px var(--neon-cyan-glow);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-backdrop.open .modal-window {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid rgba(0, 210, 255, 0.2);
  background: rgba(0, 210, 255, 0.05);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--neon-cyan);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem;
  transition: color 0.2s ease;
}

.modal-close-btn:hover {
  color: var(--neon-crimson);
}

.modal-body {
  padding: 1.4rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* History List items */
.history-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: var(--transition-smooth);
}

.history-item:hover {
  border-color: rgba(0, 210, 255, 0.3);
  background: rgba(0, 210, 255, 0.05);
}

.history-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.history-item-text {
  font-size: 0.98rem;
  color: #fff;
  line-height: 1.45;
}

.history-item-author {
  font-family: var(--font-tech);
  font-size: 0.82rem;
  color: var(--neon-amber);
  align-self: flex-end;
}

/* Custom Quote Form */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-label {
  font-family: var(--font-tech);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--neon-cyan);
}

.form-input, .form-textarea, .form-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 210, 255, 0.3);
  color: #fff;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-smooth);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px var(--neon-cyan-glow);
  background: rgba(0, 210, 255, 0.08);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* Toast Notification */
.toast-notice {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: rgba(8, 16, 28, 0.95);
  border: 1px solid var(--neon-green);
  color: var(--neon-green);
  box-shadow: 0 0 20px rgba(0, 255, 170, 0.3);
  padding: 0.6rem 1.4rem;
  border-radius: 30px;
  font-family: var(--font-tech);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 1px;
  pointer-events: none;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 200;
}

.toast-notice.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.app-footer {
  text-align: center;
  font-family: var(--font-tech);
  font-size: 0.85rem;
  color: var(--text-dim);
  letter-spacing: 1px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 1rem;
}

.app-footer kbd {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--neon-cyan);
}

/* Highlight Mobile button in header */
.btn-icon-tech.highlight-mobile {
  border-color: var(--neon-amber);
  color: var(--neon-amber);
  background: rgba(255, 157, 0, 0.1);
  box-shadow: 0 0 10px rgba(255, 157, 0, 0.25);
  animation: pulseMobileBtn 3s infinite alternate;
}

@keyframes pulseMobileBtn {
  0% { box-shadow: 0 0 6px rgba(255, 157, 0, 0.2); }
  100% { box-shadow: 0 0 16px rgba(255, 157, 0, 0.5), inset 0 0 8px rgba(255, 157, 0, 0.2); }
}

/* ==========================================================================
   RATON DARK MODE (MODE FURTIF CYBER-NOIR)
   ========================================================================== */
body.raton-dark-mode {
  --bg-deep: #020204;
  --bg-card: rgba(14, 5, 10, 0.88);
  --bg-card-border: rgba(255, 0, 75, 0.4);

  --neon-cyan: #ff0055;
  --neon-cyan-glow: rgba(255, 0, 85, 0.7);
  --neon-amber: #ff2a5f;
  --neon-amber-glow: rgba(255, 42, 95, 0.75);
  --neon-green: #ff0055;
  --neon-purple: #9d00ff;
  --neon-crimson: #ff0033;

  --text-main: #fff0f5;
  --text-muted: #c9889d;
  --text-dim: #75384e;

  background-image: 
    radial-gradient(circle at 50% 15%, rgba(255, 0, 85, 0.18), transparent 50%),
    radial-gradient(circle at 85% 75%, rgba(157, 0, 255, 0.12), transparent 45%),
    linear-gradient(to bottom, #020204 0%, #090306 100%);
}

body.raton-dark-mode::before {
  background-image: 
    linear-gradient(to right, rgba(255, 0, 85, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 0, 85, 0.05) 1px, transparent 1px);
}

body.raton-dark-mode .scanlines {
  opacity: 0.75;
  background: linear-gradient(rgba(25, 5, 15, 0) 50%, rgba(0, 0, 0, 0.35) 50%);
}

body.raton-dark-mode .ambient-glow {
  background: radial-gradient(ellipse, rgba(255, 0, 85, 0.28) 0%, rgba(157, 0, 255, 0.1) 50%, transparent 70%);
}

/* Image filter to shift cyan/amber neon to crimson/purple night stealth */
body.raton-dark-mode #raccoonImg,
body.raton-dark-mode .hud-image {
  filter: hue-rotate(130deg) contrast(1.25) brightness(0.95) saturate(1.4) !important;
}

body.raton-dark-mode .hud-viewport.booped #raccoonImg,
body.raton-dark-mode .hud-viewport.booped .hud-image {
  animation: boopImpactDark 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28) !important;
}

@keyframes boopImpactDark {
  0% { transform: scale(1); filter: hue-rotate(130deg) contrast(1.25) brightness(0.95) saturate(1.4); }
  25% { transform: scale(0.985) translateY(2px); filter: hue-rotate(130deg) contrast(1.3) brightness(1.3) saturate(1.5) drop-shadow(0 0 20px #ff0055); }
  50% { transform: scale(1.015) translateY(-2px); filter: hue-rotate(130deg) contrast(1.25) brightness(1.1) saturate(1.4); }
  100% { transform: scale(1); filter: hue-rotate(130deg) contrast(1.25) brightness(0.95) saturate(1.4); }
}

body.raton-dark-mode .brand-title {
  background: linear-gradient(90deg, #ffffff, #ff0055, #ff3366);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(255, 0, 85, 0.4);
}

body.raton-dark-mode .hud-viewport {
  background: #010103;
  box-shadow: inset 0 0 35px rgba(0, 0, 0, 0.98), 0 0 30px rgba(255, 0, 85, 0.2);
}

body.raton-dark-mode .snoot-beacon {
  border-color: #ff0055;
  box-shadow: 0 0 15px #ff0055, inset 0 0 8px #ff0055;
}

body.raton-dark-mode .snoot-reticle .bracket {
  border-color: #ff0055;
}

body.raton-dark-mode .snoot-tooltip {
  border-color: #ff0055;
  color: #ff0055;
  box-shadow: 0 0 15px rgba(255, 0, 85, 0.5);
}

body.raton-dark-mode .eye-glow {
  background: radial-gradient(circle, #fff 0%, #ff0055 60%, transparent 100%);
}

body.raton-dark-mode .eye-glow.active {
  filter: blur(1px) drop-shadow(0 0 18px #ff0055);
}

/* Dark mode button styling */
.btn-icon-tech.dark-mode-toggle {
  border-color: rgba(255, 0, 85, 0.4);
  color: #ff3366;
  background: rgba(255, 0, 85, 0.08);
  transition: all 0.25s ease;
}

.btn-icon-tech.dark-mode-toggle:hover {
  background: rgba(255, 0, 85, 0.22);
  border-color: #ff0055;
  box-shadow: 0 0 15px rgba(255, 0, 85, 0.5);
  color: #fff;
}

body.raton-dark-mode .btn-icon-tech.dark-mode-toggle {
  background: rgba(255, 0, 85, 0.25);
  border-color: #ff0055;
  color: #fff;
  box-shadow: 0 0 18px rgba(255, 0, 85, 0.6);
}

/* ==========================================================================
   QR CODE & MOBILE MODAL STYLES
   ========================================================================== */
.qr-modal-window {
  max-width: 500px;
  border-color: var(--neon-amber);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8), 0 0 35px var(--neon-amber-glow);
}

.qr-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
}

.qr-intro-text {
  font-family: var(--font-tech);
  font-size: 1rem;
  color: var(--text-main);
  line-height: 1.45;
}

.qr-display-box {
  position: relative;
  background: #ffffff;
  padding: 1rem;
  border-radius: 16px;
  box-shadow: 0 0 30px rgba(0, 210, 255, 0.4), 0 0 15px rgba(255, 157, 0, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.qr-image {
  width: 190px;
  height: 190px;
  display: block;
}

.local-url-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
}

.url-label {
  font-family: var(--font-tech);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--neon-cyan);
  letter-spacing: 0.5px;
}

.url-field-row {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.url-input {
  flex: 1;
  background: rgba(0, 210, 255, 0.08);
  border: 1px solid var(--neon-cyan);
  color: #fff;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  font-family: monospace;
  font-size: 0.95rem;
  font-weight: bold;
  letter-spacing: 0.5px;
  outline: none;
}

.mobile-tips-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tip-title {
  font-family: var(--font-tech);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--neon-amber);
  letter-spacing: 0.5px;
}

.tip-list {
  padding-left: 1.2rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* ==========================================================================
   BUY ME A COFFEE STYLES
   ========================================================================== */
.btn-icon-tech.btn-coffee {
  background: linear-gradient(135deg, rgba(255, 179, 71, 0.15), rgba(255, 140, 0, 0.25));
  border-color: #ffb347;
  color: #ffe6b3;
  box-shadow: 0 0 10px rgba(255, 179, 71, 0.25);
  font-weight: 700;
  transition: all 0.25s ease;
}

.btn-icon-tech.btn-coffee:hover {
  background: linear-gradient(135deg, rgba(255, 179, 71, 0.3), rgba(255, 140, 0, 0.45));
  box-shadow: 0 0 20px rgba(255, 179, 71, 0.6);
  color: #fff;
  transform: translateY(-2px);
}

.coffee-footer-btn {
  background: transparent;
  border: 1px dashed rgba(255, 179, 71, 0.4);
  color: #ffb347;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-family: var(--font-tech);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.coffee-footer-btn:hover {
  background: rgba(255, 179, 71, 0.12);
  border-style: solid;
  border-color: #ffb347;
  box-shadow: 0 0 12px rgba(255, 179, 71, 0.35);
  color: #fff;
  transform: translateY(-1px);
}

.coffee-modal-window {
  max-width: 540px;
  background: #09111c !important;
  border-color: #ffb347;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.9), 0 0 35px rgba(255, 179, 71, 0.4);
}

.coffee-modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.coffee-avatar-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 179, 71, 0.08);
  border: 1px solid rgba(255, 179, 71, 0.25);
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
}

.coffee-giant-emoji {
  font-size: 2.4rem;
  line-height: 1;
}

.coffee-desc {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text-main);
}

.coffee-desc strong {
  color: #ffb347;
  font-family: var(--font-tech);
  font-size: 1.05rem;
}

/* Grille des paliers de café */
.coffee-tiers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.coffee-tier-card {
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 179, 71, 0.3);
  border-radius: 12px;
  padding: 1rem 0.5rem;
  text-align: center;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.25s ease;
}

.coffee-tier-card:hover {
  background: rgba(255, 179, 71, 0.15);
  border-color: #ffb347;
  box-shadow: 0 0 16px rgba(255, 179, 71, 0.4);
  transform: translateY(-3px);
}

.coffee-tier-card.popular {
  border-color: #ffb347;
  background: rgba(255, 179, 71, 0.1);
  box-shadow: 0 0 12px rgba(255, 179, 71, 0.2);
}

.tier-badge {
  position: absolute;
  top: -9px;
  background: #ffb347;
  color: #000;
  font-family: var(--font-tech);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.tier-icon {
  font-size: 1.6rem;
}

.tier-name {
  font-family: var(--font-tech);
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}

.tier-price {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffb347;
}

.coffee-cta-box {
  width: 100%;
}

.btn-coffee-main {
  width: 100%;
  background: linear-gradient(135deg, #ffb347, #ff9000);
  color: #1a0f00;
  border: none;
  padding: 0.8rem 1.25rem;
  border-radius: 10px;
  font-family: var(--font-tech);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 20px rgba(255, 179, 71, 0.4);
  transition: all 0.25s ease;
  cursor: pointer;
}

.btn-coffee-main:hover {
  background: linear-gradient(135deg, #ffc266, #ffa31a);
  box-shadow: 0 6px 25px rgba(255, 179, 71, 0.6);
  color: #000;
  transform: translateY(-2px);
}

.custom-coffee-url-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.custom-url-label {
  font-family: var(--font-tech);
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE-FIRST TUNING)
   ========================================================================== */
@media (max-width: 768px) {
  .app-container {
    padding: max(0.6rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(2rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
    gap: 0.9rem;
  }

  .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.85rem;
  }

  .brand-section {
    justify-content: center;
  }

  .header-status {
    align-self: center;
  }

  .header-actions {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .btn-icon-tech {
    padding: 0.45rem 0.65rem;
    font-size: 0.82rem;
  }

  .hud-card {
    padding: 0.5rem;
    border-radius: 12px;
  }

  /* Snoot hotspot tap cushion on phones */
  .snoot-hotspot::before {
    inset: -24px;
  }

  /* Horizontal swipeable category list on mobile */
  .category-controls-bar {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.4rem 0.2rem 0.6rem;
    scrollbar-width: none;
  }

  .category-controls-bar::-webkit-scrollbar {
    display: none;
  }

  .category-tab {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0.45rem 0.85rem;
    font-size: 0.84rem;
  }

  .oracle-output-card {
    padding: 1.15rem 1rem;
    border-radius: 14px;
    gap: 0.85rem;
  }

  .oracle-truth-text {
    font-size: 1.15rem;
    line-height: 1.5;
  }

  .oracle-actions-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .boop-counter {
    justify-content: center;
  }

  .action-buttons-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
  }

  .action-buttons-group .btn-cyber-primary {
    grid-column: span 2;
    padding: 0.75rem 1rem;
    font-size: 1.05rem;
  }

  .modal-window {
    max-height: 90vh;
    border-radius: 14px;
  }

  .modal-body {
    padding: 1rem;
  }
}

