:root {
  color-scheme: dark;
  --bg: #051a7a;
  --bg-deep: #031052;
  --panel: #071d8f;
  --panel-strong: #0927ba;
  --ink: #d8f8ff;
  --muted: #83dff4;
  --line: #34d4ff;
  --accent: #ffcf24;
  --accent-hot: #ff7a1a;
  --accent-ink: #06145f;
  --warn: #ffd35a;
  --shadow: 8px 8px 0 rgba(0, 9, 70, 0.9);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    repeating-linear-gradient(0deg, rgba(92, 220, 255, 0.07) 0 2px, transparent 2px 8px),
    repeating-linear-gradient(90deg, rgba(255, 207, 36, 0.08) 0 2px, transparent 2px 96px),
    linear-gradient(135deg, #061eb0 0%, var(--bg) 42%, var(--bg-deep) 100%);
  color: var(--ink);
  font-family: "Courier New", ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 72px;
  padding: 0 28px;
  background: #06145f;
  border-bottom: 4px solid #00093d;
  box-shadow: 0 4px 0 var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border: 3px solid var(--line);
  border-radius: 0;
  image-rendering: pixelated;
  box-shadow: 4px 4px 0 #00093d;
}

.brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.header-link,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 3px solid #00093d;
  border-radius: 0;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 #00093d;
}

.button.primary {
  border-color: #00093d;
  background: var(--accent-hot);
  color: #1b0700;
}

#shareButton {
  min-width: 118px;
}

.header-link:hover,
.button:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #00093d;
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  min-height: calc(100vh - 72px);
}

.sidebar {
  border-right: 4px solid #00093d;
  background:
    repeating-linear-gradient(135deg, rgba(52, 212, 255, 0.12) 0 3px, transparent 3px 18px),
    #082099;
}

.cover-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin: 18px;
  padding: 12px;
  border: 4px solid #00093d;
  background: #0625bf;
  box-shadow: var(--shadow);
}

.cover-card img {
  width: 96px;
  height: 96px;
  border: 3px solid var(--accent);
  object-fit: cover;
  image-rendering: pixelated;
}

.cover-card p {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.cover-card strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.05;
  text-transform: uppercase;
}

.about-us {
  margin: 0 18px 18px;
  padding: 14px;
  border: 4px solid #00093d;
  background: #06145f;
  box-shadow: var(--shadow);
}

.about-us h2 {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 15px;
  line-height: 1.2;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 #00093d;
}

.host-links {
  display: grid;
  gap: 10px;
}

.host-links a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border: 3px solid #00093d;
  background: #d8f8ff;
  color: #06145f;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 #00093d;
}

.host-links a:hover {
  background: var(--accent);
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #00093d;
}

.feedback-panel {
  margin-top: 16px;
}

.feedback-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 12px;
  border: 3px solid #00093d;
  background: var(--accent-hot);
  color: #1b0700;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  list-style: none;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 #00093d;
}

.feedback-panel summary::-webkit-details-marker {
  display: none;
}

.feedback-panel summary::after {
  content: "+";
  font-size: 18px;
  line-height: 1;
}

.feedback-panel[open] summary::after {
  content: "-";
}

.feedback-panel summary:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #00093d;
}

.feedback-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.feedback-form label {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.feedback-form input,
.feedback-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 3px solid #00093d;
  border-radius: 0;
  background: #d8f8ff;
  color: #06145f;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 4px 4px 0 #00093d;
}

.feedback-form textarea {
  min-height: 104px;
  resize: vertical;
}

.feedback-form input:focus,
.feedback-form textarea:focus {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.feedback-form button {
  min-height: 42px;
  padding: 0 12px;
  border: 3px solid #00093d;
  border-radius: 0;
  background: var(--accent-hot);
  color: #1b0700;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 #00093d;
}

.feedback-form button:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #00093d;
}

.search-row {
  position: sticky;
  top: 72px;
  z-index: 2;
  display: grid;
  gap: 10px;
  padding: 20px;
  background: #06145f;
  border-top: 4px solid #00093d;
  border-bottom: 4px solid #00093d;
}

.search-row label {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
}

.search-row input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 3px solid #00093d;
  border-radius: 0;
  background: #d8f8ff;
  font: inherit;
  color: #06145f;
  font-weight: 800;
  box-shadow: 4px 4px 0 #00093d;
}

.meta-line {
  padding: 12px 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  border-bottom: 4px solid #00093d;
  background: #0927ba;
}

.episode-list {
  display: grid;
}

.episode-button {
  display: grid;
  grid-template-columns: 54px 44px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  min-height: 84px;
  padding: 14px 20px;
  border: 0;
  border-bottom: 3px solid #00093d;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.episode-cover {
  width: 54px;
  height: 54px;
  align-self: start;
  border: 3px solid #00093d;
  background: #06145f;
  object-fit: cover;
  image-rendering: pixelated;
  box-shadow: 3px 3px 0 #00093d;
}

.episode-button:hover,
.episode-button.active {
  background: #0d37e6;
}

.episode-button.active {
  box-shadow: inset 6px 0 0 var(--accent);
}

.episode-number {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.episode-title {
  display: block;
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  text-transform: uppercase;
}

.episode-status {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.episode-button.missing .episode-status {
  color: var(--warn);
}

.reader {
  min-width: 0;
  padding: 32px;
  background:
    repeating-linear-gradient(45deg, rgba(255, 207, 36, 0.1) 0 3px, transparent 3px 34px),
    transparent;
}

.reader-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  grid-template-areas:
    "heading cover"
    "actions actions";
  align-items: start;
  gap: 24px;
  margin: 0 auto 24px;
  max-width: 980px;
  width: 100%;
}

.episode-heading {
  grid-area: heading;
  min-width: 0;
  padding-left: 8px;
}

.selected-cover {
  grid-area: cover;
  width: 92px;
  aspect-ratio: 1;
  justify-self: end;
  border: 4px solid #00093d;
  background: #06145f;
  object-fit: cover;
  image-rendering: pixelated;
  box-shadow: 5px 5px 0 rgba(0, 9, 70, 0.9);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 #00093d;
}

h1 {
  margin: 0;
  max-width: 100%;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: 0;
  color: var(--ink);
  text-transform: uppercase;
  text-shadow: 4px 4px 0 #00093d;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  grid-area: actions;
  justify-content: flex-start;
  gap: 10px;
  padding-left: 8px;
}

.language-switch {
  display: inline-flex;
  min-height: 40px;
  border: 3px solid #00093d;
  box-shadow: 4px 4px 0 #00093d;
}

.language-switch button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-right: 3px solid #00093d;
  background: #d8f8ff;
  color: #06145f;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.language-switch button:last-child {
  border-right: 0;
}

.language-switch button.active {
  background: var(--accent);
}

.language-switch button:hover {
  background: var(--accent-hot);
  color: #1b0700;
}

.podcast-player {
  max-width: 980px;
  min-height: 166px;
  margin: 0 auto 24px;
  padding: 10px;
  border: 4px solid #00093d;
  background:
    repeating-linear-gradient(135deg, rgba(255, 207, 36, 0.16) 0 3px, transparent 3px 18px),
    #06145f;
  box-shadow: var(--shadow);
}

.podcast-player[hidden] {
  display: none;
}

.podcast-player iframe {
  display: block;
  width: 100% !important;
  min-height: 142px;
  border: 0;
  background: #d8f8ff;
}

.transcript {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px;
  border: 4px solid #00093d;
  border-radius: 0;
  background: #d8f8ff;
  color: #06145f;
  box-shadow: var(--shadow);
}

.transcript h1,
.transcript h2 {
  margin: 28px 0 14px;
  color: #06145f;
  font-size: 24px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  text-shadow: none;
  text-transform: none;
}

.transcript h1 {
  padding-bottom: 10px;
  border-bottom: 4px solid #06145f;
}

.transcript h2 {
  display: inline-block;
  padding: 4px 8px;
  background: #06145f;
  color: #d8f8ff;
  line-height: 1.25;
}

.transcript p {
  margin: 0 0 14px;
  color: #06145f;
  font-size: 16px;
  line-height: 1.65;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.transcript a {
  color: #c24200;
  font-weight: 800;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.transcript a:hover {
  background: var(--accent);
  color: #06145f;
}

.transcript .timestamp {
  color: #c24200;
  font-weight: 800;
  font-family: "Courier New", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.empty-state {
  color: #1641a8;
  font-weight: 700;
}

@media (max-width: 860px) {
  .topbar {
    height: auto;
    min-height: 72px;
    padding: 0 16px;
    flex-wrap: wrap;
    row-gap: 12px;
    padding-bottom: 12px;
    padding-top: 12px;
  }

  .topnav {
    width: 100%;
    justify-content: flex-start;
  }

  .layout {
    display: block;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .search-row {
    top: 72px;
  }

  .cover-card {
    grid-template-columns: 72px minmax(0, 1fr);
    margin: 14px;
  }

  .cover-card img {
    width: 72px;
    height: 72px;
  }

  .about-us {
    margin: 0 14px 14px;
  }

  .episode-list {
    max-height: 42vh;
    overflow: auto;
  }

  .reader {
    padding: 22px 16px;
  }

  .reader-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px;
    grid-template-areas:
      "heading cover"
      "actions actions";
    gap: 14px;
  }

  .actions {
    justify-content: flex-start;
  }

  .selected-cover {
    width: 72px;
  }

  h1 {
    font-size: 28px;
  }

  .transcript {
    padding: 20px;
  }
}
