/* 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;
}
