:root {
  color-scheme: light;
  --paper: #f3efe5;
  --paper-deep: #e9e2d4;
  --ink: #17221d;
  --ink-soft: #58625d;
  --rule: #c9c1b3;
  --accent: #d6532e;
  --accent-dark: #a53a1d;
  --green: #1f6b4f;
  --white: #fffdf8;
  --danger: #a9362c;
  --shadow: 0 14px 42px rgba(23, 34, 29, 0.09);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(23, 34, 29, 0.026) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 32px;
  font-family: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select { font: inherit; }
button { color: inherit; }
a { color: inherit; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  width: min(1480px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(20px + var(--safe-top)) clamp(18px, 4vw, 58px) calc(24px + var(--safe-bottom));
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.brand img { width: 36px; height: 36px; }
.brand-name { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 18px; font-weight: 700; }
.brand-note { display: block; margin-top: 1px; color: var(--ink-soft); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }

.header-tools { display: flex; align-items: center; gap: 10px; }
.language-switch { display: inline-flex; padding: 3px; border: 1px solid var(--rule); background: rgba(255,255,255,.28); }
.language-switch button { min-width: 38px; border: 0; padding: 6px 9px; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.language-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.language-switch button:disabled { opacity: 1; cursor: not-allowed; }

.round-chip { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }

.screen { animation: screen-in .32s ease-out both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

.menu-layout {
  display: grid;
  grid-template-columns: minmax(0, .86fr) minmax(520px, 1.14fr);
  gap: clamp(50px, 8vw, 124px);
  align-items: end;
  min-height: calc(100dvh - 112px - var(--safe-top));
  padding: clamp(54px, 9vh, 112px) 0 40px;
}

.menu-intro { align-self: center; }
.eyebrow { margin: 0 0 22px; color: var(--accent-dark); font-size: 12px; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; }
.display-title { max-width: 620px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(54px, 7.6vw, 112px); font-weight: 700; letter-spacing: -.065em; line-height: .88; }
.display-title span { color: var(--accent); font-style: italic; font-weight: 400; }
.lead { max-width: 520px; margin: 28px 0 0; color: var(--ink-soft); font-size: clamp(17px, 1.6vw, 22px); line-height: 1.55; }

.network-signature { position: relative; width: 210px; height: 56px; margin-top: 44px; }
.network-signature::before { content: ""; position: absolute; left: 11px; right: 11px; top: 27px; height: 1px; background: var(--ink); }
.network-signature i { position: absolute; top: 20px; width: 15px; height: 15px; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper); }
.network-signature i:nth-child(1) { left: 0; background: var(--accent); border-color: var(--accent); }
.network-signature i:nth-child(2) { left: 64px; }
.network-signature i:nth-child(3) { left: 128px; }
.network-signature i:nth-child(4) { right: 0; background: var(--ink); }

.mode-list { border-top: 1px solid var(--ink); }
.mode-row {
  width: 100%;
  display: grid;
  grid-template-columns: 42px 1fr 34px;
  gap: 20px;
  align-items: start;
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 25px 4px 25px 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: color .18s ease, padding-left .18s ease, border-color .18s ease;
}
.mode-row:hover, .mode-row:focus-visible { color: var(--accent-dark); padding-left: 10px; border-color: var(--accent); outline: none; }
.mode-index { padding-top: 6px; color: var(--ink-soft); font: 700 12px/1 Georgia, serif; }
.mode-title { display: block; font: 700 clamp(25px, 2.8vw, 38px)/1.1 Georgia, serif; letter-spacing: -.025em; }
.mode-description { display: block; max-width: 520px; margin-top: 8px; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }
.mode-arrow { padding-top: 4px; font-size: 28px; line-height: 1; transition: transform .18s ease; }
.mode-row:hover .mode-arrow { transform: translateX(4px); }

.settings-layout { width: min(940px, 100%); margin: 0 auto; padding: clamp(54px, 9vh, 104px) 0; }
.section-number { color: var(--accent-dark); font: italic 400 18px Georgia, serif; }
.settings-title { margin: 10px 0 14px; font: 700 clamp(42px, 7vw, 78px)/.96 Georgia, serif; letter-spacing: -.045em; }
.settings-intro { max-width: 620px; margin: 0 0 50px; color: var(--ink-soft); font-size: 17px; line-height: 1.6; }
.setting-row { display: grid; grid-template-columns: 180px 1fr; align-items: center; gap: 30px; min-height: 84px; border-top: 1px solid var(--rule); }
.setting-row:last-of-type { border-bottom: 1px solid var(--rule); }
.setting-label { font-size: 13px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.choice-line { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.choice-button { border: 1px solid transparent; padding: 10px 15px; background: transparent; cursor: pointer; color: var(--ink-soft); font-weight: 750; }
.choice-button:hover { border-color: var(--rule); }
.choice-button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.settings-actions { display: flex; justify-content: space-between; gap: 14px; margin-top: 38px; }

.primary-button, .secondary-button, .text-button, .danger-button {
  min-height: 46px;
  border: 1px solid var(--ink);
  padding: 0 18px;
  cursor: pointer;
  font-weight: 850;
  transition: transform .16s ease, background .16s ease, color .16s ease;
}
.primary-button { background: var(--ink); color: var(--paper); box-shadow: 5px 5px 0 var(--accent); }
.primary-button:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--accent); }
.secondary-button { background: transparent; }
.secondary-button:hover { background: var(--ink); color: var(--paper); }
.text-button { min-height: 38px; border-color: transparent; padding: 0 8px; background: transparent; color: var(--ink-soft); }
.text-button:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.danger-button { border-color: #ba7b70; background: transparent; color: var(--danger); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

.game-layout {
  display: grid;
  grid-template-columns: minmax(300px, .72fr) minmax(520px, 1.28fr);
  gap: clamp(32px, 6vw, 88px);
  min-height: calc(100dvh - 92px - var(--safe-top));
  padding: 28px 0 20px;
}

.route-pane { position: sticky; top: 24px; align-self: start; width: 100%; min-width: 0; max-height: calc(100dvh - 122px); display: grid; grid-template-rows: auto auto minmax(92px, 1fr) auto auto; overflow: hidden; overscroll-behavior: contain; padding-right: 10px; }
.target-band { display: grid; grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr); gap: 12px; align-items: center; width: 100%; min-width: 0; padding-bottom: 20px; border-bottom: 1px solid var(--rule); }
.target-band > div:not(.target-arrow) { min-width: 0; }
.target-label { display: block; margin-bottom: 5px; color: var(--ink-soft); font-size: 10px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.target-name { display: block; max-width: 100%; font: 700 clamp(18px, 1.7vw, 27px)/1.08 Georgia, serif; overflow-wrap: anywhere; word-break: normal; hyphens: auto; text-wrap: balance; }
.target-wiki-title { display: block; max-width: 100%; margin-top: 6px; color: var(--ink-soft); font-size: 10px; line-height: 1.25; overflow-wrap: anywhere; }
.target-arrow { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--accent); border-radius: 50%; color: var(--accent-dark); font-size: 18px; line-height: 1; }
.route-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 22px; color: var(--ink-soft); font-size: 9px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.route-heading strong { color: var(--ink); font-size: 10px; }

.route-list { position: relative; width: 100%; min-width: 0; list-style: none; margin: 20px 0 0; padding: 0 5px 0 10px; overflow-x: hidden; overflow-y: auto; scrollbar-gutter: stable; }
.route-list::before { content: ""; position: absolute; left: 18px; top: 17px; bottom: 20px; width: 1px; background: var(--ink); transform-origin: top; animation: line-grow .45s ease-out both; }
@keyframes line-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.route-node { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 17px; align-items: center; min-width: 0; min-height: 52px; }
.route-node + .route-node { margin-top: 6px; }
.node-dot { z-index: 1; width: 17px; height: 17px; border: 3px solid var(--paper); outline: 1px solid var(--ink); border-radius: 50%; background: var(--paper); }
.route-node:first-child .node-dot { background: var(--ink); }
.route-node.current .node-dot { background: var(--accent); outline-color: var(--accent); animation: node-arrive .38s cubic-bezier(.2,.8,.2,1); }
.route-node.target .node-dot { width: 19px; height: 19px; border-radius: 2px; background: var(--green); outline-color: var(--green); transform: rotate(45deg); }
@keyframes node-arrive { 0% { transform: scale(.35); } 65% { transform: scale(1.28); } 100% { transform: scale(1); } }
.route-node-copy { min-width: 0; padding: 8px 0; }
.route-node-title { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; font: 700 17px/1.25 Georgia, serif; }
.route-node-meta { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.route-empty { display: grid; grid-template-columns: 18px 1fr; gap: 17px; align-items: center; min-height: 48px; color: var(--ink-soft); font: italic 15px Georgia, serif; }
.route-empty i { width: 8px; height: 8px; margin-left: 5px; border: 1px solid var(--rule); border-radius: 50%; background: var(--paper); z-index: 1; }

.route-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; width: 100%; min-width: 0; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--rule); }
.mini-stat strong { display: block; font: 700 22px Georgia, serif; }
.mini-stat span { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 9px; line-height: 1.25; letter-spacing: .06em; text-transform: uppercase; overflow-wrap: anywhere; }

.decision-pane { min-width: 0; padding: 12px 0 32px; }
.article-kicker { margin: 0 0 10px; color: var(--accent-dark); font-size: 11px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.article-title { margin: 0; font: 700 clamp(42px, 6.1vw, 82px)/.96 Georgia, serif; letter-spacing: -.05em; text-wrap: balance; }
.article-context { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: start; margin: 24px 0 30px; padding-bottom: 24px; border-bottom: 1px solid var(--rule); }
.article-summary { max-width: 670px; margin: 0; color: var(--ink-soft); font: 17px/1.62 Georgia, serif; }
.wiki-link { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--ink-soft); font-size: 12px; font-weight: 800; text-decoration: none; }
.wiki-link:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 4px; }

.search-wrap { position: relative; }
.link-search { width: 100%; height: 54px; border: 0; border-bottom: 2px solid var(--ink); padding: 0 52px 0 0; outline: none; background: transparent; color: var(--ink); font-size: 18px; }
.link-search:focus { border-color: var(--accent); }
.search-mark { position: absolute; right: 0; top: 15px; width: 23px; height: 23px; border: 2px solid var(--ink); border-radius: 50%; pointer-events: none; }
.search-mark::after { content: ""; position: absolute; width: 8px; height: 2px; right: -6px; bottom: 0; background: var(--ink); transform: rotate(45deg); }
.link-heading { display: flex; justify-content: space-between; align-items: center; margin: 26px 0 8px; color: var(--ink-soft); font-size: 11px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.link-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--rule); }
.link-option { position: relative; min-height: 78px; display: grid; grid-template-columns: 11px 1fr 22px; gap: 12px; align-items: center; border: 0; border-bottom: 1px solid var(--rule); padding: 12px 18px 12px 2px; background: transparent; cursor: pointer; text-align: left; }
.link-option:nth-child(odd) { border-right: 1px solid var(--rule); padding-right: 18px; }
.link-option:nth-child(even) { padding-left: 18px; }
.link-option:hover, .link-option:focus-visible { background: rgba(255,253,248,.7); outline: none; }
.link-option:hover .link-name { color: var(--accent-dark); }
.link-swatch { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-soft); }
.link-option[data-category="person"] .link-swatch { background: #a4412a; }
.link-option[data-category="place"] .link-swatch { background: #336c60; }
.link-option[data-category="science"] .link-swatch, .link-option[data-category="technology"] .link-swatch { background: #315f82; }
.link-option[data-category="culture"] .link-swatch { background: #7b507b; }
.link-name { display: block; font: 700 17px/1.2 Georgia, serif; transition: color .15s ease; }
.link-description { display: block; margin-top: 4px; color: var(--ink-soft); font-size: 11px; line-height: 1.35; }
.link-go { color: var(--accent); font-size: 20px; }
.empty-links { grid-column: 1 / -1; padding: 28px 0; color: var(--ink-soft); font: italic 16px Georgia, serif; }
.game-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; min-width: 0; margin-top: 22px; }
.route-pane .game-actions > button { min-width: 0; max-width: 100%; white-space: normal; line-height: 1.2; }

.time-track { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; height: 4px; background: var(--paper-deep); }
.time-track span { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left; transition: transform .18s linear; }
.round-countdown { position: fixed; z-index: 40; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(23,34,29,.94); color: var(--paper); }
.round-countdown span { font-size: 11px; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.round-countdown strong { margin-top: 10px; color: var(--accent); font: 700 clamp(96px, 20vw, 210px)/.8 Georgia, serif; }

.result-layout { width: min(1120px, 100%); margin: 0 auto; padding: clamp(40px, 7vh, 78px) 0; }
.result-header { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; padding-bottom: 28px; border-bottom: 1px solid var(--ink); }
.result-eyebrow { margin: 0 0 8px; color: var(--accent-dark); font-size: 11px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.result-title { margin: 0; font: 700 clamp(42px, 7vw, 76px)/.95 Georgia, serif; letter-spacing: -.045em; }
.result-score { text-align: right; }
.result-score strong { display: block; font: 700 clamp(50px, 7vw, 84px)/.8 Georgia, serif; }
.result-score span { color: var(--ink-soft); font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.comparison { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 6vw, 84px); margin-top: 38px; }
.path-column h2 { display: flex; justify-content: space-between; gap: 20px; margin: 0 0 18px; font: 700 20px Georgia, serif; }
.path-column h2 span { color: var(--ink-soft); font: 800 11px "Avenir Next", sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.result-path { list-style: none; margin: 0; padding: 0; }
.result-path li { position: relative; min-height: 42px; padding: 8px 0 8px 30px; font: 700 16px Georgia, serif; }
.result-path li::before { content: ""; position: absolute; left: 4px; top: 15px; width: 10px; height: 10px; border: 2px solid var(--paper); outline: 1px solid var(--ink); border-radius: 50%; background: var(--paper); z-index: 1; }
.result-path li::after { content: ""; position: absolute; left: 9px; top: 27px; bottom: -15px; width: 1px; background: var(--rule); }
.result-path li:last-child::before { background: var(--green); outline-color: var(--green); }
.result-path li:last-child::after { display: none; }
.result-metrics { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-top: 38px; }
.metric { padding: 20px 14px; text-align: center; }
.metric + .metric { border-left: 1px solid var(--rule); }
.metric strong { display: block; font: 700 26px Georgia, serif; }
.metric span { display: block; margin-top: 5px; color: var(--ink-soft); font-size: 10px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.result-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 30px; }
.ai-verdict { margin: 28px 0 0; padding: 13px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); color: var(--accent-dark); font: italic 700 18px Georgia, serif; }

.summary-hero { width: min(1080px, 100%); margin: 0 auto; padding: clamp(48px, 8vh, 92px) 0; }
.summary-title { max-width: 780px; margin: 0; font: 700 clamp(54px, 8vw, 92px)/.9 Georgia, serif; letter-spacing: -.055em; }
.summary-title em { color: var(--accent); font-weight: 400; }
.summary-score { margin: 42px 0 36px; padding: 24px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.summary-score strong { font: 700 clamp(64px, 10vw, 120px)/.75 Georgia, serif; }
.summary-score span { margin-left: 14px; color: var(--ink-soft); font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.summary-item { min-height: 130px; padding: 22px; background: var(--paper); }
.summary-item strong { display: block; font: 700 32px Georgia, serif; }
.summary-item span { display: block; margin-top: 8px; color: var(--ink-soft); font-size: 11px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.summary-rounds { margin-top: 42px; border-top: 1px solid var(--rule); }
.summary-round { display: grid; grid-template-columns: 44px 1fr auto auto; gap: 18px; align-items: center; min-height: 64px; border-bottom: 1px solid var(--rule); }
.summary-round-index { color: var(--ink-soft); font: italic 14px Georgia, serif; }
.summary-round-route { font: 700 16px Georgia, serif; }
.summary-round-meta { color: var(--ink-soft); font-size: 12px; }
.summary-round-score { min-width: 62px; text-align: right; font: 700 18px Georgia, serif; }

.room-entry-layout { display: grid; grid-template-columns: 1fr minmax(360px, 520px); gap: clamp(60px, 10vw, 150px); align-items: center; min-height: calc(100dvh - 92px); padding: 50px 0; }
.room-entry-form { padding: 32px 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); }
.field-label { display: block; margin: 0 0 8px; color: var(--ink-soft); font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.line-input { width: 100%; height: 54px; margin-bottom: 20px; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; outline: 0; background: transparent; color: var(--ink); font: 700 25px Georgia, serif; }
.line-input:focus { border-bottom: 2px solid var(--accent); }
.line-input::placeholder { color: #a59d90; font-style: italic; font-weight: 400; }
.code-input { text-transform: uppercase; letter-spacing: .22em; }
.room-primary { width: 100%; margin-top: 6px; }
.or-rule { display: flex; align-items: center; gap: 12px; margin: 28px 0; color: var(--ink-soft); font: italic 13px Georgia, serif; }
.or-rule::before, .or-rule::after { content: ""; height: 1px; flex: 1; background: var(--rule); }
.room-back { display: block; margin: 22px auto 0; }
.form-error { margin: 16px 0 0; color: var(--danger); font-size: 13px; line-height: 1.45; }

.lobby-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(330px, .75fr); gap: clamp(50px, 8vw, 110px); padding: clamp(44px, 8vh, 84px) 0; }
.room-code-block { display: flex; align-items: center; gap: 18px; padding: 17px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.room-code-block > span { color: var(--ink-soft); font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.room-code-block strong { margin-right: auto; font: 700 clamp(30px, 5vw, 52px)/1 Georgia, serif; letter-spacing: .16em; }
.lobby-heading { display: flex; align-items: baseline; justify-content: space-between; margin: 44px 0 14px; }
.lobby-heading h1 { margin: 0; font: 700 clamp(37px, 5vw, 60px)/1 Georgia, serif; }
.lobby-heading span { color: var(--ink-soft); font: italic 18px Georgia, serif; }
.player-list { border-top: 1px solid var(--rule); }
.player-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 16px; align-items: center; min-height: 66px; border-bottom: 1px solid var(--rule); }
.player-row.is-me { background: rgba(255,253,248,.38); }
.player-order { color: var(--ink-soft); font: italic 13px Georgia, serif; }
.player-name { font: 700 19px Georgia, serif; }
.player-name em { margin-left: 9px; color: var(--accent-dark); font: 900 8px "Avenir Next", sans-serif; letter-spacing: .12em; }
.player-status { color: var(--ink-soft); font-size: 11px; font-weight: 800; }
.player-status.ready { color: var(--green); }
.lobby-settings { align-self: start; padding-top: 3px; }
.lobby-settings > .setting-label { display: block; margin-bottom: 15px; }
.lobby-settings .setting-row { grid-template-columns: 110px 1fr; min-height: 72px; gap: 12px; }
.lobby-settings .choice-line { justify-content: flex-start; }
.lobby-settings .choice-button { padding: 8px 10px; }
.setting-row.compact strong { justify-self: end; font: 700 20px Georgia, serif; }
.lobby-actions { display: grid; gap: 10px; margin-top: 26px; }
.host-note { margin: 8px 0; color: var(--ink-soft); font: italic 15px Georgia, serif; text-align: center; }
.local-room-note { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--rule); color: var(--ink-soft); font-size: 11px; line-height: 1.55; }

.waiting-layout { width: min(840px, 100%); min-height: calc(100dvh - 92px); display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0 auto; padding: 60px 0; text-align: center; }
.waiting-route { position: relative; display: flex; justify-content: space-between; width: min(360px, 78vw); margin-bottom: 42px; }
.waiting-route::before { content: ""; position: absolute; left: 8px; right: 8px; top: 8px; height: 1px; background: var(--ink); }
.waiting-route i { z-index: 1; width: 17px; height: 17px; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper); animation: route-pulse 1.6s ease-in-out infinite; }
.waiting-route i:nth-child(2) { animation-delay: .2s; }
.waiting-route i:nth-child(3) { animation-delay: .4s; }
.waiting-route i:nth-child(4) { animation-delay: .6s; background: var(--accent); border-color: var(--accent); }
@keyframes route-pulse { 50% { transform: scale(1.35); } }
.waiting-layout h1 { margin: 0; font: 700 clamp(50px, 9vw, 96px)/.95 Georgia, serif; letter-spacing: -.05em; }
.waiting-layout > p:not(.eyebrow):not(.form-error) { max-width: 580px; color: var(--ink-soft); font-size: 16px; line-height: 1.6; }
.waiting-player-line { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin: 28px 0; }
.waiting-player-line span { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: 12px; font-weight: 800; }
.waiting-player-line i { width: 8px; height: 8px; border: 1px solid currentColor; border-radius: 50%; }
.waiting-player-line span.done { color: var(--green); }
.waiting-player-line span.done i { background: var(--green); }
.waiting-score { margin-top: 10px; font: 700 76px/1 Georgia, serif; }
.waiting-score small { display: block; margin-top: 7px; color: var(--ink-soft); font: 900 10px "Avenir Next", sans-serif; letter-spacing: .12em; text-transform: uppercase; }

.multiplayer-result-layout { width: min(1280px, 100%); margin: 0 auto; padding: 42px 0 70px; }
.multi-result-header { display: flex; align-items: end; justify-content: space-between; gap: 30px; padding-bottom: 26px; border-bottom: 1px solid var(--ink); }
.multi-result-header h1 { margin: 0; font: 700 clamp(42px, 7vw, 78px)/.9 Georgia, serif; letter-spacing: -.045em; }
.multi-result-header h1 em { color: var(--accent); font-weight: 400; }
.optimal-stamp { display: grid; grid-template-columns: auto auto; column-gap: 9px; align-items: end; text-align: right; }
.optimal-stamp span { grid-column: 1 / -1; color: var(--ink-soft); font-size: 9px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.optimal-stamp strong { font: 700 48px/.9 Georgia, serif; }
.optimal-stamp small { padding-bottom: 5px; color: var(--ink-soft); font-size: 10px; text-transform: uppercase; }
.player-path-comparison { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-left: 1px solid var(--rule); margin-top: 34px; }
.multiplayer-path { min-width: 0; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 22px; background: rgba(255,253,248,.25); }
.multiplayer-path.winner { box-shadow: inset 0 4px var(--accent); }
.multiplayer-path.optimum-example { background: var(--ink); color: var(--paper); }
.multiplayer-path header { display: grid; grid-template-columns: 30px 1fr auto; gap: 9px; align-items: baseline; padding-bottom: 13px; border-bottom: 1px solid currentColor; }
.multiplayer-path header h2 { overflow: hidden; margin: 0; text-overflow: ellipsis; white-space: nowrap; font: 700 18px Georgia, serif; }
.multiplayer-path header strong { font: 700 21px Georgia, serif; }
.rank-number { color: var(--ink-soft); font: italic 12px Georgia, serif; }
.optimum-example .rank-number { color: var(--accent); }
.multiplayer-path ol { list-style: none; margin: 18px 0; padding: 0; }
.multiplayer-path li { position: relative; min-height: 31px; padding-left: 21px; font: 700 13px/1.35 Georgia, serif; }
.multiplayer-path li::before { content: ""; position: absolute; left: 1px; top: 4px; width: 8px; height: 8px; border: 1px solid currentColor; border-radius: 50%; background: var(--paper); }
.multiplayer-path li::after { content: ""; position: absolute; left: 5px; top: 13px; bottom: -3px; width: 1px; background: currentColor; opacity: .4; }
.multiplayer-path li:last-child::before { background: var(--accent); border-color: var(--accent); }
.multiplayer-path li:last-child::after { display: none; }
.multiplayer-path footer { display: flex; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid currentColor; color: var(--ink-soft); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.optimum-example footer { color: var(--paper-deep); }

.multiplayer-summary { width: min(980px, 100%); margin: 0 auto; padding: clamp(52px, 8vh, 90px) 0; }
.multiplayer-summary h1 { max-width: 760px; margin: 0 0 48px; font: 700 clamp(52px, 8vw, 90px)/.92 Georgia, serif; letter-spacing: -.055em; }
.multiplayer-summary h1 em { color: var(--accent); font-weight: 400; }
.podium-list { border-top: 1px solid var(--ink); }
.podium-row { display: grid; grid-template-columns: 50px 1fr 100px auto; gap: 18px; align-items: center; min-height: 82px; border-bottom: 1px solid var(--rule); }
.podium-row > span { color: var(--accent-dark); font: italic 24px Georgia, serif; }
.podium-row > strong { font: 700 25px Georgia, serif; }
.podium-row > em { color: var(--ink-soft); font-size: 11px; font-style: normal; text-transform: uppercase; }
.podium-row > b { font: 700 26px Georgia, serif; }

@media (max-width: 980px) {
  .menu-layout { grid-template-columns: 1fr; min-height: auto; padding-top: 56px; gap: 64px; }
  .menu-intro { max-width: 760px; }
  .mode-list { margin-bottom: 30px; }
  .game-layout { grid-template-columns: 310px minmax(0, 1fr); gap: 30px; }
  .link-list { grid-template-columns: 1fr; }
  .link-option:nth-child(odd) { border-right: 0; padding-right: 8px; }
  .link-option:nth-child(even) { padding-left: 2px; }
  .room-entry-layout { gap: 50px; }
  .lobby-layout { grid-template-columns: 1fr 330px; gap: 42px; }
  .player-path-comparison { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .app-shell { padding-left: 16px; padding-right: 16px; }
  .brand-note { display: none; }
  .display-title { font-size: clamp(58px, 18vw, 86px); }
  .menu-layout { padding-top: 46px; gap: 52px; }
  .mode-row { grid-template-columns: 32px 1fr 24px; gap: 10px; padding: 20px 0; }
  .mode-title { font-size: 27px; }
  .mode-description { font-size: 13px; }
  .setting-row { grid-template-columns: 1fr; gap: 12px; padding: 18px 0; }
  .choice-line { justify-content: flex-start; }
  .settings-actions { position: sticky; z-index: 10; bottom: calc(8px + var(--safe-bottom)); padding: 10px 0; background: linear-gradient(transparent, var(--paper) 18%); }
  .game-layout { display: flex; flex-direction: column; gap: 0; min-height: 0; padding-top: 16px; }
  .route-pane { position: static; max-height: none; overflow: visible; padding: 0; }
  .target-band { position: sticky; z-index: 9; top: calc(0px + var(--safe-top)); margin: 0 -16px; padding: 12px 16px; background: rgba(243,239,229,.96); backdrop-filter: blur(8px); }
  .target-name { font-size: 18px; }
  .route-heading { margin-top: 16px; }
  .route-list { display: flex; align-items: center; gap: 0; overflow-x: auto; margin: 10px -16px 0; padding: 4px 16px 12px; scrollbar-width: none; }
  .route-list::-webkit-scrollbar { display: none; }
  .route-list::before { left: 25px; right: 25px; top: 16px; bottom: auto; width: auto; height: 1px; }
  .route-node { display: flex; flex-direction: column; gap: 7px; min-width: 104px; max-width: 140px; min-height: 62px; text-align: center; }
  .route-node + .route-node { margin: 0; }
  .route-node-copy { width: 100%; padding: 0 6px; }
  .route-node-title { font-size: 13px; }
  .route-node-meta { display: none; }
  .route-empty { display: none; }
  .route-stats { margin-top: 8px; padding: 12px 0; }
  .mini-stat strong { font-size: 19px; }
  .decision-pane { padding-top: 24px; }
  .article-title { font-size: clamp(42px, 13vw, 64px); }
  .article-context { grid-template-columns: 1fr; gap: 14px; margin-top: 16px; }
  .article-summary { font-size: 15px; }
  .link-option { min-height: 70px; }
  .game-actions { position: sticky; z-index: 8; bottom: calc(5px + var(--safe-bottom)); margin: 18px -16px -6px; padding: 10px 16px; background: rgba(243,239,229,.96); border-top: 1px solid var(--rule); backdrop-filter: blur(8px); }
  .result-header { grid-template-columns: 1fr; }
  .result-score { text-align: left; }
  .comparison { grid-template-columns: 1fr; }
  .result-metrics { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(3) { border-left: 0; border-top: 1px solid var(--rule); }
  .metric:nth-child(4) { border-top: 1px solid var(--rule); }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-round { grid-template-columns: 32px 1fr auto; gap: 10px; }
  .summary-round-meta { display: none; }
  .room-entry-layout { grid-template-columns: 1fr; min-height: auto; gap: 18px; padding-top: 42px; }
  .room-entry-intro .network-signature { display: none; }
  .room-entry-form { padding-top: 24px; }
  .lobby-layout { grid-template-columns: 1fr; gap: 42px; padding-top: 38px; }
  .room-code-block { flex-wrap: wrap; gap: 10px; }
  .room-code-block strong { width: 100%; order: 2; font-size: 42px; }
  .room-code-block .text-button { margin-left: auto; }
  .player-row { grid-template-columns: 30px 1fr; }
  .player-status { grid-column: 2; margin-top: -12px; padding-bottom: 10px; }
  .lobby-settings { padding-bottom: 40px; }
  .player-path-comparison { grid-template-columns: 1fr; }
  .multi-result-header { align-items: start; }
  .multiplayer-path { padding: 18px; }
  .podium-row { grid-template-columns: 34px 1fr auto; gap: 10px; }
  .podium-row > em { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Live Wikipedia play surface */
.live-wikipedia-game {
  grid-template-columns: minmax(245px, 310px) minmax(0, 1fr);
  gap: clamp(22px, 3.2vw, 52px);
  align-items: start;
}
.live-wikipedia-game .route-pane { top: 18px; }
.live-wikipedia-pane { padding-top: 0; }
.live-game-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--rule); }
.live-game-actions .text-button { padding-inline: 2px 8px; text-align: left; }
.wiki-browser { position: relative; overflow: hidden; border: 1px solid #a2a9b1; border-top: 3px solid #202122; background: #fff; color: #202122; box-shadow: 0 18px 54px rgba(23,34,29,.13); }
.wiki-browser::before { content: ""; position: absolute; z-index: 2; top: -3px; left: 0; width: 76px; height: 3px; background: var(--accent); }
.wiki-browser-bar { min-height: 70px; display: grid; grid-template-columns: auto minmax(180px, 1fr) auto; gap: 24px; align-items: center; padding: 10px 18px; border-bottom: 1px solid #c8ccd1; background: #fff; }
.wiki-wordmark { display: flex; align-items: center; gap: 10px; }
.wiki-globe { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid #72777d; border-radius: 50%; font: 700 25px Georgia, serif; background: radial-gradient(circle at 35% 32%, #fff 0 22%, #eaecf0 68%, #c8ccd1 100%); }
.wiki-wordmark strong { display: block; font: 700 21px/1 Georgia, "Times New Roman", serif; letter-spacing: .08em; }
.wiki-wordmark small { display: block; margin-top: 4px; font: 9px/1.1 Georgia, serif; letter-spacing: .13em; }
.wiki-current-page { min-width: 0; padding-left: 20px; border-left: 1px solid #c8ccd1; }
.wiki-current-page span { display: block; color: #54595d; font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.wiki-language-badge { display: inline-block; margin-right: 7px; padding: 2px 4px; border: 1px solid #a2a9b1; color: #202122; font-size: 8px; line-height: 1; letter-spacing: .08em; vertical-align: 1px; }
.wiki-current-page strong { display: block; overflow: hidden; margin-top: 3px; text-overflow: ellipsis; white-space: nowrap; font: 700 16px Georgia, serif; }
.wiki-contained-badge { padding: 6px 8px; border: 1px solid #14866d; color: #116b58; font-size: 8px; font-weight: 900; letter-spacing: .12em; white-space: nowrap; }
.wiki-game-notice { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center; min-height: 42px; padding: 8px 18px; border-bottom: 1px solid #c8ccd1; background: #f8f9fa; color: #54595d; }
.wiki-game-notice p { margin: 0; font-size: 11px; line-height: 1.35; }
.wiki-link-counter { display: grid; min-width: 48px; justify-items: end; color: #202122; line-height: 1; }
.wiki-link-counter strong { font: 700 15px/1 Georgia, "Times New Roman", serif; }
.wiki-link-counter small { margin-top: 3px; color: #72777d; font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #14866d; box-shadow: 0 0 0 3px rgba(20,134,109,.12); }
.wiki-article-shell { width: 100%; }
.wiki-article { min-height: 68vh; padding: clamp(24px, 4vw, 58px) clamp(20px, 5vw, 78px) 70px; font-family: sans-serif; font-size: 14px; line-height: 1.6; }
.wiki-article-heading { position: relative; margin-bottom: 18px; border-bottom: 1px solid #a2a9b1; }
.wiki-article-heading::before { content: ""; position: absolute; top: 8px; left: -18px; width: 4px; height: 28px; background: var(--accent); }
.wiki-article-heading h1 { margin: 0 0 8px; font: 400 clamp(34px, 4.5vw, 52px)/1.12 Georgia, "Times New Roman", serif; letter-spacing: -.025em; }
.wiki-article-heading > div { display: flex; gap: 20px; color: #36c; font-size: 12px; }
.wiki-article-heading > div span { padding: 8px 0 7px; }
.wiki-article-heading > div span:first-child { color: #202122; border-bottom: 2px solid #202122; }
.wiki-article p { margin: .55em 0 1em; }
.wiki-article h2 { margin: 1.45em 0 .55em; padding-bottom: .18em; border-bottom: 1px solid #a2a9b1; font: 400 1.65em/1.25 Georgia, "Times New Roman", serif; }
.wiki-article h3 { margin: 1.25em 0 .45em; font: 700 1.25em/1.3 sans-serif; }
.wiki-article h4 { margin: 1em 0 .4em; font-size: 1.05em; }
.wiki-article a[data-wiki-title] { color: #36c; text-decoration: none; cursor: pointer; border-bottom: 1px solid transparent; }
.wiki-article a[data-wiki-title]:hover, .wiki-article a[data-wiki-title]:focus-visible { color: #3056a9; border-bottom-color: currentColor; outline: none; }
.wiki-article a[data-wiki-title]::after { content: ""; display: inline-block; width: 4px; height: 4px; margin: 0 1px 1px 2px; border-radius: 50%; background: var(--accent); opacity: 0; transform: scale(.4); transition: opacity .12s ease, transform .12s ease; }
.wiki-article a[data-wiki-title]:hover::after { opacity: 1; transform: scale(1); }
.wiki-article .wiki-nonplayable-link { color: #72777d; text-decoration: none; cursor: not-allowed; }
.wiki-article a[data-wiki-section] { color: #36c; text-decoration: none; }
.wiki-article img { max-width: 100%; height: auto; }
.wiki-article figure { max-width: min(100%, 320px); margin: 0 0 18px 24px; padding: 4px; border: 1px solid #c8ccd1; background: #f8f9fa; }
.wiki-article figure[typeof~="mw:File/Thumb"], .wiki-article .thumb, .wiki-article .tright { float: right; clear: right; }
.wiki-article figure[typeof~="mw:File/Thumb"] figcaption, .wiki-article .thumbcaption { padding: 5px 7px; font-size: 12px; line-height: 1.4; }
.wiki-article .infobox { float: right; clear: right; width: min(320px, 42%); margin: 0 0 20px 28px; border: 1px solid #a2a9b1; border-spacing: 3px; background: #f8f9fa; color: #202122; font-size: 12px; line-height: 1.45; }
.wiki-article .infobox th, .wiki-article .infobox td { padding: 4px 7px; vertical-align: top; }
.wiki-article .infobox-above, .wiki-article .infobox-title { font-size: 15px; }
.wiki-article table.wikitable { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1em 0; background: #f8f9fa; font-size: 12px; }
.wiki-article table.wikitable th, .wiki-article table.wikitable td { border: 1px solid #a2a9b1; padding: 5px 8px; }
.wiki-article table.wikitable th { background: #eaecf0; }
.wiki-article .toc, .wiki-article .vector-toc { width: min(100%, 430px); margin: 18px 0; padding: 12px 18px; border: 1px solid #a2a9b1; background: #f8f9fa; }
.wiki-article .references { font-size: 11px; line-height: 1.45; }
.wiki-article .mw-collapsible-toggle, .wiki-article .mw-empty-elt { display: none; }
.wiki-article::after { content: ""; display: block; clear: both; }
.wiki-attribution { display: flex; justify-content: space-between; gap: 20px; padding: 11px 18px; border-top: 1px solid #c8ccd1; background: #f8f9fa; color: #72777d; font-size: 10px; }
.wiki-loading, .wiki-load-error { min-height: 54vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.wiki-loading i { width: 58px; height: 58px; margin-bottom: 20px; border: 2px solid #c8ccd1; border-top-color: #36c; border-radius: 50%; animation: wiki-spin .8s linear infinite; }
.wiki-loading strong, .wiki-load-error strong { font: 400 24px Georgia, serif; }
.wiki-loading span, .wiki-load-error p { margin-top: 8px; color: #72777d; font-size: 12px; }
.wiki-load-error .secondary-button { margin-top: 18px; }
@keyframes wiki-spin { to { transform: rotate(1turn); } }

@media (max-width: 980px) {
  .live-wikipedia-game { grid-template-columns: minmax(210px, 230px) minmax(0, 1fr); gap: 22px; }
  .target-band { grid-template-columns: minmax(0, 1fr) 26px minmax(0, 1fr); gap: 7px; }
  .target-arrow { width: 25px; height: 25px; font-size: 15px; }
  .target-name { font-size: clamp(16px, 2vw, 20px); }
  .wiki-browser-bar { grid-template-columns: auto 1fr; gap: 14px; }
  .wiki-contained-badge { grid-column: 1 / -1; justify-self: end; margin-top: -26px; }
  .wiki-wordmark small { display: none; }
  .wiki-article { padding-left: 30px; padding-right: 30px; }
}

@media (max-width: 760px) {
  .live-wikipedia-game { display: flex; }
  .live-wikipedia-game .route-pane { width: 100%; }
  .route-pane { display: block; overflow: visible; padding-right: 0; }
  .live-game-actions { position: static; margin-top: 6px; padding: 8px 0 14px; }
  .wiki-browser { margin: 0 -16px; border-left: 0; border-right: 0; box-shadow: none; }
  .wiki-browser-bar { min-height: 60px; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 8px 13px; }
  .wiki-globe { width: 34px; height: 34px; font-size: 20px; }
  .wiki-wordmark strong { font-size: 17px; }
  .wiki-current-page { padding-left: 10px; }
  .wiki-current-page strong { font-size: 13px; }
  .wiki-contained-badge { display: none; }
  .wiki-game-notice { grid-template-columns: 9px 1fr auto; padding: 8px 13px; }
  .wiki-game-notice p { font-size: 10px; }
  .wiki-article { min-height: 72vh; padding: 24px 16px 62px; font-size: 14px; line-height: 1.58; }
  .wiki-article-heading h1 { font-size: 35px; }
  .wiki-article-heading > div { gap: 15px; overflow-x: auto; }
  .wiki-article .infobox { float: none; width: 100%; margin: 18px 0; }
  .wiki-article figure, .wiki-article figure[typeof~="mw:File/Thumb"], .wiki-article .thumb, .wiki-article .tright { float: none; max-width: 100%; margin: 18px auto; }
  .wiki-attribution { padding: 10px 13px; }
}

/*
 * Ana menü bağlantısı — siteye (worldofsimulation.com) dönüş.
 *
 * Üst şeridin içinde, dil düğmelerinin yanında duruyor. Oyunun kendi
 * "marka" düğmesi oyunun MENÜSÜNE döner; bu bağlantı SİTEYE döner — ikisi
 * ayrı şeyler, o yüzden ayrı düğmeler.
 */
.portal-home {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--rule);
  border-radius: 11px;
  background: var(--white);
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.portal-home:hover,
.portal-home:focus-visible {
  background: var(--paper-deep);
  border-color: var(--ink-soft);
}

.portal-home svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

/* Dar ekranda yazı düşer, ev simgesi kalır: üst şerit tek satırda durur. */
@media (max-width: 560px) {
  .portal-home {
    padding: 7px 9px;
  }
  .portal-home span {
    display: none;
  }
}

.score-guide{border:1px solid #d3dad4;border-radius:12px;padding:12px 16px;margin:12px 0;font-size:13px;line-height:1.6;background:#f4f6ef}.score-guide summary{font-weight:700;cursor:pointer}.score-guide p{margin:10px 0}.score-breakdown{font-weight:700;color:#346854}
