/* The home pages (signed out: the way in; an admin's: the box for any
   player), after the game page: game.css's colours and body, then a centred
   column under the emblem (a minimap's diamond, bronze-edged). */
.home {
  max-width: 34rem;
  margin: 0 auto;
  padding: 2rem 1rem 2rem;
  text-align: center;
}
/* with the demo, the page is wider; the rest keeps its column */
.home:has(.demo) { max-width: 60rem; }
.home-hero, .home-card, .home-features { max-width: 34rem; margin-left: auto; margin-right: auto; }
.home-hero { margin-bottom: 1.75rem; }
.emblem { display: block; width: 7rem; height: 7rem; margin: 0 auto 1rem; }
.home-hero h1 {
  margin: 0;
  font: 600 2.4rem/1.15 Georgia, "Times New Roman", serif;
  letter-spacing: 0.06em;
  color: var(--gold);
}
.home-hero h1 span { color: var(--ink); }
.tagline { margin: 0.6rem auto 0; max-width: 26rem; color: var(--ink-muted); }

.home-card {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-top: 2px solid var(--gold);
  border-radius: 4px;
  padding: 1.5rem 1.25rem 1.25rem;
  margin-bottom: 2rem;
}
.home-card p { margin: 0; }
/* signed out: what signing in gives, over Steam's own button (and Xbox's) */
.card-head {
  margin: 0 0 0.4rem;
  font: 600 1.3rem/1.3 Georgia, "Times New Roman", serif;
  letter-spacing: 0.03em;
  color: var(--ink);
}
.card-lead { color: var(--ink-muted); }
.steam-cta { margin-top: 1.1rem !important; }
.cta .steam-in, .cta .xbox-in { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; }
/* Steam's and Xbox's buttons side by side, as tall as each other; stacked when narrow */
.home-card .cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
.cta .steam-logo, .cta .xbox-logo { width: 1.35rem; height: 1.35rem; flex: none; }
/* as wide as each other, stacked or side by side */
.home-card .cta .steam-in, .home-card .cta .xbox-in { min-width: 19rem; box-sizing: border-box; }
.home-card .note { margin-top: 1rem; color: var(--ink-muted); font-size: 0.85rem; }
.home-card .error { color: var(--defeat); margin-bottom: 1rem; }
.home-card form { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin-top: 1.25rem; }
.home-card label { display: flex; flex-direction: column; gap: 0.3rem; text-align: left; font-size: 0.8rem; color: var(--ink-muted); }
.home-card input {
  background: var(--page);
  color: var(--ink);
  border: 1px solid var(--panel-edge);
  border-radius: 3px;
  padding: 0.5rem 0.6rem;
  font: inherit;
}
.home-card input:focus { outline: none; border-color: var(--gold); }
.home-card form button { align-self: flex-end; }

/* the one thing to do: gold on dark, like the game's menu buttons */
.cta a, .home button {
  display: inline-block;
  background: linear-gradient(to bottom, #2a2418, #1b1710);
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 3px;
  padding: 0.7rem 1.6rem;
  font: 600 0.9rem/1.2 system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(214, 178, 94, 0.25), 0 2px 6px rgba(0, 0, 0, 0.4);
}
.home button { padding: 0.55rem 1.1rem; font-size: 0.78rem; }
.cta a:hover, .home button:hover { text-decoration: none; background: #332b1b; color: var(--gold); }
.cta a:focus-visible, .home button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* what a game's page has: gold diamonds, as the game page's section heads */
.home-features { list-style: none; margin: 0 auto; padding: 0; text-align: left; display: grid; gap: 0.9rem; }
.home-features li { display: grid; grid-template-columns: 0.45rem 1fr; column-gap: 0.85rem; }
.home-features li::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  margin-top: 0.45rem;
  background: var(--gold);
  transform: rotate(45deg);
}
.home-features b { display: block; color: var(--ink); font: 600 0.82rem/1.5 system-ui, sans-serif; text-transform: uppercase; letter-spacing: 0.1em; }
.home-features span { color: var(--ink-muted); font-size: 0.9rem; }

/* The demo (static/home.js): the game's replay looping beside each team's
   chance to win, a line at the moment the replay shows. */
.demo { margin: 0 0 2.25rem; text-align: left; }
.demo-body {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 4px;
  padding: 1rem;
}
.demo-clip { min-width: 0; }
.demo-title { margin: 0 0 0.6rem; font: 600 1.15rem/1.3 Georgia, "Times New Roman", serif; color: var(--gold); }
.demo-title span { color: var(--ink-muted); font: 400 0.9rem system-ui, sans-serif; margin-left: 0.4rem; }
.demo-chance svg { display: block; width: 100%; height: auto; }
.demo-chance[hidden] { display: none; }
.dc-grid { stroke: var(--rule); stroke-width: 1; }
.dc-even { stroke-dasharray: 3 3; }
.dc-axis { fill: var(--ink-muted); font: 9px system-ui, sans-serif; }
.dc-line { fill: none; stroke-width: 2; stroke-linejoin: round; }
.dc-mark { stroke: var(--gold); stroke-width: 1; opacity: 0.8; }
.dc-legend { list-style: none; margin: 0.5rem 0 0; padding: 0; font-size: 0.85rem; }
.dc-legend li { display: flex; align-items: center; gap: 0.5rem; padding: 0.15rem 0; }
.dc-swatch { flex: none; width: 0.7rem; height: 0.7rem; border-radius: 2px; }
.dc-civs { flex: 1; min-width: 0; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-now { color: var(--ink); font-variant-numeric: tabular-nums; }
.demo-caption { margin: 0.75rem 0 0; color: var(--ink-muted); font-size: 0.85rem; }
.demo-more { margin: 0.9rem 0 0; }
.demo-more a { font-weight: 600; }
.demo-more a::after { content: "\00a0\2192"; }

/* the peek at the match stats: three tiles under the demo, each a small
   chart (static/home.js) leading to the demo's page */
.peeks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.peeks[hidden] { display: none; }
.peek {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 4px;
  padding: 0.85rem 1rem 1rem;
  color: var(--ink);
  transition: border-color 0.15s;
}
.peek:hover { text-decoration: none; border-color: var(--gold); }
.peek b { color: var(--gold); font: 600 0.78rem/1.3 system-ui, sans-serif; text-transform: uppercase; letter-spacing: 0.12em; }
.peek-chart svg { display: block; width: 100%; height: auto; }
.peek-about { color: var(--ink-muted); font-size: 0.85rem; }
.pk-base { stroke: var(--rule); stroke-width: 1; }
.pk-area { opacity: 0.07; }
.pk-line { fill: none; stroke-width: 1.8; stroke-linejoin: round; }
.demo .cta.demo-more { margin: 1.5rem 0 0; text-align: center; }

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

@media (max-width: 640px) {
  .home { padding-top: 3.5rem; }
  .home-hero h1 { font-size: 2rem; }
}

/* A message (an error, a refusal): the emblem smaller, over a card with the
   message and the way home. */
.home-msg .home-hero a { display: inline-block; text-decoration: none; }
.home-msg .emblem { width: 4rem; height: 4rem; margin-bottom: 0.6rem; }
.home-msg .home-hero h1 { font-size: 1.6rem; }
.home-msg .message { margin-bottom: 1.25rem; font-size: 1.05rem; }

/* The settings page (pages.rs settings): one card, each setting a checkbox
   beside what it does, the button under them. */
.settings form { flex-direction: column; align-items: stretch; gap: 1.25rem; }
.settings .saved { color: var(--up); margin: 0.5rem 0 0; }
.home-card label.setting { flex-direction: row; align-items: flex-start; gap: 0.75rem; font-size: 0.95rem; color: var(--ink); cursor: pointer; }
.home-card .setting input { width: 1.1rem; height: 1.1rem; margin: 0.15rem 0 0; padding: 0; accent-color: var(--gold); flex: none; }
.setting b { display: block; }
.setting-about { display: block; margin-top: 0.2rem; color: var(--ink-muted); font-size: 0.85rem; }
.home-card.settings form button { align-self: center; }
/* the viewer's roles, small gold-edged tags under the heading */
.settings .roles { display: flex; justify-content: center; gap: 0.4rem; margin-top: 0.4rem; }
.settings .role {
  border: 1px solid var(--gold);
  border-radius: 3px;
  color: var(--gold);
  padding: 0.1rem 0.5rem;
  font: 600 0.68rem/1.4 system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* The privacy and terms page (pages.rs privacy): one card of plain text. */
.home-card.legal { max-width: 40rem; text-align: left; }
.legal .card-head { text-align: center; margin-bottom: 0.5rem; }
.legal h2 { margin: 1.25rem 0 0.4rem; font: 600 1rem/1.3 Georgia, "Times New Roman", serif; color: var(--gold); }
.home-card.legal p { margin: 0 0 0.6rem; line-height: 1.5; font-size: 0.92rem; }
.legal code { color: var(--ink); font-size: 0.85rem; }
/* deleting the account: its own card under the settings, edged in the defeat colour */
.home-card.delete-account { border-top-color: var(--defeat); }
.delete-account .card-head { font-size: 1.05rem; }
.delete-account .setting-about { margin-top: 0.4rem; }
.home-card.delete-account form { margin-top: 1rem; }
.delete-account button { color: var(--defeat); border-color: var(--defeat); }

/* Feedback (pages.rs feedback_card, admin_feedback): the conversation as a
   list, the player's messages edged in the muted rule, the answers in gold;
   the form's box as wide as the card. */
.home-card.feedback { text-align: left; }
.feedback .card-head, .home-settings > .card-head { text-align: center; }
.home-settings > .fb-count { text-align: center; margin-bottom: 1rem; }
.fb-messages { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.fb-msg { border-left: 3px solid var(--rule); padding: 0.25rem 0 0.25rem 0.75rem; }
.fb-msg.fb-admin { border-left-color: var(--gold); }
.home-card .fb-meta { color: var(--ink-muted); font-size: 0.78rem; margin-bottom: 0.2rem; }
.fb-admin .fb-meta b { color: var(--gold); }
.home-card .fb-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; font-size: 0.92rem; }
.home-card .fb-about { color: var(--ink-muted); font-size: 0.85rem; }
.feedback .saved, .feedback .error { margin: 1rem 0 0 !important; }
.feedback label { width: 100%; }
.home-card textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--page);
  color: var(--ink);
  border: 1px solid var(--panel-edge);
  border-radius: 3px;
  padding: 0.5rem 0.6rem;
  font: inherit;
  font-size: 0.92rem;
  resize: vertical;
}
.home-card textarea:focus { outline: none; border-color: var(--gold); }
.fb-id { color: var(--ink-muted); font: 0.8rem system-ui, sans-serif; margin-left: 0.4rem; }
.fb-waiting {
  margin-left: 0.6rem;
  border: 1px solid var(--gold);
  border-radius: 3px;
  color: var(--gold);
  padding: 0.05rem 0.45rem;
  font: 600 0.65rem/1.4 system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  vertical-align: middle;
}
