@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800;900&family=DM+Sans:wght@400;500;600;650;700;750;800;900&display=swap');

:root {
  font-family: 'DM Sans', Arial, sans-serif;
  color: #f5f4ee;
  background: #101214;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --bg: #101214;
  --panel: #1b1e20;
  --muted: #9da2a5;
  --line: #34383b;
  --yellow: #fccc0a;
  --white: #f5f4ee;
  --display: 'Barlow Condensed', Impact, 'Arial Narrow', sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); }
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: -1; background: radial-gradient(ellipse at 50% -15%, #2c3135 0, transparent 55%); }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
button, summary, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible, summary:focus-visible, textarea:focus-visible { outline: 3px solid var(--yellow); outline-offset: 5px; }
button:disabled { cursor: default; }
a { color: inherit; }
button svg { width: 21px; height: 21px; flex-shrink: 0; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
.loading { padding: 80px 24px; text-align: center; color: var(--muted); }
.site-header { display: flex; justify-content: space-between; align-items: center; max-width: 1000px; padding: 27px 0; margin: 0 auto; }
.wordmark { font-size: 12px; font-weight: 900; letter-spacing: 1.7px; text-decoration: none; display: flex; align-items: center; gap: 10px; }
.mini-mark { display: inline-grid; place-items: center; width: 25px; height: 25px; border: 1px solid #777d80; border-radius: 50%; font-size: 19px; letter-spacing: 0; }
.icon-button { display: inline-grid; place-items: center; background: transparent; color: var(--muted); border: 1px solid var(--line); width: 38px; height: 38px; border-radius: 50%; transition: color .15s, background .15s; }
.icon-button svg { width: 17px; height: 17px; }
.icon-button:hover { color: var(--white); background: #ffffff0c; }
.home-shell { padding: 0 32px; }
.home-main { width: min(100%, 560px); margin: 31px auto 0; text-align: center; }
.hero-bullets { display: flex; justify-content: center; gap: 9px; margin-bottom: 27px; }
.bullet { background: var(--route); color: var(--ink); border-radius: 50%; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; font-family: Arial, sans-serif; font-weight: 800; font-size: 17px; line-height: 1; flex-shrink: 0; letter-spacing: -.6px; }
.hero-bullets .bullet { width: 39px; height: 39px; font-size: 24px; box-shadow: 0 3px 0 #0005; }
.eyebrow { font-size: 10px; font-weight: 750; letter-spacing: 2px; color: var(--muted); }
.home-main > .eyebrow { color: var(--yellow); font-size: 10px; }
.home-main h1 { font-family: var(--display); font-size: clamp(65px, 7vw, 86px); line-height: .97; font-weight: 800; letter-spacing: -.8px; margin: 19px 0 22px; }
.home-main h1 span { color: var(--yellow); }
.intro { font-size: 14px; line-height: 1.8; color: #afb4b6; }
.instructions { list-style: none; text-align: left; margin: 31px auto 27px; padding: 0; max-width: 420px; display: grid; gap: 9px; }
.instructions li { display: flex; align-items: center; gap: 13px; background: #ffffff04; border: 1px solid #ffffff0c; border-radius: 8px; padding: 12px 14px; font-size: 12px; line-height: 1.7; color: #b2b6b8; }
.instructions strong { color: var(--white); font-weight: 700; }
.step-number { border: 1px solid #6b601e; width: 23px; height: 23px; border-radius: 50%; color: var(--yellow); font-size: 11px; font-weight: 800; flex-shrink: 0; display: grid; place-items: center; }
.primary { background: var(--yellow); color: #121416; border: none; border-radius: 8px; min-height: 60px; padding: 16px 24px; display: flex; align-items: center; justify-content: center; gap: 16px; width: 100%; font-size: 16px; font-weight: 900; box-shadow: 0 4px 0 #9e8000; transition: filter .15s, transform .15s; }
.primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #9e8000; }
.start-button { max-width: 420px; margin: auto; }
.start-caption { margin-top: 19px; color: #8f969a; font-size: 10px; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 7px; }
.status-dot { width: 5px; height: 5px; display: inline-block; border-radius: 50%; background: var(--yellow); }
.personal-best { flex-basis: 100%; padding-top: 10px; font-size: 9px; letter-spacing: 1px; }
.personal-best strong { color: var(--white); margin-left: 8px; }
.home-divider { display: flex; gap: 15px; align-items: center; margin: 44px 0 27px; }
.home-divider span { height: 1px; background: var(--line); flex: 1; }
.home-divider p { font-size: 8px; letter-spacing: 1.9px; color: #7f8589; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 15px; text-align: left; gap: 12px; }
.section-heading h2 { font-size: 13px; font-weight: 700; }
.section-heading > span { font-size: 10px; color: var(--muted); white-space: nowrap; }
.route-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.route-tile { display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid #ffffff0b; border-radius: 6px; background: #ffffff03; }
.route-bullets { display: flex; gap: 3px; min-width: 85px; }
.route-tile .bullet { width: 20px; height: 20px; font-size: 13px; }
.route-tile > span { font-size: 10px; text-align: left; color: #b1b6b9; line-height: 1.4; }
.data-caption { font-size: 10px; line-height: 1.8; color: #7f878c; margin-top: 17px; }
.rules-details { text-align: left; margin-top: 25px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
summary { cursor: pointer; }
.rules-details summary { list-style: none; display: flex; justify-content: space-between; padding: 17px 0; font-size: 11px; color: var(--muted); }
.rules-details summary::-webkit-details-marker { display: none; }
.rules-details summary span { font-size: 15px; }
.rules-details[open] summary span { transform: rotate(45deg); }
.rules-details > div { padding-bottom: 16px; font-size: 11px; line-height: 1.8; color: var(--muted); }
.rules-details p + p { margin-top: 9px; }
footer { margin: 32px auto 0; padding: 0 0 28px; text-align: center; color: #7e8589; font-size: 9px; line-height: 2.3; }
footer a { text-underline-offset: 3px; text-decoration-color: #4d5358; }
footer a:hover { color: var(--white); }
.footer-dot { margin: 0 8px; }

/* The round stays within the viewport on phones and desktops. */
.in-game { overscroll-behavior: none; }
.play-shell { height: 100svh; min-height: 540px; padding: max(24px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left)); display: flex; flex-direction: column; position: relative; overflow: hidden; touch-action: none; user-select: none; }
.game-header { display: flex; align-items: flex-start; justify-content: space-between; position: relative; z-index: 2; }
.timer-group, .score-group { width: 140px; }
.timer-group .eyebrow, .score-group .eyebrow { font-size: 9px; letter-spacing: 1.6px; }
.timer-row { display: flex; align-items: baseline; gap: 2px; }
#time, #score { font-family: var(--display); font-weight: 800; font-size: 54px; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.time-unit { color: var(--muted); font-size: 19px; margin-left: 2px; }
#time-delta { font-weight: 800; font-size: 14px; margin-left: 9px; }
.good { color: #a8df73; }
.bad { color: #ff737a; }
.total-time-track { height: 4px; width: 112px; background: #ffffff12; border-radius: 2px; overflow: hidden; margin-top: 7px; }
#total-time { height: 100%; background: var(--yellow); transform-origin: left; }
.score-group { text-align: right; }
#score { display: block; }
.game-tools { display: flex; gap: 7px; justify-content: flex-end; margin-top: 10px; }
.game-tools .icon-button { width: 32px; height: 32px; }
.game-tools .icon-button svg { width: 14px; height: 14px; }
.game-logo { text-align: center; font-weight: 900; font-size: 18px; line-height: 1; letter-spacing: -1px; color: #c3c6c6; margin-top: 2px; }
.game-logo span { font-size: 8px; letter-spacing: 1.5px; line-height: 2; }
.combo-wrap { display: flex; align-items: center; justify-content: center; margin-top: -26px; min-height: 30px; }
.combo-pill { color: #737d82; font-size: 9px; letter-spacing: 1.5px; font-weight: 800; border: 1px solid #ffffff0c; border-radius: 20px; padding: 7px 12px; transition: color .2s; }
#combo { color: #a3aaae; margin-right: 5px; }
.combo-pill.has-streak { color: var(--yellow); border-color: #fccc0a50; background: #fccc0a08; }
.has-streak #combo { color: var(--yellow); }
.station-stage { flex: 1; min-height: 190px; display: grid; place-items: center; position: relative; perspective: 1000px; padding: 22px 0; }
.station-card { width: min(100%, 440px); background: #f3f1e9; color: #141719; border-radius: 12px; padding: 21px 24px 0; box-shadow: 0 7px 0 #a8acaa, 0 15px 0 #080a0b, 0 22px 60px #0005; transform-origin: center 100%; position: relative; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 21px; }
.card-kicker { font-size: 8px; letter-spacing: 1.5px; font-weight: 800; color: #717676; }
#transfer-tag { background: #171b1e; color: #f3d254; font-size: 8px; font-weight: 900; letter-spacing: .7px; border-radius: 3px; padding: 5px 7px; white-space: nowrap; }
.station-info { text-align: center; padding: 22px 0 25px; min-height: 155px; display: flex; flex-direction: column; justify-content: center; }
#borough { text-transform: uppercase; font-size: 9px; letter-spacing: 2px; font-weight: 800; color: #787f7d; margin-bottom: 7px; }
#station-name { font-size: clamp(28px, 4vw, 42px); letter-spacing: -1.4px; line-height: 1.1; font-weight: 900; overflow-wrap: anywhere; }
#station-name.long-name { font-size: clamp(25px, 3vw, 33px); }
#corridor { color: #6d7675; font-size: 10px; font-weight: 650; margin-top: 10px; }
.card-bottom { border-top: 1px solid #171b1e22; display: flex; justify-content: space-between; align-items: center; padding: 11px 0 12px; font-size: 7px; letter-spacing: 1.3px; color: #838a87; font-weight: 750; }
.card-dots { font-size: 6px; color: #b0b5ae; letter-spacing: 3px; }
.card-time-track { background: #d5d8d0; height: 5px; margin: 0 -24px; overflow: hidden; border-radius: 0 0 12px 12px; }
#card-time { background: #232b2d; height: 100%; transform-origin: left; }
.card-danger #card-time { background: #db4649; }
.card-wrong { animation: card-shake .35s ease; }
.exit-0 { animation: exit-left .2s ease-in forwards; }
.exit-1 { animation: exit-right .2s ease-in forwards; }
.edge-glow { position: absolute; top: 0; bottom: 0; width: 35%; pointer-events: none; opacity: .12; z-index: -1; }
.left-glow { left: 0; background: linear-gradient(90deg, var(--route), transparent); }
.right-glow { right: 0; background: linear-gradient(-90deg, var(--route), transparent); }
.feedback { text-align: center; height: 33px; font-size: 12px; font-weight: 700; color: var(--muted); padding: 0 0 10px; }
.feedback.positive { color: #bad79b; }
.feedback.negative { color: #ff8488; }
.answer-area { width: 100%; max-width: 1100px; margin: 0 auto; }
.play-hint { font-size: 10px; color: #90989c; text-align: center; margin-bottom: 15px; display: flex; justify-content: center; align-items: center; gap: 18px; }
.play-hint > span { color: #626c71; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.choice { border: 1px solid #ffffff26; border-radius: 12px; background: var(--route); color: var(--ink); min-height: 120px; display: flex; justify-content: center; align-items: center; gap: 24px; position: relative; box-shadow: 0 5px 0 color-mix(in srgb, var(--route) 60%, #000); transition: filter .1s; padding: 17px 20px; }
.choice:hover { filter: brightness(1.12); }
.choice:active { transform: translateY(3px); }
.choice-content { display: flex; flex-direction: column; gap: 9px; align-items: center; }
.choice-bullets { display: flex; gap: 5px; }
.choice .bullet { background: var(--ink); color: var(--route); width: 30px; height: 30px; font-size: 19px; }
.choice-direction { position: absolute; left: 22px; font-size: 23px; opacity: .7; }
.choice[data-side="1"] .choice-direction { left: auto; right: 22px; }
.key-hint { font-size: 12px; position: absolute; right: 18px; border: 1px solid currentColor; opacity: .4; border-radius: 3px; padding: 0 4px; }
.choice[data-side="1"] .key-hint { right: auto; left: 18px; }
.choice.is-correct { outline: 3px solid #fff; outline-offset: -5px; }
.choice.is-wrong { opacity: .35; }
.play-footnote { text-align: center; color: #737e83; font-size: 8px; letter-spacing: .7px; margin-top: 16px; }
.hurry #time { color: #ff737a; }
.fever .combo-pill { box-shadow: 0 0 35px #fccc0a22; }
.fever .station-card { box-shadow: 0 7px 0 #a89a5a, 0 15px 0 #080a0b, 0 0 60px #fccc0a22; }
#effects { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.points-effect { position: absolute; top: 36%; color: var(--yellow); text-shadow: 0 2px 10px #0007; font-family: var(--display); font-size: 44px; font-weight: 800; animation: points-up .8s ease-out forwards; z-index: 5; }
.pause-overlay { position: fixed; inset: 0; z-index: 20; background: #080b0de8; backdrop-filter: blur(12px); display: grid; place-items: center; padding: 24px; }
.pause-dialog { text-align: center; max-width: 340px; width: 100%; }
.pause-dialog .eyebrow { color: var(--yellow); }
.pause-dialog h2 { font-family: var(--display); font-size: 60px; line-height: 1; margin: 20px 0 15px; }
.pause-dialog p { font-size: 14px; color: var(--muted); line-height: 1.8; margin-bottom: 30px; }
.text-button { color: #a3aaae; background: none; border: 0; padding: 16px; font-size: 12px; text-decoration: underline; text-underline-offset: 4px; }
.text-button:hover { color: var(--white); }

.has-results { overflow: hidden; }
.has-results .play-shell { min-height: 0; }
.result-dialog { width: min(420px, calc(100% - 32px)); max-width: none; max-height: calc(100svh - 32px); margin: auto; padding: 0; border: 1px solid #ffffff14; border-radius: 18px; background: var(--panel); color: var(--white); box-shadow: 0 24px 100px #0009; overflow: hidden; }
.result-dialog::backdrop { background: #080b0dd9; backdrop-filter: blur(5px); }
.result-main { display: flex; flex-direction: column; max-height: calc(100svh - 34px); text-align: center; }
.result-content { padding: 26px 24px 20px; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.arrival-label { color: var(--yellow); font-size: 8px; letter-spacing: 1.7px; font-weight: 800; display: inline-flex; gap: 9px; align-items: center; margin-bottom: 16px; }
#result-title { font-family: var(--display); font-size: 45px; font-weight: 800; line-height: 1; margin: 0 0 11px; }
.rank-description { font-size: 12px; line-height: 1.6; color: var(--muted); max-width: 330px; margin: 0 auto 22px; }
.result-content .eyebrow { font-size: 8px; }
.final-score { display: block; font-family: var(--display); color: var(--yellow); font-size: 76px; font-weight: 800; line-height: 1; margin: 5px 0 22px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.stats-grid > div { display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 11px 2px; border: 1px solid #ffffff06; border-radius: 8px; background: #101214; }
.stats-grid span { font-size: 8px; color: var(--muted); white-space: nowrap; }
.stats-grid strong { font-family: var(--display); font-size: 25px; line-height: 1; font-weight: 700; }
.answer-history { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin-top: 22px; }
.history-dot { width: 15px; height: 15px; border-radius: 3px; background: var(--route); flex-shrink: 0; }
.history-wrong { display: inline-grid; place-items: center; color: white; font-size: 14px; line-height: 1; }
.heatmap-legend { font-size: 8px; color: var(--muted); margin: 10px 0 18px; }
.best-caption { font-size: 8px; letter-spacing: 1px; color: var(--muted); }
.best-caption strong { color: var(--white); margin-left: 5px; }
.result-actions { flex-shrink: 0; padding: 18px 24px 12px; border-top: 1px solid var(--line); background: var(--panel); }
.result-actions .primary { min-height: 52px; font-size: 14px; }
.secondary { display: flex; gap: 10px; align-items: center; justify-content: center; background: transparent; border: 1px solid #52585d; border-radius: 8px; min-height: 45px; padding: 12px 20px; color: var(--white); font-size: 12px; font-weight: 700; width: 100%; margin-top: 12px; }
.secondary:hover { background: #ffffff08; }
.secondary:disabled { opacity: .6; cursor: progress; }
.secondary svg { width: 16px; height: 16px; }
.result-actions .text-button { padding: 14px 8px 5px; font-size: 10px; }
.share-status { color: var(--yellow); font-size: 10px; line-height: 1.5; margin-top: 8px; }
.share-status:empty { display: none; }
@keyframes exit-left { to { transform: translateX(-100vw) rotate(-25deg); opacity: 0; } }
@keyframes exit-right { to { transform: translateX(100vw) rotate(25deg); opacity: 0; } }
@keyframes card-shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes points-up { from { opacity: 1; transform: translate(-50%, 0) scale(.8); } 20% { opacity: 1; transform: translate(-50%, -10px) scale(1); } to { opacity: 0; transform: translate(-50%, -80px) scale(1); } }

@media (min-width: 1500px) { .play-shell { padding: 38px 48px 26px; } .choice { min-height: 145px; } }
@media (max-width: 650px) {
  .home-shell { padding: 0 20px; }
  .site-header { padding: 20px 0; }
  .wordmark { font-size: 10px; letter-spacing: 1.2px; }
  .home-main { margin-top: 24px; }
  .hero-bullets { gap: 7px; margin-bottom: 25px; }
  .hero-bullets .bullet { width: 33px; height: 33px; font-size: 21px; }
  .home-main h1 { font-size: clamp(53px, 16.5vw, 68px); margin-top: 17px; }
  .intro { font-size: 12px; }
  .instructions { margin-top: 25px; }
  .instructions li { font-size: 11px; padding: 11px 12px; gap: 10px; }
  .home-divider { margin-top: 37px; }
  .section-heading h2 { font-size: 11px; }
  .section-heading > span { font-size: 8px; }
  .route-tile { padding: 10px 8px; flex-direction: column; gap: 7px; align-items: flex-start; }
  .route-bullets { min-width: 0; }
  .route-tile > span { font-size: 9px; }
  .route-grid { gap: 6px; }
  .play-shell { padding: max(22px, env(safe-area-inset-top)) 16px max(19px, env(safe-area-inset-bottom)); min-height: 530px; }
  .timer-group, .score-group { width: 108px; }
  #time, #score { font-size: 46px; }
  .game-logo { font-size: 16px; margin-top: 3px; }
  .game-logo span { font-size: 7px; letter-spacing: 1px; }
  .total-time-track { width: 91px; }
  .combo-wrap { margin-top: -8px; }
  .combo-pill { font-size: 8px; }
  .station-stage { padding: 25px 6px; }
  .station-card { padding: 16px 18px 0; }
  .card-top { gap: 5px; }
  .card-kicker { font-size: 7px; letter-spacing: 1.1px; }
  #transfer-tag { font-size: 7px; padding: 4px 5px; }
  .station-info { min-height: 157px; padding: 22px 0 24px; }
  #station-name { font-size: 33px; letter-spacing: -1px; }
  #station-name.long-name { font-size: 27px; }
  #borough { font-size: 8px; }
  .card-time-track { margin: 0 -18px; }
  .card-bottom { font-size: 6px; }
  .feedback { font-size: 10px; height: 36px; padding-bottom: 15px; }
  .choices { gap: 10px; }
  .choice { min-height: 122px; padding: 16px 8px; border-radius: 10px; }
  .choice .bullet { width: 24px; height: 24px; font-size: 16px; }
  .choice-bullets { gap: 3px; }
  .choice-direction { display: none; }
  .key-hint { display: none; }
  .play-hint { font-size: 9px; margin-bottom: 14px; gap: 12px; }
  .play-footnote { font-size: 7px; margin-top: 16px; }
  .points-effect { font-size: 36px; }
}
@media (max-width: 360px) {
  .home-shell { padding: 0 16px; }
  .home-main h1 { font-size: 53px; }
  .hero-bullets .bullet { width: 30px; height: 30px; font-size: 19px; }
  .home-main > .eyebrow { font-size: 8px; }
  .instructions li { font-size: 10px; }
  .choice .bullet { width: 21px; height: 21px; font-size: 14px; }
  .choice-bullets { gap: 2px; }
  .game-logo { display: none; }
}
@media (max-height: 700px) and (max-width: 650px) {
  .result-content { padding: 18px 16px 14px; }
  .arrival-label { margin-bottom: 11px; }
  #result-title { font-size: 36px; margin-bottom: 8px; }
  .rank-description { font-size: 11px; margin-bottom: 15px; }
  .final-score { font-size: 64px; margin-bottom: 16px; }
  .stats-grid span { font-size: 7px; }
  .stats-grid strong { font-size: 23px; }
  .answer-history { margin-top: 16px; }
  .heatmap-legend { margin-bottom: 13px; font-size: 7px; }
  .result-actions { padding: 14px 16px 10px; }
  .play-shell { padding-top: 16px; padding-bottom: 14px; min-height: 500px; }
  #time, #score { font-size: 39px; }
  .game-tools { margin-top: 6px; }
  .game-tools .icon-button { width: 28px; height: 28px; }
  .combo-wrap { margin-top: -12px; min-height: 26px; }
  .combo-pill { padding: 6px 10px; font-size: 7px; }
  .station-stage { padding: 12px 6px; min-height: 170px; }
  .station-card { padding: 12px 14px 0; }
  .card-top { min-height: 18px; }
  .station-info { min-height: 98px; padding: 12px 0; }
  #borough { font-size: 7px; margin-bottom: 5px; }
  #station-name { font-size: 26px; }
  #station-name.long-name { font-size: 21px; }
  .card-bottom { padding: 8px 0; }
  .card-time-track { margin: 0 -14px; }
  .feedback { height: 28px; flex-shrink: 0; font-size: 9px; padding-bottom: 8px; }
  .choice { min-height: 100px; }
  .play-hint { margin-bottom: 10px; }
  .play-footnote { margin-top: 12px; }
}
@media (max-height: 650px) and (min-width: 651px) {
  .play-shell { padding-top: 15px; padding-bottom: 15px; }
  #time, #score { font-size: 44px; }
  .station-card { width: 400px; padding-top: 14px; }
  .station-info { min-height: 110px; padding: 12px 0 17px; }
  #station-name { font-size: 35px; }
  .station-stage { padding: 10px 0 20px; }
  .choice { min-height: 95px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
