/* Planet Zoo-inspired theme: emerald header, cream panel, gold accents. */
:root {
  --pz-green: #1f9e6a;
  --pz-green-bright: #28b27c;
  --pz-green-deep: #0f5e3e;
  --pz-cream: #f1ece1;
  --pz-ink: #2c3a33;
  --pz-ink-soft: #5b6b62;
  --pz-gold: #e2ab3c;
  --pz-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--pz-ink);
  background:
    radial-gradient(1100px 560px at 50% -12%, #2f8c66 0%, rgba(47, 140, 102, 0) 60%),
    linear-gradient(160deg, #14503a 0%, #0c3527 55%, #0a2c20 100%);
}

main { width: min(760px, 100%); }

/* Card */
.panel {
  background: var(--pz-cream);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--pz-shadow);
}

/* Green header strip */
.panel__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: linear-gradient(180deg, var(--pz-green-bright), var(--pz-green));
  color: #fff;
}

.panel__badge {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 2px solid var(--pz-gold); /* gold ring, like the game's portraits */
  color: #fff;
}

.panel__badge .paw {
  width: 21px;
  height: 21px;
  display: block;
}

.panel__eyebrow {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.95rem;
}

/* Body */
.panel__body {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#headline {
  margin: 0;
  font-size: clamp(1.25rem, 1rem + 1.4vw, 1.7rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--pz-green-deep);
}

#status { margin: 0; font-size: 0.95rem; font-weight: 600; }
#status[hidden] { display: none; }
.loading { color: var(--pz-ink-soft); }
.error { color: #c0392b; }
.setup { color: #b8862a; }

/* Framed 16:9 video; IFrame API swaps #player-mount for an iframe. */
.player-box {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

#player iframe,
#player-mount {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Primary action — Planet Zoo green pill */
.actions { display: flex; justify-content: center; }

button#shuffle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(180deg, var(--pz-green-bright), var(--pz-green));
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(20, 120, 80, 0.35);
  transition: transform 0.05s ease, filter 0.15s ease;
}

button#shuffle::before { content: "⟳"; font-size: 1.6rem; font-weight: 700; line-height: 1; }
button#shuffle:hover:not(:disabled) { filter: brightness(1.06); }
button#shuffle:active:not(:disabled) { transform: translateY(1px); }
button#shuffle:disabled { opacity: 0.5; cursor: default; box-shadow: none; }
