:root {
  --teal: #2db8b2;
  --teal-mid: #249f9a;
  --teal-deep: #167873;
  --teal-sky: #5ed4cf;
  --ink: #142022;
  --cream: #f7fffd;
  --stripe-pink: #ef3b6d;
  --stripe-white: #ffffff;
  --lime: #8dff4a;
  --headset-pink: #ff4d8d;
  --btn-dark: #1a1f24;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: "Bricolage Grotesque", Georgia, serif;
  --font-body: "Outfit", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--teal);
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* —— Custom animated voxel world —— */
.world {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(90% 70% at 50% -10%, #7fe0db 0%, transparent 58%),
    radial-gradient(55% 45% at 12% 30%, rgba(143, 255, 74, 0.18), transparent 60%),
    radial-gradient(50% 40% at 88% 24%, rgba(239, 59, 109, 0.16), transparent 62%),
    linear-gradient(180deg, var(--teal-sky) 0%, var(--teal) 48%, var(--teal-deep) 100%);
  animation: sky-shift 16s ease-in-out infinite alternate;
}

.grid {
  position: absolute;
  inset: -10%;
  background-image:
    linear-gradient(rgba(20, 32, 34, 0.07) 2px, transparent 2px),
    linear-gradient(90deg, rgba(20, 32, 34, 0.07) 2px, transparent 2px);
  background-size: 48px 48px;
  transform: perspective(700px) rotateX(62deg) translateY(18%) scale(1.35);
  transform-origin: center top;
  opacity: 0.55;
  animation: grid-drift 22s linear infinite;
}

.voxels {
  position: absolute;
  inset: 0;
}

.voxel {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: var(--s);
  height: var(--s);
  background: var(--c);
  box-shadow:
    inset -3px -3px 0 rgba(0, 0, 0, 0.18),
    inset 2px 2px 0 rgba(255, 255, 255, 0.22);
  opacity: var(--o, 0.85);
  animation: voxel-float var(--dur) var(--ease) infinite alternate;
  animation-delay: var(--delay);
}

.voxel.is-stripe {
  background: repeating-linear-gradient(
    180deg,
    var(--stripe-pink) 0 25%,
    var(--stripe-white) 25% 50%,
    var(--stripe-pink) 50% 75%,
    var(--stripe-white) 75% 100%
  );
}

.hills {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(28vh, 260px);
  background:
    linear-gradient(180deg, transparent, rgba(20, 32, 34, 0.12) 40%),
    repeating-linear-gradient(
      90deg,
      #1f8a85 0 40px,
      #237f7a 40px 80px,
      #1a736e 80px 120px
    );
  clip-path: polygon(
    0 55%, 7% 48%, 14% 58%, 22% 40%, 30% 52%, 38% 34%, 46% 50%,
    54% 30%, 62% 48%, 70% 36%, 78% 54%, 86% 42%, 94% 56%, 100% 46%,
    100% 100%, 0 100%
  );
  animation: hills-breathe 10s ease-in-out infinite alternate;
}

.stripe-rail {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0.7rem;
  background: repeating-linear-gradient(
    90deg,
    var(--stripe-pink) 0 22px,
    var(--stripe-white) 22px 44px
  );
}

/* —— Centered composition —— */
.shell {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  max-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(0.75rem, 2vh, 1.25rem) 1.25rem clamp(1.6rem, 4vh, 2.5rem);
  gap: clamp(0.35rem, 1vh, 0.75rem);
}

.brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.2rem, 11vw, 6.2rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--cream);
  text-shadow: 0 3px 0 rgba(20, 32, 34, 0.28);
  animation: rise-in 0.8s var(--ease) both;
}

.hero-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: clamp(1.5rem, 5vw, 4rem);
  width: min(1100px, 98vw);
  margin: 0.1rem 0;
  animation: rise-in 0.9s var(--ease) 0.06s both;
}

.mascot {
  grid-column: 2;
  width: min(38vmin, 260px);
  max-height: 36svh;
  aspect-ratio: 1;
  animation: mascot-float 4s ease-in-out 1s infinite;
}

.mascot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 0 rgba(20, 32, 34, 0.18));
}

.lede {
  margin: 0;
  max-width: 28ch;
  font-size: clamp(1rem, 2.3vw, 1.22rem);
  font-weight: 600;
  line-height: 1.35;
  color: rgba(20, 32, 34, 0.86);
  animation: rise-in 0.85s var(--ease) 0.14s both;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.2rem;
  animation: rise-in 0.85s var(--ease) 0.22s both;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-width: 9.75rem;
  padding: 0.9rem 1.3rem;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  border: 3px solid var(--ink);
  transition: transform 0.16s var(--ease);
}

.btn svg {
  width: 1.15rem;
  height: 1.15rem;
}

.btn-twitch {
  background: var(--btn-dark);
  color: var(--cream);
  box-shadow: 4px 4px 0 var(--ink);
}

.btn-discord {
  background: var(--cream);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.btn:hover,
.btn:focus-visible {
  transform: translate(-2px, -2px);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn.is-pending {
  opacity: 0.75;
}

.btn-twitch.is-live {
  background: var(--stripe-pink);
  color: var(--cream);
  animation: live-pulse 1.8s ease-in-out infinite;
}

/* —— Status: offline Borrelbuurt / live Twitch —— */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--cream);
  background: var(--stripe-pink);
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  animation: rise-in 0.7s var(--ease) both;
}

.live-badge::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  background: var(--cream);
  animation: blink 1s steps(2, end) infinite;
}

.live-badge[hidden] {
  display: none !important;
}

.status-stage {
  grid-column: 3;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  max-width: min(22rem, 100%);
  margin-left: clamp(0.5rem, 2vw, 1.5rem);
}

.mc-skin {
  width: auto;
  height: clamp(7rem, 16vh, 10rem);
  flex-shrink: 0;
  image-rendering: pixelated;
  filter: drop-shadow(3px 4px 0 rgba(20, 32, 34, 0.28));
  animation: skin-bob 2.8s ease-in-out infinite;
}

.status-panel {
  min-width: min(15rem, 58vw);
  max-width: 22rem;
  padding: 0.8rem 0.95rem;
  text-align: left;
  background: rgba(20, 32, 34, 0.82);
  border: 3px solid var(--ink);
  color: var(--cream);
  box-shadow: 4px 4px 0 var(--ink);
}

.status-copy {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
}

.status-copy strong {
  color: #7ad7ff;
}

.borrel-logo-link {
  display: block;
  margin: 0.15rem 0 0.7rem;
  transition: transform 0.16s var(--ease);
}

.borrel-logo-link:hover,
.borrel-logo-link:focus-visible {
  transform: translateY(-2px);
}

.borrel-logo {
  display: block;
  width: 100%;
  max-width: 220px;
  height: auto;
}

.btn-borrel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  padding: 0.7rem 1rem;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--cream);
  background: #1f6fe5;
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.16s var(--ease);
}

.btn-borrel:hover,
.btn-borrel:focus-visible {
  transform: translate(-2px, -2px);
}

.btn-borrel:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn-borrel-compact {
  margin-top: 0.75rem;
  background: #243041;
}

.live-kicker {
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lime);
}

.live-title {
  font-size: clamp(0.95rem, 2.2vw, 1.1rem);
  font-weight: 700;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.live-game {
  margin-top: 0.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #7ad7ff;
}

.live-viewers {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.55rem;
  font-size: 0.92rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.live-viewers svg {
  width: 0.95rem;
  height: 0.95rem;
}

body.is-live .mascot {
  max-height: 32svh;
  width: min(34vmin, 230px);
}

.status-panel.is-live {
  border-color: var(--stripe-pink);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes mascot-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes voxel-float {
  from { transform: translateY(0) rotate(0deg); }
  to { transform: translateY(-16px) rotate(6deg); }
}

@keyframes sky-shift {
  from { filter: saturate(1); }
  to { filter: saturate(1.12); }
}

@keyframes grid-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 48px 48px, 48px 48px; }
}

@keyframes hills-breathe {
  from { transform: translateY(0); }
  to { transform: translateY(4px); }
}

@keyframes blink {
  50% { opacity: 0.25; }
}

@keyframes live-pulse {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-1px, -1px); }
}

@keyframes skin-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@media (max-height: 720px) {
  .mascot {
    width: min(30vmin, 200px);
    max-height: 30svh;
  }

  .brand {
    font-size: clamp(2.6rem, 9vw, 4.4rem);
  }
}

@media (max-width: 420px) {
  .cta {
    width: 100%;
  }

  .btn {
    flex: 1 1 calc(50% - 0.4rem);
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .hero-row {
    grid-template-columns: 1fr;
    width: min(420px, 96vw);
    justify-items: center;
    row-gap: 0.75rem;
  }

  .mascot,
  .status-stage {
    grid-column: 1;
  }

  .status-stage {
    justify-self: center;
    width: 100%;
    max-width: none;
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .status-stage {
    flex-direction: column;
    gap: 0.55rem;
  }

  .status-panel {
    text-align: center;
    width: 100%;
  }

  .borrel-logo {
    margin-inline: auto;
  }

  .live-viewers {
    justify-content: center;
  }
}

/* Alleen zichtbaar met ?debug — lokaal in die browser */
.debug-live {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: min(220px, calc(100vw - 24px));
  padding: 0.7rem;
  background: rgba(20, 32, 34, 0.92);
  border: 3px solid var(--ink);
  color: var(--cream);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: var(--font-body);
}

.debug-live-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.debug-live-toggle,
.debug-live-reset {
  appearance: none;
  border: 3px solid var(--ink);
  padding: 0.55rem 0.65rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
  background: var(--cream);
}

.debug-live-toggle.is-on {
  background: var(--stripe-pink);
  color: var(--cream);
}

.debug-live-reset {
  background: #243041;
  color: var(--cream);
}

@media (prefers-reduced-motion: reduce) {
  .brand,
  .mascot,
  .hero-row,
  .lede,
  .cta,
  .voxel,
  .sky,
  .grid,
  .hills,
  .live-badge,
  .btn-twitch.is-live,
  .mc-skin,
  .live-badge::before {
    animation: none !important;
  }

  .brand,
  .hero-row,
  .lede,
  .cta {
    opacity: 1;
    transform: none;
  }
}
