* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #05070f; color: #f3ead8; overflow: hidden;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif; -webkit-tap-highlight-color: transparent; user-select: none; }
body { display: flex; align-items: center; justify-content: center; }

#stage { position: relative; --s: 3; width: calc(384px * var(--s)); height: calc(224px * var(--s));
  box-shadow: 0 0 0 1px #1b2233, 0 20px 60px #000c; overflow: hidden; }
#cv { width: 100%; height: 100%; display: block; image-rendering: pixelated; image-rendering: crisp-edges; }

/* ölçeklenen yazı: 1 birim = oyun pikseli */
#stage { font-size: calc(var(--s) * 5.2px); }

/* HUD */
#hud { position: absolute; left: calc(var(--s) * 4px); top: calc(var(--s) * 3px); pointer-events: none;
  text-shadow: 0 2px 0 #000, 0 0 6px #000; }
#hud .row { display: flex; gap: 1em; align-items: center; font-weight: 700; }
.hearts { color: #ff5a6e; letter-spacing: .1em; font-size: 1.2em; }
.shards { color: #8fe6ff; }
.quest { margin-top: .2em; font-size: .9em; color: #ffe7a8; }
.quest::before { content: "▶ "; color: #ffd84d; }

#ai-panel { position: absolute; right: calc(var(--s) * 4px); top: calc(var(--s) * 3px); background: #05070fcc;
  border: 1px solid #2c3550; border-radius: .4em; padding: .3em .6em; font-size: .78em; line-height: 1.5; pointer-events: none; }
#ai-panel b { font-weight: 700; }

#prompt { position: absolute; transform: translate(-50%, -100%); background: #0b1020e6; border: 1px solid #ffd84d88;
  color: #ffe7a8; padding: .1em .45em; border-radius: .3em; font-size: .75em; white-space: nowrap; pointer-events: none; }
#prompt kbd { background: #ffd84d; color: #1a1408; border-radius: .2em; padding: 0 .3em; font-weight: 800; margin-right: .3em; font-family: inherit; }

#toast { position: absolute; left: 50%; top: calc(var(--s) * 30px); transform: translateX(-50%); background: #0b1020e6;
  border: 1px solid #8fe6ff66; color: #bff0ff; padding: .3em .9em; border-radius: .4em; font-weight: 700; white-space: nowrap;
  animation: pop .25s ease-out; pointer-events: none; }
@keyframes pop { from { transform: translateX(-50%) scale(.85); opacity: 0; } }

#dialog { position: absolute; left: 5%; right: 5%; bottom: calc(var(--s) * 6px); min-height: 22%;
  background: linear-gradient(#0d1428f2, #070b18f2); border: 2px solid #c9a95a; border-radius: .5em;
  box-shadow: 0 0 0 2px #2a1f0a, 0 10px 30px #000a; padding: .5em .9em 1.2em; cursor: pointer; }
#dialog .who { color: #ffd84d; font-weight: 800; font-size: .85em; letter-spacing: .05em; min-height: 1em; }
#dialog .text { font-size: 1.05em; line-height: 1.35; margin-top: .15em; }
#dialog .hint { position: absolute; right: .8em; bottom: .3em; font-size: .65em; color: #9aa3b8; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* ekranlar */
.screen { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, #05070f55, #05070fd9); }
.screen[hidden], #hud[hidden], #dialog[hidden], #toast[hidden], #prompt[hidden], #ai-panel[hidden], #touch[hidden] { display: none; }
.panel { text-align: center; display: flex; flex-direction: column; align-items: center; gap: .55em; max-width: 80%; }
.panel h1 { font-family: Georgia, "Times New Roman", serif; font-size: 3.2em; margin: 0; color: #ffe7a8; letter-spacing: .03em;
  text-shadow: 0 0 .4em #ffb84d88, 0 4px 0 #3a2508; }
.panel h2 { font-family: Georgia, serif; font-size: 2.2em; margin: 0 0 .2em; color: #ffe7a8; text-shadow: 0 3px 0 #3a2508; }
.panel .sub { margin: 0 0 .6em; color: #c9cfdf; font-style: italic; }
.panel button { font: inherit; font-weight: 700; color: #f3ead8; background: #141b2f; border: 2px solid #3a4565; border-radius: .4em;
  padding: .35em 1.4em; min-width: 9em; cursor: pointer; transition: transform .08s, border-color .1s; }
.panel button:hover, .panel button:focus-visible { border-color: #ffd84d; outline: none; transform: translateY(-1px); }
.panel button.primary { background: linear-gradient(#ffd84d, #e0a92e); color: #2a1c05; border-color: #fff0b0; font-size: 1.25em; padding: .35em 2em; }
.opts { display: flex; gap: .5em; flex-wrap: wrap; justify-content: center; }
.panel button.opt { min-width: 0; font-size: .85em; padding: .3em .8em; }
.controls { font-size: .72em; color: #aab3c8; margin: .4em 0 0; line-height: 1.8; }
.controls kbd { background: #20283f; border: 1px solid #3a4565; border-radius: .25em; padding: 0 .35em; font-family: inherit; color: #f3ead8; }
.credits { font-size: .6em; color: #6f7891; margin: .3em 0 0; }

/* dokunmatik */
#touch { position: absolute; inset: 0; pointer-events: none; }
#joy { position: absolute; left: 4%; bottom: 8%; width: 26%; aspect-ratio: 1; max-width: 170px; border-radius: 50%;
  background: #ffffff10; border: 2px solid #ffffff30; pointer-events: auto; touch-action: none; }
#knob { position: absolute; left: 50%; top: 50%; width: 40%; height: 40%; margin: -20% 0 0 -20%; border-radius: 50%;
  background: #ffd84d99; border: 2px solid #fff0b0aa; }
#btn-act { position: absolute; right: 5%; bottom: 12%; width: 15%; max-width: 90px; aspect-ratio: 1; border-radius: 50%;
  background: #ffd84dcc; border: 3px solid #fff0b0; color: #2a1c05; font-family: inherit; font-weight: 800; font-size: 2em;
  pointer-events: auto; touch-action: none; }
#btn-pause { position: absolute; right: 3%; top: 4%; background: #0b1020aa; border: 1px solid #3a4565; color: #f3ead8;
  border-radius: .3em; padding: .2em .5em; font-size: .8em; pointer-events: auto; }

/* bölüm başlığı */
#banner { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); pointer-events: none; white-space: nowrap;
  font-family: Georgia, serif; font-size: 2.4em; color: #ffe7a8; text-shadow: 0 0 .5em #ffb84d88, 0 3px 0 #3a2508;
  animation: banner 2.6s ease-in-out forwards; }
#banner[hidden] { display: none; }
@keyframes banner { 0% { opacity: 0; letter-spacing: .3em; } 20%, 75% { opacity: 1; letter-spacing: .05em; } 100% { opacity: 0; } }

/* bölüm seçimi */
#chapter-btns:empty { display: none; }
.panel button.ch { min-width: 0; font-size: .85em; padding: .3em .9em; }
.panel button.ch.done::after { content: " ✓"; color: #7ee787; }
.panel button[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

/* telefon dik tutulunca: yan çevir uyarısı */
#rotate { display: none; position: fixed; inset: 0; z-index: 100; background: #05070f; color: #f3ead8;
  flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; padding: 24px;
  font: 600 18px "Trebuchet MS", system-ui, sans-serif; }
#rotate .phone { width: 46px; height: 80px; border: 4px solid #ffd84d; border-radius: 9px; position: relative; animation: rot 2.2s ease-in-out infinite; }
#rotate .phone::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 10px; height: 3px; margin-left: -5px; background: #ffd84d; border-radius: 2px; }
@keyframes rot { 0%, 25% { transform: rotate(0); } 55%, 100% { transform: rotate(-90deg); } }
@media (orientation: portrait) and (pointer: coarse) { #rotate { display: flex; } }
