/* ==========================================================================
   METREAL VOL.2 — route.css  (#route-root → .rt)
   Left: the walk game. Right: legs with minutes + departure calculator.
   Flat hairlines, big numerals, square corners only. Oedo line magenta #c4007a.
   ========================================================================== */
.rt { position: relative; margin-top: clamp(28px, 4vw, 48px); --rt-oedo: #c4007a; }

/* ---------- layout: timeline + one button ---------- */
.rt-wrap { display: grid; gap: 28px; max-width: 720px; }
.rt-play { display: flex; }

/* ---------- legs ---------- */
.rt-legs { position: relative; padding-left: 30px; padding-top: 4px; }
.rt-leg-time { display: block; font-family: var(--font-display); font-weight: 800; font-size: 15px; letter-spacing: -.01em; color: var(--cyan); font-variant-numeric: tabular-nums; margin-bottom: 2px; }
.rt-leg--goal .rt-leg-time { color: var(--red); font-size: 17px; }
.rt-legs::before { content: ''; position: absolute; left: 7px; top: 24px; bottom: 10px; width: 2px; background: var(--line); }
.rt-leg { position: relative; min-width: 0; }
.rt-leg::before { content: ''; position: absolute; left: -30px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); }
.rt-leg--pt { padding: 0 0 18px; }
.rt-leg--pt::before { top: 5px; border: 2px solid var(--white); }
.rt-leg--oedo::before { border-color: var(--rt-oedo); background: var(--rt-oedo); }
.rt-leg--goal::before { border-color: var(--red); background: var(--red); }
.rt-leg--start::before { background: var(--white); }
.rt-leg-name { display: block; font-family: var(--font-body); font-weight: 900; font-size: clamp(18px, 1.8vw, 22px); line-height: 1.3; color: var(--white); }
.rt-leg--goal .rt-leg-name { font-size: clamp(22px, 2.2vw, 28px); }
.rt-leg-sub { display: block; margin-top: 2px; font-size: 13px; line-height: 1.6; color: var(--muted); }
/* a photo under the place name: 3:2, hairline frame, licence credit in small mono */
.rt-leg-ph { margin: 12px 0 0; max-width: 440px; }
.rt-leg-ph img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border: 1px solid var(--line); background: #000; }
.rt-leg-ph figcaption { margin-top: 5px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .02em; color: var(--muted); }
.rt-leg-ph figcaption a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.rt-leg-ph figcaption a:hover { color: var(--white); }
.rt-leg--pt:has(.rt-leg-ph) { padding-bottom: 26px; }
.rt-leg--mv .rt-leg-ph { grid-column: 2; margin-top: 8px; }
.rt-leg--mv:has(.rt-leg-ph) { padding-bottom: 28px; }
.rt-leg--mv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; align-items: baseline; padding: 2px 0 22px; }
.rt-leg--mv::before { top: 14px; left: -27px; width: 10px; height: 10px; background: var(--line); border-radius: 0; }
.rt-leg-num { display: inline-flex; align-items: baseline; gap: 3px; white-space: nowrap; }
.rt-leg-num b { font-family: var(--font-display); font-weight: 900; font-size: clamp(34px, 3.4vw, 44px); line-height: 1; letter-spacing: -.04em; color: var(--white); }
.rt-leg-num small { font-family: var(--font-body); font-weight: 700; font-size: 13px; color: var(--muted); }
.rt-leg-how { font-family: var(--font-body); font-weight: 900; font-size: 16px; color: var(--cyan); }
.rt-leg--mv .rt-leg-sub { grid-column: 2; margin-top: 0; }

.rt-k { font-size: 13px; color: var(--muted); letter-spacing: .02em; }

/* ---------- modal that holds the game ---------- */
.rt-modal { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 12px; margin: 0; }   /* appended to <body> by route.js */
.rt-modal[hidden] { display: none; }
.rt-modal__bd { position: absolute; inset: 0; background: rgba(7, 8, 12, .9); opacity: 0; transition: opacity .25s ease; }
.rt-modal.is-open .rt-modal__bd { opacity: 1; }
.rt-modal__panel { position: relative; width: min(100%, 960px); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow: auto; overscroll-behavior: contain; background: var(--bg); border: 1px solid var(--line); padding: 52px 12px 12px; opacity: 0; transform: translateY(18px); transition: opacity .25s ease, transform .3s var(--ease-out); }
.rt-modal.is-open .rt-modal__panel { opacity: 1; transform: none; }
.rt-modal__close { position: absolute; right: 8px; top: 8px; width: 40px; height: 40px; display: grid; place-items: center; font-size: 26px; line-height: 1; color: var(--white); border: 1px solid var(--line); transition: background .15s var(--ease), color .15s var(--ease); }
.rt-modal__close:hover, .rt-modal__close:focus-visible { background: var(--white); color: #000; }
@media (min-width: 700px) { .rt-modal__panel { padding: 56px 20px 20px; } }

/* ==========================================================================
   「歩いてみる」 game
   ========================================================================== */
.rt-game { min-width: 0; }
.rt-g-hud { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px 18px; align-items: end; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.rt-g-hud-item { display: grid; gap: 2px; min-width: 0; }
.rt-g-hud-item b { font-family: var(--font-display); font-weight: 900; font-size: 22px; line-height: 1; letter-spacing: -.02em; color: var(--white); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rt-g-hud-clock b { font-size: clamp(32px, 4vw, 44px); color: var(--cyan); }
.rt-g-seg { font-family: var(--font-body) !important; font-weight: 900 !important; font-size: 16px !important; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) {
  .rt-g-hud { grid-template-columns: 1fr 1fr; }
  .rt-g-hud-item b { font-size: 20px; }
}

.rt-g-screen { position: relative; margin-top: 14px; background: var(--bg-2); border: 1px solid var(--line-soft); display: flex; flex-direction: column; align-items: center; overflow: hidden; }
.rt-g-canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; background: var(--bg-2); }
.rt.is-run .rt-g-canvas { touch-action: none; }
/* three.js diorama (route3d.js) mounted into .rt-g3; the 2D hud/screen stay as the fallback */
.rt.is-3d .rt-g-hud, .rt.is-3d .rt-g-screen { display: none; }
.rt-g3 { display: block; }
.rt-g-canvas:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }

.rt-g-msg { position: absolute; left: 50%; top: 14%; transform: translate(-50%, 0); padding: 8px 14px; background: var(--red); color: #fff; font-family: var(--font-body); font-weight: 900; font-size: clamp(15px, 2vw, 20px); line-height: 1.2; white-space: nowrap; opacity: 0; visibility: hidden; transition: opacity .15s var(--ease), visibility .15s; pointer-events: none; }
.rt-g-msg.is-show { opacity: 1; visibility: visible; }

/* choice bar: reserved strip under the canvas so buttons never cover the scene */
.rt-g-choices { width: 100%; min-height: 68px; display: flex; justify-content: center; align-items: center; gap: 8px; padding: 10px; border-top: 1px solid var(--line-soft); opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .15s var(--ease), transform .2s var(--ease-out), visibility .15s; pointer-events: none; }
.rt-g-choices.is-show { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }
.rt-g-btn { min-height: 48px; min-width: 96px; padding: 0 18px; background: var(--bg); color: var(--white); border: 2px solid var(--white); font-family: var(--font-body); font-weight: 700; font-size: 16px; letter-spacing: .02em; line-height: 1; transition: background .15s var(--ease), color .15s var(--ease); }
.rt-g-btn:hover, .rt-g-btn:focus-visible { background: var(--white); color: #000; }
.rt-g-btn--red { background: var(--red); border-color: var(--red); color: #fff; }
.rt-g-btn--red:hover, .rt-g-btn--red:focus-visible { background: #fff; border-color: #fff; color: var(--red); }

.rt-g-over { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(7, 8, 12, .86); }
.rt-g-over.is-show { display: flex; }
.rt-g-title { display: grid; justify-items: center; gap: 10px; text-align: center; }
.rt-g-title-h { font-family: var(--font-body); font-weight: 900; font-size: clamp(28px, 5vw, 44px); line-height: 1; color: var(--white); }
.rt-g-title-s { font-family: var(--font-body); font-weight: 700; font-size: 14px; color: var(--muted); }
.rt-g-title-best { display: inline-flex; align-items: baseline; gap: 8px; }
.rt-g-title-best b { font-family: var(--font-display); font-weight: 900; font-size: 24px; line-height: 1; color: var(--white); }
.rt-g-title-best i { font-style: normal; font-family: var(--font-display); font-weight: 900; font-size: 18px; color: var(--cyan); }
.rt-g-btn--start { margin-top: 6px; min-width: 160px; background: var(--red); border-color: var(--red); color: #fff; }
.rt-g-btn--start:hover, .rt-g-btn--start:focus-visible { background: #fff; border-color: #fff; color: var(--red); }

.rt-g-fin { width: 100%; max-width: 560px; display: grid; gap: 14px; }
.rt-g-fin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.rt-g-fin-grid > div { display: grid; gap: 2px; border-top: 1px solid var(--line); padding-top: 6px; }
.rt-g-fin-grid b { font-family: var(--font-display); font-weight: 900; font-size: clamp(26px, 4vw, 40px); line-height: 1; letter-spacing: -.03em; color: var(--white); font-variant-numeric: tabular-nums; }
.rt-g-fin-score { grid-column: 1 / -1; border-top-width: 2px !important; border-top-color: var(--white) !important; position: relative; }
.rt-g-fin-score b { font-size: clamp(48px, 8vw, 80px); color: var(--white); }
.rt-g-fin-new { position: absolute; right: 0; top: 8px; font-style: normal; font-size: 13px; color: #000; background: var(--cyan); padding: 2px 8px; }
.rt-g-fin-rank b { color: var(--red); }
.rt-g-fin-rank b.is-S { color: var(--red); }
.rt-g-fin-rank b.is-A { color: var(--cyan); }
.rt-g-fin-rank b.is-B, .rt-g-fin-rank b.is-C { color: var(--white); }
.rt-g-fin-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.rt-g-fin-acts .btn { min-height: 44px; }
@media (max-width: 420px) {
  .rt-g-fin-grid b { font-size: 24px; }
  .rt-g-fin-score b { font-size: 44px; }
  .rt-g-over { padding: 10px; align-items: flex-start; overflow: auto; }
}
