/* Footlife's look, taken from src/ui/theme.ts and StadiumBackdrop: navy ink outlines, a pitch-green
   glass frame around a pale plate, cream raised buttons, lime for the selected state and tags, and
   the game's day sky behind. The game has no dark palette; dark mode here is its night sky. */
:root {
  color-scheme: light dark;
  --sky-top: #bfddf8;
  --sky-bottom: #fff1ce;
  --ink: #2b2f63;
  --muted: #3f4466;
  --outline: #2b2f63;
  --glass: #a8e0be;
  --rim: #d6f5e0;
  --lip: #6bb88a;
  --plate: #eafaee;
  --link: #2a4a88;
  --tag: #c8f06a;
  --tag-ink: #2f4a0a;
  --button: #fff5d7;
  --button-lip: #e6dcc0;
  --button-on: #ddf5a3;
  --button-on-lip: #c8dc93;
  --button-outline: #515773;
  --button-ink: #2b2f63;
}

@media (prefers-color-scheme: dark) {
  :root {
    --sky-top: #414575;
    --sky-bottom: #7f9bc7;
    --ink: #eef1ff;
    --muted: #cbd5f8;
    --outline: #15173a;
    --glass: #38785c;
    --rim: #4f9a77;
    --lip: #27503f;
    --plate: #23264f;
    --link: #c8f06a;
  }
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--sky-bottom) linear-gradient(var(--sky-top), var(--sky-bottom)) no-repeat;
  -webkit-text-size-adjust: 100%;
}

body {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.75rem 0.75rem 3rem;
  color: var(--ink);
  /* No CJK font is named: with `lang` set on <html> and on each language link, system-ui and
     sans-serif fall back to the platform's own Japanese and Korean faces. */
  font:
    500 1.0625rem/1.65 ui-rounded,
    'SF Pro Rounded',
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
  overflow-wrap: break-word;
}

.top {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 0.5rem;
}

.icon {
  flex: none;
  width: 72px;
  height: 72px;
  border: 2px solid var(--outline);
  border-radius: 18px;
  box-shadow: 0 4px 0 var(--outline);
}

.game {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

/* Long title words (French, German, Russian) must fit beside the icon at 320px, and the Japanese
   title must break between its two words: strict line breaking keeps `ー` off a line start. */
.top div {
  min-width: 0;
}

h1 {
  margin: 0;
  font-size: clamp(1.5rem, 7vw, 2rem);
  font-weight: 800;
  line-height: 1.15;
  hyphens: auto;
  line-break: strict;
  text-wrap: balance;
}

/* Korean reads better broken between words than inside them. */
:lang(ko) {
  word-break: keep-all;
}

/* Language links are the game's raised control: pastel face, slate outline, a lip inside the
   bottom edge that the face settles onto when pressed. Thirteen of them wrap onto five rows at
   320px, three to a row, so they are kept compact and use the full width. */
.langs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.5rem 0 1rem;
}

.langs a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 0.7rem 3px;
  border: 2px solid var(--button-outline);
  border-radius: 999px;
  background: var(--button);
  box-shadow: inset 0 -3px 0 var(--button-lip);
  color: var(--button-ink);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.langs a[aria-current] {
  background: var(--button-on);
  box-shadow: inset 0 -3px 0 var(--button-on-lip);
}

.langs a:active {
  padding: 3px 0.7rem 0;
  box-shadow: none;
}

/* The pale plate that long copy sits on, inside a 7px glass frame with its paler inner rim. */
.panel {
  padding: calc(9px + clamp(0.9rem, 4vw, 2rem));
  border: 2px solid var(--outline);
  border-radius: 22px;
  background: var(--plate);
  box-shadow:
    inset 0 -4px 0 var(--lip),
    inset 0 0 0 7px var(--glass),
    inset 0 0 0 9px var(--rim);
}

.updated {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.updated time {
  white-space: nowrap;
}

/* Tags are flat on purpose: nothing here is tappable. */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.tags li {
  margin: 0;
  padding: 0.15rem 0.75rem;
  border-radius: 999px;
  background: var(--tag);
  color: var(--tag-ink);
  font-size: 0.9rem;
  font-weight: 700;
}

h2 {
  margin: 2.2rem 0 0.6rem;
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.25;
}

p,
ul {
  margin: 0 0 1rem;
}

ul {
  padding-left: 1.25rem;
}

li {
  margin: 0.3rem 0;
}

a {
  color: var(--link);
  font-weight: 600;
  text-underline-offset: 2px;
}

a:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 2px;
}

hr {
  margin: 2.5rem 0 1.25rem;
  border: 0;
  border-top: 2px solid var(--glass);
}

footer {
  color: var(--muted);
  font-size: 0.95rem;
}

footer p:last-child {
  margin-bottom: 0;
}

/* ---- Home page. Layout follows the usual app landing: a bar, a hero with the pitch and a picture of
   the game beside it, how a season plays, then what a career holds. Same tokens as the policy. ---- */
:root {
  --card: #cdd6ff;
  --card-lip: #a9b4ec;
  --story-ink: #2b2f63;
}

body.home {
  max-width: 68rem;
  padding: 1rem 1rem 3rem;
}

.home h1 {
  font-size: clamp(2rem, 7vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.home h2 {
  margin: 0 0 1.25rem;
  font-size: clamp(1.5rem, 4.5vw, 2.1rem);
  text-align: center;
  text-wrap: balance;
}

.home h3 {
  margin: 0.5rem 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.25;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.95rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand img {
  border: 2px solid var(--outline);
  border-radius: 11px;
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 2rem;
  padding: 3rem 0 0;
}

.kicker {
  margin: 0 0 0.6rem;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.lede {
  max-width: 34rem;
  margin: 1.1rem 0 1.4rem;
  font-size: 1.15rem;
}

/* Flat on purpose until the listing exists: it reads as a label, not a button. */
.soon {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.45rem 1rem;
  border: 2px dashed var(--outline);
  border-radius: 999px;
  font-weight: 800;
}

/* The phone: a dark rounded frame around the game's sky, with a story card and its two answers.
   It is a picture, so nothing in it reacts to the pointer. */
.phone {
  justify-self: center;
  width: min(100%, 300px);
  margin: 0;
  padding: 10px;
  border-radius: 44px;
  background: var(--outline);
  box-shadow: 0 18px 40px rgb(43 47 99 / 0.25);
  pointer-events: none;
  user-select: none;
}

.screen {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  min-height: 460px;
  padding: 2.4rem 0.9rem 1.2rem;
  border-radius: 35px;
  background: linear-gradient(#bfddf8, #fff1ce);
  color: var(--story-ink);
}

.chip {
  align-self: center;
  margin: 0;
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  background: var(--tag);
  color: var(--tag-ink);
  font-size: 0.8rem;
  font-weight: 800;
}

.story {
  flex: 1;
  padding: 1rem;
  border: 2px solid #2b2f63;
  border-radius: 20px;
  background: var(--card);
  box-shadow: inset 0 -4px 0 var(--card-lip);
  font-size: 0.92rem;
  line-height: 1.45;
  text-align: center;
}

.story img {
  display: block;
  margin: 0.25rem auto 0.5rem;
}

.story-title {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
  font-weight: 800;
}

.story p:last-child {
  margin: 0;
}

.answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.answers span {
  padding: 0.6rem 0.4rem 0.8rem;
  border: 2px solid #515773;
  border-radius: 16px;
  background: #fff5d7;
  box-shadow: inset 0 -3px 0 #e6dcc0;
  font-size: 0.85rem;
  font-weight: 800;
  text-align: center;
}

/* The game's stadium closes the hero; the sky fades into it. */
.stadium {
  aspect-ratio: 853 / 470;
  margin: -1.5rem -1rem 0;
  background: url('/img/stadium.webp') center top / 100% auto no-repeat;
}

.steps,
.features {
  margin-top: 3.5rem;
}

.steps ol {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  margin: 0;
  padding: 1.25rem;
  border: 2px solid var(--outline);
  border-radius: 22px;
  background: var(--plate);
  box-shadow: inset 0 -4px 0 var(--lip);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--tag);
  color: var(--tag-ink);
  font-weight: 800;
}

.steps p,
.grid p {
  margin: 0;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.grid article {
  padding: calc(9px + 1.1rem);
  border: 2px solid var(--outline);
  border-radius: 22px;
  background: var(--plate);
  box-shadow:
    inset 0 -4px 0 var(--lip),
    inset 0 0 0 7px var(--glass),
    inset 0 0 0 9px var(--rim);
}

.foot {
  margin-top: 3.5rem;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.foot .langs {
  justify-content: center;
}

@media (max-width: 760px) {
  /* The footer carries the policy link; the bar keeps the name on one line. */
  .bar > a:last-child {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 2rem;
    text-align: center;
  }

  .lede {
    margin-inline: auto;
  }

  .hero .tags {
    justify-content: center;
  }

  .steps ol,
  .grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 761px) and (max-width: 980px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
