/* ============ Yıldız Tozu – kitap görünümü ============ */
:root {
  --ink: #2d241c;
  --ink-2: #5b4c3e;
  --ink-3: #8a7a68;
  --paper: #fbf6ea;
  --paper-2: #f3ead6;
  --rule: #d9cdb4;
  --rust: #a8453c;
  --blue: #3f5a7a;
  --green: #5f7f4a;
  --ochre: #c9962e;
  --desk: #3a2f27;
  --font-size: 19px;
  --pw: 460px;
  --ph: 640px;
  --serif: 'Alegreya', Georgia, 'Times New Roman', serif;
  --sc: 'Alegreya SC', 'Alegreya', Georgia, serif;
  --hand: 'Caveat', 'Segoe Print', cursive;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--serif); color: var(--ink);
  background-color: var(--desk);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .9' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 .1  0 0 0 0 .07  0 0 0 0 .04  0 0 0 .35 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 50% 40%, #4a3c31 0%, #2c231d 75%);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--rust); outline-offset: 2px; }
[hidden] { display: none !important; }

#desk { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 12px; }

/* ---------- Kapak ---------- */
.cover {
  position: relative; width: min(420px, 80vw); aspect-ratio: 0.72; border-radius: 4px 12px 12px 4px;
  background-color: #6e3f27;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .18 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23c)'/%3E%3C/svg%3E"),
    linear-gradient(90deg, #4f2b19 0, #6e3f27 6%, #6e3f27 100%);
  box-shadow: inset 6px 0 0 rgba(0,0,0,.25), inset -2px 0 0 rgba(255,255,255,.06), 0 30px 60px rgba(0,0,0,.5), 0 6px 14px rgba(0,0,0,.4);
  transform-origin: left center; transition: transform 1s cubic-bezier(.5,.05,.3,1), opacity .4s .7s;
  display: flex; align-items: center; justify-content: center;
}
.cover:hover { transform: rotateY(-4deg); }
.cover.opening { transform: perspective(1600px) rotateY(-150deg); opacity: 0; }
.cover-frame { position: absolute; inset: 22px 22px 22px 34px; border: 2px solid #c9a24a; border-radius: 3px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 26px 16px; color: #d8b45c; text-align: center; }
.cover-frame::before { content: ''; position: absolute; inset: 6px; border: 1px solid rgba(201,162,74,.5); }
.cover-top { font-family: var(--sc); letter-spacing: .25em; font-size: 14px; }
.cover-title { font-family: var(--sc); font-weight: 700; font-size: clamp(44px, 9vw, 66px); line-height: .95; letter-spacing: .06em; text-shadow: 0 1px 0 rgba(0,0,0,.4); }
.cover-art { width: 44%; opacity: .95; }
.cover-art svg { width: 100%; filter: sepia(1) saturate(1.6) hue-rotate(-8deg) brightness(.95); }
.cover-sub { font-style: italic; font-size: 18px; }
.cover-hint { position: absolute; bottom: -38px; left: 0; right: 0; text-align: center; color: #d9cbb5; font-style: italic; font-size: 15px; opacity: .8; }

/* ---------- Açık kitap ---------- */
.book {
  position: relative; display: flex; perspective: 2600px;
  width: calc(var(--pw) * 2); height: var(--ph);
  animation: bookIn .7s ease both;
}
.book.single { width: var(--pw); }
.book::before { /* kitap kalınlığı / alt sayfalar */
  content: ''; position: absolute; inset: 4px -6px -8px -6px; border-radius: 6px;
  background: repeating-linear-gradient(0deg, #e9dfc8 0 1px, #f6efdf 1px 3px); box-shadow: 0 30px 50px rgba(0,0,0,.45);
  z-index: -1;
}
.book.single::before { inset: 4px -6px -8px 2px; }
.slot { position: relative; width: var(--pw); height: var(--ph); }
.book.single .slot.left { display: none; }
.slot:empty { visibility: hidden; }

.page {
  position: absolute; inset: 0; background: var(--paper); overflow: hidden;
  display: flex; flex-direction: column;
  padding: var(--pad-y, 40px) var(--pad-x, 46px) 26px;
}
.page::before { /* kağıt dokusu */
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 .45  0 0 0 0 .35  0 0 0 0 .2  0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23p)'/%3E%3C/svg%3E");
}
.page.verso { border-radius: 6px 0 0 6px; box-shadow: inset -26px 0 30px -22px rgba(80, 55, 25, .35); }
.page.recto { border-radius: 0 6px 6px 0; box-shadow: inset 26px 0 30px -22px rgba(80, 55, 25, .35); }
.book.single .page { border-radius: 2px 6px 6px 2px; box-shadow: inset 14px 0 20px -16px rgba(80, 55, 25, .35); }
.page.past { background: #efe6d2; }
.page.past .content { filter: sepia(.45) grayscale(.35); transition: filter 1.2s; }
.page.past.restored .content { filter: none; }

.runhead { flex: none; display: flex; justify-content: space-between; font-family: var(--sc); font-size: 12px; letter-spacing: .14em; color: var(--ink-3); margin-bottom: 18px; min-height: 14px; position: relative; }
.content { flex: 1; min-height: 0; overflow: hidden; position: relative; }
.folio { flex: none; text-align: center; font-size: 13px; color: var(--ink-3); margin-top: 10px; position: relative; }

/* Metin */
.content p { font-size: var(--font-size); line-height: 1.62; margin: 0 0 .45em; text-indent: 1.3em; hyphens: manual; }
.content p.cont { text-indent: 0; }
.content p.noind, .content h3 + p, .content .orn + p { text-indent: 0; }
.content p.dropcap::first-letter { font-family: var(--sc); font-weight: 700; float: left; font-size: 3.5em; line-height: .82; padding: 6px 8px 0 0; color: var(--rust); }
.content p.letter { font-style: italic; color: #4a3a2a; text-indent: 0; padding-left: 18px; border-left: 2px solid var(--rule); margin-left: 4px; }
.content .letter-head { font-family: var(--sc); font-size: 14px; letter-spacing: .14em; color: var(--rust); margin: 6px 0 8px 4px; }
.content h3.sec { font-family: var(--sc); font-weight: 500; font-size: 1.15em; text-align: center; letter-spacing: .08em; margin: .6em 0 .5em; }
.content .orn { display: block; width: 140px; margin: 10px auto; }
.content .speaking { background: linear-gradient(transparent 62%, rgba(201,150,46,.35) 62%); }

/* Bölüm açılış sayfası */
.opener { height: 100%; display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 4%; }
.opener .num { font-family: var(--sc); letter-spacing: .3em; font-size: 14px; color: var(--rust); }
.opener h2 { font-family: var(--serif); font-weight: 500; font-size: 2.05em; line-height: 1.1; margin: 10px 0 6px; }
.opener h4 { font-weight: 400; font-style: italic; font-size: 1.15em; margin: 0; color: var(--ink-2); }
.opener .ill { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 4px; margin: 6px 0; }
.opener .ill .art { width: 34%; max-width: 150px; height: auto; max-height: 100%; }
.opener .ill .firefly { width: 16%; max-width: 70px; }
.opener .ill .bird { width: 38%; max-width: 170px; }
.opener blockquote { margin: 0 0 10px; font-style: italic; font-size: 1.05em; max-width: 92%; }
.opener .meta { font-size: 13px; color: var(--ink-3); line-height: 1.5; }
.opener.future { opacity: .55; }
.opener.future .blank-note { font-family: var(--hand); font-size: 24px; color: var(--ink-2); margin-top: 8px; }

/* Ön sayfalar */
.title-page { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; }
.title-page .small { font-family: var(--sc); letter-spacing: .3em; font-size: 13px; color: var(--ink-3); }
.title-page h1 { font-family: var(--sc); font-weight: 700; font-size: 3.1em; margin: 0; letter-spacing: .06em; line-height: 1; }
.title-page .art { width: 46%; margin: 10px 0; }
.title-page p { font-style: italic; margin: 0; }
.imprint { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.content .imprint p { text-indent: 0; font-size: 15px; line-height: 1.55; margin: 0 0 .8em; }
.imprint b { font-family: var(--sc); font-weight: 500; letter-spacing: .06em; }
.imprint a, .link { color: var(--rust); text-decoration: underline; cursor: pointer; }

.exlibris { height: 100%; display: flex; align-items: center; justify-content: center; }
.exlibris .plate { width: 92%; border: 2px solid var(--ink); outline: 1px solid var(--ink); outline-offset: 5px; padding: 30px 20px 26px; text-align: center; }
.exlibris .plate h3 { font-family: var(--sc); letter-spacing: .3em; font-weight: 500; margin: 0 0 10px; }
.exlibris .plate .art { width: 90px; }
.exlibris .line { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin: 18px 0 6px; flex-wrap: wrap; }
.exlibris input { font-family: var(--hand); font-size: 34px; color: var(--blue); border: 0; border-bottom: 1.5px solid var(--ink); background: transparent; width: 220px; text-align: center; padding: 0 4px; }
.exlibris .name { font-family: var(--hand); font-size: 40px; color: var(--blue); border-bottom: 1.5px solid var(--ink); padding: 0 14px; }
.exlibris small { display: block; color: var(--ink-3); font-size: 13px; margin-top: 12px; }

.toc h2 { font-family: var(--sc); font-weight: 500; letter-spacing: .2em; text-align: center; font-size: 1.2em; margin: 6px 0 22px; }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc li { margin-bottom: 12px; }
.toc button { width: 100%; display: flex; align-items: baseline; gap: 6px; text-align: left; font-size: 17px; padding: 2px 0; }
.toc button:hover .t { color: var(--rust); }
.toc .n { font-family: var(--sc); font-size: 13px; color: var(--ink-3); min-width: 74px; letter-spacing: .06em; }
.toc .t { flex: 0 1 auto; min-width: 0; }
.toc .dots { flex: 1 0 12px; border-bottom: 1.5px dotted var(--ink-3); transform: translateY(-4px); }
.toc .pg { flex: none; font-variant-numeric: oldstyle-nums; }
.toc li.off .pg { font-style: italic; font-size: 14px; }
.toc li.off { opacity: .5; }
.toc li.off button { cursor: default; }

/* ---------- Etkinlik / etkileşim sayfaları ---------- */
.task { display: flex; flex-direction: column; height: 100%; gap: 8px; }
.task .kicker { font-family: var(--sc); font-size: 13px; letter-spacing: .2em; color: var(--rust); text-align: center; }
.task h3 { font-weight: 500; font-size: 1.45em; text-align: center; margin: 0; line-height: 1.15; }
.task .hint { font-style: italic; text-align: center; color: var(--ink-2); margin: 0 auto; font-size: .95em; line-height: 1.45; max-width: 95%; }
.task .field { position: relative; flex: 1; min-height: 200px; }
.task .msg { min-height: 1.4em; text-align: center; font-style: italic; color: var(--green); font-weight: 500; }
.task .skip { position: absolute; right: 0; bottom: 0; font-size: 12px; color: var(--ink-3); text-decoration: underline; z-index: 4; }
.stamp {
  position: absolute; right: 6px; bottom: 34px; z-index: 4; transform: rotate(-12deg);
  border: 2px solid var(--rust); color: var(--rust); border-radius: 50%; width: 74px; height: 74px;
  display: grid; place-items: center; text-align: center; font-family: var(--sc); font-size: 11px; letter-spacing: .08em; line-height: 1.15;
  opacity: .85; animation: stampIn .35s cubic-bezier(.3,1.6,.5,1) both; pointer-events: none;
}
.stamp::before { content: ''; position: absolute; inset: 4px; border: 1px solid var(--rust); border-radius: 50%; }
.tap { cursor: pointer; }
.btn {
  display: inline-block; font-family: var(--sc); font-size: 16px; letter-spacing: .08em; padding: 8px 18px;
  border: 1.5px solid var(--ink); border-radius: 3px; background: var(--paper); box-shadow: 2px 2px 0 var(--ink);
  transition: transform .1s, box-shadow .1s;
}
.btn:hover { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 var(--ink); }
.btn:active { transform: translate(2px,2px); box-shadow: 0 0 0 var(--ink); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.center { text-align: center; }
.pulse { animation: nudge 1.6s ease-in-out infinite; }

.name-card { position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; width: max-content; max-width: 96%; background: var(--paper-2); border: 1.5px solid var(--ink); padding: 8px 14px; font-size: 15px; line-height: 1.35; animation: fadeIn .5s both; }
.name-card b { font-family: var(--sc); font-size: 17px; color: var(--rust); display: block; }
.name-card small { color: var(--ink-3); display: block; }
.pf-center { position: absolute; inset: 0; margin: auto; height: max-content; transition: all .6s cubic-bezier(.3,1.2,.5,1); }
.pf-center.up { inset: 0 0 auto 0; width: 110px !important; }

.drag { position: absolute; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-2); border: 1.5px dashed var(--ink-2); touch-action: none; cursor: grab; user-select: none; z-index: 5; }
.drag svg { width: 80%; height: 80%; }
.drag.dragging { cursor: grabbing; box-shadow: 0 6px 14px rgba(0,0,0,.2); z-index: 9; }
.drag.used { opacity: 0; pointer-events: none; transition: opacity .3s; }
.drop { position: absolute; border: 1.5px dashed transparent; border-radius: 8px; }
.drop.over { border-color: var(--rust); background: rgba(168,69,60,.06); }
.nest { left: 0; right: 0; margin: 0 auto; bottom: 18px; width: 170px; height: 74px; border-color: var(--ink-3); border-radius: 0 0 90px 90px; overflow: hidden; }
.nest .fill { position: absolute; inset: auto 0 0 0; height: 0; background: repeating-linear-gradient(35deg, #8a5a33 0 5px, #a8784a 5px 9px, #6f8f4e 9px 11px); transition: height .6s; }

.window { position: absolute; inset: 0; margin: auto; width: 170px; height: 190px; border-radius: 85px 85px 6px 6px; background: #22263a; border: 8px solid #8a5a33; outline: 1.5px solid var(--ink); overflow: hidden; transition: background 1.2s; cursor: pointer; }
.window::before, .window::after { content: ''; position: absolute; background: #8a5a33; }
.window::before { left: 50%; top: 0; bottom: 0; width: 6px; transform: translateX(-50%); }
.window::after { top: 52%; left: 0; right: 0; height: 6px; }
.window.lit { background: #f2e2a8; }

.chest .chest-lid { transform-origin: 30px 100px; transition: transform .9s cubic-bezier(.3,1.5,.5,1); }
.chest.open .chest-lid { transform: rotate(-24deg) translate(-8px, -14px); }
.chest-wrap { position: relative; width: 230px; margin: 60px auto 0; }
.chest-wrap .charm { position: absolute; left: 0; right: 0; margin: 0 auto; top: 0; width: 90px; transform: translateY(60px) scale(.3); opacity: 0; transition: all 1.1s cubic-bezier(.2,1.3,.4,1) .4s; }
.chest-wrap.reveal .charm { transform: translateY(-70px) scale(1); opacity: 1; }

.threads-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.threads-svg path { fill: none; stroke-linecap: round; transition: stroke 1.2s, stroke-width 1.2s, opacity .8s; }
.threads-svg .hidden { opacity: 0; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; font-size: 13.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 22px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }

.choices { display: grid; gap: 8px; }
.choice { text-align: left; display: flex; gap: 10px; align-items: baseline; padding: 7px 10px; border: 1.5px solid var(--rule); border-radius: 4px; font-size: 16.5px; line-height: 1.35; background: rgba(255,255,255,.35); transition: border-color .2s, background .2s; }
.choice:hover { border-color: var(--ink-2); }
.choice .l { font-family: var(--sc); color: var(--ink-3); flex: none; }
.choice.picked { border-color: var(--blue); background: rgba(63,90,122,.08); }
.choice.correct { border-color: var(--green); background: rgba(95,127,74,.12); }
.choice.wrong { border-color: var(--rust); background: rgba(168,69,60,.08); }
.choice.correct .l::after { content: ' ✓'; color: var(--green); }
.choice.wrong .l::after { content: ' ✗'; color: var(--rust); }
.choice[disabled] { cursor: default; }
.why { font-style: italic; font-size: 15px; color: var(--ink-2); margin-top: 6px; line-height: 1.4; }

.seals { display: grid; gap: 8px; }
.seal-item { border: 1.5px solid var(--rule); border-radius: 4px; padding: 8px 12px; text-align: left; background: rgba(255,255,255,.35); }
.seal-item .h { display: flex; align-items: center; gap: 10px; font-family: var(--sc); letter-spacing: .04em; font-size: 16px; }
.seal-item .wax { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 13px; font-family: var(--serif); font-weight: 700; box-shadow: inset 0 -2px 0 rgba(0,0,0,.2); }
.seal-item p { margin: 6px 0 0; font-size: 14.5px; line-height: 1.45; display: none; }
.seal-item.open p { display: block; animation: fadeIn .5s both; }
.seal-item:not(.open) .h::after { content: 'aç'; margin-left: auto; font-size: 12px; color: var(--ink-3); }

.hold-btn { position: absolute; inset: 0; margin: auto; width: 140px; height: 140px; border-radius: 50%; display: grid; place-items: center; touch-action: none; user-select: none; z-index: 3; transition: opacity .6s; }
.hold-btn .charm { width: 92px; pointer-events: none; }
.hold-ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.hold-ring circle { fill: none; stroke: var(--rust); stroke-width: 3; stroke-dasharray: 427; stroke-dashoffset: 427; }
.hold-ring circle.bg { stroke: var(--rule); stroke-dashoffset: 0; }
.factory { position: absolute; inset: 0; display: flex; align-items: flex-end; opacity: 0; transition: opacity 1.6s; }
.factory.show { opacity: 1; }
.factory svg { width: 100%; }
.smoke { animation: smoke 4s ease-in infinite; transform-box: fill-box; transform-origin: center; }

.net-field { position: absolute; inset: 0; }
.net-field svg.net { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.net-field svg.net line { stroke: var(--ochre); stroke-width: 2.5; stroke-linecap: round; }
.net-kid { position: absolute; width: 46px; transform: translate(-50%, -50%); filter: grayscale(1) opacity(.65); transition: filter .4s; }
.net-kid.joined { filter: none; }
.chain-txt { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-family: var(--sc); font-size: 13px; letter-spacing: .1em; color: var(--ink-3); }

.word-row { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.slot-l { width: 38px; height: 46px; border-bottom: 2px solid var(--ink); display: grid; place-items: center; font-family: var(--hand); font-size: 34px; color: var(--blue); }
.tile { width: 42px; height: 46px; border: 1.5px solid var(--ink); border-radius: 3px; font-family: var(--sc); font-size: 22px; background: var(--paper-2); box-shadow: 2px 2px 0 var(--ink); }
.tile.used { visibility: hidden; }
.tile.no { animation: shake .35s; }
.word-list { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; font-family: var(--sc); letter-spacing: .1em; font-size: 14px; color: var(--ink-3); }
.word-list span.got { color: var(--green); text-decoration: underline; }
.clue { text-align: center; font-style: italic; color: var(--ink-2); }

.notebook { flex: 1; background: #fffdf6; border: 1px solid var(--rule); padding: 10px 12px 10px 34px; position: relative; background-image: repeating-linear-gradient(transparent 0 29px, #cfdcec 29px 30px); }
.notebook::before { content: ''; position: absolute; left: 22px; top: 0; bottom: 0; width: 1.5px; background: #e2a29a; }
.notebook .ttl { font-family: var(--hand); font-size: 26px; color: var(--blue); line-height: 30px; text-align: center; }
.notebook label { font-size: 14px; font-weight: 700; display: block; line-height: 30px; }
.notebook textarea, .notebook input { width: 100%; font-family: var(--hand); font-size: 23px; color: var(--blue); border: 0; background: transparent; resize: none; line-height: 30px; padding: 0; }
.notebook textarea { height: 90px; }

/* Etkinlik kartları */
.match { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; flex: 1; align-content: start; }
.m-col { display: grid; gap: 8px; align-content: start; }
.m-item { display: flex; align-items: center; gap: 8px; text-align: left; padding: 6px 8px; border: 1.5px solid var(--rule); border-radius: 4px; font-size: 14.5px; line-height: 1.3; min-height: 64px; background: rgba(255,255,255,.35); }
.m-item .art { width: 44px; flex: none; }
.m-item .firefly { width: 34px; }
.m-item b { font-family: var(--sc); font-weight: 500; font-size: 16px; }
.m-item.sel { border-color: var(--blue); background: rgba(63,90,122,.08); }
.m-item.matched { border-color: var(--green); background: rgba(95,127,74,.12); pointer-events: none; }
.m-item.wrong { animation: shake .4s; border-color: var(--rust); }

.ecard { border: 1.5px solid var(--ink); padding: 12px 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; background: rgba(255,255,255,.35); position: relative; }
.ecard .who { font-family: var(--sc); font-size: 18px; color: var(--blue); }
.ecard p { margin: 0; line-height: 1.45; font-size: 16px; }
.ecard .q { font-family: var(--sc); font-size: 13px; letter-spacing: .08em; color: var(--ink-3); margin-top: 4px; }
.feel { display: flex; flex-wrap: wrap; gap: 6px; }
.feel button { border: 1px solid var(--rule); border-radius: 20px; padding: 2px 12px; font-size: 14.5px; }
.feel button.on { border-color: var(--blue); background: var(--blue); color: #fff; }
.thread-line { height: 3px; background: #a39d93; margin-top: auto; transition: background 1.2s, height .6s; border-radius: 2px; }
.thread-line.healed { height: 6px; background: linear-gradient(90deg, var(--ochre), var(--rust)); }

.mission { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; padding: 5px 0; border-bottom: 1px dotted var(--rule); font-size: 15.5px; line-height: 1.35; }
.mission .box { flex: none; width: 20px; height: 20px; border: 1.5px solid var(--ink); margin-top: 2px; display: grid; place-items: center; font-size: 15px; color: var(--blue); font-family: var(--hand); font-weight: 700; }
.mission b { font-family: var(--sc); font-weight: 500; }

.likert-q { padding: 4px 0 8px; border-bottom: 1px dotted var(--rule); margin-bottom: 6px; }
.likert-q .s { font-size: 16.5px; line-height: 1.35; margin-bottom: 4px; }
.likert { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.lk { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 2px; border-radius: 6px; border: 1.5px solid transparent; }
.lk .face { width: 36px; }
.lk small { font-size: 10.5px; color: var(--ink-3); text-align: center; line-height: 1.1; }
.lk.on { border-color: var(--blue); background: rgba(63,90,122,.08); }
.lk.on .face circle:first-child { fill: #f0cf7e; }
.q-head { font-family: var(--sc); font-size: 13px; letter-spacing: .14em; color: var(--rust); margin: 4px 0 6px; }
.q-block { margin-bottom: 12px; }
.q-block .s { font-weight: 500; font-size: 17px; margin-bottom: 6px; line-height: 1.35; }

/* Şifre defteri */
.codex-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cx { border: 1px solid var(--rule); padding: 5px 6px; min-height: 64px; font-size: 12px; line-height: 1.2; color: var(--ink-3); position: relative; }
.cx .n { font-family: var(--sc); font-size: 18px; display: block; }
.cx.got { color: var(--ink); border-color: var(--ink-2); }
.cx.got .n { color: var(--c); }
.cx.got::after { content: 'çözüldü'; position: absolute; right: 4px; top: 4px; font-family: var(--sc); font-size: 9px; color: var(--c); border: 1px solid var(--c); padding: 0 3px; transform: rotate(8deg); }

/* ---------- Sayfa çevirme ---------- */
.leaf { position: absolute; top: 0; width: var(--pw); height: var(--ph); transform-style: preserve-3d; z-index: 20; will-change: transform; }
.leaf.fwd { left: var(--pw); transform-origin: left center; }
.leaf.bwd { left: 0; transform-origin: right center; }
.book.single .leaf.fwd, .book.single .leaf.bwd { left: 0; transform-origin: left center; }
.leaf .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.leaf .face.b { transform: rotateY(180deg); }
.leaf .face.blank { background: var(--paper-2); }
.leaf .shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(0,0,0,.18), transparent 40%); opacity: 0; transition: opacity .4s; }

/* ---------- Araç çubuğu ---------- */
.toolbar { display: flex; align-items: center; gap: 4px; padding: 4px 8px; background: rgba(28, 22, 18, .78); border: 1px solid rgba(255,255,255,.08); border-radius: 6px; color: #e9dfcb; font-size: 15px; max-width: 100%; }
.tb { padding: 6px 10px; border-radius: 4px; white-space: nowrap; }
.tb:hover { background: rgba(255,255,255,.08); }
.tb.on { background: #e9dfcb; color: var(--ink); }
.tb.arrow { font-size: 26px; line-height: 1; padding: 2px 14px 6px; }
.tb-page { min-width: 108px; text-align: center; font-variant-numeric: tabular-nums; color: #bcae98; font-size: 14px; }

#measure { position: fixed; left: -10000px; top: 0; visibility: hidden; pointer-events: none; }
#note { position: fixed; left: 50%; top: 18px; transform: translate(-50%, -20px); opacity: 0; background: var(--paper); color: var(--ink); border: 1.5px solid var(--ink); padding: 8px 16px; font-style: italic; box-shadow: 3px 3px 0 var(--ink); transition: all .3s; z-index: 100; pointer-events: none; max-width: 90vw; text-align: center; }
#note.show { opacity: 1; transform: translate(-50%, 0); }
.page.nope { animation: shake .4s; }

/* ---------- Karakter animasyonları (sakin) ---------- */
.cat .cat-tail { transform-origin: 140px 168px; animation: tail 3s ease-in-out infinite; }
.cat .blink { transform-box: fill-box; transform-origin: center; animation: blink 5s infinite; }
.bird .wing-front { transform-origin: 112px 86px; animation: flap .6s ease-in-out infinite alternate; }
.bird .wing-back { transform-origin: 104px 80px; animation: flap2 .6s ease-in-out infinite alternate; }
.bird.rest .wing-front, .bird.rest .wing-back { animation-duration: 2.6s; }
.firefly .ff-halo { animation: halo 2.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.firefly .ff-wings { animation: buzz .14s linear infinite alternate; transform-origin: 60px 50px; }
.firefly.dim .ff-halo { animation: none; opacity: 0; }
.firefly.dim .ff-belly { fill: #b9ad86; }
.charm .charm-heart { animation: beat 1.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.book .twinkle path { animation: twinkle 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.book .twinkle path:nth-child(2) { animation-delay: .8s; }
.book .twinkle path:nth-child(3) { animation-delay: 1.5s; }
.float { animation: float 4s ease-in-out infinite; }

@keyframes tail { 0%,100% { transform: rotate(0); } 50% { transform: rotate(-12deg); } }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes flap { from { transform: rotate(6deg); } to { transform: rotate(-20deg); } }
@keyframes flap2 { from { transform: rotate(-6deg); } to { transform: rotate(14deg); } }
@keyframes halo { 0%,100% { opacity: .25; transform: scale(.85); } 50% { opacity: .8; transform: scale(1.05); } }
@keyframes buzz { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
@keyframes beat { 0%,100% { transform: scale(1); } 15% { transform: scale(1.06); } 30% { transform: scale(.99); } }
@keyframes twinkle { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes stampIn { from { opacity: 0; transform: rotate(-12deg) scale(1.6); } }
@keyframes shake { 20%,60% { transform: translateX(-5px); } 40%,80% { transform: translateX(5px); } }
@keyframes nudge { 0%,100% { transform: translateX(0); } 50% { transform: translateX(4px); } }
@keyframes smoke { 0% { opacity: .8; transform: translateY(0) scale(.7); } 100% { opacity: 0; transform: translateY(-40px) scale(1.5); } }
@keyframes bookIn { from { opacity: 0; transform: scale(.97); } }

@media (max-width: 860px) {
  #desk { padding: 6px; gap: 6px; }
  .toolbar { font-size: 13.5px; gap: 0; padding: 2px 4px; }
  .tb { padding: 6px 7px; }
  .tb.arrow { padding: 2px 10px 6px; }
  .tb-page { min-width: 64px; font-size: 12.5px; }
  .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ============ Öğretmen paneli ============ */
#teacher { position: fixed; inset: 0; overflow: auto; background: #f6f1e6; color: var(--ink); z-index: 200; font-family: var(--serif); }
