/* ====================================================================
   NARRATOR ENGINE — self-contained styles
   Palette lifted from the main site (style.css) so it matches on sight,
   but every rule here is local — this file has no shared dependency.
   ==================================================================== */

:root {
  --bg: #000;
  --pink: #ff007f;
  --purple: #7209b7;
  --purple-light: #b5179e;
  --green: #00ff66;
  --lcd-green: #98fb98;
  --cyan: #2ee6ff;
  --red: #ff2b4d;
  --panel: #14141a;
  --panel-dark: #0a0a0d;
  --chrome: #2a2a32;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: #fff;
  font-family: 'Courier New', Courier, monospace;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ==================== Matrix rain (full page background) ==================== */
.matrix-rain {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.matrix-rain .rain-col {
  position: absolute;
  top: 0;
  width: 22px;
  height: 200%;
  font-size: 15px;
  line-height: 25px;
  letter-spacing: 1px;
  text-align: center;
  white-space: pre-line;
  animation-name: rainFall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes rainFall {
  0%   { transform: translateY(-50%); }
  100% { transform: translateY(0%); }
}

/* ==================== Nav / header ==================== */
.nar-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 40px;
  border-bottom: 2px solid rgba(46,230,255,0.4);
}
.nar-title {
  font-size: 1.1rem;
  font-weight: bold;
  letter-spacing: 2px;
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(46,230,255,0.85), 0 0 24px rgba(46,230,255,0.4);
}
.nar-title span { color: #fff; text-shadow: none; opacity: 0.6; font-weight: normal; }
.nar-nav { display: flex; gap: 10px; }
.nar-nav a {
  border: 1px solid rgba(46,230,255,0.4);
  color: var(--cyan);
  padding: 8px 16px;
  font-size: 0.8rem;
  letter-spacing: 1px;
  transition: all 0.25s;
}
.nar-nav a:hover { background: rgba(46,230,255,0.16); box-shadow: 0 0 15px rgba(46,230,255,0.35); }

/* ==================== Layout ==================== */
.nar-main {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin: 0 auto;
  padding: 50px 24px 80px;
}
.nar-subtitle {
  text-align: center;
  color: #888;
  font-size: 0.8rem;
  letter-spacing: 2px;
  margin: 0 0 34px;
}
.nar-subtitle .blink { color: var(--green); animation: blinkCursor 1s steps(1) infinite; }
@keyframes blinkCursor { 50% { opacity: 0; } }

/* ==================== MiniDisc chassis ==================== */
.md-unit {
  background: linear-gradient(160deg, #1c1c22, #0c0c10 60%);
  border: 1px solid var(--chrome);
  border-radius: 18px;
  padding: 26px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03) inset,
    0 20px 60px rgba(0,0,0,0.7),
    0 0 40px rgba(255,0,127,0.08);
  position: relative;
}
.md-brand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding: 0 4px;
}
.md-brand {
  font-size: 0.7rem;
  letter-spacing: 3px;
  color: #777;
}
.md-brand b { color: var(--pink); text-shadow: 0 0 6px rgba(255,0,127,0.6); }
.md-power-led {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green), 0 0 16px var(--green);
}

/* ---- Disc window ---- */
.md-disc-bay {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.md-disc-window {
  width: 176px;
  height: 176px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #26262e 0%, #0a0a0d 70%);
  border: 6px solid #050506;
  box-shadow:
    0 0 0 2px rgba(46,230,255,0.25),
    inset 0 0 30px rgba(0,0,0,0.9),
    0 0 30px rgba(46,230,255,0.15);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.md-disc {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background:
    repeating-conic-gradient(
      from 0deg,
      rgba(255,0,127,0.35) 0deg 8deg,
      rgba(46,230,255,0.25) 8deg 16deg,
      rgba(114,9,183,0.3) 16deg 24deg,
      rgba(0,0,0,0) 24deg 32deg
    );
  border: 2px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s linear;
}
.md-disc-hub {
  width: 34px; height: 34px; border-radius: 50%;
  background: #050506;
  border: 2px solid var(--pink);
  box-shadow: 0 0 12px rgba(255,0,127,0.5);
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; color: var(--pink); letter-spacing: 1px;
}
.md-disc.spinning { animation: discSpin linear infinite; }
@keyframes discSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ---- LCD readout ---- */
.md-lcd {
  background: #0b1a10;
  border: 2px inset #1b2a1b;
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 18px rgba(0,0,0,0.85);
}
.md-lcd::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0.18) 0px,
    rgba(0,0,0,0.18) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
}
.md-lcd-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  letter-spacing: 1px;
  color: var(--lcd-green);
  text-shadow: 0 0 6px rgba(152,251,152,0.55);
  padding: 2px 0;
}
.md-lcd-row .lbl { opacity: 0.55; }
#lcdStatus { font-weight: bold; }

/* ---- Voice selector ---- */
.md-voice-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 22px;
}
.md-voice-btn {
  width: 30px; height: 30px;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  background: transparent;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.2s;
}
.md-voice-btn:hover { background: var(--cyan); color: #000; box-shadow: 0 0 12px var(--cyan); }
.md-voice-label {
  font-size: 0.7rem;
  letter-spacing: 1px;
  color: #aaa;
  min-width: 150px;
  text-align: center;
}

/* ---- Jog dial ---- */
.md-jog-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
  user-select: none;
}
.md-jog-outer {
  width: 92px; height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #333, #0d0d10 75%);
  border: 3px solid #050506;
  box-shadow: 0 0 0 1px rgba(255,0,127,0.25), inset 0 4px 10px rgba(0,0,0,0.8);
  display: flex; align-items: center; justify-content: center;
  cursor: grab;
  touch-action: none;
  position: relative;
}
.md-jog-outer:active { cursor: grabbing; }
.md-jog-notch {
  position: absolute;
  top: 8px; left: 50%;
  width: 4px; height: 14px;
  margin-left: -2px;
  background: var(--pink);
  box-shadow: 0 0 8px var(--pink);
  border-radius: 2px;
  transform-origin: 2px 38px;
}
.md-jog-cap {
  width: 30px; height: 30px; border-radius: 50%;
  background: #1a1a1e;
  border: 1px solid #444;
}
.md-jog-label {
  margin-top: 8px;
  font-size: 0.65rem;
  letter-spacing: 2px;
  color: #777;
}

/* ---- Transport buttons ---- */
.md-transport {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 6px;
}
.md-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--panel-dark);
  border: 1px solid #333;
  padding: 12px 6px;
  font-family: inherit;
  font-size: 0.65rem;
  letter-spacing: 1px;
  color: #ccc;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}
.md-btn svg { width: 16px; height: 16px; }
.md-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.md-btn.rec { border-color: var(--red); color: var(--red); }
.md-btn.rec:hover:not(:disabled) { background: var(--red); color: #fff; box-shadow: 0 0 14px var(--red); }
.md-btn.play { border-color: var(--green); color: var(--green); }
.md-btn.play:hover:not(:disabled) { background: var(--green); color: #000; box-shadow: 0 0 14px var(--green); }
.md-btn.stop { border-color: var(--pink); color: var(--pink); }
.md-btn.stop:hover:not(:disabled) { background: var(--pink); color: #fff; box-shadow: 0 0 14px var(--pink); }
.md-btn.save { border-color: var(--cyan); color: var(--cyan); }
.md-btn.save:hover:not(:disabled) { background: var(--cyan); color: #000; box-shadow: 0 0 14px var(--cyan); }

/* ==================== Script input console ==================== */
.nar-console {
  margin-top: 30px;
  background: var(--panel);
  border: 1px solid rgba(255,0,127,0.35);
  border-radius: 8px;
  padding: 18px;
}
.nar-console-label {
  font-size: 0.7rem;
  letter-spacing: 2px;
  color: var(--pink);
  text-shadow: 0 0 6px rgba(255,0,127,0.5);
  margin-bottom: 10px;
}
#scriptInput {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  background: #050505;
  border: 1px solid #262626;
  color: #ddd;
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.5;
  padding: 12px;
  border-radius: 4px;
}
#scriptInput:focus { outline: none; border-color: var(--cyan); }
.nar-console-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: #666;
  margin-top: 8px;
  letter-spacing: 1px;
}

/* ==================== Footer ==================== */
.nar-footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 24px;
  font-size: 0.65rem;
  letter-spacing: 1px;
  color: #555;
  border-top: 1px solid rgba(255,255,255,0.06);
}

@media (max-width: 520px) {
  .nar-header { padding: 18px 20px; flex-direction: column; gap: 12px; }
  .md-transport { grid-template-columns: repeat(2, 1fr); }
}
