/* XOX — yalnız XOX'a özgü yerleşim ve hareket (ayar ekranı, durum satırı, düğmeler ortak: proje.css "Oyun ekranı ortak").
    Renk kodu yok: renkler proje.css :root'taki değişkenlerden
   (--oyuncu-1 X, --oyuncu-2 O, --tahta-zemin, --hucre-zemin …). */

/* X / O rozeti (etiket, skor, durum satırı) */
.xox-rozet {
  display: inline-grid; place-items: center; flex: none; width: 1.7em; height: 1.7em; border-radius: 7px;
  font-weight: 800; font-size: .85em; line-height: 1; vertical-align: middle;
}
.xox-rozet.x { background: var(--oyuncu-1-soft); color: var(--oyuncu-1-yazi); }
.xox-rozet.o { background: var(--oyuncu-2-soft); color: var(--oyuncu-2-yazi); }

/* ---- Skor ---- */
.xox-skor { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: stretch; }
.xox-oyuncu {
  display: flex; align-items: center; gap: 8px; min-width: 0; padding: 9px 12px;
  background: var(--surface); border: 1px solid var(--border-color); border-radius: 12px;
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.xox-oyuncu.o { flex-direction: row-reverse; text-align: right; }
.xox-oyuncu .xox-rozet { font-size: 1rem; }
.xox-oyuncu-ad { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.xox-puan { font-size: 1.5rem; line-height: 1; font-variant-numeric: tabular-nums; }
.xox-oyuncu.aktif.x { background: var(--oyuncu-1-soft); border-color: var(--oyuncu-1); box-shadow: inset 0 0 0 1px var(--oyuncu-1); }
.xox-oyuncu.aktif.o { background: var(--oyuncu-2-soft); border-color: var(--oyuncu-2); box-shadow: inset 0 0 0 1px var(--oyuncu-2); }
.xox-oyuncu.aktif .xox-rozet { background: var(--surface); }   /* kutu zemini rozetinkiyle aynı olunca kaybolmasın */
.xox-berabere { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0 6px; color: var(--text-secondary); }
.xox-berabere small { font-size: var(--fs-kucuk); }
.xox-berabere .xox-puan { font-size: 1.15rem; color: var(--text-primary); }

/* ---- Durum satırı (düzeni ortak .oyun-durum) ---- */
.oyun-durum .xox-rozet { font-size: .95rem; }
.oyun-durum.kazandi.x b { color: var(--oyuncu-1-yazi); }
.oyun-durum.kazandi.o b { color: var(--oyuncu-2-yazi); }

/* ---- Tahta: telefonda ekran genişliği, bilgisayarda ekran yüksekliğine sığar ---- */
.xox-tahta {
  --bosluk: 8px;
  width: min(100%, calc(100vh - 320px)); width: min(100%, calc(100dvh - 320px)); min-width: min(100%, 280px);
  aspect-ratio: 1; margin: 0 auto; padding: var(--bosluk);
  display: flex; flex-direction: column; gap: var(--bosluk);
  background: var(--tahta-zemin); border-radius: 18px;
}
.xox-tahta.n5 { --bosluk: 6px; border-radius: 16px; }
.xox-satir { flex: 1; min-height: 0; display: flex; gap: var(--bosluk); }
.xox-hucre {
  position: relative; flex: 1; min-width: 0; padding: 0; border: 0; border-radius: 12px;
  display: grid; place-items: center; background: var(--hucre-zemin); box-shadow: 0 1px 2px rgba(var(--golge-rgb), .08);
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: background-color .12s, opacity .2s, box-shadow .15s;
}
.xox-tahta.n5 .xox-hucre { border-radius: 9px; }
.xox-hucre:focus-visible { outline: 3px solid var(--brand-primary); outline-offset: 2px; z-index: 1; }
.xox-hucre.x { color: var(--oyuncu-1); }
.xox-hucre.o { color: var(--oyuncu-2); }
.xox-hucre svg { width: 80%; height: 80%; fill: none; stroke: currentColor; stroke-width: 11; stroke-linecap: round; }
.xox-tahta.n5 .xox-hucre svg { stroke-width: 12; }
.xox-hucre svg path, .xox-hucre svg circle { stroke-dasharray: 1; stroke-dashoffset: 1; animation: xox-ciz .25s ease-out forwards; }
.xox-hucre svg path + path { animation-delay: .12s; }
.xox-hucre.dolu, .xox-tahta.bitti .xox-hucre { cursor: default; }
.xox-tahta.bekle .xox-hucre:not(.dolu) { cursor: wait; }
@media (hover: hover) {   /* fareyle boş hücrenin üstüne gelince sıradakinin rengi */
  .xox-tahta[data-sira="x"]:not(.bitti):not(.bekle) .xox-hucre:not(.dolu):hover { background: var(--oyuncu-1-soft); }
  .xox-tahta[data-sira="o"]:not(.bitti):not(.bekle) .xox-hucre:not(.dolu):hover { background: var(--oyuncu-2-soft); }
}
.xox-tahta.bitti .xox-hucre:not(.kazanan) { opacity: .4; }
.xox-tahta.kazanan-x .kazanan { background: var(--oyuncu-1-soft); box-shadow: inset 0 0 0 2px var(--oyuncu-1); animation: xox-zipla .45s ease-out; }
.xox-tahta.kazanan-o .kazanan { background: var(--oyuncu-2-soft); box-shadow: inset 0 0 0 2px var(--oyuncu-2); animation: xox-zipla .45s ease-out; }

@keyframes xox-ciz { to { stroke-dashoffset: 0; } }
@keyframes xox-zipla { 0% { transform: scale(1); } 40% { transform: scale(1.07); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .xox-hucre svg path, .xox-hucre svg circle { animation: none; stroke-dashoffset: 0; }
  .xox-tahta .kazanan { animation: none; }
}

@media (max-width: 575.98px) {   /* telefonda ad alt satırda: "Bilgisayar · Zor" kesilmesin */
  .xox-oyuncu { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "rozet puan" "ad ad"; gap: 4px 6px; padding: 8px 10px; }
  .xox-oyuncu.o { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "puan rozet" "ad ad"; }
  .xox-oyuncu .xox-rozet { grid-area: rozet; }
  .xox-oyuncu .xox-puan { grid-area: puan; font-size: 1.35rem; text-align: right; }
  .xox-oyuncu.o .xox-puan { text-align: left; }
  .xox-oyuncu-ad { grid-area: ad; font-size: .93rem; }
}
