/* Roleplay
   Ekran bir oyun masasıdır: ortada keçe (harita), kenarlarda ceviz ahşap (paneller),
   pirinç aksesuarlar (etkileşim). Cesur iki öğe var: çokyüzlü zarlar ve Fallout'taki gibi
   yanan enerji ışıkları. Gerisi sakin kalır. */

:root {
  --felt: #1c332c;
  --felt-deep: #12231e;
  --wood: #241a14;
  --wood-2: #2e231b;
  --wood-3: #3b2d23;
  --rule: #4a3a2d;
  --bone: #ede4d1;
  --bone-dim: #b9ad96;
  --bone-faint: #9a8e77;
  --brass: #c9a24a;
  --brass-hi: #e2c071;
  --ink: #1b130e;
  --ember: #c9503b;
  --ember-hi: #f08a73;

  --serif: "Alegreya", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Alegreya Sans", "Gill Sans", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --topbar-h: 56px;
  --side-w: 360px;
  --gm-w: 300px;

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
}
body {
  background: var(--felt-deep);
  color: var(--bone);
  font: 400 15px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
[hidden] {
  display: none !important;
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}
::selection {
  background: rgba(201, 162, 74, 0.35);
}
:focus-visible {
  outline: 2px solid var(--brass-hi);
  outline-offset: 2px;
}
b {
  color: var(--bone);
  font-weight: 700;
}
a {
  color: var(--brass-hi);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--bone);
}

.felt {
  background-color: var(--felt);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .2 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(120% 95% at 50% 42%, var(--felt) 0%, var(--felt-deep) 100%);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------- düğmeler ve alanlar */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--wood-2);
  color: var(--bone);
  font: 500 15px/1 var(--sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.btn:hover {
  background: var(--wood-3);
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}
.btn-sm {
  height: 32px;
  padding: 0 11px;
  font-size: 14px;
}
.btn-lg {
  height: 46px;
  font-size: 16px;
}
.btn-block {
  width: 100%;
}
.btn-primary {
  background: var(--brass);
  border-color: var(--brass);
  color: var(--ink);
  font-weight: 700;
}
.btn-primary:hover {
  background: var(--brass-hi);
  border-color: var(--brass-hi);
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--bone-dim);
}
.btn-ghost:hover {
  background: var(--wood-2);
  color: var(--bone);
}
.btn-danger {
  background: transparent;
  border-color: rgba(201, 80, 59, 0.55);
  color: var(--ember-hi);
}
.btn-danger:hover {
  background: rgba(201, 80, 59, 0.14);
}
.btn-felt {
  background: rgba(0, 0, 0, 0.22);
  border-color: rgba(237, 228, 209, 0.16);
}
.btn-felt:hover {
  background: rgba(0, 0, 0, 0.34);
  border-color: rgba(226, 192, 113, 0.5);
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--bone-dim);
  font: 500 15px/1 var(--sans);
  cursor: pointer;
}
.icon-btn:hover {
  border-color: var(--rule);
  background: var(--wood-3);
  color: var(--bone);
}
.icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--wood-2);
  color: var(--bone);
  font: 400 15px/1.2 var(--sans);
}
.input::placeholder {
  color: var(--bone-faint);
}
.input:focus {
  border-color: var(--brass);
  outline: none;
  box-shadow: 0 0 0 1px var(--brass);
}
.input-felt {
  height: 32px;
  border-color: rgba(237, 228, 209, 0.16);
  background: rgba(0, 0, 0, 0.25);
}
select.input {
  padding-right: 6px;
}
textarea.input {
  height: auto;
  padding: 10px;
  resize: vertical;
}
input[type="range"],
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--brass);
}
input[type="range"] {
  width: 100%;
  margin: 2px 0;
}
input[type="checkbox"] {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.field-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--bone-dim);
  font-size: 14px;
}
.field-label output {
  color: var(--bone);
  font-variant-numeric: tabular-nums;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--bone);
  font-size: 14px;
  cursor: pointer;
}
.hint {
  margin: 0;
  color: var(--bone-faint);
  font-size: 13px;
  line-height: 1.45;
}
.form-error {
  margin: 0;
  color: var(--ember-hi);
  font-size: 14px;
}
.form-error:empty {
  display: none;
}
.row-2 {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.row-2 > .btn {
  flex: 1 1 auto;
}
.row-2 > .field {
  flex: 1 1 100px;
  min-width: 0;
}

.mark {
  display: block;
  color: var(--brass);
}
.mark-num {
  fill: currentColor;
  font: 800 11px var(--serif);
}

/* ---------------------------------------------------------------- giriş */

.boot {
  position: fixed;
  inset: 0;
}
.login {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 16px;
}
.login-card {
  display: grid;
  gap: 16px;
  width: min(100%, 380px);
  padding: 30px 28px 24px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--wood);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.login-mark {
  width: 58px;
  height: 58px;
}
.login-head {
  display: grid;
  gap: 4px;
}
.login-title {
  margin: 0;
  font: 700 36px/1.05 var(--serif);
  overflow-wrap: anywhere;
}
.login-sub {
  margin: 0;
  color: var(--bone-dim);
  font-size: 16px;
}
.login-fields {
  display: grid;
  gap: 14px;
}
.login-note {
  margin: 0;
  color: var(--bone-dim);
  font-size: 15px;
  line-height: 1.5;
}

/* ---------------------------------------------------------------- düzen */

.app {
  display: grid;
  height: 100vh;
  height: 100dvh;
  grid-template-columns: minmax(0, 1fr) var(--side-w);
  grid-template-rows: var(--topbar-h) minmax(0, 1fr);
  grid-template-areas:
    "top top"
    "board side";
}
.app.is-gm {
  grid-template-columns: var(--gm-w) minmax(0, 1fr) var(--side-w);
  grid-template-areas:
    "top top top"
    "gm board side";
}
.app:not(.is-gm) .gm-only {
  display: none !important;
}
.app.is-gm .oyuncu-only {
  display: none !important;
}

.topbar {
  display: flex;
  grid-area: top;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 0 12px 0 18px;
  border-bottom: 1px solid var(--rule);
  background: var(--wood);
}
.scene-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--bone);
  font: 700 23px/1.15 var(--serif);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.presence {
  display: flex;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
}
.who-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 11px 0 9px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--wood-2);
  color: var(--bone-dim);
  font-size: 14px;
  white-space: nowrap;
}
.who-chip::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c);
}
.who-chip.is-me {
  color: var(--bone);
}
.badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--brass);
  color: var(--ink);
  font: 700 12px/1 var(--sans);
}

/* ---------------------------------------------------------------- harita */

.board {
  position: relative;
  grid-area: board;
  min-width: 0;
  overflow: hidden;
}
.viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  outline: none;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.viewport.can-walk {
  cursor: crosshair;
}
.viewport.can-attack {
  cursor: pointer;
}
.viewport.is-panning {
  cursor: grabbing;
}
.viewport:focus-visible {
  box-shadow: inset 0 0 0 2px var(--brass-hi);
}
.viewport.is-pointer-focus:focus-visible {
  box-shadow: none;
}
.world {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
}
.map-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: var(--felt-deep);
  box-shadow: 0 calc(14px * var(--inv, 1)) calc(50px * var(--inv, 1)) rgba(0, 0, 0, 0.55);
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity 0.25s;
}
.world.is-loading .map-img {
  opacity: 0;
}
.grid {
  --line: calc(1px * var(--inv, 1));
  --gc: #0d0906;
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--gc) var(--line), transparent var(--line)),
    linear-gradient(to bottom, var(--gc) var(--line), transparent var(--line));
  background-size: var(--cell, 70px) var(--cell, 70px);
  pointer-events: none;
}
.grid.is-light {
  --gc: #fffaf0;
}
.tokens,
.labels,
.effects,
.pings {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.fog {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

/* Yollar, hedefler, görüş halkaları (SVG, dünya koordinatlarında) */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
  pointer-events: none;
}
.overlay line,
.overlay circle {
  fill: none;
  stroke-linecap: round;
}
.vision-ring {
  stroke: var(--rc, var(--bone));
  stroke-width: calc(2px * var(--inv, 1));
  stroke-dasharray: calc(5px * var(--inv, 1)) calc(7px * var(--inv, 1));
  opacity: 0.55;
}
.path-line {
  stroke: var(--brass-hi);
  stroke-width: calc(3px * var(--inv, 1));
  stroke-dasharray: calc(1px * var(--inv, 1)) calc(9px * var(--inv, 1));
}
.path-line.is-preview {
  stroke-width: calc(4px * var(--inv, 1));
}
.path-line.is-request {
  stroke: var(--bone);
  stroke-dasharray: calc(10px * var(--inv, 1)) calc(7px * var(--inv, 1));
  stroke-width: calc(2.5px * var(--inv, 1));
}
.attack-line {
  stroke: var(--ember-hi);
  stroke-width: calc(3px * var(--inv, 1));
  stroke-dasharray: calc(12px * var(--inv, 1)) calc(6px * var(--inv, 1));
}
.attack-line.is-pending,
.path-line.is-pending {
  animation: yol-akisi 1s linear infinite;
}
.ghost {
  fill: rgba(226, 192, 113, 0.16) !important;
  stroke: var(--brass-hi);
  stroke-width: calc(2px * var(--inv, 1));
  stroke-dasharray: calc(4px * var(--inv, 1)) calc(4px * var(--inv, 1));
}
.ghost.is-request {
  fill: color-mix(in srgb, var(--rc, var(--bone)) 28%, transparent) !important;
  stroke: var(--rc, var(--bone));
  stroke-dasharray: none;
  pointer-events: auto;
  cursor: grab;
}
.ghost.is-request:active {
  cursor: grabbing;
}
@keyframes yol-akisi {
  to {
    stroke-dashoffset: calc(-20px * var(--inv, 1));
  }
}

.map-label {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
}
.map-label-in {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: calc(6px * var(--inv, 1));
  padding: calc(2px * var(--inv, 1)) calc(8px * var(--inv, 1));
  border: calc(1px * var(--inv, 1)) solid rgba(226, 192, 113, 0.45);
  border-radius: calc(5px * var(--inv, 1));
  background: rgba(24, 16, 11, 0.92);
  color: var(--bone);
  font: 700 calc(13px * var(--inv, 1)) / 1.3 var(--sans);
  white-space: nowrap;
  transform: translate(-50%, 0);
}
.map-label-in img {
  width: calc(22px * var(--inv, 1));
  height: calc(22px * var(--inv, 1));
  object-fit: contain;
}
.map-label.is-pending .map-label-in {
  color: var(--brass-hi);
}
.map-label.is-attack .map-label-in {
  border-color: rgba(240, 138, 115, 0.6);
  transform: translate(-50%, -50%);
}
.map-label.is-request .map-label-in {
  border-color: rgba(237, 228, 209, 0.35);
}

/* Token: boyalı tahta pul. Konumu .token'da, saldırı/ölüm hareketleri .token-body'de. */
.token {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--ts);
  height: var(--ts);
  pointer-events: auto;
  touch-action: none;
  transition: opacity 0.35s ease;
}
.token.is-dragging {
  z-index: 5;
}
.token.is-waiting,
.token.is-leaving {
  opacity: 0;
}
.token-body {
  position: absolute;
  inset: 0;
  transition: transform 0.4s ease, filter 0.4s ease, opacity 0.4s ease;
}
.token-disc {
  position: absolute;
  inset: 7%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background-color: var(--tc);
  background-image: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0) 46%),
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0) 58%, rgba(0, 0, 0, 0.26) 100%);
  color: var(--ti);
  font: 700 calc(var(--ts) * 0.32) / 1 var(--serif);
  box-shadow:
    0 0 0 calc(2px * var(--inv, 1)) rgba(20, 13, 9, 0.9),
    0 calc(3px * var(--inv, 1)) calc(8px * var(--inv, 1)) rgba(0, 0, 0, 0.55);
}
.token.is-walking .token-disc {
  animation: adim 0.34s ease-in-out infinite alternate;
}
@keyframes adim {
  from {
    transform: translateY(-5%) rotate(-3deg);
  }
  to {
    transform: translateY(3%) rotate(3deg);
  }
}
.token-name {
  position: absolute;
  top: 100%;
  left: 50%;
  max-width: calc(220px * var(--inv, 1));
  overflow: hidden;
  padding: calc(1px * var(--inv, 1)) calc(7px * var(--inv, 1));
  border-radius: calc(4px * var(--inv, 1));
  background: rgba(24, 16, 11, 0.86);
  color: var(--bone);
  font: 500 calc(13px * var(--inv, 1)) / 1.25 var(--sans);
  white-space: nowrap;
  text-overflow: ellipsis;
  transform: translate(-50%, calc(2px * var(--inv, 1)));
  pointer-events: none;
}
.token.is-movable {
  cursor: grab;
}
.token.is-mine .token-disc {
  box-shadow:
    0 0 0 calc(2px * var(--inv, 1)) rgba(20, 13, 9, 0.9),
    0 0 0 calc(4px * var(--inv, 1)) var(--brass-hi),
    0 calc(3px * var(--inv, 1)) calc(8px * var(--inv, 1)) rgba(0, 0, 0, 0.55);
}
.token.is-target .token-disc {
  box-shadow:
    0 0 0 calc(2px * var(--inv, 1)) rgba(20, 13, 9, 0.9),
    0 0 0 calc(4px * var(--inv, 1)) var(--ember-hi),
    0 0 calc(18px * var(--inv, 1)) rgba(240, 138, 115, 0.7);
}
.token.is-turn::before {
  content: "";
  position: absolute;
  inset: calc(-7px * var(--inv, 1));
  border: calc(3px * var(--inv, 1)) solid var(--brass-hi);
  border-radius: 50%;
  animation: sira-nabzi 1.6s ease-in-out infinite;
}
.token.is-offline .token-disc {
  filter: grayscale(0.7) brightness(0.75);
}
.token.is-selected::after {
  content: "";
  position: absolute;
  inset: calc(-4px * var(--inv, 1));
  border: calc(2px * var(--inv, 1)) dashed var(--bone);
  border-radius: 50%;
}
.token.is-hidden .token-body {
  opacity: 0.5;
  filter: saturate(0.5);
}
.token.is-npc .token-disc {
  border-radius: 22%;
}
/* Hatıra: en son görüldüğü yer (eski hali); sisin altında da kararır */
.token.is-memory {
  pointer-events: none;
}
.token.is-memory .token-body {
  filter: grayscale(0.85) brightness(0.8);
  opacity: 0.8;
}
.token.is-memory .token-name {
  font-style: italic;
  opacity: 0.8;
}
/* Ölü: yana devrilmiş, solmuş, üstünde çarpı */
.token.is-dead .token-body {
  transform: rotate(-90deg) scale(0.86);
  filter: grayscale(1) brightness(0.7);
  opacity: 0.85;
}
.token.is-dead .token-disc::after {
  content: "";
  position: absolute;
  inset: 16%;
  background:
    linear-gradient(45deg, transparent 44%, rgba(18, 9, 7, 0.9) 44% 56%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, rgba(18, 9, 7, 0.9) 44% 56%, transparent 56%);
}
.token.is-dead .token-name {
  color: var(--bone-faint);
  text-decoration: line-through;
}
.token.is-dead.is-turn::before,
.token.is-memory.is-turn::before {
  display: none;
}
@keyframes sira-nabzi {
  0%,
  100% {
    opacity: 0.95;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(1.08);
  }
}

/* Saldırı ve ölüm efektleri */
.missile {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--ms);
  height: var(--ms);
  will-change: transform, opacity;
}
.missile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7));
}
.missile.is-spark::after {
  content: "";
  position: absolute;
  inset: 30%;
  border-radius: 50%;
  background: #fff3d6;
  box-shadow: 0 0 10px 4px var(--brass-hi), 0 0 24px 8px rgba(240, 138, 115, 0.6);
}
.spark {
  position: absolute;
  top: -4px;
  left: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sc);
  box-shadow: 0 0 8px var(--sc);
}
.ring-burst {
  position: absolute;
  top: calc(var(--rs) / -2);
  left: calc(var(--rs) / -2);
  width: var(--rs);
  height: var(--rs);
  border: 4px solid var(--ember-hi);
  border-radius: 50%;
}
.ring-burst.is-miss {
  border-color: rgba(237, 228, 209, 0.7);
  border-width: 2px;
}
.ring-burst.is-death {
  border-color: #b8331f;
  border-width: 6px;
  box-shadow: 0 0 24px rgba(184, 51, 31, 0.7);
}
.floater {
  position: absolute;
  top: -0.65em;
  left: -2em;
  width: 4em;
  color: #ff8f78;
  font: 800 calc(26px * var(--inv, 1)) / 1.3 var(--serif);
  text-align: center;
  text-shadow: 0 2px 0 #2a0e08, 0 0 10px rgba(0, 0, 0, 0.8);
}
.floater.is-heal {
  color: #9be08f;
  text-shadow: 0 2px 0 #0c2a08, 0 0 10px rgba(0, 0, 0, 0.8);
}

.ping {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
}
.ping-ring {
  position: absolute;
  top: calc(-34px * var(--inv, 1));
  left: calc(-34px * var(--inv, 1));
  width: calc(68px * var(--inv, 1));
  height: calc(68px * var(--inv, 1));
  border: calc(3px * var(--inv, 1)) solid var(--pc);
  border-radius: 50%;
  animation: ping-ring 1.1s cubic-bezier(0.2, 0.6, 0.35, 1) 2 both;
}
.ping-ring + .ping-ring {
  animation-delay: 0.22s;
}
.ping-name {
  position: absolute;
  top: calc(40px * var(--inv, 1));
  left: 0;
  padding: calc(1px * var(--inv, 1)) calc(7px * var(--inv, 1));
  border-radius: calc(4px * var(--inv, 1));
  background: rgba(24, 16, 11, 0.86);
  color: var(--bone);
  font: 500 calc(13px * var(--inv, 1)) / 1.25 var(--sans);
  white-space: nowrap;
  transform: translateX(-50%);
  animation: fade-out 2.4s ease-in both;
}
@keyframes ping-ring {
  from {
    transform: scale(0.25);
    opacity: 1;
  }
  to {
    transform: scale(1.5);
    opacity: 0;
  }
}
@keyframes fade-out {
  0%,
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  pointer-events: none;
}
.empty-mark {
  width: 64px;
  height: 64px;
  margin-bottom: 6px;
  color: rgba(226, 192, 113, 0.55);
}
.empty-title {
  margin: 0;
  font: 700 28px/1.15 var(--serif);
}
.empty-text {
  max-width: 40ch;
  margin: 0;
  color: var(--bone-dim);
  font-size: 16px;
}
.map-status {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 28px);
  padding: 7px 12px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: rgba(36, 26, 20, 0.95);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
  color: var(--bone-dim);
  font-size: 14px;
}
.status-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ember-hi);
}
.map-status.is-live .status-dot {
  background: var(--brass-hi);
}
.zoom {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: rgba(36, 26, 20, 0.95);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
}
.zoom button {
  min-width: 40px;
  height: 38px;
  border: 0;
  background: none;
  color: var(--bone);
  font: 500 20px/1 var(--sans);
  cursor: pointer;
}
.zoom button:hover {
  background: var(--wood-3);
}
.zoom .zoom-fit {
  padding: 0 12px;
  border-right: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
  font-size: 14px;
}
.drop-hint {
  position: absolute;
  inset: 14px;
  display: grid;
  place-items: center;
  border: 2px dashed var(--brass);
  border-radius: 16px;
  background: rgba(18, 35, 30, 0.85);
  color: var(--bone);
  font: 700 22px/1.2 var(--serif);
  text-align: center;
  pointer-events: none;
}

/* ---------------------------------------------------------------- GM paneli */

.gm-panel {
  grid-area: gm;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-right: 1px solid var(--rule);
  background: var(--wood);
}
.panel-sec {
  border-bottom: 1px solid var(--rule);
}
.panel-sec > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px 13px;
  font: 700 19px/1.2 var(--serif);
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.panel-sec > summary::-webkit-details-marker {
  display: none;
}
.panel-sec > summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-right: 1.5px solid var(--bone-dim);
  border-bottom: 1.5px solid var(--bone-dim);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.15s;
}
.panel-sec[open] > summary::after {
  transform: translateY(2px) rotate(-135deg);
}
.panel-body {
  display: grid;
  gap: 12px;
  padding: 0 18px 18px;
}
.sub-sec {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}
.sub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
}
.sub-title {
  margin: 0;
  font: 700 16px/1.2 var(--serif);
}

.library {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.lib-open {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.lib-open:hover .lib-name {
  color: var(--brass-hi);
}
.lib-open[aria-current="true"] {
  border-color: var(--rule);
  background: var(--wood-2);
}
.lib-thumb {
  display: block;
  width: 68px;
  height: 46px;
  border-radius: 4px;
  background: var(--felt-deep);
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.lib-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.lib-name {
  overflow: hidden;
  color: var(--bone);
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.lib-meta {
  color: var(--bone-faint);
  font-size: 13px;
}
.lib-open[aria-current="true"] .lib-meta {
  color: var(--brass-hi);
}

.order-list,
.inv-list,
.player-admin {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.order-row,
.inv-row,
.admin-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 3px 4px 3px 8px;
  border-radius: 6px;
}
.order-row:hover,
.inv-row:hover,
.admin-row:hover {
  background: var(--wood-2);
}
.order-row.is-current {
  background: rgba(201, 162, 74, 0.16);
}
.order-num {
  width: 18px;
  color: var(--bone-faint);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.dot {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
}
.is-offline .dot {
  opacity: 0.4;
}
.row-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.row-meta {
  flex: none;
  color: var(--bone-faint);
  font-size: 13px;
}
.inv-thumb {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: var(--felt-deep);
  object-fit: contain;
}
.inv-count {
  flex: none;
  min-width: 28px;
  color: var(--bone);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.item-grid > .hint,
.item-grid > .inventory-empty {
  grid-column: 1 / -1;
}
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.item {
  position: relative;
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 6px 6px 7px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--wood-2);
  color: var(--bone);
  font: inherit;
  text-align: center;
  cursor: pointer;
}
.item:hover {
  border-color: var(--brass);
}
.item-img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  background: var(--felt-deep);
  object-fit: contain;
}
.item-icon {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  background: var(--felt-deep);
  color: var(--bone-dim);
  font: 700 12px/1 var(--sans);
}
.item-name {
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.item-class {
  color: var(--bone-faint);
  font-size: 11px;
  line-height: 1.1;
}
.item.is-selected {
  border-color: var(--brass-hi);
  box-shadow: 0 0 0 1px var(--brass-hi);
}
.pick-grid {
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
}
.pick-grid .item:hover {
  border-color: var(--ember-hi);
  box-shadow: 0 0 0 1px var(--ember-hi);
}
.catalog {
  display: grid;
  gap: 12px;
}
.catalog-title {
  margin: 0 0 6px;
  color: var(--bone-dim);
  font: 700 13px/1.2 var(--sans);
  letter-spacing: 0.02em;
}
.item-count {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 22px;
  padding: 3px 6px;
  border-radius: 10px;
  background: var(--brass);
  color: var(--ink);
  font: 700 12px/1 var(--sans);
}
.item.is-missing {
  opacity: 0.55;
}
.inventory-empty {
  margin: 8px 4px;
  color: var(--bone-faint);
  font-size: 14px;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.swatch {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
.swatch[aria-checked="true"] {
  box-shadow: 0 0 0 2px var(--wood-2), 0 0 0 4px var(--bone);
}
.settings {
  display: grid;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}

/* ---------------------------------------------------------------- yan panel: sıra, kayıt, envanter, zar */

.side {
  display: flex;
  grid-area: side;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--rule);
  background: var(--wood);
}

.turn-card {
  flex: none;
  margin: 12px 12px 0;
  padding: 12px 14px 14px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--wood-2);
}
.turn-card.is-mine {
  border-color: var(--brass);
  box-shadow: 0 0 0 1px rgba(201, 162, 74, 0.35), 0 0 26px rgba(201, 162, 74, 0.12);
}
.turn-card.is-fresh {
  animation: sira-geldi 1s ease-out 1;
}
@keyframes sira-geldi {
  from {
    box-shadow: 0 0 0 0 rgba(226, 192, 113, 0.7);
  }
  to {
    box-shadow: 0 0 0 16px rgba(226, 192, 113, 0);
  }
}
.turn-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.turn-label {
  color: var(--bone-dim);
  font-size: 13px;
}
.turn-round {
  color: var(--bone-dim);
  font: 700 14px/1 var(--sans);
  font-variant-numeric: tabular-nums;
}
.turn-who {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--c, var(--bone));
  font: 700 24px/1.15 var(--serif);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.turn-free {
  margin: 0;
  color: var(--bone-dim);
  font-size: 14px;
}
.order-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.order-chip {
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--wood-3);
  color: var(--bone-dim);
  font-size: 13px;
  white-space: nowrap;
}
.order-chip.is-current {
  background: var(--brass);
  color: var(--ink);
  font-weight: 700;
}
.order-chip.is-offline {
  opacity: 0.5;
  text-decoration: line-through;
}
.order-chip.is-dead {
  opacity: 0.55;
  text-decoration: line-through;
}
.order-chip.is-unknown {
  font-style: italic;
}
.ap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.ap-label {
  color: var(--bone-dim);
  font: 700 13px/1 var(--sans);
}
.turn-hint {
  margin-top: 10px;
}
.pending {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 8px 8px 8px 12px;
  border: 1px dashed rgba(226, 192, 113, 0.6);
  border-radius: 8px;
  background: rgba(201, 162, 74, 0.08);
}
.pending-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brass-hi);
  animation: sira-nabzi 1.2s ease-in-out infinite;
}
.pending-text {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  line-height: 1.3;
}
.pending-text b {
  color: var(--brass-hi);
  font-weight: 700;
}
.ap-pips {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 3px;
}
.pip {
  --lit: 0;
  width: 11px;
  height: 18px;
  border: 1px solid #3a2d23;
  border-radius: 2px;
  background: linear-gradient(to top, var(--brass-hi) calc(var(--lit) * 100%), #18120e calc(var(--lit) * 100%));
}
.pip.is-on {
  border-color: var(--brass-hi);
  box-shadow: 0 0 6px rgba(226, 192, 113, 0.45);
}
.ap-num {
  flex: none;
  color: var(--bone);
  font: 700 15px/1 var(--sans);
  font-variant-numeric: tabular-nums;
}
.end-turn {
  width: 100%;
  height: 48px;
  margin-top: 14px;
  font-size: 17px;
}
.gm-turn-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}
.gm-turn-tools .spacer {
  flex: 1;
}

.tabs {
  display: flex;
  gap: 2px;
  margin: 10px 12px 0;
  border-bottom: 1px solid var(--rule);
}
.tab {
  padding: 8px 12px 7px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--bone-dim);
  font: 500 15px/1 var(--sans);
  cursor: pointer;
}
.tab:hover {
  color: var(--bone);
}
.tab[aria-selected="true"] {
  border-bottom-color: var(--brass);
  color: var(--bone);
}
.tab-count {
  color: var(--bone-faint);
  font-size: 13px;
}

.log {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  margin: 0;
  padding: 14px 14px 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
}
.log:empty::after {
  content: "Zar sonuçları, sıra değişimleri ve kuralların duyuruları burada akar.";
  margin: auto 8px;
  color: var(--bone-faint);
  font-size: 14px;
  text-align: center;
}
.inventory {
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px 14px 12px;
  overflow-y: auto;
}

.entry {
  position: relative;
  min-width: 0;
}
.entry-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.who {
  overflow: hidden;
  color: var(--c, var(--bone));
  font: 700 16px/1.2 var(--serif);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.entry-time {
  flex: none;
  margin-left: auto;
  color: var(--bone-faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.tag {
  flex: none;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--wood-3);
  color: var(--bone-dim);
  font: 500 12px/1 var(--sans);
}
.entry-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--bone-dim);
  font-size: 14px;
}
.entry-line .text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}
.entry.turn .text {
  color: var(--bone);
  font: 700 15px/1.3 var(--serif);
}
.entry.rule {
  padding: 8px 11px 9px;
  border-left: 3px solid var(--brass);
  border-radius: 0 8px 8px 0;
  background: rgba(201, 162, 74, 0.08);
}
.entry.rule .text {
  color: var(--bone);
  font: italic 500 16px/1.35 var(--serif);
}
.entry.gm-note {
  padding: 8px 11px 9px;
  border: 1px dashed var(--rule);
  border-radius: 8px;
}
.entry.gm-note .text {
  color: var(--bone);
}
.entry.attack .text {
  color: var(--ember-hi);
  font-weight: 700;
}
.entry.death .text {
  color: #f3b3a8;
  font: italic 700 15px/1.3 var(--serif);
}
.entry.private {
  padding: 8px 11px 9px;
  border-left: 3px solid #b48ee0;
  border-radius: 0 8px 8px 0;
  background: rgba(180, 142, 224, 0.09);
}
.entry.private .text {
  color: var(--bone);
}
.entry.secret {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--bone-dim);
  font-size: 14px;
}
.entry.secret .die {
  width: 22px;
  height: 22px;
}

/* Zar sonucu kartı */
.entry.roll {
  padding: 8px 12px 10px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--c, var(--rule));
  border-radius: 8px;
  background: var(--wood-2);
}
.roll-label {
  margin: 3px 0 0;
  color: var(--bone);
  font: italic 500 17px/1.25 var(--serif);
}
.roll-body {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}
.roll-dice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.roll-op {
  padding: 0 1px;
  color: var(--bone-faint);
  font-size: 16px;
}
.roll-num {
  padding: 0 2px;
  color: var(--bone);
  font: 700 17px/1 var(--sans);
}
.roll-result {
  display: grid;
  flex: none;
  justify-items: end;
  gap: 3px;
}
.roll-total {
  min-width: 1.4ch;
  color: var(--bone);
  font: 800 38px/0.82 var(--serif);
  font-variant-numeric: lining-nums tabular-nums;
  text-align: right;
}
.roll-flag {
  font-size: 13px;
  line-height: 1;
}
.roll-notation {
  margin: 8px 0 0;
  color: var(--bone-faint);
  font-size: 13px;
}
.roll.is-crit {
  border-color: rgba(201, 162, 74, 0.55);
  border-left-color: var(--brass-hi);
}
.roll.is-crit .roll-total,
.roll.is-crit .roll-flag {
  color: var(--brass-hi);
}
.roll.is-fumble .roll-total,
.roll.is-fumble .roll-flag {
  color: var(--ember-hi);
}
.roll.is-crit.is-fresh {
  animation: crit-glow 0.9s ease-out 0.45s 1;
}
.die {
  display: block;
  flex: none;
  overflow: visible;
}
.die text {
  fill: var(--bone);
  font: 700 16px var(--sans);
}
.die text.t3 {
  font-size: 12.5px;
}
.die text.t4 {
  font-size: 10px;
}
.entry .die {
  width: 34px;
  height: 34px;
}
.entry .die-shape {
  fill: var(--wood-3);
  stroke: var(--bone-faint);
  stroke-width: 1.6;
  stroke-linejoin: round;
}
.die.is-max .die-shape {
  fill: rgba(201, 162, 74, 0.2);
  stroke: var(--brass-hi);
}
.die.is-max text {
  fill: var(--brass-hi);
}
.die.is-min .die-shape {
  fill: rgba(201, 80, 59, 0.18);
  stroke: var(--ember-hi);
}
.die.is-min text {
  fill: var(--ember-hi);
}
.die.is-dropped {
  opacity: 0.5;
}
.die-strike {
  stroke: var(--bone);
  stroke-width: 2.2;
  stroke-linecap: round;
}
.roll.is-rolling .roll-dice .die {
  animation: die-settle 0.55s cubic-bezier(0.2, 0.75, 0.25, 1.15) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
@keyframes die-settle {
  0% {
    transform: translateY(-8px) rotate(-130deg) scale(0.45);
    opacity: 0;
  }
  70% {
    transform: translateY(0) rotate(10deg) scale(1.07);
    opacity: 1;
  }
  100% {
    transform: none;
    opacity: 1;
  }
}
@keyframes crit-glow {
  from {
    box-shadow: 0 0 0 0 rgba(226, 192, 113, 0.55);
  }
  to {
    box-shadow: 0 0 0 14px rgba(226, 192, 113, 0);
  }
}

.tray {
  margin: 0 12px calc(12px + env(safe-area-inset-bottom));
  padding: 8px 8px 10px;
  border: 1px solid #0c1814;
  border-radius: 12px;
  background: radial-gradient(130% 120% at 50% 30%, #20392f 0%, #142820 100%);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.55), 0 1px 0 rgba(255, 255, 255, 0.04);
}
.tray-dice {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}
.die-btn {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--bone);
  cursor: pointer;
}
.die-btn .die {
  width: 100%;
  max-width: 40px;
  height: auto;
  transition: transform 0.12s;
}
.die-btn .die-shape {
  fill: rgba(237, 228, 209, 0.05);
  stroke: var(--bone-dim);
  stroke-width: 1.7;
  stroke-linejoin: round;
  transition: fill 0.12s, stroke 0.12s;
}
.die-btn text {
  font-size: 15px;
}
.die-btn:hover .die-shape {
  fill: rgba(201, 162, 74, 0.16);
  stroke: var(--brass-hi);
}
.die-btn:active .die {
  transform: translateY(1px) scale(0.93);
}
.tray-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 0 2px;
}
.tray-row .input {
  flex: 1 1 120px;
}
.check-felt {
  margin-left: auto;
  padding-right: 4px;
}

/* ---------------------------------------------------------------- statlar, istekler, karakterler */

.stat-card {
  flex: none;
  margin: 12px 12px 0;
  padding: 10px 14px 12px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--wood-2);
}
.stat-card + .turn-card {
  margin-top: 8px;
}
.stat-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.stat-name {
  overflow: hidden;
  color: var(--c, var(--bone));
  font: 700 19px/1.2 var(--serif);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.tag-dead {
  background: rgba(201, 80, 59, 0.2);
  color: var(--ember-hi);
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 10px;
  margin: 8px 0 0;
}
.stat {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.stat dt {
  overflow: hidden;
  color: var(--bone-faint);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.stat dd {
  margin: 0;
  color: var(--bone);
  font: 700 19px/1.1 var(--sans);
  font-variant-numeric: tabular-nums;
}
.stat-can dd {
  color: #f09a8c;
}
.stat-enerji dd {
  color: var(--brass-hi);
}
.stat-card.is-dead .stats {
  opacity: 0.55;
}

.requests {
  display: grid;
  flex: none;
  gap: 8px;
  max-height: 42vh;
  margin: 10px 12px 0;
  overflow-y: auto;
  overflow-anchor: none;
  overscroll-behavior: contain;
}
.requests-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font: 700 16px/1.2 var(--serif);
}
.request {
  display: grid;
  gap: 8px;
  padding: 10px 10px 10px 12px;
  border: 1px solid rgba(226, 192, 113, 0.45);
  border-left: 4px solid var(--c, var(--brass));
  border-radius: 10px;
  background: var(--wood-2);
  animation: istek-geldi 0.5s ease-out 1;
}
.request.is-attack {
  border-color: rgba(240, 138, 115, 0.5);
  border-left-color: var(--ember-hi);
  background: linear-gradient(90deg, rgba(201, 80, 59, 0.12), rgba(201, 80, 59, 0) 70%), var(--wood-2);
}
.req-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.req-what {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}
.req-what b {
  font-weight: 700;
}
.req-meta {
  margin: 0;
  color: var(--bone-dim);
  font-size: 13px;
}
.req-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.req-item img {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  background: var(--felt-deep);
  object-fit: contain;
}
.req-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
@keyframes istek-geldi {
  from {
    box-shadow: 0 0 0 0 rgba(226, 192, 113, 0.6);
  }
  to {
    box-shadow: 0 0 0 12px rgba(226, 192, 113, 0);
  }
}
.btn-danger-solid {
  background: var(--ember);
  border-color: var(--ember);
  color: #fff6ef;
  font-weight: 700;
}
.btn-danger-solid:hover {
  background: #d9614b;
  border-color: #d9614b;
}

.dot.is-npc {
  border-radius: 3px;
}
.char-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.char-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--bone);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.char-row:hover {
  background: var(--wood-2);
}
.char-row.is-selected {
  background: var(--wood-3);
  box-shadow: inset 2px 0 0 var(--c);
}
.char-row.is-dead .row-name {
  color: var(--bone-faint);
  text-decoration: line-through;
}
.row-meta.is-dead {
  color: var(--ember-hi);
}
.mini-stats {
  flex: none;
  color: var(--bone-faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.char-editor {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--wood-2);
}
.char-editor .input {
  background: var(--wood);
}
.char-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.char-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font: 700 18px/1.2 var(--serif);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.npc-only-fields {
  display: grid;
  gap: 10px;
}
.stat-edit {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.stat-input {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: var(--bone-dim);
  font-size: 12px;
}
.stat-input span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.stat-input .input {
  height: 32px;
  padding: 0 6px;
  font-variant-numeric: tabular-nums;
}
.char-editor .sub-head {
  padding-top: 8px;
}
.char-editor .tag {
  white-space: nowrap;
}

/* ---------------------------------------------------------------- dosya yöneticisi ve pencereler */

dialog {
  color: var(--bone);
}
dialog::backdrop {
  background: rgba(10, 8, 6, 0.62);
}
.files {
  width: min(96vw, 1000px);
  height: min(90vh, 780px);
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--wood);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.files[open] {
  display: flex;
  flex-direction: column;
}
.files-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
}
.files-title {
  margin: 0;
  font: 700 20px/1.2 var(--serif);
}
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  min-width: 0;
  color: var(--bone-faint);
}
.crumb {
  padding: 4px 6px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--bone-dim);
  font: 500 15px/1 var(--sans);
  cursor: pointer;
}
.crumb:hover {
  background: var(--wood-3);
  color: var(--bone);
}
.crumb[aria-current="true"] {
  color: var(--bone);
  cursor: default;
}
.files-actions {
  display: flex;
  gap: 6px;
}
.files-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.file-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.file-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 12px;
  border-bottom: 1px solid var(--rule);
  background: var(--wood);
  color: var(--bone-faint);
  font-weight: 500;
  text-align: left;
}
.file-table td {
  padding: 4px 12px;
  border-bottom: 1px solid rgba(74, 58, 45, 0.5);
  vertical-align: middle;
}
.file-table tr:hover td {
  background: rgba(46, 35, 27, 0.6);
}
.file-table .num {
  color: var(--bone-faint);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.file-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--bone);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.file-name:hover span {
  color: var(--brass-hi);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.file-name svg {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--bone-dim);
}
.file-name.is-folder svg {
  color: var(--brass);
}
.file-name span {
  overflow-wrap: anywhere;
}
.file-tag {
  margin-left: 8px;
  color: var(--bone-faint);
  font-size: 12px;
}
.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
  white-space: nowrap;
}
.row-actions .btn {
  height: 28px;
  padding: 0 8px;
  font-size: 13px;
}
.files-empty {
  margin: 30px;
  color: var(--bone-faint);
  text-align: center;
}
.files-foot {
  margin: 0;
  padding: 8px 16px;
  border-top: 1px solid var(--rule);
  color: var(--bone-faint);
  font-size: 13px;
}
.files-foot:empty {
  display: none;
}

.modal {
  width: min(92vw, 460px);
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--wood);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.modal.is-wide {
  width: min(96vw, 920px);
}
.modal-body {
  display: grid;
  gap: 14px;
  padding: 18px 20px;
}
.modal-title {
  margin: 0;
  font: 700 21px/1.2 var(--serif);
  overflow-wrap: anywhere;
}
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.modal-text {
  margin: 0;
  color: var(--bone-dim);
}
.preview-img {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  margin: 0 auto;
  border-radius: 6px;
  background: var(--felt-deep);
  object-fit: contain;
}
.editor {
  width: 100%;
  height: 60vh;
  font: 14px/1.5 var(--mono);
  tab-size: 4;
  white-space: pre;
}

/* ---------------------------------------------------------------- bildirimler */

.toasts {
  position: fixed;
  bottom: calc(18px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 100;
  display: grid;
  gap: 8px;
  width: min(92vw, 420px);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  padding: 10px 14px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--ember);
  border-radius: 8px;
  background: var(--wood-3);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  color: var(--bone);
  font-size: 15px;
  transition: opacity 0.3s, transform 0.3s;
}
.toast.is-ok {
  border-left-color: var(--brass);
}
.toast.is-leaving {
  opacity: 0;
  transform: translateY(6px);
}
.conn {
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  left: 50%;
  z-index: 90;
  padding: 8px 14px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--ember);
  border-radius: 8px;
  background: var(--wood-3);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  font-size: 14px;
  transform: translateX(-50%);
}

/* ---------------------------------------------------------------- ekran boyutları */

@media (min-width: 901px) {
  .only-narrow {
    display: none !important;
  }
}
@media (max-width: 1150px) and (min-width: 901px) {
  :root {
    --side-w: 320px;
    --gm-w: 276px;
  }
  .presence {
    display: none;
  }
}
@media (max-width: 900px) {
  :root {
    --topbar-h: 52px;
  }
  .app,
  .app.is-gm {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "top"
      "board";
  }
  .topbar {
    gap: 6px;
    padding: 0 6px 0 12px;
  }
  .app.is-gm .topbar {
    padding-left: 6px;
  }
  .scene-title {
    font-size: 19px;
  }
  .presence {
    display: none;
  }
  .side,
  .gm-panel {
    position: fixed;
    top: var(--topbar-h);
    bottom: 0;
    z-index: 30;
    width: min(100%, 400px);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    visibility: hidden;
    transition: transform 0.22s ease, visibility 0s linear 0.22s;
  }
  .side {
    right: 0;
    transform: translateX(100%);
  }
  .gm-panel {
    left: 0;
    transform: translateX(-100%);
  }
  .app.show-yan .side,
  .app.show-gm .gm-panel {
    visibility: visible;
    transform: none;
    transition: transform 0.22s ease, visibility 0s;
  }
  .map-status {
    top: 10px;
    left: 10px;
  }
  .zoom {
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
  }
  .files-head {
    grid-template-columns: 1fr auto;
  }
  .crumbs {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .file-table .num {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ping-ring {
    animation: fade-out 2.2s ease-in both;
  }
  .roll.is-rolling .roll-dice .die,
  .roll.is-crit.is-fresh,
  .turn-card.is-fresh,
  .token.is-turn::before,
  .token.is-walking .token-disc,
  .pending-dot,
  .request,
  .attack-line.is-pending,
  .path-line.is-pending {
    animation: none;
  }
  .token-body,
  .token,
  .side,
  .gm-panel,
  .app.show-yan .side,
  .app.show-gm .gm-panel,
  .toast,
  .map-img {
    transition: none;
  }
}

/* Küçük piksel resimler (ör. 16x16 eşya simgeleri) büyütülünce keskin kalsın */
img.is-pixel {
  image-rendering: pixelated;
}
