/* ==========================================================================
   Abluka Oyunu — ablukaoyunu.com
   ========================================================================== */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e2e5ea;
  --border-strong: #cfd4dc;
  --text: #12151a;
  --muted: #5b6474;
  --faint: #8a93a2;
  --primary: #14181f;
  --primary-hover: #2a303b;
  --primary-text: #ffffff;

  --red: #e5484d;
  --red-deep: #c4323a;
  --red-soft: rgba(229, 72, 77, 0.14);
  --blue: #3e6ae1;
  --blue-deep: #2b52bd;
  --blue-soft: rgba(62, 106, 225, 0.14);
  --amber: #b45309;
  --amber-bg: #fff3dc;
  --danger: #c4323a;
  --danger-bg: #fde8e8;
  --ok: #157f4b;

  --frame: #dde1e8;
  --cell: #ffffff;
  --cell-hover: #f2f4f7;
  --stone: #2b313c;
  --stone-top: #434b59;
  --stone-shadow: rgba(10, 14, 20, 0.28);

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 6px 20px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, 0.22);
  --radius: 14px;
  --radius-sm: 10px;
  --gap: 6px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1015;
    --surface: #151920;
    --surface-2: #1b2029;
    --border: #262c36;
    --border-strong: #353d4a;
    --text: #e9ecf1;
    --muted: #a1aab8;
    --faint: #6f7887;
    --primary: #e9ecf1;
    --primary-hover: #ffffff;
    --primary-text: #0d1015;
    --red: #f2555a;
    --red-deep: #d63c43;
    --red-soft: rgba(242, 85, 90, 0.18);
    --blue: #5b84f0;
    --blue-deep: #3f68d6;
    --blue-soft: rgba(91, 132, 240, 0.2);
    --amber: #f5b14a;
    --amber-bg: rgba(245, 177, 74, 0.14);
    --danger: #ff7b7f;
    --danger-bg: rgba(242, 85, 90, 0.16);
    --ok: #4cc38a;
    --frame: #0a0c10;
    --cell: #1e232c;
    --cell-hover: #262c36;
    --stone: #aab3c1;
    --stone-top: #d5dbe4;
    --stone-shadow: rgba(0, 0, 0, 0.5);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0d1015;
  --surface: #151920;
  --surface-2: #1b2029;
  --border: #262c36;
  --border-strong: #353d4a;
  --text: #e9ecf1;
  --muted: #a1aab8;
  --faint: #6f7887;
  --primary: #e9ecf1;
  --primary-hover: #ffffff;
  --primary-text: #0d1015;
  --red: #f2555a;
  --red-deep: #d63c43;
  --red-soft: rgba(242, 85, 90, 0.18);
  --blue: #5b84f0;
  --blue-deep: #3f68d6;
  --blue-soft: rgba(91, 132, 240, 0.2);
  --amber: #f5b14a;
  --amber-bg: rgba(245, 177, 74, 0.14);
  --danger: #ff7b7f;
  --danger-bg: rgba(242, 85, 90, 0.16);
  --ok: #4cc38a;
  --frame: #0a0c10;
  --cell: #1e232c;
  --cell-hover: #262c36;
  --stone: #aab3c1;
  --stone-top: #d5dbe4;
  --stone-shadow: rgba(0, 0, 0, 0.5);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

/* ---------- Temel ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0; }
p { margin: 0; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }

.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.wrap--narrow { max-width: 760px; }

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

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--primary); color: var(--primary-text);
  padding: 10px 14px; border-radius: var(--radius-sm); text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ---------- Üst bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar__in { display: flex; align-items: center; gap: 16px; height: 60px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand__logo { width: 32px; height: 32px; border-radius: 8px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06); }
.brand__name { font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.brand__sub { font-weight: 500; color: var(--muted); margin-left: 1px; }
.brand--sm .brand__logo { width: 26px; height: 26px; border-radius: 7px; }
.brand--sm .brand__name { font-size: 16px; }

.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  text-decoration: none; color: var(--muted); font-weight: 550; font-size: 15px;
  padding: 8px 12px; border-radius: 8px;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }

.topbar__actions { display: flex; gap: 4px; }
.nav + .topbar__actions { margin-left: 8px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--muted);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn[aria-pressed="false"] { color: var(--faint); }

/* ---------- Oyun alanı ---------- */

.play { padding: 20px 0 40px; }
.play__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}
.play__main { display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 0; }
.play__side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* Durum çubuğu */
.status {
  --tone: var(--red);
  --tone-soft: var(--red-soft);
  width: 100%;
  max-width: var(--board-w);
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px 12px 12px;
  box-shadow: var(--shadow-sm);
  min-height: 68px;
}
.status[data-tone="1"] { --tone: var(--blue); --tone-soft: var(--blue-soft); }
.status[data-tone="end"] { --tone: var(--ok); --tone-soft: transparent; }
.status__bar { width: 6px; align-self: stretch; border-radius: 6px; background: var(--tone); flex: none; transition: background 0.2s; }
.status__text { flex: 1; min-width: 0; }
.status__title { font-weight: 750; font-size: 17px; letter-spacing: -0.01em; }
.status__sub { color: var(--muted); font-size: 14.5px; margin-top: 1px; }
.status__sub .s-warn { color: var(--danger); font-weight: 650; }
.status__sub .s-tip { color: var(--amber); font-weight: 650; }
.status.is-thinking .status__title::after {
  content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 10px; vertical-align: -2px;
  border: 2px solid var(--border-strong); border-top-color: var(--tone); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.steps { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; flex: none; }
.steps__item {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 650; color: var(--faint);
  padding: 5px 10px 5px 6px; border-radius: 999px; background: var(--surface-2);
  transition: background 0.2s, color 0.2s;
}
.steps__item span {
  display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  font-size: 12px; background: var(--border); color: var(--muted);
}
.steps__item.is-active { color: var(--text); background: var(--tone-soft); }
.steps__item.is-active span { background: var(--tone); color: #fff; }
.steps__item.is-done span { background: var(--tone); color: #fff; opacity: 0.5; }

/* Tahta */
.play__main { --board-w: min(100%, 600px, max(320px, calc(100svh - 250px))); }

.board-frame {
  width: var(--board-w);
  padding: 10px;
  background: var(--frame);
  border-radius: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), var(--shadow);
}

.board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--gap);
  aspect-ratio: 1 / 1;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.cell {
  position: relative;
  border: 0;
  padding: 0;
  margin: 0;
  aspect-ratio: 1 / 1;
  border-radius: 18%;
  background: var(--cell);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.06);
  cursor: default;
  transition: background 0.15s;
  container-type: inline-size;
}
.cell:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; z-index: 3; }

/* Koordinatlar */
.coord {
  position: absolute; font-size: max(9px, 15cqi); line-height: 1; font-weight: 650;
  color: var(--faint); pointer-events: none; opacity: 0; transition: opacity 0.2s;
}
.coord--rank { left: 8%; top: 7%; }
.coord--file { right: 8%; bottom: 6%; }
.board.show-coords .coord { opacity: 0.9; }

/* Engel taşı */
.cell__stone {
  position: absolute; inset: 13%;
  border-radius: 20%;
  background: linear-gradient(180deg, var(--stone-top), var(--stone));
  box-shadow: 0 3px 0 var(--stone-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform: scale(0);
  opacity: 0;
  transition: transform 0.22s cubic-bezier(0.3, 1.6, 0.5, 1), opacity 0.12s;
}
.cell.is-stone .cell__stone { transform: scale(1); opacity: 1; }

/* Son konan taş */
.board[data-last-by="0"] .cell.is-last-stone .cell__stone { box-shadow: 0 3px 0 var(--stone-shadow), 0 0 0 3px var(--cell), 0 0 0 5px var(--red); }
.board[data-last-by="1"] .cell.is-last-stone .cell__stone { box-shadow: 0 3px 0 var(--stone-shadow), 0 0 0 3px var(--cell), 0 0 0 5px var(--blue); }

/* Piyonun geldiği kare */
.cell.is-last-from::before {
  content: ""; position: absolute; inset: 36%;
  border-radius: 50%; border: 2px dashed var(--border-strong);
}

/* Gidilebilir kareler */
.board[data-turn="0"] { --turn: var(--red); --turn-soft: var(--red-soft); }
.board[data-turn="1"] { --turn: var(--blue); --turn-soft: var(--blue-soft); }

.cell.is-target, .cell.is-placeable { cursor: pointer; }
.cell.is-target::after {
  content: ""; position: absolute; inset: 39%;
  border-radius: 50%; background: var(--turn); opacity: 0.55;
  transition: transform 0.15s, opacity 0.15s;
}
.board.hide-moves .cell.is-target::after { display: none; }
@media (hover: hover) {
  .cell.is-target:hover { background: var(--turn-soft); }
  .cell.is-target:hover::after { transform: scale(2.4); opacity: 0.22; }
  .cell.is-placeable:hover { background: var(--cell-hover); }
  .cell.is-placeable:hover .cell__stone { transform: scale(0.92); opacity: 0.32; }
}

/* İpucu */
.cell.is-hint-move { background: var(--turn-soft); box-shadow: inset 0 0 0 3px var(--turn); animation: hintPulse 1.2s ease-in-out infinite; }
.cell.is-hint-stone { box-shadow: inset 0 0 0 3px var(--amber); }
.cell.is-hint-stone .cell__stone { transform: scale(0.92); opacity: 0.35; }

/* Abluka anı */
.cell.is-siege { background: var(--danger-bg); }

/* Piyonlar */
.pawn {
  position: absolute; left: 0; top: 0; z-index: 2;
  width: calc((100% - 6 * var(--gap)) / 7);
  aspect-ratio: 1 / 1;
  pointer-events: none;
  transform: translate(calc(var(--c) * (100% + var(--gap))), calc(var(--r) * (100% + var(--gap))));
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.pawn__disc {
  position: absolute; inset: 12%;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, var(--pawn-hi) 0 18%, var(--pawn) 58%, var(--pawn-deep) 100%);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.22), inset 0 -3px 0 rgba(0, 0, 0, 0.16);
  transition: box-shadow 0.2s, filter 0.2s;
}
.pawn__disc::after {
  content: ""; position: absolute; inset: 27%;
  border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.55);
}
.pawn--0 { --pawn: var(--red); --pawn-deep: var(--red-deep); --pawn-hi: #ff9a9d; --pawn-soft: var(--red-soft); }
.pawn--1 { --pawn: var(--blue); --pawn-deep: var(--blue-deep); --pawn-hi: #a9c0ff; --pawn-soft: var(--blue-soft); }
.pawn.is-active .pawn__disc { box-shadow: 0 0 0 4px var(--cell), 0 0 0 7px var(--pawn-soft), 0 4px 8px rgba(0, 0, 0, 0.22), inset 0 -3px 0 rgba(0, 0, 0, 0.16); }
.pawn.is-pulse .pawn__disc { animation: pawnPulse 1.6s ease-in-out infinite; }
.pawn.is-trapped .pawn__disc { filter: grayscale(0.55) brightness(0.9); animation: shake 0.5s ease-in-out 2; }
.pawn.is-trapped::after {
  content: ""; position: absolute; inset: 30%;
  background:
    linear-gradient(45deg, transparent 44%, #fff 44% 56%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, #fff 44% 56%, transparent 56%);
}
.pawn.is-winner .pawn__disc { box-shadow: 0 0 0 4px var(--cell), 0 0 0 8px var(--pawn-soft), 0 6px 14px rgba(0, 0, 0, 0.25); }

/* Araç çubuğu */
.toolbar {
  width: var(--board-w);
  display: grid; grid-template-columns: 1fr 1fr auto 1.3fr; gap: 8px;
}
.toolbar.no-full { grid-template-columns: 1fr 1fr 1.3fr !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 650; font-size: 15px;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s, border-color 0.15s, transform 0.1s, opacity 0.15s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn--primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn--primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn--sm { height: 38px; font-size: 14px; padding: 0 12px; }
.btn--ghost-danger { background: transparent; box-shadow: none; color: var(--danger); border-color: transparent; padding: 0 8px; }
.btn--ghost-danger:hover:not(:disabled) { background: var(--danger-bg); border-color: transparent; }
.btn.is-loading .i { animation: spin 0.8s linear infinite; }

/* ---------- Yan panel ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.card__title { font-size: 15px; font-weight: 750; }
.card__meta { font-size: 13px; color: var(--faint); }

.players { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.player {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 10px 12px; border-radius: 10px;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}
.player[data-p="0"] { --pc: var(--red); --pc-soft: var(--red-soft); }
.player[data-p="1"] { --pc: var(--blue); --pc-soft: var(--blue-soft); }
.player.is-turn { background: var(--pc-soft); border-color: color-mix(in srgb, var(--pc) 35%, transparent); }
.player__dot {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: var(--pc); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.15);
}
.player__meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.player__name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player__tag { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.libs {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 56px; padding: 4px 8px; border-radius: 10px;
  background: var(--surface-2); line-height: 1.1;
}
.libs b { font-size: 20px; font-variant-numeric: tabular-nums; }
.libs small { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.libs.is-warn { background: var(--amber-bg); color: var(--amber); }
.libs.is-warn small { color: var(--amber); }
.libs.is-crit { background: var(--danger-bg); color: var(--danger); }
.libs.is-crit small { color: var(--danger); }

.intro__list { margin: 8px 0 12px; padding-left: 20px; color: var(--muted); font-size: 14.5px; display: grid; gap: 6px; }
.intro__list b { color: var(--text); }

.history {
  list-style: none; margin: 0; padding: 0;
  max-height: 228px; overflow-y: auto;
  font-size: 14px;
  display: grid; gap: 2px;
  scrollbar-width: thin;
}
.history li {
  display: grid; grid-template-columns: 26px 12px 1fr auto; align-items: center; gap: 8px;
  padding: 5px 6px; border-radius: 8px;
}
.history li:nth-child(odd) { background: var(--surface-2); }
.history .h-no { color: var(--faint); font-variant-numeric: tabular-nums; font-size: 13px; }
.history .h-dot { width: 10px; height: 10px; border-radius: 50%; }
.history .h-dot--0 { background: var(--red); }
.history .h-dot--1 { background: var(--blue); }
.history .h-move { font-family: var(--mono); font-size: 13.5px; }
.history .h-stone { font-family: var(--mono); font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.history .h-stone::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--stone); }
.history .h-empty { display: block; color: var(--faint); background: none !important; padding: 4px 2px; }

.score { width: 100%; border-collapse: collapse; font-size: 14px; }
.score th { text-align: left; font-weight: 600; color: var(--faint); font-size: 12.5px; padding: 0 0 6px; }
.score th:not(:first-child), .score td:not(:first-child) { text-align: right; }
.score td { padding: 6px 0; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.score td:first-child { font-weight: 600; }
.score tr.is-current td:first-child::after { content: " •"; color: var(--blue); }

/* ---------- İçerik bölümleri ---------- */

.section { padding: 64px 0; border-top: 1px solid var(--border); }
.section--alt { background: var(--surface); }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.section__title { font-size: clamp(26px, 3.6vw, 34px); font-weight: 800; }
.section__lead { color: var(--muted); font-size: 17px; max-width: 680px; margin-top: 12px; }

.rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 32px; }
.rule {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.rule h3 { display: flex; align-items: center; gap: 10px; font-size: 18px; margin: 16px 0 6px; }
.rule p { color: var(--muted); }
.rule p b { color: var(--text); }
.rule__no {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary); color: var(--primary-text); font-size: 14px;
}
.mini { width: 112px; height: 112px; }
.mini__bg { fill: var(--frame); }
.mini__cells rect, .mini__cell { fill: var(--cell); }
.mini__dots circle { fill: var(--red); opacity: 0.55; }
.mini__red { fill: var(--red); }
.mini__red--trapped { opacity: 0.75; }
.mini__blue { fill: var(--blue); }
.mini__stone { fill: var(--stone); }
.mini__stone--new { stroke: var(--red); stroke-width: 3; }
.mini__x { stroke: #fff; stroke-width: 3; stroke-linecap: round; }

.note {
  margin-top: 20px; padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--muted); font-size: 15px;
}

.tips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 32px; counter-reset: tip; }
.tip {
  position: relative; padding: 20px 20px 20px 64px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg);
  counter-increment: tip;
}
.tip::before {
  content: counter(tip); position: absolute; left: 20px; top: 18px;
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  font-weight: 800; font-size: 15px; background: var(--surface); border: 1px solid var(--border);
}
.tip h3 { font-size: 17px; margin-bottom: 6px; }
.tip p { color: var(--muted); font-size: 15px; }

.edu { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.checks li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted);
}
.checks b { color: var(--text); }
.checks .i { color: var(--ok); margin-top: 3px; }

.faq { margin-top: 24px; display: grid; gap: 8px; }
.faq details {
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg);
  padding: 0 16px;
}
.faq summary {
  cursor: pointer; list-style: none; font-weight: 650; padding: 16px 28px 16px 0; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 4px; top: 50%; width: 9px; height: 9px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg); transition: transform 0.2s;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { color: var(--muted); padding: 0 0 16px; }

.footer { border-top: 1px solid var(--border); padding: 24px 0 calc(24px + env(safe-area-inset-bottom)); }
.footer__in { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.footer__in p { flex: 1; }
.footer__in > a:last-child { color: var(--muted); }

/* ---------- Diyaloglar ---------- */

.dialog {
  width: min(460px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 0; border: 1px solid var(--border); border-radius: 18px;
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-lg);
}
.dialog::backdrop { background: rgba(8, 10, 14, 0.5); backdrop-filter: blur(3px); }
.dialog[open] { animation: dialogIn 0.22s cubic-bezier(0.2, 0.8, 0.2, 1); }
.dialog__body { padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.dialog__head { display: flex; align-items: center; justify-content: space-between; margin: -4px -6px -4px 0; }
.dialog__head h2 { font-size: 20px; font-weight: 800; }
.dialog__foot { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 4px; }
.dialog__foot--split { display: flex; justify-content: space-between; }

.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.field legend { font-weight: 700; font-size: 14px; margin-bottom: 8px; padding: 0; }
.field__hint { font-size: 13.5px; color: var(--muted); margin-top: 8px; min-height: 1.4em; }
.optional { font-weight: 500; color: var(--faint); }
.field[hidden] { display: none; }

.seg { display: grid; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; }
.seg--2 { grid-template-columns: repeat(2, 1fr); }
.seg--3 { grid-template-columns: repeat(3, 1fr); }
.seg--4 { grid-template-columns: repeat(4, 1fr); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 8px; border-radius: 9px;
  font-weight: 650; font-size: 14.5px; color: var(--muted);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12), 0 0 0 1px var(--border); }
.seg input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 1px; }
.seg label:hover input:not(:checked) + span { color: var(--text); }

.names { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.input { position: relative; display: block; }
.input::before {
  content: ""; position: absolute; left: 12px; top: 50%; width: 12px; height: 12px; margin-top: -6px;
  border-radius: 50%; background: var(--red);
}
.input--blue::before { background: var(--blue); }
.input input {
  width: 100%; height: 44px; padding: 0 12px 0 32px;
  border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface);
}
.input input:focus { outline: 3px solid var(--blue-soft); border-color: var(--blue); }

.switches { display: grid; gap: 4px; }
.switch {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer;
}
.switch span { display: flex; flex-direction: column; }
.switch small { color: var(--muted); font-size: 13px; }
.switch input {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 44px; height: 26px; border-radius: 999px; margin: 0;
  background: var(--border-strong); position: relative; cursor: pointer; transition: background 0.2s;
}
.switch input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.2s;
}
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(18px); }

kbd {
  font-family: var(--mono); font-size: 12px; padding: 1px 6px; border-radius: 5px;
  border: 1px solid var(--border-strong); background: var(--surface-2);
}

.dialog--result { width: min(400px, calc(100% - 32px)); text-align: center; }
.dialog--result .dialog__body { align-items: center; padding: 28px 22px 18px; }
.result__badge {
  width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center;
  background: var(--amber-bg); color: var(--amber);
}
.result__badge .i { width: 32px; height: 32px; }
.result__badge.is-lose { background: var(--surface-2); color: var(--muted); }
.result__badge.is-red { background: var(--red-soft); color: var(--red); }
.result__badge.is-blue { background: var(--blue-soft); color: var(--blue); }
.result__title { font-size: 26px; font-weight: 800; margin-top: -4px; }
.result__text { color: var(--muted); margin-top: -10px; max-width: 320px; }
.result__stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; margin: 0;
}
.result__stats div { background: var(--surface-2); border-radius: 12px; padding: 10px 6px; }
.result__stats dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.result__stats dd { margin: 0; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.dialog--result .dialog__foot { width: 100%; }
.link-btn {
  border: 0; background: none; color: var(--muted); font-weight: 600; font-size: 14px;
  padding: 6px 10px; border-radius: 8px; margin-top: -8px;
}
.link-btn:hover { color: var(--text); background: var(--surface-2); }

.noscript {
  position: fixed; inset: auto 16px 16px; padding: 14px 16px; border-radius: 12px;
  background: var(--danger-bg); color: var(--danger); font-weight: 600; text-align: center;
}

/* ---------- Tam ekran (akıllı tahta) ---------- */

.play:fullscreen {
  background: var(--bg); overflow: auto;
  display: flex; align-items: center; padding: 16px 0;
}
.play:fullscreen .play__main { --board-w: min(100%, max(320px, calc(100svh - 200px))); }
.play:fullscreen .play__grid { max-width: 1400px; }

/* ---------- Animasyonlar ---------- */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pawnPulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--cell), 0 0 0 7px var(--pawn-soft), 0 4px 8px rgba(0, 0, 0, 0.22), inset 0 -3px 0 rgba(0, 0, 0, 0.16); }
  50% { box-shadow: 0 0 0 4px var(--cell), 0 0 0 10px var(--pawn-soft), 0 4px 8px rgba(0, 0, 0, 0.22), inset 0 -3px 0 rgba(0, 0, 0, 0.16); }
}
@keyframes hintPulse { 50% { box-shadow: inset 0 0 0 5px var(--turn); } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7%); }
  40% { transform: translateX(7%); }
  60% { transform: translateX(-4%); }
  80% { transform: translateX(4%); }
}
@keyframes dialogIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.cell.is-nudge { animation: nudge 0.25s ease-in-out; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Duyarlı düzen ---------- */

@media (max-width: 960px) {
  .play__grid { grid-template-columns: minmax(0, 1fr); }
  .play__main { --board-w: min(100%, 560px); }
  .play__side {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%; max-width: 560px; margin: 0 auto;
  }
  .players, .intro { grid-column: 1 / -1; }
  .players { flex-direction: row; }
  .player { flex: 1; min-width: 0; }
  .tips { grid-template-columns: repeat(2, 1fr); }
  .edu { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 760px) {
  .nav { display: none; }
  .topbar__actions { margin-left: auto; }
  .rules { grid-template-columns: 1fr; }
  .rule { display: grid; grid-template-columns: 88px 1fr; gap: 0 16px; align-items: start; }
  .rule .mini { width: 88px; height: 88px; grid-row: span 2; }
  .rule h3 { margin: 2px 0 4px; }
}

@media (max-width: 560px) {
  :root { --gap: 4px; }
  .play { padding: 12px 0 28px; }
  .play__main { gap: 10px; }
  .play__side { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .board-frame { padding: 6px; border-radius: 14px; }
  .status { padding: 10px 12px 10px 10px; gap: 10px; min-height: 60px; }
  .status__title { font-size: 16px; }
  .status__sub { font-size: 13.5px; }
  .steps__item { font-size: 0; gap: 0; padding: 4px; }
  .steps__item span { font-size: 12px; }
  .toolbar { grid-template-columns: 1fr 1fr 46px 1.25fr; gap: 6px; }
  .toolbar .btn { padding: 0 10px; font-size: 14px; gap: 6px; }
  .btn--icon-only-sm span { display: none; }
  .players { flex-direction: column; }
  .player { gap: 10px; padding: 6px 8px 6px 10px; }
  .player__dot { width: 16px; height: 16px; }
  .libs { min-width: 46px; padding: 3px 6px; }
  .libs b { font-size: 17px; }
  .tips { grid-template-columns: 1fr; }
  .section { padding: 48px 0; }
  .seg span { font-size: 13.5px; padding: 0 4px; }
  .names { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
  .toolbar .btn .i { display: none; }
  .btn--icon-only-sm .i { display: block !important; }
  .brand__sub { display: none; }
}
