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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Fullscreen map */
#map {
  width: 100vw;
  height: 100vh;
}

/* Hide Leaflet controls for minimal look */
.leaflet-control-zoom,
.leaflet-control-attribution {
  display: none !important;
}

/* Custom marker */
.marker {
  font-size: 20px;
  color: #000;
  text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff;
  cursor: pointer;
  line-height: 1;
}

.marker-watched {
  color: #666;
}

.marker-favorite {
  color: #d4a017;
}

.marker:hover {
  transform: scale(1.3);
}

/* Overlay backdrop */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

/* Dialog */
.dialog {
  background: #faf9f7;
  border: 1px solid #d4d0c8;
  max-width: 360px;
  width: 100%;
  max-height: 80vh;
  position: relative;
  font-family: Georgia, "Times New Roman", serif;
  display: flex;
  flex-direction: column;
}


/* Intro dialog */
.intro-dialog {
  padding: 2rem;
  padding-top: 3rem;
}

.intro-dialog h1 {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
  line-height: 1.3;
}

.intro-dialog p {
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.intro-dialog .copyright-notice {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e8e6e1;
}

/* Close button */
.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  color: #666;
  padding: 0;
  z-index: 1;
}

.close-btn:hover {
  color: #000;
}

/* Episode list */
.episode-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.episode-item {
  padding: 1.5rem;
  border-bottom: 1px solid #e8e6e1;
}

.episode-item:first-child {
  padding-top: 3rem;
}

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

.episode-item h2 {
  font-size: 1rem;
  font-weight: bold;
  color: #000;
  margin-bottom: 0.75rem;
}

.episode-figure {
  margin: 0 0 0.75rem 0;
}

.episode-image {
  width: 100%;
}

.episode-figure figcaption {
  font-size: 0.75rem;
  color: #999;
  text-align: center;
  margin-top: 0.25rem;
}

.episode-figure figcaption a {
  color: #999;
}

.meta {
  color: #666;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.separator {
  margin: 0 0.25rem;
}

.subtitle {
  color: #333;
  font-size: 0.9375rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.episode-item > a {
  font-size: 0.875rem;
}

/* Episode actions */
.episode-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e8e6e1;
}

.episode-actions-divider {
  width: 1px;
  height: 1rem;
  background: #d4d0c8;
}

.favorite-toggle,
.watched-toggle {
  flex: 1;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.875rem;
  color: #666;
}

.favorite-toggle {
  text-align: right;
}

.watched-toggle {
  text-align: left;
}

.favorite-toggle:hover,
.watched-toggle:hover {
  color: #000;
}

.favorite-toggle.is-favorite {
  color: #d4a017;
}

.favorite-toggle.is-favorite:hover {
  color: #b8860b;
}

/* Mobile: fullscreen dialog */
@media (max-width: 640px) {
  .overlay {
    padding: 0;
    align-items: stretch;
  }

  .dialog {
    max-width: none;
    max-height: none;
    height: 100%;
    border: none;
  }

  .episode-list {
    flex: 1;
  }
}
