/* Kółko i krzyżyk — style specyficzne dla gry */

.turn {
  margin: 0;
  font-weight: 600;
  color: var(--muted);
  min-height: 1.6em;
}

/* --- baner z wynikiem rundy --- */

.result {
  width: min(420px, 100%);
  display: grid;
  gap: 2px;
  place-items: center;
  text-align: center;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid rgba(167, 139, 250, .45);
  animation: resultIn .3s cubic-bezier(.2, .8, .3, 1.2);
}

/* `display: grid` wyżej wygrywa z atrybutem hidden — trzeba go przywrócić jawnie */
.result[hidden] { display: none; }

.result__text {
  margin: 0;
  font-size: clamp(1.25rem, 5vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -.02em;
  background: linear-gradient(100deg, var(--violet), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.result__countdown {
  margin: 0;
  font-size: .85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

@keyframes resultIn {
  from { opacity: 0; transform: translateY(-8px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

.ttt {
  width: min(420px, 100%);
  aspect-ratio: 1;
  display: grid;
  /*
   * Obie osie muszą być zadeklarowane jawnie. Bez `grid-template-rows` wiersze są
   * niejawne i mają rozmiar `auto`, więc rosną pod wstawioną figurę — pola zmieniały
   * rozmiar w trakcie gry. `minmax(0, 1fr)` zamiast `1fr` odcina też domyślne
   * minimum `auto`, przez które duży znak mógłby jeszcze rozepchnąć ścieżkę.
   */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ttt-cell {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  font-size: clamp(2.2rem, 12vw, 3.6rem);
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s;
}

.ttt-cell:hover:not(:disabled) {
  background: var(--surface-hi);
  border-color: rgba(167, 139, 250, .55);
  transform: translateY(-2px);
}

.ttt-cell:disabled { cursor: default; }

.ttt-cell[data-mark="X"] { color: var(--pink); }
.ttt-cell[data-mark="O"] { color: #fbbf24; }

.ttt-cell[data-mark] { animation: drop .25s cubic-bezier(.2, .8, .3, 1.3); }

.ttt-cell.is-win {
  border-color: currentColor;
  box-shadow: 0 0 0 2px currentColor inset, 0 0 30px rgba(167, 139, 250, .35);
  background: rgba(255, 255, 255, .08);
}

.ttt-cell.is-dim { opacity: .35; }

@keyframes drop {
  from { transform: scale(.4); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
