.game-root[data-game="tic-tac-toe"] { min-height: 36rem; }

.ttt-num {
  display: inline-block;
  min-width: 3ch;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.ttt-new {
  min-width: 8.6rem;
  white-space: nowrap;
}

.ttt-stage {
  width: min(100%, 22rem);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  user-select: none;
}

.ttt-status {
  min-height: 4.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.12rem;
  text-align: center;
}

.ttt-line,
.ttt-note {
  margin: 0;
  line-height: 1.35;
  min-height: 1.35em;
}

.ttt-line { color: #f4f0e8; }

.ttt-note {
  color: #d5ddd6;
  font-size: 0.95rem;
}

.ttt-note.is-good { color: #e0b948; }

.ttt-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  min-height: 2.75rem;
}

.ttt-who {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  margin: 0;
  padding: 0 0.4rem;
  border-radius: 10px;
  color: #d5ddd6;
  font-size: 0.95rem;
  box-shadow: inset 0 0 0 1px transparent;
}

.ttt-who.is-turn {
  color: #f4f0e8;
  box-shadow: inset 0 0 0 1px rgba(224, 185, 72, 0.75);
}

.ttt-avatar {
  width: 1.65rem;
  height: 1.65rem;
}

.ttt-key {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
  flex: 0 0 auto;
}

.ttt-key path,
.ttt-key circle {
  fill: none;
  stroke-linecap: round;
  stroke-width: 10;
}

.ttt-key.is-you path { stroke: #f4f0e8; }
.ttt-key.is-him circle { stroke: #e7b2a8; }

.ttt-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  padding: 0.7rem;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 42%),
    #14241e;
  box-shadow:
    inset 0 0 0 1px rgba(232, 217, 168, 0.38),
    inset 0 12px 24px rgba(0, 0, 0, 0.25);
}

.ttt-board.is-live {
  box-shadow:
    inset 0 0 0 1px rgba(224, 185, 72, 0.75),
    inset 0 12px 24px rgba(0, 0, 0, 0.25);
}

.ttt-cell {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  aspect-ratio: 1;
  min-width: 0;
  min-height: var(--tap-min);
  background: #fffdf7;
  box-shadow:
    inset 0 0 0 1px rgba(184, 146, 58, 0.45),
    0 1px 0 rgba(255, 255, 255, 0.35);
  cursor: default;
  touch-action: manipulation;
}

.ttt-cell:focus-visible {
  outline: 3px solid #e0b948;
  outline-offset: 2px;
}

.ttt-cell.is-open { cursor: pointer; }

.ttt-cell.is-open:hover {
  box-shadow:
    inset 0 0 0 2px rgba(224, 185, 72, 0.9),
    0 1px 0 rgba(255, 255, 255, 0.35);
}

.ttt-cell.is-last {
  box-shadow:
    inset 0 0 0 2px rgba(184, 146, 58, 0.85),
    0 1px 0 rgba(255, 255, 255, 0.35);
}

.ttt-cell.is-win {
  background: #fff6df;
  box-shadow:
    inset 0 0 0 3px #e0b948,
    0 1px 0 rgba(255, 255, 255, 0.35);
}

.ttt-mark {
  width: 86%;
  height: 86%;
  display: block;
}

.ttt-mark path,
.ttt-mark circle {
  fill: none;
  stroke-linecap: round;
}

.ttt-mark.is-you path { stroke: #1d2433; stroke-width: 8; }
.ttt-mark.is-him circle { stroke: #8f2f2c; stroke-width: 8; }
