/* ==========================================================================
   SupDucks Arcade — play.supducks.com

   Self-contained. The tokens, base, layout, buttons, header, footer and page
   head are copied from supducks.com's assets/css/styles.css so the arcade
   reads as part of the same site; the cabinet comes from the scrapped
   in-site arcade; the worlds section is new.

   Sections:
     1. Tokens            6. Footer
     2. Reset / base      7. Page head
     3. Layout            8. The arcade cabinet   (A. arcade games)
     4. Buttons           9. The big worlds       (B. linked-out games)
     5. Header           10. Responsive / motion
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  --sup-sky:        #6FE0F5;
  --sup-sky-deep:   #3FC6E8;
  --sup-sea:        #2E5FD9;
  --sup-sand:       #EBD7A6;

  --sup-pink:       #FF5FA2;
  --sup-bubblegum:  #FF95D6;
  --sup-yellow:     #FFD23F;
  --sup-orange:     #FF8A3D;
  --sup-toxic:      #B6F24B;
  --sup-green:      #5BD46B;
  --sup-purple:     #7B4BE8;
  --sup-deep:       #241748;

  --sup-ink:        #0D0D0D;
  --sup-cream:      #FFF7E9;
  --sup-paper:      #FFFFFF;

  /* The wordmark is a heavy black outline — that outline is the whole system */
  --line:           4px;
  --line-thick:     6px;
  --radius:         18px;
  --radius-md:      12px;
  --radius-lg:      28px;
  --radius-pill:    999px;

  /* Hard offset shadow, no blur — sticker look */
  --pop:            6px 6px 0 var(--sup-ink);
  --pop-sm:         4px 4px 0 var(--sup-ink);
  --pop-lg:         10px 10px 0 var(--sup-ink);

  --font-display:   "Sigmar", "Impact", system-ui, sans-serif;
  --font-body:      "Nunito", ui-rounded, "Segoe UI", system-ui, sans-serif;

  --shell:          1180px;
  --header-h:       76px;

  --ease-out:       cubic-bezier(0.16, 1, 0.3, 1);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* --------------------------------------------------------------------------
   2. Reset / base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

/* The `hidden` attribute has to win over any component's own display. */
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--safe-t) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.65;
  color: var(--sup-ink);
  background: var(--sup-cream);
  overflow-x: hidden;
}

img { max-width: 100%; display: block; height: auto; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0 0 1.1em; }
a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: 0.01em;
  margin: 0 0 0.4em;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -100px; z-index: 200;
  background: var(--sup-yellow); color: var(--sup-ink);
  padding: 12px 20px; border: var(--line) solid var(--sup-ink);
  border-radius: var(--radius); font-weight: 900; text-decoration: none;
  transition: top 0.2s var(--ease-out);
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 4px solid var(--sup-purple);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */
.shell {
  width: min(100% - 2.5rem, var(--shell));
  margin-inline: auto;
}

.section { padding: clamp(4.5rem, 9vw, 7.5rem) 0; position: relative; }
.section--sky {
  background: linear-gradient(180deg, var(--sup-sky) 0%, var(--sup-sky-deep) 100%);
  border-top: var(--line-thick) solid var(--sup-ink);
  border-bottom: var(--line-thick) solid var(--sup-ink);
}
.section--dark {
  background:
    radial-gradient(120% 90% at 80% 0%, rgba(123, 75, 232, 0.55), transparent 60%),
    radial-gradient(90% 80% at 10% 100%, rgba(255, 95, 162, 0.35), transparent 60%),
    var(--sup-deep);
  border-bottom: var(--line-thick) solid var(--sup-ink);
}

.section__head {
  max-width: 760px;
  margin: 0 auto clamp(2.5rem, 5vw, 4rem);
  text-align: center;
}
.section__sub { font-size: 1.1rem; opacity: 0.92; margin-bottom: 0; font-weight: 700; }
.section--dark .section__sub { color: var(--sup-paper); }

.h2 { font-size: clamp(2.1rem, 1.3rem + 3.4vw, 3.9rem); }
.h2--light { color: var(--sup-paper); text-shadow: 4px 4px 0 var(--sup-ink); }

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.86rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sup-paper);
  -webkit-text-stroke: 0.6px var(--sup-ink);
  margin-bottom: 0.9rem;
}
.eyebrow--dark { color: var(--sup-purple); -webkit-text-stroke: 0; }

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--sup-yellow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  padding: 0.85rem 1.75rem;
  background: var(--btn-bg);
  color: var(--sup-ink);
  border: var(--line) solid var(--sup-ink);
  border-radius: var(--radius-pill);
  box-shadow: var(--pop);
  cursor: pointer;
  transition: transform 0.14s var(--ease-out), box-shadow 0.14s var(--ease-out);
}
.btn:hover { transform: translate(3px, 3px); box-shadow: var(--pop-sm); }
.btn:active { transform: translate(6px, 6px); box-shadow: 0 0 0 var(--sup-ink); }

.btn--sm { font-size: 0.9rem; padding: 0.55rem 1.15rem; box-shadow: var(--pop-sm); }
.btn--pink   { --btn-bg: var(--sup-pink); color: var(--sup-paper); }
.btn--yellow { --btn-bg: var(--sup-yellow); }
.btn--ghost  { --btn-bg: var(--sup-paper); }
.btn--ghost-light { --btn-bg: var(--sup-sky); }

.btn--boardwalk {
  --btn-bg: var(--sup-purple);
  color: var(--sup-paper);
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.btn--boardwalk:hover { --btn-bg: #8d5cff; }

/* --------------------------------------------------------------------------
   5. Header
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: calc(var(--header-h) + var(--safe-t));
  padding-top: var(--safe-t);
  display: flex;
  align-items: center;
}
.site-header.is-stuck {
  background: var(--sup-cream);
  border-bottom: var(--line) solid var(--sup-ink);
  box-shadow: 0 6px 0 rgba(13, 13, 13, 0.08);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: min(100% - 2.5rem, 1320px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: none;
  text-decoration: none;
}
.brand__mark {
  height: 30px;
  width: auto;
  transition: transform 0.2s var(--ease-out);
}
.brand:hover .brand__mark { transform: rotate(-3deg) scale(1.04); }
/* Says which part of supducks.com this is, without a second logo. */
.brand__tag {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  line-height: 1;
  color: var(--sup-ink);
  background: var(--sup-yellow);
  border: 3px solid var(--sup-ink);
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.6rem 0.35rem;
  box-shadow: 2px 2px 0 var(--sup-ink);
  transform: rotate(-4deg);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 1.9rem);
}
.nav > a {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: var(--sup-ink);
  position: relative;
  padding: 4px 0;
}
.nav > a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 4px;
  border-radius: 4px;
  background: var(--sup-pink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s var(--ease-out);
}
.nav > a:not(.btn):hover::after { transform: scaleX(1); }
/* `.nav > a` outranks `.btn--sm`, so the pill restates its own size. */
.nav > .btn--boardwalk {
  font-size: 0.9rem;
  padding: 0.55rem 1.6rem;
  line-height: normal;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 48px; height: 44px;
  padding: 0 9px;
  background: var(--sup-yellow);
  border: var(--line) solid var(--sup-ink);
  border-radius: 12px;
  box-shadow: var(--pop-sm);
  cursor: pointer;
}
.nav-toggle__bar {
  display: block; height: 4px; width: 100%;
  background: var(--sup-ink); border-radius: 3px;
  transition: transform 0.22s var(--ease-out), opacity 0.15s linear;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   6. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--sup-deep);
  color: var(--sup-cream);
  padding: clamp(3rem, 6vw, 4.5rem) 0 calc(1.75rem + var(--safe-b));
}
.footer__inner {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 2fr;
  gap: clamp(2rem, 5vw, 4rem);
  padding-bottom: 2.5rem;
  border-bottom: 3px solid rgba(255, 247, 233, 0.18);
}
.footer__logo { height: 34px; width: auto; filter: invert(1); }
.footer__tag {
  margin: 1rem 0 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--sup-sky);
}

.footer__nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.5rem;
}
.footer__col h4 {
  font-size: 1.05rem;
  color: var(--sup-yellow);
  margin-bottom: 0.8em;
}
.footer__col a {
  display: block;
  text-decoration: none;
  font-weight: 700;
  padding: 0.28rem 0;
  opacity: 0.85;
  transition: opacity 0.15s, transform 0.15s var(--ease-out);
}
.footer__col a:hover { opacity: 1; transform: translateX(4px); color: var(--sup-sky); }

.footer__base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 1.75rem;
  font-size: 0.87rem;
  opacity: 0.7;
}
.footer__base p { margin: 0; }

/* The MEGAVOLT mark under the cabinet. No fill of its own: it stands on the
   dark arcade section. */
.brand-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 4vw, 3rem) 1rem 0;
}
.brand-footer__logo {
  display: block;
  width: auto;
  height: clamp(3rem, 6vw, 4rem);
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.6));
}

/* --------------------------------------------------------------------------
   7. Page head
   -------------------------------------------------------------------------- */
.page { padding-top: calc(var(--header-h) + var(--safe-t)); }
.page > .section--dark:first-child { padding-top: clamp(2rem, 4vw, 3rem); }

.page__lede {
  max-width: 620px;
  font-weight: 700;
  margin-top: 0.75rem;
}
.page__lede--light {
  color: var(--sup-paper);
  opacity: 0.92;
  margin: -0.9rem 0 1.75rem;
}
.page__lede--light a { color: var(--sup-yellow); }

.step__title {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3.1rem);
  margin-bottom: 1.75rem;
}
.step__title--light { color: var(--sup-paper); text-shadow: 3px 3px 0 var(--sup-ink); }

#arcade .eyebrow { margin-bottom: 0.5rem; color: var(--sup-yellow); }

/* --------------------------------------------------------------------------
   8. The arcade cabinet  (A. ARCADE GAMES)

   Marquee on top, screen in the middle, a rack of game buttons across the
   deck. The screen holds a same-origin iframe, and it stays empty until
   somebody picks.
   -------------------------------------------------------------------------- */
.cab {
  background: var(--sup-cream);
  border: var(--line-thick) solid var(--sup-ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--pop-lg);
  overflow: hidden;
}

.cab__marquee {
  background: var(--sup-pink);
  border-bottom: var(--line) solid var(--sup-ink);
  padding: 0.75rem 1.25rem;
  text-align: center;
}
.cab__marquee-text {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 0.9rem + 1.2vw, 1.9rem);
  letter-spacing: 0.06em;
  color: var(--sup-paper);
  -webkit-text-stroke: 2px var(--sup-ink);
  paint-order: stroke fill;
}

/* The glass. Sized by aspect so the cabinet does not change height when a
   game loads, which would bounce the deck out from under the cursor.
   Portrait by default: these are phone games first. A game that really wants
   width says "orientation": "landscape" in arcade.json. */
.cab__screen {
  position: relative;
  aspect-ratio: 4 / 5;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(111, 224, 245, 0.22), transparent 60%),
    var(--sup-deep);
  border-bottom: var(--line) solid var(--sup-ink);
}
.cab[data-orientation="landscape"] .cab__screen { aspect-ratio: 16 / 10; }

/* The glass takes its height from the cabinet's width, so cap the width in
   portrait so the whole cabinet -- marquee, screen and rack -- fits a desktop
   window under the header. ~420px is the header plus the marquee and the
   deck; what is left of the viewport is the screen's height, and 4:5 of that
   is the width. Phones are exempt: below 560px the cabinet fills the screen. */
@media (min-width: 561px) {
  .cab:not([data-orientation]),
  .cab[data-orientation="portrait"] {
    max-width: min(100%, max(340px, calc((100vh - 420px) * 4 / 5)));
    margin-inline: auto;
  }
}

.cab__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.cab__attract {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 1.5rem;
}
.cab__attract-line {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 0.9rem + 1vw, 1.7rem);
  color: var(--sup-paper);
  text-shadow: 3px 3px 0 var(--sup-ink);
  animation: cab-blink 1.6s steps(1, end) infinite;
}
@keyframes cab-blink { 50% { opacity: 0.35; } }
.cab__attract-sub {
  margin: 0;
  font-weight: 700;
  color: rgba(255, 247, 233, 0.75);
}

.cab__status {
  position: absolute;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 2rem);
  text-align: center;
  margin: 0;
  font-weight: 900;
  background: var(--sup-yellow);
  border: 3px solid var(--sup-ink);
  border-radius: var(--radius-pill);
  padding: 0.35rem 1rem;
  box-shadow: var(--pop-sm);
}

.cab__deck { padding: clamp(1rem, 3vw, 1.6rem); }

.cab__slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.85rem;
}

.cab-slot {
  --slot-tint: var(--sup-sky);
  display: grid;
  align-content: start;
  gap: 0.2rem;
  text-align: left;
  font: inherit;
  color: inherit;
  padding: 0.85rem 1rem;
  background: var(--slot-tint);
  border: var(--line) solid var(--sup-ink);
  border-radius: var(--radius);
  box-shadow: var(--pop-sm);
  cursor: pointer;
  transition: transform 0.14s var(--ease-out), box-shadow 0.14s var(--ease-out);
}
.cab-slot:hover { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--sup-ink); }
.cab-slot.is-playing { box-shadow: 0 0 0 4px var(--sup-yellow), var(--pop-sm); }

.cab-slot__name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.2;
  color: var(--sup-paper);
  -webkit-text-stroke: 1.5px var(--sup-ink);
  paint-order: stroke fill;
}
.cab-slot__blurb {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--sup-ink);
  opacity: 0.85;
}
.cab-slot__flag {
  justify-self: start;
  margin-top: 0.3rem;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--sup-ink);
  color: var(--sup-cream);
  border-radius: var(--radius-pill);
  padding: 0.1rem 0.55rem;
}
/* An unfinished cabinet still gets a button, but must not look as pressable. */
.cab-slot.is-soon { opacity: 0.72; }

.cab__deck-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.cab__noscript { margin-top: 1.5rem; }

/* --------------------------------------------------------------------------
   9. The big worlds  (B. linked out, not bundled)

   Bigger than a cabinet button on purpose: these are whole games on their
   own subdomains, and the card is a door rather than a coin slot.
   -------------------------------------------------------------------------- */
.worlds-section .h2 { text-shadow: 3px 3px 0 var(--sup-paper); }
.worlds-section .eyebrow--dark { color: var(--sup-deep); }

.worlds {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: clamp(1.5rem, 3vw, 2.25rem);
}

.world {
  --world-tint: var(--sup-purple);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: clamp(260px, 30vw, 340px);
  padding: clamp(1.4rem, 3vw, 2.1rem);
  color: var(--sup-paper);
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.28) 0 18%, transparent 19%),
    radial-gradient(circle at 100% 100%, rgba(13, 13, 13, 0.22) 0 34%, transparent 35%),
    linear-gradient(160deg, var(--world-tint) 0%, var(--sup-deep) 115%);
  border: var(--line-thick) solid var(--sup-ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--pop-lg);
  overflow: hidden;
  transition: transform 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
}
.world:hover { transform: translate(-2px, -2px) rotate(-0.4deg); box-shadow: 14px 14px 0 var(--sup-ink); }

.world__tag {
  align-self: flex-start;
  margin: 0 0 1rem;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--sup-ink);
  color: var(--sup-cream);
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.75rem;
}

.world__title {
  font-size: clamp(2.1rem, 1.4rem + 3vw, 3.4rem);
  color: var(--sup-paper);
  -webkit-text-stroke: 3px var(--sup-ink);
  paint-order: stroke fill;
  text-shadow: 4px 4px 0 var(--sup-ink);
  margin-bottom: 0.5rem;
  overflow-wrap: anywhere;
}

.world__blurb {
  max-width: 34ch;
  font-size: 1.05rem;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(13, 13, 13, 0.4);
  margin-bottom: 1.5rem;
}

.world__foot {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}
.world__host {
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  opacity: 0.85;
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   10. Responsive / motion
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .footer__inner { grid-template-columns: 1fr; }
}

/* Three links fit inline on anything wider than a phone; below that the
   header gets supducks.com's drawer. */
@media (max-width: 640px) {
  .nav-toggle { display: flex; }

  .nav {
    position: fixed;
    inset: calc(var(--header-h) + var(--safe-t)) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--sup-cream);
    border-bottom: var(--line-thick) solid var(--sup-ink);
    padding: 0.5rem 1.25rem 1.5rem;
    transform: translateY(-130%);
    visibility: hidden;
    transition: transform 0.3s var(--ease-out), visibility 0s linear 0.3s;
    box-shadow: 0 14px 0 rgba(13, 13, 13, 0.1);
  }
  .nav.is-open {
    transform: translateY(0);
    visibility: visible;
    transition: transform 0.3s var(--ease-out), visibility 0s;
  }
  .site-header.is-nav-open { border-bottom-color: transparent; box-shadow: none; }

  .nav > a {
    padding: 0.85rem 0;
    font-size: 1.3rem;
    border-bottom: 3px solid rgba(13, 13, 13, 0.1);
  }
  .nav > a:not(.btn)::after { display: none; }
  .nav > .nav__boardwalk {
    margin-top: 1rem;
    font-size: 1.05rem;
    padding: 0.75rem 1.5rem;
    border-bottom: var(--line) solid var(--sup-ink);
  }
}

@media (max-width: 560px) {
  /* On a phone the cabinet is the whole screen, so the glass goes as tall as
     it can without pushing the whole rack below the fold. */
  .cab__screen { aspect-ratio: 3 / 5; }
  .cab[data-orientation="landscape"] .cab__screen { aspect-ratio: 4 / 3; }
  .cab__slots { grid-template-columns: 1fr; }
  .cab { border-width: var(--line); box-shadow: var(--pop); }
  .world { box-shadow: var(--pop); }
  .brand__mark { height: 24px; }
}

@media (max-width: 780px) {
  .btn { min-height: 48px; }
}

@media (max-width: 480px) {
  .cab__deck-actions .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
