/* ============================================================================
   MAX OUUUT (https://max.ouuut.com) · 滿格遊戲史 · 復古掌機硬體 OS 正式版樣式
   Locked Recipe: Terracotta #C44D3A × Matte Charcoal #141414 × Warm Cream #FFFDF5 × Diagonal Stripes
   ============================================================================ */

@font-face {
  font-family: 'DotGothic16';
  src: url('/assets/fonts/DotGothic16-400-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00FF, U+2010-2027, U+2190-21FF, U+2264-2265, U+25A0-25FF;
}
@font-face {
  font-family: 'MPLUSRounded1c';
  src: url('/assets/fonts/MPLUSRounded1c-900-latin.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00FF, U+2010-2027, U+2190-21FF, U+2264-2265, U+25A0-25FF;
}
@font-face {
  font-family: 'Noto Sans TC Punct';
  src: url('/assets/fonts/NotoSansPunct-700-normal.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+3001-3002, U+FF01, U+FF0C, U+FF1A, U+FF1B, U+FF1F;
}
@font-face {
  font-family: 'Noto Sans TC Punct';
  src: url('/assets/fonts/NotoSansPunct-900-normal.woff2') format('woff2');
  font-weight: 800 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+3001-3002, U+FF01, U+FF0C, U+FF1A, U+FF1B, U+FF1F;
}
@font-face {
  font-family: 'Noto Sans TC';
  src: url('/assets/fonts/NotoSansTC-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans TC';
  src: url('/assets/fonts/NotoSansTC-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans TC';
  src: url('/assets/fonts/NotoSansTC-700-normal.woff2') format('woff2');
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans TC';
  src: url('/assets/fonts/NotoSansTC-900-normal.woff2') format('woff2');
  font-weight: 800 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans SC';
  src: url('/assets/fonts/NotoSansSC-900-normal.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/JetBrainsMono-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/JetBrainsMono-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/JetBrainsMono-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root,
html[data-theme="light"] {
  --c1: #00B894;
  --c2: #F59E0B;
  --c3: #EF4444;
  --c4: #2563EB;
  --c5: #8B5CF6;
  --c6: #EC4899;
  --hd-h: 64px;
  --pad: clamp(16px, 3vw, 40px);
  --font-pixel: 'DotGothic16', 'JetBrains Mono', 'Noto Sans TC Punct', 'Noto Sans TC', monospace;
  --font-pop: 'MPLUSRounded1c', 'Noto Sans TC Punct', 'Noto Sans TC', 'Noto Sans SC', 'Microsoft JhengHei', sans-serif;
  --font-sans: 'Noto Sans TC Punct', 'Noto Sans TC', 'Noto Sans SC', 'Microsoft JhengHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'Noto Sans TC Punct', 'Noto Sans TC', monospace;

  --bg: #FFFDF5;
  --card: #FFFFFF;
  --surface-2: #FFF5D6;
  --hd-bg: #181818;
  --ink: #171717;
  --muted: #57554F;
  --bd: #171717;
  --bd-w: 4px;
  --c4-ink: #1D4ED8;
  --queue-hd-bg: #FAF2DB;
  --ep-active-bg: #FFF3F0;
  --console-pri: #C44D3A;
  --console-acc: #FBBF24;
  --console-ink: #FFFFFF;
  --rad-sm: 4px;
  --rad-md: 6px;
  --rad-lg: 8px;
  --sh-stage: 8px 8px 0 var(--console-pri);
  --sh-ctrl: 6px 6px 0 var(--bd);
  --sh-queue: 8px 8px 0 var(--bd);
  --sh-pipe: 8px 8px 0 var(--console-acc);
}

html[data-theme="dark"] {
  --bg: #141414;
  --card: #1D1D1D;
  --surface-2: #262626;
  --hd-bg: #111111;
  --ink: #F2F0EA;
  --muted: #9D9B95;
  --bd: #050505;
  --bd-w: 4px;
  --c4-ink: #E5E3DC;
  --queue-hd-bg: #222222;
  --ep-active-bg: #262120;
}

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

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--ink) 28%, transparent) transparent;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: clip;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  transition: background-color .22s ease, color .22s ease;
}

.ep-list, .td-body {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--ink) 28%, transparent) transparent;
}
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--ink) 26%, transparent);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--console-pri, var(--c3));
  border: 1.5px solid transparent;
  background-clip: padding-box;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 10px 16px;
  background: var(--c2);
  color: #171717;
  font-family: var(--font-pop);
  font-weight: 900;
  border: 3px solid var(--bd);
}
.skip-link:focus { left: 12px; top: 12px; }

/* Retro Diagonal Stripes Backdrop */
html[data-wire="all"] .screen-sec,
html[data-wire="all"] .ep-detail-sec {
  background-image: repeating-linear-gradient(
    -45deg,
    color-mix(in srgb, var(--ink) 6%, transparent) 0 2px,
    transparent 2px 14px
  );
}
html[data-wire="clean"] .screen-sec,
html[data-wire="clean"] .ep-detail-sec {
  background-image: none;
}

/* Inline SVG Brand Lockup + Animated Bounce */
.wm-lockup { display: block; height: 22px; width: auto; flex-shrink: 0; }
.wm-lockup.is-hero-wordmark { height: 30px; }
.wm-lockup.is-animated-lockup,
.wm-lockup.is-drop-wordmark { overflow: visible; }
.wm-lockup .g-pre, .wm-lockup .g-dot1, .wm-lockup .g-c, .wm-lockup .g-o, .wm-lockup .g-m { fill: var(--ink); stroke: var(--ink); }
.wm-lockup .g-mark { fill: var(--c1); stroke: var(--c1); }
.wm-lockup .g-u1 { fill: var(--c2); stroke: var(--c2); }
.wm-lockup .g-u2 { fill: var(--c3); stroke: var(--c3); }
.wm-lockup .g-u3 { fill: var(--c4); stroke: var(--c4); }
.wm-lockup .g-t4 { fill: var(--c5); stroke: var(--c5); }
.wm-lockup .g-dot { fill: var(--c6); stroke: var(--c6); }

@keyframes logoLetterHop {
  0%, 12%, 100% { transform: translateY(0); }
  5% { transform: translateY(-115px); }
  8% { transform: translateY(18px); }
}
.wm-lockup.is-animated-lockup path {
  animation: logoLetterHop 6.4s cubic-bezier(.34,1.56,.64,1) infinite;
  animation-delay: calc(var(--li, 0) * 75ms);
}
@keyframes ouuutDrop {
  0% { opacity: 0; transform: translateY(-480px); }
  64% { opacity: 1; transform: translateY(38px); }
  82% { opacity: 1; transform: translateY(-18px); }
  100% { opacity: 1; transform: translateY(0); }
}
.wm-lockup.is-drop-wordmark { cursor: pointer; }
.wm-lockup.is-drop-wordmark.is-dropping path {
  animation: ouuutDrop 0.92s cubic-bezier(.22,1,.36,1) both;
  animation-delay: calc(var(--li, 0) * 95ms);
}

/* Header & 5-Color Segmented Scroll Bar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  height: var(--hd-h);
  background: var(--hd-bg);
  border-bottom: var(--bd-w) solid var(--bd);
}
html[data-theme="light"] .site-header { color: #F5F2EA; }
html[data-theme="light"] .site-header .wm-lockup .g-pre,
html[data-theme="light"] .site-header .wm-lockup .g-dot1,
html[data-theme="light"] .site-header .wm-lockup .g-c,
html[data-theme="light"] .site-header .wm-lockup .g-o,
html[data-theme="light"] .site-header .wm-lockup .g-m { fill: #F5F2EA; stroke: #F5F2EA; }
html[data-theme="light"] .site-header .tab-link { color: #C2BFB6; }
html[data-theme="light"] .site-header .tab-link.is-active,
html[data-theme="light"] .site-header .tab-link:hover { color: #171717; }
html[data-theme="light"] .site-header .theme-toggle,
html[data-theme="light"] .site-header .wire-btn:not([aria-pressed="true"]) { color: #171717; }

.hd-inner {
  max-width: 1400px;
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; flex-shrink: 0; }
.brand-pill {
  background: var(--c2);
  color: #121826;
  border: 2.5px solid var(--bd);
  border-radius: 999px;
  padding: 2px 11px;
  font-family: var(--font-pop);
  font-size: 13px;
  font-weight: 900;
  box-shadow: 2px 2px 0 var(--bd);
  white-space: nowrap;
}
.tab-nav { display: inline-flex; align-items: center; gap: 10px; }
.tab-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 2.5px solid transparent;
  border-radius: var(--rad-sm);
  font-family: var(--font-pop);
  font-size: 14px;
  font-weight: 900;
  color: var(--muted);
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
  white-space: nowrap;
}
.tab-link .tab-num { font-family: var(--font-pixel); font-size: 13px; color: var(--c3); }
.tab-link:hover,
.tab-link.is-active {
  color: #121826;
  background: var(--c2);
  border-color: var(--bd);
  box-shadow: 3px 3px 0 var(--bd);
  transform: translate(-1px, -1px);
}
.hd-tools { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.wire-btn {
  height: 36px;
  padding: 0 12px;
  border: 2.5px solid var(--bd);
  border-radius: var(--rad-sm);
  background: var(--card);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 3px 3px 0 var(--bd);
  transition: transform .12s ease, box-shadow .12s ease;
}
html[data-wire="all"] .wire-btn { background: var(--c1); color: #FFFFFF; }
.wire-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--bd); }
.theme-toggle {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid var(--bd);
  border-radius: var(--rad-sm);
  background: var(--card);
  box-shadow: 3px 3px 0 var(--bd);
}
.theme-icon { width: 18px; height: 18px; }
html[data-theme="dark"] .icon-sun { display: none; }
html:not([data-theme="dark"]) .icon-moon { display: none; }
.scroll-progress-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 5px;
  background: linear-gradient(90deg, #00B894 0% 20%, #F59E0B 20% 40%, #EF4444 40% 60%, #2563EB 60% 80%, #8B5CF6 80% 100%);
  transform-origin: left center;
  transform: scaleX(0);
  pointer-events: none;
  z-index: 6;
}

/* 3-Screen Viewport Structure */
.screen-sec {
  position: relative;
  width: 100%;
  scroll-margin-top: var(--hd-h);
  scroll-snap-align: start;
  border-bottom: var(--bd-w) solid var(--bd);
}
.screen-sec:last-of-type { border-bottom: 0; }
.screen-wrap { max-width: 1400px; margin: 0 auto; padding: 18px var(--pad); }
@media (min-width: 1024px) and (min-height: 700px) {
  .screen-sec { height: calc(100svh - var(--hd-h)); min-height: 640px; display: flex; flex-direction: column; }
  .screen-wrap { flex: 1; width: 100%; min-height: 0; display: flex; flex-direction: column; }
}

/* Screen 1 Grid & Console Player */
.s1-wrap { gap: 10px; justify-content: space-between; }
.s1-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(400px, 1fr);
  gap: 22px;
}
.s1-grid > *, .s3-magazine > * { min-width: 0; max-width: 100%; }
.s1-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  min-width: 0;
  background: var(--console-pri, #C44D3A);
  padding: 10px 12px 12px;
  border: 4px solid var(--bd);
  border-radius: 10px;
  box-shadow: 9px 9px 0 var(--bd);
  transition: background-color .28s ease;
}
.console-bezel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px 6px;
  color: var(--console-ink, #FFFFFF);
  font-family: var(--font-pixel);
  font-size: 12.5px;
}
.console-led { display: inline-flex; align-items: center; gap: 7px; }
.console-led i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4ADE80;
  border: 2px solid var(--console-ink, #FFFFFF);
  display: block;
}
.stage-frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 220px;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 46vh;
  background: #0F172A;
  border: var(--bd-w) solid var(--bd);
  border-radius: var(--rad-lg);
  box-shadow: var(--sh-stage);
  overflow: hidden;
}
.stage-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stage-top-hud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}
.stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: #121826;
  color: #FFFFFF;
  border: 2.5px solid #FFFFFF;
  border-radius: 999px;
  font-family: var(--font-pixel);
  font-size: 13px;
  transition: opacity .25s ease;
}
.stage-pill .ep-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c1); }
.stage-pill.is-latest {
  background: var(--c3);
  color: #FFFFFF;
  border-color: #121826;
  font-family: var(--font-pop);
  font-weight: 900;
  box-shadow: 3px 3px 0 #121826;
  transform: rotate(3deg);
  animation: stickerPulse 2.4s ease-in-out infinite;
}
@keyframes stickerPulse {
  0%, 100% { transform: rotate(3deg) scale(1); }
  50% { transform: rotate(1deg) scale(1.06); }
}
.stage-sub-overlay {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.stage-sub-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 96%;
  padding: 6px 14px;
  background: var(--card);
  color: var(--ink);
  border: 3px solid var(--bd);
  border-radius: var(--rad-sm);
  box-shadow: 4px 4px 0 var(--bd);
}
.stage-sub-spk {
  background: var(--sub-c, var(--c1));
  color: #FFFFFF;
  padding: 2px 8px;
  border-radius: 6px;
  border: 2px solid var(--bd);
  font-family: var(--font-pop);
  font-size: 12.5px;
  font-weight: 900;
  flex-shrink: 0;
}
.stage-sub-txt { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.now-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--card);
  border: 3px solid var(--bd);
  border-radius: 6px;
  padding: 7px 12px;
}
.now-ep-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--font-pixel);
  font-size: 13.5px;
  color: var(--c4-ink);
}
.now-ep-detail-link {
  padding: 1px 8px;
  border: 1.5px solid var(--bd);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-pop);
  font-size: 11.5px;
  font-weight: 900;
}
.now-ep-detail-link:hover { background: var(--c2); color: #121826; }
.badge-latest {
  background: var(--c1);
  color: #FFFFFF;
  padding: 1px 8px;
  border-radius: 999px;
  border: 2px solid var(--bd);
  font-family: var(--font-pop);
  font-size: 11.5px;
  font-weight: 900;
}
.now-title {
  margin: 2px 0 0;
  font-family: var(--font-pop);
  font-size: clamp(18px, 1.8vw, 24px);
  font-weight: 900;
  line-height: 1.24;
}
.theory-inline-link {
  padding: 6px 12px;
  background: var(--c5);
  color: #FFFFFF;
  border: 2.5px solid var(--bd);
  border-radius: var(--rad-sm);
  font-family: var(--font-pop);
  font-size: 12.5px;
  font-weight: 900;
  box-shadow: 3px 3px 0 var(--bd);
  white-space: nowrap;
  transition: transform .12s ease, box-shadow .12s ease;
}
.theory-inline-link:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--bd); }

/* Transport & 96-bar Rainbow Equalizer */
.transport-wrap {
  background: var(--card);
  border: var(--bd-w) solid var(--bd);
  border-radius: var(--rad-md);
  padding: 10px 14px;
  box-shadow: var(--sh-ctrl);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wave-scrubber {
  height: 44px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  cursor: pointer;
  padding: 4px 4px 0;
  background: var(--surface-2);
  border: 2px solid var(--bd);
  border-radius: 6px;
}
.w-bar {
  flex: 1 1 0;
  min-width: 1px;
  border-radius: 2px 2px 0 0;
  background: var(--wb-c, var(--c1));
  opacity: 0.36;
  transition: opacity .1s ease, transform .15s ease;
  transform-origin: bottom center;
}
.w-bar.is-played { opacity: 1; }
@keyframes barIdleWave {
  0%, 100% { transform: scaleY(0.84); }
  50% { transform: scaleY(1.06); }
}
.wave-scrubber.is-idle .w-bar {
  opacity: 0.72;
  animation: barIdleWave 2.1s ease-in-out infinite;
  animation-delay: calc(var(--bi, 0) * 40ms);
}
.wave-chapter-ticks { position: relative; height: 6px; margin-top: -4px; }
.ch-tick { position: absolute; top: 0; width: 2px; height: 6px; background: var(--bd); opacity: 0.45; }
.controls-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ctrl-left, .ctrl-right { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.ctrl-btn {
  height: 36px;
  min-width: 38px;
  padding: 0 11px;
  background: var(--bg);
  color: var(--ink);
  border: 2.5px solid var(--bd);
  border-radius: var(--rad-sm);
  font-family: var(--font-pop);
  font-size: 13px;
  font-weight: 900;
  box-shadow: 3px 3px 0 var(--bd);
  transition: transform .1s ease, box-shadow .1s ease;
}
.ctrl-btn:hover { transform: translate(-1.5px, -1.5px); box-shadow: 4.5px 4.5px 0 var(--bd); }
.ctrl-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--bd); }
.ctrl-btn.is-play { background: var(--c3); color: #FFFFFF; min-width: 48px; font-size: 16px; }
.time-readout { font-family: var(--font-pixel); font-size: 15px; margin-left: 4px; }

/* Playlist Column (Calm Idle -> Active & Hover Highlight) */
.s1-queue {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--card);
  border: var(--bd-w) solid var(--bd);
  border-radius: var(--rad-lg);
  box-shadow: var(--sh-queue);
  overflow: hidden;
}
.playlist-head {
  padding: 11px 14px;
  border-bottom: var(--bd-w) solid var(--bd);
  background: var(--queue-hd-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.playlist-label { font-family: var(--font-pop); font-size: 14px; font-weight: 900; }
.filter-pills { display: flex; gap: 6px; }
.f-pill {
  padding: 3px 10px;
  border: 2px solid var(--bd);
  border-radius: 999px;
  background: var(--card);
  font-family: var(--font-pop);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 2px 2px 0 var(--bd);
}
.f-pill.is-active { background: var(--c2); color: #121826; }
.ep-list { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.ep-row {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  min-height: 84px;
  width: 100%;
  text-align: left;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 14px 24px;
  background: var(--bg);
  border: 2.5px solid color-mix(in srgb, var(--bd) 42%, transparent);
  border-radius: var(--rad-sm);
  box-shadow: 3px 3px 0 color-mix(in srgb, var(--bd) 20%, transparent);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease, opacity .14s ease;
}
.ep-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 9px;
  background: var(--surface-2);
  border-right: 2px solid color-mix(in srgb, var(--bd) 35%, transparent);
  transition: background .14s ease, border-color .14s ease;
}
.ep-row:hover,
.ep-row:focus-visible {
  transform: translate(-2px, -2px);
  background: color-mix(in srgb, var(--ep-c, var(--console-pri)) 10%, var(--card));
  border-color: var(--bd);
  box-shadow: 5px 5px 0 var(--ep-c, var(--console-pri));
  opacity: 1;
}
.ep-row.is-active {
  background: color-mix(in srgb, var(--ep-c, var(--console-pri)) 12%, var(--card));
  box-shadow: 5px 5px 0 var(--ep-c, var(--console-pri));
  border-color: var(--bd);
  opacity: 1;
}
.ep-row.is-active::before,
.ep-row:hover::before,
.ep-row:focus-visible::before {
  background: var(--ep-c, var(--console-pri));
  border-right-color: var(--bd);
  opacity: 1;
}
.ep-row.is-soon { opacity: 0.86; }
.ep-row.is-soon:hover,
.ep-row.is-soon:focus-visible,
.ep-row.is-soon.is-active { opacity: 1; }
.ep-row-num {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--muted);
  border: 2.5px solid color-mix(in srgb, var(--bd) 45%, transparent);
  border-radius: 8px;
  font-family: var(--font-pixel);
  font-size: 20px;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.ep-row.is-active .ep-row-num,
.ep-row:hover .ep-row-num,
.ep-row:focus-visible .ep-row-num {
  background: var(--ep-c, var(--console-pri));
  color: #FFFFFF;
  border-color: var(--bd);
}
.ep-row-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ep-row-title { font-family: var(--font-pop); font-size: 15.5px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-row-hook { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-row-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.ep-row-dur { font-family: var(--font-pixel); font-size: 13.5px; }
.latest-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--c1);
  color: #FFFFFF;
  border: 1.5px solid var(--bd);
  font-size: 10.5px;
  font-weight: 900;
}
.latest-dot { width: 6px; height: 6px; border-radius: 50%; background: #FEF08A; animation: dotPulse 1.6s infinite; }
@keyframes dotPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.45); } }
.soon-tag {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1.5px solid var(--bd);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
}

.scroll-cue { display: flex; justify-content: center; padding-top: 2px; }
.scroll-cue a {
  padding: 4px 14px;
  background: var(--card);
  border: 2px solid var(--bd);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: 2px 2px 0 var(--bd);
  animation: cueFloat 2.6s ease-in-out infinite;
}
@keyframes cueFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }

/* Screen 2 Draw.io Cartoon Pipeline */
.sec-kicker { font-family: var(--font-pixel); font-size: 13px; color: var(--c4-ink); letter-spacing: 0.06em; }
.sec-h2 { margin: 2px 0 0; font-family: var(--font-pop); font-size: clamp(22px, 2.3vw, 32px); font-weight: 900; line-height: 1.2; }
.s2-wrap { justify-content: center; gap: 12px; }
.s2-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.drawio-canvas-frame {
  background: var(--card);
  border: var(--bd-w) solid var(--bd);
  border-radius: var(--rad-lg);
  box-shadow: var(--sh-pipe);
  padding: 10px 14px;
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 16%, transparent) 1.5px, transparent 1.5px);
  background-size: 18px 18px;
}
.drawio-svg { width: 100%; height: auto; max-height: 410px; display: block; }
.dio-node { cursor: pointer; }
.dio-node .dio-box { fill: var(--card); stroke: var(--bd); stroke-width: 3; transition: fill .2s ease, transform .2s ease; }
.dio-node:hover .dio-box,
.dio-node.is-selected .dio-box {
  fill: color-mix(in srgb, var(--node-c) 18%, var(--card));
  stroke: var(--node-c);
  stroke-width: 4;
  filter: drop-shadow(5px 5px 0 var(--bd));
}
@keyframes wireFlow { from { stroke-dashoffset: 36; } to { stroke-dashoffset: 0; } }
.dio-flow-overlay {
  fill: none;
  stroke: var(--c1);
  stroke-width: 3;
  stroke-dasharray: 9 27;
  stroke-linecap: round;
  pointer-events: none;
  animation: wireFlow 2.2s linear infinite;
}
.dio-flow-overlay.is-retry { stroke: var(--c3); animation-duration: 3.1s; }
.dio-zone { fill: color-mix(in srgb, var(--bg) 68%, transparent); stroke: var(--bd); stroke-width: 2; stroke-dasharray: 6 5; }
.dio-zone-lbl { font-family: var(--font-pixel); font-size: 12px; fill: var(--ink); }
.dio-step { font-family: var(--font-pixel); font-size: 12px; fill: var(--node-c); }
.dio-title { font-family: var(--font-pop); font-size: 16px; font-weight: 900; fill: var(--ink); }
.dio-sub { font-family: var(--font-sans); font-size: 12px; fill: var(--muted); }
.dio-wire { fill: none; stroke: var(--bd); stroke-width: 2.5; }
.dio-wire-pass { fill: none; stroke: var(--c1); stroke-width: 3; }
.dio-wire-retry { fill: none; stroke: var(--c3); stroke-width: 2.5; stroke-dasharray: 6 5; }
.dio-lbl-bg { fill: var(--c2); stroke: var(--bd); stroke-width: 1.8; }
.dio-lbl { font-family: var(--font-pop); font-size: 11px; font-weight: 900; fill: #121826; }
.dio-lbl.is-pass { fill: var(--c1); font-weight: 900; }
.dio-lbl.is-retry { fill: var(--c3); font-weight: 900; }
.dio-port { fill: var(--c2); stroke: var(--bd); stroke-width: 2; }
.pipeline-readout {
  padding: 11px 16px;
  background: var(--card);
  border: var(--bd-w) solid var(--bd);
  border-left: 10px solid var(--c1);
  border-radius: var(--rad-sm);
  box-shadow: 4px 4px 0 var(--bd);
  font-size: 14px;
  font-weight: 700;
}
.pipeline-course-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.btn-arch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--btn-c, var(--c2));
  color: var(--btn-fg, #121826);
  border: 3px solid var(--bd);
  border-radius: var(--rad-sm);
  font-family: var(--font-pop);
  font-size: 13.5px;
  font-weight: 900;
  box-shadow: 4px 4px 0 var(--bd);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn-arch:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--bd); }

/* Screen 3 Magazine + 3x2 Cartoon Channel Cartridges */
.s3-wrap { justify-content: space-between; gap: 14px; }
.s3-magazine {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 30px;
  align-items: center;
}
.s3-left { display: flex; flex-direction: column; gap: 14px; }
.s3-h1 { margin: 2px 0 0; font-family: var(--font-pop); font-size: clamp(26px, 2.8vw, 38px); font-weight: 900; line-height: 1.16; }
.s3-lead { margin: 0; font-size: 14.5px; color: var(--muted); font-weight: 500; }
.s3-hosts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.host-card {
  padding: 12px 14px;
  background: var(--card);
  border: 3px solid var(--bd);
  border-radius: var(--rad-sm);
  box-shadow: 5px 5px 0 var(--hl-c);
}
.host-line-name { font-family: var(--font-pop); font-weight: 900; font-size: 16px; }
.host-line-role { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.contact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  background: var(--card);
  border: 2.5px solid var(--bd);
  border-radius: var(--rad-sm);
  box-shadow: 3px 3px 0 var(--bd);
  transition: transform .25s ease, box-shadow .25s ease;
}
.contact-item.is-glow { background: var(--c2); color: #121826; transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--c3); }
.contact-item.is-glow .contact-k,
.contact-item.is-glow .contact-v { color: #121826; }
.contact-k { font-family: var(--font-pixel); font-size: 11.5px; color: var(--muted); }
.contact-v { font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; }

.ch-grid-3x2 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ch-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 1 / 0.88;
  padding: 15px;
  background: var(--card);
  border: var(--bd-w) solid var(--bd);
  border-radius: var(--rad-md);
  box-shadow: 6px 6px 0 var(--ch-c);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s ease, background-color .25s ease;
}
.ch-tile:hover,
.ch-tile.is-glow {
  transform: translate(-3px, -5px) rotate(-1deg);
  box-shadow: 9px 10px 0 var(--ch-c);
  background: color-mix(in srgb, var(--ch-c) 12%, var(--card));
}
.ch-tile-top { display: flex; align-items: center; justify-content: space-between; }
.ch-icon { width: 22px; height: 22px; color: var(--ch-c); }
.ch-arrow { font-family: var(--font-pop); font-weight: 900; font-size: 14px; }
.ch-name { font-family: var(--font-pop); font-weight: 900; font-size: 16.5px; margin-top: 8px; }
.ch-handle { font-family: var(--font-mono); font-size: 11px; color: var(--ch-c); font-weight: 700; word-break: break-all; }
.ch-desc { font-size: 12px; color: var(--muted); margin-top: 3px; }
.s3-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 12px;
  border-top: var(--bd-w) solid var(--bd);
  flex-wrap: wrap;
}

/* Transcript Slide-Over Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(16, 22, 38, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.transcript-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(500px, 94vw);
  z-index: 120;
  background: var(--bg);
  border-left: 4px solid var(--bd);
  display: flex;
  flex-direction: column;
  transform: translateX(104%);
  transition: transform .25s cubic-bezier(.22,1,.36,1);
}
.transcript-drawer.open { transform: translateX(0); }
.td-head {
  padding: 14px 18px;
  border-bottom: 3px solid var(--bd);
  background: var(--c2);
  color: #121826;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.td-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.td-turn {
  width: 100%;
  text-align: left;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card);
  border: 2.5px solid var(--bd);
  border-radius: 8px;
  border-left: 7px solid var(--turn-c);
  box-shadow: 3px 3px 0 var(--bd);
}
.td-turn.is-active { background: color-mix(in srgb, var(--turn-c) 18%, var(--card)); }
.td-meta { font-family: var(--font-pixel); font-size: 12px; color: var(--muted); }
.td-txt { font-size: 14px; font-weight: 500; line-height: 1.5; }

/* Notification Toast */
.site-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 96;
  max-width: 420px;
  padding: 12px 16px;
  background: var(--card);
  color: var(--ink);
  border: 3px solid var(--bd);
  border-left: 8px solid var(--toast-c, var(--c3));
  border-radius: 10px;
  box-shadow: 5px 5px 0 var(--bd);
  font-family: var(--font-pop);
  font-size: 13.5px;
  font-weight: 900;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.site-toast.is-shown { opacity: 1; transform: translateY(0); }

/* Standalone Episode Detail Pages (/episodes/<slug>/) */
.ep-detail-sec { padding: 24px 0 56px; min-height: calc(100vh - var(--hd-h)); }
.ep-detail-wrap { max-width: 1220px; margin: 0 auto; padding: 0 var(--pad); display: flex; flex-direction: column; gap: 22px; }
.ep-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--card);
  border: 3px solid var(--bd);
  border-radius: var(--rad-sm);
  box-shadow: 4px 4px 0 var(--bd);
  font-family: var(--font-pixel);
  font-size: 13px;
}
.ep-breadcrumb a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ep-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.9fr);
  gap: 24px;
  align-items: start;
}
.ep-theory-box {
  padding: 18px;
  border: 4px solid var(--bd);
  border-left: 10px solid var(--c5);
  border-radius: var(--rad-md);
  background: var(--card);
  box-shadow: 6px 6px 0 var(--bd);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ep-summary-card {
  padding: 16px 18px;
  border: 3px solid var(--bd);
  border-radius: var(--rad-md);
  background: var(--card);
  box-shadow: 4px 4px 0 var(--bd);
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink);
}
.ep-ssr-transcript {
  background: var(--card);
  border: 4px solid var(--bd);
  border-radius: var(--rad-lg);
  box-shadow: 8px 8px 0 var(--bd);
  padding: 18px;
}
.ep-ssr-list { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.ep-nav-foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 12px;
}

/* Scroll Reveal (Screen 2/3 only) */
html.has-js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .45s ease, transform .45s ease;
  transition-delay: var(--rev-d, 0ms);
}
html.has-js [data-reveal].is-in { opacity: 1; transform: translateY(0); }

/* Responsive Mobile (390px) */
@media (max-width: 920px) {
  .hd-inner { padding: 0 10px; gap: 6px; }
  .wm-lockup { height: 15px; }
  .tab-nav, .brand-pill { display: none; }
  .hd-tools { gap: 5px; }
  .wire-btn { padding: 0 8px; font-size: 11px; height: 34px; }
  .theme-toggle { width: 38px; height: 38px; flex-shrink: 0; }
  .s1-grid, .s3-magazine, .ep-detail-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .s3-hosts-row, .contact-grid { grid-template-columns: 1fr; }
  .stage-frame { max-height: none; min-height: 180px; }
  .stage-sub-pill { max-width: 100%; padding: 5px 10px; }
  .stage-sub-txt { white-space: normal; font-size: 12.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .playlist-head { flex-wrap: wrap; }
  .wave-scrubber { gap: 2px; }
  .w-bar:nth-child(even) { display: none; }
  .ch-grid-3x2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ep-list { max-height: 360px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; opacity: 1 !important; transform: none !important; }
}
