/* Ironway's legal and support pages. The colours, radii and lettering are the game's own
   (Ironway/DesignSystem/Theme.swift): a dark navy stage, gold captions, glass cards. */

:root {
  color-scheme: dark;
  --background: #0d1429;
  --ink: #050a17;
  --surface: #1a2645;
  --surface-raised: #26365c;
  --gold: #f5b842;
  --gold-light: #ffe08c;
  --gold-deep: #cc8c24;
  --text: #f4f6fb;
  --soft: #a9b4cc;
  --line: rgba(255, 255, 255, 0.14);
  --regional: #73bff2;
  --express: #f59e42;
  --highspeed: #e65c9e;
  --radius-card: 18px;
  --gutter: 16px;
}

* { box-sizing: border-box; }

html { background: var(--ink); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: linear-gradient(180deg, var(--background) 0, var(--ink) 100%) fixed;
  font: 17px/1.6 system-ui, -apple-system, "Hiragino Sans", "Apple SD Gothic Neo", "PingFang TC", "Segoe UI", sans-serif;
}

a { color: var(--gold-light); text-underline-offset: 3px; }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

/* The wide, heavy lettering of the game's panel titles. */
.title, h1, h2, .brand span, .tabs a {
  font-family: system-ui, -apple-system, "Hiragino Sans", "Segoe UI", sans-serif;
  font-weight: 800;
  font-stretch: 125%;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
:lang(ja) h1, :lang(ja) h2, :lang(ja) .tabs a { letter-spacing: 0.06em; }

/* ---- The header: the station at dusk, fading into the stage ---- */

.hero {
  position: relative;
  isolation: isolate;
  padding: 20px var(--gutter) 120px;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("hero.jpg") 72% 100% / cover no-repeat;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(13, 20, 41, 0.55) 0, rgba(13, 20, 41, 0) 45%, rgba(13, 20, 41, 0.2) 70%, var(--background) 100%);
}
.hero-inner { width: 100%; max-width: 760px; margin: 0 auto; flex: 1; display: flex; flex-direction: column; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: rgba(5, 10, 23, 0.72);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-size: 0.82rem;
}
.brand img { width: 32px; height: 32px; border-radius: 9px; display: block; }

.hero h1 {
  margin: 28px 0 0;
  font-size: clamp(1.7rem, 6.4vw, 2.9rem);
  line-height: 1.08;
  text-wrap: balance;
  text-shadow: 0 2px 18px rgba(5, 10, 23, 0.8);
}
.hero .meta {
  margin: 10px 0 0;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  font-stretch: 125%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(5, 10, 23, 0.9);
}
.hero .lead {
  margin: 12px 0 0;
  max-width: 34rem;
  color: var(--text);
  text-shadow: 0 1px 12px rgba(5, 10, 23, 0.9);
}

/* ---- The tab strip, as under the game's sheets ---- */

.tabs-wrap { position: sticky; top: 0; z-index: 5; padding: 10px var(--gutter); background: linear-gradient(180deg, var(--background) 70%, rgba(13, 20, 41, 0)); }
.tabs {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  gap: 4px;
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  border-radius: 999px;
  background: var(--ink);
  border: 1px solid var(--line);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: 1 0 auto;
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--soft);
  font-size: 0.7rem;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] {
  color: var(--ink);
  background: linear-gradient(180deg, var(--gold-light), var(--gold) 55%, var(--gold-deep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* ---- Cards ---- */

main { max-width: calc(760px + 2 * var(--gutter)); margin: 0 auto; padding: 6px var(--gutter) 40px; display: grid; gap: 12px; }

.card {
  padding: 18px 18px 16px;
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(38, 54, 92, 0.72), rgba(26, 38, 69, 0.72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 30px rgba(5, 10, 23, 0.35);
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card h2 { margin: 0 0 10px; color: var(--gold); font-size: 0.86rem; line-height: 1.35; }
.card p, .card ul { margin: 10px 0; color: var(--soft); }
.card strong { color: var(--text); font-weight: 650; }
.card ul { padding: 0; list-style: none; }
.card li { position: relative; padding-left: 22px; margin: 8px 0; }
.card li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid var(--gold);
}

/* The short version: a line with three stations, in the game's three rail colours. */
.route { padding-left: 4px; }
.card .route li { padding-left: 30px; margin: 0; padding-bottom: 14px; color: var(--text); }
.card .route li:last-child { padding-bottom: 0; }
.card .route li::before { left: 0; top: 0.42em; width: 13px; height: 13px; border: 3px solid var(--regional); background: var(--ink); z-index: 1; }
.card .route li::after { content: ""; position: absolute; left: 5px; top: 0.42em; bottom: -0.42em; width: 3px; background: var(--regional); opacity: 0.55; }
.card .route li:last-child::after { display: none; }
.card .route li:nth-child(2)::before, .card .route li:nth-child(2)::after { border-color: var(--express); }
.card .route li:nth-child(2)::after { background: var(--express); }
.card .route li:nth-child(3)::before { border-color: var(--highspeed); }
.card .route li:nth-child(3)::after { background: var(--highspeed); }
.card .route li:nth-child(4)::before { border-color: var(--gold); }

/* Label and value rows, like the game's info rows. */
.rows { margin: 0; }
.rows > div { display: grid; grid-template-columns: minmax(7.5rem, 32%) 1fr; gap: 4px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.rows > div:first-child { border-top: 0; padding-top: 0; }
.rows > div:last-child { padding-bottom: 0; }
.rows dt { color: var(--soft); font-size: 0.9rem; font-weight: 600; }
.rows dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .rows > div { grid-template-columns: 1fr; }
  .rows dt { color: var(--gold); font-size: 0.74rem; font-weight: 700; font-stretch: 125%; letter-spacing: 0.05em; text-transform: uppercase; }
}

.note { color: var(--soft); font-size: 0.9rem; }

/* The gold button of the game. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  color: var(--ink);
  background: linear-gradient(180deg, var(--gold-light), var(--gold) 55%, var(--gold-deep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 6px 18px rgba(245, 184, 66, 0.22);
  font-weight: 800;
  font-stretch: 125%;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
}
.button:hover { color: var(--ink); filter: brightness(1.06); }

/* The hub: one tile per page. */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.tile { display: block; text-decoration: none; color: inherit; transition: transform 0.15s ease, border-color 0.15s ease; }
.tile:hover { transform: translateY(-2px); border-color: rgba(245, 184, 66, 0.55); color: inherit; }
.tile h2 { margin-bottom: 6px; }
.tile p { margin: 0; font-size: 0.95rem; }
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } .tile:hover { transform: none; } }

footer { max-width: 760px; margin: 0 auto; padding: 8px var(--gutter) 48px; color: var(--soft); font-size: 0.85rem; text-align: center; }
footer .track { height: 3px; margin: 0 auto 18px; max-width: 220px; border-radius: 3px; background: linear-gradient(90deg, var(--regional) 0 33%, var(--express) 33% 66%, var(--highspeed) 66%); opacity: 0.8; }
footer a { color: var(--soft); margin: 0 8px; white-space: nowrap; }

@media (min-width: 720px) {
  :root { --gutter: 24px; }
  .hero { min-height: 420px; padding-top: 28px; padding-bottom: 150px; }
  .hero::before { background-position: 60% 100%; }
  .tabs a { font-size: 0.74rem; }
  .card { padding: 22px 24px 20px; }
}
