/* ===== Zindan Masası — tema ===== */
:root {
  --bg: #13100e;
  --bg-2: #1b1714;
  --panel: #211c18;
  --panel-2: #2a231e;
  --border: #3b322b;
  --border-2: #4d4138;
  --text: #ece4d8;
  --muted: #a89c8c;
  --faint: #7a6f62;
  --accent: #c8423a;
  --accent-2: #e05a4f;
  --gold: #d6a849;
  --green: #4caf6d;
  --blue: #4f8fd6;
  --purple: #9b6ad6;
  --warn: #e0a03a;
  --radius: 10px;
  --shadow: 0 6px 24px rgba(0, 0, 0, .35);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Cinzel", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 20% -10%, #2a1c17 0%, transparent 60%), var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; margin: 0 0 .5em; letter-spacing: .02em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75em; }
[x-cloak] { display: none !important; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
small, .muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }

/* ===== Üst menü ===== */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 1rem;
  padding: .6rem 1.2rem;
  background: rgba(19, 16, 14, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { font-family: var(--display); font-size: 1.15rem; color: var(--text); display: flex; align-items: center; gap: .5rem; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .d20 { color: var(--accent); font-size: 1.4rem; }
.nav { display: flex; gap: .25rem; flex: 1; overflow-x: auto; }
.nav a { color: var(--muted); padding: .35rem .7rem; border-radius: 8px; white-space: nowrap; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--panel-2); text-decoration: none; }
.user-menu { display: flex; align-items: center; gap: .6rem; color: var(--muted); white-space: nowrap; }

@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; gap: .3rem .6rem; padding: .5rem .8rem .3rem; }
  .brand { font-size: 1.05rem; }
  .user-menu { margin-left: auto; }
  .user-menu > span { display: none; }
  .nav { order: 3; flex-basis: 100%; margin: 0 -.3rem; padding-bottom: .15rem; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: .3rem .6rem; font-size: .92rem; }
}

.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
@media (max-width: 700px) {
  .container { padding: 1rem .75rem 3rem; }
  h1 { font-size: 1.35rem; }
  .card { padding: .85rem .8rem; }
  .modal-back { padding: 2vh .5rem; }
  .modal-body { max-height: 80vh; }
  .toasts { left: .75rem; right: .75rem; max-width: none; }
}
.container.wide { max-width: 1600px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }

/* ===== Kart ve ızgara ===== */
.card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 1rem; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.card-title h2, .card-title h3 { margin: 0; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: .6rem; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }
.center { text-align: center; }
.mt { margin-top: 1rem; }
.mb { margin-bottom: 1rem; }

/* ===== Butonlar ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .5rem .9rem;
  border-radius: 8px;
  border: 1px solid var(--border-2);
  background: var(--panel-2);
  color: var(--text);
  font: inherit; font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
  white-space: nowrap;
  text-decoration: none !important;
}
.btn:hover { background: #352c26; border-color: #5d4f44; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.gold { background: #6b5320; border-color: var(--gold); color: #ffe9b8; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); }
.btn.danger { background: transparent; border-color: #7a2c26; color: #ff8a80; }
.btn.danger:hover { background: #3a1b18; }
.btn.green { background: #24502f; border-color: var(--green); color: #c9f5d5; }
.btn.sm { padding: .25rem .55rem; font-size: .85rem; border-radius: 6px; }
.btn.xs { padding: .1rem .4rem; font-size: .78rem; border-radius: 5px; }
.btn.block { width: 100%; }
.btn.icon { padding: .3rem .5rem; }

/* ===== Formlar ===== */
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .25rem; }
.field { margin-bottom: .8rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], select, textarea {
  width: 100%;
  padding: .5rem .65rem;
  background: #16120f;
  border: 1px solid var(--border-2);
  border-radius: 7px;
  color: var(--text);
  font: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(214, 168, 73, .2); }
textarea { resize: vertical; min-height: 80px; }
input[type=number] { -moz-appearance: textfield; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; vertical-align: middle; }
.check { display: inline-flex; align-items: center; gap: .4rem; color: var(--text); font-size: .9rem; cursor: pointer; margin: 0; }
.input-sm { padding: .25rem .4rem !important; font-size: .9rem; }
.w-60 { width: 60px !important; } .w-80 { width: 80px !important; } .w-120 { width: 120px !important; }
.error { color: #ff8a80; font-size: .85rem; margin-top: .25rem; }

.alert { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid; }
.alert.ok { background: #1c3324; border-color: #2f6b41; color: #c9f5d5; }
.alert.err { background: #3a1b18; border-color: #7a2c26; color: #ffc4bd; }
.alert.info { background: #1b2838; border-color: #2f557a; color: #cfe3fa; }

/* ===== Rozetler ===== */
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .08rem .5rem;
  border-radius: 999px;
  font-size: .75rem; font-weight: 600;
  background: var(--panel-2); border: 1px solid var(--border-2); color: var(--muted);
}
.badge.red { background: #3a1b18; border-color: #7a2c26; color: #ff9d94; }
.badge.gold { background: #3a2f17; border-color: #6b5320; color: var(--gold); }
.badge.green { background: #1c3324; border-color: #2f6b41; color: #9fe0b2; }
.badge.blue { background: #1b2838; border-color: #2f557a; color: #9cc6f5; }
.badge.purple { background: #2a1f3a; border-color: #533d7a; color: #c9a6f5; }
.badge.click { cursor: pointer; }
.rarity-common { color: #d8d0c4; } .rarity-uncommon { color: #5fd17f; } .rarity-rare { color: #5aa0ef; }
.rarity-very-rare { color: #b07cf0; } .rarity-legendary { color: #f0a442; } .rarity-artifact { color: #e8644f; }

/* ===== Tablo / liste ===== */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: .55rem .2rem; border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; }
.list-item { display: flex; align-items: center; gap: .6rem; }
.list-item:hover { background: rgba(255, 255, 255, .02); }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 500; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }

/* ===== HP çubuğu ===== */
.hpbar { position: relative; height: 8px; background: #3a1b18; border-radius: 99px; overflow: hidden; }
.hpbar > span { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #3d9b5c, #5cc47b); border-radius: 99px; transition: width .3s; }
.hpbar.mid > span { background: linear-gradient(90deg, #c4892b, #e0b04a); }
.hpbar.low > span { background: linear-gradient(90deg, #a52a22, #d94a3f); }
.hpbar > i { position: absolute; inset: 0 auto 0 0; background: rgba(79, 143, 214, .65); border-radius: 99px; }

/* ===== Sekmeler ===== */
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; overflow-x: auto; }
.tabs button {
  background: none; border: 0; color: var(--muted); padding: .55rem .9rem; font: inherit; cursor: pointer;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.tabs button:hover { color: var(--text); }

/* ===== Modal ===== */
.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 80; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 1rem; overflow-y: auto; }
.modal-back.modal-top { z-index: 95; } /* eşya/canavar bilgisi, seçim penceresinin önünde açılır */
.modal { background: var(--panel); border: 1px solid var(--border-2); border-radius: 12px; width: 100%; max-width: 640px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.modal.lg { max-width: 860px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; }
.modal-body { padding: 1rem; max-height: 75vh; overflow-y: auto; }
.modal-foot { padding: .75rem 1rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: .5rem; }

/* ===== Bildirim (toast) ===== */
.toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 100; display: flex; flex-direction: column; gap: .5rem; max-width: 360px; }
.toast { background: var(--panel-2); border: 1px solid var(--border-2); border-left: 4px solid var(--gold); padding: .6rem .9rem; border-radius: 8px; box-shadow: var(--shadow); animation: slideIn .2s ease-out; }
.toast.err { border-left-color: var(--accent); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ===== Zar ===== */
.dice-link {
  display: inline; background: rgba(214, 168, 73, .12); color: var(--gold); border: 1px dashed rgba(214, 168, 73, .45);
  border-radius: 5px; padding: 0 .3rem; font: inherit; cursor: pointer; line-height: 1.3;
}
.dice-link:hover { background: rgba(214, 168, 73, .25); }
.roll-result { font-family: var(--display); font-weight: 700; font-size: 1.5rem; color: var(--text); }
.roll-result.crit { color: #6fe08f; text-shadow: 0 0 12px rgba(111, 224, 143, .5); }
.roll-result.fumble { color: #ff6b5e; }
.die { display: inline-block; min-width: 1.6em; text-align: center; padding: 0 .25em; border-radius: 4px; background: #2e2620; border: 1px solid var(--border-2); font-size: .82rem; margin: 0 .1em; }
.die.drop { opacity: .35; text-decoration: line-through; }
.die.max { border-color: #3d9b5c; color: #8de0a6; }
.die.min { border-color: #a52a22; color: #ff9d94; }
.quick-dice { display: flex; gap: .3rem; flex-wrap: wrap; }
.quick-dice .btn { min-width: 46px; }

/* ===== Oyun masası ===== */
.table-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr) 330px; gap: 1rem; align-items: start; }
@media (max-width: 1250px) { .table-layout { grid-template-columns: 280px minmax(0, 1fr); } .table-layout .col-right { grid-column: 1 / -1; } }
.mobile-tabs { display: none; }
@media (max-width: 860px) {
  .table-layout { grid-template-columns: minmax(0, 1fr); }
  .mobile-tabs { display: flex; gap: .3rem; position: sticky; top: 86px; z-index: 30; background: var(--bg); padding: .4rem 0; margin-bottom: .6rem; }
  .mobile-tabs button { flex: 1; }
  .m-hide { display: none !important; }
  .feed { height: 55vh; min-height: 260px; }
  .quick-dice { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); width: 100%; gap: .25rem; }
  .quick-dice .btn { min-width: 0; padding: .3rem 0; font-size: .82rem; }
  .chat-row { position: sticky; bottom: 0; background: var(--panel); padding: .5rem 0 .2rem; margin-bottom: -.2rem; }
  .chat-row select { width: 92px !important; }
  .page-head .btn.sm { padding: .25rem .5rem; font-size: .82rem; }
  .sticky-col { position: static; }
}
.col { min-width: 0; }
.sticky-col { position: sticky; top: 70px; }

.feed { height: calc(100vh - 330px); min-height: 360px; overflow-y: auto; padding-right: .3rem; display: flex; flex-direction: column; gap: .45rem; }
.event { padding: .5rem .7rem; border-radius: 8px; background: rgba(255, 255, 255, .025); border: 1px solid transparent; }
.event .meta { font-size: .78rem; color: var(--faint); display: flex; gap: .4rem; align-items: center; }
.event .who { color: var(--gold); font-weight: 600; font-size: .85rem; }
.event.roll { border-color: var(--border); background: linear-gradient(90deg, rgba(200, 66, 58, .08), transparent 60%); }
.event.system { background: transparent; color: var(--muted); font-size: .88rem; font-style: italic; padding: .25rem .7rem; }
.event.whisper { border-color: #533d7a; background: rgba(155, 106, 214, .08); }
.event.hidden-roll { border-color: #2f557a; border-style: dashed; }
.event.mine { background: rgba(214, 168, 73, .05); }

.party-card { padding: .7rem .8rem; border-radius: 9px; border: 1px solid var(--border); background: var(--panel-2); }
.party-card + .party-card { margin-top: .55rem; }
.party-card .name { font-weight: 600; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: #3a2f27 center/cover; border: 2px solid var(--border-2); flex: none; display: grid; place-items: center; font-family: var(--display); color: var(--gold); }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; }
.online-dot.on { background: var(--green); box-shadow: 0 0 6px var(--green); }
.stat-pill { display: inline-flex; flex-direction: column; align-items: center; padding: .1rem .45rem; border-radius: 6px; background: #1a1613; border: 1px solid var(--border); min-width: 42px; }
.stat-pill b { font-size: .95rem; }
.stat-pill small { font-size: .65rem; text-transform: uppercase; letter-spacing: .05em; }

.combatant { display: flex; align-items: center; gap: .5rem; padding: .45rem .55rem; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2); }
.combatant + .combatant { margin-top: .4rem; }
.combatant.current { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 16px rgba(214, 168, 73, .25); }
.combatant.is-hidden { opacity: .55; border-style: dashed; }
.combatant.down { opacity: .6; }
.combatant .init { width: 38px; text-align: center; font-family: var(--display); font-weight: 700; font-size: 1.1rem; }
.combatant.monster .cname { color: #ffb3aa; }
.combatant.pc .cname { color: #b6dcff; }

/* ===== Karakter oluşturma (BG3 tarzı) ===== */
.cc-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr) 320px; gap: 1rem; align-items: start; }
@media (max-width: 1200px) { .cc-layout { grid-template-columns: 190px minmax(0, 1fr); } .cc-side { grid-column: 1 / -1; order: -1; } }
@media (max-width: 760px) { .cc-layout { grid-template-columns: minmax(0, 1fr); } .cc-steps { position: static !important; flex-direction: row !important; overflow-x: auto; } .cc-step { flex: none; } .cc-step small { display: none; } }
.cc-steps { position: sticky; top: 70px; display: flex; flex-direction: column; gap: .3rem; }
.cc-step { display: flex; align-items: center; gap: .55rem; text-align: left; padding: .5rem .6rem; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); color: var(--text); font: inherit; cursor: pointer; }
.cc-step:hover { border-color: var(--gold); }
.cc-step .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--border-2); font-weight: 700; font-size: .85rem; flex: none; }
.cc-step.done .n { background: #1c3324; border-color: #2f6b41; color: #9fe0b2; }
.cc-step.on { border-color: var(--gold); background: #2b2418; }
.cc-step.on .n { background: var(--gold); color: #1b1714; border-color: var(--gold); }
.cc-step small { display: block; color: var(--muted); font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.cc-main h2 { font-size: 1.5rem; }
.cc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .55rem; }
.cc-cards.small { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.cc-card { display: flex; flex-direction: column; gap: .2rem; text-align: left; padding: .7rem .8rem; border-radius: 12px; border: 1px solid var(--border-2); background: linear-gradient(180deg, var(--panel), var(--bg-2)); color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s, transform .1s; }
.cc-card:hover { border-color: var(--gold); transform: translateY(-1px); }
.cc-card.on { border: 2px solid var(--gold); background: linear-gradient(180deg, #3a2f17, #231d14); box-shadow: 0 0 18px rgba(214, 168, 73, .2); }
.cc-card .ic { font-size: 1.8rem; line-height: 1.1; }
.cc-card b { font-family: var(--display); font-size: 1rem; }
.cc-card small { color: var(--muted); font-size: .8rem; line-height: 1.3; }
.gold-text { color: var(--gold) !important; }
.cc-traits { margin: .3rem 0; padding-left: 1.1rem; font-size: .9rem; }
.cc-traits li { margin: .15rem 0; }
.cc-abil { display: grid; gap: .4rem; }
.cc-abil-row { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); flex-wrap: wrap; }
.cc-abil-row.primary { border-color: #6b5320; }
.cc-score { display: flex; flex-direction: column; align-items: center; min-width: 52px; padding: .1rem .3rem; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--border-2); }
.cc-score b { font-family: var(--display); font-size: 1.3rem; line-height: 1.1; }
.cc-score small { color: var(--gold); font-weight: 700; }
.cc-skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .35rem; }
.cc-skill { display: flex; align-items: center; gap: .55rem; text-align: left; padding: .45rem .6rem; border-radius: 8px; border: 1px solid var(--border); background: var(--panel); color: var(--text); font: inherit; cursor: pointer; }
.cc-skill .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-2); flex: none; }
.cc-skill.on { border-color: var(--gold); } .cc-skill.on .dot { background: var(--gold); border-color: var(--gold); }
.cc-skill.locked { border-color: #2f557a; background: #18222e; cursor: default; } .cc-skill.locked .dot { background: var(--blue); border-color: var(--blue); }
.cc-skill.off { opacity: .45; }
.cc-skill .d { display: block; color: var(--faint); font-size: .74rem; }
.cc-skill .src { font-size: .7rem; color: var(--muted); white-space: nowrap; }
.cc-skill .val { font-weight: 700; width: 2.2em; text-align: right; }
.cc-spells { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .4rem; max-height: 420px; overflow-y: auto; padding-right: .2rem; }
.cc-spell { display: flex; flex-direction: column; gap: .1rem; text-align: left; padding: .45rem .6rem; border-radius: 8px; border: 1px solid var(--border); background: var(--panel); color: var(--text); font: inherit; cursor: pointer; }
.cc-spell small { color: var(--muted); font-size: .74rem; line-height: 1.25; }
.cc-spell.on { border: 2px solid var(--purple); background: #241b31; }
.cc-spell.off { opacity: .45; }
.cc-portrait { width: 96px; height: 96px; border-radius: 14px; border: 2px solid var(--gold); background: #3a2f27 center/cover; display: grid; place-items: center; font-size: 2.6rem; flex: none; }
.cc-portrait.sm { width: 56px; height: 56px; font-size: 1.6rem; border-radius: 12px; }
.cc-side { position: sticky; top: 70px; }
.cc-mini-abil { display: grid; grid-template-columns: repeat(6, 1fr); gap: .25rem; text-align: center; }
.cc-mini-abil > div { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: .2rem 0; display: flex; flex-direction: column; }
.cc-mini-abil small { font-size: .62rem; color: var(--muted); }
.cc-mini-abil b { font-family: var(--display); }
.cc-mini-abil span { font-size: .72rem; color: var(--gold); }

/* ===== Rehberli içerik formu ===== */
.item-summary { position: sticky; top: 62px; z-index: 20; border-color: var(--gold); background: linear-gradient(180deg, #2b2418, #1e1913); margin-bottom: 1rem; }
.sum-list { margin: .5rem 0 0; padding-left: 1.1rem; font-size: .88rem; max-height: 20vh; overflow-y: auto; }
.sum-list li { margin: .12rem 0; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .45rem; }
.choice-grid.small { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; text-align: left; padding: .55rem .65rem; border-radius: 10px; border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text); font: inherit; cursor: pointer; }
.choice:hover { border-color: var(--gold); }
.choice.on { border: 2px solid var(--gold); background: #3a2f17; }
.choice .ci { font-size: 1.4rem; }
.choice small { color: var(--muted); font-size: .76rem; line-height: 1.25; }
.hint { font-size: .8rem; color: var(--muted); margin: .25rem 0 .6rem; }
.prop-list { display: grid; gap: .3rem; }
.prop-row { padding: .4rem .55rem; border-radius: 8px; border: 1px solid var(--border); }
.prop-row.on { border-color: #6b5320; background: rgba(214, 168, 73, .06); }
.prop-row .sub { margin: .35rem 0 0 1.6rem; font-size: .85rem; color: var(--muted); }
.prop-row .sub select { width: auto; }
details.card > summary { list-style: none; }
details.card > summary::before { content: '▸ '; color: var(--gold); }
details.card[open] > summary::before { content: '▾ '; }
@media (max-width: 700px) { .item-summary { top: 86px; } .sum-list { max-height: 20vh; } }

/* ===== Savaş ekranı (BG3 tarzı) ===== */
.cb-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; align-items: start; }
@media (max-width: 1100px) { .cb-wrap { grid-template-columns: minmax(0, 1fr); } }
.turn-strip { display: flex; gap: .45rem; overflow-x: auto; padding: .3rem .1rem .5rem; scrollbar-width: thin; }
.turn-chip { flex: none; width: 74px; text-align: center; padding: .35rem .25rem; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-2); cursor: pointer; position: relative; }
.turn-chip.current { border: 2px solid var(--gold); box-shadow: 0 0 14px rgba(214, 168, 73, .35); }
.turn-chip.down { opacity: .45; }
.turn-chip.is-hidden { border-style: dashed; opacity: .7; }
.turn-chip .nm { font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: .15rem; }
.turn-chip .ini { position: absolute; top: -6px; right: -4px; background: var(--bg); border: 1px solid var(--border-2); border-radius: 99px; font-size: .68rem; padding: 0 .3rem; }
.tok-av { width: 44px; height: 44px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 700; background: #3a2f27 center/cover; border: 2px solid var(--border-2); }
.tok-av.pc { border-color: #4f8fd6; color: #b6dcff; background-color: #1b2838; }
.tok-av.monster { border-color: #c8423a; color: #ffb3aa; background-color: #3a1b18; }
.tok-av.npc { border-color: #d6a849; color: #ffe1a0; background-color: #3a2f17; }
.mini-hp { height: 4px; border-radius: 99px; background: #3a1b18; margin-top: .25rem; overflow: hidden; }
.mini-hp > span { display: block; height: 100%; background: #4caf6d; }
.mini-hp.mid > span { background: #e0a03a; } .mini-hp.low > span { background: #d94a3f; }

.map-scroll { overflow: auto; border-radius: 10px; border: 1px solid var(--border); background: #0e0c0b; max-height: max(300px, calc(100vh - 440px)); position: relative; touch-action: none; }
.map-board { position: relative; margin: 0 auto; background: #1d1915 center / 100% 100% no-repeat; user-select: none; -webkit-user-select: none; }
.map-grid { position: absolute; inset: 0; pointer-events: none; }
.map-range { position: absolute; border: 2px dashed rgba(76, 175, 109, .7); background: rgba(76, 175, 109, .08); border-radius: 6px; pointer-events: none; }
.map-range.attack { border-color: rgba(200, 66, 58, .7); background: rgba(200, 66, 58, .07); }
.token { position: absolute; display: grid; place-items: center; touch-action: none; transition: left .25s, top .25s; z-index: 2; }
.token.dragging { transition: none; z-index: 10; opacity: .85; }
.token .disc { width: 86%; height: 86%; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 700; background: #3a2f27 center/cover; border: 3px solid var(--border-2); box-shadow: 0 2px 8px rgba(0,0,0,.6); font-size: .9em; overflow: hidden; }
.token.pc .disc { border-color: #4f8fd6; background-color: #1b2838; color: #b6dcff; }
.token.monster .disc { border-color: #c8423a; background-color: #3a1b18; color: #ffb3aa; }
.token.npc .disc { border-color: #d6a849; background-color: #3a2f17; color: #ffe1a0; }
.token.current .disc { box-shadow: 0 0 0 3px var(--gold), 0 0 18px rgba(214, 168, 73, .7); }
.token.movable { cursor: grab; }
.token.targetable .disc { box-shadow: 0 0 0 3px #ff6b5e, 0 0 16px rgba(255, 107, 94, .6); cursor: crosshair; }
.token.targeted .disc { box-shadow: 0 0 0 4px #fff, 0 0 0 7px #ff6b5e; }
.token.selected .disc { outline: 3px solid #fff; outline-offset: 2px; }
.token.down .disc { filter: grayscale(1) brightness(.5); }
.token.is-hidden { opacity: .55; }
.token .tag { position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%); font-size: .62rem; background: rgba(0,0,0,.75); padding: 0 .3rem; border-radius: 4px; white-space: nowrap; max-width: 140%; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.token .chance { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); font-size: .68rem; font-weight: 700; background: #7a2c26; color: #fff; padding: 0 .3rem; border-radius: 4px; white-space: nowrap; pointer-events: none; }
.token .hpring { position: absolute; top: 2px; left: 12%; right: 12%; height: 4px; border-radius: 99px; background: rgba(0,0,0,.6); overflow: hidden; pointer-events: none; }
.token .hpring > span { display: block; height: 100%; background: #5cc47b; }
.drag-label { position: absolute; z-index: 20; background: rgba(0,0,0,.8); border: 1px solid var(--gold); color: var(--gold); padding: 0 .4rem; border-radius: 5px; font-size: .75rem; pointer-events: none; }
.float-txt { position: absolute; z-index: 30; font-family: var(--display); font-weight: 700; font-size: 1.3rem; pointer-events: none; text-shadow: 0 2px 4px #000, 0 0 8px #000; animation: floatUp 1.8s ease-out forwards; white-space: nowrap; }
.float-txt.dmg { color: #ff6b5e; } .float-txt.miss { color: #c9c0b3; font-size: 1.05rem; } .float-txt.heal { color: #6fe08f; } .float-txt.crit { color: #ffd166; font-size: 1.6rem; }
@keyframes floatUp { 0% { transform: translate(-50%, 0) scale(.8); opacity: 0; } 15% { transform: translate(-50%, -10px) scale(1.15); opacity: 1; } 100% { transform: translate(-50%, -48px) scale(1); opacity: 0; } }

.action-bar { position: relative; z-index: 5; margin-top: .8rem; background: linear-gradient(180deg, #221c18, #171310); border: 1px solid var(--border-2); border-radius: 12px; padding: .6rem .7rem; box-shadow: 0 -8px 24px rgba(0,0,0,.45); }
.econ { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.econ .pip2 { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; padding: .15rem .55rem; border-radius: 99px; border: 1px solid var(--border-2); color: var(--faint); }
.econ .pip2.on { color: #c9f5d5; border-color: #2f6b41; background: #1c3324; }
.econ .pip2.bonus.on { color: #ffe1a0; border-color: #6b5320; background: #3a2f17; }
.econ .pip2.react.on { color: #c9a6f5; border-color: #533d7a; background: #2a1f3a; }
.acards { display: flex; gap: .4rem; overflow-x: auto; padding: .45rem .1rem .2rem; scrollbar-width: thin; }
.acard { flex: none; width: 92px; min-height: 92px; padding: .4rem .3rem; border-radius: 10px; border: 1px solid var(--border-2); background: var(--panel-2); cursor: pointer; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .1rem; position: relative; font: inherit; color: var(--text); }
.acard:hover { border-color: var(--gold); }
.acard .ic { font-size: 1.5rem; line-height: 1.2; }
.acard .an { font-size: .74rem; font-weight: 600; line-height: 1.15; }
.acard .as { font-size: .68rem; color: var(--muted); line-height: 1.2; }
.acard .cost { position: absolute; top: 3px; left: 4px; width: 8px; height: 8px; border-radius: 50%; }
.acard .cost.action, .acard .cost.attack { background: #4caf6d; } .acard .cost.bonus { background: #d6a849; } .acard .cost.reaction { background: #9b6ad6; } .acard .cost.none { background: transparent; }
.acard.sel { border: 2px solid var(--gold); background: #3a2f17; }
.acard.off { opacity: .38; cursor: not-allowed; }
.agroup { flex: none; writing-mode: vertical-rl; transform: rotate(180deg); font-size: .62rem; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; padding: 0 .1rem; }
.target-chips { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .4rem; }
.cres { font-size: .86rem; padding: .1rem 0 .1rem .6rem; border-left: 2px solid var(--border-2); margin-top: .2rem; }
.event.combat { border-color: #5a3d2b; background: linear-gradient(90deg, rgba(214, 168, 73, .07), transparent 70%); }
.event.undone { opacity: .45; text-decoration: line-through; }
.feed.compact { height: 38vh; min-height: 220px; }
@media (max-width: 700px) {
  .acard { width: 78px; min-height: 84px; }
  .acard .ic { font-size: 1.3rem; }
  .map-scroll { max-height: 60vh; }
  .turn-chip { width: 62px; } .tok-av { width: 38px; height: 38px; }
}

/* ===== Karakter kağıdı ===== */
.sheet-head { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.sheet-head .portrait { width: 84px; height: 84px; border-radius: 12px; background: #3a2f27 center/cover; border: 2px solid var(--border-2); display: grid; place-items: center; font-family: var(--display); font-size: 2rem; color: var(--gold); flex: none; }
.sheet-head .title-input { color: var(--text); min-width: 0; font-family: var(--display); font-size: 1.6rem; font-weight: 700; background: transparent; border: 1px solid transparent; padding: .1rem .3rem; }
.sheet-head .title-input:hover { border-color: var(--border); }
.abilities { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .6rem; }
@media (max-width: 700px) { .abilities { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ability { text-align: center; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 10px; padding: .5rem .3rem .4rem; }
.ability .lbl { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ability .mod { font-family: var(--display); font-size: 1.7rem; font-weight: 700; cursor: pointer; line-height: 1.2; }
.ability .mod:hover { color: var(--gold); }
.ability input { width: 54px; text-align: center; padding: .1rem; font-size: .9rem; margin-top: .2rem; }
.big-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: .6rem; }
.big-stat { text-align: center; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 10px; padding: .45rem .3rem; }
.big-stat .v { font-family: var(--display); font-size: 1.45rem; font-weight: 700; }
.big-stat .l { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.big-stat.click { cursor: pointer; } .big-stat.click:hover { border-color: var(--gold); }
.sheet-grid { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); }
@media (max-width: 900px) {
  .sheet-grid { grid-template-columns: minmax(0, 1fr); }
  .sheet-grid > .sheet-tabs { order: -1; }
  .saves-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: .5rem; }
}
@media (max-width: 700px) {
  .row:not(.nowrap) > input.grow { flex-basis: 100%; }
  .sheet-head .stack { min-width: 0 !important; width: 100%; }
  .sheet-head .stack .row { justify-content: flex-start !important; }
  .hp-box .hpbar { width: 100% !important; }
  .hp-box > div:first-child { flex: 1; }
  .attack-row { grid-template-columns: minmax(0, 1fr) 56px 104px; }
}
.skill-row { display: flex; align-items: center; gap: .45rem; padding: .22rem .3rem; border-radius: 6px; font-size: .92rem; }
.skill-row:hover { background: rgba(255, 255, 255, .03); }
.skill-row .val { width: 34px; text-align: right; font-weight: 700; cursor: pointer; }
.skill-row .val:hover { color: var(--gold); }
.skill-row .ab { font-size: .7rem; color: var(--faint); width: 28px; }
.prof-toggle { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-2); cursor: pointer; flex: none; background: transparent; padding: 0; }
.prof-toggle.on { background: var(--gold); border-color: var(--gold); }
.prof-toggle.exp { background: var(--accent); border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }
.slot-pips { display: inline-flex; gap: .25rem; flex-wrap: wrap; }
.pip { width: 16px; height: 16px; border-radius: 4px; border: 2px solid var(--purple); background: transparent; cursor: pointer; padding: 0; }
.pip.used { background: transparent; border-color: #4a3b5c; }
.pip.full { background: var(--purple); }
.pip.track { border-color: var(--accent); } .pip.track.full { background: var(--accent); }
.hp-box { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.hp-box .cur { font-family: var(--display); font-size: 2rem; font-weight: 700; }
.item-row { display: flex; align-items: center; gap: .5rem; padding: .45rem .3rem; border-bottom: 1px solid var(--border); }
.item-row:last-child { border-bottom: 0; }
.item-row .nm { font-weight: 500; cursor: pointer; }
.item-row .nm:hover { color: var(--gold); }
.attack-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 110px; gap: .5rem; align-items: center; padding: .35rem .2rem; border-bottom: 1px solid var(--border); }

/* ===== Stat bloğu (canavar) ===== */
.statblock { background: #1d1814; border: 1px solid #5a3d2b; border-top: 4px solid var(--accent); border-bottom: 4px solid var(--accent); border-radius: 6px; padding: 1rem 1.1rem; }
.statblock h2 { color: #f0b9a8; margin-bottom: 0; }
.statblock .sub { font-style: italic; color: var(--muted); margin-bottom: .6rem; }
.statblock .rule { height: 2px; background: linear-gradient(90deg, var(--accent), transparent); margin: .6rem 0; }
.statblock .abil { display: grid; grid-template-columns: repeat(6, 1fr); text-align: center; gap: .3rem; }
.statblock .abil b { display: block; font-size: .75rem; color: #f0b9a8; }
.statblock h4 { color: #f0b9a8; border-bottom: 1px solid #5a3d2b; padding-bottom: .2rem; margin-top: 1rem; font-size: 1rem; }
.statblock .prop b { color: #f0b9a8; }
.rich p { margin: 0 0 .5em; }
.rich ul { padding-left: 1.2rem; margin: 0 0 .5em; }
.rich table { border-collapse: collapse; margin: .5rem 0; font-size: .9rem; }
.rich td, .rich th { border: 1px solid var(--border); padding: .25rem .5rem; }
.rich h1, .rich h2, .rich h3, .rich h4, .rich h5 { font-size: 1rem; margin-top: .8rem; }

/* ===== Giriş sayfası ===== */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.auth-card { width: 100%; max-width: 400px; }
.auth-logo { text-align: center; font-family: var(--display); font-size: 2rem; margin-bottom: 1rem; }
.auth-logo .d20 { color: var(--accent); }

.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty .ico { font-size: 2.2rem; margin-bottom: .4rem; }
.scroll-y { max-height: 420px; overflow-y: auto; }
.chip-input { display: flex; flex-wrap: wrap; gap: .3rem; }
.kbd { font-family: ui-monospace, monospace; font-size: .78rem; background: #2e2620; border: 1px solid var(--border-2); border-radius: 4px; padding: 0 .3rem; }
.sheet-head .portrait.click { cursor: pointer; } .sheet-head .portrait.click:hover { border-color: var(--gold); }

/* ---- Portre: dikey tam fotoğraf + yuvarlak yüz ---- */
.crop-back { z-index: 100; }
.crop-body { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 1rem; align-items: start; }
.crop-stage { position: relative; overflow: hidden; border-radius: 10px; background: #000; touch-action: none; user-select: none; cursor: crosshair; justify-self: center; max-width: 100%; }
.crop-stage img { display: block; max-width: 100%; max-height: 62vh; width: auto; height: auto; pointer-events: none; }
.crop-circle { position: absolute; border-radius: 50%; border: 2px solid var(--gold); box-shadow: 0 0 0 9999px rgba(0, 0, 0, .6); cursor: grab; }
.crop-circle:active { cursor: grabbing; }
.crop-previews { display: flex; align-items: flex-end; gap: .75rem; margin: .4rem 0 .6rem; }
.crop-prev { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--gold); background: #3a2f27 no-repeat; flex: none; }
.crop-prev.big { width: 110px; height: 110px; }
.crop-prev.sm { width: 34px; height: 34px; }
@media (max-width: 640px) { .crop-body { grid-template-columns: minmax(0, 1fr); } .crop-stage img { max-height: 50vh; } }
.photo-back { align-items: center; cursor: zoom-out; }
.photo-full { margin: 0; text-align: center; }
.photo-full img { max-width: min(92vw, 720px); max-height: 86vh; border-radius: 12px; border: 2px solid var(--gold); box-shadow: 0 20px 60px rgba(0, 0, 0, .7); }
.photo-full figcaption { color: var(--gold); font-family: var(--display); margin-top: .4rem; }
.sheet-head .portrait.tall { width: 92px; height: 138px; position: relative; background-position: center top; }
.sheet-head .portrait.tall .face-badge { position: absolute; right: -10px; bottom: -10px; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--gold); background: #3a2f27 center/cover; box-shadow: 0 2px 8px rgba(0, 0, 0, .6); cursor: pointer; }
.portrait-pair { display: flex; align-items: flex-end; gap: .75rem; }
.portrait-pair .full { width: 72px; height: 108px; border-radius: 10px; border: 2px solid var(--border-2); background: #3a2f27 center top/cover; display: grid; place-items: center; color: var(--gold); font-size: 1.6rem; cursor: zoom-in; }
.portrait-pair .face { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--gold); background: #3a2f27 center/cover; display: grid; place-items: center; color: var(--gold); }
.cc-portrait.tall { width: 96px; height: 144px; background-position: center top; }

/* ---- Savaş sahnesi: siper, bayılma, karşılaşmalar ---- */
.map-cover { position: absolute; z-index: 1; pointer-events: none; background: repeating-linear-gradient(45deg, rgba(214, 168, 73, .32) 0 4px, transparent 4px 9px); border: 1px solid rgba(214, 168, 73, .6); }
.map-cover.v5 { background: repeating-linear-gradient(45deg, rgba(110, 165, 255, .36) 0 4px, transparent 4px 8px); border-color: rgba(110, 165, 255, .75); }
.map-cover span { position: absolute; right: 2px; bottom: 0; font-size: .6rem; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000; }
.map-board.painting { cursor: cell; }
.map-board.painting .token { pointer-events: none; opacity: .55; }
.token .cover-badge { position: absolute; top: -7px; right: -8px; z-index: 3; font-size: .6rem; font-weight: 700; background: #213d26; color: #bff0c5; border: 1px solid #5cc47b; border-radius: 6px; padding: 0 .2rem; pointer-events: none; white-space: nowrap; }
.token .state-badge { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.35em; pointer-events: none; text-shadow: 0 2px 5px #000; z-index: 3; }
.token.dead .disc { filter: grayscale(1) brightness(.3); }
.token.ko .disc { filter: grayscale(.5) brightness(.6); }
.turn-chip .st { position: absolute; top: -7px; left: -4px; font-size: .85rem; }
.enc-rows { display: flex; flex-direction: column; gap: .4rem; }
.enc-row { display: flex; align-items: flex-end; gap: .4rem; flex-wrap: wrap; padding: .45rem .5rem; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); }
.enc-row .grow { min-width: 150px; }

/* ---- Zar tepsisi: zarlar kendi şekilleriyle ---- */
.dice-tray { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-bottom: .55rem; }
.dice-row { display: flex; align-items: center; gap: .3rem; }
.die-btn { --shape: inset(0 round 22%); position: relative; width: 42px; height: 42px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; transition: transform .12s; filter: drop-shadow(0 0 1px rgba(214, 168, 73, .55)) drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); }
.die-btn:hover { transform: translateY(-2px) rotate(-6deg); filter: drop-shadow(0 0 2px var(--gold)) drop-shadow(0 3px 5px rgba(0, 0, 0, .6)); }
.die-btn:active { transform: scale(.92) rotate(10deg); }
.die-btn .die-face { width: 100%; height: 100%; display: grid; place-items: center; clip-path: var(--shape); background: linear-gradient(145deg, #5a4430, #2c2119); color: #f6e7c8; font-family: var(--display); font-weight: 700; font-size: .95rem; }
.die-btn.s4 { --shape: polygon(50% 3%, 98% 94%, 2% 94%); } .die-btn.s4 .die-face { padding-top: 34%; font-size: .8rem; }
.die-btn.s6 { --shape: inset(7% round 18%); }
.die-btn.s8 { --shape: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.die-btn.s10 { --shape: polygon(50% 0, 100% 40%, 50% 100%, 0 40%); } .die-btn.s10 .die-face { padding-bottom: 12%; }
.die-btn.s12 { --shape: polygon(50% 0, 99% 36%, 80% 97%, 20% 97%, 1% 36%); } .die-btn.s12 .die-face { padding-top: 10%; }
.die-btn.s20 { --shape: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%); } .die-btn.s20 .die-face { background: linear-gradient(145deg, #8a2c24, #4a1612); }
.die-btn.s100 { --shape: polygon(50% 0, 100% 40%, 50% 100%, 0 40%); } .die-btn.s100 .die-face { background: linear-gradient(145deg, #3b4a5c, #1d2631); padding-bottom: 12%; }
.die-btn.custom { width: 34px; height: 34px; border: 1px dashed var(--border-2); border-radius: 8px; filter: none; font-size: .95rem; margin-left: .2rem; }
.die-btn.custom.on { border-color: var(--gold); background: rgba(214, 168, 73, .15); }
.tray-opts { display: flex; align-items: center; gap: .35rem; margin-left: auto; }
.seg { display: inline-flex; border: 1px solid var(--border-2); border-radius: 99px; overflow: hidden; background: var(--panel-2); }
.seg button { border: 0; background: none; color: var(--faint); font: inherit; font-size: .78rem; padding: .28rem .65rem; cursor: pointer; white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: rgba(214, 168, 73, .2); color: var(--gold); font-weight: 600; }
.seg button.adv.on { background: rgba(76, 175, 109, .22); color: #8de0a6; }
.seg button.dis.on { background: rgba(200, 66, 58, .25); color: #ff9d94; }
.seg.sm button { font-size: .72rem; padding: .18rem .5rem; }
.eye-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border-2); background: var(--panel-2); cursor: pointer; font-size: .95rem; }
.eye-btn.on { border-color: #4f8fd6; background: rgba(79, 143, 214, .2); }
@media (max-width: 640px) {
  .dice-row { width: 100%; justify-content: space-between; }
  .die-btn { width: 38px; height: 38px; }
  .tray-opts { width: 100%; justify-content: space-between; margin-left: 0; }
}

/* Sonuçtaki zarlar da şekilli; avantajda alınmayan zar soluk */
.die { --shape: inset(0 round 4px); display: inline-grid; place-items: center; min-width: 1.75em; height: 1.75em; padding: 0 .15em; margin: 0 .12em; border: 0; clip-path: var(--shape); background: #4a3a2c; color: #f6e7c8; font-weight: 700; font-size: .8rem; vertical-align: middle; }
.die.s4 { --shape: polygon(50% 0, 100% 100%, 0 100%); padding-top: .45em; min-width: 2em; }
.die.s6 { --shape: inset(0 round 22%); }
.die.s8, .die.s10 { --shape: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); min-width: 2em; height: 2em; }
.die.s12 { --shape: polygon(50% 0, 100% 38%, 81% 100%, 19% 100%, 0 38%); min-width: 1.95em; height: 1.95em; padding-top: .15em; }
.die.s20 { --shape: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); min-width: 2.1em; height: 1.85em; background: #7a2a22; }
.die.max { background: #2f7a48; color: #fff; }
.die.min { background: #8a2018; color: #fff; }
.die.drop { opacity: .55; text-decoration: line-through; filter: grayscale(.7); }
.die-note { font-size: .72rem; color: var(--faint); margin-left: .25rem; white-space: nowrap; }
.dice-mini .die { font-size: .7rem; }
.dice-mini > .faint { display: none; }

/* ---- Gerçek zar ---- */
.roll-ask-back { z-index: 110; align-items: center; }
.roll-ask { max-width: 420px; }
.ra-what { display: flex; align-items: center; gap: .8rem; margin-bottom: .8rem; }
.ra-what .die-btn { width: 54px; height: 54px; flex: none; }
.ra-what .die-btn .die-face { font-size: 1.05rem; }
.ra-main { font-size: 1rem; }
.ra-main .adv-t { color: #8de0a6; } .ra-main .dis-t { color: #ff9d94; }
.ra-inputs { display: flex; align-items: flex-end; gap: .5rem; flex-wrap: wrap; }
.ra-field { display: flex; flex-direction: column; gap: .15rem; margin: 0; }
.ra-field input { width: 96px; font-size: 1.6rem; font-weight: 700; text-align: center; padding: .35rem; font-family: var(--display); }
.pending-saves { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .6rem; }
.pending-save { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border-radius: 10px; border: 1px solid var(--border-2); background: var(--panel-2); }
.pending-save.mine { border: 2px solid var(--gold); background: linear-gradient(90deg, rgba(214, 168, 73, .18), transparent); animation: pulseGold 1.6s ease-in-out infinite; }
.pending-save .ps-icon { font-size: 1.5rem; }
@keyframes pulseGold { 50% { box-shadow: 0 0 16px rgba(214, 168, 73, .45); } }

/* ---- Seviye atlama ---- */
.xp-pill { display: inline-flex; align-items: center; gap: .35rem; margin-left: .4rem; font-size: .75rem; color: var(--faint); }
.xp-bar { width: 70px; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.xp-bar > span { display: block; height: 100%; background: linear-gradient(90deg, #b8862b, var(--gold)); }
.btn.glow { animation: pulseGold 1.6s ease-in-out infinite; }
.lvl-banner { border: 2px solid var(--gold); background: linear-gradient(90deg, rgba(214, 168, 73, .2), transparent); margin-bottom: .8rem; }
.lv-wiz section { padding: .2rem 0 .9rem; border-bottom: 1px solid var(--border); margin-bottom: .8rem; }
.lv-wiz section:last-child { border-bottom: 0; margin-bottom: 0; }
.lv-wiz h4 { margin: 0 0 .4rem; font-family: var(--display); color: var(--gold); }
.lv-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
.lv-choice { text-align: left; padding: .55rem .65rem; border-radius: 10px; border: 1px solid var(--border-2); background: var(--panel-2); color: inherit; cursor: pointer; display: flex; flex-direction: column; gap: .15rem; }
.lv-choice small { color: var(--faint); font-size: .75rem; }
.lv-choice.on { border: 2px solid var(--gold); background: rgba(214, 168, 73, .14); }
.lv-big { font-family: var(--display); font-size: 1.3rem; color: #8de0a6; margin-left: .6rem; }
.lv-feats { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .3rem; }
.lv-asi { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem .9rem; }
.lv-asi-row { display: flex; align-items: center; gap: .35rem; }
.lv-asi-row > span:first-child { width: 96px; }
.lv-asi-row b { width: 26px; text-align: center; font-size: 1.05rem; }
@media (max-width: 640px) { .lv-choices { grid-template-columns: minmax(0, 1fr); } .lv-asi { grid-template-columns: minmax(0, 1fr); } }

/* =====================================================================
   ORTAÇAĞ TEMASI — koyu taş masa, parşömen kartlar, mühür ve pirinç
   Fikir: parşömen yüzeylerde (kart, pencere, kağıt) renk değişkenleri mürekkep
   tonlarına döner; o değişkenleri kullanan her parça kendiliğinden uyum sağlar.
   ===================================================================== */
:root {
  --bg: #15110e;
  --bg-2: #1d1712;
  --panel: #241c15;
  --panel-2: #2d231a;
  --border: #3e3023;
  --border-2: #5a4430;
  --text: #efe2c6;
  --muted: #b9a585;
  --faint: #8a7658;
  --gold: #d9ae58;
  --font: "EB Garamond", "Garamond", Georgia, serif;
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --deco: "Cinzel Decorative", "Cinzel", Georgia, serif;
  --ink: #2b1c0e;
  --paper: #ecdcb9;
  --paper-2: #e2cfa4;
  --wax: #8b1e1e;
  --radius: 4px;
}

body {
  font-size: 16.5px;
  font-variant-numeric: lining-nums;
  background:
    radial-gradient(1400px 700px at 50% -20%, rgba(214, 150, 70, .16), transparent 60%),
    radial-gradient(circle at 50% 50%, transparent 55%, rgba(0, 0, 0, .55) 100%),
    url("../img/ui/stone.svg"),
    #1a1511;
  background-attachment: fixed;
}
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; letter-spacing: .03em; }
.page-head h1 {
  font-family: var(--deco); color: #ecd19a; letter-spacing: .04em;
  text-shadow: 0 2px 0 #000, 0 0 18px rgba(217, 174, 88, .25);
}
hr { border: 0; height: 14px; background: url("../img/ui/divider.svg") center / 240px 14px no-repeat; margin: 1rem 0; }
::selection { background: rgba(139, 30, 30, .35); }
* { scrollbar-width: thin; scrollbar-color: #6b4a2a transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: #6b4a2a; border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }

/* ---------- Üst menü: deri ve pirinç ---------- */
.topbar {
  background: linear-gradient(180deg, #3a2716 0%, #24180d 100%);
  border-bottom: 0;
  box-shadow: 0 2px 0 #0d0905, 0 3px 0 #a07a3a, 0 6px 16px rgba(0, 0, 0, .6);
  backdrop-filter: none;
}
.brand { font-family: var(--deco); color: #f0d79f; text-shadow: 0 1px 0 #000; }
.brand .d20 { color: #c0392b; filter: drop-shadow(0 0 4px rgba(192, 57, 43, .5)); }
.nav a { font-family: var(--display); font-size: .92rem; color: #cdb48a; border-radius: 3px; letter-spacing: .02em; }
.nav a:hover, .nav a.active { color: #fff1cf; background: rgba(0, 0, 0, .28); box-shadow: inset 0 -2px 0 #c9a050; }
.user-menu { color: #cdb48a; font-family: var(--display); font-size: .9rem; }

/* ---------- Düğmeler: deri, mühür mumu, pirinç ---------- */
.btn {
  font-family: var(--display); font-weight: 600; letter-spacing: .02em; font-size: .92em;
  border-radius: 3px; border: 1px solid #1f140a;
  background: linear-gradient(180deg, #5f4127 0%, #3d2914 100%);
  color: #f6e6c4;
  box-shadow: inset 0 1px 0 rgba(255, 230, 180, .18), 0 1px 2px rgba(0, 0, 0, .45);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .5);
}
.btn:hover { background: linear-gradient(180deg, #70502f 0%, #4a321a 100%); border-color: #1f140a; }
.btn.primary { background: linear-gradient(180deg, #a83228 0%, #6f1813 100%); border-color: #3f0b08; color: #fff0dc; }
.btn.primary:hover { background: linear-gradient(180deg, #bb3a2e 0%, #7d1c16 100%); }
.btn.gold { background: linear-gradient(180deg, #e2bb63 0%, #a87a2c 55%, #8a611f 100%); border-color: #5a3d10; color: #2a1806; text-shadow: 0 1px 0 rgba(255, 240, 200, .45); }
.btn.gold:hover { background: linear-gradient(180deg, #ecc874 0%, #b4852f 55%, #946823 100%); }
.btn.green { background: linear-gradient(180deg, #4d7a3e 0%, #2d4f22 100%); border-color: #17280f; color: #eef7dc; }
.btn.danger { background: transparent; border-color: #8b1e1e; color: #e98a7c; box-shadow: none; text-shadow: none; }
.btn.danger:hover { background: rgba(139, 30, 30, .18); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; text-shadow: none; color: var(--muted); }
.btn.ghost:hover { background: rgba(0, 0, 0, .12); color: var(--text); }
.btn.sm { border-radius: 3px; } .btn.xs { border-radius: 2px; font-size: .78rem; }
input[type=checkbox], input[type=radio] { accent-color: #8b1e1e; }

/* ---------- Parşömen yüzeyler ---------- */
.card, .modal, .toast, .auth-card > .card {
  --text: var(--ink);
  --muted: #5e4630;
  --faint: #7e6647;
  --panel: #f1e3c3;
  --panel-2: #e5d2a8;
  --bg-2: #e0cb9c;
  --border: rgba(96, 64, 30, .3);
  --border-2: rgba(96, 64, 30, .5);
  --gold: #8a5a12;
  --accent: #8b1e1e;
  --accent-2: #a52828;
  --green: #2f6b34;
  --blue: #2c5282;
  --purple: #5b3a82;
  --warn: #9a5b0e;
  color: var(--ink);
}
.card {
  position: relative;
  border: 1px solid #7a5527;
  border-radius: 3px;
  padding: 1.15rem 1.25rem;
  background:
    url("../img/ui/corner-tl.svg") left 3px top 3px / 34px no-repeat,
    url("../img/ui/corner-tr.svg") right 3px top 3px / 34px no-repeat,
    url("../img/ui/corner-bl.svg") left 3px bottom 3px / 34px no-repeat,
    url("../img/ui/corner-br.svg") right 3px bottom 3px / 34px no-repeat,
    radial-gradient(ellipse at center, transparent 55%, rgba(120, 78, 30, .28) 100%),
    url("../img/ui/paper-stain.svg") center / 900px,
    url("../img/ui/paper.svg"),
    var(--paper);
  box-shadow: inset 0 0 0 4px rgba(236, 220, 185, .6), inset 0 0 0 5px rgba(122, 85, 39, .45), 0 10px 26px rgba(0, 0, 0, .55), 0 2px 4px rgba(0, 0, 0, .4);
}
.card + .card { margin-top: 1.1rem; }
.card-title { border-bottom: 1px solid rgba(122, 85, 39, .35); padding-bottom: .45rem; }
.card-title h2, .card-title h3, .card h2, .card h3 { color: #6b1a12; }
.modal {
  border: 1px solid #7a5527; border-radius: 3px;
  background:
    url("../img/ui/corner-tl.svg") left 4px top 4px / 40px no-repeat,
    url("../img/ui/corner-tr.svg") right 4px top 4px / 40px no-repeat,
    url("../img/ui/corner-bl.svg") left 4px bottom 4px / 40px no-repeat,
    url("../img/ui/corner-br.svg") right 4px bottom 4px / 40px no-repeat,
    radial-gradient(ellipse at center, transparent 55%, rgba(120, 78, 30, .3) 100%),
    url("../img/ui/paper-stain.svg") center / 900px,
    url("../img/ui/paper.svg"),
    var(--paper);
  box-shadow: inset 0 0 0 5px rgba(236, 220, 185, .6), inset 0 0 0 6px rgba(122, 85, 39, .5), 0 24px 70px rgba(0, 0, 0, .75);
}
.modal-back { background: rgba(8, 5, 3, .72); }
.modal-head { border-bottom: 0; padding: 1rem 1.3rem .3rem; position: relative; }
.modal-head::after { content: ""; position: absolute; left: 1.3rem; right: 1.3rem; bottom: -6px; height: 14px; background: url("../img/ui/divider.svg") center / 240px 14px no-repeat, linear-gradient(rgba(122, 85, 39, .35), rgba(122, 85, 39, .35)) center / 100% 1px no-repeat; }
.modal-head h3 { color: #6b1a12; font-size: 1.15rem; }
.modal-body { padding: 1.1rem 1.3rem; }
.modal-foot { border-top: 1px solid rgba(122, 85, 39, .35); padding: .8rem 1.3rem; }
.toast { background: url("../img/ui/paper.svg"), var(--paper); border: 1px solid #7a5527; border-left: 5px solid #a07a3a; color: var(--ink); border-radius: 2px; box-shadow: 0 8px 24px rgba(0, 0, 0, .6); }
.toast.err { border-left-color: var(--wax); }

/* Parşömen üzerindeki form alanları */
.card :is(input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], select, textarea),
.modal :is(input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], select, textarea) {
  background: rgba(255, 251, 238, .55);
  border: 1px solid rgba(96, 64, 30, .45);
  border-radius: 2px;
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(96, 64, 30, .15);
}
.card :is(input, select, textarea):focus, .modal :is(input, select, textarea):focus { border-color: #8b1e1e; box-shadow: 0 0 0 2px rgba(139, 30, 30, .18); }
.card ::placeholder, .modal ::placeholder { color: rgba(94, 70, 48, .6); font-style: italic; }
label { font-family: var(--display); font-size: .8rem; letter-spacing: .03em; }
.check { font-family: var(--font); font-size: .95rem; letter-spacing: 0; }

/* Mürekkep damgası rozetler */
.card .badge, .modal .badge { background: rgba(255, 250, 235, .35); border: 1px solid rgba(96, 64, 30, .45); color: #5e4630; border-radius: 3px; font-family: var(--display); font-weight: 600; letter-spacing: .02em; }
.card .badge.red, .modal .badge.red { color: #8b1e1e; border-color: rgba(139, 30, 30, .55); background: rgba(139, 30, 30, .07); }
.card .badge.gold, .modal .badge.gold { color: #7a4f0e; border-color: rgba(138, 90, 18, .6); background: rgba(217, 174, 88, .18); }
.card .badge.green, .modal .badge.green { color: #2f6b34; border-color: rgba(47, 107, 52, .55); background: rgba(47, 107, 52, .08); }
.card .badge.blue, .modal .badge.blue { color: #2c5282; border-color: rgba(44, 82, 130, .5); background: rgba(44, 82, 130, .07); }
.card .badge.purple, .modal .badge.purple { color: #5b3a82; border-color: rgba(91, 58, 130, .5); background: rgba(91, 58, 130, .07); }
.card .alert.ok, .modal .alert.ok { background: rgba(47, 107, 52, .1); border-color: rgba(47, 107, 52, .45); color: #24502a; }
.card .alert.err, .modal .alert.err, .card .alert.error, .modal .alert.error { background: rgba(139, 30, 30, .08); border-color: rgba(139, 30, 30, .45); color: #7a1a14; }
.card .alert.info, .modal .alert.info { background: rgba(122, 85, 39, .1); border-color: rgba(122, 85, 39, .45); color: #4a3218; }
.alert { border-radius: 3px; }
.card .rarity-common, .modal .rarity-common { color: #4a3a2a; } .card .rarity-uncommon, .modal .rarity-uncommon { color: #2f7a35; }
.card .rarity-rare, .modal .rarity-rare { color: #2457a0; } .card .rarity-very-rare, .modal .rarity-very-rare { color: #6b34a8; }
.card .rarity-legendary, .modal .rarity-legendary { color: #b0600b; } .card .rarity-artifact, .modal .rarity-artifact { color: #a52a1a; }
.card .error, .modal .error { color: #8b1e1e; }
.card a:not(.btn), .modal a:not(.btn) { color: #7a2a12; }
.card .list-item:hover, .modal .list-item:hover { background: rgba(122, 85, 39, .07); }
.card .table th, .modal .table th { font-family: var(--display); color: #6b1a12; }
.card .roll-result, .modal .roll-result { color: var(--ink); }
.card .roll-result.crit { color: #2f7a35; text-shadow: none; } .card .roll-result.fumble { color: #a52a1a; }
.card .dice-link, .modal .dice-link { background: rgba(139, 30, 30, .08); color: #7a1a14; border-color: rgba(139, 30, 30, .4); }

/* Sekmeler: yer imi şeritleri */
.tabs { border-bottom: 1px solid rgba(122, 85, 39, .4); gap: .3rem; }
.tabs button { font-family: var(--display); font-weight: 600; letter-spacing: .02em; border-radius: 3px 3px 0 0; }
.tabs button.active { color: #6b1a12; border-bottom: 3px solid var(--wax); background: rgba(122, 85, 39, .1); }

/* Akış (olay günlüğü) bir parşömen tomarı gibi */
.card .event { background: rgba(255, 250, 235, .3); border: 1px solid rgba(122, 85, 39, .18); border-radius: 3px; }
.card .event.roll { background: linear-gradient(90deg, rgba(139, 30, 30, .09), transparent 70%); border-color: rgba(122, 85, 39, .28); border-left: 3px solid rgba(139, 30, 30, .6); }
.card .event.system { background: transparent; border: 0; color: #6a5338; }
.card .event.whisper { background: rgba(91, 58, 130, .08); border-color: rgba(91, 58, 130, .4); }
.card .event.mine { background: rgba(217, 174, 88, .14); }
.card .event .who { color: #7a2a12; font-family: var(--display); }

/* Parşömen içindeki küçük kutular */
.card :is(.party-card, .stat-pill, .ability, .big-stat, .cc-score, .cc-mini-abil > div, .combatant, .choice, .cc-skill, .cc-spell, .cc-abil-row, .prop-row, .enc-row, .pending-save, .lv-choice, .turn-chip) {
  background: rgba(255, 250, 235, .38);
  border-color: rgba(96, 64, 30, .38);
  border-radius: 3px;
}
.card .party-card { box-shadow: inset 0 0 0 1px rgba(255, 250, 235, .35); }
.card :is(.ability, .big-stat) { box-shadow: inset 0 0 0 3px rgba(255, 250, 235, .4), inset 0 0 0 4px rgba(96, 64, 30, .25); }
.card .combatant.monster .cname { color: #8b1e1e; } .card .combatant.pc .cname { color: #2c5282; }
.card .choice.on, .card .cc-card.on, .modal .lv-choice.on { background: rgba(217, 174, 88, .28); border: 2px solid #8a5a12; box-shadow: 0 0 0 3px rgba(217, 174, 88, .18); }
.card .cc-skill.locked { background: rgba(44, 82, 130, .08); border-color: rgba(44, 82, 130, .45); }
.card .cc-spell.on { background: rgba(91, 58, 130, .1); border-color: #5b3a82; }
.card .turn-chip.current { border: 2px solid #8a5a12; box-shadow: 0 0 0 3px rgba(217, 174, 88, .3); }
.card .item-summary, .item-summary { background: url("../img/ui/paper.svg"), #e9d6aa; border: 2px solid #8a5a12; }
.card .kbd { background: rgba(255, 250, 235, .5); color: var(--ink); }
.card .hpbar { background: rgba(139, 30, 30, .25); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25); }
.card .seg, .modal .seg { background: rgba(255, 250, 235, .45); border-color: rgba(96, 64, 30, .45); }
.card .seg button.on { background: rgba(217, 174, 88, .35); color: #5a3a08; }
.card .seg button.adv.on { background: rgba(47, 107, 52, .18); color: #24502a; }
.card .seg button.dis.on { background: rgba(139, 30, 30, .15); color: #7a1a14; }
.card .eye-btn { background: rgba(255, 250, 235, .45); border-color: rgba(96, 64, 30, .45); }
.card .die-note, .modal .die-note { color: #6a5338; }
.card .xp-bar { background: rgba(96, 64, 30, .2); }
.card .lvl-banner, .lvl-banner { color: var(--ink); }

/* Karakter oluşturma kartları */
.cc-card { border-radius: 3px; }
.card .cc-card { background: rgba(255, 250, 235, .4); border: 1px solid rgba(96, 64, 30, .4); }
.card .cc-card:hover { border-color: #8a5a12; }
.cc-card b, .choice b { color: #4a1c10; }
.cc-step { font-family: var(--display); border-radius: 3px; background: linear-gradient(180deg, #3a2716, #24180d); border-color: #4a3420; color: #e6d2a6; }
.cc-step small { font-family: var(--font); color: #b9a585; }
.cc-step.on { background: linear-gradient(180deg, #5a3d1f, #3a2614); border-color: #c9a050; }
.cc-step .n { background: rgba(0, 0, 0, .3); border-color: #6b4a2a; }
.cc-step.on .n { background: #d9ae58; color: #2a1806; }
.cc-step.done .n { background: #2d4f22; border-color: #4d7a3e; color: #dff2cc; }

/* Karakter kağıdı başlığı */
.sheet-head .title-input { color: #4a1c10; font-family: var(--deco); }
.ability .mod, .big-stat .v, .hp-box .cur, .cc-score b { color: #3a1d0e; }

/* ---------- Canavar bloğu: klasik 5e görünümü ---------- */
.statblock {
  background: url("../img/ui/paper.svg"), #f6ead0;
  color: #2b1c0e;
  border: 1px solid #c9a46a;
  border-top: 5px solid #7a200d; border-bottom: 5px solid #7a200d;
  border-radius: 2px;
  box-shadow: 0 0 0 1px #e8cf9c, 0 6px 18px rgba(0, 0, 0, .35);
  --text: #2b1c0e; --muted: #5e4630; --faint: #7e6647; --border: rgba(122, 32, 13, .35);
}
.statblock h2 { color: #7a200d; font-family: var(--deco); }
.statblock .sub { color: #5e4630; }
.statblock .rule { height: 3px; background: linear-gradient(90deg, #7a200d, rgba(122, 32, 13, .1)); }
.statblock .abil b, .statblock .prop b, .statblock h4 { color: #7a200d; }
.statblock h4 { border-bottom-color: #7a200d; font-family: var(--display); }

/* ---------- Koyu kalan alanlar: harita ve aksiyon çubuğu ---------- */
.map-scroll { border: 1px solid #0d0905; box-shadow: inset 0 0 30px rgba(0, 0, 0, .8), 0 0 0 3px #3a2716, 0 0 0 4px #a07a3a, 0 10px 26px rgba(0, 0, 0, .6); border-radius: 3px; }
.action-bar {
  background: linear-gradient(180deg, #3a2716 0%, #1f150c 100%);
  border: 1px solid #0d0905; border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, .12), 0 0 0 1px #a07a3a, 0 -8px 24px rgba(0, 0, 0, .5);
}
.mobile-tabs { background: transparent; }
.mobile-tabs .btn { flex: 1; }

/* Giriş sayfası */
.auth-logo { font-family: var(--deco); color: #ecd19a; text-shadow: 0 2px 0 #000, 0 0 18px rgba(217, 174, 88, .3); font-size: 2.1rem; }
.auth-logo .d20 { color: #c0392b; }
.empty { color: var(--muted); font-style: italic; }
.card .turn-chip .ini { background: linear-gradient(180deg, #5f4127, #3d2914); color: #f6e6c4; border-color: #1f140a; font-family: var(--display); font-weight: 700; }
.card .btn.danger, .modal .btn.danger { color: #8b1e1e; border-color: rgba(139, 30, 30, .6); }
.card .btn.danger:hover, .modal .btn.danger:hover { background: rgba(139, 30, 30, .1); }
.card .btn.ghost, .modal .btn.ghost { color: #5e4630; }
.card .btn.ghost:hover, .modal .btn.ghost:hover { background: rgba(122, 85, 39, .12); color: var(--ink); }
/* Seçim kartları (ırk, sınıf, geçmiş…) her yerde küçük parşömen kartlar */
.cc-card, .cc-skill, .cc-spell, .cc-abil-row {
  --text: var(--ink); --muted: #5e4630; --faint: #6e5538; --gold: #8a5a12; --border: rgba(96, 64, 30, .3); --border-2: rgba(96, 64, 30, .5);
  --panel: #f1e3c3; --panel-2: #e5d2a8; --purple: #5b3a82; --blue: #2c5282;
  color: var(--ink);
  background: radial-gradient(ellipse at center, transparent 50%, rgba(120, 78, 30, .22) 100%), url("../img/ui/paper.svg"), var(--paper) !important;
  border: 1px solid #7a5527 !important;
  box-shadow: inset 0 0 0 3px rgba(236, 220, 185, .55), inset 0 0 0 4px rgba(122, 85, 39, .35), 0 4px 10px rgba(0, 0, 0, .45);
}
.cc-card:hover, .cc-skill:hover, .cc-spell:hover { border-color: #c9a050 !important; transform: translateY(-2px); }
.cc-card.on, .cc-skill.on, .cc-spell.on, .cc-abil-row.primary {
  background: radial-gradient(ellipse at center, rgba(217, 174, 88, .25) 30%, rgba(120, 78, 30, .25) 100%), url("../img/ui/paper.svg"), #efd9a6 !important;
  border: 2px solid #8b1e1e !important;
  box-shadow: inset 0 0 0 3px rgba(236, 220, 185, .5), 0 0 0 3px rgba(217, 174, 88, .45), 0 6px 16px rgba(0, 0, 0, .5);
}
.cc-skill.locked { border-color: #2c5282 !important; }
.cc-skill.off, .cc-spell.off { opacity: .5; }
.card { --faint: #6e5538; }
.cc-main > h2, .cc-main > section > h2 { color: #ecd19a; text-shadow: 0 2px 0 #000; }
@media (max-width: 1200px) { .cc-side { position: static; } }

/* ---- Irk / sınıf kart görselleri ---- */
.cc-card.art { padding: 0 0 .65rem; overflow: hidden; gap: .25rem; }
.cc-card.art > :not(.cc-art) { margin-left: .75rem; margin-right: .75rem; }
.cc-art {
  display: block; width: 100%; aspect-ratio: 4 / 4.2; margin-bottom: .35rem;
  background: #1a1410 center 18% / cover no-repeat;
  border-bottom: 2px solid #7a5527;
  box-shadow: inset 0 -30px 30px -18px rgba(20, 12, 6, .65), inset 0 0 0 1px rgba(0, 0, 0, .4);
  filter: saturate(.92) sepia(.08);
  transition: filter .2s, background-size .3s;
}
.cc-cards.small .cc-art { aspect-ratio: 4 / 3.4; background-position: center 14%; }
.cc-card.art:hover .cc-art { filter: saturate(1.05) brightness(1.05); }
.cc-card.art.on .cc-art { filter: none; border-bottom-color: #8b1e1e; }
.cc-card.art b { font-size: 1.05rem; }

/* =====================================================================
   3D zar ekranı (BG3 tarzı)
   ===================================================================== */
.d3-back { position: fixed; inset: 0; z-index: 120; display: none; align-items: center; justify-content: center; padding: 1rem;
  background: radial-gradient(circle at 50% 48%, rgba(40, 22, 10, .55) 0%, rgba(5, 3, 2, .9) 62%); backdrop-filter: blur(2px); }
.d3-back.open { display: flex; animation: d3fade .25s ease-out; }
@keyframes d3fade { from { opacity: 0; } to { opacity: 1; } }
.d3-box { display: flex; flex-direction: column; align-items: center; gap: .45rem; text-align: center; color: #f0dfb8; max-width: 520px; width: 100%; user-select: none; }
.d3-title { font-family: var(--display); font-size: 1.15rem; letter-spacing: .06em; color: #ecd19a; text-shadow: 0 2px 0 #000; }
.d3-target { display: inline-flex; flex-direction: column; align-items: center; min-width: 120px; padding: .35rem 1.2rem .4rem; margin-top: .2rem;
  border: 1px solid #a07a3a; background: linear-gradient(180deg, rgba(58, 39, 22, .92), rgba(28, 18, 10, .92)); box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .35), 0 0 0 1px #000; border-radius: 3px; }
.d3-target small { font-family: var(--display); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: #cdb48a; }
.d3-target b { font-family: var(--deco); font-size: 2rem; line-height: 1; color: #fff1cf; }
.d3-stage { position: relative; cursor: grab; touch-action: none; display: grid; place-items: center;
  background: radial-gradient(circle, rgba(217, 174, 88, .16) 0%, rgba(217, 174, 88, .05) 42%, transparent 64%); border-radius: 50%; }
.d3-stage::before { content: ""; position: absolute; inset: 7%; border-radius: 50%; border: 1px solid rgba(217, 174, 88, .45); box-shadow: 0 0 0 6px rgba(217, 174, 88, .06), inset 0 0 40px rgba(217, 174, 88, .12); pointer-events: none; }
.d3-stage::after { content: ""; position: absolute; inset: 12%; border-radius: 50%; border: 1px dashed rgba(217, 174, 88, .22); pointer-events: none; }
.d3-stage:active { cursor: grabbing; }
.d3-canvas { position: relative; z-index: 2; width: 100%; height: 100%; display: block; }
.d3-floor { position: absolute; left: 30%; right: 30%; bottom: 17%; height: 9%; border-radius: 50%; background: radial-gradient(ellipse, rgba(0, 0, 0, .65), transparent 70%); z-index: 1; }
.d3-box.rolling .d3-floor { animation: d3shadow .28s ease-in-out infinite alternate; }
@keyframes d3shadow { to { transform: scale(.75); opacity: .6; } }
.d3-fallback { position: relative; z-index: 2; font-family: var(--deco); font-size: 4.5rem; color: #f3d58c; text-shadow: 0 3px 0 #3a0c08, 0 0 20px rgba(217, 174, 88, .4); }
.d3-fallback.spin { animation: d3wobble .25s linear infinite; }
@keyframes d3wobble { 50% { transform: rotate(14deg) scale(1.08); } }
.d3-mode { font-size: .9rem; font-family: var(--display); letter-spacing: .03em; }
.d3-mode.adv { color: #9fe0a2; } .d3-mode.dis { color: #ff9d8c; }
.d3-sum { height: 0; overflow: visible; }
.d3-sum.show { height: auto; }
.d3-total { display: inline-block; font-family: var(--deco); font-size: 3.2rem; line-height: 1; color: #fff1cf; text-shadow: 0 3px 0 #000, 0 0 24px rgba(217, 174, 88, .5); }
.d3-total.bump { animation: d3bump .3s ease-out; }
@keyframes d3bump { 40% { transform: scale(1.25); color: #ffd36b; } }
.d3-sum.nat20 .d3-total { color: #ffe08a; text-shadow: 0 3px 0 #000, 0 0 30px rgba(255, 210, 90, .9); }
.d3-sum.nat1 .d3-total { color: #ff8a7a; }
.d3-parts { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; }
.d3-part { font-size: .9rem; padding: .18rem .6rem; border-radius: 3px; border: 1px solid rgba(217, 174, 88, .45); background: rgba(30, 20, 12, .8); color: #e6d2a6; transition: all .25s; }
.d3-part b { font-family: var(--display); color: #ffe1a0; }
.d3-part.added { border-color: #d9ae58; background: rgba(217, 174, 88, .22); box-shadow: 0 0 12px rgba(217, 174, 88, .35); }
.d3-part.muted { opacity: .6; font-style: italic; }
.d3-outcome { font-family: var(--deco); font-size: 1.9rem; letter-spacing: .08em; min-height: 2.3rem; opacity: 0; transform: scale(.7); transition: all .35s cubic-bezier(.2, 1.6, .4, 1); text-shadow: 0 3px 0 #000; }
.d3-outcome.show { opacity: 1; transform: none; }
.d3-outcome.ok { color: #9fe0a2; } .d3-outcome.fail { color: #ff8a7a; } .d3-outcome.neutral { color: #ecd19a; font-size: 1.4rem; }
.d3-outcome.crit { color: #ffd36b; text-shadow: 0 3px 0 #000, 0 0 26px rgba(255, 200, 80, .9); }
.d3-outcome.fumble { color: #ff5c48; animation: d3shake .4s; }
@keyframes d3shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.d3-box.done.crit .d3-stage { animation: d3glow 1.2s ease-in-out infinite alternate; }
@keyframes d3glow { to { box-shadow: 0 0 60px 10px rgba(255, 200, 80, .35); } }
.d3-after { font-family: var(--display); font-size: 1.15rem; color: #ffcf9a; opacity: 0; transition: opacity .3s; }
.d3-after.show { opacity: 1; }
.d3-hint { font-size: .85rem; color: #b9a585; font-style: italic; min-height: 1.2rem; animation: d3pulse 1.6s ease-in-out infinite; }
@keyframes d3pulse { 50% { opacity: .45; } }
@media (max-width: 640px) { .d3-total { font-size: 2.6rem; } .d3-outcome { font-size: 1.5rem; } .d3-title { font-size: 1rem; } }

/* Diğer oyuncuların atışı: köşede küçük zar */
.mini-rolls { position: fixed; left: 1rem; bottom: 1rem; z-index: 90; display: flex; flex-direction: column; gap: .4rem; pointer-events: none; }
.mini-roll { display: flex; align-items: center; gap: .55rem; padding: .4rem .75rem .4rem .45rem; min-width: 210px; max-width: 320px;
  background: url("../img/ui/paper.svg"), var(--paper); color: var(--ink); border: 1px solid #7a5527; border-radius: 3px; box-shadow: 0 8px 22px rgba(0, 0, 0, .6); animation: slideInL .25s ease-out; }
@keyframes slideInL { from { transform: translateX(-20px); opacity: 0; } }
.mini-roll .md { width: 34px; height: 34px; flex: none; display: grid; place-items: center; font-family: var(--display); font-weight: 700; color: #f3d58c;
  background: linear-gradient(145deg, #9b2a20, #5a120d); clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); }
.mini-roll .md.spin { animation: miniSpin .7s cubic-bezier(.2, .8, .3, 1); }
@keyframes miniSpin { from { transform: rotate(-540deg) scale(.4); } }
.mini-roll .mt { font-size: .85rem; line-height: 1.25; }
.mini-roll .mt b { font-family: var(--display); color: #6b1a12; }
.mini-roll .ok { color: #2f6b34; font-weight: 700; } .mini-roll .fail { color: #8b1e1e; font-weight: 700; } .mini-roll .crit { color: #a86b00; font-weight: 700; }
@media (max-width: 640px) { .mini-rolls { left: .5rem; right: .5rem; bottom: .5rem; } .mini-roll { max-width: none; } }
.d3-back { overflow-y: auto; }
.d3-box { gap: .3rem; }
@media (max-height: 640px) {
  .d3-title { font-size: .95rem; }
  .d3-target { padding: .15rem 1rem .2rem; } .d3-target b { font-size: 1.5rem; } .d3-target small { font-size: .62rem; }
  .d3-total { font-size: 2.3rem; } .d3-outcome { font-size: 1.35rem; min-height: 1.7rem; }
  .d3-after { font-size: 1rem; } .d3-part { font-size: .8rem; padding: .1rem .45rem; }
}

/* ---- Eylem açıklama balonu ---- */
.a-tip { position: fixed; z-index: 70; width: 320px; transform: translateY(calc(-100% - 8px)); pointer-events: none;
  padding: .6rem .75rem; border: 1px solid #7a5527; border-radius: 3px; color: var(--ink);
  background: url("../img/ui/paper.svg"), var(--paper); box-shadow: 0 10px 30px rgba(0, 0, 0, .65), inset 0 0 0 3px rgba(236, 220, 185, .55);
  --text: var(--ink); --muted: #5e4630; --border: rgba(96, 64, 30, .3); font-size: .86rem; }
.a-tip b { font-family: var(--display); color: #4a1c10; }
.a-tip .badge { background: rgba(255, 250, 235, .45); border: 1px solid rgba(96, 64, 30, .45); color: #5e4630; border-radius: 3px; }
.a-tip ul, .a-info { margin: .35rem 0 0; padding-left: 1.05rem; }
.a-tip li, .a-info li { margin: .12rem 0; }
.a-tip p { margin: .4rem 0 0; color: #5e4630; font-style: italic; font-size: .82rem; border-top: 1px solid rgba(96, 64, 30, .25); padding-top: .3rem; }
.a-tip-warn { margin-top: .3rem; color: #8b1e1e; font-weight: 600; font-size: .82rem; }
.a-tip-ok { margin-top: .3rem; color: #2f6b34; font-weight: 600; font-size: .82rem; }
.a-info { font-size: .8rem; color: #e6d2a6; margin-bottom: .3rem; }
.acard.info { border-style: dashed; opacity: .85; }
.save-head { font-size: .8rem; font-weight: 600; color: #2c4f7c; margin: .1rem 0 .15rem; }
.card .save-head { color: #2c5282; }
@media (max-width: 640px) { .a-tip { display: none; } }
/* Üst menü taşarsa kaydırma çubuğu görünmesin (yine kaydırılabilir) */
.nav { scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
