/* ==========================================================
   OKEY YAZBOZ — stiller
   Tasarım hedefi: iPhone 15 Pro Max (430 x 932 CSS px)
   ========================================================== */

:root {
  --bg: #0b1211;
  --panel: #131c1a;
  --panel-2: #1a2523;
  --line: rgba(255, 255, 255, .09);
  --text: #f3eee2;
  --muted: #8e9a95;
  --brass: #dfb85f;
  --brass-soft: rgba(223, 184, 95, .16);

  --felt-1: #217050;
  --felt-2: #0e3a2a;
  --wood-1: #7b4b28;
  --wood-2: #3a2110;

  --ivory-1: #fcf7ea;
  --ivory-2: #e5dbc0;
  --ivory-edge: #b8aa85;

  --font: -apple-system, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --font-round: ui-rounded, "SF Pro Rounded", -apple-system, system-ui, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; margin: 0; }

body {
  background: radial-gradient(120% 70% at 50% -10%, #1d2c28 0%, var(--bg) 62%);
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

button { font-family: inherit; color: inherit; border: 0; cursor: pointer; }

.app {
  height: 100vh;
  height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding:
    calc(env(safe-area-inset-top, 0px) + 8px)
    12px
    calc(env(safe-area-inset-bottom, 0px) + 10px);
}

/* ---------- 1) SKOR TABELASI ---------- */

.scoreboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
  overflow: hidden;
  flex: none;
}

.sb-name, .sb-score, .sb-pas { position: relative; text-align: center; }
.sb-name:not(:nth-child(4n)),
.sb-score:not(:nth-child(4n)),
.sb-pas:not(:nth-child(4n)) { border-right: 1px solid var(--line); }

.sb-name { border-bottom: 1px solid var(--line); background: rgba(0, 0, 0, .18); }

.sb-name input {
  width: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  padding: 11px 4px;
  text-align: center;
  font: 700 16px/1.2 var(--font);   /* 16px: iOS yakınlaştırmasın */
  letter-spacing: .02em;
  color: var(--text);
  caret-color: var(--brass);
  -webkit-user-select: text;
  user-select: text;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
.sb-name input:focus { background: var(--brass-soft); }

.sb-score {
  padding: 8px 0 12px;
  font: 800 36px/1 var(--font-round);
  font-variant-numeric: tabular-nums;
  transition: color .3s, text-shadow .3s;
}

.sb-pas {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 18px/1 var(--font);
}

.sb-pas .wave-flag { width: 26px; height: 26px; overflow: visible; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }

.sb-score.leader { color: var(--brass); text-shadow: 0 0 18px rgba(223, 184, 95, .55); }
.sb-name.leader input { color: var(--brass); }

/* döner levhalı puanlar (flap.js): her karakter ortadan bölünmüş bir kutu */
.flaps { position: relative; display: inline-flex; gap: 4px; vertical-align: top; }
.flap {
  position: relative;
  width: .76em; height: 1.22em;
  border-radius: 5px;
  perspective: 3em;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .5);
}
.flap .h {
  position: absolute; left: 0; right: 0;
  height: 50%;
  overflow: hidden;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.flap .top { top: 0; border-radius: 5px 5px 0 0; transform-origin: 50% 100%; background: linear-gradient(180deg, #2b3331, #1f2725); }
.flap .bot { bottom: 0; border-radius: 0 0 5px 5px; transform-origin: 50% 0; background: linear-gradient(180deg, #1a201f, #141918); }
.flap .fl { z-index: 2; }
.flap .bot.fl { transform: rotateX(90deg); }   /* dururken gizli; devrilirken flap.js indirir */
.flap .h b {
  position: absolute; left: 0; right: 0;
  height: 200%;
  display: flex; align-items: center; justify-content: center;
  font: inherit;
}
.flap .top b { top: 0; }
.flap .bot b { bottom: 0; }
.flap::after {                         /* levhaların birleştiği çizgi */
  content: "";
  position: absolute; left: 0; right: 0; top: 50%;
  height: 1px; margin-top: -.5px;
  background: rgba(0, 0, 0, .7);
  z-index: 3;
}

/* ---------- 2) CEZA ENERJİ GÖSTERGESİ ---------- */

.energy {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  height: 38px;
  padding: 0 4px;
}

.energy-label {
  font: 800 11px/1 var(--font);
  letter-spacing: .18em;
  color: var(--muted);
}

.energy-total {
  min-width: 30px;
  text-align: right;
  font: 800 16px/1 var(--font-round);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.energy-bar {
  flex: 1;
  height: 24px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  padding: 5px;
  background: #070c0b;
  border: 1px solid var(--line);
  border-radius: 12px;
  /* --heat (0..1) teklif yükseldikçe artar; çerçeve de uçtaki ışığın renginde parlar */
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, .7),
    0 0 calc(18px * var(--heat, 0)) calc(2px * var(--heat, 0)) var(--hc, transparent);
  transition: box-shadow .35s;
}

.seg {
  border-radius: 3px;
  background: rgba(255, 255, 255, .07);
  transition: background .25s, box-shadow .25s, filter .25s;
}
.seg.on {
  background: var(--c);
  filter: brightness(calc(.72 + .55 * var(--heat, 0))) saturate(calc(.75 + .45 * var(--heat, 0)));
  box-shadow: 0 0 calc(3px + 15px * var(--heat, 0)) var(--c), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.seg.head { animation: head 1s ease-in-out infinite; }
@keyframes head {
  50% {
    filter: brightness(calc(1.1 + .6 * var(--heat, 0)));
    box-shadow: 0 0 calc(8px + 18px * var(--heat, 0)) var(--c), inset 0 1px 0 rgba(255, 255, 255, .6);
  }
}
.energy-bar.hot .seg.on { animation: hot .6s ease-in-out infinite alternate; }
@keyframes hot { to { filter: brightness(calc(1.15 + .55 * var(--heat, 0))) saturate(1.2); } }

.toast {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0 14px;
  border-radius: 12px;
  background: rgba(19, 28, 26, .96);
  border: 1px solid rgba(223, 184, 95, .5);
  color: var(--text);
  font: 700 13px/1.25 var(--font);
  text-align: center;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 5;
}
.toast.show { opacity: 1; transform: none; }

/* ---------- 3) MASA ---------- */

.table-wrap { flex: 1; min-height: 0; }

.table {
  position: relative;
  height: 100%;
  border-radius: 40px;
  background: linear-gradient(145deg, var(--wood-1), var(--wood-2));
  box-shadow: 0 18px 40px rgba(0, 0, 0, .55), inset 0 2px 0 rgba(255, 255, 255, .18);
}
.table::before {                       /* çuha */
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 30px;
  background:
    radial-gradient(ellipse at 50% 45%, var(--felt-1) 0%, var(--felt-2) 100%);
  box-shadow: inset 0 0 46px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(0, 0, 0, .4);
}
.table::after {                        /* ortadaki süs halka */
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 230px; height: 230px;
  margin: -115px 0 0 -115px;
  border-radius: 50%;
  border: 2px solid rgba(223, 184, 95, .16);
  box-shadow: 0 0 0 14px rgba(223, 184, 95, .04);
  pointer-events: none;
}

/* oyuncu koltukları */
.seat {
  position: absolute;
  z-index: 2;
  min-width: 98px;
  padding: 8px 12px 7px;
  text-align: center;
  border-radius: 18px;
  background: rgba(0, 0, 0, .34);
  border: 1.5px solid rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: scale .18s, background .18s, border-color .18s, box-shadow .18s;
  cursor: pointer;
}
.seat-n { top: 68px;    left: 50%; translate: -50% 0; }
.seat-s { bottom: 26px; left: 50%; translate: -50% 0; }
.seat-w { left: 24px;   top: 50%;  translate: 0 -50%; }
.seat-e { right: 24px;  top: 50%;  translate: 0 -50%; }

.seat-name  { display: block; font: 700 15px/1.2 var(--font); }
.seat-score { display: block; margin-top: 2px; font: 800 20px/1 var(--font-round); color: var(--brass); font-variant-numeric: tabular-nums; }

body.armed .seat { border-color: rgba(223, 184, 95, .55); animation: armed 1.1s ease-in-out infinite; }
@keyframes armed { 50% { box-shadow: 0 0 18px rgba(223, 184, 95, .35); } }
.seat.hover {
  scale: 1.12;
  background: rgba(223, 184, 95, .3);
  border-color: var(--brass);
  box-shadow: 0 0 28px rgba(223, 184, 95, .6);
  animation: none;
}

/* merkez: taş + zar */
.center {
  position: absolute;
  left: 50%; top: 50%;
  width: 80px; height: 110px;
  margin: -55px 0 0 -40px;
  z-index: 3;
}

.tile {
  position: absolute; inset: 0;
  border-radius: 13px;
  background: linear-gradient(160deg, var(--ivory-1), var(--ivory-2));
  box-shadow:
    inset 0 1px 0 #fff,
    0 6px 0 var(--ivory-edge),
    0 14px 18px rgba(0, 0, 0, .5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: grab;
  transition: transform .3s cubic-bezier(.2, .9, .3, 1.15), box-shadow .2s;
  will-change: transform;
}
.tile.dragging {
  transition: none;
  cursor: grabbing;
  z-index: 20;
  box-shadow: inset 0 1px 0 #fff, 0 10px 0 var(--ivory-edge), 0 30px 34px rgba(0, 0, 0, .55);
}
.tile.pop { animation: pop .45s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes pop { 0% { scale: .6; opacity: 0; } 100% { scale: 1; opacity: 1; } }

.tile .num {
  font: 800 54px/1 var(--font-round);
  color: var(--tc);
  letter-spacing: -.03em;
  pointer-events: none;
}
.tile .ring {
  width: 18px; height: 18px;
  margin-top: 7px;
  border-radius: 50%;
  border: 4.5px solid var(--tc);
  pointer-events: none;
}

.tile.blank { cursor: default; }
.tile .ornament { width: 42px; height: 42px; color: #a39466; pointer-events: none; }
.tile .tile-tag {
  margin-top: 7px;
  font: 800 9px/1 var(--font);
  letter-spacing: .2em;
  color: #a39466;
  pointer-events: none;
}


/* 3B zar */
.dice {
  --d: 46px;
  position: absolute;
  right: -46px; top: -58px;
  width: 66px; height: 66px;
  padding: 0;
  background: none;
  perspective: 420px;
  z-index: 6;
  filter: drop-shadow(0 10px 8px rgba(0, 0, 0, .45));
  touch-action: manipulation;
}
.dice.wait { animation: bob 2.4s ease-in-out infinite; }
.dice.wait::before {
  content: "";
  position: absolute; inset: 4px;
  border-radius: 50%;
  border: 2px solid var(--brass);
  animation: ring 1.8s ease-out infinite;
  pointer-events: none;
}
@keyframes bob  { 50% { transform: translateY(-5px); } }
@keyframes ring { 0% { transform: scale(.7); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
.dice.rolling::before { display: none; }   /* atış ve yuvarlanma animasyonu script.js'te (rollDice) */
.dice.nudge { animation: nudge .5s ease-in-out; }
@keyframes nudge { 25% { transform: rotate(-12deg) scale(1.15); } 60% { transform: rotate(10deg) scale(1.15); } }

.tilt {
  position: absolute; inset: 0;
  margin: auto;
  width: var(--d); height: var(--d);
  transform-style: preserve-3d;
  transform: rotateX(-52deg);   /* masadaki zara yukarıdan bakış: sonuç olan üst yüz öne çıkar */
  pointer-events: none;
}
.cube {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
}
.face {
  position: absolute; inset: 0;
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  padding: 7px;
  border-radius: 9px;
  background: linear-gradient(145deg, #ffffff, #e9e3d3);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1), inset 0 -3px 6px rgba(0, 0, 0, .1);
  backface-visibility: hidden;
}
.pip {
  place-self: center;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #17181a;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6);
}
.f1 .pip { width: 11px; height: 11px; background: #d63a30; }
.f1 { transform: rotateY(0deg)   translateZ(calc(var(--d) / 2)); }
.f6 { transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); }
.f3 { transform: rotateY(90deg)  translateZ(calc(var(--d) / 2)); }
.f4 { transform: rotateY(-90deg) translateZ(calc(var(--d) / 2)); }
.f2 { transform: rotateX(90deg)  translateZ(calc(var(--d) / 2)); }
.f5 { transform: rotateX(-90deg) translateZ(calc(var(--d) / 2)); }

/* ---------- 4) BUTONLAR ---------- */

.actions {
  flex: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.btn {
  height: 54px;
  padding: 0 18px;
  border-radius: 17px;
  font: 800 15px/1 var(--font);
  letter-spacing: .1em;
  transition: transform .12s, opacity .2s, background .2s;
}
.btn:active { transform: scale(.96); }
.actions .btn { flex: 1 1 0; min-width: 0; padding: 0 8px; white-space: nowrap; letter-spacing: .06em; }

.btn-new {
  background: linear-gradient(180deg, #8a3a2c, #62241b);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 6px 14px rgba(0, 0, 0, .4);
}
.btn-undo {
  background: linear-gradient(180deg, #2a3633, #1c2624);
  border: 1.5px solid rgba(223, 184, 95, .55);
  color: var(--brass);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .4);
}
.btn:disabled { opacity: .35; pointer-events: none; }

.btn.ghost   { background: rgba(255, 255, 255, .08); }
.btn.primary { background: linear-gradient(180deg, #e7c370, #c59a3e); color: #241a06; }
.btn.danger  { background: linear-gradient(180deg, #b44a38, #7d2a1e); }

/* ---------- ALT PANELLER ---------- */

/* çıkışta pencere kapanmazsa: veda ekranı */
.bye {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  padding: 24px;
  background: radial-gradient(120% 70% at 50% -10%, #1d2c28 0%, var(--bg) 62%);
  text-align: center;
}
.bye[hidden] { display: none; }
.bye-box { max-width: 340px; }
.bye h2 { margin: 0 0 10px; font: 800 26px/1.2 var(--font); color: var(--brass); }
.bye p { margin: 0 0 8px; font: 600 16px/1.4 var(--font); }
.bye .bye-how { margin-bottom: 22px; color: var(--muted); font-weight: 500; font-size: 14px; }
.bye .btn { width: 100%; }

.overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .58);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
  z-index: 50;
}
.overlay.open { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-width: 520px;
  margin: 0 auto;
  padding: 10px 18px calc(env(safe-area-inset-bottom, 0px) + 18px);
  max-height: 92dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 28px 28px 0 0;
  background: linear-gradient(180deg, #1c2825, #131c1a);
  border-top: 1px solid rgba(223, 184, 95, .4);
  box-shadow: 0 -20px 50px rgba(0, 0, 0, .6);
  transform: translateY(108%);
  transition: transform .38s cubic-bezier(.2, .9, .3, 1);
  z-index: 60;
}
.sheet.open { transform: none; }

.grabber { width: 42px; height: 5px; margin: 0 auto 14px; border-radius: 3px; background: rgba(255, 255, 255, .22); }
.sheet h2 { margin: 0; font: 800 21px/1.2 var(--font); }
.sub { margin: 4px 0 14px; color: var(--muted); font: 500 14px/1.35 var(--font); }

.picker-head { display: flex; align-items: flex-start; justify-content: space-between; }
.mini-tile {
  width: 48px; height: 66px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 9px;
  background: linear-gradient(160deg, var(--ivory-1), var(--ivory-2));
  box-shadow: 0 4px 0 var(--ivory-edge), 0 8px 12px rgba(0, 0, 0, .4);
  font: 800 32px/1 var(--font-round);
  color: var(--tc, #b3a578);
}
.mini-tile .ring { width: 11px; height: 11px; margin-top: 4px; border-radius: 50%; border: 3px solid var(--tc); }

.color-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.color-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .06);
  border: 2px solid transparent;
  text-align: left;
  transition: border-color .15s, background .15s, transform .12s;
}
.color-btn:active { transform: scale(.97); }
.color-btn i {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, .35), 0 0 0 3px rgba(255, 255, 255, .12);
}
.color-btn b { font: 700 16px/1.1 var(--font); }
.color-btn small { margin-left: auto; color: var(--muted); font: 600 12px/1 var(--font); }
.color-btn.sel { border-color: var(--brass); background: var(--brass-soft); }

.num-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 16px;
  transition: opacity .25s;
}
.num-grid.locked { opacity: .3; pointer-events: none; }
.num-grid[hidden] { display: none; }
.num-btn {
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  background: linear-gradient(160deg, var(--ivory-1), var(--ivory-2));
  box-shadow: 0 3px 0 var(--ivory-edge);
  color: var(--sel, #222);
  font: 800 23px/1 var(--font-round);
  transition: transform .1s, box-shadow .1s;
}
.num-btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ivory-edge); }


.preview { margin: 16px 0 16px; text-align: center; font: 600 16px/1.3 var(--font); color: var(--muted); }
.preview b { color: var(--brass); font-size: 20px; }

.sheet-actions { display: flex; gap: 12px; margin-top: 8px; }
.sheet-actions .btn { flex: 1; }
.answer-acts { display: flex; gap: 8px; margin: 4px 0 14px; }
.answer-acts .act { flex: 1; height: 58px; }

/* küçük ekranlar için sıkıştır */
@media (max-height: 700px) {
  .scoreboard .sb-score { font-size: 28px; padding: 6px 0 9px; }
  .seat { padding: 6px 12px; min-width: 84px; }
  .btn { height: 46px; }
}

/* ==========================================================
   KAPATMA EKLERİ
   ========================================================== */

.toast span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* skor tabelası durumları */
.sb-score.out { color: #ff6b57; opacity: .8; }
.sb-score.out .flaps::after {          /* elenen: levhaların üstünden çizgi */
  content: "";
  position: absolute; left: -4px; right: -4px; top: 50%;
  height: 3px; margin-top: -1.5px;
  border-radius: 2px;
  background: #ff6b57;
  z-index: 4;
}
.sb-name.out input { color: #ff6b57; text-decoration: line-through; opacity: .8; }

/* masa köşe etiketleri */
.pill {
  position: absolute;
  top: 22px;
  z-index: 3;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .34);
  border: 1.5px solid rgba(255, 255, 255, .14);
  font: 800 11px/1.1 var(--font);
  letter-spacing: .1em;
  color: var(--text);
}
.pill-retro { left: 24px; cursor: pointer; color: var(--brass); }
.pill-retro:active { transform: scale(.95); }
.pill-arch { left: 24px; top: auto; bottom: 22px; cursor: pointer; color: var(--brass); }
.pill-arch:active { transform: scale(.95); }
.version {
  position: absolute; right: 28px; bottom: 64px; z-index: 3;   /* ÇIKIŞ'ın üstünde: yanında Güney koltuğuna biniyor */
  font: 700 11px/1 var(--font); letter-spacing: .06em;
  color: rgba(243, 238, 226, .4);
  pointer-events: none;
}
.pill-exit { right: 24px; top: auto; bottom: 22px; cursor: pointer; color: #ff8a7a; }
.pill-exit:active { transform: scale(.95); }
.pill-hand { right: 24px; display: flex; align-items: center; gap: 7px; }
.pill-hand i { width: 11px; height: 11px; border-radius: 50%; background: var(--c, #777); box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }

/* koltuk durumları */
.seat-meta {
  display: block;
  min-height: 13px;
  margin-top: 4px;
  font: 700 10.5px/1.2 var(--font);
  letter-spacing: .04em;
  color: rgba(243, 238, 226, .72);
  white-space: normal;
}
.seat-meta .tag { display: inline-block; margin: 0 2px; padding: 1px 5px; border-radius: 6px; background: rgba(255, 255, 255, .12); }
.seat-meta .tag.warn { background: rgba(214, 58, 48, .55); color: #fff; }
.seat-meta .tag.ok { background: rgba(223, 184, 95, .3); color: var(--brass); }

.seat.turn {
  border-color: var(--brass);
  background: rgba(223, 184, 95, .22);
  box-shadow: 0 0 26px rgba(223, 184, 95, .55);
  animation: turn 1.2s ease-in-out infinite;
}
@keyframes turn { 50% { box-shadow: 0 0 40px rgba(223, 184, 95, .85); } }
.seat.passed { opacity: .5; }
.seat.out { opacity: .45; border-color: rgba(214, 58, 48, .7); }
.seat.out .seat-name, .seat.out .seat-score { text-decoration: line-through; }
.seat.out .seat-score { color: #ff6b57; }

/* karar paneli (taşın altında) */
.panel {
  position: absolute;
  top: 100%;
  left: 50%;
  translate: -50% 0;
  margin-top: 22px;
  width: min(372px, calc(100vw - 70px));
  text-align: center;
  z-index: 4;
}
.panel-note {
  margin: 0;
  font: 600 13px/1.35 var(--font);
  color: rgba(243, 238, 226, .8);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}
.panel-note b { color: var(--brass); }
.panel.tucked { visibility: hidden; }   /* Güney'de yer yoksa cevap düğmeleri yazının yerine geçer */
.panel-sub { margin: 3px 0 0; font: 600 11.5px/1.3 var(--font); color: rgba(243, 238, 226, .55); }

/* cevap düğmeleri: sıradaki oyuncunun yanına uçar (script.js: flyDock) */
.dock {
  position: absolute;
  z-index: 5;
  display: flex;
  gap: var(--dock-gap, 8px);
  transform-origin: 50% 50%;
}
.dock[hidden] { display: none; }
.dock .act { height: var(--act-h, 58px); }
.dock.vert { flex-direction: column; }
.dock.vert .act { flex: none; }
.dock.flying { pointer-events: none; }
.dock.wobble { animation: dock-wobble .75s cubic-bezier(.3, .6, .4, 1); }
@keyframes dock-wobble {
  0%   { rotate: 0deg;    scale: 1; }
  12%  { rotate: -7deg;   scale: 1.07; }
  28%  { rotate: 6deg;    scale: 1; }
  44%  { rotate: -4deg; }
  60%  { rotate: 2.5deg; }
  76%  { rotate: -1deg; }
  100% { rotate: 0deg; }
}
@media (prefers-reduced-motion: reduce) {
  .dock.wobble { animation: none; }
}
.act {
  flex: 1;
  height: 58px;
  border-radius: 15px;
  font: 800 14px/1 var(--font);
  letter-spacing: .06em;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .22);
  transition: transform .12s, opacity .2s;
}
.act small { font: 700 11px/1 var(--font); opacity: .85; letter-spacing: .02em; }
.act:active { transform: scale(.95); }
.act.varim  { background: linear-gradient(180deg, #2f9b59, #1b6a3a); }
.act.kapali { background: linear-gradient(180deg, #e7c370, #c59a3e); color: #241a06; }
.act.pas    { background: linear-gradient(180deg, #b44a38, #7d2a1e); }
.act.off { opacity: .32; filter: grayscale(.5); }
.act.risk small { color: #ffd166; opacity: 1; }


/* bitiş türü */
.kinds { display: grid; gap: 7px; }
.kind {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-radius: 13px;
  background: rgba(255, 255, 255, .06);
  border: 2px solid transparent;
  font: 700 15px/1.1 var(--font);
  text-align: left;
  transition: border-color .15s, background .15s;
}
.kind b { color: var(--brass); font: 800 16px/1 var(--font-round); }
.kind.on { border-color: var(--brass); background: var(--brass-soft); }

.penalty-list { margin: 12px 0 14px; display: grid; gap: 5px; }
.pen-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: 11px;
  background: rgba(0, 0, 0, .25);
  font: 600 14px/1.2 var(--font);
}
.pen-row .who { flex: 1; font-weight: 700; }
.pen-row .neg { color: #ff8a73; font: 800 15px/1 var(--font-round); }
.pen-row .arrow { color: var(--muted); font-size: 13px; }
.pen-row .flag { padding: 2px 7px; border-radius: 6px; background: rgba(214, 58, 48, .6); color: #fff; font: 800 10px/1.3 var(--font); letter-spacing: .06em; }
.pen-row.exempt { opacity: .55; }

/* arşiv */
.arch-list { list-style: none; margin: 0 0 12px; padding: 0; max-height: 56dvh; overflow-y: auto; display: grid; gap: 8px; }
.arch-list li.hist-empty { padding: 14px 12px; border-radius: 12px; background: rgba(0, 0, 0, .25); color: var(--muted); font: 600 13.5px/1.35 var(--font); }
.arch-item {
  width: 100%; display: block; text-align: left; padding: 11px 13px; border-radius: 13px;
  background: rgba(0, 0, 0, .25); border: 1px solid var(--line); color: var(--text); cursor: pointer;
}
.arch-item:active { transform: scale(.98); }
.arch-top { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font: 700 11.5px/1.2 var(--font); letter-spacing: .04em; }
.arch-champ { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; font: 800 16px/1.2 var(--font); }
.arch-champ b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arch-champ span { color: var(--brass); font: 800 18px/1 var(--font-round); font-variant-numeric: tabular-nums; }
.arch-rest { margin-top: 5px; color: var(--muted); font: 600 12px/1.3 var(--font); }
.arch-rest s { color: #ff8a73; opacity: .85; }
.hist-empty { color: var(--muted); text-align: center; padding: 18px 0; font: 500 14px/1.3 var(--font); }

/* oyun sonu: lig puan tablosu */
#sheetOver { --win: #3ecf7a; --lose: #ff6b57; --pas: #e9b949; }

.st-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 12px; }
.st-kicker { display: block; margin-bottom: 3px; color: var(--brass); font: 800 11px/1 var(--font); letter-spacing: .18em; }
.st-final {
  padding: 5px 9px; border-radius: 6px;
  background: rgba(255, 255, 255, .08); color: var(--muted);
  font: 800 10.5px/1 var(--font); letter-spacing: .14em;
}

.st-champ { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 12px 14px; border-radius: 14px;
  background: linear-gradient(100deg, rgba(223, 184, 95, .28), rgba(223, 184, 95, .06));
  border: 1px solid rgba(223, 184, 95, .5); }
.st-champ:empty { display: none; }
.st-cup { font-size: 28px; line-height: 1; }
.st-champ div { flex: 1; min-width: 0; }
.st-champ small { display: block; color: var(--brass); font: 800 10.5px/1 var(--font); letter-spacing: .16em; }
.st-champ b { display: block; margin-top: 4px; font: 800 20px/1.1 var(--font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-champ-pts { font: 800 30px/1 var(--font-round); color: var(--brass); font-variant-numeric: tabular-nums; }

.standings { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: rgba(0, 0, 0, .22); }
.st-row {
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 22px 22px 34px 78px 40px;
  align-items: center; column-gap: 4px;
  padding: 9px 10px 9px 12px;
  font: 700 14px/1.1 var(--font);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
#stBody .st-row + .st-row { border-top: 1px solid var(--line); }
#stBody .st-row:nth-child(even) { background: rgba(255, 255, 255, .025); }
.st-row::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.st-row.z-win::before { background: var(--win); }
.st-row.z-out::before { background: var(--lose); }
.st-row.z-out { color: var(--muted); }
.st-row.top { background: rgba(223, 184, 95, .08) !important; }

.st-cols { padding-top: 8px; padding-bottom: 8px; background: rgba(255, 255, 255, .06); color: var(--muted); font: 800 10.5px/1 var(--font); letter-spacing: .1em; }
.c-name { text-align: left; min-width: 0; }
.c-name b { display: block; font: 800 15px/1.15 var(--font); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.z-out .c-name b { color: var(--muted); }
.c-name small { display: block; margin-top: 2px; font: 600 11px/1 var(--font); color: var(--muted); }
.c-rank { font: 800 15px/1 var(--font-round); }
.top .c-rank { color: var(--brass); }
.c-neg { color: #ff8a73; }
.c-pts { font: 800 19px/1 var(--font-round); color: var(--text); text-align: right; }
.st-cols .c-pts { font: inherit; color: inherit; }
.top .c-pts { color: var(--brass); }
.z-out .c-pts { color: var(--lose); }

.c-form { display: flex; justify-content: center; gap: 3px; }
.c-form i, .st-key b {
  display: inline-grid; place-items: center;
  width: 13px; height: 13px; border-radius: 3px;
  font: 800 8.5px/1 var(--font); font-style: normal; color: #0b1211;
}
.f-b { background: var(--win); }
.f-p { background: var(--pas); }
.f-c { background: var(--lose); }

.st-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 9px 2px 12px; color: var(--muted); font: 600 11.5px/1 var(--font); }
.st-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.st-legend i { width: 4px; height: 12px; border-radius: 2px; }
.st-legend i.z-win { background: var(--win); }
.st-legend i.z-out { background: var(--lose); }
.st-key { margin-left: auto; }
.st-key b { margin-left: 3px; }

.st-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.st-stats div { padding: 10px 6px; border-radius: 12px; background: rgba(0, 0, 0, .22); border: 1px solid var(--line); text-align: center; }
.st-stats b { display: block; font: 800 20px/1 var(--font-round); color: var(--text); font-variant-numeric: tabular-nums; }
.st-stats small { display: block; margin-top: 5px; color: var(--muted); font: 800 9.5px/1.1 var(--font); letter-spacing: .1em; }

@media (max-height: 760px) {
  .act { height: 50px; }
  .panel { margin-top: 12px; }
}

/* ---------- RETRO: ahşap altlıkta mürekkeple tutulan oyun defteri ---------- */
@font-face {
  font-family: "Caveat";
  src: url("assets/fonts/caveat.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

.retro-view {
  --ink: #1d2a52;           /* demir-mazı mürekkebi: lacivert-siyah */
  --ink-red: #a8261d;
  --ink-font: "Caveat", "Bradley Hand", "Segoe Print", cursive;
  --paper: #f4ead3;
  --paper-rule: rgba(67, 104, 158, .26);
  --paper-margin: rgba(181, 62, 48, .5);
  --print: #8a6a3a;         /* basılı form yazıları */

  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding:
    calc(env(safe-area-inset-top, 0px) + 8px)
    12px
    calc(env(safe-area-inset-bottom, 0px) + 10px);
  background: radial-gradient(120% 70% at 50% -10%, #1d2c28 0%, var(--bg) 62%);
}
.retro-view[hidden], .retro-modal[hidden] { display: none; }
body.retro-open { overflow: hidden; }
body.retro-open .overlay { z-index: 130; }
body.retro-open .sheet { z-index: 140; }
/* RETRO'da cevap, KAPALI ve gösterge (renk/sayı) panelleri alttan çıkmaz: parmağın kolay ulaştığı, ortanın biraz altında yüzen bir kart olur */
body.retro-open #sheetAnswer,
body.retro-open #sheetKapali,
body.retro-open #sheetPicker {
  top: 56%;
  bottom: auto;
  left: 16px;
  right: 16px;
  padding-bottom: 18px;
  border: 1px solid rgba(223, 184, 95, .4);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .6);
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(-50% + 24px)) scale(.96);
  transition: transform .28s cubic-bezier(.2, .9, .3, 1), opacity .2s;
}
body.retro-open #sheetAnswer.open,
body.retro-open #sheetKapali.open,
body.retro-open #sheetPicker.open { opacity: 1; pointer-events: auto; transform: translateY(-50%); }
body.retro-open #sheetAnswer .grabber,
body.retro-open #sheetKapali .grabber,
body.retro-open #sheetPicker .grabber { display: none; }
body.retro-open #sheetPicker { max-height: calc(100dvh - 32px); overflow-y: auto; }   /* sayı ızgarası açılınca da ekrana sığsın */
/* cevap verilince düğmeler dört bir yana savrulur, kart da ardından söner */
.answer-acts .act.fly {
  transition: transform .42s cubic-bezier(.4, 0, .9, .4), opacity .42s ease-in;
  transform: translate(var(--fx), var(--fy)) rotate(var(--fr)) scale(.6);
  opacity: 0;
  pointer-events: none;
}
#sheetAnswer.scatter { pointer-events: none; overflow: visible; }
#sheetAnswer.scatter > :not(.answer-acts) { opacity: 0; transition: opacity .3s .1s; }
@media (prefers-reduced-motion: reduce) {
  .answer-acts .act.fly { transition: opacity .2s; transform: none; }
}
body.retro-open .toast { z-index: 160; }   /* RETRO açıkken uyarılar defterin üstünde görünsün */

/* masa çerçevesiyle aynı ahşap: defterin altlığı */
.retro-board {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 620px);
  height: 100%;
  min-height: 0;
  padding: 22px 10px 12px;
  border-radius: 30px;
  background:
    repeating-linear-gradient(97deg, rgba(0, 0, 0, .06) 0 2px, transparent 2px 9px, rgba(255, 255, 255, .03) 9px 10px, transparent 10px 17px),
    linear-gradient(145deg, var(--wood-1), var(--wood-2));
  box-shadow: 0 18px 40px rgba(0, 0, 0, .55), inset 0 2px 0 rgba(255, 255, 255, .18), inset 0 -2px 0 rgba(0, 0, 0, .3);
}

/* pirinç sıkıştırma klipsi */
.retro-clip {
  position: absolute;
  top: 6px;
  left: 50%;
  z-index: 4;
  width: 132px;
  height: 34px;
  margin-left: -66px;
  border-radius: 12px 12px 8px 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .45), transparent 30%),
    linear-gradient(90deg, #8c6425, #f0cf82 30%, #c79a45 60%, #7a5a22);
  border: 1px solid #5a3f14;
  box-shadow: inset 0 -3px 0 rgba(90, 63, 20, .35), 0 4px 6px rgba(0, 0, 0, .4), 0 1px 0 rgba(255, 238, 190, .3);
}
.retro-clip::before {        /* klipsin kâğıda basan dili */
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: -9px;
  height: 11px;
  content: "";
  border: 1px solid #5a3f14;
  border-top: 0;
  border-radius: 0 0 9px 9px;
  background: linear-gradient(90deg, #7a5a22, #e3bd6c 40%, #a57b33);
  box-shadow: 0 3px 4px rgba(40, 25, 10, .3);
}
.retro-clip i {              /* pim */
  position: absolute;
  top: 9px;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff2c8, #c79a45 45%, #5a3f14);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .4);
}

.retro-paper {
  position: relative;
  isolation: isolate;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  padding: 26px 12px 8px;
  overflow: hidden;
  border-radius: 14px;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 90% 8%, rgba(150, 105, 50, .10), transparent 120px),
    radial-gradient(ellipse at 6% 96%, rgba(140, 95, 45, .12), transparent 150px),
    radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(140, 100, 50, .14)),
    var(--paper);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(120, 85, 40, .2);
}
.retro-paper::before {       /* kâğıt lifi */
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: .5;
  background:
    repeating-linear-gradient(23deg, rgba(120, 90, 50, .035) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(-61deg, rgba(120, 90, 50, .03) 0 1px, transparent 1px 11px);
}

.retro-kicker {
  margin: 0;
  color: var(--print);
  font: 800 10px/1.1 var(--font);
  letter-spacing: .22em;
}
/* divit sol üst hücrede durur: dokununca hokkaya batırılır ve el başlar */
.retro-pen-rest {
  display: block;
  width: 36px;
  height: 51px;
  margin: 0 auto;
  overflow: visible;
  filter: drop-shadow(0 2px 1.5px rgba(60, 40, 20, .25));
}
.retro-quill.away { visibility: hidden; }

/* yazarken kâğıt üzerinde gezen divit: öğenin sol üst köşesi uç noktasıdır */
.retro-pen {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 6;
  width: 0;
  height: 0;
  transform-origin: 0 0;
  pointer-events: none;
  will-change: transform;
}
.retro-pen[hidden] { display: none; }
.retro-pen svg {
  position: absolute;
  overflow: visible;
  filter: drop-shadow(3px 5px 3px rgba(40, 25, 10, .35));
  animation: retro-pen-in .25s ease-out both;
}
.retro-pen .pen-ink { fill: #14204a; opacity: .92; }
.retro-pen.red .pen-ink { fill: #a8261d; }
.retro-quill { transform-origin: 134px 45px; }
.retro-quill.dipping { animation: retro-dip .82s ease-in-out both; }
@keyframes retro-dip {
  0% { transform: translate(0, 0) rotate(0); }
  30% { transform: translate(-4px, -12px) rotate(-8deg); }
  62% { transform: translate(0, 7px) rotate(2deg); }
  100% { transform: translate(0, 0) rotate(0); }
}
@keyframes retro-pen-in { from { opacity: 0; } }

.retro-error {
  position: relative;
  z-index: 1;
  flex: none;
  margin: 5px 8px 0;
  color: var(--ink-red);
  font: 700 12px/1.3 var(--font);
}
.retro-error[hidden] { display: none; }

.retro-scroll {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 4px;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: rgba(138, 106, 58, .45) transparent;
}

/* çizgili defter: mavi satır çizgileri, kırmızı kenar boşluğu */
.ledger {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  color: var(--ink);
}
.ledger th, .ledger td {
  position: relative;
  width: 20.5%;   /* el sütunundan artan yer dört oyuncuya eşit bölünür */
  height: 48px;
  padding: 3px 2px;
  border-bottom: 1px solid var(--paper-rule);
  text-align: center;
  vertical-align: middle;
}
.ledger td + td { border-left: 1px solid rgba(67, 104, 158, .1); }
/* sütunlar bir açık bir koyu: 2. ve 4. sütun (Kuzey, Güney) hafif tonlu (başlık yapışkan olduğu için kâğıt rengi üstüne) */
.ledger tr > :nth-child(even) { background: rgba(138, 106, 58, .075); }
.ledger thead th:nth-child(even) { background: linear-gradient(rgba(138, 106, 58, .075), rgba(138, 106, 58, .075)), var(--paper); }
.ledger th:first-child, .ledger td:first-child {
  width: 18%;     /* BAŞLAT yazısı ve gösterge taşı sığacak kadar */
  border-right: 3px double var(--paper-margin);
}
.ledger thead { position: sticky; top: 0; z-index: 3; }
.ledger thead th + th { user-select: none; -webkit-user-select: none; }
.ledger thead th.name-held { background: rgba(138, 106, 58, .2); }   /* uzun basış tuttu: bırakınca isim düzenlenir */
/* defterde ismi düzenlerken: mürekkep yazısı, altında silik bir çizgi */
.ledger-name-input {
  width: 100%;
  padding: 0;
  border: 0;
  border-bottom: 1.5px dashed rgba(20, 32, 74, .45);
  border-radius: 0;
  outline: none;
  background: rgba(255, 250, 235, .7);
  color: inherit;
  font: inherit;
  text-align: center;
}
.ledger thead th {
  height: 44px;
  padding-bottom: 3px;
  background: var(--paper);
  border-bottom: 1.5px solid rgba(138, 106, 58, .5);
  color: var(--ink);
  font: 700 27px/1 var(--ink-font);
  letter-spacing: -.01em;
  vertical-align: bottom;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ledger thead th + th { padding-right: 5px; padding-left: 5px; }   /* isimler komşu sütuna değmesin */
.ledger thead th:first-child { padding: 0 2px 2px; overflow: visible; text-align: center; }
/* BAŞLAT: defterin başına mürekkeple, el yazısıyla yazılmış */
.ledger-start {
  display: block;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: transform .12s;
}
.ledger-start:active { transform: translateY(1px); }
.ledger-start:disabled { opacity: .45; cursor: default; background: transparent; }
.ledger-start:focus-visible { outline: 2px solid var(--print); outline-offset: 2px; }
.ledger tbody th { font-weight: 400; }
.ledger-hand-cell { padding-left: 1px !important; padding-right: 1px !important; }
.ledger-hand {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 3px 1px;
  border-radius: 10px;
  color: inherit;
  background: transparent;
  text-align: left;
}
.ledger-hand:active { background: rgba(138, 106, 58, .12); }

/* gösterge: masadaki fildişi taşın küçüğü */
.ledger-indicator {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 37px;
  border-radius: 6px;
  background: linear-gradient(160deg, var(--ivory-1), var(--ivory-2));
  color: var(--indicator-color, #76613b);
  font: 800 19px/1 var(--font-round);
  letter-spacing: -.03em;
  box-shadow: inset 0 1px 0 #fff, 0 2px 0 var(--ivory-edge), 0 3px 4px rgba(60, 40, 20, .3);
  transform: rotate(-3deg);
}
.ledger-indicator-draggable { touch-action: none; cursor: grab; user-select: none; }
.ledger-indicator-ghost {
  position: fixed;
  z-index: 150;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1.15) rotate(-6deg);
}
.ledger tr > .finish-target {
  background: rgba(138, 106, 58, .24);
  outline: 2px solid var(--print);
  outline-offset: -2px;
}
.ledger-cell { font: 600 28px/1 var(--ink-font); text-shadow: 0 0 .5px rgba(29, 42, 82, .55); }
/* el yazısı gibi: satırdan satıra hafifçe değişen eğim */
.ledger-row:nth-child(3n + 1) .ledger-cell > * { rotate: -1.5deg; }
.ledger-row:nth-child(3n + 2) .ledger-cell > * { rotate: 1deg; }
.ledger-score { display: inline-block; font-size: 31px; }
/* PAS yasağı: sayının hemen sağına, biraz yukarıya kırmızı X */
.ledger-ban-mark {
  display: inline-block;
  margin: 0 -10px 0 2px;
  color: var(--ink-red);
  font: 700 27px/1 var(--ink-font);
  vertical-align: baseline;
  transform: rotate(-6deg);
}
/* bitiren: tüy kalemle çekilmiş tek çizgi ya da XXX */
.ledger-finish { display: inline-block; min-width: 26px; }
.ledger-finish.single {
  width: 40px;
  height: 4px;
  border-radius: 2px 50% 50% 1px;
  background: linear-gradient(90deg, var(--ink), rgba(29, 42, 82, .75));
  vertical-align: middle;
  transform: rotate(-4deg);
}
.ledger-finish.triple { font-size: 26px; letter-spacing: .02em; }
.ledger-eliminated-score {
  display: inline-block;
  padding: 1px 7px 2px;
  border: 2px solid var(--ink-red);
  border-radius: 48% 55% 45% 52% / 55% 45% 58% 44%;
  color: var(--ink-red);
  transform: rotate(-7deg);
}
.ledger-out-label {
  display: block;
  margin-top: 1px;
  color: var(--ink-red);
  font: 700 17px/1 var(--ink-font);
  letter-spacing: .04em;
}
.ledger-cross {
  position: absolute;
  inset: 6px 10px;
  background:
    linear-gradient(140deg, transparent calc(50% - 1.2px), rgba(29, 42, 82, .55) 50%, transparent calc(50% + 1px)),
    linear-gradient(38deg, transparent calc(50% - 1px), rgba(29, 42, 82, .5) 50%, transparent calc(50% + 1.2px));
}
.active-hand { background: linear-gradient(90deg, rgba(223, 184, 95, .2), rgba(223, 184, 95, .06)); }
/* mürekkeple yazılış: soldan sağa açılır, ıslak mürekkep koyu başlar ve kurur */
.ledger-row.writing > * { clip-path: inset(0 100% 0 0); }
.ledger-row.written > * { clip-path: inset(0); transition: clip-path .38s ease-out; }
.ledger-row.writing.written > td { animation: ink-dry 1.6s ease-out both; }
.ledger-row.written > *:nth-child(2) { transition-delay: .08s; animation-delay: .08s; }
.ledger-row.written > *:nth-child(3) { transition-delay: .14s; animation-delay: .14s; }
.ledger-row.written > *:nth-child(4) { transition-delay: .2s; animation-delay: .2s; }
.ledger-row.written > *:nth-child(5) { transition-delay: .26s; animation-delay: .26s; }
@keyframes ink-dry {
  from { filter: brightness(.55) saturate(1.8) drop-shadow(0 0 1px rgba(20, 35, 90, .55)); }
  to { filter: none; }
}
.ledger-cell.wet, .ledger-ban-mark.wet { animation: ink-dry 1.6s ease-out both; }
.retro-view.skip-writing .ledger-row > * { clip-path: none; transition: none; animation: none; }


/* uzun oyun: defter sayfa sayfa devam eder */
.retro-pager {
  position: relative;
  z-index: 1;
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 0 -2px;
  padding-top: 4px;
  border-top: 1px solid rgba(138, 106, 58, .3);
}
.retro-pager[hidden] { display: none; }
.retro-page-no { color: var(--ink); font: 700 24px/1 var(--ink-font); }
.retro-page-btn {
  width: 44px;
  height: 40px;
  border-radius: 12px;
  background: rgba(138, 106, 58, .12);
  color: var(--ink);
  font: 700 30px/1 var(--ink-font);
}
.retro-page-btn:active { transform: scale(.94); }
.retro-page-btn:disabled { opacity: .25; pointer-events: none; }
/* sayfa köşesi: kıvrık kulak; sürüklendikçe büyür, yeterince çekilince sayfa çevrilir */
.retro-corner {
  position: absolute;
  bottom: 0;
  z-index: 7;
  width: 60px;
  height: 60px;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.retro-corner[hidden] { display: none; }
.retro-corner.left { left: 0; }
.retro-corner.right { right: 0; }
.retro-corner.dragging { cursor: grabbing; }
.retro-corner i {
  position: absolute;
  bottom: 0;
  width: 24px;
  height: 24px;
  pointer-events: none;
  filter: drop-shadow(-2px -2px 3px rgba(60, 40, 20, .3));
  transition: width .22s ease-out, height .22s ease-out;
}
.retro-corner.dragging i { transition: none; }
/* köşegenin dış yarısı alttaki sayfa, iç yarısı kâğıdın kıvrılan arka yüzü */
.retro-corner.right i { right: 0; background: linear-gradient(to top left, #cbb68b 50%, #fbf5e4 50%, #e6d7b5); }
.retro-corner.left i { left: 0; background: linear-gradient(to top right, #cbb68b 50%, #fbf5e4 50%, #e6d7b5); filter: drop-shadow(2px -2px 3px rgba(60, 40, 20, .3)); }
/* birden fazla sayfa varsa kâğıdın altında sayfa kenarları görünür */
.retro-paper.multi { box-shadow: 0 6px 14px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(120, 85, 40, .2), 0 3px 0 -1px #e2d3b3, 0 6px 0 -2px #cfbf9c; }

.retro-return { box-shadow: inset 0 1px 0 rgba(255, 245, 210, .6), 0 6px 14px rgba(0, 0, 0, .4); }
/* masadaki alt düğmeler gibi: üçü eşit genişlikte, yan yana */
.retro-actions { display: flex; flex: none; gap: 10px; margin: 12px 2px 0; }
/* yazı ekran genişliğiyle küçülür: en uzun etiket (OYUNA DÖN) dar telefonlarda da düğmeye sığar */
.retro-actions .btn { flex: 1 1 0; min-width: 0; padding: 0 6px; white-space: nowrap; font-size: clamp(11px, 3.3vw, 15px); letter-spacing: .04em; }
/* GERİ AL'in çerçevesi kadar görünmez çerçeve: üç düğme piksel piksel aynı genişlikte */
.retro-actions .btn:not(.btn-undo) { border: 1.5px solid transparent; }
.retro-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, .58);
}
.retro-dialog {
  --ink: #1d2a52;
  --ink-font: "Caveat", "Bradley Hand", "Segoe Print", cursive;
  position: relative;
  width: min(100%, 440px);
  max-height: min(78dvh, 680px);
  overflow: auto;
  padding: 22px 20px 16px;
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(140, 100, 50, .14)),
    #f4ead3;
  color: var(--ink);
  box-shadow: 0 0 0 8px #5a3418, 0 0 0 9px rgba(255, 255, 255, .12), 0 18px 40px rgba(0, 0, 0, .55);
}
.retro-dialog .retro-kicker { color: #8a6a3a; }
.retro-dialog h2 { margin: 2px 40px 8px 0; font: 700 38px/1.1 var(--ink-font); }
.retro-dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(138, 106, 58, .14);
  color: var(--ink);
  font: 700 30px/1 var(--ink-font);
}
.retro-details { margin: 0; padding: 0 0 0 24px; }
.retro-details li {
  padding: 7px 2px;
  border-bottom: 1px solid rgba(67, 104, 158, .26);
  font: 500 24px/1.25 var(--ink-font);
}
.retro-details li::marker { color: #8a6a3a; font: 700 17px var(--ink-font); }
.retro-detail-empty { list-style: none; margin-left: -24px; color: #6c5638; }

@media (prefers-reduced-motion: reduce) {
  .retro-quill.dipping { animation: none; }
  .ledger-row.writing > *, .ledger-row.written > * { clip-path: none; transition: none; animation: none; }
}

/* yan koltuklar sabit genişlikte, durum satırı sarılır (zarla çakışmasın) */
.seat-w, .seat-e { width: 112px; min-width: 0; }

