:root {
  --bg: #111015;
  --panel: #1b1a21;
  --panel2: #24222b;
  --line: #34313c;
  --text: #e8e4ea;
  --muted: #9a94a3;
  --accent: #b3202c;
  --accent2: #e0434f;
  --ok: #3ccf6e;
  --bad: #ff4d4d;
  --both: #4aa3ff;
  --hunger: #8e1520;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --side: 380px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.4 var(--sans); overflow: hidden; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.err { color: var(--bad); min-height: 1.2em; font-size: 13px; }
.row { display: flex; gap: 6px; align-items: center; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; }
code { background: #0004; padding: 0 4px; border-radius: 3px; font-size: 12px; }
input, textarea, select {
  background: #0e0d12; color: var(--text); border: 1px solid var(--line); border-radius: 4px;
  padding: 5px 7px; font: inherit; min-width: 0;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent2); }
.btn {
  background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 5px;
  padding: 6px 12px; cursor: pointer; font: inherit; white-space: nowrap;
}
.btn:hover { border-color: var(--accent2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent2); }
.btn.ghost { background: transparent; }
.btn.danger { color: #ff8a8a; }
.btn.small { padding: 3px 8px; font-size: 12px; }

/* ---------- pop-up ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, #2a0d12 0%, #07060a 75%);
  padding: 16px;
}
.modal {
  width: 360px; max-width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 24px; box-shadow: 0 20px 60px #000a; display: flex; flex-direction: column; gap: 12px;
}
.modal.center { text-align: center; align-items: center; }
.modal h1 { margin: 0; font: 600 26px var(--serif); color: var(--accent2); letter-spacing: .5px; }
.modal label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.modal label.check { flex-direction: row; align-items: center; gap: 8px; }
.modal input { font-size: 15px; padding: 8px 10px; }

/* ---------- yerleşim ---------- */
#app { display: flex; height: 100%; }
#board { position: relative; flex: 1; overflow: hidden; background: #08070a; }
#bgFill { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(24px) brightness(.45); }
#side { width: var(--side); display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--line); }

/* sahne */
#stage { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; /* sayfa boyutu JS'ten gelir */ transform-origin: 0 0; background: #0c0b0f; box-shadow: 0 0 0 1px #222; }
#bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
#items { position: absolute; inset: 0; }
.item { position: absolute; user-select: none; touch-action: none; cursor: grab; }
.item img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; -webkit-user-drag: none; }
.item.sel { outline: 2px solid var(--accent2); outline-offset: 1px; }
.item .rz { position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; background: var(--accent2); border: 2px solid #fff; border-radius: 3px; cursor: nwse-resize; display: none; }
.item.sel .rz { display: block; }
.item .who { position: absolute; left: 0; top: -30px; font-size: 20px; background: #000a; padding: 0 5px; border-radius: 3px; white-space: nowrap; display: none; }
.item.sel .who { display: block; }

#toolbar { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; align-items: center; background: #0009; padding: 6px; border-radius: 8px; z-index: 5; flex-wrap: wrap; }
#toolbar .sep { width: 1px; height: 22px; background: var(--line); }
#itemBar { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 6px; background: #000b; padding: 6px; border-radius: 8px; z-index: 5; }
#dropHint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 28px var(--serif); background: #b3202c33; border: 3px dashed var(--accent2); z-index: 50; pointer-events: none; }

/* ---------- sekmeler ---------- */
#tabs { display: flex; border-bottom: 1px solid var(--line); }
#tabs button { flex: 1; background: none; border: none; color: var(--muted); padding: 8px 2px; cursor: pointer; font-size: 16px; display: flex; flex-direction: column; align-items: center; gap: 2px; border-bottom: 2px solid transparent; }
#tabs button span { font-size: 11px; }
#tabs button.active { color: var(--text); border-bottom-color: var(--accent2); }
.tab { display: none; flex: 1; min-height: 0; flex-direction: column; }
.tab.active { display: flex; }
.tabhead { padding: 10px; border-bottom: 1px solid var(--line); }
.journal { list-style: none; margin: 0; padding: 6px; overflow: auto; flex: 1; }
.journal li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.journal li:hover { background: var(--panel2); }
.journal .av { width: 38px; height: 38px; border-radius: 5px; background: #000 center/cover; flex: none; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.journal .sub { font-size: 12px; color: var(--muted); }
.journal .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.help { padding: 10px 14px; overflow: auto; font-size: 12px; border-top: 1px solid var(--line); }
.help h3 { font-size: 13px; margin: 4px 0; color: var(--text); }

/* ---------- sohbet ---------- */
#chatLog { flex: 1; overflow-y: auto; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
#chatBox { border-top: 1px solid var(--line); padding: 8px; display: flex; flex-direction: column; gap: 6px; }
#chatInput { resize: none; width: 100%; }
#quickRoll { width: 80px; }
.msg { padding: 5px 8px; border-radius: 6px; background: var(--panel2); word-wrap: break-word; }
.msg .by { font-weight: 600; }
.msg .tag { font-size: 10px; padding: 0 4px; border-radius: 3px; background: #000; color: var(--muted); margin-left: 4px; vertical-align: 1px; }
.msg.emote { background: none; font-style: italic; color: #f0c6ff; }
.msg.desc { background: #0007; font-style: italic; text-align: center; color: #ddd; }
.msg.system, .msg.error { background: none; font-size: 12px; color: var(--muted); }
.msg.error { color: var(--bad); }
.msg.whisper { background: #2b2140; border-left: 3px solid #9b59b6; }
.msg.secret { border: 1px dashed #9b59b6; }
.msg .formula { font-size: 12px; color: var(--muted); }
.rollbox { margin-top: 3px; background: #0006; border-radius: 5px; padding: 5px 7px; font-family: Consolas, monospace; font-size: 13px; }
.rollbox .total { float: right; font: 700 18px var(--sans); padding-left: 8px; }
.dgrp { white-space: normal; }
.die { display: inline-block; min-width: 18px; text-align: center; padding: 0 2px; }
.die.c { color: var(--ok); font-weight: 700; }
.die.f { color: var(--bad); font-weight: 700; }
.die.drop { color: #666; text-decoration: line-through; font-weight: 400; }
.die.ok { text-decoration: underline; }
.die.rr { color: #666; text-decoration: line-through; font-size: 11px; }
.die.m0 { box-shadow: inset 0 3px 0 #f1c40f; } .die.m1 { box-shadow: inset 0 3px 0 #3498db; }
.die.m2 { box-shadow: inset 0 3px 0 #e67e22; } .die.m3 { box-shadow: inset 0 3px 0 #2ecc71; }
.die.m4 { box-shadow: inset 0 3px 0 #ff6fb5; } .die.m5 { box-shadow: inset 0 3px 0 #1abc9c; }
.sub.drop { opacity: .45; text-decoration: line-through; }
.lbl { color: #c8a2ff; font-size: 11px; }
.inl { display: inline-block; padding: 0 6px; border-radius: 4px; background: #f6e7c1; color: #000; font-weight: 700; border: 2px solid #f6e7c1; cursor: help; }
.inl.c { border-color: var(--ok); } .inl.f { border-color: var(--bad); } .inl.cf { border-color: var(--both); }

/* V5 kartı */
.v5 { margin-top: 4px; background: #0008; border: 1px solid #3a1418; border-radius: 6px; padding: 6px 8px; }
.v5 .title { font: 600 14px var(--serif); }
.v5 .pool { font-size: 11px; color: var(--muted); }
.v5 .dice { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.v5 .res { display: flex; justify-content: space-between; align-items: baseline; }
.v5 .res b { font-size: 20px; }
.v5 .out { font: 700 13px var(--sans); text-transform: uppercase; letter-spacing: .5px; }
.out.messy, .out.bestial { color: var(--accent2); }
.out.critical, .out.success { color: var(--ok); }
.out.failure, .out.total_failure { color: var(--muted); }
.v5 .rr { margin-top: 4px; }

/* ---------- pencereler ---------- */
#windows { position: absolute; inset: 0; pointer-events: none; z-index: 35; }
.win { position: absolute; pointer-events: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 40px #000c; display: flex; flex-direction: column; min-width: 320px; min-height: 200px; overflow: hidden; }
.win .wh { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; background: var(--panel2); cursor: move; border-bottom: 1px solid var(--line); user-select: none; }
.win .wh .t { flex: 1; font: 600 14px var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win .wh .x { background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.win .wz { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; cursor: default; }
.win .wz button { background: none; border: none; color: var(--text); font: 600 13px var(--serif); padding: 3px 8px; cursor: pointer; line-height: 1.2; }
.win .wz button:hover { background: #ffffff14; }
.win .wz .wz-v { font: 11px system-ui, sans-serif; color: var(--muted); min-width: 44px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.win .wtabs { display: flex; gap: 2px; padding: 6px 8px 0; border-bottom: 1px solid var(--line); }
.win .wtabs button { background: none; border: 1px solid transparent; border-bottom: none; color: var(--muted); padding: 5px 10px; border-radius: 5px 5px 0 0; cursor: pointer; font: inherit; }
.win .wtabs button.active { color: var(--text); background: var(--bg); border-color: var(--line); }
.win .wb { flex: 1; overflow: auto; padding: 10px 12px; background: var(--bg); }
.win .pane { display: none; } .win .pane.active { display: block; }
.imgdrop { border: 2px dashed var(--line); border-radius: 8px; min-height: 160px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); background: #000 center/contain no-repeat; text-align: center; padding: 8px; }
.imgdrop.has { min-height: 280px; color: transparent; }
/* karakter pozları: ‹ ana resim › + 4 slot */
.avgal { display: flex; align-items: stretch; gap: 6px; }
.avgal .imgdrop { flex: 1; min-width: 0; }
.avnav { width: 34px; flex: none; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.04); color: var(--text, inherit); font-size: 26px; line-height: 1; cursor: pointer; }
.avnav:hover:not(:disabled) { background: rgba(255,255,255,.12); }
.avnav:disabled { opacity: .3; cursor: default; }
.avslots { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }
.avslot { position: relative; width: 64px; height: 64px; border: 2px dashed var(--line); border-radius: 8px; background: #000 center/cover no-repeat; cursor: pointer; }
.avslot.has { border-style: solid; }
.avslot.on { border-color: var(--accent, #c33); box-shadow: 0 0 0 2px var(--accent, #c33); }
.avslot .n { position: absolute; left: 3px; bottom: 2px; font-size: 11px; color: #fff; text-shadow: 0 0 3px #000; }
.avslot:not(.has) .n { left: 50%; top: 50%; bottom: auto; transform: translate(-50%, -50%); font-size: 13px; color: var(--muted); text-shadow: none; }
.avslot:not(.has)::after { content: "+"; position: absolute; right: 4px; top: 1px; color: var(--muted); font-size: 13px; }
.avslot .x { position: absolute; top: -7px; right: -7px; width: 18px; height: 18px; padding: 0; border: none; border-radius: 50%; background: #600; color: #fff; font-size: 10px; line-height: 18px; cursor: pointer; display: none; }
.avslot.has:hover .x { display: block; }
.field { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.field textarea { min-height: 120px; resize: vertical; }

/* ---------- V5 kâğıdı ---------- */
.sheet { font-size: 13px; }
.sheet h3 { font: 600 13px var(--serif); text-transform: uppercase; letter-spacing: 1.5px; color: var(--accent2); margin: 14px 0 6px; border-bottom: 1px solid #3a1418; padding-bottom: 3px; }
.sheet .grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 14px; }
.sheet .grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; }
.sheet .kv { display: flex; align-items: center; gap: 6px; }
.sheet .kv > span { width: 82px; color: var(--muted); font-size: 12px; flex: none; }
.sheet .kv input, .sheet .kv select { flex: 1; width: 100%; }
.trait { display: flex; align-items: center; gap: 6px; padding: 1px 4px; border-radius: 4px; }
.trait .nm { flex: 1; cursor: pointer; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trait .nm:hover { color: var(--accent2); }
.trait.on { background: #b3202c44; }
.trait .spec { width: 70px; flex: none; font-size: 11px; padding: 2px 4px; }
.dots { display: inline-flex; gap: 2px; flex: none; }
.dots i { width: 12px; height: 12px; border-radius: 50%; border: 1px solid #8a8490; display: inline-block; cursor: pointer; }
.dots i.on { background: var(--accent2); border-color: var(--accent2); }
/* eşya artısı/eksisi (sheet.js drawDots/drawItemMods): sarı dolu dot, sarı halkalı (eksi) dot, ekstra dot tıklanmaz */
.dots i.iplus { background: #e8c23a; border-color: #e8c23a; box-shadow: 0 0 4px #e8c23a88; }
.dots i.iminus { box-shadow: inset 0 0 0 2px #e8c23a; opacity: .55; }
.dots i.ex { pointer-events: none; cursor: default; }
.itm-mod { display: flex; flex-direction: column; gap: 1px; padding: 0 4px 3px 22px; font-size: 10.5px; line-height: 1.25; color: #e8c23a; }
.itm-mod .neg { color: #e8a43a; }
.itm-mod em { opacity: .75; }
.boxes { display: inline-flex; gap: 2px; flex-wrap: nowrap; }
.boxes i { width: 16px; height: 16px; border: 1px solid #8a8490; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 12px; cursor: pointer; color: var(--accent2); font-weight: 700; }
.boxes i.st { background: #444; }
.boxes i.on { background: var(--accent2); color: #fff; }
.trk { display: flex; align-items: center; gap: 8px; margin: 4px 0; flex-wrap: wrap; }
.trk > span:first-child { width: 82px; color: var(--muted); font-size: 12px; }
.rollbar { position: sticky; top: -10px; z-index: 2; background: #1d0b0e; border: 1px solid #3a1418; border-radius: 6px; padding: 6px 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -2px 0 8px; }
.rollbar .pl { flex: 1; min-width: 140px; font-size: 12px; }
.rollbar .pl b { font-size: 16px; color: #fff; }
.rollbar input[type=number] { width: 52px; }
.rollbar label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.rep { border: 1px solid var(--line); border-radius: 6px; padding: 6px; margin-bottom: 6px; background: #0004; }
.rep .row { margin-bottom: 4px; }
.rep textarea { width: 100%; min-height: 44px; resize: vertical; font-size: 12px; }
.rep .x { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; }
.bptable { font-size: 12px; color: var(--muted); display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin-top: 6px; }
.bptable b { color: var(--text); font-weight: 500; }
.sheet textarea.big { width: 100%; min-height: 70px; resize: vertical; }

@media (max-width: 800px) {
  :root { --side: 100%; }
  #app { flex-direction: column; }
  #board { flex: 1 1 55%; }
  #side { flex: 1 1 45%; border-left: none; border-top: 1px solid var(--line); }
  .sheet .grid3 { grid-template-columns: 1fr; }
  .win { left: 4px !important; top: 4px !important; width: calc(100% - 8px) !important; height: calc(100% - 8px) !important; }
}

/* ---------- roller ---------- */
body:not(.is-gm) .gm-only { display: none !important; }
#pageBar { display: none; }
body.pagebar-open #pageBar { display: block; }
#toolbar { display: none; }

/* ---------- katmanlar & grid ---------- */
.layer { position: absolute; inset: 0; pointer-events: none; }
#layer-map { z-index: 1; } #grid { z-index: 2; } #layer-objects { z-index: 3; } #layer-gm { z-index: 4; }
#grid { position: absolute; inset: 0; pointer-events: none; }
.layer .item { pointer-events: auto; }
#stage:not(.act-map) #layer-map .item,
#stage:not(.act-objects) #layer-objects .item,
#stage:not(.act-gm) #layer-gm .item { pointer-events: none; }
#layer-gm .item { opacity: .55; outline: 2px dashed #9b59b6; }
#layer-gm .item.sel { outline: 2px solid var(--accent2); }

/* ---------- sol araç çubuğu ---------- */
:root { --ts: 1; --tw: 52px; }  /* sol araç çubuğu ölçeği (toolbar.js, kişiye özel) */
#tools { position: absolute; left: 0; top: 0; bottom: 0; width: var(--tw); z-index: 30; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; }
#tools > button { width: calc(46px * var(--ts)); height: calc(46px * var(--ts)); flex: none; border-radius: 7px; border: 1px solid transparent; background: none; color: var(--text); font-size: calc(18px * var(--ts)); cursor: pointer; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 0; }
#tools > button .ti { line-height: 1; }
#tools > button small { font: 600 calc(9px * var(--ts)) system-ui, sans-serif; color: var(--muted); letter-spacing: .2px; line-height: 1; white-space: nowrap; }
#tools > button:hover small, #tools > button.on small { color: var(--text); }
#toolTip { position: fixed; z-index: 3000; transform: translateY(-50%); background: #000e; color: #fff; border: 1px solid var(--accent2); border-radius: 6px; padding: 5px 9px; font: 13px system-ui, sans-serif; max-width: 280px; pointer-events: none; box-shadow: 0 4px 14px #000a; }
/* cetvel ve çizim */
#measure { position: absolute; left: 0; top: 0; z-index: 60; pointer-events: none; overflow: visible; }
#board[data-tool=ruler], #board[data-tool=ruler] .item, #board[data-tool=draw], #board[data-tool=draw] .item { cursor: crosshair; }
.item.drawing .dsvg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.item.drawing img { display: none; }
#drawPop { width: 230px; top: 100px; }
@media (max-height: 760px) {
  #tools { gap: 1px; padding: 4px 0; }
  #tools > button { height: calc(38px * var(--ts)); font-size: calc(15px * var(--ts)); }
  #tools > button small { font-size: calc(8px * var(--ts)); }
}
#drawPop .dshapes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 6px 0; }
#drawPop .dshapes .on { border-color: var(--accent2); background: #b3202c55; }
#drawPop .dcolors { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
#drawPop .dcolors button { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #0008; cursor: pointer; padding: 0; }
#drawPop .dcolors button.on { border-color: #fff; box-shadow: 0 0 0 2px var(--accent2); }
#drawPop .dwidth { display: flex; align-items: center; gap: 8px; font-size: 12px; margin: 4px 0 6px; }
#drawPop .dwidth input { flex: 1; }
#tools > button:hover { background: var(--panel2); border-color: var(--line); }
#tools > button.on { background: #b3202c55; border-color: var(--accent2); }
#tools .badge { position: absolute; right: 1px; bottom: 1px; font: 700 9px var(--sans); background: var(--accent); color: #fff; border-radius: 3px; padding: 0 3px; }
#tLayer[data-layer=gm] .badge { background: #8e44ad; }
#tLayer[data-layer=map] .badge { background: #2c7a4b; }
.pop { position: absolute; left: calc(var(--tw) + 4px); top: 50px; width: 270px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px #000c; padding: 10px; z-index: 40; display: flex; flex-direction: column; gap: 6px; }
.pop .pt { font: 600 13px var(--serif); color: var(--accent2); }
.pop .small { font-size: 11px; }
.lrow { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; }
.lrow.act { background: #b3202c33; }
.lrow .eye { background: none; border: 1px solid var(--line); border-radius: 5px; width: 30px; height: 26px; cursor: pointer; color: var(--text); }
.lrow .ln { flex: 1; }
.lrow .ln[data-pick] { cursor: pointer; } .lrow .ln[data-pick]:hover { color: var(--accent2); }
.lrow .cur { font-size: 10px; color: var(--accent2); text-transform: uppercase; }
#bgPop { top: 140px; }

/* ---------- sayfa çubuğu ---------- */
:root { --pagebar: 122px; }
#pageBar { position: absolute; left: var(--tw); right: 0; top: 0; height: var(--pagebar); z-index: 25; background: linear-gradient(#1b1a21, #141318); border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; }
#pageCards { display: flex; gap: 10px; padding: 18px 14px 8px; height: 100%; align-items: flex-start; }
.pcard { position: relative; width: 132px; flex: none; border: 2px solid var(--line); border-radius: 7px; background: #0c0b0f; cursor: pointer; }
.pcard:hover { border-color: #666; }
.pcard.view { border-color: #f6e7c1; }
.pcard.over { border-color: var(--ok); box-shadow: 0 0 0 3px #3ccf6e55; }
.pcard .thumb { height: 52px; background: #222 center/cover; border-radius: 5px 5px 0 0; }
.pcard .pn { font-size: 12px; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .chips { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 4px 4px; min-height: 8px; }
.chip { font-size: 10px; padding: 0 5px; border-radius: 8px; background: var(--c); color: #000; font-weight: 700; cursor: grab; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.split { outline: 1px dashed #fff; }
.pcard .gear { position: absolute; right: 3px; top: 3px; background: #000a; border: none; color: #ddd; border-radius: 4px; cursor: pointer; font-size: 12px; padding: 1px 4px; }
.ribbon { position: absolute; top: -16px; left: 6px; background: var(--accent); color: #fff; font: 700 10px var(--sans); padding: 1px 8px 2px; border-radius: 4px 4px 0 0; cursor: grab; letter-spacing: .5px; }
.pcard.rib { border-color: var(--accent); }
.pcard.rib.view { border-color: #f6e7c1; box-shadow: 0 -2px 0 var(--accent); }
.pcard.add { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 86px; border-style: dashed; color: var(--muted); }
.pcard.add .plus { font-size: 26px; }
/* sahne sürükleme + klasörler (kullanıcı isteği 2026-11-29) */
#pageCards { position: relative; width: max-content; min-width: 100%; box-sizing: border-box; }
.pcard[data-pid], .pfh { touch-action: none; }
.pfold { position: relative; display: flex; gap: 6px; flex: none; padding: 0; border-radius: 9px; }
.pfold.open { padding: 0 6px 0 0; background: #ffffff08; outline: 1px dashed #f2e9d830; outline-offset: 3px; }
.pfh { position: relative; width: 132px; height: 86px; flex: none; box-sizing: border-box; border: 2px solid var(--line); border-radius: 7px; background: linear-gradient(#1d1417, #120c0e); cursor: pointer; display: flex; flex-direction: column; }
.pfh:hover { border-color: #666; }
.pfold.has-view > .pfh { border-color: #f6e7c1; }
.pfold.has-rib > .pfh { box-shadow: 0 -2px 0 var(--accent); }
.pf-thumbs { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 4px; min-height: 0; }
.pf-thumbs i { background: #2a2224 center/cover; border-radius: 3px; }
.pf-thumbs b { grid-column: 1 / -1; display: grid; place-items: center; color: var(--muted); font: 400 11px var(--serif); }
.pfh .pn { font-size: 12px; padding: 2px 6px 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.pf-ic { font-size: 12px; }
.pf-n { margin-left: auto; font-size: 10px; color: var(--muted); }
.pf-btns { position: absolute; right: 3px; top: 3px; display: none; gap: 2px; }
.pfh:hover .pf-btns { display: flex; }
.pf-btns button { background: #000b; border: none; color: #ddd; border-radius: 4px; cursor: pointer; font-size: 11px; padding: 1px 4px; }
.pf-btns button:hover { color: #fff; background: var(--accent); }
.pfh.pb-into { border-color: var(--ok); box-shadow: 0 0 0 3px #3ccf6e55; }
.pcard.addf { width: 96px; }
.pb-src { opacity: .35; }
.pb-ghost { position: fixed; z-index: 9999; pointer-events: none; opacity: .88; transform: rotate(-3deg); box-shadow: 0 10px 30px #000c; }
.pb-mark { position: absolute; top: 12px; bottom: 4px; width: 3px; margin-left: -1px; background: var(--accent2, #c0222e); border-radius: 2px; box-shadow: 0 0 8px var(--accent2, #c0222e); display: none; pointer-events: none; }
body.pb-dragging, body.pb-dragging * { cursor: grabbing !important; }
#tPages { position: absolute; top: 0; left: calc(var(--tw) / 2 + 50%); transform: translateX(-50%); z-index: 26; background: var(--panel); border: 1px solid var(--line); border-top: none; color: var(--text); border-radius: 0 0 8px 8px; padding: 2px 12px 4px; cursor: pointer; font-size: 12px; }
body.pagebar-open #tPages { top: var(--pagebar); }
#pageName { position: absolute; right: 10px; bottom: 10px; z-index: 5; font: 600 13px var(--serif); background: #000a; padding: 3px 10px; border-radius: 5px; color: #f6e7c1; pointer-events: none; }
#toast { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 60; background: #000d; border: 1px solid var(--accent); color: #fff; padding: 14px 26px; border-radius: 8px; font: 600 20px var(--serif); pointer-events: none; }
#itemBar { left: calc(50% + 26px); }
#itemBar .lay { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
#itemBar .lay select { padding: 2px 4px; font-size: 12px; }
#dropHint { left: var(--tw); }
.field .check { flex-direction: row; display: flex; align-items: center; gap: 6px; color: var(--text); }

/* ---------- V5 kâğıdı teması ---------- */
.sheet { position: relative; margin: -10px -12px; padding: 14px 18px 24px; min-height: 100%;
  background-color: #0d0a0b;
  background-image:
    radial-gradient(ellipse at 12% 0%, #5a0b1388 0%, transparent 45%),
    radial-gradient(ellipse at 100% 100%, #3d060c99 0%, transparent 50%),
    radial-gradient(circle at 85% 12%, #7a0f1a33 0 6%, transparent 7%),
    repeating-linear-gradient(115deg, #ffffff03 0 2px, transparent 2px 6px),
    linear-gradient(180deg, #151012, #0b0809);
  background-size: cover; background-attachment: local; }
.sheet.custom-bg { background-image: linear-gradient(#0b0809d9, #0b0809e6), var(--sheet-bg); background-size: cover; background-position: center; }
.sheet-head { text-align: center; margin: 0 0 10px; padding: 6px 0 10px; border-bottom: 1px solid #5a0b13; position: relative; }
.sheet-head .logo { font: 400 34px/1 var(--serif); letter-spacing: 10px; color: #e8e4ea; text-shadow: 0 0 18px #b3202c88, 0 2px 0 #000; }
.sheet-head .logo b { color: var(--accent2); font-weight: 400; }
.sheet-head .sub { font: 11px var(--sans); letter-spacing: 6px; color: #b98a8e; margin-top: 4px; }
.sheet-head::before, .sheet-head::after { content: "❦"; position: absolute; top: 10px; color: #7a1520; font-size: 22px; }
.sheet-head::before { left: 8px; } .sheet-head::after { right: 8px; transform: scaleX(-1); }
.sheet h3 { display: flex; align-items: center; gap: 10px; border-bottom: none; }
.sheet h3::before, .sheet h3::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, #7a1520, transparent); }
.sheet .rollbar { background: #1d0b0ee6; backdrop-filter: blur(3px); }
.sheet input, .sheet select, .sheet textarea { background: #0a0708cc; }

/* ---------- yakınlaştırma ---------- */
#zoomBox { position: absolute; left: calc(var(--tw) + 10px); bottom: 10px; z-index: 6; display: flex; background: #000b; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
#zoomBox button { background: none; border: none; color: var(--text); padding: 5px 10px; cursor: pointer; font: 600 14px var(--sans); }
#zoomBox button:hover { background: var(--panel2); }
#zoomPct { min-width: 56px; font-size: 12px !important; border-left: 1px solid var(--line) !important; border-right: 1px solid var(--line) !important; }
#board.can-pan, #board.can-pan .item { cursor: grab; }
#board.panning, #board.panning .item { cursor: grabbing; }
#stage, #bgFill { touch-action: none; }

/* ---------- sahne düzenleme ---------- */
.item { cursor: pointer; }
.item .rz, .item .rot, .item .lk { display: none; }
.item.sel.single:not(.locked) .rz { display: block; }
.item .rot { position: absolute; left: 50%; top: calc(-34px * var(--inv, 1)); width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: #f6e7c1; border: 2px solid var(--accent2); cursor: grab; transform: scale(var(--inv, 1)); }
.item .rot::after { content: ""; position: absolute; left: 50%; top: 14px; width: 2px; height: calc(18px); background: var(--accent2); }
.item.sel.single:not(.locked) .rot { display: block; }
.item .rz { transform: scale(var(--inv, 1)); transform-origin: 100% 100%; }
.item.locked .lk { display: block; position: absolute; right: 2px; top: 2px; font-size: calc(16px * var(--inv, 1)); }
.item.locked.sel { outline-style: dashed; }
.item .who { transform: scale(var(--inv, 1)); transform-origin: 0 100%; font-size: 12px; top: -20px; }
.item.sel .who { display: block; }
.item.turn { box-shadow: 0 0 0 calc(4px * var(--inv, 1)) #f1c40f, 0 0 calc(30px * var(--inv, 1)) #f1c40f; }
/* token altındaki Health / Willpower çubukları: ekranda hep aynı kalınlıkta */
/* token altında Health / Willpower: kâğıttaki kutuların aynısı (.boxes), ekranda sabit boyut */
.item .tbars { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: calc(3px * var(--inv, 1)); display: flex; flex-direction: column; align-items: center; gap: calc(2px * var(--inv, 1)); pointer-events: auto; white-space: nowrap; }
/* token'ın altındaki kutular yalnız fare üstündeyken görünür */
.item .tbars { display: none; z-index: 5; align-items: flex-start; }
/* fare üstündeyken ya da token seçiliyken (tıklanınca açık kalır) */
.item:hover .tbars, .item.sel .tbars { display: flex; }
.item .tbars.ed .boxes i { cursor: pointer; }
.item .tbars.ed .boxes i:hover { outline: calc(1px * var(--inv, 1)) solid #f6e7c1; }
.ctrack .boxes i.hg { background: #b3121f; border-color: #ff4d5e; box-shadow: 0 0 4px #ff2a3a; }
.ctrack.hunger .lb { width: auto; }
.item .ctrack.hunger .lb { width: calc(58px * var(--inv, 1)); }
.ctrack { display: flex; align-items: center; gap: 3px; }
.ctrack .lb { font: 700 10px var(--serif); color: var(--accent2); width: 9px; text-align: center; text-shadow: 0 0 3px #000, 0 0 3px #000; }
.ctrack .boxes i { cursor: default; background: #0e0b0dd0; }
.ctrack .boxes i.on { background: var(--accent2); }
.item .ctrack { gap: calc(3px * var(--inv, 1)); }
.item .ctrack .lb { font-size: calc(10px * var(--inv, 1)); width: calc(58px * var(--inv, 1)); text-align: right; }
.item .ctrack .boxes { gap: calc(2px * var(--inv, 1)); }
.item .ctrack .boxes i { width: calc(12px * var(--inv, 1)); height: calc(12px * var(--inv, 1)); font-size: calc(9px * var(--inv, 1)); border-width: calc(1px * var(--inv, 1)); }
.selbox { position: absolute; z-index: 50; border: calc(1px * var(--inv, 1)) dashed #f6e7c1; background: #f6e7c122; pointer-events: none; }
#itemBar { flex-wrap: wrap; justify-content: center; max-width: calc(100% - 140px); align-items: center; }
#itemBar #selCount { font-size: 12px; padding: 0 6px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- ping ---------- */
.ping { position: absolute; z-index: 60; width: 0; height: 0; pointer-events: none; }
.ping i { position: absolute; left: 0; top: 0; width: calc(90px * var(--inv, 1)); height: calc(90px * var(--inv, 1)); margin: calc(-45px * var(--inv, 1)) 0 0 calc(-45px * var(--inv, 1)); border: calc(4px * var(--inv, 1)) solid var(--c); border-radius: 50%; opacity: 0; animation: ping 1.4s ease-out forwards; }
.ping i:nth-child(2) { animation-delay: .25s; } .ping i:nth-child(3) { animation-delay: .5s; }
.ping span { position: absolute; left: calc(14px * var(--inv, 1)); top: calc(-34px * var(--inv, 1)); font: 700 calc(13px * var(--inv, 1)) var(--sans); color: #000; background: var(--c); padding: 0 calc(6px * var(--inv, 1)); border-radius: calc(4px * var(--inv, 1)); white-space: nowrap; animation: fade 2.2s forwards; }
@keyframes ping { 0% { transform: scale(.1); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes fade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- sıra takibi ---------- */
.trackerwin { min-width: 280px; }
.trk-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.trk-head .round { flex: 1; text-align: center; font: 600 14px var(--serif); }
.trk-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.trk-list li { display: flex; align-items: center; gap: 5px; padding: 4px 5px; border-radius: 6px; background: var(--panel2); border: 1px solid transparent; }
.trk-list li.cur { border-color: #f1c40f; background: #3a3210; box-shadow: inset 3px 0 0 #f1c40f; }
.trk-list li.hid { opacity: .55; font-style: italic; }
.trk-list li.empty { background: none; justify-content: center; }
.trk-list .av { width: 26px; height: 26px; border-radius: 4px; background: #000 center/cover; flex: none; border: 1px solid var(--line); }
.trk-list .nm { flex: 1; min-width: 0; }
.trk-list input.nm, .trk-list input.vl { padding: 2px 4px; font-size: 12px; background: transparent; border-color: transparent; }
.trk-list input.nm:focus, .trk-list input.vl:focus { background: #0e0d12; border-color: var(--accent2); }
.trk-list .vl { width: 46px; text-align: center; font-weight: 700; flex: none; }
.trk-list .ib { background: none; border: none; color: var(--muted); cursor: pointer; padding: 0 2px; font-size: 12px; }
.trk-list .ib:hover { color: var(--text); }
.trk-add { display: flex; gap: 4px; margin-top: 8px; }
.trk-add input:first-child { flex: 1; }
.small { font-size: 11px; }

/* ---------- lobiler ---------- */
body:not(.is-owner) .owner-only { display: none !important; }
.overlay.dim { background: #000b; z-index: 1100; }
.hint { font-size: 11px; color: var(--muted); }
.lobbybox { width: 680px; max-width: 100%; max-height: 100%; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; box-shadow: 0 20px 60px #000a; }
.lhead { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.lhead h1 { margin: 0; font: 600 26px var(--serif); color: var(--accent2); }
#lobbyList { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
#lobbyList li { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); }
#lobbyList li.empty { justify-content: center; background: none; border-style: dashed; }
#lobbyList .lmain { flex: 1; min-width: 0; }
#lobbyList .lname { font: 600 16px var(--serif); }
#lobbyList .lsub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tag.own { background: #5a0b13; color: #f6e7c1; }
#diskBox { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.diskhead { display: flex; align-items: baseline; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.diskhead > span:first-child { font: 600 14px var(--serif); color: var(--accent2); }
.diskbar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: #0004; border: 1px solid var(--line); margin-bottom: 4px; }
.diskbar span { height: 100%; transition: width .4s; }
.diskbar .d-used { background: #8a2430; }
.diskbar .d-free { background: #3d7a4a; }
.diskbar .d-res { min-width: 6px; background: repeating-linear-gradient(45deg, #6b5a2e 0 5px, #3a3020 5px 10px); }
#diskBox.low .d-free { background: #b5852a; }
#diskBox.full #diskText { color: #e0606a; }

/* ---------- izinler ---------- */
table.perm { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
table.perm th { text-align: center; font-weight: 500; color: var(--muted); font-size: 12px; padding: 4px; }
table.perm th:first-child { text-align: left; }
table.perm td { padding: 5px 4px; border-top: 1px solid var(--line); }
table.perm td:not(:first-child) { text-align: center; width: 110px; }
table.perm tr.all td { background: #b3202c22; }
table.perm input { width: 16px; height: 16px; }
.perm-state { padding: 6px 10px; border-radius: 6px; font-weight: 600; }
.perm-state.closed { background: #2b2140; color: #d9c2ff; }
.perm-state.open { background: #12331f; color: #9ff0b8; }
/* yalnız profil izniyle açılan karakter penceresi: ad + fotoğraf */
.cprof { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px; text-align: center; height: 100%; box-sizing: border-box; }
.cprof img { max-width: 100%; max-height: calc(100% - 70px); object-fit: contain; border-radius: 10px; box-shadow: 0 4px 18px #0008; }
.cprof-none { width: 160px; height: 160px; border-radius: 10px; background: #222; display: grid; place-items: center; font-size: 60px; color: #666; }
.cprof-name { font-size: 20px; font-weight: 700; }
.gmnote { background: #2b214055; border: 1px dashed #9b59b6; border-radius: 6px; padding: 6px; color: #d9c2ff !important; }
.gm-row { margin-bottom: 8px; }
.gm-row .vis { font-size: 12px; color: var(--muted); }
.win.readonly .dots i, .win.readonly .boxes i, .win.readonly .trait .nm, .win.readonly .imgdrop, .win.readonly .avslot, .win.readonly .avnav { pointer-events: none; }
.win.readonly .avslot .x { display: none; }
.win.readonly .rollbar { display: none; }
.ro-tag { margin-left: auto; align-self: center; font-size: 11px; color: #f6e7c1; background: #3a3210; border-radius: 4px; padding: 1px 8px; }
.journal li .grow { min-width: 0; }

/* =====================================================================
   VtM TEMASI — kan kırmızısı, kemik rengi yazı, gotik serif başlıklar.
   (Özgün çizim; dış font/görsel yok.)
   ===================================================================== */
:root {
  --bg: #0a0708; --panel: #140e10; --panel2: #1f1518; --line: #3b2328;
  --text: #ece2d4; --muted: #a39093; --accent: #7d0e18; --accent2: #c0222e;
  --hunger: #7a0d16; --bone: #f2e9d8; --ink: #2a1a1c; --gold: #b8923a;
  --serif: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
}
html, body { background: var(--bg); }
body { font-family: var(--serif); font-size: 14.5px; }
input, textarea, select { font-family: var(--serif); }
::selection { background: #7d0e1899; color: #fff; }
/* Kaydırma çubukları koyu zeminde görünsün ve tutulup sürüklenebilsin (kullanıcı isteği 2026-11-29);
   pencerelerin içinde tam genişlik, diğer yerlerde ince. */
* { scrollbar-width: thin; scrollbar-color: #8a3a44 #ffffff0a; }
.win * { scrollbar-width: auto; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: #8a3a44; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #b04a55; }
::-webkit-scrollbar-track { background: transparent; }

.btn { font-family: var(--serif); letter-spacing: .3px; }
.btn.primary { background: linear-gradient(#9c1420, #6a0b14); border-color: #3a050a; box-shadow: inset 0 1px 0 #ffffff22, 0 1px 3px #000a; }
.btn.primary:hover { background: linear-gradient(#b81a27, #7d0e18); }

/* giriş / lobi */
.overlay {
  background:
    radial-gradient(ellipse at 50% 35%, #3b0a10cc 0%, transparent 60%),
    radial-gradient(ellipse at 50% 120%, #1a0306 0%, transparent 70%),

    #050304;
}
.overlay.dim { background: #000c; }
/* lobi ekranı: solda lobiler, sağda ziyaretçiler */
.lobbywrap { display: flex; gap: 22px; align-items: center;  /* Lobbies kutusu hep dikeyde ortada (kullanıcı isteği 2026-11-29) */ max-width: 100%; max-height: 100%; }
.lobbywrap .lobbybox { flex: 0 1 680px; min-width: 0; }
.visitbox { width: 320px; flex: none; max-height: calc(100vh / var(--uiz, 1) - 32px); overflow: auto; padding: 18px 18px 14px; border-radius: 10px; }
.vhead { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.vhead h2 { margin: 0; font: 400 22px var(--serif); font-variant: small-caps; letter-spacing: 2px; color: var(--bone); }
.vonline { font-size: 12px; color: #6fcf86; cursor: default; }
#visitList { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
#visitList li { display: grid; grid-template-columns: 10px 1fr; column-gap: 8px; padding: 5px 8px; border-radius: 6px; background: #ffffff06; align-items: center; }
#visitList li.empty { display: block; text-align: center; background: none; }
#visitList .vdot { width: 8px; height: 8px; border-radius: 50%; background: #5a4a4c; grid-row: span 2; }
#visitList li.on .vdot { background: #45c463; box-shadow: 0 0 6px #45c463aa; }
#visitList .vname { font: 600 14px var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#visitList .vtime { font-size: 11px; color: var(--muted); display: flex; gap: 8px; }
#visitList .vtime i { font-style: normal; margin-left: auto; }
#visitList li.on .vtime i { color: #6fcf86; }
.vpager { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 10px 0 4px; font-size: 12px; color: var(--muted); }
.vpager button:disabled { opacity: .35; cursor: default; }
@media (max-width: 1060px) {
  .lobbywrap { flex-direction: column; align-items: center; overflow: auto; }
  .lobbywrap .lobbybox { flex: none; width: 680px; max-height: none; }
  .visitbox { width: 680px; max-width: 100%; max-height: none; }
}
.modal, .lobbybox, .visitbox {
  background: linear-gradient(180deg, #1a1114, #100a0c);
  border: 1px solid #4a1a20; box-shadow: 0 0 0 1px #000, 0 0 0 4px #1a0a0d, 0 0 0 5px #4a1a20, 0 25px 70px #000;
}
.modal h1, .lhead h1 {
  font: 400 28px var(--serif); font-variant: small-caps; letter-spacing: 3px; color: var(--bone);
  text-shadow: 0 0 14px #c0222e99, 0 2px 0 #000;
}
.modal h1::after, .lhead h1::after { content: ""; display: block; height: 1px; margin-top: 8px; background: linear-gradient(90deg, transparent, var(--accent2), transparent); }
.modal.center h1::after { margin-left: auto; margin-right: auto; }
#lobbyList li { background: linear-gradient(90deg, #1f1518, #160f11); border-color: #3b2328; }
#lobbyList li:hover { border-color: #6d1d26; }
#lobbyList .lname { font-variant: small-caps; letter-spacing: 1px; font-size: 17px; }

/* yan panel */
#side { background: linear-gradient(180deg, #140e10, #0e0a0b); }
#tabs { background: #0d090a; }
#tabs button { font-family: var(--serif); }
#tabs button span { font-variant: small-caps; letter-spacing: 1px; font-size: 12px; }
#tabs button.active { color: var(--bone); border-bottom-color: var(--accent2); background: linear-gradient(0deg, #7d0e1833, transparent); }
.msg { background: #1b1215; border: 1px solid #2a1a1e; }
.msg .by { font-variant: small-caps; letter-spacing: .5px; }
.msg.whisper { background: #22142a; }
.win { border-color: #4a1a20; }
.win .wh { background: linear-gradient(#25171a, #1a1012); }
.win .wh .t { font-variant: small-caps; letter-spacing: 1px; color: var(--bone); }
#tools, .pop { background: linear-gradient(180deg, #150e10, #0f0a0b); }
.pop .pt { font-variant: small-caps; letter-spacing: 1px; }
#pageBar { background: linear-gradient(#1a1114, #100a0c); }
#pageName { font-variant: small-caps; letter-spacing: 1px; }
#toast { font-variant: small-caps; letter-spacing: 2px; border-color: var(--accent2); box-shadow: 0 0 30px #7d0e1888; }

/* ---------- V5 zar kartı (parşömen) ---------- */
.v5 {
  --cut: 14px;
  position: relative; margin: 6px 2px 2px; padding: 12px 14px 10px; color: var(--ink);
  background: radial-gradient(ellipse at 50% 0%, #fbf5ea, #efe4cf 70%, #e4d6bb);
  border: none; border-radius: 0;
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut));
  font-family: var(--serif); text-align: center;
}
.v5::before { /* iç kırmızı çerçeve, köşeleri kesik */
  content: ""; position: absolute; inset: 4px; pointer-events: none; border: 1px solid #a3343d;
  clip-path: polygon(calc(var(--cut) - 4px) 0, calc(100% - var(--cut) + 4px) 0, 100% calc(var(--cut) - 4px), 100% calc(100% - var(--cut) + 4px), calc(100% - var(--cut) + 4px) 100%, calc(var(--cut) - 4px) 100%, 0 calc(100% - var(--cut) + 4px), 0 calc(var(--cut) - 4px));
}
.v5 .who5 { font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: #a08a7a; }
.v5 .title { font: 400 15px var(--serif); font-variant: small-caps; letter-spacing: 1.5px; color: #8e1520; line-height: 1.15; }
.v5 .pool { font-size: 11px; color: #7a6a5e; margin-top: 2px; }
.v5 .rule { height: 1px; margin: 7px -6px; background: linear-gradient(90deg, transparent, #b05a60, transparent); }
.v5 .dice { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 6px; margin: 4px 0; padding: 2px 0 6px; }
.v5 .dice .v5d:nth-child(even) { transform: translateY(8px); }
.v5d { width: 28px; height: 38px; border: none; background: none; padding: 0; border-radius: 0; display: inline-block; color: inherit; transition: transform .15s; }
.v5d svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 1px 1px #0006); }
.v5d.pick { cursor: pointer; }
.v5d.pick:hover svg { filter: drop-shadow(0 0 3px #c0222e); }
.v5d.picked svg { filter: drop-shadow(0 0 2px #e0a800) drop-shadow(0 0 4px #e0a800); }
.v5d.was svg { filter: drop-shadow(0 0 2px #3a7bd5) drop-shadow(0 0 3px #3a7bd5); }
.v5 .stats { display: flex; justify-content: center; align-items: center; gap: 6px; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: #6b5a50; margin: 4px 0; flex-wrap: wrap; }
.v5 .stats .k { margin-right: 2px; }
.v5 .stats .n { display: inline-block; min-width: 22px; padding: 2px 5px; font: 600 12px var(--serif); letter-spacing: 0; color: var(--ink); background: #f8f1e3; border: 1px solid #b9a590; }
.v5 .stats .n.hg { background: #7a0d16; color: #fff; border-color: #3a050a; }
.v5 .stats .of { text-transform: none; letter-spacing: 0; font-size: 11px; }
.v5 .out { display: block; margin-top: 6px; font: 400 13px var(--serif); font-variant: small-caps; letter-spacing: 2px; text-transform: none; }
.v5 .out small { display: block; font-size: 10px; letter-spacing: 1px; color: #6b5a50; font-variant: normal; }
.v5 .out.messy, .v5 .out.bestial { color: #a3101d; font-weight: 700; }
.v5 .out.critical { color: #8a6a12; font-weight: 700; }
.v5 .out.success { color: #2f5d2a; }
.v5 .out.failure, .v5 .out.total_failure { color: #5d4b45; }
.v5 .rr { margin-top: 6px; }
.v5 .rr .btn { background: #f8f1e3; color: #7d0e18; border-color: #b9a590; font-size: 11px; }
.v5 .rr .btn:not(:disabled):hover { background: #7d0e18; color: #fff; }
.v5 .rr .btn:disabled { opacity: .55; cursor: default; }
.msg:has(> .v5) { background: none; border: none; padding: 2px 0; }
.msg:has(> .v5) > .by { padding-left: 4px; }

/* =====================================================================
   V5 KÂĞIDI — Roll20 düzeni (ön/arka yüz), mevcut koyu tema renkleriyle
   ===================================================================== */
.win .wb { container-type: inline-size; }
.sheet .grow { flex: 1; }
.sheet .hint.c { text-align: center; margin: 2px 0 4px; }
.sheet .face.hidden { display: none; }

/* üst satır: gizli atış + ön/arka yüz */
.sh-top { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; flex-wrap: wrap; }
.sh-top .whisper { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid #3a1418; border-radius: 4px; background: #0a0708cc; cursor: pointer; color: var(--muted); font-size: 12px; user-select: none; }
.sh-top .whisper input { margin: 0; }
.sh-top .whisper .ic { color: var(--accent2); }
.sh-top .whisper:has(input:checked) { border-color: var(--accent2); color: var(--text); background: #b3202c33; }
.sh-top .sides { display: flex; gap: 6px; }
.sh-top .sides button { min-width: 130px; padding: 5px 12px; border: 1px solid #3a1418; background: #0a0708cc; color: var(--muted); font: 600 12px var(--serif); letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer; border-radius: 3px; }
.sh-top .sides button:hover { color: var(--text); border-color: var(--accent2); }
.sh-top .sides button.on { background: linear-gradient(#9c1420, #6a0b14); color: #fff; border-color: #3a050a; }

/* kimlik tablosu */
.sheet .infogrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid #5a0b13; margin-bottom: 4px; }
.sheet .infogrid .kv { border: 1px solid #3a1418; margin: -.5px; padding: 3px 8px; gap: 8px; }
.sheet .infogrid .kv > span { width: auto; min-width: 62px; color: var(--muted); }
.sheet .infogrid .kv input { background: transparent; border: none; color: var(--accent2); font: 15px var(--serif); padding: 3px 0; }
.sheet .infogrid .kv input:focus { background: #0a0708; }

/* başlık + kilit */
.sheet h3 > span { flex: none; }
.sheet h3 .lock { position: absolute; right: 0; font: 600 10px var(--sans); letter-spacing: 1px; text-transform: uppercase; background: #0a0708cc; color: var(--muted); border: 1px solid #3a1418; border-radius: 3px; padding: 3px 8px; cursor: pointer; }
.sheet h3 { position: relative; }
.sheet h3 .lock:hover { color: var(--text); border-color: var(--accent2); }
.sheet.locked .dots i, .sheet.locked .boxes i { cursor: not-allowed; }
.sheet.locked h3 .lock { color: #f6e7c1; border-color: var(--accent2); }

/* sütunlar */
.sheet .grid3.cols { gap: 0; }
.sheet .grid3.cols > div { padding: 0 12px; }
.sheet .grid3.cols > div + div { border-left: 1px solid #3a1418; }
.sheet .colh { text-align: center; font: italic 600 14px var(--serif); color: var(--text); margin-bottom: 4px; }
/* Impaired: dolu Health → Physical, dolu Willpower → Social/Mental sütunları kırmızı zeminli; havuz −2 */
.sheet .imp { display: none; margin-left: 6px; vertical-align: middle; background: #a00000; color: #fff; font: 700 10px/1.7 system-ui, sans-serif; font-style: normal; letter-spacing: .08em; text-transform: uppercase; padding: 0 6px; border-radius: 3px; box-shadow: 0 0 6px #ff000088; }
.sheet .impskill { display: none; text-align: center; margin-bottom: 4px; }
.sheet [data-cat].impaired { background: rgba(170, 0, 0, .22); box-shadow: inset 0 0 0 1px rgba(220, 0, 0, .55); border-radius: 6px; }
.sheet [data-cat].impaired .imp, .sheet [data-impt].impaired .imp, .sheet [data-cat].impaired .impskill { display: inline-block; }
.sheet [data-cat].impaired .impskill { display: block; }
.impv { color: #ff5a5a; font-style: normal; font-weight: 700; }
.sheet .trait { padding: 2px 4px; }
.sheet .trait .nm { flex: none; max-width: 60%; }
.sheet .trait .nm::before { content: "◈"; color: var(--accent2); font-size: 10px; margin-right: 6px; opacity: .8; }
.sheet .trait .grip { color: #5a3a3e; font-size: 11px; width: 10px; flex: none; }
.sheet .trait.sk .spec { flex: 1; width: auto; min-width: 20px; background: transparent; border: none; border-bottom: 1px dotted #5a3a3e; border-radius: 0; color: var(--accent2); font-size: 11px; padding: 0 4px 1px; align-self: flex-end; margin-bottom: 3px; }
.sheet .trait.sk .spec:focus { border-bottom-color: var(--accent2); background: #0a0708; }

/* Health / Willpower / Hunger / Humanity satırları */
.sheet .trackrow { margin: 12px 0 2px; align-items: start; position: relative; }
.sheet .trackrow .trkgear { position: absolute; right: 2px; top: -2px; font-size: 15px; z-index: 1; }
/* Health & Willpower ⚙ paneli (Roll20 gibi) */
.sheet .trkset { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin: 6px 0 4px; padding: 8px 10px; border: 1px dashed currentColor; border-radius: 5px; background: rgba(192, 34, 46, .07); }
.sheet .trkset.hidden { display: none; }
.sheet .trkset .ts { display: flex; flex-direction: column; gap: 6px; }
.sheet .trkset .tsh { text-align: center; font-weight: 700; }
.sheet .trkset .tsr { display: flex; align-items: flex-end; justify-content: space-around; gap: 6px; }
.sheet .trkset label { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; opacity: .85; text-align: center; }
.sheet .trkset label b { font-size: 14px; font-weight: 400; min-height: 18px; }
.sheet .trkset input { width: 52px; text-align: center; padding: 1px 4px; }
.sheet .trkset .tsr i { font-style: normal; opacity: .6; padding-bottom: 2px; }
.sheet .trkset .tsbtn { grid-column: 1 / -1; display: flex; justify-content: center; }
.sheet .trackrow .tc { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.sheet .trackrow .tc.init .initv { font: 700 26px/1 var(--serif); color: var(--accent2, #c0222e); min-width: 44px; padding: 3px 10px; border: 1px solid currentColor; border-radius: 4px; }
.sheet .trackrow .tc.init .small { font-size: 11px; }
.sheet .tl { font: 700 14px var(--serif); color: var(--accent2); display: inline-flex; align-items: center; gap: 8px; }
.sheet .tl .lnk { font: 700 14px var(--serif); color: var(--accent2); }
.sheet .lnks { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; align-items: center; }
.sheet .lnk { background: none; border: none; padding: 1px 2px; color: var(--muted); font: 12px var(--serif); cursor: pointer; }
.sheet .lnk:hover { color: var(--accent2); text-shadow: 0 0 8px #b3202c88; }
.sheet .stains { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.sheet .stains input { width: 46px; padding: 1px 4px; }
.sheet [data-dots=hunger] i { border-radius: 2px; }
.sheet .reso { display: flex; align-items: center; gap: 8px; margin: 10px auto 4px; max-width: 70%; }
.sheet .reso select { width: auto; }
.sheet .reso .line { border-bottom: 1px dotted #5a3a3e; height: 1px; align-self: flex-end; margin-bottom: 6px; }
.sheet .grid2.bottom { gap: 0 24px; }
.sheet .btn.add { margin-bottom: 4px; }

/* arka yüz */
.sheet .boxes3 { gap: 0; margin-bottom: 14px; }
.sheet .bx { display: flex; flex-direction: column; gap: 4px; border: 1px solid #3a1418; margin: -.5px; padding: 6px 8px 8px; min-height: 150px; }
.sheet .bx > span { text-align: center; font: 700 12px var(--serif); color: var(--accent2); letter-spacing: .5px; }
.sheet .bx textarea { flex: 1; min-height: 110px; resize: vertical; background: transparent; border: none; }
.sheet .bx textarea:focus { background: #0a0708; }
.sheet .bx .rep { background: transparent; }
.sheet .back2 { gap: 0 20px; }
.sheet .back2 .vr { border-left: 1px solid #3a1418; padding-left: 16px; }
.sheet .bpt { display: flex; justify-content: center; margin-bottom: 6px; width: 100%; }
/* kilitliyken arka yüzde de görünen kilit işareti; kilitli noktaya tıklayınca kilitler yanıp söner */
.sheet .bpt .lockmark { display: none; margin-left: 6px; background: none; border: 1px solid var(--accent2); border-radius: 3px; padding: 0 4px; font-size: 11px; line-height: 16px; cursor: pointer; }
.sheet.locked .bpt .lockmark { display: inline-block; }
@keyframes lockNudge { 0%, 100% { box-shadow: none; } 30%, 70% { box-shadow: 0 0 0 2px #f6e7c1, 0 0 10px var(--accent2); } }
.sheet.lock-nudge [data-lock] { animation: lockNudge .45s 2; }
.sheet .bptable { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid #3a1418; margin: 0 0 12px; }
.sheet .bptable > div { border: 1px solid #3a1418; margin: -.5px; padding: 5px 8px; display: flex; flex-direction: column; gap: 2px; min-height: 44px; }
.sheet .bptable span { font-size: 11px; color: var(--muted); }
.sheet .bptable b { font-size: 12px; font-weight: 500; color: var(--text); }
.sheet .bx.notes { min-height: 300px; }
.sheet .bx.notes textarea { min-height: 280px; }
.sheet .xp { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sheet .xp .tl { flex: none; }
.sheet .xp .line { flex: 1; border-bottom: 1px dotted #5a3a3e; align-self: flex-end; margin-bottom: 5px; }
.sheet .xp input { width: 90px; text-align: center; }
.sheet .ctable { border: 1px solid #3a1418; margin-top: 10px; }
.sheet .cell { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #3a1418; padding: 4px 8px; }
.sheet .cell:last-child { border-bottom: none; }
.sheet .cell > span { font-size: 12px; color: var(--muted); flex: none; min-width: 96px; }
.sheet .cell input, .sheet .cell textarea { flex: 1; background: transparent; border: none; color: var(--text); padding: 2px 0; }
.sheet .cell.tall { flex-direction: column; align-items: stretch; gap: 2px; }
.sheet .cell.tall textarea { min-height: 52px; resize: vertical; }
.sheet .cell input:focus, .sheet .cell textarea:focus { background: #0a0708; }

/* dar pencere */
@container (max-width: 760px) {
  .sheet .infogrid, .sheet .grid3, .sheet .grid2 { grid-template-columns: 1fr !important; }
  .sheet .grid3.cols > div + div { border-left: none; border-top: 1px solid #3a1418; padding-top: 6px; margin-top: 6px; }
  .sheet .back2 .vr { border-left: none; padding-left: 0; }
  .sh-top .sides button { min-width: 0; }
}

/* ---------- atış penceresi (Roll20 "Input Value" gibi) ---------- */
.rdlg { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; background: #0007; padding: 16px; }
.rdlg .box { width: 330px; max-width: 100%; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 14px;
  background: linear-gradient(180deg, #1a1114, #100a0c); border: 1px solid #4a1a20; border-radius: 8px;
  box-shadow: 0 0 0 1px #000, 0 18px 50px #000c; }
.rdlg .hd { display: flex; align-items: center; gap: 8px; font: 15px var(--serif); font-variant: small-caps; letter-spacing: 1px; color: var(--bone); border-bottom: 1px solid #3b2328; padding-bottom: 8px; }
.rdlg .hd span { flex: 1; }
.rdlg .hd b { color: var(--accent2); margin-left: 4px; }
.rdlg .hd .x { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 15px; }
.rdlg .hd .x:hover { color: var(--text); }
.rdlg label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.rdlg label.chk { flex-direction: row; align-items: center; gap: 6px; color: var(--text); }
.rdlg select, .rdlg input[type=number] { font-size: 14px; padding: 6px 8px; }
.rdlg .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rdlg .pv { font-size: 12px; color: var(--muted); background: #0a0708; border: 1px solid #3b2328; border-radius: 5px; padding: 6px 8px; }
.rdlg .pv b { font-size: 18px; color: var(--accent2); margin: 0 4px; }
.rdlg .ft { display: flex; align-items: center; gap: 6px; }
.rdlg .ft .grow { flex: 1; }
.rdlg .wh { font-size: 11px; color: #d9c2ff; }
.rdlg .imods { border: 1px solid #3b2328; border-radius: 5px; background: #0f0a0b; padding: 6px 8px; display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow-y: auto; }
.rdlg .imods .ih { font-size: 12px; color: var(--bone); }
.rdlg .imods .ih span { color: var(--muted); font-size: 11px; margin-left: 4px; }
.rdlg label.chk.im { font-size: 12px; cursor: pointer; flex-wrap: wrap; gap: 4px 6px; }
.rdlg label.chk.im b { color: #ffd84a; min-width: 20px; }
.rdlg label.chk.im.neg b { color: #ff9a6a; }
.rdlg label.chk.im small { color: var(--muted); font-size: 11px; flex-basis: 100%; padding-left: 22px; margin-top: -3px; }
.rdlg .pv em.imv { font-style: normal; color: #ffd84a; }
.rdlg .pv em.imv.neg { color: #ff9a6a; }
.win.readonly .sheet .lnk, .win.readonly .sheet [data-drol] { pointer-events: none; opacity: .5; }

/* ---------- anında ipucu (Roll20 gibi) ---------- */
#tip { position: fixed; z-index: 3000; pointer-events: none; max-width: 260px; padding: 4px 8px; border-radius: 3px;
  background: #000; color: #fff; font: 12px/1.35 var(--sans); text-align: center; box-shadow: 0 2px 8px #000a; }
#tip b { font-weight: 700; }
#tip b.ok { color: #5fd35f; } #tip b.crit { color: #e7c56a; } #tip b.fail { color: #ff5a5a; }
#tip .hg { color: #ff8a8a; font-size: 11px; }
.v5 [data-tip] { cursor: help; }
.v5d.pick[data-tip] { cursor: pointer; }

/* ---------- sol alt oyuncu kutuları (Roll20 gibi) ---------- */
#avatars { position: absolute; left: calc(var(--tw) + 10px); bottom: 52px; z-index: 6; display: flex; flex-direction: row; flex-wrap: wrap-reverse; align-items: flex-end; gap: 6px; pointer-events: none; max-width: calc(100% - 80px); max-height: calc(100% - 70px); overflow: hidden; }
/* #avatars ile kapsanır: phone.css'teki telefon avatarı (.pav) bu kutuları ezmesin */
#avFree { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
#avFree .pav { position: absolute; }
#avatars .pav, #avFree .pav { display: block; border-radius: 0; color: inherit; font-weight: inherit; flex: none; width: 177px; pointer-events: auto; border: 1px solid #000; background: #0a0708; box-shadow: 0 3px 10px #000a; user-select: none; }
.pav .img { position: relative; height: 102px; background: #1f1518 center/cover no-repeat; display: flex; align-items: center; justify-content: center; font: 600 45px var(--serif); color: #6d4a50; }
.pav .img.empty { background: radial-gradient(circle at 50% 40%, #3b1a20, #140e10); }
.pav .nm { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 0; background: #3a3a3a; color: #fff; font: 600 15px var(--sans); }
.pav .sw { width: 8px; align-self: stretch; flex: none; }
.pav .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pav .gm { font-size: 11px; background: #000; color: #f6e7c1; padding: 0 3px; border-radius: 2px; }
.pav .rm { background: none; border: none; color: #ccc; cursor: pointer; padding: 0 2px; font-size: 14px; }
.pav .rm:hover { color: #fff; }
.pav.me { cursor: pointer; }
#avatars .pav, #avFree .pav { touch-action: none; }
.pav.dragging { opacity: .85; box-shadow: 0 8px 24px #000c; cursor: grabbing; z-index: 1; }
.pav.mini .img { display: none; }
#zoomBox #avToggle { border-left: 1px solid var(--line); }
#zoomBox #avToggle.on { background: var(--panel2); color: var(--accent2); }
.pav .cam { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: #000a; color: #fff; font: 600 14px var(--sans); }
.pav.me:hover .cam { display: flex; }
.pav.me:hover { outline: 1px solid var(--accent2); }


/* ---------- giriş: kayıtlı hesaplar ---------- */
.loginwrap { display: flex; gap: 14px; align-items: stretch; justify-content: center; flex-wrap: wrap; max-width: 100%; }
.loginwrap .modal { margin: 0; }
.pwrow { display: flex; gap: 6px; }
.pwrow input { flex: 1; min-width: 0; font-family: Consolas, "Courier New", monospace; letter-spacing: .5px; }
.saved { width: 280px; gap: 8px; }
.saved h2 { margin: 0; font: 400 17px var(--serif); font-variant: small-caps; letter-spacing: 2px; color: var(--bone); }
#savedList { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; }
#savedList li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #1f1518; cursor: pointer; }
#savedList li:hover { border-color: var(--accent2); }
#savedList li.cur { border-color: var(--accent2); background: #3a0b1255; }
#savedList .sn { font-weight: 600; flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#savedList .sp { flex: 1; min-width: 0; color: var(--muted); font: 12px Consolas, "Courier New", monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#savedList .x { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; }
#savedList .x:hover { color: var(--bad); }


/* ---------- büyüyen yazı alanları: uzun metin alt satıra iner ---------- */
.sheet textarea.auto { resize: none; overflow: hidden; min-height: 26px; line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; display: block; width: 100%; }
.sheet textarea.auto.big { min-height: 120px; }
.sheet .bx.notes textarea.auto.big { min-height: 280px; }
.sheet .infogrid .kv { align-items: flex-start; }
.sheet .infogrid .kv > span { padding-top: 5px; }
.sheet .infogrid .kv textarea.auto { background: transparent; border: none; color: var(--accent2); font: 15px var(--serif); padding: 3px 0; min-height: 24px; }
.sheet .infogrid .kv textarea.auto:focus { background: #0a0708; }
.sheet .cell textarea.auto { background: transparent; border: none; color: var(--text); padding: 2px 0; min-height: 22px; }
.sheet .cell:not(.tall) { align-items: flex-start; }
.sheet .cell:not(.tall) > span { padding-top: 3px; }

/* ---------- Roll20 gibi kartlar: Disciplines / Advantages / Flaws ---------- */
.sheet .rep.card { padding: 0; border: 1px solid #5a1a22; border-radius: 4px; background: #0a0708aa; overflow: hidden; }
.sheet .rep.card .rh { display: flex; align-items: center; gap: 6px; padding: 5px 6px 5px 8px; background: linear-gradient(#2a1418, #1d0e11); border-bottom: 1px solid #5a1a22; }
.sheet .rep.card .rh > input, .sheet .rep.card .rh > textarea { flex: 1; min-width: 0; background: transparent; border: none; border-bottom: 1px dotted #5a3a3e; border-radius: 0; color: var(--bone); font: 600 14px var(--serif); padding: 2px 2px; }
.sheet .rep.card .rh select { width: auto; max-width: 120px; padding: 2px 4px; font-size: 12px; }
.sheet .rep.card .ib { background: #0a0708; border: 1px solid #5a3a3e; color: var(--muted); border-radius: 3px; width: 24px; height: 22px; padding: 0; cursor: pointer; font-size: 12px; line-height: 1; flex: none; }
.sheet .rep.card .ib:hover { color: var(--text); border-color: var(--accent2); }
.sheet .rep.card .ib.roll { color: var(--accent2); font-size: 14px; }
.sheet .rep.card .rb { padding: 6px 8px 8px; display: flex; flex-direction: column; gap: 6px; }
.sheet .rep.card.folded > .rb { display: none; }
.sheet .rep.card.folded > .rh { border-bottom: none; }
/* Retainer kartı: altında bağlı karakter kâğıdı */
.sheet .rep.card.ret { border-color: #7a3a22; }
.sheet .rep.card .ret-ic { color: #d9a441; font-size: 14px; flex: none; }
.sheet .rep.card .ret-box { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 8px; background: #160c0b; border-bottom: 1px solid #5a1a22; }
.sheet .rep.card .ret-box select { width: auto; max-width: 200px; padding: 2px 4px; font-size: 12px; }
.sheet .rep.card .ret-av { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: #2a1418; color: #d9a441; flex: none; }
.sheet .rep.card .ret-av img { width: 100%; height: 100%; object-fit: cover; }
.sheet .rep.card .ret-box .lnk { font-weight: 600; }
.sheet .rf { display: flex; flex-direction: column; gap: 2px; }
.sheet .rf > span { font: 600 12px var(--serif); color: var(--text); }
.sheet .rf textarea.auto { background: #0a0708aa; border: 1px solid #3a1418; border-radius: 3px; color: var(--text); padding: 4px 6px; font-size: 13px; }
.sheet .rf textarea.auto:focus { border-color: var(--accent2); background: #0a0708; }

/* disiplin güçleri */
.sheet .pws { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.sheet .pw { border: 1px solid #4a1a20; border-radius: 3px; background: #2a0b1030; }
.sheet .pw .ph { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-bottom: 1px dashed #5a1a22; }
.sheet .pw .ph input[data-pk=name] { flex: 1; min-width: 0; background: transparent; border: none; border-bottom: 1px dotted #5a3a3e; border-radius: 0; color: var(--bone); font: 600 13px var(--serif); }
.sheet .pw .ph .plv { width: 46px; text-align: center; padding: 1px 2px; }
.sheet .pw .pb { padding: 6px; display: flex; flex-direction: column; gap: 5px; }
.sheet .pw.folded .pb { display: none; }
.sheet .pw.folded .ph { border-bottom: none; }
.sheet .addpw { width: 100%; margin-top: 6px; padding: 6px; background: #1d0e11; border: 1px solid #5a1a22; border-radius: 3px; color: var(--accent2); font: 700 13px var(--serif); cursor: pointer; }
.sheet .addpw:hover { background: #2a1418; color: var(--text); }
.sheet .rep .row textarea.auto { flex: 1; }
.sheet .rep > textarea.auto { margin-top: 4px; }


/* ---------- dikey zoom kaydırıcısı (Roll20 gibi) ---------- */
#zoomSlider { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 34px; padding: 6px 0 8px; background: #000b; border: 1px solid var(--line); border-radius: 17px; user-select: none; touch-action: none; }
body.pagebar-open #zoomSlider { top: calc(50% + var(--pagebar) / 2); }
#zoomSlider button { background: none; border: none; color: var(--text); cursor: pointer; font: 600 15px var(--sans); padding: 0; width: 26px; height: 22px; border-radius: 4px; }
#zoomSlider button:hover { background: var(--panel2); }
#zoomSlider .zpct { font: 600 11px var(--sans); color: var(--bone); background: #ffffff14; border-radius: 9px; width: 30px; height: 20px; }
#zoomSlider .ztrack { position: relative; width: 6px; height: 160px; border-radius: 3px; background: #ffffff22; cursor: pointer; }
#zoomSlider .ztrack::before { content: ""; position: absolute; inset: 0 -12px; }  /* tıklama alanını genişlet */
#zoomSlider .zfill { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 3px; background: linear-gradient(#c0222e, #7d0e18); }
#zoomSlider .zthumb { position: absolute; left: 50%; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: #f2e9d8; border: 2px solid var(--accent2); box-shadow: 0 1px 4px #000a; pointer-events: none; }
#zoomSlider .ztrack:active .zthumb { background: #fff; }


/* ---------- oyuncu renkleri: sadece sol alttaki oyuncu kutularında (sohbet klasik kalır) ---------- */
/* AFK: kutu solar, köşede rozet, alttan durum baloncuğu */
.pav.afk .img { overflow: hidden; }
.pav.afk .img::before { content: ""; position: absolute; inset: 0; background: #0007; backdrop-filter: grayscale(1); }
.pav .afkTag { position: absolute; top: 4px; right: 4px; background: #b8860b; color: #000; font: 700 11px var(--sans); padding: 1px 5px; border-radius: 3px; letter-spacing: .04em; box-shadow: 0 1px 4px #000a; }
.pav .afkb { position: absolute; left: 6px; right: 6px; bottom: 8px; background: #fff; color: #111; font: 600 12px/1.25 var(--sans); text-align: center; padding: 5px 7px; border-radius: 12px; box-shadow: 0 2px 8px #000c; animation: afkUp .55s cubic-bezier(.2, 1.6, .4, 1) both; }
.pav .afkb::after { content: ""; position: absolute; left: 18px; bottom: -5px; border: 6px solid transparent; border-top-color: #fff; border-bottom: 0; }
.pav .afkb.still { animation: none; }
.pav .afkb.out { animation: afkGone .55s ease-in forwards; }
@keyframes afkUp { from { transform: translateY(60px) scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }
/* Dönüş: "Geldim kanka!" görünür, sonra gri örtü + rozet + baloncuk birlikte yavaşça solar (AFK_BYE_MS = 5 sn) */
.pav .afkBye { position: absolute; inset: 0; overflow: hidden; pointer-events: none; animation: afkBye 5s ease-in forwards; }
.pav .afkBye::before { content: ""; position: absolute; inset: 0; background: #0007; backdrop-filter: grayscale(1); }
@keyframes afkBye { 0%, 45% { opacity: 1; } 100% { opacity: 0; } }
@keyframes afkGone { to { transform: translateY(-50px) scale(.8); opacity: 0; } }
.pav .pal { background: none; border: none; cursor: pointer; padding: 0 2px; font-size: 16px; line-height: 1; }
.pav .pal:hover { transform: scale(1.2); }
#palPop { position: fixed; z-index: 1500; width: 196px; padding: 10px; background: linear-gradient(180deg, #1a1114, #100a0c); border: 1px solid #4a1a20; border-radius: 8px; box-shadow: 0 10px 30px #000c; display: flex; flex-direction: column; gap: 8px; }
#palPop .pt { font: 13px var(--serif); font-variant: small-caps; letter-spacing: 1px; color: var(--bone); }
#palPop .sws { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
#palPop .swb { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #0008; background: var(--c); cursor: pointer; color: #000; font: 700 12px var(--sans); padding: 0; }
#palPop .swb:hover:not([disabled]) { transform: scale(1.12); border-color: #fff; }
#palPop .swb.cur { border-color: #fff; box-shadow: 0 0 0 2px var(--c); }
#palPop .swb.taken { opacity: .35; cursor: not-allowed; }

/* isimler oyuncu renginden bağımsız, hep aynı renkte */
.msg .by, .msg .emn { color: var(--bone); }

.sh-top .btn.small { flex: none; }

#tools .tsep { width: calc(28px * var(--ts)); height: 1px; background: var(--line); margin: 2px 0; flex: none; }

.journal li.drag { cursor: grab; }
.journal li.drag:active { cursor: grabbing; }


/* ---------- 8 boyutlandırma tutamacı (Roll20 gibi): köşeler + kenarlar ---------- */
.item .rz { right: auto; bottom: auto; width: 14px; height: 14px; margin: -7px 0 0 -7px; transform: scale(var(--inv, 1)); transform-origin: 50% 50%; }
.item .rz[data-h=nw] { left: 0; top: 0; cursor: nwse-resize; }
.item .rz[data-h=n] { left: 50%; top: 0; cursor: ns-resize; }
.item .rz[data-h=ne] { left: 100%; top: 0; cursor: nesw-resize; }
.item .rz[data-h=e] { left: 100%; top: 50%; cursor: ew-resize; }
.item .rz[data-h=se] { left: 100%; top: 100%; cursor: nwse-resize; }
.item .rz[data-h=s] { left: 50%; top: 100%; cursor: ns-resize; }
.item .rz[data-h=sw] { left: 0; top: 100%; cursor: nesw-resize; }
.item .rz[data-h=w] { left: 0; top: 50%; cursor: ew-resize; }
.item .rz[data-h=n], .item .rz[data-h=s], .item .rz[data-h=e], .item .rz[data-h=w] { border-radius: 50%; }
.item.sel:not(.single) .rz, .item.sel.locked .rz { display: none; }
#itemBar { z-index: 7; }  /* büyük oyuncu kutuları nesne çubuğunu kapatmasın */

/* normal ve Hunger zarları ayrı sıralarda */
.v5 .dice + .rule + .dice.hg { margin-top: 2px; }
#tip .kd { color: #bbb; font-size: 11px; }

/* Health / Willpower ⚙ değiştirici */
.sheet .gear { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 0 2px; }
.sheet .gear:hover { color: var(--accent2); }
.sheet .tmod { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.sheet .tmod.hidden { display: none; }
.sheet .tmod input { width: 56px; padding: 1px 4px; }

/* kitaplık */
.journal .av.book { width: 30px; height: 40px; background-size: cover; }
.win .wb.bookwb { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.bookbar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.bookbar input { width: 70px; }
.bookframe { flex: 1; width: 100%; border: 0; background: #2a2a2e; min-height: 0; }
.bookhint { padding: 4px 10px; border-top: 1px solid var(--line); }
/* kitap görünümü (sayfa resimleri): masa üstünde açık duran kitap, yapraklar 3B çevrilir */
.fb-area { flex: 1; min-height: 0; overflow: hidden; display: grid; place-items: center; padding: 12px; outline: none;
  background: radial-gradient(ellipse at 50% 40%, #3a2a22 0%, #1d1512 70%, #120d0b 100%); cursor: pointer; user-select: none; }
.fb-area.zoomed { overflow: auto; place-items: start center; cursor: grab; }
.fb-area.zoomed:active { cursor: grabbing; }
.fb-book { position: relative; perspective: 2600px; background: transparent; }
.fb-page { position: absolute; top: 0; bottom: 0; overflow: hidden; background: #f4efe4; box-shadow: 0 14px 40px #000c, 0 2px 6px #0008; }
.fb-page.empty { box-shadow: none; }
.fb-page.empty img, .fb-page img:not([src]) { display: none; }
.fb-page img, .fb-face img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: fill; -webkit-user-drag: none; pointer-events: none; }
.fb-page.empty { background: transparent; }
.fb-book:not(.two) .fb-l, .fb-book:not(.two) .fb-spine { display: none; }
.fb-book:not(.two) .fb-r { left: 0; right: 0; }
.fb-book.two .fb-l { left: 0; width: 50%; }
.fb-book.two .fb-r { left: 50%; width: 50%; }
/* sırt: iki sayfanın birleştiği yerde hafif gölge (sayfaların içine taşmadan, üstte ince çizgi) */
.fb-book.two .fb-l:not(.empty)::after, .fb-book.two .fb-r:not(.empty)::after { content: ""; position: absolute; top: 0; bottom: 0; width: 7%; pointer-events: none; }
.fb-book.two .fb-l::after { right: 0; background: linear-gradient(to left, #0004, #0000); }
.fb-book.two .fb-r::after { left: 0; background: linear-gradient(to right, #0004, #0000); }
.fb-spine { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #0006; z-index: 1; pointer-events: none; }
.fb-book.two:has(.fb-l.empty) .fb-spine, .fb-book.two:has(.fb-r.empty) .fb-spine { display: none; }
.fb-leaf { position: absolute; top: 0; bottom: 0; z-index: 3; transform-style: preserve-3d; pointer-events: none; }
.fb-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; background: #f4efe4; }
.fb-face.empty { background: #e9e2d2; }
.fb-face.backf { transform: rotateY(180deg); }
.fb-face::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; animation: fbShade .7s ease-in-out forwards; }
.fb-face.front::after { background: linear-gradient(to left, #0000 40%, #0005); }
.fb-face.backf::after { background: linear-gradient(to right, #0000 40%, #0005); animation-name: fbShadeB; }
@keyframes fbShade { 0% { opacity: 0; } 50% { opacity: 1; } 100% { opacity: 1; } }
@keyframes fbShadeB { 0% { opacity: 1; } 50% { opacity: 1; } 100% { opacity: 0; } }
/* iki sayfa: ileri = sağ yaprak sırttan (sol kenarı) sola döner; geri = sol yaprak sırttan sağa */
.fb-leaf.fwd:not(.single) { left: 50%; width: 50%; transform-origin: left center; animation: fbFwd .7s cubic-bezier(.45, .05, .35, 1) forwards; }
.fb-leaf.back:not(.single) { left: 0; width: 50%; transform-origin: right center; animation: fbBack .7s cubic-bezier(.45, .05, .35, 1) forwards; }
@keyframes fbFwd { from { transform: rotateY(0); } to { transform: rotateY(-180deg); } }
@keyframes fbBack { from { transform: rotateY(0); } to { transform: rotateY(180deg); } }
/* tek sayfa: ileri = sayfa sol kenardan kalkıp gider; geri = önceki sayfa gelip üstüne kapanır */
.fb-leaf.single { left: 0; width: 100%; transform-origin: left center; }
.fb-leaf.fwd.single { animation: fbFwdS .6s ease-in-out forwards; }
.fb-leaf.back.single { animation: fbBackS .6s ease-in-out forwards; }
@keyframes fbFwdS { 0% { transform: rotateY(0); opacity: 1; } 80% { opacity: 1; } 100% { transform: rotateY(-120deg); opacity: 0; } }
@keyframes fbBackS { 0% { transform: rotateY(-120deg); opacity: 0; } 20% { opacity: 1; } 100% { transform: rotateY(0); opacity: 1; } }
.fb-zoom { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; }
.fb-zv { min-width: 42px; text-align: center; font-size: 12px; }

/* --- kütüphane (yüklenen dosyalar) --- */
.libhead { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.libhead #libSearch { flex: 1; min-width: 80px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.seg button { background: var(--panel2); color: var(--muted); border: 0; padding: 4px 8px; cursor: pointer; font: inherit; font-size: 12px; }
.seg button.active { background: var(--accent); color: #fff; }
#libGrid { flex: 1; overflow: auto; padding: 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; align-content: start; }
#tab-library.dropping #libGrid { outline: 2px dashed var(--accent2); outline-offset: -4px; }
.libempty { grid-column: 1 / -1; padding: 10px; }
.libhint { padding: 6px 10px; border-top: 1px solid var(--line); }
.libit { position: relative; border: 1px solid var(--line); border-radius: 6px; background: var(--panel2); cursor: grab; overflow: hidden; user-select: none; }
.libit:hover { border-color: var(--muted); }
.libit.sel { border-color: var(--accent2); box-shadow: 0 0 0 1px var(--accent2); }
.libit .th { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: #0e0d12 repeating-conic-gradient(#1a1920 0 25%, #121117 0 50%) 0 0 / 16px 16px; }
.libit .th img { max-width: 100%; max-height: 100%; object-fit: contain; pointer-events: none; }
.libit .ficon { flex-direction: column; font-size: 36px; background: #0e0d12; }
.libit .ficon span { font-size: 11px; color: var(--muted); letter-spacing: 1px; }
.libit .ln { font-size: 11px; padding: 3px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.libit .lb { position: absolute; top: 3px; left: 3px; font-size: 10px; background: #000b; padding: 0 4px; border-radius: 3px; max-width: 85%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctxmenu { position: fixed; z-index: 9999; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px #000c; padding: 4px; display: flex; flex-direction: column; min-width: 180px; }
.ctxmenu button { background: none; border: 0; color: var(--text); text-align: left; padding: 6px 10px; border-radius: 4px; cursor: pointer; font: inherit; }
.ctxmenu button:hover { background: var(--panel2); }
.ctxmenu button.danger { color: #ff7b7b; }
/* sahnede dosya kartı (PDF / metin) */
.item.file .fcard { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px; box-sizing: border-box;
  background: linear-gradient(160deg, #2a2730, #16151b); border: 1px solid #ffffff2a; border-radius: 6px; box-shadow: 0 4px 14px #0009; pointer-events: none; overflow: hidden; text-align: center; }
.item.file .fcard .fi { font-size: 56px; line-height: 1; }
.item.file .fcard .fn { font-size: 15px; font-weight: bold; color: var(--text); word-break: break-word; max-height: 3.9em; overflow: hidden; }
.item.file .fcard .fk { font-size: 11px; color: var(--muted); }
.item.file img { display: none; }
.win .wb.filewb { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.filetext { flex: 1; margin: 0; padding: 12px; overflow: auto; white-space: pre-wrap; font: 13px/1.5 ui-monospace, Consolas, monospace; }
.fileimg { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: #0e0d12; }
.fileimg img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* tıklama hissi: basınca düğme hafifçe içeri çöker ve kararır (karakter kâğıdındakiler hariç) */
button:not(.sheet *), .btn:not(.sheet *) { transition: transform .07s ease, filter .07s ease, box-shadow .07s ease, background-color .15s, border-color .15s, color .15s; }
button:not(.sheet *):not(:disabled):active, .btn:not(.sheet *):not(:disabled):active { transform: translateY(1px) scale(.95); filter: brightness(.8); }
.btn:not(.sheet *):not(:disabled):active { box-shadow: inset 0 2px 6px #000b; }
.btn.primary:not(.sheet *):not(:disabled):active { box-shadow: inset 0 2px 7px #000d, 0 0 0 2px #c9a22744; }
.journal li:active:not(.muted) { background: var(--line); transform: scale(.99); }

/* masadaki kitap: sayfa sahnede görünür, ◀ ▶ ile çevrilir */
.item.bookitem .bkpage { position: absolute; inset: 0; perspective: 1400px; border-radius: 3px; box-shadow: 0 6px 18px #000a; }
.item.bookitem .bkpage iframe, .item.bookitem .bkpage img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; background: transparent; }
.item.bookitem .bkpage img { object-fit: fill; display: block; -webkit-user-drag: none; user-select: none; }
.item.bookitem .leaf { position: absolute; inset: 0; z-index: 2; pointer-events: none; transform-origin: left center;
  background: linear-gradient(90deg, #cbbd9c 0%, #efe5cf 18%, #f6efdf 60%, #e4d8bd 100%); box-shadow: 0 0 18px #0009; border-radius: 0 3px 3px 0; }
.item.bookitem .leaf.next { animation: leafNext .55s ease-in-out forwards; }
.item.bookitem .leaf.prev { animation: leafPrev .55s ease-in-out forwards; }
@keyframes leafNext { 0% { transform: rotateY(0); opacity: 0; } 12% { opacity: 1; } 75% { opacity: 1; } 100% { transform: rotateY(-180deg); opacity: 0; } }
@keyframes leafPrev { 0% { transform: rotateY(-180deg); opacity: 0; } 25% { opacity: 1; } 88% { transform: rotateY(0); opacity: 1; } 100% { transform: rotateY(0); opacity: 0; } }
.item.bookitem .bknav { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 2px;
  background: #0b0809e6; border: 1px solid #c9a22766; border-radius: 16px; padding: 2px 4px; opacity: 0; transition: opacity .15s; cursor: default; }
.item.bookitem:hover .bknav, .item.bookitem.sel .bknav { opacity: 1; }
.item.bookitem .bknav button { background: none; border: 0; color: #f3e9d2; font-size: 15px; width: 30px; height: 26px; border-radius: 12px; cursor: pointer; }
.item.bookitem .bknav button:hover { background: #8b1e2d; }
.item.bookitem .bkno { font: 600 12px var(--serif); color: #f3e9d2; min-width: 46px; text-align: center; white-space: nowrap; }

/* yükleme ilerleme kutusu (resim/arka plan/dosya yüklerken) */
#upBox { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 10000; width: min(380px, calc(100vw - 32px));
  background: var(--panel); border: 1px solid #c9a22766; border-radius: 8px; box-shadow: 0 12px 40px #000c; padding: 10px 12px; animation: upIn .18s ease-out; }
#upBox.out { opacity: 0; transform: translate(-50%, -10px); transition: opacity .3s, transform .3s; }
@keyframes upIn { from { opacity: 0; transform: translate(-50%, -10px); } }
#upBox .uh { font: 600 14px var(--serif); margin-bottom: 6px; }
#upBox .ul { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow: auto; }
#upBox .un { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#upBox .ub { height: 6px; background: #000; border-radius: 3px; overflow: hidden; margin: 3px 0; }
#upBox .ub i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8b1e2d, #c9a227); transition: width .15s; }
#upBox .ur.ok .ub i { background: #2e8b57; }
#upBox .ur.bad .ub i { background: #b00020; }
#upBox .us { font-size: 11px; color: var(--muted); }
#upBox .ur.bad .us { color: #ff8a8a; }

/* sahne sağ tık menüsü */
#stageMenu { min-width: 200px; }
#stageMenu .cm-sep { height: 1px; background: var(--line); margin: 4px 2px; }
#stageMenu .cm-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; padding: 4px 10px 2px; }
#stageMenu button.on { color: #c9a227; }

/* pencereleri her köşeden / kenardan boyutlandırma tutamaçları (görünmez şeritler) */
.win .wrz { position: absolute; z-index: 5; }
.win .wrz-n, .win .wrz-s { left: 10px; right: 10px; height: 6px; cursor: ns-resize; }
.win .wrz-e, .win .wrz-w { top: 10px; bottom: 10px; width: 6px; cursor: ew-resize; }
.win .wrz-n { top: 0; } .win .wrz-s { bottom: 0; } .win .wrz-e { right: 0; } .win .wrz-w { left: 0; }
.win .wrz-ne, .win .wrz-nw, .win .wrz-se, .win .wrz-sw { width: 14px; height: 14px; }
.win .wrz-nw { left: 0; top: 0; cursor: nwse-resize; } .win .wrz-se { right: 0; bottom: 0; cursor: nwse-resize; }
.win .wrz-ne { right: 0; top: 0; cursor: nesw-resize; } .win .wrz-sw { left: 0; bottom: 0; cursor: nesw-resize; }
.win .wrz-se::after { content: ""; position: absolute; right: 3px; bottom: 3px; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); opacity: .6; }
body.win-resizing iframe { pointer-events: none; }
body.win-resizing { user-select: none; }

/* karakter kâğıdı başlığı: karakterin adı (kırmızı şerit üstünde geniş aralıklı beyaz harfler) + klan simgesi */
.sheet-head .name-banner { display: inline-flex; align-items: center; gap: 14px; max-width: calc(100% - 70px); padding: 6px 18px;
  background: linear-gradient(#7a0f1c, #4a0710); border: 1px solid #2a0408; box-shadow: inset 0 1px 0 #ffffff1a, 0 2px 8px #000a; }
.sheet-head .cname { font: 400 30px/1.1 var(--serif); letter-spacing: 8px; text-transform: uppercase; color: #fff;
  text-shadow: 0 1px 0 #000, 0 0 12px #00000088; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sheet-head .clan-ic { flex: none; width: 40px; height: 40px; color: #fff; filter: drop-shadow(0 1px 1px #000); }
.sheet-head .clan-ic svg { width: 100%; height: 100%; display: block; }
@container (max-width: 520px) { .sheet-head .cname { font-size: 20px; letter-spacing: 4px; } .sheet-head .clan-ic { width: 30px; height: 30px; } }
.sheet-head .clan-ic img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* canlı imleçler */
#cursorLayer { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 70; pointer-events: none; }
.rcursor { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; will-change: transform; }
.rcursor[hidden] { display: none; }
.rcursor svg { display: block; filter: drop-shadow(0 1px 2px #0008); }
.rcursor path { fill: var(--c); stroke: #fff; stroke-width: 1.5; stroke-linejoin: round; }
.rcursor span { position: absolute; left: 14px; top: 22px; font: 600 12px var(--sans); color: #fff; background: var(--c); padding: 1px 7px; border-radius: 9px; white-space: nowrap; text-shadow: 0 1px 1px #0007; box-shadow: 0 1px 3px #0006; }
/* "yazıyor…" */
#typingBar { padding: 3px 12px; font-size: 12px; color: var(--muted, #aaa); font-style: italic; display: flex; align-items: center; gap: 6px; }
#typingBar[hidden] { display: none; }
#typingBar b { font-style: normal; }
.tdots { display: inline-flex; gap: 3px; background: var(--line, #444); padding: 5px 7px; border-radius: 10px; }
.tdots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .4; animation: tdot 1.2s infinite; }
.tdots i:nth-child(2) { animation-delay: .2s; } .tdots i:nth-child(3) { animation-delay: .4s; }
@keyframes tdot { 0%, 60%, 100% { opacity: .4; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* ---------- YouTube sekmesi ve sahnedeki video ---------- */
#videoLayer { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
#videoLayer .ytf { position: absolute; right: 0; bottom: 0; width: 2px; height: 2px; border: 0; opacity: 0; pointer-events: none; }
.item.videoitem { background: transparent; }
.item.videoitem img { display: none; }
.item.videoitem .vcard { position: absolute; inset: 0; pointer-events: none; }
.item.videoitem .vcard { display: none; }
.item.videoitem:not(.vhost) .vcard, .item.videoitem .vcard.gone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: #111; border: 1px dashed #555; color: #aaa; font-size: 28px; }
.item.videoitem .vcard.gone .small { font-size: 12px; }
.item.videoitem .vcard.mp3card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: #15121a; border: 1px solid #4a3a5a; color: #ccc; font-size: 30px; border-style: solid; }
.item.videoitem .vcard.mp3card .small { font-size: 13px; padding: 0 8px; text-align: center; overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
#videoLayer .mp3a { display: none; }
#ytList .yt-mp3 { font-size: 11px; padding: 0 5px; border-radius: 3px; background: #3a2d48; color: #ddd; }
.yt-head { display: flex; flex-direction: column; gap: 8px; }
.yt-logo { display: flex; align-items: center; gap: 6px; font: 700 18px system-ui, sans-serif; color: #fff; letter-spacing: -.5px; }
.yt-play { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 21px; border-radius: 6px; background: #ff0033; color: #fff; font-size: 11px; }
#ytForm { display: flex; gap: 6px; }
#ytForm input { flex: 1; min-width: 0; }
#ytList { overflow-y: auto; flex: 1; padding: 6px; }
#ytList .yt-h { cursor: default; padding: 8px 8px 2px; }
#ytList .yt-h:hover { background: none; }
#ytList .ytv { align-items: flex-start; border: 1px solid var(--line); margin-bottom: 6px; cursor: grab; }
#ytList .yt-t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ytList .sub a { color: inherit; text-decoration: underline dotted; word-break: break-all; }
#ytList .ytdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
#ytList .yt-ctl { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
#ytList .yt-seek { flex: 1; min-width: 0; }
#ytList .yt-volrow { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; }
#ytList .yt-vol { flex: 1; min-width: 0; }
#ytList .yt-volv { width: 36px; text-align: right; }
#ytList .yt-loop.on { background: var(--accent, #8b1a1a); color: #fff; border-color: transparent; }
#ytList .yt-lrow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 4px; font-size: 12px; }
#ytList .yt-lrow input { width: 52px; padding: 2px 4px; font-size: 12px; }

/* karakter / not klasörleri */
.journal li.folder { gap: 6px; padding-top: 5px; padding-bottom: 5px; font-weight: 600; user-select: none; }
.journal li.folder .fcaret { width: 12px; flex: none; color: var(--muted); font-size: 11px; transition: transform .15s; }
.journal li.folder.open .fcaret { transform: rotate(90deg); }
.journal li.folder .ficon { font-size: 18px; flex: none; }
.journal li.folder .fcount { font-size: 11px; font-weight: 400; color: var(--muted); background: var(--panel2); border-radius: 9px; padding: 0 7px; }
.journal li.folder .fmenu { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 4px; font-size: 16px; visibility: hidden; }
.journal li.folder:hover .fmenu { visibility: visible; }
.journal li.dropin { background: var(--line); outline: 2px dashed var(--muted); outline-offset: -2px; }
.journal.droproot { outline: 2px dashed var(--line); outline-offset: -4px; }
#tab-chars .tabhead, #tab-notes .tabhead { display: flex; gap: 6px; }

/* ---------- numaralı katlar (1–15) ---------- */
.layer > .lvl { position: absolute; inset: 0; pointer-events: none; }
#stageMenu .cm-lv { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; padding: 2px 8px 6px; }
#stageMenu .cm-lv button { text-align: center; padding: 4px 0; border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
#stageMenu .cm-lv button.on { background: var(--accent2); border-color: var(--accent2); color: #fff; font-weight: 700; }
.item.videoitem > .ytf { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 1; background: #000; pointer-events: none; }
#lobbyList .ldots { font-size: 18px; line-height: 1; padding: 4px 8px; }

/* SPC (Storyteller karakteri / NPC) kâğıdı — Roll20 "SPC Sheet" gibi kısa düzen */
.sh-top .stype { width: auto; padding: 3px 6px; font: 12px var(--serif); background: #0a0708cc; border: 1px solid #3a1418; color: var(--text); border-radius: 3px; }
.sheet.spc-mode .sh-top .sides { display: none; }
.sheet .spc-name { max-width: 360px; margin: 6px auto 18px; }
.sheet .spc-name textarea { width: 100%; text-align: center; background: transparent; border: none; border-bottom: 1px solid #5a3a3e; border-radius: 0; color: var(--accent2); font: 600 24px var(--serif); text-transform: uppercase; letter-spacing: 1px; padding: 2px 4px; resize: none; }
.sheet .spc-name textarea:focus { background: #0a0708; border-bottom-color: var(--accent2); }
.sheet .trait.spc { padding: 3px 8px; }
.sheet .sv { width: 44px; flex: none; text-align: center; background: transparent; border: none; border-bottom: 1px dotted #5a3a3e; border-radius: 0; color: var(--accent2); font: 700 14px var(--serif); padding: 1px 2px; -moz-appearance: textfield; }
.sheet .sv::-webkit-inner-spin-button, .sheet .sv::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.sheet .sv:focus { background: #0a0708; border-bottom-color: var(--accent2); }
.sheet .sv::placeholder { color: #7a5a5e; }
.sheet .spc-h { margin-top: 26px; max-width: 50%; }
.sheet .spc-sec { display: flex; gap: 40px; padding: 4px 30px 10px; flex-wrap: wrap; }
.sheet .spc-sec .sv2 { display: flex; align-items: center; gap: 24px; font: 600 14px var(--serif); color: var(--text); }
.sheet .bx.notes.spc-notes { margin-top: 10px; min-height: 0; }
.sheet .bx.notes.spc-notes textarea.auto.big { min-height: 90px; }

/* Turn Tracker: sürükleme, sıradaki, çubuklar, sıra değişince 2 kez yanıp sönme */
.trk-list li .grip { cursor: grab; color: var(--muted); padding: 0 1px; user-select: none; flex: none; }
.trk-list li .grip:active { cursor: grabbing; }
.trk-list li.dragging { opacity: .35; }
.trk-list li.nxt { border-color: #f1c40f44; background: #25211a; }
.trk-list .mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.trk-list .mid .nm { width: 100%; box-sizing: border-box; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trk-list .nx { font-size: 10px; color: #f1c40faa; text-transform: uppercase; letter-spacing: .5px; flex: none; }
.trk-bars { display: flex; flex-direction: column; gap: 2px; padding: 1px 4px 2px; }
.trk-bars .ctrack .boxes { gap: 2px; flex-wrap: wrap; }
.trk-bars .ctrack .boxes i { width: 12px; height: 12px; font-size: 9px; }
.trk-list .ib.mv { display: none; }
@media (max-width: 760px), (pointer: coarse) { .trk-list .ib.mv { display: inline; } }
.trk-quick, .trk-opts { margin-top: 6px; align-items: center; gap: 6px; flex-wrap: wrap; }
.trk-quick select { max-width: 130px; font-size: 12px; padding: 2px 4px; }
.trk-opts label.check { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); cursor: pointer; }
@keyframes trkflash { 0%, 100% { background: #3a3210; } 50% { background: #6e5c1c; box-shadow: 0 0 10px #f1c40f88; } }
.trk-list li.cur.flash, #trkStrip .tchip.cur.flash { animation: trkflash .5s ease-in-out 2; }
@keyframes turnpulse {
  0%, 100% { box-shadow: 0 0 0 calc(4px * var(--inv, 1)) #f1c40f, 0 0 calc(30px * var(--inv, 1)) #f1c40f; }
  50% { box-shadow: 0 0 0 calc(7px * var(--inv, 1)) #fff6, 0 0 calc(70px * var(--inv, 1)) calc(18px * var(--inv, 1)) #f1c40f; }
}
.item.turnpulse { animation: turnpulse .6s ease-in-out 4; }

/* Üstteki ince sıra şeridi */
#trkStrip { position: absolute; top: 30px; left: calc(50% + 26px); transform: translateX(-50%); z-index: 24; max-width: calc(100% - 200px); display: flex; align-items: center; gap: 4px; padding: 3px 6px; background: #000c; border: 1px solid var(--line); border-radius: 16px; overflow-x: auto; scrollbar-width: none; cursor: pointer; user-select: none; color: var(--text); }
#trkStrip::-webkit-scrollbar { display: none; }
body.pagebar-open #trkStrip { top: calc(var(--pagebar) + 30px); }  /* "Pages" sekmesinin altında */
#trkStrip .rd { font: 600 12px var(--serif); color: #f1c40f; padding: 0 4px; flex: none; }
#trkStrip .tchip { display: flex; align-items: center; gap: 4px; padding: 2px 8px 2px 2px; border-radius: 12px; border: 1px solid transparent; flex: none; opacity: .7; font-size: 12px; max-width: 120px; }
#trkStrip .tchip .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#trkStrip .tchip .av { width: 20px; height: 20px; border-radius: 50%; background: #2a2730 center/cover; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
#trkStrip .tchip.cur { opacity: 1; border-color: #f1c40f; background: #3a3210; }
#trkStrip .tchip.nxt { opacity: .95; border-color: #f1c40f44; }
#trkStrip .tchip.hid { font-style: italic; opacity: .45; }
@media (max-width: 600px) { #trkStrip { max-width: calc(100% - 80px); } #trkStrip .tchip .nm { display: none; } #trkStrip .tchip { padding-right: 2px; } }

/* kayıt durumu: bağlantı yoksa altta uyarı, düzelince "kaydedildi" */
#saveState { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 9999; padding: 7px 14px; border-radius: 18px;
  font: 600 13px var(--sans, system-ui); color: #fff; box-shadow: 0 4px 16px #0008; pointer-events: none; max-width: calc(100vw - 32px); text-align: center; }
#saveState[hidden] { display: none; }
#saveState.bad { background: #a5281b; }
#saveState.ok { background: #2e7d32; }

/* kâğıt/not üzerindeki canlı imleçler (Google Docs gibi) */
.scur-layer { position: absolute; pointer-events: none; overflow: hidden; z-index: 4; }
.scur { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.scur[hidden], .sfocus[hidden] { display: none; }
.scur svg { display: block; filter: drop-shadow(0 1px 2px #0008); }
.scur path { fill: var(--c); stroke: #fff; stroke-width: 1.5; stroke-linejoin: round; }
.scur span, .sfocus span { position: absolute; font: 600 11px var(--sans, system-ui); color: #fff; background: var(--c); padding: 1px 6px;
  border-radius: 8px; white-space: nowrap; text-shadow: 0 1px 1px #0007; box-shadow: 0 1px 3px #0006; transition: opacity .4s; }
.scur span { left: 13px; top: 19px; }
.scur.idle span { opacity: 0; }
.sfocus { position: absolute; left: 0; top: 0; border: 2px solid var(--c); border-radius: 4px; box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 30%, transparent); }
.sfocus span { left: -2px; top: -17px; border-radius: 4px 4px 4px 0; }

/* yedek yükleme ilerlemesi ve üzerine yazma uyarısı */
.xprog { position: relative; height: 22px; border-radius: 6px; background: #0006; border: 1px solid var(--line); overflow: hidden; }
.xprog.hidden { display: none; }
.xprog span { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent, #8b1e2b); transition: width .2s; }
.xprog b { position: relative; display: block; text-align: center; font: 600 12px/22px var(--sans, system-ui); color: #fff; }
.warnbox { margin: 0; padding: 10px 12px; border-radius: 6px; background: #5a141a; border: 1px solid #a5281b; color: #f3dede; font-size: 13px; line-height: 1.45; }

/* kitap şifresi */
#bookList .booklock { display: block; cursor: default; padding: 18px 12px; }
#bookList .booklock form { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
#bookList .booklock .bl-ico { font-size: 30px; }
#bookList .booklock .bl-t { font: 600 15px var(--serif); }
#bookList .booklock input { width: 100%; max-width: 240px; font-size: 15px; padding: 7px 10px; text-align: center; }
#bookList .booklock .err { min-height: 1em; color: #ff8a8a; font-size: 13px; }
.item .bklock { position: absolute; left: 0; right: 0; bottom: 10%; text-align: center; font: 600 12px var(--sans, system-ui);
  color: #fff; background: #000a; padding: 4px; pointer-events: none; }

/* Turn Tracker: turda geçen süre ve toplam savaş süresi */
.trk-head .trk-total { display: block; font: 500 11px var(--sans, inherit); color: var(--muted); letter-spacing: .3px; }
.trk-head .trk-total:empty { display: none; }
.trk-time { display: inline-block; font: 600 11px ui-monospace, Consolas, monospace; color: #f1c40f; margin-left: 6px; white-space: nowrap; }
.trk-list li .mid .trk-time { margin: 0 0 2px; }
#trkStrip .tchip .trk-time { font-size: 10px; margin-left: 4px; }

/* SPC kâğıdı: standart havuzlar, beceriler */
.sheet .spc-pools .trait.sv2 { gap: 14px; padding: 3px 8px; }
.sheet .spc-skills .trait.spc .spec { flex: 1; min-width: 0; margin: 0 6px; font-size: 11px; background: transparent; border: none; border-bottom: 1px dotted #3a2a2e; border-radius: 0; color: var(--muted); padding: 1px 2px; }
.sheet .spc-skills .trait.spc .spec:focus { background: #0a0708; color: var(--text); }

/* biçimli not alanları (rich.js) */
.rt-wrap { display: flex; flex-direction: column; min-width: 0; width: 100%; }
.rt-bar { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; padding: 2px; background: #0e0d12; border: 1px solid var(--line); border-bottom: none; border-radius: 4px 4px 0 0; }
.rt-bar button { background: none; border: 1px solid transparent; color: var(--muted); min-width: 24px; height: 22px; padding: 0 5px; border-radius: 3px; cursor: pointer; font: 600 12px var(--sans); }
.rt-bar button:hover:not(:disabled) { color: var(--text); background: var(--panel2); border-color: var(--line); }
.rt-bar button:disabled { opacity: .35; cursor: default; }
.rt-bar .grow { flex: 1; }
.rt-bar .rt-prevbtn { font-weight: 500; }
.rt-wrap > textarea { border-top-left-radius: 0; border-top-right-radius: 0; }
.rt-wrap.previewing > textarea { display: none; }
.rt-wrap.ro .rt-bar { display: none; }
.rt-prev { min-height: 60px; padding: 8px 10px; background: #0e0d12; border: 1px solid var(--line); border-radius: 0 0 4px 4px; color: var(--text); font: 14px/1.45 var(--sans); text-align: left; cursor: text; overflow-wrap: anywhere; text-transform: none; letter-spacing: normal; }
.rt-wrap.ro .rt-prev { border-radius: 4px; cursor: default; }
.rt-prev h4 { margin: 6px 0 4px; font: 600 17px var(--serif); color: var(--accent2); }
.rt-prev h5 { margin: 6px 0 3px; font: 600 14px var(--serif); color: var(--accent2); }
.rt-prev ul { margin: 3px 0; padding-left: 20px; }
.rt-prev blockquote { margin: 4px 0; padding: 3px 10px; border-left: 3px solid var(--accent); color: #cfc6d3; background: #ffffff08; }
.rt-prev hr { border: none; border-top: 1px solid var(--line); margin: 8px 0; }
.rt-prev .gap { height: .7em; }
span.mention { color: #ff4a4a; font-weight: 700; cursor: pointer; white-space: nowrap; text-shadow: 0 0 6px #ff2a2a99, 0 0 12px #ff000055; animation: mnGlow 2.4s ease-in-out infinite; border-radius: 3px; padding: 0 1px; }
span.mention:hover { color: #ff7070; text-decoration: underline; text-shadow: 0 0 8px #ff3b3bcc, 0 0 16px #ff000088; }
@keyframes mnGlow { 50% { text-shadow: 0 0 9px #ff2a2acc, 0 0 18px #ff00007a; } }
.mn-card { position: fixed; z-index: 10001; pointer-events: none; background: var(--panel); border: 1px solid #ff3b3b66; border-radius: 8px; box-shadow: 0 8px 24px #000c, 0 0 14px #ff00002a; padding: 8px; text-align: center; width: 140px; font: 13px var(--sans); }
.mn-card .mn-av { width: 124px; height: 124px; border-radius: 6px; background: #2a1d21 center/cover; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 32px; }
.mn-card .mn-nm { margin-top: 6px; color: #ff6060; font-weight: 700; overflow-wrap: anywhere; }
.mn-card .mn-no { color: var(--muted); font-size: 11px; }
.rt-pop { position: fixed; z-index: 10000; width: 230px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px #000c; padding: 3px; font: 13px var(--sans); }
.rt-pop .rt-ph { color: var(--muted); font-size: 11px; padding: 3px 6px; }
.rt-pop .rt-it { display: flex; align-items: center; gap: 7px; padding: 4px 6px; border-radius: 4px; cursor: pointer; color: var(--text); }
.rt-pop .rt-it.on, .rt-pop .rt-it:hover { background: var(--panel2); }
.rt-pop .av { width: 22px; height: 22px; border-radius: 50%; background: #2a1d21 center/cover; flex: none; }
.msg.mention { cursor: pointer; border-left: 3px solid #4aa3ff; background: #4aa3ff12; padding: 6px 8px; border-radius: 4px; }
.msg.mention .mn-s { margin-top: 4px; min-height: 0; padding: 4px 8px; font-size: 13px; }

/* oturum notları */
.ses-head { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.ses-head .ses-q { flex: 1; min-width: 160px; }
.ses.card { border: 1px solid var(--line); border-radius: 6px; background: var(--panel2); margin-bottom: 10px; padding: 6px 8px 8px; }
.ses .ses-h { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.ses .ses-h [data-sk=title] { flex: 1; min-width: 0; font: 600 15px var(--serif); }
.ses .ses-h [data-sk=date] { width: 140px; flex: none; }
.ses .ib { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 2px 5px; }
.ses .ib:hover { color: var(--text); }
.ses textarea.ses-text { width: 100%; min-height: 120px; resize: vertical; box-sizing: border-box; }
.ses.folded .ses-b { display: none; }
.ses.flash { animation: sesFlash 1.6s ease-out; }
@keyframes sesFlash { 0%, 40% { box-shadow: 0 0 0 2px #f1c40f; } 100% { box-shadow: 0 0 0 0 transparent; } }
.ses-empty { padding: 10px 2px; }
.nsearch { padding-top: 0; }
.nsearch input { width: 100%; box-sizing: border-box; }
#noteResults li.nres { align-items: flex-start; }
#noteResults .av.ic { display: flex; align-items: center; justify-content: center; font-size: 18px; background: var(--panel2); }
#noteResults .snip { font-size: 12px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
#noteResults mark { background: #f1c40f55; color: #fff; border-radius: 2px; padding: 0 1px; }
.ctxmenu .cm-h { color: var(--muted); font-size: 11px; padding: 4px 10px 2px; text-transform: uppercase; letter-spacing: .5px; }
.ctxmenu .cm-sep { border-top: 1px solid var(--line); margin: 4px 0; }
.ctxmenu .cm-note { padding: 2px 10px 4px; }

/* profil: karakter seçimi, fotoğraf, kadraj */
.profmenu { max-height: calc(80vh / var(--uiz, 1)); overflow-y: auto; min-width: 220px; }
.profmenu button { display: flex; align-items: center; gap: 8px; }
.profmenu button.on { background: #4aa3ff22; box-shadow: inset 3px 0 0 #4aa3ff; }
.profmenu .pm-av { width: 24px; height: 24px; border-radius: 50%; background: #2a1d21 center/cover; flex: none; display: inline-flex; align-items: center; justify-content: center; font: 600 12px var(--serif); color: #b88; }
.pav .who { position: absolute; left: 4px; bottom: 4px; background: #000b; color: #ddd; font: 600 11px var(--sans); padding: 1px 5px; border-radius: 3px; max-width: calc(100% - 8px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-bg { position: fixed; inset: 0; z-index: 9000; background: #000a; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-bg .modal { width: 420px; padding: 14px 16px; gap: 10px; }
.modal-bg .hd { display: flex; align-items: center; gap: 8px; }
.modal-bg .hd .grow, .modal-bg .row .grow { flex: 1; }
.modal-bg .x { background: none; border: none; color: var(--muted); font-size: 16px; cursor: pointer; }
.libpick .modal { width: 560px; max-height: calc(80vh / var(--uiz, 1)); }
.libpick .lp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; overflow-y: auto; min-height: 0; }
.libpick .lp-grid button { padding: 0; border: 1px solid var(--line); background: #0e0d12; border-radius: 4px; aspect-ratio: 1; cursor: pointer; overflow: hidden; }
.libpick .lp-grid button:hover { border-color: var(--accent2); }
.libpick .lp-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cropdlg .cr-frame { width: 100%; position: relative; border: 2px solid var(--accent2); cursor: grab; overflow: hidden; touch-action: none; background: #000; }
.cropdlg .cr-frame:active { cursor: grabbing; }
.cropdlg .cr-img { position: absolute; inset: 0; background-repeat: no-repeat; }
.cropdlg .cr-z { flex-direction: row !important; align-items: center; gap: 8px !important; }
.cropdlg .cr-z input { flex: 1; padding: 0; }

/* SPC: ⚙ Configure ve "SPC Sheet Settings" penceresi */
.sheet:not(.spc-mode) .spc-cfgbtn { display: none; }
.spc-cfg { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; background: #0007; padding: 16px; }
.spc-cfg .box { width: 560px; max-width: 100%; background: #f7f3ea; color: #2a1a1c; border: 3px double #8b2b33; border-radius: 4px; padding: 10px 18px 14px; box-shadow: 0 16px 50px #000c; display: flex; flex-direction: column; gap: 2px; }
.spc-cfg .hd { display: flex; align-items: center; border-bottom: 1px solid #8b2b33; padding-bottom: 4px; margin-bottom: 6px; }
.spc-cfg .hd span { flex: 1; text-align: center; font: 600 20px var(--serif); letter-spacing: 3px; text-transform: uppercase; color: #6d0f19; }
.spc-cfg .hd .x { background: none; border: none; font-size: 18px; cursor: pointer; color: #2a1a1c; }
.spc-cfg .row { display: grid; grid-template-columns: 1fr 1fr; align-items: center; padding: 7px 0; font: 15px var(--serif); cursor: pointer; }
.spc-cfg .row input[type=checkbox] { justify-self: center; width: 18px; height: 18px; accent-color: #8b2b33; cursor: pointer; }
.spc-cfg .row select { background: #fff; color: #555; border: 1px solid #bbb; border-radius: 3px; padding: 3px 6px; font: 14px var(--serif); }
.sheet .rep.spcx .rh { display: flex; align-items: center; gap: 6px; }
.sheet .rep.spcx textarea { flex: 1; }

/* sekmeler iki satır (kullanıcı isteği 2026-11-28): 5 sütun, adlar birbirine girmesin */
#tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
#tabs button { min-width: 0; padding: 5px 2px 4px; font-size: 15px; gap: 1px; }
#tabs button span { font-size: 11px; letter-spacing: .4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#tabs button:nth-child(-n+6) { border-bottom-color: var(--line); }
#tabs button.active { border-bottom-color: var(--accent2); }

/* karakterlerde toplu seçim */
#tab-chars { position: relative; }
/* başlık satırının üstüne biner: açılınca liste kaymasın (basılı tutup çekerken satırlar yerinde kalsın) */
.selbar { position: absolute; z-index: 5; top: 6px; left: 6px; right: 6px; display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--accent); border-radius: 6px; background: var(--panel); box-shadow: inset 0 0 0 999px #b3202c22, 0 2px 8px #000a; font-size: 13px; }
.selbar.hidden { display: none; }
.selbar .grow { flex: 1; }
.selbar .btn[disabled] { opacity: .45; cursor: default; }
.journal.selecting li[data-char] { user-select: none; }
.journal.sweeping, .journal.sweeping li { cursor: ns-resize !important; user-select: none; }
.journal li.sel { background: #b3202c33; box-shadow: inset 3px 0 0 var(--accent2); }
.journal li.sel:hover { background: #b3202c44; }

/* ---------------- envanter (Diablo tarzı ızgara, VtM havası) ---------------- */
.inv { --cell: 38px; position: relative; outline: none; padding: 2px 2px 8px; }
.inv-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.inv-top .inv-help b { color: var(--text); }
.inv-bags { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.inv-col { display: flex; flex-direction: column; gap: 14px; }
.inv-bag { background: linear-gradient(#1d1215, #120b0e); border: 1px solid #4a1a20; border-radius: 6px; padding: 8px 10px 10px; box-shadow: 0 4px 14px #0008, inset 0 1px 0 #ffffff0a; }
.inv-hv { display: flex; gap: 10px; align-items: flex-start; }
.inv-garage { width: calc(4 * var(--cell)); display: flex; flex-direction: column; gap: 6px; }
.ig-h { display: flex; align-items: center; gap: 6px; font-family: var(--serif); }
.ig-h b { color: #e6d3c0; letter-spacing: .5px; }
.ig-h .inv-bi { width: 22px; height: 22px; }
.ig-h .muted.small { font-family: var(--sans); font-size: 11px; }
.ig-bay { position: relative; height: calc(1.8 * var(--cell)); border: 1px dashed #6a2a32aa; border-radius: 4px; display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(135deg, #0c0809 0 10px, #140c0e 10px 20px); box-shadow: inset 0 0 12px #000; }
.ig-no { position: absolute; left: 6px; top: 3px; font: 700 11px var(--sans); color: #b3202c; }
.ig-e { font-size: 11px; color: #8a7670; font-style: italic; }
.ig-none { border: 1px dashed #4a1a20; border-radius: 4px; padding: 8px; line-height: 1.4; }
.ig-bay.full { border-style: solid; border-color: #6a2a32; background: radial-gradient(ellipse at 50% 70%, #2a1a1d, #0c0809 75%); flex-direction: column; justify-content: flex-end; padding: 2px 4px 3px; }
.ig-bay.over { border-color: #e0a020; }
.ig-bay.over .ig-no { color: #e0a020; }
.ig-car { flex: 1; width: 100%; min-height: 0; display: flex; align-items: center; justify-content: center; }
.ig-car svg { width: 100%; height: 100%; }
.ig-n { font-size: 10.5px; color: #e6d3c0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; line-height: 1.2; }
.ig-x { position: absolute; right: 2px; top: 1px; opacity: 0; transition: opacity .15s; }
.ig-bay:hover .ig-x, .ig-x:focus-visible { opacity: 1; }
.ig-buy { align-self: stretch; }
.loc-nobay { color: #e0a020; }
.inv-bh { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; font-family: var(--serif); }
.inv-bh b { letter-spacing: .5px; color: #e6d3c0; }
.inv-bh .muted.small { font-family: var(--sans); font-size: 11px; }
.inv-bi { width: 26px; height: 26px; color: #b3202c; flex: none; filter: drop-shadow(0 0 4px #b3202c55); }
.inv-bi svg { width: 100%; height: 100%; display: block; }
.inv-cnt { white-space: nowrap; align-self: flex-start; }
.inv-grid {
  position: relative; width: calc(var(--cols) * var(--cell)); height: calc(var(--rows) * var(--cell));
  background-color: #0c0809;
  background-image:
    linear-gradient(to right, #6a2a3233 1px, transparent 1px),
    linear-gradient(to bottom, #6a2a3233 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, #ffffff06 0, transparent 70%);
  background-size: var(--cell) var(--cell), var(--cell) var(--cell), var(--cell) var(--cell);
  border: 1px solid #5a1d25; box-shadow: inset 0 0 18px #000, 0 0 0 1px #000;
  touch-action: none;
}
.inv-item {
  --tint: #3a2329; --edge: #5d4337;
  position: absolute; left: calc(var(--x) * var(--cell) + 1px); top: calc(var(--y) * var(--cell) + 1px);
  width: calc(var(--w) * var(--cell) - 2px); height: calc(var(--h) * var(--cell) - 2px);
  background:
    linear-gradient(160deg, #ffffff12, transparent 35%, transparent 70%, #00000059),
    radial-gradient(ellipse at 50% 42%, var(--tint), #0f080a 78%);
  border: 1px solid var(--edge); border-radius: 3px;
  overflow: hidden; cursor: grab; user-select: none; box-sizing: border-box;
  box-shadow: inset 0 0 0 1px #00000080, inset 0 0 10px #000c;
  transition: border-color .12s, box-shadow .12s;
}
.inv-item[data-cat="kindred"] { --tint: #4a0f18; --edge: #6e2a33; }
.inv-item[data-cat="weapons"] { --tint: #252b33; --edge: #4d5560; }
.inv-item[data-cat="gear"] { --tint: #2b2a22; --edge: #5a5442; }
.inv-item[data-cat="personal"] { --tint: #33291a; --edge: #6a5632; }
.inv-item[data-cat="cash"] { --tint: #1f2e1b; --edge: #4f6b3f; }
.inv-item:hover { border-color: #b8977a; box-shadow: inset 0 0 0 1px #00000080, inset 0 0 10px #000c, 0 0 8px #c4182a66; }
.inv-item.sel { border-color: #d9b56a; box-shadow: inset 0 0 0 1px #00000080, inset 0 0 10px #000c, 0 0 0 1px #d9b56a, 0 0 12px #d9b56a66; z-index: 2; }
.inv-item.lifted { opacity: .25; }
.inv-item .ii { position: absolute; left: 50%; top: 50%; width: calc(var(--ow) * var(--cell) - 6px); height: calc(var(--oh) * var(--cell) - 6px); transform: translate(-50%, -50%) rotate(var(--rot)); pointer-events: none; }
.inv-item .ii svg, .inv-item .ii img { width: 100%; height: 100%; display: block; object-fit: contain; filter: drop-shadow(0 2px 2px #000d) drop-shadow(0 0 1px #000); }
.inv-item .in { position: absolute; inset: 2px; display: flex; align-items: center; justify-content: center; text-align: center; font: 600 10.5px/1.15 var(--serif); color: #e6d3c0; overflow: hidden; word-break: break-word; pointer-events: none; }
.inv-item.plain { background: repeating-linear-gradient(135deg, #2a1a1e 0 6px, #24151a 6px 12px); }
.inv-item .iq { position: absolute; right: 2px; bottom: 1px; font: 700 11px var(--sans); color: #f3e6c8; text-shadow: 0 0 3px #000, 0 0 2px #000; pointer-events: none; }
.inv-item .iq.cash { left: 0; right: 0; bottom: 0; text-align: center; font-size: 10px; letter-spacing: -.2px; color: #d8f0c0; background: linear-gradient(transparent, #000c 60%); padding-top: 4px; }
.inv-cash { color: #9fd486; font-weight: 700; }
.inv-money { margin-left: auto; font-size: 13px; }
.inv-money b { color: #9fd486; }
.inv-hl.merge { background: #d9b56a33; border: 1px solid #d9b56acc; }
.inv-cashrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inv-cashrow label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.inv-cashrow input { width: 120px; }
.inv-cashrow .muted { flex-basis: 100%; }
.inv.ro .inv-item { cursor: default; }
.inv-ghost { position: fixed !important; left: 0; top: 0; z-index: 100000; pointer-events: none; opacity: .92; cursor: grabbing; box-shadow: 0 8px 24px #000c, 0 0 12px #c4182a66; }
body.inv-dragging, body.inv-dragging * { cursor: grabbing !important; }
.inv-hl { position: absolute; left: calc(var(--x) * var(--cell)); top: calc(var(--y) * var(--cell)); width: calc(var(--w) * var(--cell)); height: calc(var(--h) * var(--cell)); pointer-events: none; z-index: 3; box-sizing: border-box; border-radius: 2px; }
.inv-hl.ok { background: #3ccf6e26; border: 1px solid #3ccf6e99; }
.inv-hl.bad { background: #ff2a2a2e; border: 1px solid #ff4d4daa; }
.inv-info { display: flex; align-items: center; gap: 10px; margin-top: 12px; min-height: 46px; padding: 6px 10px; border: 1px solid #3a1a1f; border-radius: 6px; background: #140c0f; }
.inv-info .grow { flex: 1; min-width: 0; }
.inv-sw { width: 40px; height: 40px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.inv-sw svg, .inv-sw img { max-width: 100%; max-height: 100%; object-fit: contain; }
.inv-note { color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.inv-dlg { position: absolute; inset: 0; z-index: 20; background: #000a; display: flex; align-items: flex-start; justify-content: center; padding: 14px; }
.inv-dlg-b { background: var(--panel); border: 1px solid #5a1d25; border-radius: 8px; box-shadow: 0 14px 40px #000d; padding: 10px 14px 14px; width: min(640px, 100%); max-height: calc(100% - 10px); overflow: auto; }
.inv-dlg-h { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-size: 16px; margin-bottom: 8px; }
.inv-dlg-h .ib { background: none; border: 0; color: var(--muted); font-size: 16px; cursor: pointer; }
.inv-to { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.inv-to .btn.on { border-color: var(--accent2); background: #b3202c33; }
.inv-cat { margin: 12px 0 6px; font: 600 12px var(--serif); letter-spacing: 1.5px; text-transform: uppercase; color: #c9a54a; border-bottom: 1px solid #3a1a1f; padding-bottom: 3px; }
.inv-pre { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.inv-pb .inv-pi { filter: drop-shadow(0 2px 2px #000c); }
.inv-pb { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px; background: #170e11; border: 1px solid #3a2328; border-radius: 5px; color: var(--text); cursor: pointer; font: 12px var(--sans); text-align: center; }
.inv-pb:hover { border-color: #a8876b; background: #22131a; }
.inv-pb small { color: var(--muted); font-size: 10px; }
.inv-pi { width: 54px; height: 44px; display: flex; align-items: center; justify-content: center; }
.inv-pi svg { max-width: 100%; max-height: 100%; }
.inv-custom { display: grid; grid-template-columns: 1fr 80px 80px; gap: 8px; align-items: end; }
.inv-custom label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.inv-custom .wide { grid-column: 1 / -1; }
.inv-custom .row { display: flex; align-items: center; gap: 8px; }
.inv-custom textarea { resize: vertical; }
.inv-pick { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.inv-pick select { flex: 1; max-width: 360px; }
#tInv .ti svg { width: calc(20px * var(--ts)); height: calc(20px * var(--ts)); display: block; margin: 0 auto; }

/* ---------- Settings sekmesi ---------- */
.settings { padding: 12px 14px; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.settings h3 { margin: 0; font-family: var(--serif); font-variant: small-caps; letter-spacing: 1px; }
.settings p { margin: 0; }
.set-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.set-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent2); }
label.set-row { cursor: pointer; }
.set-row.sub { padding-left: 24px; }
.set-row.sub > span:first-child { min-width: 64px; color: var(--muted); font-size: 13px; }
.set-row.dim { opacity: .5; cursor: default; }
/* Settings → Sound: Master / Effects / Music */
.vol-row { flex-wrap: nowrap; }
.vol-row > span { flex: 0 0 120px; display: flex; flex-direction: column; line-height: 1.2; }
.vol-row > span small { font-size: 10.5px; }
.vol-row input[type=range] { flex: 1; min-width: 60px; accent-color: var(--accent2); cursor: pointer; }
.vol-row output { flex: 0 0 38px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }

/* ---------- Hunger efekti: kenarlardan kan bürümesi ----------
   Kullanıcı isteği: opaklık ve nabız %50 azaltıldı, kaplanan alan yarıya indi, ekranın ortası tamamen açık. */
#fxHunger { position: fixed; inset: 0; z-index: 9000; pointer-events: none; opacity: 0; transition: opacity 2.5s ease; --a: .2; --in: 80%; --beat: 1.6s; }
#fxHunger.on { opacity: 1; }
#fxHunger[data-lv="3"] { --a: .31; --in: 76%; --beat: 1.6s; }
#fxHunger[data-lv="4"] { --a: .39; --in: 71%; --beat: 1.2s; }
#fxHunger[data-lv="5"] { --a: .46; --in: 66%; --beat: .85s; }
#fxHunger[data-str="light"] { --a2: .55; } #fxHunger { --a2: 1; }
#fxHunger .fx-vig { position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent var(--in), rgba(110,0,8,calc(var(--a) * var(--a2) * .7)) calc(var(--in) + (100% - var(--in)) * .6), rgba(35,0,2,calc(var(--a) * var(--a2))) 100%);
  box-shadow: inset 0 0 calc(20px + var(--a) * 45px) rgba(90,0,6,calc(var(--a) * var(--a2)));
  animation: fxBeat var(--beat) ease-in-out infinite; transform-origin: center; }
/* kalp atışı: iki vuruş, sonra dinlenme (genlik yarıya indi) */
@keyframes fxBeat { 0% { opacity: .86; } 14% { opacity: 1; } 26% { opacity: .9; } 38% { opacity: .985; } 60%, 100% { opacity: .85; } }
#fxHunger .fx-veins { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 3s ease; filter: drop-shadow(0 0 2px #6a0008); }
#fxHunger .fx-veins path { stroke: rgba(120,4,14,.85); }
#fxHunger[data-lv="4"] .fx-veins { opacity: calc(.22 * var(--a2)); }
#fxHunger[data-lv="5"] .fx-veins { opacity: calc(.4 * var(--a2)); animation: fxBeat var(--beat) ease-in-out infinite; }
#fxHunger .fx-flash { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, transparent 65%, rgba(150,0,10,.3) 100%); }
#fxHunger.flash .fx-flash { animation: fxFlash 1.1s ease-out; }
@keyframes fxFlash { 0% { opacity: 0; } 12% { opacity: calc(var(--a2)); } 100% { opacity: 0; } }
.fx-shake { animation: fxShake .45s linear; }
@keyframes fxShake { 0%,100% { transform: none; } 20% { transform: translate(1px,-.5px); } 40% { transform: translate(-1px,.5px); } 60% { transform: translate(.5px,1px); } 80% { transform: translate(-.5px,-.5px); } }
@media (prefers-reduced-motion: reduce) { #fxHunger .fx-vig, #fxHunger .fx-veins { animation: none !important; } }

/* ---------- Willpower efekti: zihinsel yorgunluk ----------
   Kullanıcı isteği: etkiler %50 azaltıldı; ekranın ortası tamamen açık (her katman kenarlara maskeli). */
#fxWill { position: fixed; inset: 0; z-index: 8990; pointer-events: none; opacity: 0; transition: opacity 3s ease;
  --sat: 1; --fog: 0; --blur: 0px; --k: 1; }
#fxWill[data-str="light"] { --k: .55; }
#fxWill.on { opacity: 1; }
#fxWill[data-lv="1"] { --sat: .8; --fog: .23; }
#fxWill[data-lv="2"] { --sat: .71; --fog: .33; --blur: .6px; }
#fxWill[data-lv="3"] { --sat: .62; --fog: .42; --blur: 1px; }
#fxWill[data-str="light"][data-lv="1"] { --sat: .9; }
#fxWill[data-str="light"][data-lv="2"] { --sat: .85; --blur: 0px; }
#fxWill[data-str="light"][data-lv="3"] { --sat: .8; --blur: 0px; }
#fxWill > div { position: absolute; inset: 0; }
/* ortası açık kalsın: kenar maskesi */
#fxWill .fx-desat, #fxWill .fx-blur, #fxWill .fx-fog, #fxWill .fx-lapse {
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 62%, #000 100%); mask-image: radial-gradient(ellipse at center, transparent 62%, #000 100%); }
/* renkler solar (kenarlarda) */
#fxWill .fx-desat { backdrop-filter: saturate(var(--sat)) brightness(calc(1 - (1 - var(--sat)) * .18)); -webkit-backdrop-filter: saturate(var(--sat)); }
/* kenarlar bulanır, orta net kalır */
#fxWill .fx-blur { backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur)); }
/* soğuk gri-mavi sis, yavaşça kayar (yalnız köşelerde) */
#fxWill .fx-fog { inset: -8%; opacity: calc(var(--fog) * var(--k));
  background:
    radial-gradient(ellipse 22% 16% at 6% 10%, rgba(150,160,180,.55), transparent 70%),
    radial-gradient(ellipse 18% 20% at 96% 18%, rgba(130,140,165,.5), transparent 70%),
    radial-gradient(ellipse 24% 16% at 22% 98%, rgba(140,150,170,.5), transparent 70%),
    radial-gradient(ellipse 18% 18% at 94% 95%, rgba(120,130,155,.5), transparent 70%),
    radial-gradient(ellipse at center, transparent 75%, rgba(70,78,98,.75) 100%);
  animation: fxFog 38s ease-in-out infinite alternate; }
@keyframes fxFog { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(1.25%, -.75%) scale(1.02); } 100% { transform: translate(-1%, 1%) scale(1.01); } }
/* odak kaybı: kenarlar bulanır, sonra toparlanır */
#fxWill .fx-lapse { opacity: 0; backdrop-filter: blur(1.5px); -webkit-backdrop-filter: blur(1.5px); }
#fxWill.lapse .fx-lapse { animation: fxLapse 3.2s ease-in-out; }
@keyframes fxLapse { 0% { opacity: 0; } 30% { opacity: .5; } 55% { opacity: .42; } 100% { opacity: 0; } }
/* ağır göz kırpma (kullanıcı isteği 2026-11-28): kavisli göz kapakları; üst kapak çoğunu iner, alt kapak biraz kalkar,
   ekran bir an TAMAMEN kapanır, sonra yavaşça açılır; açılınca kısa bir odak toparlanması. Light'ta %60'a kadar iner. */
#fxWill { --close: 1; }
#fxWill[data-str="light"] { --close: .6; }
#fxWill .fx-eye { overflow: hidden; }
#fxWill .fx-eye > div { position: absolute; }
#fxWill .fx-lid { left: -12%; right: -12%; filter: blur(1.5px); will-change: transform; }
#fxWill .fx-lid.top { top: 0; height: 86%; transform: translateY(-104%);
  border-radius: 0 0 50% 50% / 0 0 16% 16%;
  background: linear-gradient(to bottom, #040303 0%, #080506 62%, #140a0a 86%, #24110f 96%, #050303 100%);
  box-shadow: 0 10px 28px 10px rgba(0,0,0,.55), inset 0 -4px 2px rgba(0,0,0,.95); }
#fxWill .fx-lid.bot { bottom: 0; height: 42%; transform: translateY(104%);
  border-radius: 50% 50% 0 0 / 20% 20% 0 0;
  background: linear-gradient(to top, #040303 0%, #090606 60%, #170b0b 88%, #050303 100%);
  box-shadow: 0 -8px 22px 8px rgba(0,0,0,.5), inset 0 3px 2px rgba(0,0,0,.95); }
/* kapanırken kenarlardan kararma, açılınca kısa bulanıklık */
#fxWill .fx-eyedark { inset: 0; opacity: 0; background: radial-gradient(ellipse 70% 45% at center, transparent 30%, rgba(0,0,0,.75) 100%); }
#fxWill .fx-refocus { inset: 0; opacity: 0; backdrop-filter: blur(1.6px); -webkit-backdrop-filter: blur(1.6px); }
#fxWill.blink .fx-lid.top { animation: fxLidTop 1.7s both; }
#fxWill.blink .fx-lid.bot { animation: fxLidBot 1.7s both; }
#fxWill.blink .fx-eyedark { animation: fxEyeDark 1.7s both; }
#fxWill.blink .fx-refocus { animation: fxRefocus 1.7s both; }
#fxWill.blink2 .fx-lid.top { animation: fxLidTop2 2.8s both; }
#fxWill.blink2 .fx-lid.bot { animation: fxLidBot2 2.8s both; }
#fxWill.blink2 .fx-eyedark { animation: fxEyeDark2 2.8s both; }
#fxWill.blink2 .fx-refocus { animation: fxRefocus2 2.8s both; }
/* tek ağır kırpma: hızlı kapanır, bir an kapalı kalır, yavaş açılır */
@keyframes fxLidTop {
  0% { transform: translateY(-104%); animation-timing-function: cubic-bezier(.55,0,.85,.4); }
  20% { transform: translateY(calc((1 - var(--close)) * -100%)); }
  40% { transform: translateY(calc((1 - var(--close)) * -100%)); animation-timing-function: cubic-bezier(.3,0,.25,1); }
  58% { transform: translateY(-58%); animation-timing-function: ease-out; }
  100% { transform: translateY(-104%); } }
@keyframes fxLidBot {
  0% { transform: translateY(104%); animation-timing-function: cubic-bezier(.55,0,.85,.4); }
  20% { transform: translateY(calc((1 - var(--close)) * 100%)); }
  40% { transform: translateY(calc((1 - var(--close)) * 100%)); animation-timing-function: cubic-bezier(.3,0,.25,1); }
  58% { transform: translateY(55%); animation-timing-function: ease-out; }
  100% { transform: translateY(104%); } }
@keyframes fxEyeDark { 0% { opacity: 0; } 18%, 42% { opacity: 1; } 75%, 100% { opacity: 0; } }
@keyframes fxRefocus { 0%, 45% { opacity: 0; } 60% { opacity: 1; } 100% { opacity: 0; } }
/* yorgun kırpma: kapaklar ağırlaşır, zorla açılır, sonra tam kapanır */
@keyframes fxLidTop2 {
  0% { transform: translateY(-104%); animation-timing-function: ease-in-out; }
  16% { transform: translateY(-48%); animation-timing-function: ease-in-out; }
  28% { transform: translateY(-88%); animation-timing-function: cubic-bezier(.55,0,.85,.4); }
  44% { transform: translateY(calc((1 - var(--close)) * -100%)); }
  64% { transform: translateY(calc((1 - var(--close)) * -100%)); animation-timing-function: cubic-bezier(.3,0,.25,1); }
  78% { transform: translateY(-62%); animation-timing-function: ease-out; }
  100% { transform: translateY(-104%); } }
@keyframes fxLidBot2 {
  0% { transform: translateY(104%); animation-timing-function: ease-in-out; }
  16% { transform: translateY(70%); animation-timing-function: ease-in-out; }
  28% { transform: translateY(95%); animation-timing-function: cubic-bezier(.55,0,.85,.4); }
  44% { transform: translateY(calc((1 - var(--close)) * 100%)); }
  64% { transform: translateY(calc((1 - var(--close)) * 100%)); animation-timing-function: cubic-bezier(.3,0,.25,1); }
  78% { transform: translateY(58%); animation-timing-function: ease-out; }
  100% { transform: translateY(104%); } }
@keyframes fxEyeDark2 { 0% { opacity: 0; } 16% { opacity: .6; } 28% { opacity: .2; } 44%, 64% { opacity: 1; } 88%, 100% { opacity: 0; } }
@keyframes fxRefocus2 { 0%, 68% { opacity: 0; } 80% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #fxWill .fx-fog { animation: none; } }

/* Yazı aracı (Ctrl+G): sahnede tıklanan yerde açılan geçici kutu */
#textInput { position: fixed; z-index: 9000; min-width: 160px; padding: 2px 6px; background: #000c; border: 1px dashed #fff8;
  border-radius: 4px; font-family: system-ui, sans-serif; font-weight: 600; outline: none; }

/* Settings → Keyboard shortcuts */
.setscroll { flex: 1; min-height: 0; overflow: auto; }
.setscroll > .settings { overflow: visible; }
#setKeys { border-top: 1px solid #ffffff14; }
.ktable { display: flex; flex-direction: column; }
.kgrp { margin: 10px 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; opacity: .6; }
.krow { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px; border-radius: 4px; }
.krow:nth-child(even) { background: #ffffff08; }
.krow .kl { font-size: 13px; }
.krow .kk { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; flex-shrink: 0; max-width: 55%; }
.kchip { display: inline-flex; border: 1px solid #ffffff2a; border-radius: 4px; overflow: hidden; background: #0007; }
.kchip button, .kadd { font: 600 12px ui-monospace, Consolas, monospace; color: inherit; background: none; border: 0; padding: 2px 7px; cursor: pointer; }
.kchip button:hover, .kadd:hover { background: #ffffff18; }
.kchip button.cap { color: #f1c40f; animation: kblink 1s infinite; }
.kchip .kx { padding: 2px 5px; opacity: .5; border-left: 1px solid #ffffff1a; }
.kchip .kx:hover { opacity: 1; color: #e74c3c; }
.kadd { border: 1px dashed #ffffff2a; border-radius: 4px; opacity: .6; }
.kfix { font: 600 12px ui-monospace, Consolas, monospace; opacity: .75; text-align: right; }
.krow.fixed .kk { max-width: 45%; }
@keyframes kblink { 50% { opacity: .4; } }

/* Karakter kâğıdı ayrı sekmede (?sheet=<id>): yalnız kâğıt penceresi, tüm sayfayı kaplar */
body.sheet-tab #side, body.sheet-tab #board > :not(#windows) { display: none !important; }
body.sheet-tab #board { flex: 1 1 100%; }
body.sheet-tab .win.tabwin { position: fixed; left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; border: none; box-shadow: none; }
body.sheet-tab .win.tabwin .wrz { display: none; }
body.sheet-tab .win.tabwin .wh { cursor: default; }
.sheettab-gone { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; text-align: center; background: var(--bg, #0d0a0b); color: var(--text, #ddd); font: 600 16px var(--sans, sans-serif); z-index: 9999; }

/* Kâğıt üst çubuğu: Play as */
.sh-top .playas-btn { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-top .playas-btn.on { border-color: var(--accent2); color: var(--accent2); }

/* Başlığa çift tıkla sahneyi kaplayan pencere */
.win.maxed { border-radius: 0; }

/* Pencere başlığında ⧉: ayrı tarayıcı penceresine çıkar */
.win .wh .wpop { background: none; border: none; color: var(--muted, #aaa); cursor: pointer; font-size: 15px; padding: 0 6px; }
.win .wh .wpop:hover { color: var(--text, #fff); }

/* Başlık tarayıcı dışına sürüklenince: bırakınca ayrı pencere olur */
.win.popping { outline: 2px dashed var(--accent2, #e0b050); outline-offset: -2px; opacity: .8; }
.win.popping::after { content: "Release to open in its own window"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: #000d; color: #fff; font: 600 14px var(--sans, sans-serif); padding: 8px 14px; border-radius: 8px; pointer-events: none; z-index: 5; }

/* Zırh çubuğu + Ghoul/Human düğmeleri (kullanıcı isteği 2026-11-29) */
.armorbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 8px; padding: 5px 10px; border: 1px solid #3a1418; border-radius: 4px; background: #0a0708cc; font-size: 12px; }
.armorbar .ab-ic { font-size: 15px; }
.armorbar .ab-v { color: var(--text); }
.armorbar .ab-ok { color: #7fd17f; }
.armorbar .ab-no { color: var(--muted); font-style: italic; }
.armorbar.void .ab-ic, .armorbar.void .ab-v { opacity: .45; }
.armorbar.void .ab-v { text-decoration: line-through; }
.armorbar .ab-kind { padding: 2px 4px; font-size: 12px; }
.sheet:not(.spc-mode) .armorbar .ab-kind { display: none; }
.win.readonly .sheet .creat button { pointer-events: none; }
.sheet .kvclan { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sheet .creat { display: flex; align-items: center; gap: 6px; padding-left: 88px; }
.sheet .creat button { padding: 1px 8px; border: 1px solid #3a1418; border-radius: 3px; background: #0a0708cc; color: var(--muted); font-size: 11px; cursor: pointer; }
.sheet .creat button:hover { color: var(--text); }
.sheet .creat button.on { border-color: var(--accent2); background: #b3202c33; color: var(--text); }
.sheet .infogrid .kvclan { border: 1px solid #3a1418; margin: -.5px; padding-bottom: 4px; }
.sheet .infogrid .kvclan .kv { border: none; margin: 0; }
.sheet .infogrid .kvclan .creat { padding-left: 78px; }

/* ---------- sol çubuk: boyut, ekle/çıkar, sürükleyerek sıralama (toolbar.js) ---------- */
#tools { user-select: none; }
#tools .tb-off { display: none !important; }
#tools > button.tb-drag { opacity: .6; background: var(--panel2); border-color: var(--accent2); cursor: grabbing; }
#tools.tb-sorting, #tools.tb-sorting * { cursor: grabbing !important; }
#tools .tsep { transition: none; }
#tbCtl { flex: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; width: calc(var(--tw) - 6px); margin-top: 2px; }
#tbCtl button { flex: 1 1 14px; min-width: 0; height: 16px; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: none; color: var(--muted); font: 700 12px/1 system-ui, sans-serif; cursor: pointer; }
#tbCtl button.tb-edit { flex-basis: 100%; font-size: 9px; font-weight: 600; }
#tbCtl button:hover:not(:disabled), #tbCtl button.on { color: var(--text); border-color: var(--accent2); }
#tbCtl button:disabled { opacity: .35; cursor: default; }
#tbPop { top: auto; bottom: 10px; width: 250px; max-height: calc(100vh / var(--uiz, 1) - 20px); overflow: auto; }
#tbPop .tb-size { display: flex; align-items: center; gap: 6px; font-size: 12px; }
#tbPop .tb-size > span { flex: 1; color: var(--muted); }
#tbPop .tb-pct { min-width: 42px; text-align: center; font-size: 12px; }
#tbPop .tb-list { display: flex; flex-direction: column; gap: 1px; }
#tbPop .tb-row { display: flex; align-items: center; gap: 4px; padding: 2px 4px; border-radius: 5px; background: #ffffff08; }
#tbPop .tb-row.off { opacity: .5; }
#tbPop .tb-row.tb-drag { background: #b3202c44; outline: 1px solid var(--accent2); }
#tbPop .tb-grip { cursor: grab; color: var(--muted); padding: 0 3px; touch-action: none; }
#tbPop .tb-row label { flex: 1; display: flex; align-items: center; gap: 6px; font-size: 12.5px; cursor: pointer; }
#tbPop .tb-row label i { color: var(--muted); font-size: 11px; }
#tbPop .tb-li { width: 20px; text-align: center; font-size: 15px; line-height: 1; }
#tbPop .tb-li svg { width: 17px; height: 17px; display: block; margin: 0 auto; }
#tbPop .tb-li .badge { display: none; }
#tbPop .tb-foot { display: flex; justify-content: space-between; margin-top: 4px; }

/* Yeni güncelleme şeridi: haritanın üstünde, ortada (kullanıcı isteği 2026-11-30) */
#updBar { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 14px; border-radius: 999px; background: #17121acc; backdrop-filter: blur(8px); border: 1px solid #8a2a35;
  box-shadow: 0 6px 24px #000a, 0 0 0 4px #8a2a3522; color: #eee; font: 13px system-ui, sans-serif; white-space: nowrap;
  animation: updIn .4s cubic-bezier(.2,1.3,.4,1); }
#updBar b { font-weight: 700; letter-spacing: .02em; }
#updBar .upd-sub { color: #aaa; }
#updBar .upd-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff5a6a; box-shadow: 0 0 0 0 #ff5a6a; animation: updPulse 1.6s infinite; }
#updBar .upd-go { border: none; border-radius: 999px; padding: 6px 14px; background: #b3283a; color: #fff; font: 600 13px system-ui, sans-serif; cursor: pointer; }
#updBar .upd-go:hover { background: #cf3447; }
#updBar .upd-x { border: none; background: none; color: #888; font-size: 14px; cursor: pointer; padding: 4px 6px; }
#updBar .upd-x:hover { color: #fff; }
@keyframes updIn { from { opacity: 0; transform: translate(-50%, -12px); } }
@keyframes updPulse { 70% { box-shadow: 0 0 0 8px #ff5a6a00; } 100% { box-shadow: 0 0 0 0 #ff5a6a00; } }
@media (max-width: 600px) { #updBar .upd-sub { display: none; } }
