:root {
  --text: #f6f3ea;
  --muted: #c3bfd2;
  --surface: rgba(16, 18, 30, 0.86);
  --border: rgba(255, 255, 255, 0.14);
  --accent: #f5b83d;
  --accent-text: #241800;
  --accent-shadow: #a8741a;
  --blue: #3f7fe0;
  --blue-shadow: #244c8f;
  color-scheme: dark;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  /* Shown if the animated background can't run. */
  background: radial-gradient(circle at 50% 40%, #6a2a3c, #1d3560 55%, #12141f);
}

#background {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  image-rendering: pixelated;
}

/* ---------- Title ---------- */

/* Title on the left, audidiot on the right (stacked on narrow screens). */
.hero {
  max-width: 1240px;
  margin: 0 auto;
  padding: max(32px, env(safe-area-inset-top)) 16px 8px;
  min-height: min(78vh, 640px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  align-items: center;
  gap: 32px;
}

header {
  text-align: center;
}

/* The title with the Florida Man card under it, no taller than audidiot beside it. */
.hero-left {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

/* Wide screens: the card fills down to the bottom of audidiot, so both columns line up. */
@media (min-width: 901px) {
  .hero {
    align-items: stretch;
    min-height: 0;
    padding-top: max(40px, env(safe-area-inset-top));
  }

  .florida {
    flex: 1;
  }

  .florida-result {
    flex: 1;
    justify-content: center;
    gap: 10px;
  }

  .florida .florida-headline {
    font-size: clamp(1.25rem, 1.9vw, 1.6rem);
    -webkit-line-clamp: 6;
  }
}

/* ---------- Florida Man of the day ---------- */

.florida {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 20px;
  background: var(--surface);
  border: 2px solid var(--border);
  box-shadow: 0 8px 0 #0007;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.florida p {
  margin: 0;
}

.florida-label {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Looks like a search box. */
.florida-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  color: #202124;
  font-size: 0.95rem;
}

.florida-g {
  font-weight: 900;
  font-size: 1.1rem;
  background: conic-gradient(from -45deg, #ea4335 0 25%, #4285f4 0 50%, #34a853 0 75%, #fbbc05 0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.florida-result {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.florida-headline {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  color: #8ab4f8;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.florida-headline:hover {
  text-decoration: underline;
}

.florida-meta,
.florida-loading {
  color: var(--muted);
  font-size: 0.9rem;
}

.florida-more a {
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- Small print ---------- */

.smallprint {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 16px max(28px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--muted);
}

.smallprint p {
  margin: 0;
}

.smallprint a {
  color: var(--muted);
}

.smallprint .dot {
  margin: 0 8px;
}

@media (min-width: 901px) {
  .hero h1 {
    font-size: min(3.5vw, 4.2rem);
    white-space: nowrap;
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    gap: 24px;
  }

  header {
    text-align: center;
  }
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 8vw, 4.5rem);
  font-weight: 900;
  color: var(--accent);
  text-shadow: 0 6px 0 #000a, 0 0 24px #0009;
  overflow-wrap: anywhere;
}

/* ---------- Game cards ---------- */

main {
  padding: 24px 16px 32px;
}

.cards {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  align-items: stretch;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 0 #0007;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.card-image {
  display: block;
  aspect-ratio: 13 / 10;
  overflow: hidden;
  background: #0b0d18;
  border-bottom: 2px solid var(--border);
}

.card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover; /* crops the picture to fill the box */
  object-position: top;
  transition: transform 300ms ease;
}

/* Wide banners: show the whole picture on white instead of cropping the sides. */
.card-image.fit {
  background: #fff;
}

.card-image.fit img {
  object-fit: contain;
  object-position: center;
}

/* Keep the Krillion title and boat in view when cropped. */
.card-image img.krillion-image {
  object-position: center 40%;
}

.card:hover .card-image img {
  transform: scale(1.03);
}

.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}

h2 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--accent);
}

.card-body p {
  margin: 0;
  line-height: 1.5;
}

/* ---------- Buttons ---------- */

.button {
  margin-top: auto; /* keeps buttons lined up at the bottom of each card */
  display: block;
  padding: 16px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 1.1rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 5px 0 var(--accent-shadow);
  transition: transform 80ms, box-shadow 80ms;
}

.button.secondary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 5px 0 var(--blue-shadow);
}

.button:hover {
  filter: brightness(1.07);
}

.button:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--accent-shadow);
}

.button.secondary:active {
  box-shadow: 0 1px 0 var(--blue-shadow);
}

.button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .card-image img,
  .button {
    transition: none;
  }
}

/* ---------- audidiot ---------- */

.audidiot {
  --lum: #e6ff1a; /* luminous yellow */
  --lum-shadow: #8a9900;
  --ink: #160a22; /* near-black purple */
  --ink-2: #2a1442;
  --ink-text: #f3f0ff;
  background: linear-gradient(160deg, #1d0d2e, var(--ink) 60%);
  border: 2px solid var(--lum);
  border-radius: 24px;
  padding: 20px 24px 24px;
  box-shadow: 0 8px 0 #000a, 0 0 40px rgba(230, 255, 26, 0.18);
  color: var(--ink-text);
}

.aud-title {
  margin: 0 0 12px;
  text-align: center;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--lum);
  text-shadow: 0 0 18px rgba(230, 255, 26, 0.45);
}

.aud-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

@media (max-width: 640px) {
  .audidiot {
    padding: 16px;
  }

  .aud-body {
    grid-template-columns: minmax(0, 1fr);
  }
}

.wheel-wrap {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  padding-top: 14px;
}

#wheel {
  display: block;
  width: 100%;
  height: auto;
  cursor: pointer;
  filter: drop-shadow(0 6px 0 #000a);
}

#wheel-spin {
  transform-box: fill-box;
  transform-origin: center;
}

/* Arrow at the top pointing down into the wheel. */
.wheel-pointer {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 1;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 30px solid #fff;
  filter: drop-shadow(0 2px 2px #000);
}

.wheel-rim {
  fill: var(--lum);
}

.wheel-edge {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
}

.seg-bright {
  fill: var(--lum);
}

.seg-dark {
  fill: var(--ink);
}

.seg-deep {
  fill: var(--ink-2);
}

.seg-bright-text,
.seg-dark-text,
.seg-deep-text {
  font: 700 7px system-ui, sans-serif;
  pointer-events: none;
}

.seg-bright-text {
  fill: var(--ink);
}

.seg-dark-text,
.seg-deep-text {
  fill: var(--lum);
}

.wheel-hub {
  fill: var(--ink);
  stroke: var(--lum);
  stroke-width: 2.5;
}

.wheel-hub-text {
  font: 900 8px system-ui, sans-serif;
  fill: var(--lum);
  pointer-events: none;
}

.aud-panel label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 700;
  color: var(--lum);
}

.aud-picker,
.aud-result {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.aud-picker[hidden],
.aud-result[hidden] {
  display: none;
}

.aud-intro,
.aud-count {
  margin: 0;
  line-height: 1.45;
}

.aud-count {
  color: #c9bfdc;
  font-size: 0.95rem;
}

.aud-panel select {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 2px solid var(--ink-2);
  background: #0e0617;
  color: var(--ink-text);
  font: inherit;
  font-size: 1rem;
}

.aud-panel select:focus-visible {
  outline: 3px solid var(--lum);
  outline-offset: 2px;
}

.aud-button {
  padding: 14px 18px;
  border: none;
  border-radius: 12px;
  background: var(--lum);
  color: var(--ink);
  font: inherit;
  font-size: 1.15rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--lum-shadow);
  transition: transform 80ms, box-shadow 80ms;
}

.aud-button:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--lum-shadow);
}

.aud-button:disabled {
  opacity: 0.55;
  cursor: default;
}

.aud-button.ghost {
  background: transparent;
  color: var(--lum);
  border: 2px solid var(--lum);
  box-shadow: none;
}

.aud-button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.aud-album {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: aud-pop 400ms ease-out;
}

.aud-cover {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 1;
  height: auto;
  margin: 0 auto;
  border-radius: 12px;
  border: 2px solid var(--lum);
  box-shadow: 0 0 24px rgba(230, 255, 26, 0.3);
  object-fit: cover;
}

.aud-cover-missing {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink-2);
  color: var(--lum);
  font-size: 5rem;
}

.aud-info {
  text-align: center;
}

.aud-info p {
  margin: 2px 0;
}

.aud-name {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--lum);
}

.aud-artist {
  font-size: 1.1rem;
  font-weight: 700;
}

.aud-meta {
  color: #c9bfdc;
  font-size: 0.9rem;
}

.aud-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin-top: 8px !important;
}

.aud-links a {
  color: var(--lum);
  font-weight: 700;
}

.aud-sign {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.aud-sign .aud-button {
  flex: 1;
  min-width: 120px;
}

.aud-happy {
  flex-basis: 100%;
  margin: 0;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--lum);
}

@keyframes aud-pop {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aud-album {
    animation: none;
  }

  .aud-button {
    transition: none;
  }
}
