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

body {
  font-family: 'Nunito', Arial, sans-serif;
  background: #001a4d;
  color: white;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Star canvas background */

#starCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* All content sits above the canvas */

header,
main,
.modal-overlay {
  position: relative;
  z-index: 1;
}

/* Header */

header {
  background: transparent;
  padding: 28px 20px 22px;
  text-align: center;
  border-bottom: 2px solid rgba(255, 255, 255, 0.15);
}

.logo {
  height: 80px;
  margin-bottom: 14px;
}

header h1 {
  font-family: 'Fredoka One', cursive;
  font-size: 52px;
  color: white;
  letter-spacing: 3px;
  line-height: 1.1;
  text-shadow: 0 2px 20px rgba(100, 160, 255, 0.5);
}

.tagline {
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 8px;
  letter-spacing: 0.5px;
}

/* Main grid area */

main {
  max-width: 1300px;
  margin: 0 auto;
  padding: 36px 24px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 28px;
}

.loading {
  color: rgba(255, 255, 255, 0.6);
  font-size: 18px;
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 0;
}

/* Thumbnail cards */

.card {
  cursor: pointer;
  border-radius: 14px;
  overflow: hidden;
  background: #002a7a;
  border: 2px solid transparent;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.card:focus {
  outline: none;
  border-color: white;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4);
}

/* Newest story highlight */

.card.newest {
  border-color: #ffd700;
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.4);
}

.card.newest:hover {
  box-shadow: 0 10px 30px rgba(255, 215, 0, 0.5);
}

.newest-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #ffd700;
  color: #001a4d;
  font-family: 'Fredoka One', cursive;
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 20px;
  z-index: 2;
  letter-spacing: 0.5px;
}

.card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: #001a4d;
}

.card-info {
  padding: 10px 14px 12px;
}

.card-title {
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: white;
  text-align: center;
  line-height: 1.4;
}

.card-date {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  margin-top: 4px;
}

/* Modal overlay */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 20, 0.85);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: #001a4d;
  border-radius: 16px;
  width: 100%;
  max-width: 900px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  font-size: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.modal-title {
  font-family: 'Fredoka One', cursive;
  padding: 20px 60px 16px 20px;
  font-size: 22px;
  color: white;
  letter-spacing: 0.5px;
}

.modal-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: black;
}

.modal-video iframe {
  width: 100%;
  height: 100%;
  display: block;
}

/* Responsive */

@media (max-width: 600px) {
  header h1 {
    font-size: 36px;
  }

  .tagline {
    font-size: 14px;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 18px;
  }

  .card-title {
    font-size: 13px;
  }

  .modal-title {
    font-size: 18px;
  }
}
