:root {
  --night: #0b110d;
  --night-soft: #111913;
  --forest-glass: rgba(18, 27, 20, .78);
  --forest-solid: #151e17;
  --pearl: #f0eee4;
  --pearl-soft: #d8d9cd;
  --muted: #aeb9aa;
  --quiet: #7f8e80;
  --sage: #98b28d;
  --sage-bright: #bfd0b2;
  --amber: #d6a45d;
  --amber-bright: #f0c57c;
  --risk: #d77b66;
  --risk-soft: #a95f51;
  --water: #90b8b2;
  --line: rgba(222, 228, 211, .16);
  --line-strong: rgba(222, 228, 211, .28);
  --shadow: 0 24px 72px rgba(0, 0, 0, .34);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  font-family: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--pearl);
  background: var(--night);
  font-synthesis: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html,
body { width: 100%; height: 100%; margin: 0; overflow: hidden; }

body {
  min-width: 320px;
  background: var(--night);
  color: var(--pearl);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
select,
input { font: inherit; }

button,
select { cursor: pointer; }

button { color: inherit; }

button:focus-visible,
select:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--amber-bright);
  outline-offset: 3px;
}

button:disabled { cursor: not-allowed; opacity: .45; }

svg { display: block; }

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

.skip-link {
  position: fixed;
  z-index: 200;
  top: 10px;
  left: 10px;
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  color: var(--night);
  background: var(--amber-bright);
  font-weight: 750;
  transform: translateY(-160%);
}

.skip-link-secondary { left: 184px; }
.skip-link:focus { transform: translateY(0); }

.app-shell {
  position: relative;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  isolation: isolate;
  background: var(--night);
}

.topbar {
  position: relative;
  z-index: 60;
  flex: 0 0 66px;
  min-height: 66px;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto auto auto;
  align-items: center;
  gap: 18px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 18, 14, .93);
  backdrop-filter: blur(20px) saturate(115%);
}

.brand,
.identity-line,
.connection,
.primary-controls,
.speed-control,
.control-button { display: flex; align-items: center; }

.brand { min-width: 0; gap: 10px; }
.brand-mark { width: 42px; height: 42px; flex: none; }
.brand strong { display: block; font-size: 19px; line-height: 1; letter-spacing: -.035em; white-space: nowrap; }
.brand strong span { color: var(--amber-bright); font-size: 12px; letter-spacing: 0; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }

.identity-line { gap: 11px; }
.identity-line > span:not(.life-signal) { display: grid; gap: 1px; }
.identity-line small { color: var(--muted); font-size: 11px; line-height: 1.1; }
.identity-line strong { max-width: 126px; overflow: hidden; color: var(--pearl-soft); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.identity-line > i { width: 1px; height: 26px; background: var(--line); }
.life-signal,
.connection-dot,
.live-pip { border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 5px rgba(214, 164, 93, .08); }
.life-signal { width: 7px; height: 7px; }

.connection { gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.connection-dot { width: 7px; height: 7px; }
.connection.is-live .connection-dot { background: var(--sage-bright); box-shadow: 0 0 0 5px rgba(191, 208, 178, .08); }

.primary-controls { justify-content: flex-end; gap: 8px; }
.speed-control { min-height: 46px; gap: 7px; padding: 0 7px 0 12px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255, 255, 255, .025); }
.speed-control span { color: var(--quiet); font-size: 10px; }
.speed-control select { height: 34px; padding: 0 24px 0 8px; border: 0; color: var(--pearl-soft); background: transparent; font-weight: 700; }

.control-button,
.icon-button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .035);
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.control-button { justify-content: center; gap: 8px; padding: 0 13px; color: var(--pearl-soft); font-size: 12px; font-weight: 650; white-space: nowrap; }
.control-button svg { width: 18px; height: 18px; fill: currentColor; }
.control-button:hover,
.icon-button:hover { color: var(--pearl); border-color: var(--line-strong); background: rgba(255, 255, 255, .075); }
.control-button:active,
.icon-button:active { transform: translateY(1px); }
.pause-button { color: #15190f; border-color: var(--sage-bright); background: var(--sage-bright); }
.pause-button:hover { color: #0b100a; background: #d2dfc8; }
.quiet-button[aria-expanded="true"],
.quiet-button[aria-pressed="true"] { color: var(--night); border-color: var(--amber-bright); background: var(--amber-bright); }

.experience {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: #111810;
}

.experience::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(6, 10, 7, .32), transparent 22%, transparent 70%, rgba(6, 9, 7, .36)),
    radial-gradient(ellipse at 50% 45%, transparent 52%, rgba(5, 8, 6, .2));
}

.webgl-root,
.webgl-root canvas,
.scene-grid { position: absolute; inset: 0; width: 100%; height: 100%; }
.webgl-root { z-index: 0; }
.webgl-root canvas { display: block; touch-action: none; }

.scene-grid {
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 0;
  pointer-events: none;
  transition: grid-template-columns 360ms cubic-bezier(.2, .75, .25, 1);
}

.experience[data-brain-open="true"] .scene-grid { grid-template-columns: minmax(0, 1fr) minmax(280px, 29vw); }

.scene-region { position: relative; min-width: 0; overflow: hidden; pointer-events: none; }
.surface-control { pointer-events: auto; }
.surface-copy { pointer-events: none; }

.world-view::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(7, 12, 8, .3), transparent 26%, transparent 77%, rgba(7, 12, 8, .12));
}

.world-heading { position: absolute; z-index: 6; top: 22px; left: 24px; max-width: min(560px, 62%); text-shadow: 0 2px 18px rgba(0, 0, 0, .68); }
.world-heading p { display: flex; align-items: center; gap: 9px; margin: 0 0 6px; color: var(--pearl-soft); font-size: 13px; }
.world-heading p i { width: 18px; height: 1px; background: var(--amber); }
.world-heading h1 { margin: 0; font-size: clamp(24px, 2.6vw, 41px); font-weight: 560; letter-spacing: -.045em; line-height: 1.02; text-wrap: balance; }
.world-heading h1.is-alert { color: #ffb0a6; }

.world-clock { position: absolute; z-index: 6; top: 22px; right: 22px; display: grid; justify-items: end; text-shadow: 0 2px 18px rgba(0, 0, 0, .68); }
.world-clock strong { font-size: 20px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.world-clock span { color: var(--pearl-soft); font-size: 11px; }

.memory-map-panel,
.organism-card,
.world-controls,
.tutorial-panel,
.replay-panel,
.evidence-strip,
.brain-head,
.brain-mode {
  border: 1px solid var(--line);
  background: var(--forest-glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px) saturate(112%);
}

.memory-map-panel {
  position: absolute;
  z-index: 7;
  top: 82px;
  right: 20px;
  width: 230px;
  padding: 12px;
  border-radius: var(--radius);
}
.memory-map-panel > div:first-child { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.memory-map-panel h2 { margin: 0; font-size: 13px; font-weight: 720; }
.memory-map-panel > div:first-child span { color: var(--muted); font-size: 11px; }
#memory-map { display: block; width: 100%; height: 120px; margin-top: 7px; border-radius: 8px; background: rgba(8, 13, 9, .72); }
.map-key { display: flex; justify-content: space-between; margin-top: 8px; color: var(--pearl-soft); font-size: 11px; }
.map-key span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 4px; border-radius: 50%; vertical-align: 1px; }
.map-key .is-food::before { background: var(--amber); }
.map-key .is-risk::before { background: var(--risk); }
.map-key .is-safe::before { background: var(--sage); }

.organism-card {
  position: absolute;
  z-index: 7;
  left: 20px;
  bottom: 104px;
  width: min(370px, calc(100% - 40px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius);
}
.organism-card-heading { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.organism-card-heading > span { margin-bottom: 6px; padding: 3px 9px; border: 1px solid rgba(191, 208, 178, .3); border-radius: 99px; color: var(--sage-bright); font-size: 11px; font-weight: 650; }
.organism-card-heading strong { font-size: 22px; letter-spacing: -.025em; }
.organism-card-heading small { max-width: 100%; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.decision-plain { margin: 0; color: var(--pearl-soft); font-size: 14px; line-height: 1.45; }
.decision-plain strong { color: var(--pearl); }

/* Sahne etiketleri: 3B nesnelerin üstünde duran küçük adlar (sade görünümde renk efsanesinin yerine). */
.scene-labels { position: absolute; inset: 0; z-index: 5; overflow: hidden; pointer-events: none; }
.scene-tag {
  position: absolute;
  top: 0;
  left: 0;
  padding: 4px 10px;
  border-radius: 99px;
  color: #11160f;
  background: var(--tag, #ffd27a);
  box-shadow: 0 3px 12px rgba(0, 0, 0, .45);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 220ms ease;
  will-change: transform;
}
.scene-tag::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 9px; height: 9px; background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 2px; z-index: -1; }
.scene-tag.is-visible { opacity: .96; }
.scene-tag.is-male { --tag: #ffc96b; }
.scene-tag.is-food { --tag: #bfe07a; }
.scene-tag.is-danger { --tag: #ff7a70; }
.scene-tag.is-female { --tag: #f5a3c4; }

.detail-toggle { display: flex; align-items: center; gap: 5px; min-height: 38px; margin-left: 5px; padding: 0 10px; border: 0; border-left: 1px solid var(--line); border-radius: 0 8px 8px 0; color: var(--muted); background: transparent; font-size: 10px; font-weight: 680; }
.detail-toggle svg { width: 14px; height: 14px; fill: currentColor; }
.detail-toggle:hover { color: var(--pearl); }
.detail-toggle[aria-pressed="true"] { color: var(--amber-bright); }

/* Sade görünüm (varsayılan): ayrıntı panelleri gizlenir, kartlar aşağı iner. */
body:not(.detail-mode) .memory-map-panel,
body:not(.detail-mode) .evidence-strip,
body:not(.detail-mode) .overlay-controls { display: none; }
body:not(.detail-mode) .organism-card,
body:not(.detail-mode) .world-controls,
body:not(.detail-mode) .pilot-pad,
body:not(.detail-mode) .replay-panel { bottom: 22px; }
body:not(.detail-mode) .tutorial-panel { bottom: 30px; }
body:not(.detail-mode) .detail-only { display: none; }
body:not(.detail-mode) .brain-groups { bottom: 24px; }
body:not(.detail-mode) .brain-legend { bottom: 138px; }
.brain-view.has-cells .brain-legend { bottom: 344px; }
body:not(.detail-mode) .brain-view.has-cells .brain-legend { bottom: 262px; }

.glossary { display: grid; gap: 6px; margin: 0; }
.glossary div { padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255, 255, 255, .02); }
.glossary dt { color: var(--pearl-soft); font-size: 10px; font-weight: 720; }
.glossary dd { margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.4; }

.drive-list { display: grid; gap: 7px; padding-top: 10px; border-top: 1px solid var(--line); }
.drive-row { display: grid; grid-template-columns: 118px 1fr 66px; align-items: center; gap: 9px; color: var(--pearl-soft); font-size: 12px; }
.drive-row output { color: var(--pearl-soft); font-size: 12px; font-weight: 650; text-align: right; }
.drive-row.is-critical span,
.drive-row.is-critical output { color: #ff9a8f; }
.drive-track { height: 7px; overflow: hidden; border-radius: 99px; background: rgba(255, 255, 255, .1); }
.drive-fill { height: 100%; border-radius: inherit; transition: width 280ms ease; }

.world-controls {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 104px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border-radius: 13px;
  transform: translateX(-50%);
}
.segmented { display: flex; align-items: stretch; gap: 2px; }
.segmented button,
.overlay-controls button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 680;
  transition: color 150ms ease, background 150ms ease;
}
.segmented button { min-width: 58px; padding: 0 10px; }
.segmented button:hover,
.overlay-controls button:hover { color: var(--pearl); background: rgba(255, 255, 255, .055); }
.segmented button.is-active,
.segmented button[aria-pressed="true"],
.overlay-controls button[aria-pressed="true"] { color: #11170f; background: var(--sage-bright); }
.overlay-controls { display: flex; gap: 2px; padding-left: 5px; border-left: 1px solid var(--line); }
.overlay-controls button { display: flex; align-items: center; gap: 5px; padding: 0 9px; }
.overlay-controls svg { width: 14px; height: 14px; fill: currentColor; }

/* Pilot: kartın başındaki tek dokunuşluk anahtar + sağ altta küçük yön çubuğu ve "Uç" düğmesi. */
.agency-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  padding: 3px 4px 3px 9px;
  border: 1px solid rgba(191, 208, 178, .3);
  border-radius: 99px;
  color: var(--sage-bright);
  background: transparent;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}
.agency-switch:hover { border-color: rgba(191, 208, 178, .6); }
.agency-switch i { position: relative; width: 24px; height: 14px; border-radius: 99px; background: rgba(255, 255, 255, .14); transition: background 150ms ease; }
.agency-switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--pearl-soft); transition: transform 150ms ease; }
.agency-switch[aria-checked="true"] { border-color: rgba(255, 196, 92, .45); color: var(--amber-bright); }
.agency-switch[aria-checked="true"] i { background: var(--amber-bright); }
.agency-switch[aria-checked="true"] i::after { transform: translateX(10px); background: var(--night); }
.agency-switch [data-agency-label="PILOT"],
.agency-switch[aria-checked="true"] [data-agency-label="AUTO"] { display: none; }
.agency-switch[aria-checked="true"] [data-agency-label="PILOT"] { display: inline; }

.pilot-pad {
  position: absolute;
  z-index: 9;
  right: 22px;
  bottom: 104px;
  display: grid;
  grid-template-columns: auto auto;
  align-items: end;
  gap: 8px;
}
.pilot-pad[hidden] { display: none; }
.pilot-stick {
  position: relative;
  width: 88px;
  height: 88px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .06), rgba(9, 14, 10, .55) 72%);
  backdrop-filter: blur(6px);
  touch-action: none;
  pointer-events: auto;  /* sahne bölgesi olayları kanvasa bırakır; çubuk ve düğme kendisi alır */
  cursor: grab;
}
.pilot-stick::before { content: "▲"; position: absolute; top: 5px; left: 50%; color: var(--muted); font-size: 9px; transform: translateX(-50%); }
.pilot-knob {
  position: absolute;
  top: calc(50% - 15px);
  left: calc(50% - 15px);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--pearl-soft);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
  pointer-events: none;
  transition: transform 90ms ease;
}
.pilot-stick.is-active { cursor: grabbing; }
.pilot-stick.is-active .pilot-knob { background: var(--amber-bright); transition: none; }
.pilot-fly {
  width: 50px;
  height: 50px;
  margin-bottom: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--pearl);
  background: rgba(9, 14, 10, .62);
  font-size: 13px;
  font-weight: 760;
  pointer-events: auto;
  touch-action: manipulation;
}
.pilot-fly[aria-pressed="true"] { color: var(--night); background: var(--amber-bright); border-color: var(--amber-bright); }
.pilot-fly.is-unavailable { opacity: .45; }
.pilot-keys { grid-column: 1 / -1; color: var(--muted); font-size: 9px; text-align: center; }
@media (pointer: coarse) { .pilot-keys { display: none; } }

.brain-view {
  z-index: 4;
  opacity: 0;
  border-left: 1px solid var(--line-strong);
  background: radial-gradient(ellipse at 50% 44%, rgba(20, 30, 22, .05), rgba(9, 14, 10, .82) 84%);
  transition: opacity 220ms ease;
}
.experience[data-brain-open="true"] .brain-view { opacity: 1; }
.brain-head { position: absolute; z-index: 7; top: 14px; left: 14px; right: 14px; display: flex; justify-content: space-between; align-items: center; padding: 10px 10px 10px 13px; border-radius: 13px; }
.brain-head span { color: var(--sage-bright); font-size: 9px; }
.brain-head h2 { margin: 2px 0 0; font-size: 18px; font-weight: 610; letter-spacing: -.025em; }
.icon-button { width: 44px; min-width: 44px; display: grid; place-items: center; padding: 0; }
.icon-button svg { width: 18px; height: 18px; fill: currentColor; }
.brain-mode { position: absolute; z-index: 7; top: 86px; left: 14px; display: flex; padding: 4px; border-radius: 11px; }
.brain-mode button { min-width: 77px; min-height: 42px; padding: 5px 10px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; text-align: left; }
.brain-mode button strong,
.brain-mode button small { display: block; }
.brain-mode button strong { font-size: 10px; }
.brain-mode button small { margin-top: 2px; font-size: 8px; }
.brain-mode button.is-active { color: #11170f; background: var(--sage-bright); }

.brain-readout { position: absolute; z-index: 6; top: 150px; right: 17px; display: grid; gap: 9px; text-align: right; text-shadow: 0 2px 15px #000; }
.brain-readout div { display: grid; }
.brain-readout strong { color: var(--pearl); font-size: 14px; font-variant-numeric: tabular-nums; }
.brain-readout span { color: var(--muted); font-size: 8px; }
.brain-legend { position: absolute; z-index: 6; right: 17px; bottom: 218px; display: flex; gap: 9px; color: var(--muted); font-size: 8px; }
.brain-legend span { display: flex; align-items: center; gap: 4px; }
.brain-legend i { width: 6px; height: 6px; border-radius: 50%; }
.legend-structure { background: var(--pearl-soft); opacity: .5; }
.legend-activity { background: var(--sage-bright); }
.legend-spike { background: var(--amber-bright); box-shadow: 0 0 8px var(--amber); }
.brain-groups { position: absolute; z-index: 6; left: 16px; right: 16px; bottom: 105px; padding-top: 10px; border-top: 1px solid var(--line); text-shadow: 0 2px 12px #000; }
.brain-groups > span { color: var(--muted); font-size: 9px; }
.brain-groups ol { display: flex; flex-wrap: wrap; gap: 5px; margin: 7px 0 8px; padding: 0; list-style: none; }
.brain-groups li { padding: 4px 7px; border: 1px solid var(--line); border-radius: 99px; color: var(--pearl-soft); background: rgba(9, 14, 10, .42); font-size: 8px; }
.brain-groups small { display: block; color: var(--quiet); font-size: 8px; line-height: 1.35; }
.brain-groups ol.has-cells { display: grid; gap: 4px; }
.brain-groups ol.has-cells li { border-radius: 9px; font-size: 10px; }
.brain-groups .brain-odor { margin: 0 0 7px; color: var(--pearl-soft); font-size: 9px; line-height: 1.45; }
.brain-groups .brain-odor small { display: inline; color: var(--quiet); }
.brain-groups ol.has-cells li b { font-weight: 680; }
.brain-groups ol.has-cells li small { margin-top: 1px; color: var(--muted); font-size: 9px; }

.tutorial-panel {
  position: absolute;
  z-index: 30;
  right: 22px;
  bottom: 116px;
  width: min(374px, calc(100% - 44px));
  padding: 17px;
  border-radius: var(--radius-lg);
}
.tutorial-count { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 11px; color: var(--amber-bright); font-size: 10px; }
.tutorial-count progress { width: 100%; height: 3px; overflow: hidden; border: 0; border-radius: 99px; background: rgba(255, 255, 255, .1); }
.tutorial-count progress::-webkit-progress-bar { background: rgba(255, 255, 255, .1); }
.tutorial-count progress::-webkit-progress-value { background: var(--amber-bright); }
.tutorial-count progress::-moz-progress-bar { background: var(--amber-bright); }
.tutorial-panel h2 { margin: 13px 0 7px; font-size: 20px; font-weight: 620; letter-spacing: -.03em; }
.tutorial-panel p { margin: 0; color: var(--pearl-soft); font-size: 12px; line-height: 1.5; }
.tutorial-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 15px; }

.text-button,
.filled-button,
.inspect-button,
.drawer-action,
.feedback-button {
  min-height: 44px;
  border-radius: 9px;
  font-weight: 680;
}
.text-button { padding: 0 10px; border: 0; color: var(--muted); background: transparent; font-size: 11px; }
.text-button:hover { color: var(--pearl); background: rgba(255, 255, 255, .05); }
.filled-button { padding: 0 17px; border: 1px solid var(--sage-bright); color: #11170f; background: var(--sage-bright); font-size: 11px; }
.filled-button:hover { background: #d1dfc8; }

.replay-panel { position: absolute; z-index: 24; left: 50%; bottom: 105px; width: min(650px, calc(100% - 40px)); display: grid; grid-template-columns: 130px 1fr auto auto; align-items: center; gap: 12px; padding: 9px 10px 9px 14px; border-radius: var(--radius); transform: translateX(-50%); }
.replay-panel > div { display: grid; }
.replay-panel strong { font-size: 10px; }
.replay-panel span { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.replay-panel input { width: 100%; accent-color: var(--amber-bright); }
.replay-panel output { color: var(--pearl-soft); font-size: 10px; font-variant-numeric: tabular-nums; }

.evidence-strip {
  position: absolute;
  z-index: 20;
  left: 12px;
  right: 12px;
  bottom: 12px;
  height: 80px;
  display: grid;
  grid-template-columns: minmax(170px, .7fr) minmax(500px, 2.8fr) auto;
  align-items: stretch;
  overflow: hidden;
  border-radius: var(--radius);
}
.evidence-intro { display: grid; grid-template-columns: 8px 1fr; align-content: center; column-gap: 9px; padding: 11px 16px; border-right: 1px solid var(--line); }
.evidence-intro .live-pip { width: 7px; height: 7px; grid-row: 1 / span 2; align-self: center; background: var(--sage-bright); }
.evidence-intro strong { font-size: 14px; }
.evidence-intro small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.evidence-strip ol { min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.evidence-strip li { position: relative; min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 9px 20px 9px 13px; border-right: 1px solid var(--line); }
.evidence-strip li:not(:last-child)::after { content: "›"; position: absolute; right: 7px; top: 50%; color: var(--amber); font-size: 17px; transform: translateY(-50%); }
.evidence-strip li span { color: var(--muted); font-size: 11px; }
.evidence-strip li strong { margin-top: 4px; overflow: hidden; color: var(--pearl); font-size: 14px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.inspect-button { align-self: center; min-width: 118px; margin: 0 10px; padding: 0 13px; border: 1px solid var(--line-strong); color: var(--pearl-soft); background: rgba(255, 255, 255, .045); font-size: 13px; font-weight: 650; }
.inspect-button:hover { border-color: rgba(214, 164, 93, .55); color: var(--amber-bright); }

.lab-drawer {
  position: fixed;
  z-index: 80;
  top: 66px;
  right: 0;
  bottom: 0;
  width: min(390px, 100vw);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line-strong);
  background: rgba(15, 22, 17, .97);
  box-shadow: -30px 0 80px rgba(0, 0, 0, .38);
  transform: translateX(104%);
  transition: transform 260ms cubic-bezier(.25, .7, .3, 1);
}
.lab-drawer.is-open { transform: translateX(0); }
.lab-drawer > header { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 17px 18px; border-bottom: 1px solid var(--line); }
.lab-drawer > header span { color: var(--sage-bright); font-size: 9px; }
.lab-drawer > header h2 { margin: 2px 0 0; font-size: 23px; font-weight: 610; letter-spacing: -.035em; }
.drawer-scroll { flex: 1 1 auto; overflow-y: auto; padding: 0 18px calc(24px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }
.lab-section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 11px; }
.section-title h3 { margin: 0; font-size: 12px; font-weight: 720; }
.section-title small { max-width: 190px; color: var(--quiet); font-size: 8px; text-align: right; line-height: 1.35; }
.segmented.wide { width: 100%; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255, 255, 255, .025); }
.segmented.wide button { flex: 1; min-height: 42px; }
.diagnostic-status { min-height: 38px; display: grid; grid-template-columns: 7px 1fr; align-items: center; gap: 9px; margin-top: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255, 255, 255, .018); }
.diagnostic-status > span { width: 7px; height: 7px; border-radius: 50%; background: var(--sage-bright); box-shadow: 0 0 0 4px rgba(191, 208, 178, .08); }
.diagnostic-status > div { min-width: 0; display: grid; gap: 2px; }
.diagnostic-status strong { color: var(--pearl-soft); font-size: 9px; }
.diagnostic-status small { color: var(--quiet); font-size: 8px; }
.diagnostic-status[data-status="warning"] { border-color: rgba(214, 164, 93, .32); background: rgba(214, 164, 93, .055); }
.diagnostic-status[data-status="warning"] > span { background: var(--amber-bright); box-shadow: 0 0 0 4px rgba(214, 164, 93, .1); }
.performance-readout { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 9px; }
.performance-readout > div { display: flex; justify-content: space-between; align-items: baseline; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255, 255, 255, .02); }
.performance-readout span { color: var(--quiet); font-size: 8px; }
.performance-readout strong { color: var(--pearl-soft); font-size: 10px; font-variant-numeric: tabular-nums; }
.performance-note { margin: 7px 1px 0; color: var(--quiet); font-size: 8px; line-height: 1.4; }
.preference-list { display: grid; gap: 7px; }
.preference-row { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .02); cursor: pointer; }
.preference-row:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, .05); }
.preference-row > span { min-width: 0; display: grid; gap: 3px; }
.preference-row strong { color: var(--pearl-soft); font-size: 10px; }
.preference-row small { color: var(--quiet); font-size: 8px; line-height: 1.35; }
.preference-toggle { position: relative; flex: 0 0 auto; width: 44px; height: 26px; margin: 0; appearance: none; border: 1px solid var(--line-strong); border-radius: 999px; background: rgba(255, 255, 255, .06); cursor: pointer; transition: border-color 160ms ease, background 160ms ease; }
.preference-toggle::before { content: ""; position: absolute; top: 4px; left: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform 160ms ease, background 160ms ease; }
.preference-toggle:checked { border-color: var(--sage-bright); background: rgba(152, 178, 141, .26); }
.preference-toggle:checked::before { background: var(--sage-bright); transform: translateX(18px); }
.tool-grid,
.lesion-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.tool-grid button,
.lesion-grid button { min-height: 45px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--pearl-soft); background: rgba(255, 255, 255, .025); font-size: 10px; text-align: left; }
.tool-grid button { display: flex; align-items: center; gap: 8px; }
.tool-grid button:hover,
.lesion-grid button:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, .06); }
.tool-grid button[aria-pressed="true"],
.lesion-grid button[aria-pressed="true"] { color: var(--night); border-color: var(--amber-bright); background: var(--amber-bright); }
.tool-grid i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.tool-grid .tool-food { background: var(--amber); }
.tool-grid .tool-danger { background: var(--risk); }
.tool-grid .tool-signal-food { background: var(--sage-bright); box-shadow: 0 0 0 3px rgba(191, 208, 178, .12); }
.tool-grid .tool-signal-danger { background: var(--risk); box-shadow: 0 0 0 3px rgba(215, 123, 102, .12); }
.drawer-action { width: 100%; margin-top: 8px; border: 1px solid var(--line-strong); color: var(--pearl-soft); background: transparent; font-size: 10px; }
.drawer-action:hover { border-color: var(--sage); background: rgba(152, 178, 141, .08); }
.resource-line { display: flex; justify-content: space-between; margin: 10px 1px 0; color: var(--quiet); font-size: 9px; }
.resource-line strong { color: var(--pearl-soft); font-variant-numeric: tabular-nums; }
.feedback-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.feedback-button { border: 1px solid var(--line); background: rgba(255, 255, 255, .025); font-size: 10px; }
.feedback-button.positive:hover { color: var(--sage-bright); border-color: var(--sage); }
.feedback-button.negative:hover { color: #e69a89; border-color: var(--risk-soft); }
.continuity-section dl { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 0; }
.continuity-section dl div { min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255, 255, 255, .02); }
.continuity-section dt { color: var(--quiet); font-size: 8px; }
.continuity-section dd { margin: 4px 0 0; overflow: hidden; color: var(--pearl-soft); font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.continuity-section p { margin: 11px 0 0; color: var(--quiet); font-size: 9px; line-height: 1.45; }
.drawer-footer-actions { display: grid; gap: 4px; padding-top: 14px; }
.drawer-footer-actions .text-button { width: 100%; text-align: left; }
.danger-text { color: #da9587; }

.drawer-scrim { position: fixed; z-index: 70; inset: 66px 0 0; background: rgba(3, 6, 4, .38); backdrop-filter: blur(2px); }

/* Giriş ekranı: ilk ziyarette bir kez; sahne arkada akmaya devam eder. */
.intro { position: fixed; inset: 0; z-index: 140; display: grid; place-items: center; padding: 16px; background: rgba(6, 10, 7, .72); backdrop-filter: blur(6px); }
.intro[hidden] { display: none; }
.intro-card { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 28px 30px; border: 1px solid var(--line-strong); border-radius: 18px; background: rgba(16, 23, 17, .97); box-shadow: var(--shadow); }
.intro-kicker { color: var(--amber-bright); font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.intro-card h2 { margin: 8px 0 12px; font-size: clamp(24px, 4vw, 32px); font-weight: 640; letter-spacing: -.035em; line-height: 1.12; }
.intro-brain { margin: 0 0 16px; color: var(--pearl); font-size: 15px; line-height: 1.55; }
.intro-points { display: grid; gap: 10px; margin: 0 0 16px; padding: 0; list-style: none; }
.intro-points li { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--pearl-soft); background: rgba(255, 255, 255, .025); font-size: 14px; line-height: 1.5; }
.intro-points strong { color: var(--pearl); }
.intro-points em { color: var(--sage-bright); font-style: normal; }
.intro-card small { display: block; color: var(--muted); font-size: 12px; line-height: 1.5; }
.intro-card .filled-button { width: 100%; min-height: 48px; margin-top: 18px; font-size: 15px; }

.game-over {
  position: fixed;
  z-index: 110;
  top: 50%;
  left: 50%;
  width: min(440px, calc(100% - 32px));
  padding: 25px;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: rgba(16, 24, 18, .97);
  box-shadow: 0 32px 100px rgba(0, 0, 0, .58);
  transform: translate(-50%, -50%);
}
.game-over > span { color: var(--risk); font-size: 12px; }
.game-over h2 { margin: 8px 0; font-size: 29px; font-weight: 610; letter-spacing: -.04em; }
.game-over p { margin: 0; color: var(--pearl-soft); font-size: 14px; line-height: 1.5; }
.death-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 18px 0 12px; }
.death-stats span { padding: 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--pearl-soft); font-size: 13px; font-weight: 650; text-align: center; }
.game-over small { display: block; color: var(--muted); font-size: 12px; line-height: 1.5; }
.game-over .filled-button { width: 100%; margin-top: 18px; }

.toast { position: fixed; z-index: 130; left: 50%; max-width: min(460px, calc(100% - 32px)); padding: 11px 15px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--pearl); background: rgba(20, 28, 21, .96); box-shadow: var(--shadow); font-size: 13px; transform: translateX(-50%); top: 82px; bottom: auto; }

.loading-overlay {
  position: fixed;
  z-index: 150;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  background: radial-gradient(circle at 50% 46%, #1a251c, #0b110d 62%);
  transition: opacity 420ms ease, visibility 420ms ease;
}
.loading-overlay.is-hidden { visibility: hidden; opacity: 0; pointer-events: none; }
.loading-overlay strong { margin-top: 16px; font-size: 16px; font-weight: 620; }
.loading-overlay span { color: var(--muted); font-size: 11px; }
.loading-orbit { position: relative; width: 56px; height: 56px; }
.loading-orbit i { position: absolute; inset: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--sage-bright); transform-origin: 3px 3px; animation: orbit 2s linear infinite; }
.loading-orbit i:nth-child(1) { transform: rotate(0deg) translateX(25px); }
.loading-orbit i:nth-child(2) { background: var(--amber); animation-delay: -.66s; }
.loading-orbit i:nth-child(3) { animation-delay: -1.32s; }

@keyframes orbit {
  from { transform: rotate(0deg) translateX(25px); }
  to { transform: rotate(360deg) translateX(25px); }
}

@media (max-width: 1260px) {
  .topbar { gap: 10px; }
  .identity-line { display: none; }
  .topbar { grid-template-columns: minmax(175px, 1fr) auto auto; }
  .quiet-button { width: 46px; padding: 0; }
  .quiet-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .speed-control span { display: none; }
  .evidence-strip { grid-template-columns: minmax(135px, .55fr) minmax(450px, 2.8fr) auto; }
  .evidence-intro { padding-inline: 12px; }
  .organism-card { width: 310px; }
}

@media (max-width: 1050px) {
  .evidence-intro small { display: none; }
  .evidence-strip { grid-template-columns: 116px minmax(430px, 1fr) auto; }
  .world-controls { left: auto; right: 20px; transform: none; }
}

@media (max-width: 980px) {
  .experience[data-brain-open="true"] .scene-grid,
  .scene-grid { display: block; }
  .world-view { position: absolute; inset: 0; }
  .brain-view { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%); transform: translateX(102%); transition: opacity 220ms ease, transform 300ms cubic-bezier(.25, .72, .3, 1); }
  .experience[data-brain-open="true"] .brain-view { transform: translateX(0); }
  .evidence-strip { grid-template-columns: 108px minmax(0, 1fr) 104px; }
  .evidence-strip ol { grid-template-columns: repeat(3, minmax(100px, 1fr)); overflow-x: auto; }
  .evidence-strip li { padding-inline: 10px 18px; }
  .inspect-button { min-width: 92px; margin-inline: 6px; padding-inline: 8px; }
  .memory-map-panel { width: 155px; }
  #memory-map { height: 72px; }
}

@media (max-width: 850px) {
  .brain-view { width: 100%; border-left: 0; }
  .experience[data-brain-open="true"] .world-view > * { visibility: hidden; }
}

@media (max-width: 760px) {
  .detail-toggle { font-size: 0; gap: 0; padding: 0 8px; }
  .detail-toggle svg { width: 16px; height: 16px; }
  .topbar { flex-basis: 58px; min-height: 58px; grid-template-columns: minmax(126px, 1fr) auto; padding: 6px 9px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand strong { font-size: 16px; }
  .brand small,
  .connection,
  .speed-control span,
  #audio-button { display: none; }
  .primary-controls { gap: 5px; }
  .speed-control { min-height: 44px; padding: 0 3px; }
  .speed-control select { padding: 0 19px 0 5px; font-size: 11px; }
  .control-button { min-height: 44px; }
  .pause-button { width: 44px; padding: 0; }
  .pause-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .world-heading { top: 16px; left: 14px; max-width: 62%; }
  .world-heading h1 { font-size: clamp(21px, 6vw, 31px); }
  .world-heading p { font-size: 9px; }
  .world-clock { top: 16px; right: 14px; }
  .world-clock strong { font-size: 16px; }
  .memory-map-panel { top: 68px; right: 12px; width: 136px; padding: 8px; }
  .memory-map-panel h2 { font-size: 11px; }
  #memory-map { height: 62px; }
  .map-key { font-size: 9px; }
  .organism-card { left: 10px; bottom: 92px; width: min(330px, calc(100% - 20px)); gap: 8px; padding: 11px 12px; }
  .organism-card-heading strong { font-size: 19px; }
  .decision-plain { font-size: 13px; }
  .drive-row { grid-template-columns: 104px 1fr 60px; gap: 6px; font-size: 11px; }
  .drive-row output { font-size: 11px; }
  .scene-tag { font-size: 11px; padding: 3px 8px; }
  /* Dar ekranda kamera düğmeleri alta, durum kartı onların üstüne yerleşir (üst üste binmez). */
  body:not(.detail-mode) .organism-card { bottom: 80px; }
  body.detail-mode .organism-card { bottom: 146px; }
  .world-controls { right: 10px; bottom: 92px; }
  .camera-controls button { min-width: 44px; padding-inline: 6px; }
  .overlay-controls button { width: 38px; padding: 0; justify-content: center; font-size: 0; }
  .overlay-controls svg { width: 16px; height: 16px; }
  .evidence-strip { left: 6px; right: 6px; bottom: 6px; height: 76px; grid-template-columns: minmax(0, 1fr) 72px; }
  .evidence-intro { display: none; }
  .evidence-strip ol { grid-column: 1; }
  .evidence-strip li { padding: 8px 15px 8px 8px; }
  .evidence-strip li span { font-size: 10px; }
  .evidence-strip li strong { display: -webkit-box; font-size: 12px; white-space: normal; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .evidence-strip li:not(:last-child)::after { display: none; }
  .inspect-button { grid-column: 2; min-width: 0; height: calc(100% - 12px); margin: 6px; }
  .tutorial-panel { right: 10px; bottom: 94px; width: min(350px, calc(100% - 20px)); }
  .replay-panel { bottom: 92px; grid-template-columns: 86px 1fr auto; }
  .replay-panel .text-button { grid-column: 1 / -1; min-height: 32px; }
  .lab-drawer { top: 58px; }
  .drawer-scrim { inset-block-start: 58px; }
  /* Dar ekranda pilot: düğme çubuğun üstünde tek sütun; kart daralıp yer açar, cümle gizlenir. */
  body .pilot-pad, body:not(.detail-mode) .pilot-pad { right: 10px; bottom: 150px; grid-template-columns: auto; justify-items: center; }
  .pilot-fly { order: -1; margin: 0; }
  body.pilot-mode .organism-card { width: min(330px, calc(100% - 120px)); }
  body.pilot-mode .decision-plain { display: none; }
}

@media (max-width: 560px) {
  .brand-mark { width: 30px; height: 30px; }
  .brand strong { font-size: 15px; }
  .speed-control { display: none; }
  .world-heading h1 { font-size: 22px; }
  .world-heading p span:last-child,
  .world-heading p i { display: none; }
  .memory-map-panel { top: 61px; width: 112px; }
  .memory-map-panel > div:first-child span { display: none; }
  .map-key { display: none; }
  #memory-map { height: 55px; }
  .organism-card { bottom: 86px; }
  .organism-card-heading small { max-width: 190px; }
  .drive-row:nth-child(n+4) { display: none; }  /* telefonda yalnız sağlık, enerji, açlık */
  .world-controls { bottom: 86px; }
  .camera-controls button { min-width: 39px; font-size: 8px; }
  .camera-controls button:last-child { width: 40px; font-size: 0; }
  .camera-controls button:last-child::after { content: "Göz"; font-size: 8px; }
  .overlay-controls { display: none; }
  .brain-view { width: 100%; }
  .brain-readout { top: 145px; }
  .tutorial-panel { padding: 15px; }
  .tutorial-panel h2 { font-size: 18px; }
  .evidence-strip ol { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .game-over { padding: 20px; }
  .death-stats { grid-template-columns: 1fr; }
}

@media (max-height: 620px) and (orientation: landscape) {
  .memory-map-panel { display: none; }
  .world-heading h1 { font-size: 23px; }
  .organism-card { bottom: 82px; padding-block: 8px; }
  .world-controls { bottom: 82px; }
  .evidence-strip { height: 68px; }
  .tutorial-panel { bottom: 82px; max-height: calc(100% - 100px); overflow-y: auto; }
  .brain-groups { bottom: 88px; }
  .brain-legend { display: none; }
}

body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after {
  scroll-behavior: auto !important;
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .01ms !important;
}

body.high-contrast {
  --pearl: #fffef5;
  --pearl-soft: #f1f4e9;
  --muted: #d6dfd1;
  --quiet: #bbc8b9;
  --sage: #b7d3a9;
  --sage-bright: #d1e7c5;
  --amber: #edb965;
  --amber-bright: #ffd38b;
  --line: rgba(243, 248, 235, .34);
  --line-strong: rgba(243, 248, 235, .62);
}

body.high-contrast .topbar,
body.high-contrast .lab-drawer,
body.high-contrast .surface-control,
body.high-contrast .game-over,
body.high-contrast .toast { background-color: rgba(8, 13, 9, .97); }
body.high-contrast button:focus-visible,
body.high-contrast select:focus-visible,
body.high-contrast input:focus-visible,
body.high-contrast [tabindex]:focus-visible { outline-width: 4px; outline-color: #ffd38b; }

/* Laboratuvar sekmeleri: uzun tek kaydırma yerine Oyna / Deney / Ayarlar */
.lab-tabs { flex: 0 0 auto; display: flex; gap: 2px; padding: 10px 18px 0; border-bottom: 1px solid var(--line); }
.lab-tabs button {
  flex: 1;
  min-height: 38px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 8px 8px 0 0;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 680;
  cursor: pointer;
}
.lab-tabs button:hover { color: var(--pearl); background: rgba(255, 255, 255, .045); }
.lab-tabs button[aria-selected="true"] { color: var(--pearl); border-bottom-color: var(--sage-bright); }
.lab-drawer[data-tab="play"] .lab-section:not([data-tab="play"]),
.lab-drawer[data-tab="experiment"] .lab-section:not([data-tab="experiment"]),
.lab-drawer[data-tab="settings"] .lab-section:not([data-tab="settings"]) { display: none; }
.glossary-section summary { cursor: pointer; list-style: none; }
.glossary-section summary::-webkit-details-marker { display: none; }
.glossary-section details[open] summary small::after { content: " ▴"; }
.glossary-section details:not([open]) summary small::after { content: " ▾"; }

/* Ölüm ekranı: yavru / aynı sinek seçimi ve soy kaydı */
.game-over-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }
.lineage-list { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.lineage-list li { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; }
.lineage-list li strong { color: var(--pearl-soft); font-weight: 640; }
.lineage-list:empty { display: none; }
.lineage-tree { margin: 10px 0 0; }
.lineage-tree svg { width: 100%; height: 96px; display: block; }
.lineage-tree figcaption { color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 6px; }
.lineage-tree .edge { fill: none; stroke: var(--muted); stroke-width: 1.2; opacity: .7; }
.lineage-tree .edge.is-return { stroke: #d9a3ff; stroke-dasharray: 3 2; }
.lineage-tree .node { stroke: var(--pearl-soft); stroke-width: 1; fill: transparent; }
.lineage-tree .node.is-elite { fill: rgba(140, 240, 208, .55); }
.lineage-tree .node.is-current { stroke: #ffbd57; stroke-width: 2; }
.lineage-tree text { fill: var(--muted); font-size: 10px; text-anchor: middle; }

/* Merkezi kompleks pusulası (karar kartında) */
.compass-figure { margin: 6px 0 0; display: flex; align-items: center; gap: 6px; }
.compass-figure canvas { width: 44px; height: 44px; }
.compass-figure figcaption { color: var(--pearl-soft); font-size: 12px; white-space: nowrap; }
.compass-figure figcaption.is-search { color: var(--sage-bright); }

/* Günlük ve profil kartı */
.journal-today { margin: 0 0 8px; color: var(--pearl-soft); font-size: 10px; line-height: 1.5; }
.journal-recent { margin: 0 0 10px; padding: 0; list-style: none; display: grid; gap: 5px; }
.journal-recent li { color: var(--muted); font-size: 9px; line-height: 1.45; }
.journal-recent:empty { display: none; }
.profile-card { display: grid; gap: 3px; margin-bottom: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(135deg, rgba(232, 196, 108, .08), rgba(160, 214, 140, .05)); }
.profile-card strong { color: var(--pearl); font-size: 12px; letter-spacing: .02em; }
.profile-card span { color: var(--muted); font-size: 9px; }

/* Oyun içi deneyler */
.experiment-section .segmented.wide button { font-size: 10px; min-height: 36px; }
.experiment-question { margin: 10px 0 8px; color: var(--pearl-soft); font-size: 10px; line-height: 1.5; }
.experiment-options { display: grid; gap: 5px; margin-bottom: 8px; }
.experiment-options button { text-align: left; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255, 255, 255, .02); color: var(--muted); font: inherit; font-size: 10px; cursor: pointer; }
.experiment-options button[aria-checked="true"] { color: #11170f; background: var(--sage-bright); border-color: transparent; }
.experiment-status { margin: 8px 0; font-size: 10px; line-height: 1.5; color: var(--pearl-soft); }
.experiment-status:empty { display: none; }
.weekly-board { font-size: 10px; color: var(--muted); line-height: 1.5; }
.weekly-board:empty { display: none; }
.weekly-board ol { margin: 6px 0; padding-left: 18px; }
.weekly-board li.is-own { color: var(--sage-bright); font-weight: 680; }
.weekly-board .dist { display: grid; grid-template-columns: auto 1fr auto; gap: 3px 8px; align-items: center; margin-top: 6px; }
.weekly-board .weekly-note { margin: 6px 0 0; font-style: italic; }
.weekly-board .dist i { display: block; height: 5px; border-radius: 4px; background: var(--sage-bright); opacity: .7; }
.experiment-status .bar { height: 4px; margin-top: 6px; border-radius: 4px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.experiment-status .bar i { display: block; height: 100%; background: var(--sage-bright); }
.experiment-status .verdict-yes { color: var(--sage-bright); font-weight: 680; }
.experiment-status .verdict-no { color: #e8a36c; font-weight: 680; }

.loading-progress { width: min(280px, 70vw); height: 6px; margin-top: 14px; overflow: hidden; border-radius: 99px; background: rgba(255, 255, 255, .08); }
.loading-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--sage), var(--sage-bright)); transition: width .25s ease-out; }
.loading-amount { margin-top: 7px; color: var(--quiet); font-size: 10px; font-variant-numeric: tabular-nums; }
.loading-actions { display: flex; gap: 8px; margin-top: 14px; justify-content: center; flex-wrap: wrap; }
.loading-actions button[hidden] { display: none; }
.loading-actions button { pointer-events: auto; min-width: 140px; }
.loading-overlay span { max-width: 440px; padding: 0 18px; text-align: center; line-height: 1.5; }
.static-page { min-height: 100vh; display: flex; justify-content: center; padding: 32px 16px; background: #0b110d; color: var(--pearl, #e9eee6); font: 14px/1.6 system-ui, sans-serif; overflow: auto; }
.static-card { max-width: 720px; }
.static-card h1 { font-size: 26px; margin: 0 0 12px; }
.static-card h2 { font-size: 18px; margin: 26px 0 8px; }
.static-card li { margin-bottom: 8px; }
.static-card a { color: var(--sage-bright, #b5d75b); }
@media (max-width: 700px) {
  /* Dar ekranda alttaki öğretici ve karar kartıyla çakışmasın. */
  .toast,
  body:not(.detail-mode) .toast { top: 70px; bottom: auto; }
}

/* Yönetici istatistik sayfası */
.stats-page { max-width: 900px; }
.stats-form { display: flex; gap: 10px; margin: 16px 0; }
.stats-form input { flex: 1; min-height: 42px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--pearl); background: rgba(255, 255, 255, .04); font-size: 14px; }
.stats-error { color: #ff9a8f; }
.stats-table { width: 100%; border-collapse: collapse; margin: 8px 0 18px; font-size: 13px; }
.stats-table th, .stats-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.stats-table th:first-child, .stats-table td:first-child { text-align: left; }
.stats-table th { color: var(--muted); font-weight: 600; }
.stats-note { color: var(--muted); font-size: 12px; }
@media (max-width: 700px) { .stats-page { overflow-x: auto; } }
