/* THE LANDING — INTERIM.
 *
 * Deliberately plain while the studied entry-page design is written. The live
 * field is behind, the name and the two doors are on top, and that is all.
 *
 * Layering law (learned the hard way on /play): the world layer NEVER takes
 * pointer events. A transparent div over a live sim frame is how you ship a
 * page where the clicks land on a parent div and the game never gets focus.
 * Only the doors, the strip and the invitation are interactive.
 *
 * Nothing here restyles, moves, crops or hides any part of the embedded
 * viewer. It is shown exactly as it ships.
 */

:root {
  /* Sampled from the game's own art, so the page and the board agree:
     soldier_red.png -> #ff746c, soldier_blue.png -> #74a8ff. */
  --red: #ff746c;
  --blue: #74a8ff;

  --ground: #100c0b;       /* warm paint-dark, never #000 */
  --ink: #f2e7dc;          /* warm paper-white, never #fff */
  --ink-dim: #a2938a;
  --ink-faint: #6b5f59;
  --hair: rgba(242, 231, 220, 0.13);

  --serif: "EB Garamond", Georgia, serif;
  --sans: "Merriweather Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* Small caps chrome — hierarchy from weight and spacing, not from boxes. */
.caps {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------- the world */

.world {
  position: fixed;
  inset: 0;
  pointer-events: none;            /* load-bearing — see the layering law */
  transition: opacity 620ms ease, filter 620ms ease;
}

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

/* Full frame, no crop, no transform: the viewer decides what the viewer looks
   like. */
.board iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: transparent;
}

/* Just enough tone at the edges for the chrome to be readable over the board. */
.scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(16, 12, 11, 0.86) 0, rgba(16, 12, 11, 0) 16%),
    linear-gradient(to top, rgba(16, 12, 11, 0.86) 0, rgba(16, 12, 11, 0) 14%);
}

/* --------------------------------------------------------------- the name */

/* Type, not a logotype. The real plate asset belongs to the new design.
   It rides in the footer because the top-left corner belongs to the viewer. */
.plate {
  display: flex;
  align-items: baseline;
  gap: 11px;
  margin-right: 6px;
}
.wordmark {
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.95);
}
.plate .season { color: var(--ink-dim); text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9); }

/* ------------------------------------------------------------- the doors */

.doors {
  position: fixed;
  top: 20px; right: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 3;
}

.quiet {
  color: var(--ink-dim);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
  transition: color 150ms, border-color 150ms;
}
.quiet:hover { color: var(--ink); border-bottom-color: var(--hair); }

/* The one loud thing on the page. */
.play {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #1a0f0d;
  background: #ffb27a;
  border: 0;
  padding: 13px 30px;
  cursor: pointer;
  transition: background 130ms ease, transform 130ms ease;
}
.play:hover { background: #ffc79a; }
.play:active { transform: translateY(1px); }

/* ------------------------------------------------------------- the strip */

.strip {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 0 24px 18px;
  color: var(--ink-faint);
  z-index: 3;
}
.strip .left { display: flex; align-items: baseline; gap: 11px; min-width: 0; }
.strip .left, .strip .right, .strip .plate { text-shadow: 0 1px 8px rgba(0, 0, 0, 0.95); }
.strip .left { padding-left: 12px; border-left: 1px solid var(--hair); }
.strip .right { margin-left: auto; }

.dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink-faint);
  transform: translateY(-1px);
}
.dot.live { background: #7bd88f; box-shadow: 0 0 9px rgba(123, 216, 143, 0.85); }

.keylink {
  background: none;
  border: 0;
  color: var(--ink-faint);
  cursor: pointer;
  font-family: var(--sans);
  padding: 0;
}
.keylink:hover { color: var(--ink-dim); }

/* ------------------------------------------------------------ the controls */

.keys-pop {
  position: fixed;
  right: 22px;
  bottom: 52px;
  width: 340px;
  max-width: calc(100vw - 44px);
  padding: 16px 18px 6px;
  background: rgba(20, 15, 14, 0.97);
  border: 1px solid var(--hair);
  z-index: 4;
}
.keys-pop h3 { margin: 0 0 3px; font-size: 13px; color: var(--ink); }
.keys-pop .note { margin: 0 0 10px; font-size: 11px; color: var(--ink-faint); }
.keys-pop .keys > div {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 9px;
  align-items: baseline;
  padding: 5px 0;
  font-size: 12px;
  color: var(--ink-dim);
  border-top: 1px solid rgba(242, 231, 220, 0.06);
}
.keys-pop .keys > div:first-child { border-top: 0; }
.keys-pop .keys .inactive { opacity: 0.45; }
.keys-pop kbd {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink);
}
.keys-pop .chip { display: none; }
.keys-pop .keys .inactive span:last-child { display: inline; font-size: 10px; }

/* ------------------------------------------------------- the drop-in moment */

/* Clicking PLAY takes the world down to near-black and leaves one invitation
   standing in the middle of it. */
body.dropping .world { opacity: 0.09; filter: saturate(0.5); }
body.dropping .plate,
body.dropping .doors,
body.dropping .strip { opacity: 0.1; pointer-events: none; }
.plate, .doors, .strip { transition: opacity 620ms ease; }

.dropin {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 520ms ease;
}
.dropin.on { opacity: 1; pointer-events: auto; }
.dropin[hidden] { display: none; }

.invite { width: min(600px, calc(100vw - 48px)); text-align: center; }

.invite .eyebrow { color: var(--ink-faint); }
.invite h1 {
  margin: 16px 0 0;
  font-family: var(--serif);
  font-variant: small-caps;
  font-weight: 500;
  font-size: 68px;
  line-height: 1;
  letter-spacing: 0.02em;
  color: #f6ecdf;
}
.invite .lines {
  margin: 18px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  line-height: 1.55;
  color: #b3a397;
}

/* The name beat. Free play cannot honour a typed name — the roster is baked
   into the config when the match boots, long before you arrive — so this hands
   you the one already painted on the cog, and the same rule that picks it here
   is the rule that seats you. */
.invite .cog {
  margin: 34px auto 0;
  min-height: 58px;              /* reserved so the reveal does not shift the page */
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(242, 231, 220, 0.3);
  font-family: var(--serif);
  font-size: 38px;
  line-height: 1;
  color: #f6ecdf;
}
.invite .cog.waiting { color: #6b5f59; font-style: italic; font-size: 26px; }
.invite .cog .crewdot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-right: 13px;
  transform: translateY(-9px);
}
.invite .caption { margin: 10px 0 0; color: var(--ink-faint); }

.walkon {
  display: block;
  margin: 44px auto 0;
  background: none;
  border: 0;
  border-bottom: 1px solid rgba(242, 231, 220, 0.55);
  padding: 0 6px 8px;
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #f6ecdf;
  cursor: pointer;
  transition: color 150ms, border-color 150ms, letter-spacing 220ms;
}
.walkon:hover { letter-spacing: 0.36em; border-bottom-color: #f6ecdf; }
.walkon:disabled { opacity: 0.4; cursor: default; letter-spacing: 0.3em; }

/* A focus ring that belongs to this page — visible, but not a blue box in the
   middle of a warm near-black invitation. */
.walkon:focus-visible,
.invite .back:focus-visible,
.quiet:focus-visible,
.play:focus-visible,
.keylink:focus-visible {
  outline: none;
  box-shadow: 0 3px 0 -1px #ffb27a, 0 0 22px rgba(255, 178, 122, 0.45);
}

.invite .honest {
  margin: 30px auto 0;
  max-width: 46ch;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: #6b5f59;
}
.invite .back {
  display: block;
  margin: 34px auto 0;
  background: none; border: 0;
  color: #554944;
  cursor: pointer;
  font-family: var(--sans);
}
.invite .back:hover { color: var(--ink-dim); }

/* The hand-off to /play: fade the page out so the navigation does not flash a
   fresh document in the middle of the moment. */
body.leaving { background: #000; }
body.leaving .dropin, body.leaving .world { opacity: 0; }

/* ------------------------------------------------------------------ narrow */

@media (max-width: 900px) {
  .plate { gap: 9px; }
  .wordmark { font-size: 19px; }
  .doors { top: 14px; right: 14px; gap: 13px; }
  .play { padding: 11px 20px; font-size: 10px; letter-spacing: 0.16em; }
  .strip { padding: 0 14px 14px; flex-wrap: wrap; row-gap: 7px; }
  .strip .plate { width: 100%; margin-right: 0; }
  .strip .left { padding-left: 0; border-left: 0; }
  .invite h1 { font-size: 42px; }
  .invite .lines { font-size: 16px; }
  .invite .cog { font-size: 28px; min-height: 46px; }
  .keys-pop { right: 12px; left: 12px; width: auto; bottom: 46px; }
}

@media (max-width: 560px) {
  .wordmark { font-size: 19px; }
  .plate .season { display: none; }   /* the title carries it at this width */
  .invite h1 { font-size: 36px; }
  .invite .cog { font-size: 24px; min-height: 40px; }
  .walkon { font-size: 15px; margin-top: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: 1ms !important; }
}
