:root {
  --bg: #0c1a27;
  --surf: rgba(255, 255, 255, 0.06);
  --surf-hi: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.1);
  --ink: #dceaf5;
  --muted: #6a90b0;
  --accent: #f5a623;
  --accent-d: #c47d0a;
}

* { box-sizing: border-box; }

/* Ensure [hidden] always wins over display:grid/flex set by component classes */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Outfit", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 80% 5%, rgba(245,166,35,0.12), transparent 35%),
    radial-gradient(circle at 10% 80%, rgba(52,196,124,0.08), transparent 40%),
    linear-gradient(160deg, #0c1a27, #07111b);
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: rgba(7,17,27,0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.top-brand { display: flex; align-items: center; gap: 0.5rem; }

a.top-brand {
  text-decoration: none;
}
a.top-brand:hover .brand-name {
  color: var(--accent);
}

.top-page-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Sora", sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.brand-name {
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 1rem;
}

.shell {
  width: min(1500px, 97vw);
  margin: 0.9rem auto 1.4rem;
  display: grid;
  gap: 0.85rem;
}

.card {
  background: var(--surf);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1rem;
  backdrop-filter: blur(8px);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
}

.card-label {
  font: 700 0.72rem/1 "Sora", sans-serif;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.player {
  width: 100%;
}

.slide-grid {
  display: grid;
  grid-template-columns: minmax(560px, 64%) minmax(340px, 1fr);
  gap: 1.2rem;
  align-items: stretch;
}

.photo-wrap {
  position: relative;
  width: 100%;
  min-height: 72vh;
  max-height: 72vh;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  justify-self: start;
}

:fullscreen .shell,
:-webkit-full-screen .shell {
  width: 99vw;
  margin: 0.35rem auto;
  gap: 0.45rem;
}

:fullscreen .card,
:-webkit-full-screen .card {
  padding: 0.75rem;
}

:fullscreen .slide-grid,
:-webkit-full-screen .slide-grid {
  grid-template-columns: minmax(760px, 68%) minmax(360px, 1fr);
  gap: 1rem;
}

:fullscreen .photo-wrap,
:-webkit-full-screen .photo-wrap {
  min-height: calc(100vh - 12rem);
  max-height: calc(100vh - 12rem);
}

:fullscreen .special-slide,
:-webkit-full-screen .special-slide,
:fullscreen .special-image-template,
:-webkit-full-screen .special-image-template,
:fullscreen .special-split-template,
:-webkit-full-screen .special-split-template,
:fullscreen .special-split-photo-wrap,
:-webkit-full-screen .special-split-photo-wrap {
  min-height: calc(100vh - 12rem);
  max-height: calc(100vh - 12rem);
}

:fullscreen .animal-name,
:-webkit-full-screen .animal-name {
  font-size: clamp(2.4rem, 5.2vw, 5rem);
}

:fullscreen .animal-details,
:-webkit-full-screen .animal-details {
  font-size: clamp(1.2rem, 2vw, 1.85rem);
}

:fullscreen .animal-bio,
:-webkit-full-screen .animal-bio {
  font-size: clamp(1.05rem, 1.45vw, 1.5rem);
}

.photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.photo-wrap.has-image img {
  display: block;
}

.image-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 2.1rem;
  color: var(--muted);
}

.photo-wrap.has-image .image-fallback {
  display: none;
}

.animal-name {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.05;
}

.animal-details {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: clamp(1.1rem, 2vw, 1.65rem);
}

.animal-bio {
  margin: 1rem 0 1.25rem;
  color: var(--ink);
  opacity: 0.95;
  line-height: 1.45;
  font-size: clamp(1.05rem, 1.65vw, 1.55rem);
}

.slide-actions {
  margin-top: 0.85rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.special-slide {
  min-height: 72vh;
}

.special-image-template {
  position: relative;
  width: 100%;
  min-height: 72vh;
  max-height: 72vh;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
}

.special-split-template {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  min-height: 72vh;
  max-height: 72vh;
}

.special-image-template img,
.special-split-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.special-split-template {
  display: grid;
  grid-template-columns: 50% 50%;
}

.special-split-photo-wrap {
  position: relative;
  min-height: 72vh;
  max-height: 72vh;
  overflow: hidden;
}

.special-copy-wrap {
  padding: 1.1rem 1.2rem;
  overflow: auto;
}

.special-rich-body {
  margin-top: 0.7rem;
  font-size: clamp(1rem, 1.35vw, 1.35rem);
  line-height: 1.45;
  color: var(--ink);
}

.special-rich-body p {
  margin: 0 0 0.7rem;
}

.special-rich-body ul,
.special-rich-body ol {
  margin: 0.35rem 0 0.75rem 1.2rem;
}

.special-rich-body a {
  color: var(--accent);
}

.status-line {
  margin-top: 0.5rem;
}

.status-hud {
  position: fixed;
  right: 1rem;
  bottom: calc(50px + 1rem);
  z-index: 8;
  width: min(450px, calc(100vw - 1.5rem));
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(7,17,27,0.9);
  backdrop-filter: blur(8px);
  padding: 0.7rem 0.85rem;
}

.hud-kicker {
  font: 700 0.66rem/1 "Sora", sans-serif;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.hud-title {
  margin-top: 0.3rem;
  font-family: "Sora", sans-serif;
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-meta,
.hud-time {
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-time {
  color: #b8d3e9;
}

.btn-accent,
.btn-ghost {
  border-radius: 10px;
  padding: 0.58rem 0.88rem;
  font: 600 0.92rem "Outfit", sans-serif;
  text-decoration: none;
}

.btn-accent {
  color: #fff;
  background: linear-gradient(140deg, var(--accent), var(--accent-d));
  border: none;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
}

.btn-ghost:hover {
  color: var(--ink);
  border-color: var(--ink);
}

@media (max-width: 760px) {
  .top-actions {
    gap: 0.35rem;
  }

  .slide-grid {
    grid-template-columns: 1fr;
  }

  .special-split-template {
    grid-template-columns: 1fr;
  }

  .photo-wrap {
    min-height: 45vh;
    max-height: 45vh;
  }

  .special-slide,
  .special-image-template,
  .special-split-template,
  .special-split-photo-wrap {
    min-height: 45vh;
    max-height: 45vh;
  }

  .slide-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .status-hud {
    position: static;
    margin: 0 auto 1rem;
    width: min(1000px, 97vw);
  }
}
