/* RETROVAULT HD - 80s/90s CRT Aesthetic */
:root {
  --bg: #0a0a14;
  --bg-panel: #11111f;
  --bg-card: #1a1a2e;
  --text: #e0e0ff;
  --text-cyan: #00f0ff;
  --text-magenta: #ff00aa;
  --text-purple: #c026d3;
  --text-lime: #39ff14;
  --text-yellow: #f0e130;
  --text-orange: #ff6600;
  --border: #555577;
  --border-light: #8888aa;
  --bezel: #222233;
  --scanline: rgba(255, 255, 255, 0.008);
}

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

body {
  background: #000;
  color: var(--text);
  font-family: 'Courier New', Courier, monospace;
  font-size: 15px;
  line-height: 1.4;
  overflow-x: hidden;
}

/* CRT Monitor Bezel + Frame */
.crt-monitor {
  max-width: 1080px;
  margin: 20px auto;
  background: var(--bg);
  border: 12px solid #1f1f2e;
  border-radius: 6px;
  box-shadow: 
    0 0 0 10px #0c0c14,
    0 0 0 16px #15151f,
    0 0 40px rgba(0, 240, 255, 0.2),
    inset 0 0 40px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

/* Subtle CRT curve + screen glow */
.crt-monitor::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 240, 255, 0.02) 0%,
    rgba(0, 0, 0, 0) 80%
  );
  pointer-events: none;
  z-index: 2;
  border-radius: 2px;
}

/* SCANLINES - very subtle background only, light optional on hover (Option A) */
.scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 5px,
    var(--scanline) 5px,
    var(--scanline) 6px
  );
  pointer-events: none;
  z-index: 3;
  mix-blend-mode: screen;
  opacity: 0.85;
}

/* Light optional scan effect only on hover - very gentle, slow */
.crt-monitor:hover .scanlines {
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 4px,
    rgba(255, 255, 255, 0.018) 4px,
    rgba(255, 255, 255, 0.018) 5px
  );
  animation: scan 9s linear infinite;
  opacity: 1;
}

@keyframes scan {
  0% { background-position: 0 0; }
  100% { background-position: 0 160px; }
}

/* Flicker effect for authentic CRT */
.crt-content {
  position: relative;
  z-index: 1;
}

/* Top BBS Status Bar */
.status-bar {
  background: #0f0f1c;
  border-bottom: 2px solid var(--border);
  padding: 6px 16px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-cyan);
  text-shadow: 0 0 4px var(--text-cyan);
  font-weight: bold;
  letter-spacing: 1px;
}

.status-bar .left {
  display: flex;
  gap: 20px;
}

.status-bar .right {
  color: var(--text-lime);
}

/* Header / Logo */
header {
  background: linear-gradient(#1a1a2e, #0f0f1c);
  padding: 18px 24px 14px;
  border-bottom: 3px solid var(--text-magenta);
  text-align: center;
  position: relative;
}

.logo {
  font-size: 52px;
  font-weight: 900;
  letter-spacing: 6px;
  color: var(--text-cyan);
  text-shadow: 
    0 0 8px var(--text-cyan),
    0 0 16px var(--text-cyan),
    0 0 28px var(--text-purple),
    0 0 42px var(--text-magenta),
    3px 3px 0 var(--text-magenta),
    -1px -1px 0 var(--text-magenta);
  line-height: 1;
  font-family: 'Impact', 'Arial Black', sans-serif;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s;
}

.logo:hover {
  animation: glitch 0.4s steps(2);
}

.logo .hd {
  font-size: 28px;
  vertical-align: super;
  color: var(--text-yellow);
  text-shadow: 0 0 8px var(--text-yellow);
  margin-left: 4px;
}

.tagline {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-magenta);
  letter-spacing: 4px;
  text-transform: uppercase;
  text-shadow: 
    0 0 12px var(--text-magenta),
    0 0 22px var(--text-purple),
    0 0 32px rgba(192, 38, 211, 0.5);
}

@keyframes glitch {
  0% { transform: translate(0); }
  20% { transform: translate(-3px, 1px); }
  40% { transform: translate(3px, -1px); }
  60% { transform: translate(-1px, 2px); }
  80% { transform: translate(2px, -2px); }
  100% { transform: translate(0); }
}

/* Navigation - Old School Buttons */
nav {
  background: #0f0f1c;
  border-bottom: 2px solid var(--border);
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.nav-btn {
  background: var(--bg-card);
  color: var(--text-cyan);
  border: 2px solid var(--border-light);
  padding: 8px 18px;
  font-family: inherit;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.1s;
  box-shadow: inset 0 2px 0 #ffffff22, inset 0 -2px 0 #00000088;
}

.nav-btn:hover {
  background: #22223a;
  color: var(--text-lime);
  border-color: var(--text-lime);
  box-shadow: 
    0 0 12px rgba(57, 255, 20, 0.5),
    0 0 20px rgba(0, 240, 255, 0.3);
}

.nav-btn:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
}

/* Marquee / Ticker */
.ticker {
  background: #000;
  color: var(--text-yellow);
  border: 1px solid var(--text-yellow);
  padding: 4px 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 13px;
  letter-spacing: 2px;
  text-shadow: 
    0 0 6px var(--text-yellow),
    0 0 12px var(--text-yellow),
    0 0 18px rgba(240, 225, 48, 0.5);
}

.ticker span {
  display: inline-block;
  padding-left: 100%;
  animation: ticker 18s linear infinite;
}

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* Hero */
.hero {
  padding: 36px 24px 28px;
  text-align: center;
  background: linear-gradient(to bottom, #11111f 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: 28px;
  color: var(--text-lime);
  margin-bottom: 8px;
  text-shadow: 
    0 0 10px var(--text-lime),
    0 0 20px rgba(57, 255, 20, 0.6);
}

.hero p {
  max-width: 620px;
  margin: 0 auto 18px;
  color: #aabbcc;
  font-size: 15px;
}

.cta-btn {
  display: inline-block;
  background: var(--text-magenta);
  color: #000;
  font-weight: 900;
  padding: 12px 32px;
  font-size: 15px;
  letter-spacing: 2px;
  text-decoration: none;
  border: 3px solid #fff;
  box-shadow: 
    0 0 10px var(--text-magenta),
    0 0 0 3px var(--text-magenta);
  cursor: pointer;
  font-family: inherit;
  transition: all .1s;
}

.cta-btn:hover {
  background: var(--text-yellow);
  color: #000;
  box-shadow: 
    0 0 14px var(--text-yellow),
    0 0 0 3px var(--text-yellow);
}

/* Sections */
.section {
  padding: 22px 24px;
  border-bottom: 1px solid #222233;
}

.section-title {
  color: var(--text-cyan);
  font-size: 18px;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 3px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-shadow: 
    0 0 8px var(--text-cyan),
    0 0 16px var(--text-cyan),
    0 0 26px var(--text-purple);
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--text-cyan), transparent);
}

/* Search + Filters */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  align-items: center;
}

.search-input {
  flex: 1;
  min-width: 220px;
  background: #000;
  border: 2px solid var(--border);
  color: var(--text-lime);
  padding: 9px 14px;
  font-family: inherit;
  font-size: 14px;
}

.search-input:focus {
  outline: none;
  border-color: var(--text-lime);
  box-shadow: 0 0 6px var(--text-lime);
}

.filter-btn {
  background: transparent;
  color: var(--text-cyan);
  border: 2px solid var(--border);
  padding: 7px 14px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 0 4px rgba(0, 240, 255, 0.2);
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--text-cyan);
  color: #000;
  border-color: var(--text-cyan);
  box-shadow: 0 0 10px var(--text-cyan);
}

/* Vault Grid - VHS / Cassette Cards */
.vault-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 18px;
}

.card {
  background: var(--bg-card);
  border: 3px solid var(--text-cyan);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  position: relative;
  box-shadow: 3px 3px 0 #00000066, 0 0 8px rgba(0,240,255,0.35);
  /* crisp images */
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 5px 5px 0 #00000088, 
    0 0 20px var(--text-cyan),
    0 0 35px var(--text-magenta),
    0 0 50px var(--text-purple);
  border-color: var(--text-cyan);
}

.card .title {
  text-shadow: 
    0 0 10px var(--text-cyan),
    0 0 18px var(--text-magenta),
    0 0 28px var(--text-purple);
}

.card .media {
  height: 112px;
  background: #000;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 2px solid #333355;
}

/* Very light retro poster feel only - no heavy distortion (Option A) */
.card .media::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(rgba(0,0,0,0.12) 20%, transparent 20%),
    linear-gradient(90deg, rgba(0,0,0,0.06) 1px, transparent 1px);
  background-size: 100% 12px, 18px 100%;
  opacity: 0.22;
  mix-blend-mode: multiply;
}

.card.film .media { background: linear-gradient(#1f1329, #0f0a18); }
.card.music .media { background: linear-gradient(#0a251a, #05120d); }
.card.tv .media { background: linear-gradient(#251a0f, #140f08); }
.card.culture .media { background: linear-gradient(#1a1629, #0c0a15); }

.card.games .media { background: linear-gradient(#0a251a, #05120d); }
.card.games .title { font-family: monospace; letter-spacing: 1px; text-shadow: 
    0 0 8px var(--text-lime),
    0 0 16px var(--text-lime),
    0 0 24px rgba(57, 255, 20, 0.6); }

.card .media .icon {
  font-size: 42px;
  z-index: 1;
  text-shadow: 0 0 10px currentColor;
}

.card .media .label {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  background: rgba(0,0,0,0.75);
  color: var(--text-yellow);
  font-size: 10px;
  padding: 1px 6px;
  letter-spacing: 1px;
  border: 1px solid #664400;
}

.card .info {
  padding: 10px 10px 8px;
}

.card .title {
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 3px;
}

.card .year {
  font-size: 11px;
  color: var(--text-orange);
}

.card .blurb {
  font-size: 11px;
  color: #99aabb;
  margin-top: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Category tags */
.tag {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 9px;
  padding: 1px 7px;
  background: #000000bb;
  color: var(--text-lime);
  border: 1px solid var(--text-lime);
  letter-spacing: 0.5px;
}

/* Detail Modal - Old School Window */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
}

.modal.open {
  display: flex;
}

.modal-window {
  width: 100%;
  max-width: 620px;
  background: var(--bg-panel);
  border: 4px solid var(--border-light);
  box-shadow: 
    0 0 0 6px #0a0a14,
    8px 8px 0 #00000066;
  color: var(--text);
}

.modal-titlebar {
  background: linear-gradient(#2a2a44, #1a1a2e);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--border);
  font-weight: bold;
  color: var(--text-cyan);
  font-size: 13px;
}

.modal-titlebar .close {
  background: #330000;
  color: #ffaaaa;
  border: 1px solid #662222;
  width: 22px;
  height: 20px;
  line-height: 17px;
  text-align: center;
  cursor: pointer;
  font-weight: 900;
  font-size: 15px;
}

.modal-body {
  padding: 18px 20px 22px;
}

.modal-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.meta-item {
  background: #000;
  padding: 2px 10px;
  border: 1px solid var(--border);
  font-size: 12px;
}

.modal-body h2 {
  font-size: 24px;
  color: #fff;
  margin-bottom: 2px;
  text-shadow: 
    0 0 12px var(--text-cyan),
    0 0 22px var(--text-magenta),
    0 0 34px var(--text-purple),
    0 0 48px rgba(192, 38, 211, 0.5);
}

.modal-body .year-big {
  color: var(--text-orange);
  font-size: 15px;
}

.modal-desc {
  margin: 14px 0;
  font-size: 14.5px;
  line-height: 1.55;
}

.video-player {
  background: #000;
  border: 6px solid #222233;
  border-radius: 2px;
  margin: 16px 0;
  height: 210px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #222;
  box-shadow: 
    inset 0 0 16px rgba(0,0,0,0.55),
    0 0 4px rgba(255,255,255,0.04);
}

/* Cleaner player frame when real video is playing - no heavy overlays */
.video-player.playing,
.video-player.embedded {
  background: #000;
  border-color: #1a1a22;
  box-shadow: 
    inset 0 0 8px rgba(0,0,0,0.4);
}

.video-player .scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 4px,
    rgba(255,255,255,0.012) 4px,
    rgba(255,255,255,0.012) 5px
  );
  pointer-events: none;
  z-index: 3;
  mix-blend-mode: screen;
}

/* Extremely subtle tracking - only visible in non-playing / fake states */
.video-player .vhs-tracking {
  position: absolute;
  top: 28%;
  left: -100%;
  width: 100%;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255,255,255,0.07),
    transparent
  );
  z-index: 4;
  pointer-events: none;
}

/* Optional very light hover tracking - only when not playing real video */
.video-player:not(.embedded):hover .vhs-tracking {
  animation: vhs-track 3.2s linear infinite;
}

@keyframes vhs-track {
  0% { left: -100%; }
  30% { left: 0%; }
  70% { left: 100%; }
  100% { left: 100%; }
}

/* When real content is embedded, hide ALL scan/distortion overlays completely for crisp HD video */
.video-player.embedded .scan,
.video-player.embedded .vhs-tracking {
  display: none !important;
  opacity: 0;
}

.video-player.embedded iframe {
  border: 0;
  box-shadow: none;
  filter: contrast(1.06) saturate(1.02) brightness(1.01);
  width: 100%;
  height: 100%;
}

.video-player .content {
  text-align: center;
  z-index: 2;
  color: var(--text-lime);
  font-size: 13px;
  text-shadow: 0 0 8px var(--text-lime);
}

.video-player .play-icon {
  font-size: 52px;
  margin-bottom: 4px;
  opacity: 0.9;
}

.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  background: #1f1f2e;
  color: var(--text-cyan);
  border: 2px solid var(--text-cyan);
  padding: 8px 18px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all .1s;
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.25);
}

.btn:hover {
  background: var(--text-cyan);
  color: #000;
  box-shadow: 
    0 0 16px var(--text-cyan),
    0 0 30px var(--text-magenta),
    0 0 48px var(--text-purple);
}

.btn-magenta {
  border-color: var(--text-magenta);
  color: var(--text-magenta);
}

.btn-magenta:hover {
  background: var(--text-magenta);
  color: #000;
}

/* Fake Radio Section */
.radio-panel {
  background: #0f0f1c;
  border: 3px solid var(--border);
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 16px;
}

@media (max-width: 700px) {
  .radio-panel { grid-template-columns: 1fr; }
}

.station-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.station {
  padding: 6px 10px;
  background: #000;
  border: 2px solid var(--border);
  color: var(--text-yellow);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
}

.station.active {
  border-color: var(--text-lime);
  color: var(--text-lime);
  background: #0a150a;
}

.radio-display {
  background: #050505;
  border: 3px solid #222233;
  padding: 14px;
  font-family: monospace;
  min-height: 128px;
}

.radio-display iframe {
  border: 2px solid #111;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
}

.radio-display .now {
  color: var(--text-magenta);
  font-size: 12px;
  letter-spacing: 2px;
}

.radio-display .track {
  color: var(--text-lime);
  font-size: 17px;
  margin: 6px 0 4px;
}

.radio-visual {
  height: 46px;
  margin-top: 10px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
}

.bar {
  width: 7px;
  background: var(--text-cyan);
  transition: height .08s;
  box-shadow: 0 0 4px var(--text-cyan);
}

/* Guestbook */
.guestbook {
  background: #0f0f1c;
  border: 2px solid var(--border);
  padding: 14px;
}

.guestbook form {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.guestbook input[type="text"] {
  flex: 1;
  background: #000;
  border: 2px solid var(--border);
  color: var(--text-lime);
  padding: 8px;
  font-family: inherit;
}

.guestbook .entries {
  max-height: 150px;
  overflow-y: auto;
  font-size: 13px;
  border-top: 1px dashed var(--border);
  padding-top: 8px;
}

.entry {
  padding: 3px 0;
  border-bottom: 1px dotted #333;
}

.entry .name {
  color: var(--text-yellow);
  font-weight: bold;
}

.entry .msg {
  color: #aabbcc;
}

/* Footer */
footer {
  background: #08080f;
  text-align: center;
  padding: 14px;
  font-size: 11px;
  color: #556677;
  border-top: 1px solid #222233;
}

footer a {
  color: var(--text-cyan);
  text-decoration: none;
}

/* Utility */
.hidden { display: none !important; }

.pixel-border {
  image-rendering: pixelated;
}

/* Responsive polish */
@media (max-width: 720px) {
  .crt-monitor { margin: 8px; border-width: 8px; }
  .logo { font-size: 38px; }
  .vault-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 14px; }
}