/* ==========================================
   CRT SWITCH — DEXN 2026 DESIGN SYSTEM
   ========================================== */

:root {
  /* Color Palette Tokens */
  --wood-dark: #1b1007;
  --wood-mid: #3e281a;
  --wood-main: #593b24;
  --wood-light: #7e5535;

  --brass-dark: #7a5525;
  --brass-main: #b8863b;
  --brass-light: #e2bd7c;
  --brass-glow: rgba(226, 189, 124, 0.4);

  --bezel-dark: #090a09;
  --bezel-main: #161816;
  --bezel-light: #252825;

  --screen-black: #040604;
  --phosphor: #33ff33;
  --phosphor-glow: rgba(51, 255, 51, 0.25);
  
  --led-red: #e5484d;
  --led-red-glow: rgba(229, 72, 77, 0.7);
  --led-green: #66ffa3;
  --led-green-glow: rgba(102, 255, 163, 0.85);

  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-retro: 'VT323', monospace;
}

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

html, body {
  min-height: 100vh;
  width: 100%;
}

body {
  background: 
    radial-gradient(ellipse at 50% 30%, rgba(51, 255, 51, 0.04), transparent 60%),
    radial-gradient(circle at 50% 100%, #15100a, #030302 75%);
  color: var(--phosphor);
  font-family: var(--font-retro);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 16px;
  overflow-x: hidden;
  position: relative;
}

/* Ambient Glow Backdrop */
.ambient-glow {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 450px;
  background: radial-gradient(ellipse at center, rgba(102, 255, 163, 0.08), transparent 70%);
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.5s ease;
}

.ambient-glow.on {
  background: radial-gradient(ellipse at center, rgba(51, 255, 51, 0.15), transparent 70%);
}

.app-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 720px;
  width: 100%;
}

/* Header Styles */
.header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.eyebrow {
  color: var(--brass-light);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  opacity: 0.85;
}

.title {
  font-family: var(--font-display);
  font-size: clamp(22px, 4.8vw, 32px);
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 0%, var(--brass-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.instructions {
  color: rgba(226, 189, 124, 0.8);
  font-family: var(--font-retro);
  font-size: 16px;
  max-width: 500px;
  line-height: 1.5;
  letter-spacing: 1px;
}

.key-hint {
  display: inline-block;
  background: rgba(184, 134, 59, 0.18);
  border: 1px solid rgba(226, 189, 124, 0.4);
  color: var(--brass-light);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}

/* ==========================================
   TV CABINET
   ========================================== */

.tv {
  width: min(94vw, 640px);
  background:
    repeating-linear-gradient(98deg, rgba(0, 0, 0, 0.18) 0 2px, transparent 2px 6px),
    linear-gradient(165deg, var(--wood-light), var(--wood-main) 50%, var(--wood-dark));
  border-radius: 28px;
  padding: clamp(14px, 3vw, 26px);
  box-shadow:
    0 35px 70px -15px rgba(0, 0, 0, 0.9),
    0 2px 0 rgba(255, 255, 255, 0.08) inset,
    0 -8px 20px rgba(0, 0, 0, 0.6) inset;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.tv::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -16px;
  transform: translateX(-50%);
  width: 72%;
  height: 16px;
  background: linear-gradient(var(--wood-dark), #100a04);
  border-radius: 0 0 12px 12px;
  filter: blur(0.5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6);
}

.tv-body {
  display: flex;
  gap: clamp(10px, 2.4vw, 20px);
  align-items: stretch;
}

/* ==========================================
   SCREEN AREA
   ========================================== */

.screen-bezel {
  flex: 1 1 auto;
  background: linear-gradient(155deg, var(--bezel-light), var(--bezel-dark) 65%);
  border-radius: 18px;
  padding: clamp(10px, 2vw, 16px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 12px 28px rgba(0, 0, 0, 0.7) inset;
}

.screen {
  position: relative;
  aspect-ratio: 4 / 3;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: var(--screen-black);
  box-shadow: 0 0 28px rgba(51, 255, 51, 0.12);
}

/* Screen Off Image */
.screen-off {
  position: absolute;
  inset: 0;
  z-index: 1;
  transition: opacity 0.35s ease;
}

.screen-off img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.screen-off.is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* Screen Content Layer */
.screen-content {
  position: absolute;
  inset: 0;
  transform-origin: center;
  animation-fill-mode: forwards;
  animation-duration: 0.48s;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  filter: contrast(1.05) saturate(1.05);
}

.screen-content.shutdown {
  animation-name: crtShutdown;
  animation-duration: 0.48s;
}

.screen-content.poweron {
  animation-name: crtPowerOn;
  animation-duration: 0.62s;
}

@keyframes crtShutdown {
  0%   { transform: scale3d(1, 1, 1);       filter: brightness(1) saturate(1);    opacity: 1; }
  45%  { transform: scale3d(1, 0.02, 1);    filter: brightness(2.8) saturate(1.5); opacity: 1; }
  75%  { transform: scale3d(0.32, 0.02, 1);  filter: brightness(4) saturate(0.5);   opacity: 1; }
  100% { transform: scale3d(0, 0.02, 1);     filter: brightness(6);                opacity: 0; }
}

@keyframes crtPowerOn {
  0%   { transform: scale3d(0, 0.02, 1);    filter: brightness(6);                opacity: 0; }
  14%  { transform: scale3d(0.4, 0.02, 1);   filter: brightness(4);                opacity: 1; }
  38%  { transform: scale3d(1, 0.02, 1);    filter: brightness(3);                opacity: 1; }
  70%  { transform: scale3d(1, 1, 1);       filter: brightness(1.6) contrast(1.2);opacity: 1; }
  100% { transform: scale3d(1, 1, 1);       filter: brightness(1) contrast(1.05); opacity: 1; }
}

.slot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.slot img, .slot video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Original Dazo Message Image */
.dazo-msg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: contrast(1.1) brightness(1.05);
}

/* Testcard Standby Screen */
.testcard {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.testcard .bars {
  flex: 1;
  display: flex;
}

.testcard .bars span { flex: 1; }
.testcard .bars span:nth-child(1) { background: #c0c0c0; }
.testcard .bars span:nth-child(2) { background: #c0c000; }
.testcard .bars span:nth-child(3) { background: #00c0c0; }
.testcard .bars span:nth-child(4) { background: #00c000; }
.testcard .bars span:nth-child(5) { background: #c000c0; }
.testcard .bars span:nth-child(6) { background: #c00000; }
.testcard .bars span:nth-child(7) { background: #0000c0; }

.testcard .foot {
  height: 22%;
  background: #0d0d0d;
  color: var(--phosphor);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-retro);
  font-size: 16px;
  letter-spacing: 2px;
  opacity: 0.85;
}

/* ==========================================
   CRT OVERLAYS & SWITCHABLE EFFECTS
   ========================================== */

.crt-overlays {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.25s ease;
}

.crt-overlays.effects-off {
  opacity: 0 !important;
}

/* Tuned overlays for crisp readability */
.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.18) 0px,
    rgba(0, 0, 0, 0.18) 1px,
    transparent 2px,
    transparent 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.85;
}

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 62%, rgba(0, 0, 0, 0.55) 100%);
}

.glass-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.06) 0%, transparent 28%);
}

.static-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  mix-blend-mode: screen;
}

.static-layer.flash {
  animation: staticFlash 0.26s steps(6) forwards;
}

@keyframes staticFlash {
  0%   { opacity: 0;    background-position: 0 0; }
  10%  { opacity: 0.85; background-position: 20% 10%; }
  30%  { opacity: 0.45; background-position: 60% 40%; }
  50%  { opacity: 0.8;  background-position: 10% 70%; }
  70%  { opacity: 0.25; background-position: 80% 20%; }
  100% { opacity: 0;    background-position: 0 0; }
}

/* ==========================================
   CONTROL PANEL
   ========================================== */

.panel {
  flex: 0 0 auto;
  width: clamp(70px, 16vw, 100px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(12px, 2vw, 18px);
  padding-top: 4px;
}

/* Tuning Knobs */
.knob-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.knob {
  width: clamp(30px, 5.5vw, 40px);
  height: clamp(30px, 5.5vw, 40px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--brass-light), var(--brass-main) 55%, var(--brass-dark) 100%);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(0, 0, 0, 0.3) inset;
  border: none;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease;
}

.knob::after {
  content: "";
  position: absolute;
  top: 14%; left: 50%;
  width: 2px; height: 32%;
  background: #3a260f;
  transform: translateX(-50%);
  border-radius: 2px;
}

.knob:hover { transform: rotate(15deg); }
.knob.k2 { transform: rotate(35deg); }
.knob.k2:hover { transform: rotate(55deg); }

/* Audio Button */
.audio-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.audio-btn {
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid var(--brass-main);
  color: var(--brass-light);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.audio-btn:hover {
  background: var(--brass-main);
  color: #111;
  box-shadow: 0 0 8px var(--brass-glow);
}

.audio-btn[aria-pressed="false"] {
  opacity: 0.4;
  border-color: #555;
}

.audio-label {
  font-size: 8px;
  letter-spacing: 0.15em;
  color: var(--brass-light);
  opacity: 0.75;
  font-family: var(--font-display);
  font-weight: 700;
}

/* Toggle Switches */
.switch-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.switch-label {
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--brass-light);
  opacity: 0.85;
  text-align: center;
  line-height: 1.3;
  font-family: var(--font-display);
  font-weight: 700;
}

.toggle-switch {
  width: clamp(42px, 8.5vw, 54px);
  height: clamp(20px, 4vw, 26px);
  border-radius: 999px;
  border: 2px solid var(--brass-main);
  background: linear-gradient(180deg, #1a1a1a, #0c0c0c);
  position: relative;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5) inset;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.toggle-switch[aria-checked="true"] {
  border-color: var(--led-green);
  box-shadow: 0 0 10px rgba(102, 255, 163, 0.5), 0 2px 6px rgba(0, 0, 0, 0.5) inset;
}

.toggle-switch:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.toggle-knob {
  position: absolute;
  top: 2px; left: 2px;
  height: calc(100% - 4px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--brass-light), var(--brass-main) 55%, var(--brass-dark) 100%);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-switch[aria-checked="true"] .toggle-knob {
  transform: translateX(calc( clamp(42px, 8.5vw, 54px) - clamp(20px, 4vw, 26px) ));
}

/* Power Button & LED */
.power-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}

.led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--led-red);
  box-shadow: 0 0 6px 2px var(--led-red-glow);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.led.led-on {
  background: var(--led-green);
  box-shadow: 0 0 8px 3px var(--led-green-glow);
}

.power-btn {
  width: clamp(36px, 6.5vw, 46px);
  height: clamp(36px, 6.5vw, 46px);
  border-radius: 50%;
  border: 3px solid var(--brass-main);
  background: radial-gradient(circle at 35% 30%, #ff6b6f, var(--led-red) 60%, #8f2023 100%);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  transition: transform 0.08s ease, box-shadow 0.2s ease;
}

.power-btn:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), 0 0 12px var(--led-red-glow);
}

.power-btn:active {
  transform: translateY(2px) scale(0.96);
}

.power-label {
  font-size: 9px;
  letter-spacing: 0.25em;
  color: var(--brass-light);
  opacity: 0.75;
  font-family: var(--font-display);
  font-weight: 700;
}

/* ==========================================
   FOOTER & GUIDES
   ========================================== */

.controls-guide {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 640px;
  font-size: 14px;
  color: var(--brass-light);
  opacity: 0.8;
}

.shortcuts {
  display: flex;
  gap: 12px;
}

.shortcut-item kbd {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: var(--font-retro);
  font-size: 13px;
  color: var(--phosphor);
}

.domain-badge {
  font-family: var(--font-retro);
  font-size: 15px;
  letter-spacing: 1px;
  background: rgba(184, 134, 59, 0.12);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(184, 134, 59, 0.3);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .tv-body {
    flex-direction: column;
  }
  .panel {
    flex-direction: row;
    width: 100%;
    justify-content: space-around;
    padding-top: 10px;
  }
  .power-wrap {
    margin-top: 0;
  }
  .knob-group {
    flex-direction: row;
  }
  .controls-guide {
    flex-direction: column;
    gap: 8px;
  }
}

/* ==========================================
   LIGHTBOX MODAL FOR FULL IMAGE VIEW
   ========================================== */

.screen-content .slot img {
  cursor: zoom-in;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.screen-content .slot img:hover {
  filter: contrast(1.15) brightness(1.08);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  position: relative;
  max-width: 95vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 92vw;
  max-height: 84vh;
  object-fit: contain;
  border-radius: 12px;
  border: 2px solid var(--brass-main);
  box-shadow: 
    0 0 40px rgba(51, 255, 51, 0.25),
    0 15px 50px rgba(0, 0, 0, 0.8);
  cursor: zoom-out;
}

.lightbox-close {
  position: absolute;
  top: -45px;
  right: 0;
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid var(--brass-main);
  color: var(--brass-light);
  font-size: 28px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s ease;
}

.lightbox-close:hover {
  background: var(--brass-main);
  color: #000;
  box-shadow: 0 0 10px var(--brass-glow);
}

.lightbox-caption {
  margin-top: 12px;
  font-family: var(--font-retro);
  font-size: 16px;
  color: var(--phosphor);
  letter-spacing: 2px;
  opacity: 0.85;
  text-align: center;
}

/* ==========================================
   ART NAVIGATION & OSD STYLES
   ========================================== */

.art-osd {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 5;
  font-family: var(--font-retro);
  font-size: 15px;
  letter-spacing: 2px;
  color: var(--phosphor);
  background: rgba(4, 6, 4, 0.75);
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid rgba(51, 255, 51, 0.4);
  text-shadow: 0 0 6px var(--phosphor-glow);
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  user-select: none;
}

.art-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 15;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(18, 18, 18, 0.75);
  border: 1.5px solid var(--brass-main);
  color: var(--brass-light);
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 0 10px rgba(184, 134, 59, 0.2);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.art-nav-btn:hover {
  background: var(--brass-main);
  color: #0b0b0b;
  border-color: var(--brass-light);
  box-shadow: 0 0 16px var(--brass-glow), 0 4px 14px rgba(0, 0, 0, 0.8);
  transform: translateY(-50%) scale(1.1);
}

.art-nav-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.art-nav-btn.prev-btn {
  left: 10px;
}

.art-nav-btn.next-btn {
  right: 10px;
}

.art-nav-btn[hidden] {
  display: none !important;
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1005;
  background: rgba(20, 20, 20, 0.8);
  border: 1.5px solid var(--brass-main);
  color: var(--brass-light);
  font-size: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
  user-select: none;
}

.lightbox-nav-btn:hover {
  background: var(--brass-main);
  color: #000;
  box-shadow: 0 0 14px var(--brass-glow);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-nav-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.lightbox-prev {
  left: -60px;
}

.lightbox-next {
  right: -60px;
}

@media (max-width: 600px) {
  .lightbox-prev {
    left: 8px;
  }
  .lightbox-next {
    right: 8px;
  }
}


