/* ==========================================================
   Nefesten Taksime: görsel sistem "Abanoz ve taş plak"
   Grenadil gövde, nikel-gümüş klapeler, 78'lik plak olukları.
   Anlam renkleri bütün sitede sabittir (bkz. js/lib.js C):
   durak cehri sarısı (çift halka) · güçlü yaprak yeşili (elmas) · yeden kök boya kırmızısı (üçgen) · koma çivit
   ========================================================== */

:root {
  --bg: #231a1e;          /* grenadil */
  --bg-2: #2d2227;        /* derin grenadil: sahne */
  --panel: #372a30;       /* kontrol yüzeyi */
  --line: #4a3b41;        /* oluk: ince çizgi */
  --line-soft: #3a2e34;
  --ink: #ece5da;         /* kemik */
  --ink-2: #cdc2bc;
  --muted: #a99ba1;       /* kül gülü */
  --silver: #c9ced6;      /* nikel gümüş: klapeler, arayüz */
  --silver-hi: #e6e9ee;
  --silver-lo: #8e949c;
  --durak: #ebb84c;
  --guclu: #5db8a0;
  --yeden: #d9505f;
  --koma: #a497ec;

  --f-display: "Gloock", "Bodoni 72", Georgia, serif;
  --f-body: "Commissioner", system-ui, sans-serif;

  --r-sm: 3px;
  --r-md: 8px;
  --gutter: clamp(16px, 3.2vw, 52px);
  --bar-h: 68px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background-color: var(--bg);
  /* plak olukları: ekranın dışında, alt köşede merkezlenmiş çok soluk halkalar */
  background-image:
    repeating-radial-gradient(circle at 108% 118%, rgba(236, 229, 218, 0.022) 0 1px, transparent 1px 7px),
    radial-gradient(80% 70% at 15% -10%, rgba(201, 206, 214, 0.07), transparent 60%),
    radial-gradient(120% 90% at 50% 120%, rgba(8, 4, 6, 0.5), transparent 60%);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: clamp(15px, 0.6vw + 8px, 18px);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--silver-hi); outline-offset: 3px; border-radius: 2px; }

/* ---------- Slayt kabı ---------- */
#deck { position: fixed; inset: 0 0 var(--bar-h) 0; z-index: 1; }
.slide {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) 1.28fr;
  gap: clamp(20px, 3vw, 56px);
  padding: clamp(24px, 4.5vh, 56px) var(--gutter) clamp(14px, 2.4vh, 28px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, transform 0.55s cubic-bezier(.2,.7,.2,1), visibility 0s linear 0.55s;
  transform: translateX(24px);
}
.slide.before { transform: translateX(-24px); }
.slide.active {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity 0.45s ease, transform 0.55s cubic-bezier(.2,.7,.2,1), visibility 0s;
}
.slide.wide { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
.slide.center { grid-template-columns: 1fr; place-items: center; text-align: center; }

body.text-hidden .slide:not(.center) { grid-template-columns: 0 1fr; gap: 0; }
body.text-hidden .slide:not(.center) .text { display: none; }

/* ---------- Metin sütunu ---------- */
.text {
  overflow-y: auto;
  padding-right: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  max-width: 62ch;
  align-self: start;
  max-height: 100%;
}
/* bölüm etiketi: plak etiketindeki yüz numarası gibi */
.chapter-tag {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--muted);
  margin: 0 0 1rem;
  display: flex; align-items: center; gap: 0.6em;
}
.chapter-tag b {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--bg);
  background: var(--silver);
  width: 1.7em; height: 1.7em; border-radius: 50%;
  display: inline-grid; place-items: center;
}
h1, h2, h3 {
  font-family: var(--f-display);
  font-weight: 400;
  line-height: 1.04;
  margin: 0 0 1rem;
}
h1 { font-size: clamp(3rem, 6vw, 6.2rem); letter-spacing: -0.015em; }
h2 { font-size: clamp(2rem, 3.2vw, 3.3rem); letter-spacing: -0.006em; }
h2 .bemol, h1 .bemol { font-family: var(--f-body); font-weight: 300; }
h3 { font-size: 1.22rem; margin: 1.4rem 0 0.4rem; }
.text p { margin: 0 0 0.95em; color: var(--ink-2); }
.text p.lead { color: var(--ink); font-size: 1.12em; line-height: 1.5; }
.text strong { color: var(--ink); font-weight: 600; }
.text em { color: var(--ink); }
.text ul, .text ol { padding-left: 1.15em; margin: 0 0 1em; color: var(--ink-2); }
.text li { margin-bottom: 0.35em; }
.text li::marker { color: var(--silver-lo); }
.text a { color: var(--silver-hi); text-underline-offset: 3px; }

/* anlam renkleri (metinde de aynı) */
.c-durak { color: var(--durak); }
.c-guclu { color: var(--guclu); }
.c-yeden { color: var(--yeden); }
.c-koma { color: var(--koma); }
.text .c-durak, .text .c-guclu, .text .c-yeden, .text .c-koma { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.dogrula {
  display: inline-block; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.01em;
  color: var(--bg); background: var(--koma); border-radius: 2px; padding: 0 6px; vertical-align: 0.12em;
}

details.more {
  margin: 1.2rem 0 0.6rem;
  border-left: 1px solid var(--silver-lo);
  padding: 0.1rem 0 0.1rem 1rem;
}
details.more summary {
  cursor: pointer;
  font-family: var(--f-display);
  font-size: 1.06em;
  color: var(--silver-hi);
  list-style: none;
}
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "+ "; }
details.more[open] summary::before { content: "− "; }
details.more p { margin-top: 0.6rem; font-size: 0.95em; }

.try {
  margin-top: 1.3rem;
  padding: 0.75rem 1rem;
  border-radius: var(--r-sm);
  background: rgba(201, 206, 214, 0.06);
  border-left: 2px solid var(--silver);
  color: var(--ink);
  font-size: 0.95em;
}
.try::before { content: "Dene: "; font-weight: 700; color: var(--silver-hi); }

aside.notes { display: none; }

/* ---------- Sahne ---------- */
/* kart değil: ince gümüş çizgiyle çerçevelenmiş açık bir tezgâh */
.stage {
  position: relative;
  min-height: 0; min-width: 0;
  border-radius: var(--r-md);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(201, 206, 214, 0.045), transparent 60%),
    var(--bg-2);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.stage.bare { background: transparent; box-shadow: none; }
.stage canvas { display: block; }
.stage .fill { flex: 1; min-height: 0; position: relative; }
.stage .fill > canvas, .stage .fill > svg.fill-svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.controls {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 10px 14px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: rgba(20, 13, 16, 0.4);
  font-size: 0.9rem;
}
.controls.top { border-top: 0; border-bottom: 1px solid var(--line); }
.controls .spacer { flex: 1; }
.controls label { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }

.btn {
  font-family: var(--f-body);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5em 1em;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--silver); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--silver); color: #1d1418; border-color: var(--silver); }
.btn.primary:hover { background: var(--silver-hi); }
.btn.on { border-color: var(--silver-hi); color: var(--silver-hi); background: rgba(201,206,214,.12); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn svg { width: 1.1em; height: 1.1em; vertical-align: -0.18em; margin-right: 0.35em; }

.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 999px; background: rgba(15, 9, 12, 0.35); overflow: hidden; }
.seg button {
  border: 0; background: transparent; padding: 0.38em 0.9em; cursor: pointer;
  font-weight: 600; font-size: 0.86rem; color: var(--ink-2);
  border-right: 1px solid var(--line-soft);
}
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--ink); color: var(--bg); }

/* kaydırıcı: tutamak bir klape başı */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 150px; height: 24px; background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: var(--line); }
input[type="range"]::-moz-range-track { height: 3px; background: var(--line); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle, var(--silver-hi) 0 35%, var(--silver) 36% 62%, var(--silver-lo) 64%);
  margin-top: -6.5px; border: 0; box-shadow: 0 2px 4px rgba(0,0,0,.5);
}
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--silver); border: 0; }
.val { font-size: 0.86rem; color: var(--ink); min-width: 3.6em; display: inline-block; font-variant-numeric: tabular-nums; }

select {
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 0.35em 0.9em; font-size: 0.88rem;
}

/* ---------- Alt çubuk ---------- */
#bar {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--bar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 var(--gutter);
  z-index: 5;
  font-size: 0.86rem;
  color: var(--ink-2);
  border-top: 1px solid rgba(74, 59, 65, 0.7);
  background: linear-gradient(180deg, rgba(25, 18, 21, 0.3), rgba(25, 18, 21, 0.85));
}
#bar .chapter-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 220px; }
#bar .chapter-name b { color: var(--silver-hi); font-family: var(--f-display); font-weight: 400; }

/* İlerleme: bir klarnet gövdesi. Her slayt bir delik; bölümler bilezikle ayrılır; geçilen delikler kapanır. */
#progress {
  flex: 1; min-width: 0;
  height: 16px;
  display: flex; align-items: stretch;
  position: relative;
  margin: 0 12px 0 22px;
  background: linear-gradient(180deg, #3b2d33, #1c1417 55%, #2a1f24);
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(201,206,214,.18);
}
/* ağızlık (baştaki daralan uç) ve çan (sondaki genişleyen uç) */
#progress::before {
  content: ""; position: absolute; left: -20px; top: 2px; width: 20px; height: 12px;
  background: linear-gradient(180deg, #2b2226, #111);
  clip-path: polygon(0 30%, 100% 0, 100% 100%, 0 70%);
}
#progress::after {
  content: ""; position: absolute; right: -11px; top: -4px; width: 11px; height: 24px;
  background: linear-gradient(180deg, #3b2d33, #1c1417 55%, #2a1f24);
  clip-path: polygon(0 33%, 100% 0, 100% 100%, 0 67%);
}
#progress .ch {
  display: flex; flex: var(--n) 1 0; min-width: 0;
  padding: 0 3px;
  position: relative;
}
/* bilezik: bölüm sınırı */
#progress .ch + .ch::before {
  content: ""; position: absolute; left: -1.5px; top: -2px; bottom: -2px; width: 3px;
  background: linear-gradient(90deg, var(--silver-lo), var(--silver-hi), var(--silver-lo));
  border-radius: 1px;
}
#progress .dot {
  flex: 1; min-width: 0; position: relative; border: 0; padding: 0; background: transparent; cursor: pointer;
}
#progress .dot::before {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 8px; height: 8px; margin: -4px 0 0 -4px;
  border-radius: 50%;
  border: 1.4px solid rgba(201,206,214,.55);
  transition: background .25s, border-color .25s, transform .25s;
}
#progress .dot.seen::before { background: var(--silver); border-color: var(--silver); }
#progress .dot.cur::before { background: var(--durak); border-color: var(--durak); transform: scale(1.35); box-shadow: 0 0 9px rgba(235,184,76,.75); }
#progress .dot:hover::before { border-color: var(--silver-hi); transform: scale(1.25); }
#progress .dot:focus-visible { outline-offset: 0; }

#bar .counter { font-size: 0.8rem; min-width: 4.4em; text-align: right; }
.iconbtn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; flex: none;
  border-radius: 50%; border: 1px solid var(--line); background: var(--panel); cursor: pointer; color: var(--ink);
}
.iconbtn:hover { border-color: var(--silver); }
.iconbtn svg { width: 18px; height: 18px; }
.iconbtn.on { border-color: var(--silver-hi); color: var(--silver-hi); background: rgba(201,206,214,.12); }

.volume { display: inline-flex; align-items: center; gap: 4px; flex: none; }
#btn-mute .x { display: none; }
#btn-mute.off .x { display: inline; }
#btn-mute.off .w { display: none; }
#btn-mute.off { color: var(--yeden); }
input[type="range"]#vol { width: 76px; }

/* ---------- Notlar paneli ---------- */
#notes {
  position: fixed; right: var(--gutter); bottom: calc(var(--bar-h) + 10px);
  width: min(480px, calc(100vw - 32px)); max-height: 48vh; overflow: auto;
  background: #ece5da; color: #2a1f24;
  border-radius: var(--r-md);
  padding: 16px 20px;
  font-size: 0.98rem; line-height: 1.5;
  z-index: 6;
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
  display: none;
}
#notes.open { display: block; }
#notes h4 { margin: 0 0 6px; font-family: var(--f-display); font-weight: 400; font-size: 1rem; color: #5b4650; }
#notes ul { margin: 0; padding-left: 1.1em; }
#notes a { color: #5b3b8a; }
#notes .kaynak { font-size: 0.86rem; color: #5b4650; border-top: 1px solid rgba(42,31,36,.15); margin-top: 8px; padding-top: 6px; }

/* ---------- Genel bakış ---------- */
#overview {
  position: fixed; inset: 0; z-index: 8;
  background: rgba(25, 18, 21, 0.97);
  overflow: auto;
  padding: 40px var(--gutter) 60px;
  display: none;
}
#overview.open { display: block; }
#overview h2 { font-size: 2.2rem; margin-bottom: 1.4rem; }
#overview .ov-ch { margin-bottom: 26px; }
#overview .ov-ch h3 { margin: 0 0 10px; color: var(--silver-hi); font-size: 1.15rem; }
#overview .ov-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 18px; }
#overview .ov-item {
  text-align: left; padding: 9px 4px; border: 0; border-bottom: 1px solid var(--line-soft);
  background: transparent; cursor: pointer; font-size: 0.95rem; color: var(--ink);
  display: flex; gap: 12px; align-items: baseline;
}
#overview .ov-item:hover { color: var(--silver-hi); }
#overview .ov-item span { color: var(--muted); font-size: 0.8rem; min-width: 1.6em; }
#overview .ov-item.cur { color: var(--durak); }
#overview .keys { color: var(--ink-2); font-size: 0.92rem; margin-top: 24px; max-width: 80ch; }
kbd {
  font-family: var(--f-body); font-size: 0.8rem; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 3px; padding: 0 6px; background: var(--panel); color: var(--ink);
}

/* ---------- Ortak demo parçaları ---------- */
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.82rem; color: var(--ink-2); }
.readout { font-variant-numeric: tabular-nums; }
.readout b { color: var(--ink); font-weight: 600; }
.chip { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 0.8rem; border: 1px solid var(--line); color: var(--ink-2); }
table.data { border-collapse: collapse; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
table.data th { font-weight: 600; color: var(--muted); font-size: 0.8rem; padding: 4px 10px; text-align: right; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data td { padding: 5px 10px; text-align: right; border-top: 1px solid var(--line-soft); }
.mute { color: var(--muted); }

/* rol işaretleri (renk + biçim) */
.rol { display: inline-block; width: 0.8em; height: 0.8em; vertical-align: -0.05em; margin-right: 0.3em; }
.rol.durak { border: 2px solid var(--durak); border-radius: 50%; box-shadow: inset 0 0 0 2px var(--bg), inset 0 0 0 4px var(--durak); }
.rol.guclu { background: var(--guclu); transform: rotate(45deg) scale(.82); }
.rol.yeden { width: 0; height: 0; border-left: 0.45em solid transparent; border-right: 0.45em solid transparent; border-bottom: 0.8em solid var(--yeden); }
.rol.koma { background: var(--koma); border-radius: 2px; }

/* ---------- Klarnet bileşeni ---------- */
.kc { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 100%; min-height: 0; }
.kc[data-yon="dikey"] { flex-direction: column; }
.kc[data-yon="yatay"] { flex-direction: column; }
.kc-svg { display: block; flex: 1; min-height: 0; width: 100%; height: 100%; overflow: visible; touch-action: none; user-select: none; -webkit-user-select: none; }
.kc-tahta { fill: #120c0f; stroke: rgba(201,206,214,.28); stroke-width: 1; }
.kc-agiz { fill: #0c0809; stroke: rgba(201,206,214,.35); stroke-width: 1; }
.kc-kamis { stroke: #b8a98a; stroke-width: 2.4; stroke-linecap: round; opacity: .8; }
.kc-bilezik { fill: var(--silver-lo); stroke: var(--silver); stroke-width: .8; }
.kc-bilezik-cizgi { stroke: var(--silver); stroke-width: 2; }
.kc-mil { stroke: rgba(201,206,214,.32); stroke-width: 1.4; fill: none; }
.kc-arka { fill: rgba(201,206,214,.04); stroke: rgba(201,206,214,.35); stroke-width: 1; stroke-dasharray: 3 3; }
.kc-k { cursor: pointer; outline: none; }
.kc-hit { fill: transparent; }
.kc-halka { fill: #07050600; stroke: var(--silver); stroke-width: 2.2; transition: stroke .18s var(--d, 0ms); }
.kc-dolu { fill: var(--silver); opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.6); transition: opacity .18s var(--d, 0ms), transform .18s var(--d, 0ms); }
.kc-yarim { fill: var(--silver); opacity: 0; transition: opacity .18s var(--d, 0ms); }
.kc-k.kapali .kc-dolu { opacity: 1; transform: none; }
.kc-k.yarim .kc-yarim { opacity: 1; }
.kc-yuz { fill: rgba(201,206,214,.06); stroke: var(--silver); stroke-width: 1.6; transition: fill .18s var(--d, 0ms); }
.kc-k.kapali .kc-yuz { fill: var(--silver); }
.kc-k:hover .kc-halka, .kc-k:hover .kc-yuz { stroke: var(--silver-hi); }
.kc-k:focus-visible .kc-halka, .kc-k:focus-visible .kc-yuz { stroke: var(--durak); stroke-width: 3; }
/* öğretim: basılması gereken anahtar nabız atar */
.kc-k.hedef .kc-halka, .kc-k.hedef .kc-yuz { stroke: var(--durak); animation: kcHedef 1.1s ease-in-out infinite; }
.kc-k.hedef.kapali .kc-halka, .kc-k.hedef.kapali .kc-yuz { animation: none; stroke: var(--durak); }
@keyframes kcHedef { 50% { stroke-width: 4; stroke: #fff2c8; } }
.kc-agiz-hit { fill: transparent; cursor: pointer; outline: none; }
.kc-agiz-hit:focus-visible { stroke: var(--durak); stroke-width: 2; }
.kc.ufluyor .kc-kamis { stroke: var(--durak); opacity: 1; animation: kcTitre .08s linear infinite; }
@keyframes kcTitre { 50% { transform: translateX(.8px); } }
.kc-etiket { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: center; font-size: 0.86rem; color: var(--ink-2); min-height: 1.5em; text-align: center; }
.kc-etiket b { color: var(--ink); font-weight: 600; }
.kc-yaklasik { color: var(--muted); font-style: italic; }
.kc-dogrula { color: var(--koma); font-weight: 600; }
.kc.dogru .kc-tahta { animation: kcDogru .5s ease-out; }
@keyframes kcDogru { 30% { stroke: var(--guclu); stroke-width: 3; } }

/* ---------- Kapak ---------- */
.cover { padding: 0; overflow: hidden; }
.cover .stage { position: absolute; inset: 0; background: transparent; box-shadow: none; border-radius: 0; }
.cover .cover-text {
  position: relative; z-index: 2; pointer-events: none;
  text-align: left; align-self: center; justify-self: start;
  padding: 0 var(--gutter);
  width: min(560px, 39vw);
}
.cover .cover-text > * { pointer-events: auto; }
.cover h1 { margin-bottom: 0.4rem; line-height: 0.96; }
.cover .alt { font-family: var(--f-display); font-size: clamp(1.2rem, 1.6vw, 1.6rem); color: var(--silver); margin: 0 0 1.4rem; }
.cover p { font-size: 1.1rem; color: var(--ink-2); max-width: 46ch; margin: 0 0 1.4rem; }
.cover .byline { font-size: 0.95rem; color: var(--muted); margin-bottom: 1.4rem; }
.cover-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 1.2rem; }
.btn.big { font-size: 1.02rem; padding: 0.75em 1.35em; }
.btn.ghost { background: rgba(25, 18, 21, 0.5); }
.cover .hint { font-size: 0.88rem; color: var(--muted); max-width: 58ch; }

#sound-hint {
  position: fixed; left: 50%; top: 18px; z-index: 45;
  transform: translate(-50%, -12px);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px 8px 12px; border-radius: 999px;
  border: 1px solid var(--silver); background: var(--panel); color: var(--ink);
  font-weight: 600; font-size: 0.9rem; cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
#sound-hint svg { width: 18px; height: 18px; color: var(--silver-hi); }
#sound-hint.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

/* ---------- Duyarlı ---------- */
@media (max-width: 1100px) {
  #bar .chapter-name { display: none; }
}
@media (max-width: 860px) {
  body { overflow: auto; }
  #deck { position: relative; inset: auto; }
  .slide {
    position: relative; inset: auto; display: none;
    grid-template-columns: 1fr !important; grid-auto-rows: auto;
    padding: 20px 16px 104px; transform: none !important;
  }
  .slide.active { display: grid; }
  /* telefonda sahne üstte, metin altta */
  .slide:not(.cover) .stage { order: -1; }
  .text { max-height: none; overflow: visible; padding-right: 0; }
  .stage { min-height: 72vh; }
  .cover { min-height: calc(100vh - var(--bar-h)); grid-template-rows: auto auto; padding: 0 0 104px; }
  .cover .stage { position: relative; inset: auto; height: 50vh; min-height: 330px; }
  .cover .cover-text { width: auto; align-self: start; padding: 8px 16px 0; }
  #bar { gap: 8px; background: var(--bg); padding: 0 12px; }
  #progress { margin: 0 8px 0 14px; }
  #progress::before { left: -12px; width: 12px; }
  #progress .ch { padding: 0 1px; }
  #progress .dot::before { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-width: 1px; }
  .volume input { display: none; }
  #bar .counter { display: none; }
  body.text-hidden .slide .text { display: block; }
}
@media (max-width: 480px) {
  #btn-text, #btn-notes { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .slide, .slide.active { transition: opacity 0.2s; transform: none; }
  .kc-k.hedef .kc-halka, .kc-k.hedef .kc-yuz { animation: none; stroke-width: 3.5; }
}

/* ---------- Sözlük balonları ---------- */
.term {
  color: inherit;
  text-decoration: underline dotted rgba(201, 206, 214, 0.7);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  cursor: help;
  border-radius: 2px;
}
.term:hover, .term:focus-visible { background: rgba(201, 206, 214, 0.12); text-decoration-color: var(--silver-hi); outline: none; }
#gloss {
  position: fixed; z-index: 20;
  width: min(320px, calc(100vw - 24px));
  padding: 12px 14px;
  background: #ece5da; color: #3a2c32;
  border-radius: var(--r-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  font-size: 0.9rem; line-height: 1.45;
  opacity: 0; transform: translateY(4px); pointer-events: none;
  transition: opacity .15s, transform .15s;
}
#gloss.open { opacity: 1; transform: none; pointer-events: auto; }
#gloss h4 { margin: 0 0 4px; font-family: var(--f-display); font-weight: 400; font-size: 1.1rem; color: #231a1e; }
#gloss p { margin: 0 0 8px; }
#gloss a { font-size: 0.82rem; font-weight: 600; color: #5b3b8a; text-decoration: none; }
#gloss a:hover { text-decoration: underline; }

/* ---------- Sesli anlatım çubuğu ---------- */
#narrator {
  position: fixed; left: 50%; bottom: calc(var(--bar-h) + 8px); z-index: 7;
  transform: translate(-50%, 12px);
  width: min(640px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 12px;
  padding: 7px 12px 7px 7px;
  background: rgba(55, 42, 48, 0.97);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  font-size: 0.82rem; color: var(--ink-2);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
#narrator.open { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.np-play { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 0; cursor: pointer; background: var(--silver); color: #1d1418; display: grid; place-items: center; }
.np-play svg { width: 18px; height: 18px; }
.np-track { flex: 1; min-width: 60px; height: 4px; background: var(--line); cursor: pointer; position: relative; border-radius: 2px; }
.np-track i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--silver-hi); border-radius: 2px; }
.np-time { font-size: 0.78rem; color: var(--ink); white-space: nowrap; }
.np-auto { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; }
.np-auto input { accent-color: var(--silver); }
.np-status:empty { display: none; }
.np-status { color: var(--silver-hi); white-space: nowrap; }
.np-close { border: 0; background: transparent; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 6px; }
.np-close:hover { color: var(--ink); }
@media (max-width: 860px) {
  #narrator { flex-wrap: wrap; border-radius: var(--r-md); }
  .np-auto { order: 5; }
}
body.narrating #deck { bottom: calc(var(--bar-h) + 58px); transition: bottom .2s; }
@media (max-width: 860px) { body.narrating #deck { bottom: auto; padding-bottom: 90px; } }

/* ---------- Deney rehberi ---------- */
#ghost-hand {
  position: fixed; left: 0; top: 0; z-index: 30; width: 34px; height: 34px;
  pointer-events: none; opacity: 0; transition: opacity .25s;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.5));
}
#ghost-hand svg { width: 100%; height: 100%; transition: transform .12s; transform-origin: 34% 12%; }
#ghost-hand.on { opacity: .95; }
#ghost-hand.down svg { transform: scale(.86); }
.ghost-ripple {
  position: fixed; z-index: 29; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  border: 2px solid var(--silver-hi); pointer-events: none; animation: ghostRipple .6s ease-out forwards;
}
@keyframes ghostRipple { to { transform: scale(3.6); opacity: 0; } }
#guide-ring { position: fixed; z-index: 6; pointer-events: none; border: 2px solid var(--silver-hi); opacity: 0; }
#guide-ring.on { animation: guidePulse 1.3s ease-out 3; }
#guide-ring.on.still { animation: none; opacity: 1; box-shadow: 0 0 0 4px rgba(230,233,238,.14), 0 0 22px rgba(230,233,238,.3); }
@keyframes guidePulse {
  0% { opacity: 1; box-shadow: 0 0 0 0 rgba(230,233,238,.5); }
  70% { opacity: .9; box-shadow: 0 0 0 14px rgba(230,233,238,0); }
  100% { opacity: 0; box-shadow: 0 0 0 14px rgba(230,233,238,0); }
}
.try.try-live { cursor: pointer; position: relative; padding-right: 96px; transition: background .2s, border-color .2s; }
.try.try-live:hover, .try.try-live:focus-visible { background: rgba(201,206,214,.12); outline: none; }
.try-cta {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 0.8rem; color: #1d1418;
  background: var(--silver); border-radius: 999px; padding: 4px 11px 4px 9px;
}
.try-cta::before { content: ""; width: 0; height: 0; border-left: 7px solid #1d1418; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
#guide-toast {
  position: fixed; left: 50%; top: 22px; transform: translate(-50%, -10px); z-index: 40;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px;
  font-size: .88rem; color: var(--ink);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
#guide-toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { #guide-ring.on { animation: none; opacity: 1; } }

/* ---------- Kaynak kodu ve lisans bağlantıları ---------- */
.cover-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 1rem; pointer-events: auto; }
.cover-meta a {
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
  font-size: .82rem; color: var(--muted);
  padding: 2px 0; border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
.cover-meta a:hover, .cover-meta a:focus-visible { color: var(--ink); border-bottom-color: var(--silver); }
.cover-meta svg { width: 17px; height: 17px; }
.cover-meta img { width: 18px; height: 18px; display: block; opacity: .8; }
.cover-meta .lic img + img { margin-left: -3px; }
.cover-meta .lic span { margin-left: 3px; }
.text .cover-meta a { color: var(--muted); }
