/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body, #app { width: 100%; height: 100%; overflow: hidden; background: #000; }

/* ── Backdrop sliding track ───────────────────────── */
.backdrop-track {
  display: flex;
  height: 100%;
  will-change: transform;
  /* transition is injected via backdropTrackStyle so noTransition can suppress it */
  cursor: grab;
}
.backdrop-track:active {
  cursor: grabbing;
}

.backdrop-slide {
  position: relative;
  flex: 0 0 100vw;
  width: 100vw;
  height: 100%;
  overflow: hidden;
  /* background-color is set per-slide via Vue from the PHP edge-colour analysis */
}

/* Blurred ambient layer — same image scaled to cover, heavily blurred.
   scale(1.08) pushes the blur edges out of frame so no hard boundary shows. */
.backdrop-blur {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(48px) brightness(0.65) saturate(1.4);
  transform: scale(1.08);
  transform-origin: center;
}

/* Sharp foreground layer — full image, never cropped */
.backdrop-sharp {
  position: absolute;
  inset: 0;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

/* ── Shatter overlay ──────────────────────────────── */
.shatter-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.85);
  pointer-events: none;
}

.shard {
  position: absolute;
  background-size: cover;
  background-position: center;
  animation: shard-fly 1.6s cubic-bezier(0.55, 0, 1, 0.45) forwards;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@keyframes shard-fly {
  0%   { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) rotate(var(--rot)) scale(0.3); }
}

/* ── Surprise image ───────────────────────────────── */
.surprise-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: surprise-pop 0.5s 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.surprise-img {
  max-width: 70vw;
  max-height: 70vh;
  border-radius: 6px;
  box-shadow:
    0 0 60px rgba(255, 255, 255, 0.25),
    0 0 120px rgba(100, 140, 255, 0.15);
}

@keyframes surprise-pop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.1) rotate(-8deg); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
}

/* fade transition for the whole overlay */
.surprise-fade-enter-active { transition: opacity 0.3s ease; }
.surprise-fade-leave-active { transition: opacity 0.6s ease 0.1s; }
.surprise-fade-enter-from,
.surprise-fade-leave-to { opacity: 0; }

/* ── Breaking-news top bar ─────────────────────────── */
.news-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 150;
  height: 52px;
  background: rgba(0, 0, 0, 0.88);
  border-bottom: 2px solid #ff3300;
  box-shadow:
    0 0 12px rgba(255, 51, 0, 0.2),
    inset 0 0 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
  align-items: center;
}

/* CRT scanline overlay */
.news-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.12) 2px,
    rgba(0, 0, 0, 0.12) 4px
  );
  pointer-events: none;
  z-index: 1;
}

.news-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
}

/* Static "BREAKING NEWS" badge on the left */
.news-label {
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 26px;
  font-weight: bold;
  color: #000;
  background: #ff3300;
  padding: 0 14px;
  height: 100%;
  display: flex;
  align-items: center;
  letter-spacing: 2px;
  flex-shrink: 0;
  text-shadow: none;
  box-shadow: 4px 0 12px rgba(255, 51, 0, 0.5);
}

.news-text {
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 30px;
  color: #ffaa00;
  text-shadow:
    0 0 6px rgba(255, 170, 0, 0.7),
    0 0 20px rgba(255, 100, 0, 0.3);
  letter-spacing: 1.5px;
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  padding-left: 16px;
}

.news-ribbon {
  display: inline-block;
  white-space: nowrap;
  will-change: transform;
}

/* Idle flash — shown when no new strings are queued */
.news-idle {
  display: inline-block;
  white-space: nowrap;
  animation: breaking-flash 1.1s step-end infinite;
}

@keyframes breaking-flash {
  0%, 49% { opacity: 1; color: #ffaa00; text-shadow: 0 0 8px rgba(255,170,0,0.8), 0 0 24px rgba(255,100,0,0.4); }
  50%, 100% { opacity: 0.15; color: #ff6600; text-shadow: none; }
}

/* ── Terminal ticker bar ───────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

.terminal-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150;
  height: 52px;
  background: rgba(0, 0, 0, 0.88);
  border-top: 2px solid #33ff33;
  box-shadow:
    0 0 12px rgba(51, 255, 51, 0.15),
    inset 0 0 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
  align-items: center;
}

/* CRT scanline overlay */
.terminal-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.12) 2px,
    rgba(0, 0, 0, 0.12) 4px
  );
  pointer-events: none;
  z-index: 1;
}

.terminal-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 24px;
  overflow: hidden;
  white-space: nowrap;
}

.terminal-text {
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 30px;
  color: #33ff33;
  text-shadow:
    0 0 6px rgba(51, 255, 51, 0.6),
    0 0 20px rgba(51, 255, 51, 0.2);
  letter-spacing: 1.5px;
  overflow: hidden;
  flex: 1;
  position: relative;
}

.ticker-ribbon {
  display: inline-block;
  white-space: nowrap;
  will-change: transform;
}

.terminal-cursor {
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 30px;
  color: #33ff33;
  text-shadow: 0 0 6px rgba(51, 255, 51, 0.6);
  animation: blink-cursor 0.8s step-end infinite;
  margin-left: 2px;
  flex-shrink: 0;
}

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

/* ── Audio badge ──────────────────────────────────── */
.audio-badge {
  position: fixed;
  bottom: 64px;
  left: 20px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  color: rgba(255, 255, 255, 0.7);
  font-family: 'Courier New', monospace;
  font-size: 12px;
  cursor: pointer;
  pointer-events: all;
  user-select: none;
  transition: background 0.3s, color 0.3s;
}

.audio-badge:hover {
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
}

.audio-badge.playing .audio-icon {
  animation: pulse 1.2s ease infinite;
}

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

.audio-icon { font-size: 16px; }
.audio-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
