/* Jogo da Velha — estilos */
.modos {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}
.modo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-sm);
  padding: 0.5em 1em;
  border-radius: var(--r-full);
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text-soft);
  transition: all var(--dur) var(--ease);
}
.modo:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.modo[aria-selected="true"] {
  background: var(--brand);
  color: var(--brand-ink);
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
}

.turno {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  color: var(--text-soft);
}
.turno b {
  color: var(--brand);
}

.tabuleiro {
  position: relative;
  width: min(92vw, 340px);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 5px;
  padding: 0;
  background: var(--border);
  overflow: hidden;
}
.celula {
  display: grid;
  place-items: center;
  background: var(--surface);
  border: none;
  cursor: pointer;
  position: relative;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 16vw, 4.4rem);
  line-height: 1;
  transition: background var(--dur) ease;
}
.celula:not(:disabled):hover {
  background: var(--surface-2);
}
.celula:disabled {
  cursor: default;
}
.celula.x {
  color: var(--violet);
}
.celula.o {
  color: var(--pink);
}
.celula .mark {
  animation: mark-in var(--dur-slow) var(--ease);
}
@keyframes mark-in {
  from {
    transform: scale(0.3) rotate(-12deg);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
.celula.vencedora {
  background: color-mix(in srgb, var(--amber) 25%, transparent);
}

.linha-vitoria {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}
.linha-vitoria line {
  stroke: var(--amber);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 420;
  stroke-dashoffset: 420;
  animation: traco var(--dur-slow) var(--ease) forwards;
}
@keyframes traco {
  to {
    stroke-dashoffset: 0;
  }
}
