/* ---------------------------------------------------------------------------
 * The front page, over the shared chrome in site.css. The only hues on the
 * page are the ones that mean something: the live dot, and the clan pennants,
 * which are drawn by the very routine that draws them on the ground.
 * Everything else is ink on paper, which leaves the preview window the
 * brightest thing here — as it should be, being the only part that is
 * actually alive.
 * ------------------------------------------------------------------------- */

:root {
  --live: hsl(135, 65%, 40%);
  --shadow: 0 18px 50px -28px rgba(20, 24, 32, 0.45);
}

#authbar {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

#authbar form {
  margin: 0;
}

.authbar-name {
  font-weight: 600;
}

.authbar-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink-soft);
  text-decoration: none;
  text-underline-offset: 3px;
  cursor: pointer;
}

.authbar-link:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* --- hero ---------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  align-items: center;
  gap: clamp(28px, 5vw, 60px);
  padding: clamp(36px, 7vh, 74px) 0 clamp(40px, 8vh, 76px);
}

h1 {
  margin: 14px 0 0;
  font-family: var(--display);
  font-size: clamp(38px, 5.4vw, 62px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.lede {
  margin: 18px 0 0;
  max-width: 30em;
  color: var(--ink-soft);
  font-size: 16.5px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin: 30px 0 0;
}

.play {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 10px 24px -14px rgba(20, 24, 32, 0.8);
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.play:hover {
  background: #33384a;
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -14px rgba(20, 24, 32, 0.75);
}

.play:active {
  transform: translateY(0);
}

.play .arrow {
  transition: transform 0.16s ease;
}

.play:hover .arrow {
  transform: translateX(3px);
}

/* The online count is the one number in the hero, so it wears the live dot
 * instead of a heading. */
.online {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
}

.dot {
  position: relative;
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--live);
}

.dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--live);
  opacity: 0;
  animation: ping 2.4s ease-out infinite;
}

@keyframes ping {
  0% {
    opacity: 0.7;
    transform: scale(0.6);
  }
  70%,
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}

/* --- the live preview ---------------------------------------------- */
.window {
  display: grid;
  gap: 10px;
}

.preview {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 18px;
  border: 1px solid var(--hair);
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.preview iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* The whole window is a way in. It is untabbable and aria-hidden on
 * purpose: the Play button already says this in the tab order, and a
 * second identical link would only be read out twice. */
.preview-hit {
  position: absolute;
  inset: 0;
}

.preview-chip {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--hair);
  background: rgba(252, 252, 250, 0.86);
  backdrop-filter: blur(6px);
  pointer-events: none;
}

/* The caption sits under the frame rather than over the world: inside it,
 * it would have to be legible against whatever happens to walk past. */
.preview-cap {
  margin: 0;
  text-align: right;
  letter-spacing: 0.1em;
  opacity: 0.85;
}

/* Slides up over the window on hover, so the preview says out loud that it
 * is a door and not a screenshot. */
.preview-enter {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  margin: 0;
  padding: 16px 18px;
  background: linear-gradient(to top, rgba(252, 252, 250, 0.96), rgba(252, 252, 250, 0));
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.24s ease,
    opacity 0.24s ease;
}

.preview:hover .preview-enter {
  transform: translateY(0);
  opacity: 1;
}

/* --- the two panels ------------------------------------------------ */
.panels {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(30px, 5vw, 64px);
  padding-bottom: 48px;
}

/* --- what's next ---------------------------------------------------- */
.whats-next {
  padding: 0 0 clamp(30px, 6vh, 54px);
}

.whats-next .note a {
  text-decoration: none;
  text-underline-offset: 3px;
}

.whats-next .note a:hover {
  text-decoration: underline;
}

.next {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.next li {
  padding: 15px 16px 16px;
  border: 1px solid var(--hair);
  background: rgba(255, 255, 255, 0.55);
}

.next .lead {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.next li.now .lead {
  color: var(--live);
}

.next .name {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 8px 0 0;
  font-family: var(--display);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.15;
}

.next .when {
  display: block;
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

@media (max-width: 720px) {
  .next {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Section heading: a small-caps label with a rule running off to the
 * right — the field guide's own divider. */
.head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 4px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}

.head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hair);
}

.note {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 13.5px;
}

/* How to play: five rows, each a display numeral, a name, and a sentence
 * that is true of the actual game. */
.steps {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.steps li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 2px 12px;
  padding: 15px 0;
  border-top: 1px solid var(--hair-soft);
}

.steps li:first-child {
  border-top: 0;
  padding-top: 4px;
}

.steps .n {
  grid-row: span 2;
  font-family: var(--display);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.1;
  opacity: 0.36;
}

.steps h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.steps p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.55;
}

/* A cast word or a key, set apart from the prose: in this game the word IS
 * the spell, so it reads as something you type. */
kbd,
.word {
  padding: 1px 5px;
  border-radius: 5px;
  border: 1px solid var(--hair);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.92em;
  white-space: nowrap;
}

/* --- clan board ---------------------------------------------------- */
.board {
  margin: 0;
  padding: 0;
  list-style: none;
}

.board li {
  display: grid;
  grid-template-columns: 18px 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 3px 12px;
  padding: 11px 0;
  border-top: 1px solid var(--hair-soft);
}

.board li:first-child {
  border-top: 0;
}

.board .rank {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
}

.board canvas {
  display: block;
  width: 34px;
  height: 34px;
}

.board .clan {
  min-width: 0;
  overflow: hidden;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The bar runs under the name rather than in a column of its own, so a
 * long clan name never squeezes it to nothing. */
.board .bar {
  grid-column: 3;
  grid-row: 2;
  height: 2px;
  margin-top: 2px;
  border-radius: 2px;
  background: var(--hair-soft);
}

.board .bar i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--ink);
  opacity: 0.45;
  transition: width 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.board .held {
  color: var(--ink-soft);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.board .held b {
  color: var(--ink);
  font-weight: 600;
}

.empty {
  margin: 0;
  padding: 20px 0;
  border-top: 1px dashed var(--hair);
  color: var(--ink-soft);
  font-size: 14px;
}

.empty[hidden] {
  display: none;
}

/* The board is short by nature — a handful of clans, often none — so the
 * column carries the one thing worth knowing about what it is counting. */
.foot-note {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--hair-soft);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}

/* --- buy coins ----------------------------------------------------- */
/* One paid thing on the page, and it is the game's own currency, so it is
 * dressed as another entry in the field guide rather than as a donate
 * banner: same hairline card, same ink, and the only gold on the page is
 * the coin itself — drawn with the very CSS the HUD's coin counter uses. */
.coins {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px 32px;
  padding: 22px 24px;
  margin: 0 0 56px;
  border: 1px solid var(--hair);
  border-radius: 18px;
  background: #fff;
}

.coins p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.55;
}

.coins p b {
  color: var(--ink);
}

.coins .fine {
  margin: 6px 0 0;
  font-size: 12.5px;
  opacity: 0.8;
}

.buy {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 22px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.16s ease,
    color 0.16s ease;
}

.buy:hover {
  background: var(--ink);
  color: #fff;
}

/* The HUD's coin, verbatim (see play.html): a player who has seen one in
 * the corner of the game should recognise this as the same object. */
.coin-glyph {
  width: 15px;
  height: 15px;
  flex: none;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 35%,
    hsl(45, 92%, 80%),
    hsl(45, 82%, 56%) 55%,
    hsl(44, 78%, 44%)
  );
  box-shadow:
    inset 0 0 0 2px hsl(44, 78%, 44%),
    0 0 0 1.5px hsl(42, 72%, 30%);
}

/* --- follow -------------------------------------------------------- */
/* The same hairline card as the coins offer below it, because it is the
 * same kind of entry: one line about somewhere else worth going, and the
 * way to get there. The platform marks ride the page's ink and only take
 * their own color under the cursor — at rest they are two more glyphs in
 * a field guide rather than two logos parked on top of one. */
.follow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px 32px;
  padding: 22px 24px;
  margin: 0 0 18px;
  border: 1px solid var(--hair);
  border-radius: 18px;
  background: #fff;
}

.follow p {
  margin: 8px 0 0;
  max-width: 40em;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.55;
}

.channels {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Outlined like the coins button, but it does not invert on hover: two
 * solid ink slabs side by side would outweigh the one paid thing on the
 * page. It warms to the platform's own color instead. */
.channel {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease;
}

.channel svg {
  display: block;
  flex: none;
  color: var(--ink-soft);
  transition: color 0.16s ease;
}

.channel:hover {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--hair));
  background: color-mix(in srgb, var(--brand) 7%, #fff);
  transform: translateY(-1px);
}

.channel:hover svg {
  color: var(--brand);
}

.channel:active {
  transform: translateY(0);
}

.channel.tiktok {
  --brand: #fe2c55;
}

.channel.youtube {
  --brand: #f00;
}

/* --- entrance ------------------------------------------------------ */
/* One staggered reveal on load. Nothing else on the page moves by itself
 * but the live dot: the preview is this page's animation. */
.rise {
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero .window {
  animation-delay: 0.1s;
}

.panels > :first-child {
  animation-delay: 0.16s;
}

.panels > :last-child {
  animation-delay: 0.22s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* --- narrow -------------------------------------------------------- */
@media (max-width: 880px) {
  .hero,
  .panels {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero {
    padding-top: 26px;
    gap: 30px;
  }

  .preview {
    aspect-ratio: 4 / 3;
  }

  .panels {
    gap: 40px;
  }

  .coins,
  .follow {
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
  }
}
