/* ============ BERRRYVISION LD-9000 — Retro Home Theater ============ */
:root {
  --wood1: #3a2517;
  --wood2: #241610;
  --metal1: #4a4f57;
  --metal2: #2b2f35;
  --metal-hi: #6b727c;
  --lcd-green: #4ade80;
  --lcd-glow: #22c55e;
  --amber: #fbbf24;
  --red: #ef4444;
  --panel: #16181c;
}

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

html, body {
  min-height: 100%;
  background:
    radial-gradient(circle at 50% -10%, #1a2230 0%, #0a0d12 55%, #05070a 100%);
  color: #e5e7eb;
  font-family: 'IBM Plex Mono', monospace;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---- The unit (rack component) ---- */
#unit {
  width: 100%;
  max-width: 960px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, #52585f, #2c3036 8%, #23262b 100%);
  border: 2px solid #14161a;
  box-shadow:
    0 0 0 3px #0b0d10,
    0 30px 70px rgba(0,0,0,0.7),
    inset 0 2px 0 rgba(255,255,255,0.08);
  padding: 4px;
  overflow: hidden;
}

/* ---- Faceplate header ---- */
#faceplate {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 16px 22px;
  background:
    linear-gradient(180deg, #6a7078 0%, #3a3e44 40%, #2a2d32 100%);
  border-radius: 8px 8px 0 0;
  border-bottom: 3px solid #101215;
  position: relative;
}
#faceplate::after {
  /* brushed metal texture */
  content: ''; position: absolute; inset: 0; border-radius: 8px 8px 0 0;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 3px);
  pointer-events: none;
}

.brand-block { z-index: 1; }
.brand {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(20px, 5vw, 34px);
  letter-spacing: 3px;
  background: linear-gradient(180deg, #f4f7fa 0%, #aeb6c0 45%, #6b7280 55%, #d5dae0 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 3px rgba(0,0,0,0.5);
  filter: drop-shadow(0 1px 0 rgba(255,255,255,0.3));
}
.model {
  font-size: 10px; letter-spacing: 2px; color: #9aa3ad;
  margin-top: 2px; font-weight: 600;
}

.readout-block { z-index: 1; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }

.leds { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.led {
  font-size: 8px; letter-spacing: 1px; color: #4b5158; font-weight: 600;
  display: flex; align-items: center; gap: 4px;
}
.led::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: #2a2d30; box-shadow: inset 0 0 2px #000;
}
.led.on { color: #cdd3da; }
.led[data-led="POWER"].on::before { background: var(--red); box-shadow: 0 0 6px var(--red); }
.led[data-led="DISC"].on::before  { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.led[data-led="NTSC"].on::before  { background: #22d3ee; box-shadow: 0 0 6px #22d3ee; }
.led[data-led="CX"].on::before    { background: #a78bfa; box-shadow: 0 0 6px #a78bfa; }
.led[data-led="DIGITAL"].on::before { background: var(--lcd-green); box-shadow: 0 0 6px var(--lcd-green); }

/* LCD readout */
.lcd {
  font-family: 'VT323', monospace;
  font-size: clamp(20px, 4vw, 30px);
  letter-spacing: 2px;
  min-width: 220px; text-align: center;
  padding: 4px 16px;
  background: #071008;
  color: #2f5a38;
  border: 2px solid #000; border-radius: 4px;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.9), inset 0 0 4px #062;
  text-shadow: none;
}
.lcd-ok { color: var(--lcd-green); text-shadow: 0 0 8px var(--lcd-glow); }
.lcd-err { color: var(--red); text-shadow: 0 0 10px var(--red); background: #180606; border-color: #300; }
.lcd.blink { animation: lcdblink 0.35s steps(1) infinite; }
@keyframes lcdblink { 50% { opacity: 0.25; } }

/* ---- Body / disc bay ---- */
#body {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 4px;
  background:
    linear-gradient(180deg, var(--wood1), var(--wood2));
  background-blend-mode: multiply;
}
#disc-bay {
  position: relative;
  min-height: 340px;
  background:
    radial-gradient(circle at 50% 45%, #10161f 0%, #05070a 80%),
    repeating-linear-gradient(90deg, rgba(0,0,0,0.15) 0 2px, transparent 2px 6px);
  border-right: 3px solid #101215;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
#canvas { display: block; width: 100%; height: 100%; }
#disc-caption {
  position: absolute; bottom: 12px; left: 0; right: 0;
  text-align: center; font-size: 11px; letter-spacing: 2px;
  color: #7dd3fc; text-shadow: 0 0 6px rgba(56,189,248,0.5);
  pointer-events: none;
  font-family: 'IBM Plex Mono', monospace;
}

/* ---- Side panel ---- */
#side-panel {
  padding: 16px;
  background: linear-gradient(180deg, #1c1f24, #14161a);
  display: flex; flex-direction: column; gap: 14px;
}

/* Drop zone / disc slot */
.drop-zone {
  border: 2px dashed #3a4048;
  border-radius: 8px;
  padding: 16px 14px 18px;
  text-align: center;
  background: linear-gradient(180deg, #0f1216, #1a1e24);
  transition: all 0.18s;
}
.drop-zone.drag {
  border-color: var(--lcd-green);
  background: linear-gradient(180deg, #0f1a12, #12291a);
  box-shadow: 0 0 18px rgba(74,222,128,0.3);
}
.slot-mouth {
  height: 10px; width: 80%; margin: 0 auto 12px;
  background: linear-gradient(180deg, #000, #222);
  border-radius: 4px;
  box-shadow: inset 0 3px 6px rgba(0,0,0,0.9), 0 1px 0 rgba(255,255,255,0.06);
}
.slot-label {
  font-family: 'Orbitron', sans-serif; font-weight: 700;
  font-size: 12px; letter-spacing: 1px; color: var(--amber);
  text-shadow: 0 0 6px rgba(251,191,36,0.4);
}
.slot-hint { font-size: 10px; color: #7a828c; margin: 6px 0 12px; line-height: 1.5; }

/* Hardware buttons */
.hw-btn {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700; font-size: 11px; letter-spacing: 1px;
  color: #e6e9ed;
  background: linear-gradient(180deg, #4b535d, #2b3037);
  border: 1px solid #14161a;
  border-radius: 6px;
  padding: 10px 14px;
  cursor: pointer;
  box-shadow: 0 2px 0 #0c0e11, inset 0 1px 0 rgba(255,255,255,0.15);
  transition: transform 0.05s, box-shadow 0.05s;
  user-select: none;
}
.hw-btn:hover { background: linear-gradient(180deg, #565f6a, #333941); }
.hw-btn:active { transform: translateY(2px); box-shadow: 0 0 0 #0c0e11, inset 0 2px 4px rgba(0,0,0,0.6); }
.hw-btn.wide { width: 100%; }
.hw-btn.small { font-size: 10px; padding: 8px 10px; }

/* Meta panel */
.meta-panel {
  background: linear-gradient(180deg, #0c0f13, #14181e);
  border: 1px solid #262b32;
  border-radius: 8px;
  padding: 12px;
  min-height: 90px;
  font-size: 11px;
}
.meta-empty { color: #565d66; font-style: italic; text-align: center; padding: 18px 0; }
.meta-title {
  font-family: 'Orbitron', sans-serif; font-weight: 700;
  color: #7dd3fc; font-size: 13px; letter-spacing: 0.5px;
  text-shadow: 0 0 8px rgba(56,189,248,0.4);
  line-height: 1.3;
}
.meta-year { color: #94a3b8; font-size: 10px; margin: 3px 0 10px; }
.meta-rows { display: flex; flex-direction: column; gap: 5px; }
.meta-rows > div {
  display: flex; justify-content: space-between;
  border-bottom: 1px dotted #2a303a; padding-bottom: 3px;
}
.meta-rows span { color: #6b7684; letter-spacing: 1px; font-size: 9px; }
.meta-rows b { color: #d5dbe3; font-weight: 600; }
.meta-egg {
  margin-top: 10px; padding: 8px; border-radius: 6px;
  background: rgba(251,191,36,0.12); border: 1px solid rgba(251,191,36,0.3);
  color: var(--amber); font-size: 10px; line-height: 1.4;
}

/* Toggles */
.toggles { display: flex; flex-direction: column; gap: 10px; }
.tog {
  display: flex; align-items: center; gap: 8px;
  font-size: 10px; letter-spacing: 1px; color: #b3bbc4; cursor: pointer;
}
.tog input { accent-color: #a78bfa; width: 16px; height: 16px; }

/* ---- Transport ---- */
#transport {
  display: flex; gap: 6px; flex-wrap: wrap; justify-content: center;
  padding: 14px;
  background: linear-gradient(180deg, #2a2d32, #1a1c20);
  border-top: 3px solid #101215;
}
.hw-btn.t { min-width: 46px; font-size: 13px; padding: 12px 10px; }
.hw-btn.t.play {
  color: #d1fadf;
  background: linear-gradient(180deg, #1f7a45, #0f4f2a);
  box-shadow: 0 2px 0 #062, inset 0 1px 0 rgba(255,255,255,0.2);
}
.hw-btn.t.play:hover { background: linear-gradient(180deg, #269152, #135f33); }

/* ---- Progress ---- */
#progress-wrap {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px 16px;
  background: #14161a;
  border-radius: 0 0 8px 8px;
}
.chapter-tag, .time-tag {
  font-family: 'VT323', monospace; font-size: 20px;
  color: var(--lcd-green); text-shadow: 0 0 6px var(--lcd-glow);
  min-width: 56px; text-align: center;
  background: #071008; border: 1px solid #000; border-radius: 4px;
  padding: 2px 6px;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.9);
}
.progress-track {
  flex: 1; height: 10px; border-radius: 5px;
  background: #05070a; border: 1px solid #000;
  overflow: hidden; box-shadow: inset 0 2px 4px rgba(0,0,0,0.8);
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #16a34a, #4ade80, #a78bfa);
  box-shadow: 0 0 8px rgba(74,222,128,0.6);
  transition: width 0.3s linear;
}

/* ---- Modal ---- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}
.modal.hidden { display: none; }
.modal-card {
  max-width: 440px; width: 100%;
  background: linear-gradient(180deg, #1a1216, #120a0c);
  border: 2px solid var(--red);
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 0 40px rgba(239,68,68,0.4), 0 30px 60px rgba(0,0,0,0.7);
  animation: pop 0.25s ease;
}
@keyframes pop { from { transform: scale(0.85); opacity: 0; } }
.modal-error {
  font-family: 'Orbitron', sans-serif; font-weight: 900;
  font-size: 26px; letter-spacing: 2px; color: var(--red);
  text-shadow: 0 0 14px rgba(239,68,68,0.7);
  margin-bottom: 16px;
  animation: errpulse 0.6s ease-in-out infinite alternate;
}
@keyframes errpulse { to { transform: scale(1.04); } }
#reject-text { color: #f1d5d5; font-size: 14px; line-height: 1.6; margin-bottom: 22px; }

/* Shake */
body.shake { animation: shake 0.45s; }
@keyframes shake {
  10%,90% { transform: translateX(-2px); }
  20%,80% { transform: translateX(4px); }
  30%,50%,70% { transform: translateX(-6px); }
  40%,60% { transform: translateX(6px); }
}

/* ---- Footer ---- */
#footer {
  margin-top: 18px;
  max-width: 960px; text-align: center;
  font-size: 10px; color: #5b636d; line-height: 1.6;
  letter-spacing: 0.5px;
}
#footer a { color: #7dd3fc; text-decoration: none; border-bottom: 1px dotted #7dd3fc; }
#footer a:hover { color: #bae6fd; }

/* ---- Responsive ---- */
@media (max-width: 680px) {
  body { padding: 10px; }
  #body { grid-template-columns: 1fr; }
  #disc-bay { border-right: none; border-bottom: 3px solid #101215; min-height: 300px; }
  #faceplate { flex-direction: column; align-items: center; text-align: center; }
  .readout-block { align-items: center; }
  .leds { justify-content: center; }
  .lcd { min-width: 200px; }
  .hw-btn.t { min-width: 40px; font-size: 12px; padding: 12px 6px; flex: 1 1 auto; }
}
</style>