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

html, body {
  min-height: 100vh;
  font-family: "Georgia", "Times New Roman", serif;
  color: #fff;
  background: #000;
}

body {
  padding: 24px 16px;
  overflow-x: hidden;
}

body.has-bg {
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ── Top Row: Patreon + Alerts ── */
.top-row {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  min-height: 120px;
}

.patreon-area {
  flex: 0 0 280px;
  display: flex;
  align-items: stretch;
}

.patreon-area a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 1px solid #fff;
  transition: opacity 0.15s;
  text-decoration: none;
  color: #fff;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  padding: 8px;
}

.patreon-area a:hover { opacity: 0.7; }
.patreon-area a:active { filter: invert(1); }

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

.alerts-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  min-width: 0;
  background: #000;
}

.discord-area {
  flex: 0 0 280px;
  display: flex;
  align-items: stretch;
  margin-left: auto;
}

.discord-area a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 1px solid #fff;
  transition: opacity 0.15s;
  text-decoration: none;
  color: #fff;
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: bold;
  text-align: center;
  padding: 8px;
}

.discord-area a:hover { opacity: 0.7; }
.discord-area a:active { filter: invert(1); }

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

.alert-item {
  border: 1px solid #fff;
  padding: 10px 14px;
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: bold;
  line-height: 1.4;
}

/* ── Embeds Row ── */
.embeds-row {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.main-embed {
  flex: 3;
  min-width: 0;
}

.main-embed .embed-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border: 1px solid #fff;
}

.secondary-embed {
  flex: 1;
  min-width: 0;
}

.secondary-embed .embed-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 177.78%;
  border: 1px solid #fff;
}

.embed-wrapper iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ── Podcast Player ── */
.podcast-section {
  background: #000;
  border: 1px solid #fff;
  margin-bottom: 20px;
}

.podcast-header {
  padding: 12px 16px;
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.podcast-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.podcast-header .refresh-btn,
.rss-link {
  background: none;
  border: 1px solid #fff;
  color: #fff;
  font-family: "Courier New", monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  padding: 4px 10px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: opacity 0.15s;
  text-decoration: none;
}

.podcast-header .refresh-btn:hover,
.rss-link:hover { opacity: 0.7; }
.podcast-header .refresh-btn:active,
.rss-link:active { filter: invert(1); }

.podcast-episodes {
  max-height: none;
}

.podcast-episode {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  display: flex;
  gap: 14px;
}

.podcast-episode:last-child { border-bottom: none; }

.podcast-episode.older {
  display: none;
}

.load-older-wrap {
  border-top: 1px solid #fff;
  padding: 10px 16px;
  text-align: center;
}

.load-older-btn {
  background: none;
  border: 1px solid #fff;
  color: #fff;
  font-family: "Courier New", monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 6px 16px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.load-older-btn:hover { opacity: 0.7; }
.load-older-btn:active { filter: invert(1); }

.episode-art {
  flex: 0 0 80px;
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.2);
  align-self: flex-start;
}

.episode-body {
  flex: 1;
  min-width: 0;
}

.podcast-episode-title {
  font-size: 1rem;
  margin-bottom: 4px;
}

.podcast-episode-meta {
  font-family: "Courier New", monospace;
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.episode-player-wrap {
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.episode-player-wrap audio {
  flex: 1;
  display: block;
  min-width: 0;
}

.episode-player-wrap audio::-webkit-media-controls-panel {
  background: #111;
}

.download-link {
  flex: 0 0 auto;
  border: 1px solid #fff;
  color: #fff;
  font-family: "Courier New", monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 6px 10px;
  text-decoration: none;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.download-link:hover { opacity: 0.7; }
.download-link:active { filter: invert(1); }

.podcast-empty {
  padding: 30px 16px;
  text-align: center;
  font-family: "Courier New", monospace;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #555;
}

/* ── Loading / Placeholder ── */
.placeholder-box {
  border: 1px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Courier New", monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #444;
  min-height: 80px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .top-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    min-height: 0;
  }
  .alerts-area {
    order: -1;
    grid-column: 1 / -1;
  }
  .patreon-area,
  .discord-area {
    flex: none;
    aspect-ratio: 1 / 1;
  }
  .discord-area a {
    min-height: 0;
  }
  .podcast-episode {
    flex-direction: column;
    gap: 10px;
  }
  .episode-art {
    flex: 0 0 auto;
    width: 60px;
    height: 60px;
  }
  .episode-player-wrap {
    flex-direction: column;
  }
  .download-link {
    width: 100%;
    text-align: center;
  }
}

/* ── Large screens: podcast container fills viewport height ── */
@media (min-width: 1024px) and (min-height: 800px) {
  body.site {
    display: flex;
    flex-direction: column;
  }
  body.site .container {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
  }
  body.site .podcast-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  body.site .podcast-episodes {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
  }
}

/* ── Status / Error messages ── */
.status-msg {
  margin-bottom: 12px;
  padding: 8px 12px;
  border: 1px solid #fff;
  font-family: "Courier New", monospace;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.status-msg.success { border-color: #0f0; color: #0f0; }
.status-msg.error { border-color: #f00; color: #f00; }
