@font-face {
  font-family: Jersey;
  src: url('/portal/assets/jersey10.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --sea: #2a7ab3;
  --sea-deep: #1f5f92;
  --navy: #173f6b;
  --navy-deep: #0f2c4d;
  --foam: #8fd8f6;
  --cream: #fff4d8;
  --muted: #b8d6ec;
  --sign: #f3e2b8;
  --sign-edge: #4a2f1c;
  --leaf: #72d65c;
  --leaf-light: #b4f28f;
  --leaf-dark: #2d7d34;
  --ink: #12301a;
  --gold: #ffcd73;
  font-family: 'Trebuchet MS', Arial, sans-serif;
  color: var(--cream);
  background: var(--navy);
}

* { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.6; background: var(--navy); }
body.home { background: linear-gradient(var(--sea) 0 70svh, var(--sea-deep) 95svh, var(--navy) 150svh); }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 5px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.page { width: min(1040px, calc(100% - 32px)); margin-inline: auto; }

/* Top bar: logo, live count, Play. Stays put while scrolling. */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--navy);
  border-bottom: 4px solid var(--navy-deep);
  box-shadow: inset 0 -4px 0 #24578c;
}
.topbar-inner {
  width: min(1180px, calc(100% - 32px)); margin-inline: auto;
  display: flex; align-items: center; gap: 18px; min-height: 76px; padding: 8px 0 12px;
}
.brand { display: block; margin-right: auto; line-height: 0; }
.brand img { display: block; width: 222px; height: 44px; image-rendering: pixelated; }

/* Hero: the island is drawn on a canvas by island.js. */
.hero {
  position: relative; height: clamp(400px, 48vw, 66svh); overflow: hidden;
  background: linear-gradient(#62bdf1 0 33%, #45abda 33% 50%, var(--sea) 50%);
}
.hero canvas {
  position: absolute; left: 50%; top: 0; translate: -50% 0;
  display: block; image-rendering: pixelated; cursor: pointer;
  opacity: 0; transition: opacity .3s steps(3);
}
.hero canvas.is-ready { opacity: 1; }

.play-button {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 180px; min-height: 56px; padding: 4px 28px 10px;
  border: 4px solid var(--ink);
  background: var(--leaf);
  color: var(--ink);
  font: 38px/1 Jersey, 'Trebuchet MS', sans-serif;
  text-decoration: none; white-space: nowrap;
  text-shadow: 0 3px 0 var(--leaf-light);
  box-shadow: inset 0 5px 0 var(--leaf-light), inset 0 -8px 0 var(--leaf-dark);
  /* Notched corners read as pixels, not rounded UI. */
  clip-path: polygon(8px 0, calc(100% - 8px) 0, calc(100% - 8px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 8px, 100% 8px,
    100% calc(100% - 8px), calc(100% - 4px) calc(100% - 8px), calc(100% - 4px) calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) 100%,
    8px 100%, 8px calc(100% - 4px), 4px calc(100% - 4px), 4px calc(100% - 8px), 0 calc(100% - 8px),
    0 8px, 4px 8px, 4px 4px, 8px 4px);
  transition: transform .08s steps(2);
}
.play-button:hover { background: #86e86d; transform: translateY(-3px); }
.play-button:active { transform: translateY(4px); box-shadow: inset 0 3px 0 var(--leaf-dark), inset 0 -3px 0 var(--leaf-dark); }
.play-button:focus-visible { outline: none; background: #86e86d; text-decoration: underline 4px; text-underline-offset: 6px; }

.online-status {
  color: var(--cream);
  font: 22px/1.1 Jersey, 'Trebuchet MS', sans-serif;
  white-space: nowrap;
}
.online-status::before {
  content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 8px;
  background: #3fae3a; box-shadow: 0 0 0 2px #1d5c22; vertical-align: 2px;
  animation: blink 2s steps(1) infinite;
}
.online-status.is-offline::before { background: #8a8170; box-shadow: 0 0 0 2px #5b5446; animation: none; }

.event-sign {
  position: absolute; z-index: 2; top: 18px; left: 18px;
  max-width: 300px; padding: 10px 14px 12px;
  border: 3px solid var(--sign-edge);
  background: var(--sign);
  color: var(--sign-edge);
  font-size: 13px; line-height: 1.4;
  box-shadow: inset 0 -4px 0 #d8c08c, 0 5px 0 rgb(0 0 0 / .35);
  transform: rotate(-1.5deg);
}
.event-sign strong { display: block; font: 24px/1 Jersey, 'Trebuchet MS', sans-serif; color: #8a3b1c; margin-bottom: 4px; }

@keyframes blink { 50% { opacity: .35; } }

/* Intro + postcards */
.intro { padding: 30px 0 8px; text-align: center; }
.intro-text { font: 34px/1.1 Jersey, 'Trebuchet MS', sans-serif; color: var(--cream); }
.intro-note { margin-top: 6px; color: var(--muted); font-size: 13px; }

.postcards {
  list-style: none; padding: 30px 28px 34px; margin-top: 32px; margin-bottom: 56px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px;
  background: #3a8fc8;
  border: 4px solid var(--navy-deep);
  box-shadow: inset 0 4px 0 #5aaedf, inset 0 -6px 0 #2d76ab;
}
.postcard {
  padding: 8px 8px 0;
  border: 3px solid var(--sign-edge);
  background: var(--sign);
  box-shadow: 0 6px 0 rgb(15 44 77 / .55);
  transform: rotate(var(--tilt, -2deg));
  transition: transform .12s steps(3);
}
.postcard:nth-child(2) { --tilt: 1.5deg; }
.postcard:nth-child(3) { --tilt: -1deg; }
.postcard:nth-child(4) { --tilt: 2.2deg; }
.postcard:hover { transform: rotate(0) translateY(-6px) scale(1.03); }
.shot { display: block; aspect-ratio: 4 / 3; overflow: hidden; border: 2px solid var(--sign-edge); background: var(--navy-deep); }
/* Zoom past the HUD so each card shows the room itself. */
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.2); image-rendering: pixelated; }
.label { display: block; padding: 6px 0 8px; text-align: center; color: var(--sign-edge); font: 26px/1 Jersey, 'Trebuchet MS', sans-serif; }

/* Footer */
.site-footer {
  background: var(--navy-deep);
  border-top: 6px solid #24578c;
  color: var(--muted); font-size: 13px;
}
.footer-inner { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 16px; padding: 20px 0 28px; }
.footer-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 22px; }
.footer-links a, .help summary { font: 22px/1 Jersey, 'Trebuchet MS', sans-serif; color: var(--sign); text-decoration: none; }
.footer-links a:hover, .help summary:hover { color: var(--gold); }
.help { flex: 1; }
.help summary { width: fit-content; min-height: 32px; cursor: pointer; }
.help[open] { flex-basis: 100%; }
.help-content { max-width: 560px; padding: 2px 0 8px; }
.help-content h2 { margin: 14px 0 4px; font: 22px/1 Jersey, 'Trebuchet MS', sans-serif; color: var(--cream); }

@media (max-width: 860px) {
  .postcards { grid-template-columns: repeat(2, 1fr); gap: 22px; }
}

@media (max-width: 640px) {
  .topbar-inner { gap: 12px; min-height: 60px; }
  .brand img { width: 148px; height: auto; }
  .online-status { display: none; }
  .play-button { min-width: 0; min-height: 46px; padding: 2px 18px 8px; font-size: 30px; }
  .hero { height: clamp(220px, 52vw, 400px); }
  .hero { overflow: visible; }
  .event-sign { position: absolute; top: 100%; left: 0; right: 0; max-width: none; transform: none; box-shadow: none; border-width: 0 0 3px; text-align: center; padding: 6px 10px 8px; }
  .intro { padding-top: 76px; }
  .event-sign strong { font-size: 20px; }
  .intro-text { font-size: 28px; }
  .postcards { gap: 18px 14px; padding: 18px 14px 22px; }
  .label { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  .online-status::before { animation: none; }
  .hero canvas { transition: none; }
  .postcard, .play-button { transition: none; }
}

/* Rules and privacy pages */
.doc { max-width: 760px; padding: 32px 0 48px; text-align: left; }
.doc .logo { display: block; width: 160px; margin: 0 0 24px; image-rendering: pixelated; }
.doc h1 { font: 44px/1 Jersey, 'Trebuchet MS', sans-serif; margin-bottom: 14px; color: var(--leaf); }
.doc h2 { margin: 26px 0 6px; font: 26px/1 Jersey, 'Trebuchet MS', sans-serif; color: var(--gold); }
.doc ul, .doc ol { margin: 8px 0; padding-left: 22px; }
.doc li { margin: 6px 0; }
.doc a { color: var(--gold); text-underline-offset: 3px; }
.doc-links { margin-top: 32px; font-size: 13px; color: var(--muted); }
