/* Okey — tavla ile ortak tasarım dili: ceviz ahşap, krem taşlar, altın detaylar */
:root {
  --bg: #100b07; --panel-1: #2c1d13; --line: rgba(212, 169, 79, .32); --line-strong: rgba(212, 169, 79, .7);
  --text: #f3e9d6; --muted: #b5a385; --gold: #d4a94f; --gold-light: #f3d98f; --cream: #f4e7c8;
  --green-1: #46a253; --green-2: #1d6430; --red-1: #c2402f; --red-2: #7c1a11;
  --felt: #1f5c3c; --serif: Georgia, "Times New Roman", serif; --tap: 46px;
  --c0: #c0392b; --c1: #d99a1e; --c2: #1f5fb3; --c3: #1d1b1a;
  --tile-w: 46px; --tile-h: 64px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(120, 70, 30, .28), transparent 70%), url("../assets/bg-pattern.svg"), linear-gradient(180deg, #160f0a, var(--bg));
  background-attachment: fixed; color: var(--text); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overscroll-behavior: none;
}
button, input { font: inherit; color: inherit; }
button { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 2px; }
[hidden] { display: none !important; }
.icon { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.icon.gold { color: var(--gold); }

.screen { display: none; min-height: 100dvh; }
.screen.active { display: flex; animation: screenIn .28s ease-out; }
@keyframes screenIn { from { opacity: 0; transform: translateY(6px); } }
#home, #rules { align-items: center; justify-content: center; padding: 16px; }

.menu-card, .modal-card {
  position: relative; background: linear-gradient(180deg, rgba(255, 255, 255, .045), transparent 30%), url("../assets/wood-panel.svg") center / cover, var(--panel-1);
  border-radius: 22px; box-shadow: 0 18px 50px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(0, 0, 0, .6), inset 0 0 0 2px var(--line);
}
.menu-card::before, .modal-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(180deg, rgba(20, 12, 7, .5), rgba(12, 7, 4, .75)); }
.menu-card > *, .modal-card > * { position: relative; }
.menu-card { width: 100%; max-width: 420px; padding: 26px 22px; display: flex; flex-direction: column; gap: 14px; }
.menu-card.wide { max-width: 660px; }
.brand { display: flex; flex-direction: column; align-items: center; text-align: center; }
.brand-tiles { display: flex; gap: 6px; margin-bottom: 8px; transform: rotate(-4deg); }
.brand-tiles .tile { --tile-w: 38px; --tile-h: 52px; }
.title { margin: 6px 0 0; font: 700 46px/1 var(--serif); background: linear-gradient(180deg, #fff1c4, #e2b65b 55%, #a8772a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; }
.card-title { margin: 0; font: 700 24px/1.2 var(--serif); color: var(--gold-light); display: flex; align-items: center; gap: 10px; }
h3 { margin: 12px 0 2px; font: 700 16px var(--serif); color: var(--gold); }
.hint { color: var(--muted); font-size: 13px; margin: 0; }
.rules p { color: #e2d6bf; font-size: 15px; margin: 4px 0; }
.field { display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: var(--muted); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .icon { position: absolute; left: 13px; opacity: .8; }
.field input { width: 100%; min-height: var(--tap); background: rgba(0, 0, 0, .38); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 12px 42px; font-size: 16px; color: var(--text); outline: none; }
.field input:focus { border-color: var(--gold); }

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: var(--tap); padding: 10px 18px; border-radius: 13px; cursor: pointer;
  font-weight: 700; color: var(--cream); border: 1px solid var(--line-strong); background: linear-gradient(180deg, #4a3222, #2a1b11);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 3px 0 #0c0704, 0 8px 18px rgba(0, 0, 0, .45); text-shadow: 0 1px 1px rgba(0, 0, 0, .5); transition: transform .08s, filter .15s;
}
.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn:active:not(:disabled) { transform: translateY(2px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-green { background: linear-gradient(180deg, var(--green-1), var(--green-2)); }
.btn-red { background: linear-gradient(180deg, var(--red-1), var(--red-2)); }
.btn-gold { background: linear-gradient(180deg, #f6dc92, #cf9f45 55%, #a87a2e); color: #2b1a06; text-shadow: 0 1px 0 rgba(255, 255, 255, .35); border-color: #f3d98f; }
.btn.big { min-height: 56px; font-size: 18px; }
.btn > .icon { position: absolute; left: 16px; }
.tile-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 14px; cursor: pointer; color: var(--cream); font-size: 13px; font-weight: 600; border: 1px solid var(--line); background: rgba(0, 0, 0, .3); }
.tile-btn .icon { width: 26px; height: 26px; }
button.back { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; background: none; border: none; color: var(--muted); cursor: pointer; padding: 4px 6px 4px 0; min-height: 36px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; background: rgba(0, 0, 0, .35); border-radius: 14px; padding: 5px; border: 1px solid var(--line); }
.seg button { display: flex; flex-direction: column; align-items: center; min-height: 52px; border: 1px solid transparent; background: none; padding: 6px; border-radius: 10px; cursor: pointer; color: var(--muted); }
.seg button .stars { color: var(--gold); letter-spacing: 1px; font-size: 11px; }
.seg button.on { background: linear-gradient(180deg, #f6dc92, #c99a40); color: #2b1a06; }
.seg button.on .stars { color: #7a2a12; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 8px 12px; border-radius: 12px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); cursor: pointer; }
.setting-row > span:first-child { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.toggle { position: relative; width: 52px; height: 30px; flex: none; }
.toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.toggle i { position: absolute; inset: 0; border-radius: 999px; background: #3a2a20; border: 1px solid var(--line); transition: background .2s; pointer-events: none; }
.toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--cream); transition: transform .2s; }
.toggle input:checked + i { background: linear-gradient(180deg, var(--green-1), var(--green-2)); }
.toggle input:checked + i::after { transform: translateX(22px); }
.setting-label { display: block; font-weight: 600; margin-bottom: 8px; }
.lang-switch { display: flex; gap: 6px; justify-content: center; }
.lang-switch button { min-height: 34px; padding: 4px 12px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 700; border: 1px solid var(--line); background: rgba(0, 0, 0, .3); color: var(--muted); }
.lang-switch button.on { background: var(--gold); color: #2b1a06; }
.top-right { position: absolute; top: 14px; right: 14px; z-index: 2; }

/* ---------- Taş ---------- */
.tile {
  position: relative; display: inline-flex; align-items: center; justify-content: center; width: var(--tile-w); height: var(--tile-h); border-radius: 7px;
  background: linear-gradient(180deg, #fffaf0, #efe3c6 70%, #d8c9a3); border: 1px solid #b9a47c; box-shadow: inset 0 1px 0 #fff, 0 3px 6px rgba(0, 0, 0, .45);
  font: 800 calc(var(--tile-h) * .42) var(--serif); user-select: none; -webkit-user-select: none; flex: none; cursor: grab;
}
.tile b { font-weight: 800; line-height: 1; }
.tile.c0 b { color: var(--c0); } .tile.c1 b { color: var(--c1); } .tile.c2 b { color: var(--c2); } .tile.c3 b { color: var(--c3); }
.tile.fake b { color: #6a5a3a; font-size: 60%; }
.tile.okey::after { content: "★"; position: absolute; top: 2px; right: 4px; font-size: 11px; color: var(--gold); }
.tile.back { background: linear-gradient(180deg, #6b3b1c, #3e200d); border-color: #2a1308; cursor: default; }
.tile.back::before { content: ""; position: absolute; inset: 5px; border: 1px solid rgba(212, 169, 79, .5); border-radius: 4px; }
.tile.small { --tile-w: 30px; --tile-h: 42px; }
.tile.dragging { opacity: .35; }
.tile.hinted { box-shadow: 0 0 0 3px #6fd3ff, 0 0 16px #6fd3ff; }
.tile.ghost { opacity: .55; }

/* ---------- Oyun ekranı ---------- */
#game { flex-direction: column; height: 100dvh; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.game-top { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.icon-btn { width: var(--tap); height: var(--tap); border-radius: 12px; flex: none; cursor: pointer; display: grid; place-items: center; border: 1px solid var(--line-strong); background: linear-gradient(180deg, #3e2a1c, #22160e); }
.fair-badge { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 3px 10px; border-radius: 999px; cursor: pointer; font-size: 12px; font-weight: 700; color: #b8ffbf; background: rgba(40, 110, 60, .35); border: 1px solid rgba(111, 207, 127, .5); }
.fair-badge .icon { width: 15px; height: 15px; }
.fair-badge.verified { background: rgba(40, 140, 70, .6); }
.fair-badge.failed { color: #ffb3a7; background: rgba(140, 40, 30, .5); }

.table { position: relative; flex: 1; min-height: 0; display: grid; align-items: center; justify-items: center; }
@keyframes pulse { 50% { opacity: .6; } }
@keyframes blink { 50% { opacity: .35; } }
.turn-pill { display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid var(--line); background: rgba(0, 0, 0, .45); }
.turn-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: #888; }
.turn-pill.me { background: linear-gradient(180deg, #2f7a3b, #1a4d24); } .turn-pill.me .dot { background: #b8ffbf; animation: blink 1.2s infinite; }
.coach-line { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.coach-line.good { background: rgba(40, 140, 70, .5); color: #b8ffbf; } .coach-line.minor { background: rgba(200, 160, 40, .4); color: #ffe6a0; }
.coach-line.error { background: rgba(200, 100, 30, .45); color: #ffc9a0; } .coach-line.blunder { background: rgba(170, 40, 30, .55); color: #ffb3a7; }
.rack { display: grid; }
.slot { display: flex; align-items: center; justify-content: center; min-width: 0; }

/* ---------- Pencere, bildirim ---------- */
.modal { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(5, 3, 1, .78); animation: fade .2s; }
.modal-card { width: 100%; max-width: 400px; padding: 26px 22px 22px; text-align: center; animation: pop .32s cubic-bezier(.2, .9, .3, 1.3); }
.modal-card h2 { margin: 0 0 6px; font: 700 26px var(--serif); color: var(--gold-light); }
.modal-card p { color: #e2d6bf; margin: 8px 0; }
.modal-actions { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.88) translateY(10px); } }
.settings-card { text-align: left; display: flex; flex-direction: column; gap: 12px; }
.go-art { position: relative; height: 96px; margin: -6px auto 4px; width: 140px; }
.go-art .laurel { position: absolute; inset: -20px 0 0; width: 140px; height: 140px; opacity: .9; }
.go-art .crown { position: absolute; left: 35px; top: 14px; width: 70px; animation: crownIn .7s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes crownIn { from { transform: translateY(-30px) scale(.4) rotate(-20deg); opacity: 0; } }
.modal-card.win { background: radial-gradient(at center top, rgba(120, 200, 120, .25), transparent 60%), linear-gradient(180deg, #1f5a30, #0f2d18); box-shadow: 0 18px 50px rgba(0, 0, 0, .55), inset 0 0 0 2px var(--gold); }
.modal-card.lose { background: linear-gradient(180deg, #1f2740, #0d111d); box-shadow: 0 18px 50px rgba(0, 0, 0, .55), inset 0 0 0 2px #8a93a8; }
.modal-card.win::before, .modal-card.lose::before { display: none; }
.modal-card.lose .go-art { filter: grayscale(1) brightness(1.3); }
.hand-show { display: flex; flex-wrap: wrap; gap: 4px 2px; justify-content: center; margin: 10px 0; }
.hand-show .tile { --tile-w: 26px; --tile-h: 36px; cursor: default; }
.hand-show .gap { width: 10px; }
.score-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 15px; }
.score-table td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.score-table td:last-child { text-align: right; font: 700 18px var(--serif); color: var(--gold-light); }
.score-table tr.me td { color: var(--gold-light); }
.score-table .delta { color: #ff9a85; font-size: 13px; margin-left: 6px; }
.score-table .delta.up { color: #8dff9b; }
.coach-report .acc { font: 800 40px var(--serif); color: var(--gold-light); text-align: center; margin: 4px 0; }
.coach-report .acc small { font: 600 13px system-ui, sans-serif; color: var(--muted); display: block; }
.fair-body { text-align: left; font-size: 13px; }
.fair-body dt { color: var(--gold); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; margin-top: 10px; }
.fair-body dd { margin: 2px 0 0; word-break: break-all; font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: #e2d6bf; }
.fair-result { margin-top: 10px; padding: 8px 10px; border-radius: 10px; font-weight: 600; }
.fair-result.ok { background: rgba(40, 140, 70, .35); color: #b8ffbf; } .fair-result.fail { background: rgba(140, 40, 30, .4); color: #ffb3a7; }
.fair-how { color: var(--muted); font-size: 11px; margin-top: 8px; }
.toast { position: fixed; left: 50%; bottom: calc(160px + env(safe-area-inset-bottom)); z-index: 30; display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 12px; max-width: calc(100vw - 32px); font-size: 14px; font-weight: 600; color: #fff; background: linear-gradient(180deg, #2a5ea8, #173a70); border: 1px solid rgba(255, 255, 255, .25); opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(16px); transition: .25s; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: linear-gradient(180deg, #2f8a3e, #1a5424); } .toast.error { background: linear-gradient(180deg, #a83324, #6a170e); } .toast.gold { background: linear-gradient(180deg, #c99a40, #8a6224); }

@media (max-width: 700px) {
  :root { --tile-w: 36px; --tile-h: 50px; }
  .fair-badge span { display: none; }
}
@media (max-width: 400px) { :root { --tile-w: 26px; --tile-h: 40px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- Masa düzeni v3: avatar + plaka, köşe taşları, büyük ıstaka ---------- */
.round-info { flex: 1; text-align: center; font-size: 13px; color: var(--muted); }
.table {
  grid-template-columns: minmax(70px, 1fr) minmax(0, 3fr) minmax(70px, 1fr); grid-template-rows: auto 1fr auto; padding: 10px 14px; gap: 4px; margin: 0 6px;
  background: radial-gradient(ellipse 70% 60% at 50% 45%, #2c8a5a 0%, #1f6a44 45%, #154a30 100%);
  box-shadow: inset 0 0 90px rgba(0, 0, 0, .45), 0 10px 30px rgba(0, 0, 0, .5); border-radius: 14px;
}
.table::before, .table::after { content: ""; position: absolute; top: 18%; bottom: 18%; width: 6px; border-radius: 3px; background: linear-gradient(180deg, #b07a3c, #6b3b1c 50%, #b07a3c); box-shadow: 0 0 6px rgba(0, 0, 0, .5); opacity: .9; }
.table::before { left: 0; } .table::after { right: 0; }
/* Koltuklar */
.seat-box { display: flex; align-items: center; gap: 0; z-index: 1; min-width: 0; }
.seat-box.s2 { grid-column: 2; grid-row: 1; align-self: start; justify-self: center; }
.seat-box.s3 { grid-column: 1; grid-row: 2; justify-self: start; }
.seat-box.s1 { grid-column: 3; grid-row: 2; justify-self: end; flex-direction: row-reverse; }
.seat-box.s1 .plate { padding: 6px 30px 6px 14px; margin: 0 -24px 0 0; text-align: right; align-items: flex-end; }
.avatar { position: relative; width: 58px; height: 58px; border-radius: 50%; flex: none; z-index: 2; display: grid; place-items: center; font: 800 24px system-ui, sans-serif; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); background: var(--av, #c2402f); box-shadow: 0 0 0 3px #f4e7c8, 0 4px 10px rgba(0, 0, 0, .5); }
.avatar::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 3px solid transparent; opacity: 0; transition: opacity .25s; }
.seat-box.active .avatar { box-shadow: 0 0 0 3px #b8ffbf, 0 0 18px rgba(140, 255, 160, .6); }
.seat-box.active .avatar::after { opacity: 1; border-color: #8dff9b transparent transparent transparent; animation: spin 1.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.plate { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 6px 14px 6px 30px; margin-left: -24px; border-radius: 10px; min-height: 48px; background: linear-gradient(180deg, rgba(10, 60, 30, .85), rgba(5, 35, 18, .9)); border: 1px solid rgba(140, 255, 160, .35); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 4px 10px rgba(0, 0, 0, .35); color: #f4e7c8; }
.plate .nm { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.plate .row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #c9e6cf; }
.plate .sc { font: 800 14px var(--serif); color: var(--gold-light); }
.plate .cnt { display: inline-flex; align-items: center; gap: 3px; }
.plate .cnt::before { content: ""; width: 8px; height: 11px; border-radius: 2px; background: linear-gradient(180deg, #6b3b1c, #3e200d); border: 1px solid rgba(212, 169, 79, .6); }
.seat-box.out { opacity: .45; }
.seat-box.active .plate { border-color: #8dff9b; box-shadow: 0 0 14px rgba(140, 255, 160, .35), inset 0 1px 0 rgba(255, 255, 255, .1); }
/* Köşe yığınları: üstteki taş büyük, altında kaç taş olduğu rozette */
.pile { position: relative; display: grid; place-items: center; width: calc(var(--pile-w) + 12px); height: calc(var(--pile-h) + 12px); --pile-w: 54px; --pile-h: 76px; z-index: 1; }
.pile.p2 { grid-column: 1; grid-row: 1; justify-self: start; align-self: start; }
.pile.p1 { grid-column: 3; grid-row: 1; justify-self: end; align-self: start; }
.pile.p3 { grid-column: 1; grid-row: 3; justify-self: start; align-self: end; }
.pile.p0 { grid-column: 3; grid-row: 3; justify-self: end; align-self: end; }
.pile .tile { --tile-w: var(--pile-w); --tile-h: var(--pile-h); position: absolute; cursor: default; }
.pile .tile.u1 { transform: translate(-4px, -3px) rotate(-4deg); filter: brightness(.8); } .pile .tile.u2 { transform: translate(4px, -5px) rotate(5deg); filter: brightness(.7); }
.pile .tile.top { position: absolute; z-index: 2; }
.pile .tile.takeable { cursor: pointer; box-shadow: 0 0 0 3px #8dff9b, 0 0 16px #8dff9b; animation: pulse 1.2s infinite; }
.pile .cntb { position: absolute; z-index: 3; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #1d140c; color: #fff; font: 700 12px system-ui, sans-serif; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.pile.empty::before { content: ""; position: absolute; inset: 6px; border: 2px dashed rgba(255, 255, 255, .18); border-radius: 8px; }
/* Orta */
.center { grid-column: 2; grid-row: 2; display: flex; align-items: center; justify-content: center; gap: 16px; }
.indicator { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.indicator small, .stock small { font-size: 11px; color: rgba(244, 231, 200, .8); }
.indicator .tile { --tile-w: 54px; --tile-h: 76px; cursor: default; }
.stock { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; cursor: pointer; }
.stock .stack { position: relative; display: block; width: 54px; height: 76px; }
.stock .stack .tile.back { --tile-w: 54px; --tile-h: 76px; position: absolute; left: 0; top: 0; }
.stock .stack .tile.back:nth-child(2) { transform: translate(-2px, -2px); } .stock .stack .tile.back:nth-child(3) { transform: translate(-4px, -4px); }
.stock .cntb { position: absolute; z-index: 3; top: -10px; right: -10px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; background: #1d140c; color: #fff; font: 700 13px system-ui, sans-serif; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.stock.drawable .tile.back { box-shadow: 0 0 0 3px #8dff9b, 0 0 14px #8dff9b; }
.stock.empty .stack { opacity: .3; }
.finish-zone { width: 54px; height: 76px; border: 2px dashed rgba(255, 255, 255, .3); border-radius: 8px; display: grid; place-items: center; font-size: 11px; color: rgba(255, 255, 255, .6); text-align: center; }
.finish-zone.ready { border-color: var(--gold-light); color: var(--gold-light); box-shadow: 0 0 16px rgba(243, 217, 143, .5); animation: pulse 1.2s infinite; }
.finish-zone.over { background: rgba(243, 217, 143, .2); }
/* Alt orta: durum + benim koltuğum */
.bottom-mid { grid-column: 2; grid-row: 3; display: flex; flex-direction: column; align-items: center; gap: 6px; align-self: end; min-width: 0; }
.status-line { position: static; display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 13px; color: var(--cream); text-align: center; flex-wrap: wrap; }
.seat-box.s0 .plate .nm { color: #b8ffbf; }
.distance { display: block; font-size: 11px; font-weight: 700; color: var(--gold-light); white-space: nowrap; }
.distance.ready { color: #b8ffbf; animation: blink 1s infinite; }
/* Istaka alanı */
.rack-area { padding: 6px 8px 8px; }
.rack-tools { position: relative; max-width: calc(13 * 60px + 12 * 5px + 28px); margin: 0 auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; padding: 0 4px 6px; z-index: 2; }
.tools { display: flex; gap: 6px; flex-wrap: wrap; }
.tools.right { justify-content: flex-end; }
.tool { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 4px 14px 4px 8px; border-radius: 8px; cursor: pointer; font: 800 13px system-ui, sans-serif; letter-spacing: .4px; text-transform: uppercase; border: 1px solid rgba(255, 255, 255, .14); background: linear-gradient(180deg, rgba(30, 30, 30, .92), rgba(10, 10, 10, .92)); color: #f4e7c8; box-shadow: 0 4px 10px rgba(0, 0, 0, .4); }
.tool .mini { display: inline-flex; gap: 2px; } .tool .mini i { display: block; width: 11px; height: 15px; border-radius: 2px; background: #fff; font: 800 9px/15px system-ui, sans-serif; font-style: normal; text-align: center; color: var(--c0); }
.tool .mini i.b { color: var(--c2); } .tool .mini i.y { color: var(--c1); } .tool .mini i.k { color: var(--c3); }
.tool.gold { background: linear-gradient(180deg, #f6dc92, #c99a40); color: #2b1a06; border-color: #f3d98f; }
.tool:disabled { opacity: .4; }
.my-rack { position: relative; width: fit-content; max-width: 100%; margin: 0 auto; --tile-w: min(60px, calc((100vw - 60px) / 13 - 5px)); --tile-h: calc(var(--tile-w) * 1.38); }
.rack { grid-template-columns: repeat(13, var(--tile-w)); grid-template-rows: repeat(2, var(--tile-h)); gap: 5px; row-gap: 14px; padding: 12px 14px 8px; border-radius: 6px 6px 3px 3px; border: 1px solid #a56a33;
  background: linear-gradient(180deg, #b77a3e 0%, #8f5826 3%, #a66a32 20%, #8a5424 48%, #a46a33 53%, #8f5826 75%, #7a4a20 100%);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, .15), inset 0 -3px 6px rgba(0, 0, 0, .35), 0 10px 24px rgba(0, 0, 0, .5); }
.rack::before { content: ""; position: absolute; left: 14px; right: 14px; top: calc(12px + var(--tile-h) + 5px); height: 4px; border-radius: 2px; background: linear-gradient(180deg, rgba(0, 0, 0, .35), rgba(0, 0, 0, .1)); pointer-events: none; }
.slot { background: rgba(0, 0, 0, .12); border-radius: 4px 4px 2px 2px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18); }
.slot .tile { width: 100%; height: calc(100% + 4px); margin-top: -4px; }
.slot.over { background: rgba(243, 217, 143, .45); } .slot.gap { background: transparent; }
.rack-ledge { height: 12px; margin: 0 -3px; border-radius: 0 0 8px 8px; background: linear-gradient(180deg, #c58747, #7a4a20 60%, #5a3318); box-shadow: 0 8px 14px rgba(0, 0, 0, .5); }
.my-rack::before, .my-rack::after { content: ""; position: absolute; top: -4px; bottom: 6px; width: 16px; border-radius: 4px; background: linear-gradient(90deg, #4a2a12, #8f5826 50%, #4a2a12); box-shadow: 0 4px 8px rgba(0, 0, 0, .5); z-index: 1; }
.my-rack::before { left: -8px; } .my-rack::after { right: -8px; }
/* Taş v3: beyaz zemin, kalın sans rakam, altta renkli işaret */
.tile { background: linear-gradient(180deg, #ffffff, #f4f1ea); border: 1px solid #cfc7b8; border-radius: 6px; box-shadow: inset 0 1px 0 #fff, 0 3px 6px rgba(0, 0, 0, .4); font: 900 calc(var(--tile-h) * .46) system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.tile b { margin-top: calc(var(--tile-h) * -.14); letter-spacing: -1px; }
.tile .pip { position: absolute; bottom: calc(var(--tile-h) * .09); left: 50%; width: calc(var(--tile-h) * .14); height: calc(var(--tile-h) * .14); transform: translateX(-50%) rotate(45deg); border-radius: 2px; background: currentColor; opacity: .9; }
.tile.c0 .pip { color: var(--c0); } .tile.c1 .pip { color: var(--c1); } .tile.c2 .pip { color: var(--c2); } .tile.c3 .pip { color: var(--c3); } .tile.fake .pip { color: #3c9d4a; }
.tile.fake b { color: #3c9d4a; font-size: 90%; }
.tile.okey::after { top: 3px; right: 5px; font-size: calc(var(--tile-h) * .16); color: var(--gold); }
.tile.back { background: linear-gradient(180deg, #7a4a24, #4a2a12); border-color: #2a1308; }
.tile.back::before { inset: 5px; border-color: rgba(212, 169, 79, .5); }
.hand-show .tile { --tile-w: 26px; --tile-h: 36px; }
.hand-show .tile .pip { display: none; }
@media (max-width: 700px) {
  .table { padding: 8px 10px; gap: 2px; grid-template-columns: minmax(60px, 1fr) minmax(0, 2fr) minmax(60px, 1fr); }
  .table::before, .table::after { display: none; }
  .avatar { width: 40px; height: 40px; font-size: 17px; }
  .plate { min-height: 36px; padding: 3px 9px 3px 22px; margin-left: -18px; } .seat-box.s1 .plate { padding: 3px 22px 3px 9px; margin: 0 -18px 0 0; }
  .plate .nm { font-size: 12px; max-width: 70px; } .plate .row { font-size: 11px; gap: 6px; } .plate .sc { font-size: 12px; }
  .pile { --pile-w: 36px; --pile-h: 50px; } .pile .cntb { min-width: 18px; height: 18px; font-size: 10px; }
  .indicator .tile, .stock .stack .tile.back { --tile-w: 40px; --tile-h: 56px; }
  .stock .stack, .finish-zone { width: 40px; height: 56px; }
  .center { gap: 10px; }
  .status-line { font-size: 12px; }
  .rack-area { padding: 4px 6px 6px; }
  .my-rack { --tile-w: calc((100vw - 28px) / 13 - 2px); }
  .rack { gap: 2px; row-gap: 7px; padding: 6px 5px 4px; } .rack::before { left: 5px; right: 5px; top: calc(6px + var(--tile-h) + 2px); height: 3px; }
  .my-rack::before, .my-rack::after { width: 8px; } .my-rack::before { left: -4px; } .my-rack::after { right: -4px; }
  .seat-box.s0 .plate .nm { max-width: 120px; }
  .plate .distance { font-size: 10px; }
  .tool { min-height: 32px; padding: 3px 10px 3px 7px; font-size: 11px; } .tool .mini i { width: 9px; height: 13px; font-size: 8px; line-height: 13px; }
  .rack-ledge { height: 9px; }
}
/* Masadan taş tutma */
.stock.drawable, .pile .tile.takeable, .rack .tile { touch-action: none; cursor: grab; }
.rack .tile.selected { transform: translateY(-6px); box-shadow: 0 0 0 3px var(--gold-light), 0 8px 14px rgba(0, 0, 0, .45); }
.lifting { opacity: .45; }
.tile.ghost { cursor: grabbing; }

/* Renk sembolleri: renk tek bilgi kaynağı olmasın (kırmızı ●, sarı ▲, mavi ■, siyah ◆) */
.tile .pip { background: none; transform: translateX(-50%); border-radius: 0; width: auto; height: auto; font: 900 calc(var(--tile-h) * .17) system-ui, sans-serif; line-height: 1; }
.tile .pip::before { content: "◆"; }
.tile.c0 .pip::before { content: "●"; } .tile.c1 .pip::before { content: "▲"; } .tile.c2 .pip::before { content: "■"; } .tile.c3 .pip::before { content: "◆"; }
.tile.fake .pip::before { content: "★"; }
