:root {
  --bg: #0e0d0c;
  --bg2: #171513;
  --ink: #f3eee5;
  --soft: #d9d2c6;
  --muted: #938b7f;
  --line: #2b2723;
  --accent: #f2c14e;
  --ok: #7be0a8;
  --bad: #ff7a6b;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- Üst çubuk ---- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; gap: .9rem;
  padding: max(.7rem, env(safe-area-inset-top)) 1rem .9rem;
  background: linear-gradient(var(--bg) 55%, transparent);
}
.logo { font-family: var(--serif); font-size: 1.4rem; font-weight: 700; letter-spacing: -.03em; color: var(--ink); text-decoration: none; flex: none; }
.logo span { color: var(--accent); }
.chips { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; padding: .1rem 0; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: transparent; color: var(--muted);
  padding: .32rem .8rem; border-radius: 999px; font-size: .82rem; cursor: pointer; white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
}
.chip:hover { color: var(--ink); border-color: #4a443c; }
.chip[aria-pressed='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 600; }
.btn-add {
  flex: none; border: 0; background: var(--accent); color: #1a1405; font-weight: 700;
  padding: .5rem .95rem; border-radius: 999px; cursor: pointer; font-size: .9rem;
  transition: transform .15s;
}
.btn-add:hover { transform: translateY(-1px); }

/* ---- Akış ---- */
.feed {
  height: 100dvh; overflow-y: auto; scroll-snap-type: y mandatory;
  overscroll-behavior: contain; scroll-behavior: smooth; outline: none;
}
.card {
  --c: var(--accent);
  position: relative; isolation: isolate; scroll-snap-align: start; scroll-snap-stop: always;
  min-height: 100dvh; display: grid; place-items: center;
  padding: 6rem 1.25rem 3.5rem; overflow: hidden;
}
.card[data-cat='bilgi'] { --c: #6ec6ff; }
.card[data-cat='wisdom'] { --c: #f2c14e; }
.card[data-cat='hikaye'] { --c: #ff8f6b; }
.card[data-cat='muzik'] { --c: #b38cff; }
.card[data-cat='kitap'] { --c: #f08dc7; }
.card[data-cat='editor'] { --c: #7be0a8; }
.card::before {
  content: attr(data-catlabel); position: absolute; left: 0; right: 0; bottom: 6%;
  text-align: center; white-space: nowrap; line-height: 1; pointer-events: none; z-index: -1;
  font-family: var(--serif); font-weight: 800; font-size: clamp(4.5rem, 21vw, 15rem);
  color: transparent; -webkit-text-stroke: 1px color-mix(in srgb, var(--c) 16%, transparent);
}
.card::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(55% 45% at 50% 38%, color-mix(in srgb, var(--c) 11%, transparent), transparent 72%);
}
.inner { width: min(680px, 100%); animation: rise .5s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.tag { display: flex; align-items: center; gap: .6rem; color: var(--c); font-size: .76rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 700; margin-bottom: 1.1rem; }
.tag::before { content: ''; width: 2rem; height: 2px; background: var(--c); }
.card h2 { font-family: var(--serif); font-size: clamp(1.8rem, 5.2vw, 3.1rem); line-height: 1.12; letter-spacing: -.015em; margin: 0 0 1.2rem; text-wrap: balance; }
.body { font-size: clamp(1.05rem, 2.1vw, 1.22rem); line-height: 1.68; color: var(--soft); white-space: pre-line; margin: 0 0 1.6rem; max-width: 62ch; }
.card audio { width: 100%; margin: .2rem 0 1.4rem; }
.embed { width: 100%; border: 0; border-radius: 14px; background: var(--bg2); margin: .2rem 0 1.4rem; display: block; }
.embed.youtube { aspect-ratio: 16 / 9; }
.embed.spotify { height: 152px; }
.embed.spotify.tall { height: 352px; }
.embed.soundcloud { height: 166px; }
/* ---- Kitap okuyucu ---- */
.book { margin: .2rem 0 1.4rem; }
.pages {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  border-radius: 14px; background: var(--bg2); overscroll-behavior-x: contain; outline-offset: 3px;
}
.pages::-webkit-scrollbar { display: none; }
.pg { flex: 0 0 100%; scroll-snap-align: center; height: min(46dvh, 500px); display: grid; place-items: center; }
.pg img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pgbar { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: .6rem; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.pgbar button { width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 1.2rem; line-height: 1; }
.pgbar button:hover:not(:disabled) { border-color: var(--c); color: var(--c); }
.pgbar button:disabled { opacity: .3; cursor: default; }
.meta { display: flex; align-items: center; gap: .9rem; color: var(--muted); font-size: .82rem; flex-wrap: wrap; }
.meta .sp { flex: 1; }
.badge { border: 1px solid var(--line); border-radius: 999px; padding: .1rem .55rem; font-size: .75rem; }
.link-btn { background: none; border: 0; color: var(--muted); cursor: pointer; text-decoration: underline; padding: 0; font-size: .82rem; }
.link-btn:hover { color: var(--bad); }
.link-btn.plain:hover { color: var(--ink); }
.hint { position: absolute; bottom: 1rem; left: 50%; translate: -50% 0; color: var(--muted); font-size: .75rem; letter-spacing: .15em; text-transform: uppercase; animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(5px); } }
.end { text-align: center; }
.end h2 { margin-inline: auto; }
.end .primary { margin-top: .5rem; }

/* ---- Paylaşım penceresi ---- */
dialog {
  background: var(--bg2); color: var(--ink); border: 1px solid var(--line); border-radius: 20px;
  width: min(560px, calc(100% - 1.5rem)); max-height: calc(100dvh - 1.5rem); padding: 1.2rem 1.3rem 1.3rem; overflow-y: auto;
}
dialog::backdrop { background: rgb(8 7 6 / .72); backdrop-filter: blur(6px); }
.d-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .8rem; }
.d-head h2 { font-family: var(--serif); font-size: 1.5rem; margin: 0; }
.x { background: none; border: 0; color: var(--muted); font-size: 1.1rem; cursor: pointer; padding: .3rem .5rem; border-radius: 8px; }
.x:hover { color: var(--ink); background: var(--line); }
.seg { border: 0; padding: 0; margin: 0 0 .9rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.seg legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: .32rem .8rem; font-size: .84rem; color: var(--muted); transition: all .15s; }
.seg input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.f { display: block; margin-bottom: .85rem; }
.f > span, .f > label > span { display: block; font-size: .82rem; color: var(--muted); margin-bottom: .3rem; }
.f input[type='file']::file-selector-button {
  background: var(--line); color: var(--ink); border: 0; border-radius: 999px;
  padding: .35rem .85rem; margin-right: .7rem; cursor: pointer; font: inherit; font-size: .82rem;
}
.f input[type='file']::file-selector-button:hover { background: #3a342e; }
.f em { font-style: normal; opacity: .7; }
.f input:not([type='file']), .f textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: .65rem .8rem; resize: vertical;
}
.f input[type='file'] { width: 100%; font-size: .85rem; color: var(--muted); }
.f input:not([type='file']):focus, .f textarea:focus { outline: none; border-color: var(--accent); }
.thumbs { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .5rem; }
.thumbs:empty { display: none; }
.th { position: relative; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); }
.th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.th .n { position: absolute; top: 4px; left: 4px; background: rgb(0 0 0 / .65); border-radius: 6px; font-size: .7rem; padding: 0 .35rem; }
.th .act { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; background: linear-gradient(transparent, rgb(0 0 0 / .8)); padding: 1rem .2rem .2rem; }
.th .act button { background: none; border: 0; color: var(--ink); cursor: pointer; font-size: .95rem; padding: .1rem .3rem; border-radius: 6px; }
.th .act button:hover { background: rgb(255 255 255 / .18); }
.th .st { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-size: .72rem; background: rgb(0 0 0 / .55); padding: .3rem; }
.th.err { border-color: var(--bad); }
.f small { display: block; text-align: right; color: var(--muted); font-size: .75rem; margin-top: .2rem; }
.note { color: var(--muted); font-size: .78rem; margin: .4rem 0 .8rem; }
.error { color: var(--bad); font-size: .88rem; margin: 0 0 .8rem; }
.d-actions { display: flex; gap: .6rem; justify-content: flex-end; }
.ghost, .primary { border-radius: 999px; padding: .6rem 1.1rem; cursor: pointer; font-weight: 600; font-size: .92rem; }
.ghost { background: transparent; border: 1px solid #4a443c; }
.ghost:hover { border-color: var(--ink); }
.primary { background: var(--accent); color: #1a1405; border: 1px solid var(--accent); }
.primary:disabled, .ghost:disabled { opacity: .5; cursor: progress; }
.ai { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: .8rem .9rem; margin-bottom: .8rem; }
.ai-top { display: flex; justify-content: space-between; font-size: .85rem; }
.ai-top span { color: var(--muted); font-size: .75rem; }
.meter { height: 6px; background: var(--line); border-radius: 99px; margin: .55rem 0; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--muted); transition: width .5s ease, background .3s; }
.ai.ok .meter i { background: var(--ok); }
.ai.bad .meter i { background: var(--bad); }
.ai p { margin: 0; font-size: .9rem; line-height: 1.5; color: var(--soft); }

@media (max-width: 560px) {
  .btn-add .lbl { display: none; }
  .btn-add { padding: .5rem .8rem; }
}
@media (prefers-reduced-motion: reduce) {
  .feed { scroll-behavior: auto; }
  .inner, .hint { animation: none; }
}

/* ---- Kaynak, kaydet ---- */
.source { font-size: .84rem; color: var(--muted); margin: -.9rem 0 1.5rem; max-width: 62ch; }
.link-btn.saved { color: var(--accent); text-decoration: none; font-weight: 600; }

/* ---- Yönetici ---- */
body.admin { overflow: auto; height: auto; min-height: 100%; }
.adm { max-width: 860px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.adm-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.adm-head h1 { font-family: var(--serif); font-size: 1.7rem; margin: 0; }
.adm-head h1 span { color: var(--muted); font-weight: 400; font-size: 1.1rem; }
.adm-tools { display: flex; gap: .5rem; flex-wrap: wrap; }
.adm-tools select { background: var(--bg2); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: .5rem .9rem; }
.adm-card { background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.1rem; margin: 1rem 0; }
.adm-card.hidden-post { opacity: .8; border-style: dashed; }
.adm-card h2 { font-family: var(--serif); font-size: 1.3rem; margin: .5rem 0; }
.adm-meta { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; font-size: .8rem; color: var(--muted); }
.adm-body { white-space: pre-line; color: var(--soft); line-height: 1.55; margin: .3rem 0; }
.adm-pages { display: flex; gap: .5rem; overflow-x: auto; padding: .4rem 0; }
.adm-pages img { height: 140px; border-radius: 8px; flex: none; }
.adm-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .8rem; }
.adm-actions .ghost, .adm-actions .primary { padding: .4rem .9rem; font-size: .85rem; }
.ghost.danger { color: var(--bad); border-color: var(--bad); }

/* ---- Açık tema (cihaz ayarına göre) ---- */
:root { color-scheme: dark; }
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #faf6ee; --bg2: #fffdf8; --ink: #1d1a16; --soft: #3b362f; --muted: #6f675b; --line: #e2dacb;
    --accent: #a06f00; --ok: #1c8c59; --bad: #c4372a;
  }
  .card[data-cat='bilgi'] { --c: #1f6fae; }
  .card[data-cat='wisdom'] { --c: #a06f00; }
  .card[data-cat='hikaye'] { --c: #c4501f; }
  .card[data-cat='kitap'] { --c: #b73a82; }
  .card[data-cat='muzik'] { --c: #6b43c4; }
  .card[data-cat='editor'] { --c: #178a57; }
  .btn-add, .primary { color: #fff; }
  .chip:hover, .ghost { border-color: #bdb2a0; }
  .ghost:hover { border-color: var(--ink); }
  .f input[type='file']::file-selector-button:hover { background: #d8cfbe; }
  dialog::backdrop { background: rgb(40 34 26 / .45); }
  .th .n, .th .act button, .th .st { color: #fff; }
}

/* ---- Hesap, çalışma alanı, odalar ---- */
.btn-user {
  flex: none; border: 1px solid var(--line); background: transparent; color: var(--ink);
  border-radius: 999px; padding: .5rem .9rem; font-size: .85rem; cursor: pointer; font-weight: 600;
  max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.btn-user:hover { border-color: var(--accent); }
.chip.room { border-style: dashed; }
.acct-fields select {
  width: 100%; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: .65rem .8rem;
}
.check { display: flex; gap: .55rem; align-items: flex-start; font-size: .82rem; color: var(--muted); margin: 0 0 .85rem; cursor: pointer; }
.check em { font-style: normal; opacity: .7; }
.check input { margin-top: .2rem; }
.sp-dialog { width: min(640px, calc(100% - 1.5rem)); }
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin: 0 0 1rem; }
.tabs button {
  background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 999px;
  padding: .32rem .8rem; font-size: .84rem; cursor: pointer;
}
.tabs button[aria-selected='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 600; }
.row { display: flex; gap: .6rem; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 12px; padding: .6rem .8rem; margin: 0 0 .5rem; }
.row .grow { flex: 1; min-width: 0; }
.row h3 { margin: 0; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row p { margin: .15rem 0 0; font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .acts { display: flex; gap: .4rem; flex: none; }
.mini { background: transparent; border: 1px solid var(--line); color: var(--ink); border-radius: 999px; padding: .2rem .65rem; font-size: .78rem; cursor: pointer; }
.mini:hover { border-color: var(--accent); }
.mini.danger:hover { border-color: var(--bad); color: var(--bad); }
.empty { color: var(--muted); font-size: .9rem; margin: .5rem 0 1rem; }
.sp-form { display: grid; gap: .6rem; margin: 0 0 1rem; }
.sp-form input, .sp-form textarea {
  width: 100%; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: .6rem .8rem; font: inherit;
}
.sp-form input:focus, .sp-form textarea:focus { outline: none; border-color: var(--accent); }
.keybox { background: var(--bg); border: 1px dashed var(--accent); border-radius: 12px; padding: .8rem; margin: 0 0 1rem; }
.keybox code { display: block; font-size: 1.15rem; letter-spacing: .08em; margin: .4rem 0; user-select: all; word-break: break-all; }
.sp-msg { font-size: .88rem; margin: 0 0 .8rem; color: var(--soft); }
.sp-msg.bad { color: var(--bad); }
.sp-h { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 1.1rem 0 .5rem; }
.link-line { display: block; font-size: .8rem; word-break: break-all; color: var(--soft); }

/* ---- Zarf: açılış ve bekleyen mektup (oyundaki giriş düğmesinden esinlenildi) ---- */
:root { --gold: #ffd24a; --gold-d: #7a5808; }
#gate {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; align-content: center; gap: 1.6rem;
  background: radial-gradient(60% 50% at 50% 45%, #2a2318, #0e0d0c); color: #f3eee5; transition: opacity .7s ease;
}
#gate.done { opacity: 0; pointer-events: none; }
.gate-title { font-family: var(--serif); font-size: 1.6rem; margin: 0; letter-spacing: -.02em; text-align: center; }
.gate-title span { color: var(--accent); }
.enter-hint {
  margin: 0; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .8rem; letter-spacing: .12em;
  color: var(--gold); text-align: center; animation: hintBlink 1.4s ease-in-out infinite; min-height: 1.2em;
}
@keyframes hintBlink { 50% { opacity: .5; } }
.env { position: relative; width: min(78vw, 360px); aspect-ratio: 3 / 2; perspective: 900px; }
.env-back { position: absolute; inset: 0; background: #c9a35a; border-radius: 6px; box-shadow: 0 18px 50px rgb(0 0 0 / .55); }
.env-letter {
  position: absolute; left: 7%; right: 7%; bottom: 8%; height: 78%; background: #fffaf0; color: #3a3226; border-radius: 4px;
  padding: .9rem 1rem; font-family: var(--serif); font-size: .85rem; line-height: 1.5; transition: transform 1s ease .35s; z-index: 2;
  box-shadow: 0 1px 6px rgb(0 0 0 / .25); overflow: hidden;
}
.env-letter b { display: block; font-size: 1rem; margin-bottom: .3rem; }
.env-front {
  position: absolute; inset: 0; border-radius: 6px; pointer-events: none;
  background: linear-gradient(#d8b46a, #bf9648);
  clip-path: polygon(0 0, 50% 52%, 100% 0, 100% 100%, 0 100%); z-index: 3;
}
.env-flap {
  position: absolute; left: 0; right: 0; top: 0; height: 56%; background: linear-gradient(#e2c27c, #c9a35a);
  clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top; transition: transform .7s ease, z-index 0s .35s; z-index: 4;
  border-radius: 6px 6px 0 0;
}
.env.open .env-flap { transform: rotateX(180deg); z-index: 1; }
.env.open .env-letter { transform: translateY(-62%); }
.seal {
  position: absolute; left: 50%; top: 52%; width: 72px; height: 72px; margin: -36px 0 0 -36px; z-index: 5;
  border-radius: 50% !important; padding: 0; cursor: pointer; border: 4px solid var(--gold);
  background: radial-gradient(circle at 40% 35%, #3aa868, #0e3a22); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 4px #041018, 0 0 28px #ffd24a55, 0 6px 0 var(--gold-d); animation: markPulse 1.6s ease-in-out infinite;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: opacity .3s;
}
.seal img { width: 42px; height: 42px; image-rendering: pixelated; pointer-events: none; }
.seal:hover { filter: brightness(1.1); }
.env.open .seal { opacity: 0; pointer-events: none; }
@keyframes markPulse {
  0%, 100% { box-shadow: 0 0 0 4px #041018, 0 0 22px #ffd24a44, 0 6px 0 var(--gold-d); }
  50% { box-shadow: 0 0 0 4px #041018, 0 0 40px #ffd24a88, 0 6px 0 var(--gold-d); }
}

/* Köşedeki zarf */
.mailbox {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 40;
  width: 64px; height: 64px; border-radius: 50%; padding: 0; cursor: pointer; border: 3px solid var(--gold);
  background: radial-gradient(circle at 40% 35%, #3aa868, #0e3a22); font-size: 1.9rem; line-height: 1; color: #fff;
  box-shadow: 0 0 0 3px #041018, 0 0 22px #ffd24a44, 0 5px 0 var(--gold-d); touch-action: manipulation;
}
.mailbox:hover { filter: brightness(1.12); }
.mailbox .dot { position: absolute; top: -4px; right: -4px; width: 18px; height: 18px; border-radius: 50%; background: var(--bad); border: 2px solid #041018; }
.mailbox .tip {
  position: absolute; right: 74px; top: 50%; transform: translateY(-50%); white-space: nowrap; background: var(--bg2); color: var(--ink);
  border: 1px solid var(--gold); border-radius: 10px; padding: .35rem .7rem; font-size: .8rem; font-family: var(--sans); opacity: 0; pointer-events: none; transition: opacity .3s;
}
.mailbox.wait { animation: knock 1.8s ease-in-out infinite; }
.mailbox.wait .tip { opacity: 1; }
@keyframes knock { 0%, 55%, 100% { transform: none; } 62% { transform: translateY(-10px) rotate(-8deg); } 70% { transform: rotate(8deg); } 78% { transform: translateY(-6px) rotate(-5deg); } 86% { transform: none; } }
.letter-body { font-family: var(--serif); line-height: 1.65; color: var(--soft); }
.letter-body p { margin: 0 0 .8rem; }
.letter-body ol { padding-left: 1.2rem; margin: 0 0 1rem; }
.letter-actions { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 560px) { .mailbox { bottom: 84px; } .mailbox .tip { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .seal, .mailbox.wait, .enter-hint { animation: none; }
  .env-flap, .env-letter, #gate { transition-duration: .01s; transition-delay: 0s; }
}

/* ---- Dil seçici ---- */
.lang-sel {
  flex: none; background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 999px;
  padding: .45rem .6rem; font-size: .82rem; cursor: pointer; max-width: 7.5rem;
}
.lang-sel:hover { border-color: var(--accent); }
.lang-sel option { background: var(--bg2); color: var(--ink); }
.gate-langs { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; max-width: min(92vw, 420px); }
.gate-langs button {
  background: transparent; color: #f3eee5; border: 1px solid #4a443c; border-radius: 999px; padding: .35rem .85rem;
  font-size: .85rem; cursor: pointer;
}
.gate-langs button:hover { border-color: var(--gold); }
.gate-langs button[aria-pressed='true'] { background: var(--gold); color: #1a1405; border-color: var(--gold); font-weight: 700; }
.gate-langlbl { margin: 0; color: #938b7f; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; text-align: center; }

.gate-hello { margin: .2rem 0 .6rem; min-height: 2.2rem; font: 700 1.6rem/1.2 Georgia, serif; color: var(--gold, #d9b45a); letter-spacing: .04em; text-align: center; }
.gate-langlbl { margin: 1.1rem 0 .4rem; font-size: .72rem; letter-spacing: .25em; font-weight: 700; color: var(--gold, #d9b45a); text-align: center; }
.gate-langs button { font-size: .95rem; padding: .5rem .9rem; }
.gate-langlbl { margin: .2rem 0 .4rem; }
.gate-hello { margin: .9rem 0 .8rem; }
.pgcap { margin: .5rem .2rem 0; font-size: .9rem; line-height: 1.4; color: var(--muted); text-align: center; font-style: italic; }

.ai-dialog { width: min(560px, calc(100% - 1.5rem)); }
.ai-hint { margin: 0 0 .6rem; font-size: .8rem; color: var(--muted); line-height: 1.4; }
.ai-log { height: min(40dvh, 320px); overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: .6rem; display: flex; flex-direction: column; gap: .4rem; }
.ai-log .msg { padding: .45rem .7rem; border-radius: 12px; max-width: 90%; line-height: 1.4; font-size: .92rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-log .me { align-self: flex-end; background: var(--gold); color: #1a1405; }
.ai-log .npc { align-self: flex-start; border: 1px solid var(--line); }
.ai-log .sys { align-self: center; color: var(--muted); font-size: .8rem; text-align: center; }
.ai-quick { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0; }
.ai-form { display: flex; gap: .5rem; }
.ai-form input { flex: 1; min-width: 0; }
