/* =====================================================================
   Mustafa Ali Oğün — Satranç Platformu  ·  Stil
   ===================================================================== */
:root {
  --bg: #0f1320;
  --bg-soft: #171c2e;
  --panel: #1d2336;
  --panel-2: #232a41;
  --ink: #e8ecf6;
  --muted: #9aa3bd;
  --line: #2c3450;
  --accent: #f0b429;
  --accent-2: #5b8def;
  --good: #57c98a;
  --bad: #e5604d;

  --sq-light: #ebd9b6;
  --sq-dark: #9b6a43;
  --sq-light-sel: #f4e08a;
  --sq-dark-sel: #cda74f;
  --last-move: rgba(240, 180, 41, 0.45);
  --check-glow: #e5604d;

  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 80% -10%, #1c2540 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 20%, #20183a 0%, transparent 55%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.55;
}

a { color: var(--accent-2); }

/* ---------- Üst başlık ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(15, 19, 32, 0.78);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand-logo {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  font-size: 28px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--accent), #d98e0b);
  color: #2a1c00;
  box-shadow: 0 6px 18px rgba(240, 180, 41, 0.35);
}
.brand-text b { font-size: 1.12rem; letter-spacing: .3px; }
.brand-text span { display: block; font-size: .78rem; color: var(--muted); }

.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 9px 16px;
  border-radius: 10px;
  font-size: .95rem;
  cursor: pointer;
  transition: .15s ease;
}
.nav button:hover { color: var(--ink); background: var(--panel); }
.nav button.active {
  color: #1a1205;
  background: linear-gradient(145deg, var(--accent), #e0a019);
  font-weight: 600;
}

/* ---------- Genel sayfa ---------- */
main { max-width: 1200px; margin: 0 auto; padding: 26px 22px 80px; }
.view { display: none; animation: fade .25s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.section-title { font-size: 1.5rem; margin: 0 0 4px; }
.section-sub { color: var(--muted); margin: 0 0 22px; }

/* ---------- Oyun düzeni ---------- */
.game-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 360px;
  gap: 26px;
  align-items: start;
}
@media (max-width: 900px) { .game-layout { grid-template-columns: 1fr; } }

.board-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

/* Sıra / saat üst şeridi */
.turn-bar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.player-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  flex: 1; min-width: 150px;
  transition: .2s;
}
.player-chip.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(240,180,41,.25) inset; }
.player-chip .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #000a; }
.player-chip.white .dot { background: #f4f4f4; }
.player-chip.black .dot { background: #2a2a2a; border-color: #777; }
.player-chip .who { display: flex; flex-direction: column; line-height: 1.15; }
.player-chip .who input {
  background: transparent; border: none; color: var(--ink);
  font-size: .98rem; font-weight: 600; width: 100%; padding: 0;
}
.player-chip .who input:focus { outline: none; border-bottom: 1px dashed var(--muted); }
.player-chip .who small { color: var(--muted); font-size: .72rem; }
.player-chip .clock {
  margin-left: auto; font-variant-numeric: tabular-nums;
  font-size: 1.15rem; font-weight: 700; letter-spacing: 1px;
  background: #0c1020; padding: 4px 10px; border-radius: 8px; color: var(--ink);
}
.player-chip.low .clock { color: var(--bad); }

/* ---------- Tahta ---------- */
.board-wrap {
  position: relative;
  width: min(72vh, 100%);
  margin: 0 auto;
  aspect-ratio: 1 / 1;
}
.board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  width: 100%; height: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 3px solid #5a3c25;
  box-shadow: inset 0 0 0 2px #00000033;
  user-select: none;
}
.square {
  position: relative;
  display: grid; place-items: center;
  cursor: pointer;
}
.square.light { background: var(--sq-light); }
.square.dark { background: var(--sq-dark); }
.square.sel.light { background: var(--sq-light-sel); }
.square.sel.dark { background: var(--sq-dark-sel); }
.square.last::after {
  content: ""; position: absolute; inset: 0;
  background: var(--last-move); pointer-events: none;
}
.square.check .piece { filter: drop-shadow(0 0 10px var(--check-glow)); }
.square.check::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle, rgba(229,96,77,.65) 0%, transparent 70%);
  pointer-events: none;
}

/* kare üzeri koordinat etiketleri */
.coord { position: absolute; font-size: .62rem; font-weight: 700; opacity: .6; pointer-events: none; }
.coord.file { right: 3px; bottom: 1px; }
.coord.rank { left: 3px; top: 1px; }
.square.light .coord { color: #7a5530; }
.square.dark .coord { color: #f4e4c4; }

/* Taşlar */
.piece {
  font-size: min(8.6vh, 11.5vw);
  line-height: 1;
  cursor: grab;
  transition: transform .12s ease;
  z-index: 2;
}
.board-wrap.small .piece { font-size: 40px; }
.piece.w { color: #fbfbf7; -webkit-text-stroke: 1.6px #3a3a3a; text-shadow: 0 2px 2px rgba(0,0,0,.35); }
.piece.b { color: #2a2a2a; -webkit-text-stroke: 1.4px #c9c9c9; text-shadow: 0 2px 2px rgba(0,0,0,.35); }
.square:hover .piece { transform: translateY(-2px) scale(1.04); }

/* Yasal hamle göstergeleri */
.hint {
  position: absolute; width: 30%; height: 30%;
  border-radius: 50%; background: rgba(20,30,15,.32);
  pointer-events: none; z-index: 1;
}
.hint.capture {
  width: 86%; height: 86%; background: transparent;
  border: 5px solid rgba(20,30,15,.32); border-radius: 50%;
}

/* Tahta kilitliyken */
.board-wrap.locked { opacity: .85; }
.board-wrap.locked .square { cursor: default; }

/* ---------- Araç çubuğu ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  padding: 9px 14px;
  border-radius: 10px;
  font-size: .9rem;
  cursor: pointer;
  transition: .15s;
  display: inline-flex; align-items: center; gap: 7px;
}
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn.primary { background: linear-gradient(145deg, var(--accent), #e0a019); color: #1a1205; border-color: transparent; font-weight: 600; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.toggle.on { background: var(--accent-2); color: #07122b; border-color: transparent; }

/* ---------- Yan panel ---------- */
.side-col { display: flex; flex-direction: column; gap: 18px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.card h3 { margin: 0 0 12px; font-size: 1.02rem; display: flex; align-items: center; gap: 8px; }
.card h3 .pill { margin-left: auto; font-size: .72rem; color: var(--muted); font-weight: 500; }

/* Durum kutusu */
.status-box {
  border-left: 4px solid var(--accent-2);
  background: var(--panel-2);
  padding: 12px 14px; border-radius: 10px;
  font-size: .95rem;
}
.status-box.check { border-color: var(--bad); }
.status-box.over { border-color: var(--good); }
.status-box b { display: block; font-size: 1.05rem; margin-bottom: 2px; }

/* İpucu kutusu */
.tip-box {
  font-size: .9rem; color: var(--muted);
  background: var(--panel-2); border-radius: 10px; padding: 11px 13px;
  border: 1px dashed var(--line); min-height: 44px;
}
.tip-box b { color: var(--accent); }

/* Alınan taşlar */
.captured-row { display: flex; align-items: center; gap: 2px; min-height: 30px; flex-wrap: wrap; }
.captured-row .mini { font-size: 22px; line-height: 1; }
.captured-row .mini.w { color: #f3f3ee; -webkit-text-stroke: 1px #555; }
.captured-row .mini.b { color: #2a2a2a; -webkit-text-stroke: 1px #aaa; }
.captured-label { font-size: .76rem; color: var(--muted); margin-bottom: 3px; }
.adv { margin-left: 6px; font-weight: 700; color: var(--good); font-size: .85rem; }

/* Hamle listesi */
.moves {
  max-height: 280px; overflow-y: auto;
  font-variant-numeric: tabular-nums; font-size: .92rem;
}
.moves table { width: 100%; border-collapse: collapse; }
.moves td { padding: 4px 6px; }
.moves td.num { color: var(--muted); width: 34px; }
.moves td.mv { cursor: default; border-radius: 6px; }
.moves tr:nth-child(even) { background: rgba(255,255,255,.025); }
.moves .empty { color: var(--muted); padding: 8px 6px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(6, 9, 18, 0.72);
  display: none; place-items: center;
  backdrop-filter: blur(4px);
}
.modal-backdrop.show { display: grid; }
.modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  width: min(420px, 92vw);
  text-align: center;
  box-shadow: var(--shadow);
  animation: pop .2s ease;
}
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h2 { margin: 0 0 6px; }
.modal p { color: var(--muted); margin: 0 0 18px; }
.promo-choices { display: flex; justify-content: center; gap: 10px; }
.promo-choices button {
  width: 64px; height: 64px; font-size: 40px;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel-2); cursor: pointer; transition: .15s;
}
.promo-choices button:hover { border-color: var(--accent); transform: translateY(-2px); }
.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 6px; }
.result-emoji { font-size: 52px; }

/* ---------- İçerik sayfaları ---------- */
.content-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.info-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 22px;
}
.info-card h3 { margin-top: 0; display: flex; align-items: center; gap: 10px; }
.info-card .ic { font-size: 1.5rem; }
.info-card ul { padding-left: 18px; margin: 8px 0; }
.info-card li { margin: 6px 0; }
.info-card p { color: #cfd6ea; }

.piece-table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.piece-table th, .piece-table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.piece-table th { color: var(--muted); font-weight: 600; font-size: .85rem; }
.piece-table .glyph { font-size: 30px; width: 44px; }
.piece-table .glyph .w { color: #f3f3ee; -webkit-text-stroke: 1.3px #555; }
.piece-table .val { color: var(--accent); font-weight: 700; }

.callout {
  background: linear-gradient(145deg, rgba(91,141,239,.14), rgba(240,180,41,.10));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px; margin-bottom: 20px;
}
.callout b { color: var(--accent); }

/* Hakkında */
.about-hero {
  display: flex; gap: 22px; align-items: center; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px; margin-bottom: 20px;
}
.avatar {
  width: 110px; height: 110px; border-radius: 50%;
  display: grid; place-items: center; font-size: 54px;
  background: linear-gradient(145deg, var(--accent-2), #7c5cff);
  color: #fff; flex-shrink: 0;
  box-shadow: 0 10px 30px rgba(91,141,239,.4);
}
.about-hero h2 { margin: 0 0 4px; }
.about-hero .role { color: var(--accent); font-weight: 600; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.badge { font-size: .78rem; background: var(--panel-2); border: 1px solid var(--line); padding: 4px 10px; border-radius: 20px; color: var(--muted); }

.footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 30px 0 6px; }
.footer b { color: var(--ink); }

/* küçük yardımcılar */
.kbd { background: #0c1020; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; font-size: .82rem; }
.divider { height: 1px; background: var(--line); margin: 18px 0; border: none; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
