/* ═══════════════════════════════════════════════════════════════════
   WEBSHUTT — CYBERDECK MIDNIGHT BLAUGRANA PIXEL THEME
   Engineered for iOS Mobile & Desktop • Zero-Lag Anti-AI Slop
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* Midnight Blaugrana Palette (Refined & Anti-Norak) */
  --bg-base: #080b14;
  --bg-surface: #0d1424;
  --bg-elevated: #121c33;
  --bg-card: #0f182c;
  --bg-hover: #172442;
  
  --blau-accent: #2563eb;
  --blau-bright: #3b82f6;
  --blau-glow: rgba(59, 130, 246, 0.25);
  
  --grana-accent: #991b32;
  --grana-glow: rgba(153, 27, 50, 0.35);
  --grana-border: #751426;

  --gold-accent: #eab308;
  --gold-bright: #fde047;
  --gold-glow: rgba(234, 179, 8, 0.3);

  --border-subtle: #19243c;
  --border-active: #27395e;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-gold: #fde047;

  --font-pixel: 'Press Start 2P', monospace;
  --font-term: 'VT323', monospace;
  --font-body: -apple-system, BlinkMacSystemFont, 'SF Pro Text', ui-monospace, 'Menlo', 'Consolas', monospace;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── Reset & iOS Baseline ────────────────────────────────────────── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  overflow: hidden;
  user-select: text;
  touch-action: manipulation;
  overscroll-behavior-y: none;
}

/* ── CRT Scanlines Overlay (Toggleable) ───────────────────────────── */
body.crt::before {
  content: " ";
  display: block;
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
  background-size: 100% 3px;
  z-index: 999;
  pointer-events: none;
  opacity: 0.6;
}

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

/* ── Screen Management ───────────────────────────────────────────── */
.screen {
  display: none;
  width: 100%;
  height: 100%;
  height: 100dvh;
  flex-direction: column;
}
.screen.active {
  display: flex;
}
/* ── 1. CINEMATIC BLAUGRANA INTRO ───────────────────────────────── */
.intro-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #080b14;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.intro-screen.dismissed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.intro-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px;
  max-width: 440px;
}
.intro-crest {
  width: 72px;
  height: 72px;
  margin: 0 auto;
}
.intro-crest-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 16px var(--gold-glow));
  animation: crestPulse 1.8s ease-in-out;
}
.anthem-lyrics {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--font-pixel);
  font-size: 16px;
  letter-spacing: 1px;
  margin: 10px 0 4px;
}
.anthem-word {
  opacity: 0;
  transform: scale(0.6);
}
.anthem-word.w1 {
  color: var(--blau-bright);
  animation: wordPop 0.4s forwards 0.4s;
}
.anthem-word.w2 {
  color: var(--grana-accent);
  animation: wordPop 0.4s forwards 0.9s;
}
.anthem-word.w3 {
  color: var(--gold-bright);
  text-shadow: 0 0 12px var(--gold-glow);
  animation: wordPopGlow 0.6s forwards 1.4s;
}
@keyframes wordPop {
  0% { opacity: 0; transform: scale(0.5); }
  70% { opacity: 1; transform: scale(1.15); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes wordPopGlow {
  0% { opacity: 0; transform: scale(0.5); }
  60% { opacity: 1; transform: scale(1.25); text-shadow: 0 0 20px rgba(234, 179, 8, 0.8); }
  100% { opacity: 1; transform: scale(1.05); text-shadow: 0 0 12px rgba(234, 179, 8, 0.5); }
}
@keyframes crestPulse {
  0% { transform: scale(0.75); opacity: 0; }
  40% { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.intro-sub {
  font-family: var(--font-term);
  font-size: 15px;
  color: var(--text-secondary);
  opacity: 0;
  animation: fadeIn 0.4s forwards 1.7s;
}
.intro-skip-btn {
  margin-top: 6px;
  background: rgba(153, 27, 50, 0.35);
  border: 1px solid var(--gold-accent);
  color: var(--gold-accent);
  font-family: var(--font-pixel);
  font-size: 9px;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  animation: fadeIn 0.4s forwards 1.5s;
  transition: all 0.2s;
}
.intro-skip-btn:hover {
  background: var(--grana-accent);
  color: #ffffff;
}

/* ── 2. AUTH SCREEN ──────────────────────────────────────────────── */
#auth {
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.auth-box {
  width: 100%;
  max-width: 340px;
  background: var(--bg-surface);
  border: 1px solid var(--gold-accent);
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 0 24px rgba(234, 179, 8, 0.15);
}
.auth-title {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--gold-accent);
}
.auth-sub {
  font-size: 13px;
  color: var(--text-secondary);
}
.auth-input {
  background: #04060a;
  border: 1px solid var(--border-active);
  color: var(--gold-accent);
  padding: 12px;
  font-family: var(--font-pixel);
  font-size: 16px;
  text-align: center;
  outline: none;
}
.auth-input:focus {
  border-color: var(--gold-accent);
}
.auth-btn {
  background: var(--grana-accent);
  color: var(--text-primary);
  border: 1px solid var(--gold-accent);
  font-family: var(--font-pixel);
  font-size: 11px;
  padding: 12px;
  cursor: pointer;
}
.auth-err {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: #ef4444;
}

/* ── 3. CHAT SCREEN & HUD ────────────────────────────────────────── */
#chat {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  position: relative;
}

/* Top HUD */
.hud {
  background: rgba(13, 20, 36, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding-top: var(--safe-top);
  z-index: 50;
  flex-shrink: 0;
}
.hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  height: 52px;
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.channel-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-active);
  color: var(--gold-accent);
  padding: 6px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-family: var(--font-pixel);
  font-size: 9px;
}
.channel-chip {
  color: var(--text-primary);
}

.hud-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.hud-logo-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid var(--gold-accent);
}
.hud-branding {
  display: flex;
  flex-direction: column;
}
.hud-title {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--gold-accent);
  letter-spacing: 0.5px;
}
.hud-room-name {
  font-family: var(--font-term);
  font-size: 13px;
  color: var(--blau-bright);
}

.hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hud-telemetry {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-term);
  font-size: 13px;
  color: var(--text-secondary);
}
.status-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-led.online {
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}
.status-led.offline {
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

.hud-btn-icon {
  background: transparent;
  border: 1px solid var(--border-active);
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
}
.hud-btn-icon:hover {
  background: var(--bg-hover);
  color: var(--gold-accent);
}

/* Senyera Accent Strip */
.senyera-strip {
  height: 3px;
  width: 100%;
  background: repeating-linear-gradient(
    90deg,
    var(--grana-accent) 0,
    var(--grana-accent) 12px,
    var(--gold-accent) 12px,
    var(--gold-accent) 24px
  );
}

/* Dynamic Mood Ticker */
.mood-ticker {
  background: #05070d;
  padding: 4px 12px;
  display: flex;
  align-items: center;
  font-family: var(--font-term);
  font-size: 13px;
  color: var(--gold-accent);
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
  white-space: nowrap;
}
.coffee-cup-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  flex-shrink: 0;
}
.coffee-cup {
  font-size: 14px;
  filter: drop-shadow(0 0 4px var(--gold-glow));
}
.pixel-steam {
  position: absolute;
  top: -6px;
  font-family: var(--font-pixel);
  font-size: 9px;
  font-weight: bold;
  color: var(--gold-bright);
  pointer-events: none;
  opacity: 0;
}
.steam-1 {
  left: 1px;
  animation: steamPuff 1.6s infinite ease-out;
}
.steam-2 {
  left: 8px;
  animation: steamPuff 1.6s infinite ease-out 0.8s;
}
@keyframes steamPuff {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  35% { opacity: 0.9; }
  100% { transform: translateY(-12px) scale(1.3); opacity: 0; }
}
.ticker-text {
  animation: tickerSlide 25s linear infinite;
}

/* ── 4. CHANNEL DRAWER ───────────────────────────────────────────── */
.channel-drawer-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 6, 10, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
}
.channel-drawer-overlay.active {
  display: flex !important;
}
.channel-drawer {
  width: 85%;
  max-width: 320px;
  height: 100%;
  background: var(--bg-surface);
  border-right: 2px solid var(--grana-accent);
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-top) + 12px) 16px var(--safe-bottom);
  gap: 16px;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.7);
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-active);
  padding-bottom: 12px;
}
.drawer-title {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--gold-accent);
}
.drawer-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
}
.channel-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow-y: auto;
}
.channel-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--border-active);
  padding: 10px;
  text-align: left;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.channel-card:hover {
  background: var(--bg-hover);
  border-color: var(--border-active);
}
.channel-card.active {
  background: var(--bg-elevated);
  border-color: var(--gold-accent);
  border-left: 3px solid var(--gold-accent);
}
.card-id {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--gold-accent);
  background: rgba(234, 179, 8, 0.1);
  padding: 4px;
  border-radius: 2px;
}
.card-body {
  flex: 1;
}
.card-title {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--text-primary);
}
.card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.card-badge {
  font-family: var(--font-term);
  font-size: 12px;
  color: var(--blau-bright);
}

.drawer-footer {
  border-top: 1px solid var(--border-active);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.drawer-control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--text-secondary);
}
.control-btn {
  background: var(--bg-base);
  border: 1px solid var(--border-active);
  color: var(--gold-accent);
  padding: 4px 8px;
  font-family: var(--font-pixel);
  font-size: 9px;
  border-radius: 3px;
  cursor: pointer;
}
.insert-coin-btn {
  margin-top: 6px;
  background: var(--grana-accent);
  border: 1px solid var(--gold-accent);
  color: var(--text-primary);
  font-family: var(--font-pixel);
  font-size: 9px;
  padding: 10px;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
}

/* ── 5. MESSAGES CONTAINER ───────────────────────────────────────── */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  -webkit-overflow-scrolling: touch;
}

/* Welcome Box */
.welcome-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-active);
  border-top: 3px solid var(--gold-accent);
  padding: 24px 20px;
  border-radius: 8px;
  text-align: center;
  max-width: 500px;
  margin: 16px auto 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.welcome-avatar {
  width: 56px;
  height: 56px;
  max-width: 56px;
  max-height: 56px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.welcome-avatar-img {
  width: 56px !important;
  height: 56px !important;
  max-width: 56px !important;
  max-height: 56px !important;
  object-fit: contain;
  filter: drop-shadow(0 0 8px var(--gold-glow));
}
img {
  max-width: 100%;
}
.welcome-title {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--gold-accent);
  margin-bottom: 8px;
}
.welcome-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.welcome-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
}
.tag {
  font-family: var(--font-term);
  font-size: 13px;
  background: var(--bg-base);
  border: 1px solid var(--border-active);
  color: var(--blau-bright);
  padding: 2px 8px;
  border-radius: 3px;
}

/* Message Rows */
.msg-row {
  display: flex;
  flex-direction: column;
  width: 100%;
  animation: fadeIn 0.2s ease;
}
.msg-row.user {
  align-items: flex-end;
}
.msg-row.assistant {
  align-items: flex-start;
}

/* Bubbles */
.msg-bubble {
  max-width: 90%;
  border-radius: 6px;
  padding: 12px 14px;
  position: relative;
  word-break: break-word;
}
.msg-row.user .msg-bubble {
  background: #101c38;
  border: 1px solid var(--border-active);
  border-right: 3px solid var(--blau-bright);
  color: #ffffff;
}
.msg-row.assistant .msg-bubble {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--grana-accent);
  color: var(--text-primary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Header bar inside assistant bubble (Copy & Pin buttons) */
.bubble-tools {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.tool-btn {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 4px 6px;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.tool-btn:hover {
  border-color: var(--gold-accent);
  color: var(--gold-accent);
}

/* Content Formatting */
.msg-content p {
  margin-bottom: 10px;
}
.msg-content p:last-child {
  margin-bottom: 0;
}
.msg-content strong {
  color: var(--gold-bright);
}
.msg-content ul, .msg-content ol {
  margin-left: 20px;
  margin-bottom: 10px;
}
.msg-content li {
  margin-bottom: 4px;
}

/* Code Blocks (Cartridge Box Style) */
.code-box {
  background: #04060b;
  border: 1px solid var(--border-active);
  border-radius: 4px;
  margin: 10px 0;
  overflow: hidden;
}
.code-header {
  background: var(--bg-elevated);
  padding: 6px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--gold-accent);
}
.code-copy-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 2px 6px;
  cursor: pointer;
}
.code-pre {
  padding: 10px;
  overflow-x: auto;
  font-family: ui-monospace, 'Menlo', 'Consolas', monospace;
  font-size: 13px;
  color: #38bdf8;
  line-height: 1.4;
}

/* Choice Buttons for Story Mode */
.choice-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}
.choice-btn {
  background: var(--bg-base);
  border: 1px solid var(--grana-accent);
  color: var(--gold-accent);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 4px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}
.choice-btn:hover, .choice-btn:active {
  background: var(--grana-accent);
  color: #ffffff;
  border-color: var(--gold-accent);
}

/* ── 6. SMOKING ANIMATION LOADING BOX ────────────────────────────── */
.smoking-loading-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(8, 11, 20, 0.7);
  border: 1px dashed var(--border-active);
  border-radius: 6px;
  animation: fadeIn 0.2s ease;
}
.smoker-pixel-art {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 38px;
}
.smoke-cloud-container {
  position: absolute;
  top: -14px;
  right: -6px;
  width: 30px;
  height: 25px;
  pointer-events: none;
}
.smoke-puff {
  position: absolute;
  font-size: 11px;
  color: rgba(220, 225, 235, 0.85);
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.4));
  opacity: 0;
}
.puff-1 {
  bottom: 0;
  right: 6px;
  animation: smokePuffAnim 1.8s infinite ease-out;
}
.puff-2 {
  bottom: 6px;
  right: 12px;
  font-size: 13px;
  animation: smokePuffAnim 1.8s infinite ease-out 0.6s;
}
.puff-3 {
  bottom: 14px;
  right: 16px;
  font-size: 10px;
  animation: smokePuffAnim 1.8s infinite ease-out 1.2s;
}
@keyframes smokePuffAnim {
  0% {
    transform: translate(0, 0) scale(0.5);
    opacity: 0;
  }
  30% {
    opacity: 0.9;
  }
  70% {
    transform: translate(-10px, -18px) scale(1.3);
    opacity: 0.5;
  }
  100% {
    transform: translate(-18px, -28px) scale(1.6);
    opacity: 0;
  }
}
.smoker-head {
  position: relative;
  display: flex;
  align-items: center;
}
.smoker-avatar {
  font-size: 20px;
}
.smoker-cigar {
  font-size: 14px;
  margin-left: -4px;
  margin-top: 4px;
  transform: rotate(-10deg);
}
.smoker-ember {
  position: absolute;
  right: -2px;
  top: 10px;
  font-size: 8px;
  color: #ef4444;
  animation: emberGlow 1.2s infinite ease-in-out;
}
@keyframes emberGlow {
  0%, 100% { color: #f97316; filter: drop-shadow(0 0 3px #f97316); }
  50% { color: #ef4444; filter: drop-shadow(0 0 6px #ef4444); }
}
.smoking-text {
  font-family: var(--font-pixel);
  font-size: 9px;
  display: flex;
  gap: 6px;
}
.smoking-name {
  color: var(--blau-bright);
}
.smoking-action {
  color: var(--gold-accent);
}

/* Inline Dots Fallback */
.typing-dots-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
}
.typing-dots-inline .dot {
  color: var(--gold-accent);
  animation: dotPulse 1.2s infinite;
  font-size: 10px;
}
.typing-dots-inline .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dots-inline .dot:nth-child(3) { animation-delay: 0.4s; }
/* ── 7. INPUT DOCK (iOS & Desktop Optimized) ──────────────────────── */
.input-dock {
  background: rgba(13, 20, 36, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-active);
  padding: 8px 12px calc(var(--safe-bottom) + 8px);
  flex-shrink: 0;
  z-index: 40;
}
.input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 760px;
  margin: 0 auto;
  background: #04060a;
  border: 1px solid var(--border-active);
  border-radius: 8px;
  padding: 4px 8px;
  transition: all 0.2s ease;
}
.input-row:focus-within {
  border-color: var(--gold-accent);
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.25);
}
.dock-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 16px;
  transition: color 0.15s, background 0.15s;
}
.dock-btn:hover {
  color: var(--gold-accent);
  background: var(--bg-hover);
}
.dock-btn.recording {
  background: #ef4444;
  color: #ffffff;
  animation: pulse 1s infinite;
}
.textarea-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
}
.msg-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.4;
  resize: none;
  max-height: 120px;
  padding: 6px 4px;
}
.msg-input::placeholder {
  color: var(--text-muted);
  font-family: var(--font-term);
  font-size: 16px;
}
.send-btn {
  background: var(--grana-accent);
  border: 1px solid var(--gold-accent);
  color: var(--text-primary);
  width: 34px;
  height: 34px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.send-btn:hover:not(:disabled) {
  background: #b91c1c;
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.4);
}
.send-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  border-color: var(--border-subtle);
  background: var(--bg-surface);
}

/* ── 8. MODALS & TOAST ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 6, 10, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active {
  display: flex !important;
}
.modal-box {
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  background: var(--bg-surface);
  border: 1px solid var(--gold-accent);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
}
.modal-header {
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-active);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-title {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--gold-accent);
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
}
.modal-content {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-footer {
  padding: 12px 16px;
  background: var(--bg-base);
  border-top: 1px solid var(--border-subtle);
}
.modal-btn {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-active);
  color: var(--text-primary);
  font-family: var(--font-pixel);
  font-size: 9px;
  padding: 10px;
  border-radius: 4px;
  cursor: pointer;
}

/* Notes List */
.note-card {
  background: var(--bg-base);
  border: 1px solid var(--border-active);
  border-left: 3px solid var(--gold-accent);
  padding: 10px;
  border-radius: 4px;
  position: relative;
}
.note-header {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--gold-accent);
  margin-bottom: 6px;
}
.note-body {
  font-size: 13px;
  color: var(--text-primary);
  white-space: pre-wrap;
}
.empty-notes {
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  padding: 24px 0;
}

/* Settings Items */
.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--text-secondary);
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.badge-val {
  color: var(--blau-bright);
}
.badge-val.ok {
  color: #22c55e;
}
.modal-divider {
  height: 1px;
  background: var(--border-active);
  margin: 6px 0;
}
/* Reset Modal Custom (Ganti Confirm Google) */
.reset-modal-box {
  border: 1px solid var(--grana-accent) !important;
  box-shadow: 0 0 30px rgba(153, 27, 50, 0.4);
}
.reset-modal-content {
  text-align: center;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.reset-icon-coin {
  font-size: 38px;
  filter: drop-shadow(0 0 12px var(--gold-glow));
  animation: coinSpin 1.5s infinite ease-in-out;
}
@keyframes coinSpin {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15) rotate(10deg); }
}
.reset-warn-title {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--gold-bright);
}
.reset-warn-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 320px;
}
.reset-btn-row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  width: 100%;
}
.reset-confirm-btn {
  flex: 1;
  background: var(--grana-accent);
  border: 1px solid var(--gold-accent);
  color: #ffffff;
  font-family: var(--font-pixel);
  font-size: 9px;
  padding: 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.reset-confirm-btn:hover {
  background: #b91c1c;
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.4);
}
.reset-cancel-btn {
  flex: 1;
  background: var(--bg-base);
  border: 1px solid var(--border-active);
  color: var(--text-secondary);
  font-family: var(--font-pixel);
  font-size: 9px;
  padding: 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.reset-cancel-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Toast */
.toast {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold-accent);
  color: #04060a;
  font-family: var(--font-pixel);
  font-size: 9px;
  padding: 8px 14px;
  border-radius: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  z-index: 200;
  animation: fadeIn 0.15s ease;
}

/* ── Animations ─────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}
@keyframes dotPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
@keyframes tickerSlide {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}
