js+css实现双人井字游戏代码

代码语言:html

所属分类:游戏

代码描述:js+css实现双人井字游戏代码,井字游戏。游戏在一个3x3的网格上进行,使用×与O来记录每一步。以下是游戏的基本规则: 游戏准备: 两名玩家,一个用“X”,另一个用“O”。 准备一个3x3的网格。 游戏进行: 玩家轮流在网格的空格中放置自己的标记(“X”或“O”)。 第一个玩家从“X”开始。 胜利条件: 玩家通过在任意一行、一列或对角线上连续放置三个自己的标记来获胜。 如果所有的格子都被填满,但没有玩家达到上述条件,则游戏以平局结束。 游戏结束: 当有玩家获胜或游戏以平局结束时,游

代码标签: js css 双人 井字 游戏 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="dark light">


  
  
<style>
@charset "UTF-8";
@layer reset {
  *, *:before, *:after {
    box-sizing: border-box;
  }

  img {
    max-width: 100%;
  }
}
html {
  color-scheme: dark;
  background-color: canvas;
  padding: 1rem;
  font-family: system-ui;
  font-size: 1rem;
}
html body {
  display: grid;
  gap: 1.5rem;
  color: light-dark(#333, #aaa);
  color: light-dark(#444, #999);
  max-width: min(40rem, 100%);
  width: fit-content;
  width: min(100%, 42ch);
  margin: auto;
  text-align: center;
  padding-block: 0.5rem 0.5rem;
}

body {
  overflow: auto;
  position: relative;
  display: grid;
  place-content: center;
  width: 10rem;
  margin: auto;
  gap: 1rem;
  min-height: 90dvh;
  font-family: sans-serif;
  text-align: center;
}
body > * {
  transition: all 0.3s ease-in-out;
}

h1 {
  --player-1-clr: light-dark( oklch(0.5 0.15 200 / 1), oklch(0.7 0.07 200 / 1) );
  --player-2-clr: light-dark( oklch(0.75 0.20 20 / 1), oklch(0.7 0.15 20 / 1) );
  --player-clr: var(--player-1-clr);
  font-family: inherit;
  text-align: center;
  margin-block: 0;
  padding-block: 0;
  opacity: 0.6;
  display: grid;
  position: relative;
  z-index: -1;
  color: light-dark(#000, #ccc);
}

body:has(.player-2s-turn) h1 {
  --player-clr: var(--player-2-clr);
}

h1 small {
  font-size: 0.5em;
  font-weight: normal;
  color: #888888;
  color: light-dark(#555, #777);
}

.logo {
  font-size: 18rem;
  margin-block-end: -4.9rem;
  font-weight: normal;
  height: 6rem;
  opacity: 0.07;
  display: grid;
  place-content: center;
  user-select: none;
}

kbd {
  font-size: 0.9em;
  font-weight: bold;
  border: solid 1px #88888880;
  padding-inline: 0.5ch;
  border-radius: 3px;
}

hr {
  width: 100%;
  opacity: 0.25;
}

h1 sup {
  color: light-dark(#333, #ccc);
  font-size: 1.2rem;
  font-weight: normal;
  display: inline-block;
  display: block;
  font-family: "Georgia";
  position: absolute;
  right: -1ch;
  top: 0;
}

.description {
  text-align: left;
  line-height: 1.6;
  line-height: 1.75;
  margin: 0 0.25rem;
  padding: 0;
  padding-inline: 0.5rem;
  position: relative;
  display: block;
}
.description sup {
  font-family: "Georgia";
  font-size: 1.5rem;
  position: absolute;
  top: 1.175ch;
  left: -0.5ch;
}
.description em {
  font-style: normal;
}

.adjective {
  color: var(--player-clr);
  font-family: sans-serif;
  text-transform: uppercase;
  font-weight: normal;
  font-style: normal;
  font-size: 0.75em;
  font-size: 0.35em;
  line-height: 1;
  letter-spacing: 9.25px;
  position: relative;
  transition: color 0.3s ease-out;
  width: fit-content;
  margin-inline: auto;
  padding-left: 0.75ch;
}

b, i {
  font-family: inherit;
  font-weight: bold;
  font-style: normal;
  transition: all 0.3s ease-in-out;
  display: inline-grid;
  place-content: center;
  line-height: 0.75em;
  width: 0.75rem;
  height: 0.75rem;
  position: relative;
  z-index: 1;
}

b {
  color: var(--player-1-clr);
  transform: scale(2) translatey(-0.2rem);
}

i {
  color: var(--player-2-clr);
}

.fade-out {
  opacity: 75%;
  filter: grayscale(75%);
}

button {
  cursor: pointer;
  color: inherit;
  color: light-dark(#000, #fff);
  border: transparent;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  translate: 0 3px;
  width: max-content;
  margin-inline: auto;
  min-width: 17ch;
  transition: opacity 0.6s ease-out, background-color 0.1s ease-out, translate 0.6s ease-in-out;
}
button:hover {
  background-color: #88888840;
}
button:focus-visible {
  outline: dashed 1px currentcolor;
  outline-offset: -3px;
}
button:active {
  filter: scale(0.9);
}

table.xo:not(:has(b)) + footer button {
  visibility: hidden;
  opacity: 0;
  translate: 0 -1rem;
  pointer-events: none;
}

table.xo:has(b) + footer button {
  visibility: unset;
  opacity: 1;
  translate: 0 0;
  pointer-events: unset;
}

body {
  --player-1-clr: light-dark( oklch(0.5 0.15 200 / 1), oklch(0.7 0.07 200 / 1) );
  --player-2-clr: light-dark( oklch(0.75 0.20 20 / 1), oklch(0.7 0.15 20 / 1) );
  --player-clr: var(--player-1-clr);
  --shadow-color: 220 40% 2%;
  --shadow-strength: 25%;
  --inner-shadow-highlight: inset 0 -.5px 0 0 #fff1, inset 0 .5px 0 0 #0007;
  --shadow-6:
    0 -1px 2px 0 hsl(var(--shadow-color) / calc(var(--shadow-strength) + 2%)),
    0 3px 2px -2px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 3%)),
    0 7px 5px -2px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 3%)),
    0 12px 10px -2px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 4%)),
    0 22px 18px -2px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 5%)),
    0 41px 33px -2px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 6%)),
    0 100px 80px -2px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 7%));
}
body:has(.player-2s-turn) {
  --player-clr: var(--player-2-clr);
}

table.xo {
  --player-1-clr: light-dark( oklch(0.75 0.075 200 / 1), oklch(0.7 0.07 200 / 1) );
  --_block-size: 7rem;
  --_gap: .3rem;
  --_cursor-1: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" style="filter:invert(1);"><text x="0" y="20" font-family="sans-serif" font-size="2rem" fill="black" style="font-weight: bold; font-style: normal; line-height: .75em; width: .75rem; height: .75rem; display: block;">⨯</text></svg>');
  --_cursor-2: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" style="filter:invert(1);"><text x="0" y="20" font-family="sans-serif" font-size="1rem" fill="black" style="font-weight: bold; font-style: normal; line-height: .75em; width: .75rem; height: .75rem; display: block;">⭘</text></svg>');
  width: 100%;
  user-select: none;
  border-spacing: var(--_gap);
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  position: relative;
  margin-inline: auto;
  overflow: hidden;
  /* board bg */
  /* surfaces */
  /* edges */
  /* winner strokes */
}
table.xo:active {
  opacity: 0.98;
}
table.xo:not(.player-2s-turn) {
  cursor: var(--_cursor-1) 4 16, auto;
}
table.xo.player-2s-turn {
  cursor: var(--_cursor-2) 4 16, auto;
}
table.xo:active {
  cursor: var(--_cursor-2) 4 14, auto;
}
table.xo:active td {
  transition: opacity 0.6s linear;
}
table.xo:active.player-2s-turn {
  cursor: var(--_cursor-1) 4 14, auto;
}
table.xo:not(:active):has(td:focus-visible) {
  cursor: default;
}
table.xo::before {
  content: "";
  background: #000;
  background: light-dark(#222, transparent);
  position: absolute;
  inset: 0;
  inset: var(--_gap) 0 var(--_gap) 0;
  pointer-events: none;
  z-index: -1;
  opacity: 1;
}
table.xo td {
  position: relative;
  background: #000;
  background: light-dark(#333, #000);
  padding: 1rem;
  border: solid 1px #88888899;
  border-radius: 2px;
  height: var(--_block-size);
  width: var(--_block-size);
  place-content: center;
  transition: border 0.6s ease-in-out;
}
@starting-style {
  table.xo td {
    border-color: transparent;
  }
}
table.xo td:hover {
  background-attachment: fixed;
  background-image: radial-gradient(circle at var(--x, 0) var(--y, 0), rgba(255, 255, 255, 0.175), rgba(255, 255, 255, 0.025) 7.5rem);
}
table.xo td::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background-attachment: fixed;
  background-color: #000;
  background-image: radial-gradient(circle at var(--x, 0) var(--y, 0), rgba(255, 255, 255, 0.95), transparent 2rem);
  pointer-events: none;
  z-index: -1;
}
table.xo::after {
  background: linear-gradient(to var(--_to), transparent calc(var(--_distance) - 1px), var(--_color) calc(var(--_distance) - 1px), var(--_color) calc(var(--_distance) + 1px), transparent calc(var(--_distance) + 1px));
  display: block;
  pointer-events: none;
  content: "";
  position: absolute;
  inset: 0.5rem;
  inset: calc(var(--_gap) * 4);
  border-radius: 1rem;
  z-index: 1;
}
table.xo td {
  outline-offset: -1.25rem;
}
table.xo td:focus-visible {
  outline: dashed 1px var(--player-1-clr);
}
table.xo.player-2s-turn td:focus-visible {
  outline: dashed 1px var(--player-2-clr);
}
table.xo td footer {
  position: absolute;
  bottom: var(--_gap);
  left: 50%;
  translate: -50% 0;
  display: flex;
}

button .new-game {
  display: none;
}

footer > span {
  display: none;
}

*:has(> table.xo) .turn {
  --repeat: 1;
}
*:has(> table.xo) .turn > span {
  display: block;
  font-style: italic;
}
*:has(> table.xo) .turn > span > span {
  color: #888;
}
*:has(> table.xo) .turn .player-1 {
  color: var(--player-1-clr);
  display: block;
}
*:has(> table.xo) .turn .player-2 {
  color: var(--player-2-clr);
  display: none;
}

*:has(> table.xo.player-2s-turn) .turn {
  display: grid;
  place-content: center;
}
*:has(> table.xo.player-2s-turn) .turn .player-1 {
  display: none;
}
*:has(> table.xo.player-2s-turn) .turn .player-2 {
  display: block;
}

footer {
  --player-clr: var(--player-2-clr);
  display: grid;
  gap: 1rem;
}

.asterisk {
  color: var(--player-2-clr);
}

body:has(.player-2s-turn) :is(h1, footer) .asterisk {
  color: var(--player-1-clr);
}

table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b) {
  pointer-events: none;
  /* horizontal 1 */
  /* horizontal 2 */
  /* horizontal 3 */
  /* vertical 1 */
  /* vertical 2 */
  /* vertical 3 */
  /* diagonal 1 */
  /* diagonal 2 */
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b) + footer button .new-game {
  display: unset;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b) + footer button .reset {
  display: none;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b) + footer button:has(.new-game) {
  filter: invert(1);
  letter-spacing: 1px;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b) + footer button:has(.new-game):hover {
  background-color: #aaa;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b) ~ footer .player-1 {
  display: block;
  color: var(--player-2-clr);
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b).player-2s-turn ~ footer span.player-1 {
  display: none;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b).player-2s-turn ~ footer span.player-2 {
  display: block;
  color: var(--player-1-clr);
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b) ~ footer .turn {
  display: none;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b) ~ .pyro {
  display: block;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b) ~ .ttt-winner {
  display: grid;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b)::after {
  display: block;
  --_color: light-dark( oklch(0.5 0.15 200 / 1), oklch(0.7 0.07 200 / .75) );
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b)::after {
  --_distance: calc(16.66% - (2 * var(--_gap)) + 0px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(3) b)::after {
  --_distance: calc(50% - 1px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b)::after {
  --_distance: calc(83.33% + (2 * var(--_gap)) - 2px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b)::after {
  --_distance: calc(16.66% - (2 * var(--_gap)) - 1.5px);
  --_to: right;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(2) b)::after {
  --_distance: 50%;
  --_to: right;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(3) b)::after {
  --_distance: calc(83.33% + (2 * var(--_gap)) + 1.5px);
  --_to: right;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b)::after {
  --_distance: 50%;
  --_to: top right;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(1) b)::after {
  --_distance: 50%;
  --_to: top left;
}

table.xo:has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(3) b) {
  pointer-events: none;
  /* horizontal 1 */
  /* horizontal 2 */
  /* horizontal 3 */
  /* vertical 1 */
  /* vertical 2 */
  /* vertical 3 */
  /* diagonal 1 */
  /* diagonal 2 */
}
table.xo:has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(3) b) + footer button .new-game {
  display: unset;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(3) b) + footer button .reset {
  display: none;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(3) b) + footer button:has(.new-game) {
  filter: invert(1);
  letter-spacing: 1px;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(3) b) + footer button:has(.new-game):hover {
  background-color: #aaa;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(3) b) ~ footer .player-1 {
  display: block;
  color: var(--player-2-clr);
}
table.xo:has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(3) b).player-2s-turn ~ footer span.player-1 {
  display: none;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(3) b).player-2s-turn ~ footer span.player-2 {
  display: block;
  color: var(--player-1-clr);
}
table.xo:has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(3) b) ~ footer .turn {
  display: none;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(3) b) ~ .pyro {
  display: block;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(3) b) ~ .ttt-winner {
  display: grid;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(3) b)::after {
  display: block;
  --_color: light-dark( oklch(0.5 0.15 200 / 1), oklch(0.7 0.07 200 / .75) );
}
table.xo:has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b)::after {
  --_distance: calc(16.66% - (2 * var(--_gap)) + 0px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(3) b)::after {
  --_distance: calc(50% - 1px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b)::after {
  --_distance: calc(83.33% + (2 * var(--_gap)) - 2px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b)::after {
  --_distance: calc(16.66% - (2 * var(--_gap)) - 1.5px);
  --_to: right;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(2) b)::after {
  --_distance: 50%;
  --_to: right;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(3) b)::after {
  --_distance: calc(83.33% + (2 * var(--_gap)) + 1.5px);
  --_to: right;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b)::after {
  --_distance: 50%;
  --_to: top right;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(1) b)::after {
  --_distance: 50%;
  --_to: top left;
}

table.xo:has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b) {
  pointer-events: none;
  /* horizontal 1 */
  /* horizontal 2 */
  /* horizontal 3 */
  /* vertical 1 */
  /* vertical 2 */
  /* vertical 3 */
  /* diagonal 1 */
  /* diagonal 2 */
}
table.xo:has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b) + footer button .new-game {
  display: unset;
}
table.xo:has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b) + footer button .reset {
  display: none;
}
table.xo:has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b) + footer button:has(.new-game) {
  filter: invert(1);
  letter-spacing: 1px;
}
table.xo:has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b) + footer button:has(.new-game):hover {
  background-color: #aaa;
}
table.xo:has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b) ~ footer .player-1 {
  display: block;
  color: var(--player-2-clr);
}
table.xo:has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b).player-2s-turn ~ footer span.player-1 {
  display: none;
}
table.xo:has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b).player-2s-turn ~ footer span.player-2 {
  display: block;
  color: var(--player-1-clr);
}
table.xo:has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b) ~ footer .turn {
  display: none;
}
table.xo:has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b) ~ .pyro {
  display: block;
}
table.xo:has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b) ~ .ttt-winner {
  display: grid;
}
table.xo:has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b)::after {
  display: block;
  --_color: light-dark( oklch(0.5 0.15 200 / 1), oklch(0.7 0.07 200 / .75) );
}
table.xo:has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b)::after {
  --_distance: calc(16.66% - (2 * var(--_gap)) + 0px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(3) b)::after {
  --_distance: calc(50% - 1px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b)::after {
  --_distance: calc(83.33% + (2 * var(--_gap)) - 2px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b)::after {
  --_distance: calc(16.66% - (2 * var(--_gap)) - 1.5px);
  --_to: right;
}
table.xo:has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(2) b)::after {
  --_distance: 50%;
  --_to: right;
}
table.xo:has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(3) b)::after {
  --_distance: calc(83.33% + (2 * var(--_gap)) + 1.5px);
  --_to: right;
}
table.xo:has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b)::after {
  --_distance: 50%;
  --_to: top right;
}
table.xo:has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(1) b)::after {
  --_distance: 50%;
  --_to: top left;
}

table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b) {
  pointer-events: none;
  /* horizontal 1 */
  /* horizontal 2 */
  /* horizontal 3 */
  /* vertical 1 */
  /* vertical 2 */
  /* vertical 3 */
  /* diagonal 1 */
  /* diagonal 2 */
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b) + footer button .new-game {
  display: unset;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b) + footer button .reset {
  display: none;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b) + footer button:has(.new-game) {
  filter: invert(1);
  letter-spacing: 1px;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b) + footer button:has(.new-game):hover {
  background-color: #aaa;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b) ~ footer .player-1 {
  display: block;
  color: var(--player-2-clr);
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b).player-2s-turn ~ footer span.player-1 {
  display: none;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b).player-2s-turn ~ footer span.player-2 {
  display: block;
  color: var(--player-1-clr);
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b) ~ footer .turn {
  display: none;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b) ~ .pyro {
  display: block;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b) ~ .ttt-winner {
  display: grid;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b)::after {
  display: block;
  --_color: light-dark( oklch(0.5 0.15 200 / 1), oklch(0.7 0.07 200 / .75) );
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b)::after {
  --_distance: calc(16.66% - (2 * var(--_gap)) + 0px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(3) b)::after {
  --_distance: calc(50% - 1px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b)::after {
  --_distance: calc(83.33% + (2 * var(--_gap)) - 2px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b)::after {
  --_distance: calc(16.66% - (2 * var(--_gap)) - 1.5px);
  --_to: right;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(2) b)::after {
  --_distance: 50%;
  --_to: right;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(3) b)::after {
  --_distance: calc(83.33% + (2 * var(--_gap)) + 1.5px);
  --_to: right;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b)::after {
  --_distance: 50%;
  --_to: top right;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(1) b)::after {
  --_distance: 50%;
  --_to: top left;
}

table.xo:has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(2) b) {
  pointer-events: none;
  /* horizontal 1 */
  /* horizontal 2 */
  /* horizontal 3 */
  /* vertical 1 */
  /* vertical 2 */
  /* vertical 3 */
  /* diagonal 1 */
  /* diagonal 2 */
}
table.xo:has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(2) b) + footer button .new-game {
  display: unset;
}
table.xo:has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(2) b) + footer button .reset {
  display: none;
}
table.xo:has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(2) b) + footer button:has(.new-game) {
  filter: invert(1);
  letter-spacing: 1px;
}
table.xo:has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(2) b) + footer button:has(.new-game):hover {
  background-color: #aaa;
}
table.xo:has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(2) b) ~ footer .player-1 {
  display: block;
  color: var(--player-2-clr);
}
table.xo:has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(2) b).player-2s-turn ~ footer span.player-1 {
  display: none;
}
table.xo:has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(2) b).player-2s-turn ~ footer span.player-2 {
  display: block;
  color: var(--player-1-clr);
}
table.xo:has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(2) b) ~ footer .turn {
  display: none;
}
table.xo:has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(2) b) ~ .pyro {
  display: block;
}
table.xo:has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(2) b) ~ .ttt-winner {
  display: grid;
}
table.xo:has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(2) b)::after {
  display: block;
  --_color: light-dark( oklch(0.5 0.15 200 / 1), oklch(0.7 0.07 200 / .75) );
}
table.xo:has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b)::after {
  --_distance: calc(16.66% - (2 * var(--_gap)) + 0px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(3) b)::after {
  --_distance: calc(50% - 1px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b)::after {
  --_distance: calc(83.33% + (2 * var(--_gap)) - 2px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b)::after {
  --_distance: calc(16.66% - (2 * var(--_gap)) - 1.5px);
  --_to: right;
}
table.xo:has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(2) b)::after {
  --_distance: 50%;
  --_to: right;
}
table.xo:has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(3) b)::after {
  --_distance: calc(83.33% + (2 * var(--_gap)) + 1.5px);
  --_to: right;
}
table.xo:has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b)::after {
  --_distance: 50%;
  --_to: top right;
}
table.xo:has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(1) b)::after {
  --_distance: 50%;
  --_to: top left;
}

table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(3) b) {
  pointer-events: none;
  /* horizontal 1 */
  /* horizontal 2 */
  /* horizontal 3 */
  /* vertical 1 */
  /* vertical 2 */
  /* vertical 3 */
  /* diagonal 1 */
  /* diagonal 2 */
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(3) b) + footer button .new-game {
  display: unset;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(3) b) + footer button .reset {
  display: none;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(3) b) + footer button:has(.new-game) {
  filter: invert(1);
  letter-spacing: 1px;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(3) b) + footer button:has(.new-game):hover {
  background-color: #aaa;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(3) b) ~ footer .player-1 {
  display: block;
  color: var(--player-2-clr);
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(3) b).player-2s-turn ~ footer span.player-1 {
  display: none;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(3) b).player-2s-turn ~ footer span.player-2 {
  display: block;
  color: var(--player-1-clr);
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(3) b) ~ footer .turn {
  display: none;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(3) b) ~ .pyro {
  display: block;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(3) b) ~ .ttt-winner {
  display: grid;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(3) b)::after {
  display: block;
  --_color: light-dark( oklch(0.5 0.15 200 / 1), oklch(0.7 0.07 200 / .75) );
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b)::after {
  --_distance: calc(16.66% - (2 * var(--_gap)) + 0px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(3) b)::after {
  --_distance: calc(50% - 1px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b)::after {
  --_distance: calc(83.33% + (2 * var(--_gap)) - 2px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b)::after {
  --_distance: calc(16.66% - (2 * var(--_gap)) - 1.5px);
  --_to: right;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(2) b)::after {
  --_distance: 50%;
  --_to: right;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(3) b)::after {
  --_distance: calc(83.33% + (2 * var(--_gap)) + 1.5px);
  --_to: right;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b)::after {
  --_distance: 50%;
  --_to: top right;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(1) b)::after {
  --_distance: 50%;
  --_to: top left;
}

table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b) {
  pointer-events: none;
  /* horizontal 1 */
  /* horizontal 2 */
  /* horizontal 3 */
  /* vertical 1 */
  /* vertical 2 */
  /* vertical 3 */
  /* diagonal 1 */
  /* diagonal 2 */
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b) + footer button .new-game {
  display: unset;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b) + footer button .reset {
  display: none;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b) + footer button:has(.new-game) {
  filter: invert(1);
  letter-spacing: 1px;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b) + footer button:has(.new-game):hover {
  background-color: #aaa;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b) ~ footer .player-1 {
  display: block;
  color: var(--player-2-clr);
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b).player-2s-turn ~ footer span.player-1 {
  display: none;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b).player-2s-turn ~ footer span.player-2 {
  display: block;
  color: var(--player-1-clr);
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b) ~ footer .turn {
  display: none;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b) ~ .pyro {
  display: block;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b) ~ .ttt-winner {
  display: grid;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b)::after {
  display: block;
  --_color: light-dark( oklch(0.5 0.15 200 / 1), oklch(0.7 0.07 200 / .75) );
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b)::after {
  --_distance: calc(16.66% - (2 * var(--_gap)) + 0px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(3) b)::after {
  --_distance: calc(50% - 1px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b)::after {
  --_distance: calc(83.33% + (2 * var(--_gap)) - 2px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b)::after {
  --_distance: calc(16.66% - (2 * var(--_gap)) - 1.5px);
  --_to: right;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(2) b)::after {
  --_distance: 50%;
  --_to: right;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(3) b)::after {
  --_distance: calc(83.33% + (2 * var(--_gap)) + 1.5px);
  --_to: right;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b)::after {
  --_distance: 50%;
  --_to: top right;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b):has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(1) b)::after {
  --_distance: 50%;
  --_to: top left;
}

table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(1) b) {
  pointer-events: none;
  /* horizontal 1 */
  /* horizontal 2 */
  /* horizontal 3 */
  /* vertical 1 */
  /* vertical 2 */
  /* vertical 3 */
  /* diagonal 1 */
  /* diagonal 2 */
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(1) b) + footer button .new-game {
  display: unset;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(1) b) + footer button .reset {
  display: none;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(1) b) + footer button:has(.new-game) {
  filter: invert(1);
  letter-spacing: 1px;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(1) b) + footer button:has(.new-game):hover {
  background-color: #aaa;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(1) b) ~ footer .player-1 {
  display: block;
  color: var(--player-2-clr);
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(1) b).player-2s-turn ~ footer span.player-1 {
  display: none;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(1) b).player-2s-turn ~ footer span.player-2 {
  display: block;
  color: var(--player-1-clr);
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(1) b) ~ footer .turn {
  display: none;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(1) b) ~ .pyro {
  display: block;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(1) b) ~ .ttt-winner {
  display: grid;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(1) b)::after {
  display: block;
  --_color: light-dark( oklch(0.5 0.15 200 / 1), oklch(0.7 0.07 200 / .75) );
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(1) td:nth-child(3) b)::after {
  --_distance: calc(16.66% - (2 * var(--_gap)) + 0px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(3) b)::after {
  --_distance: calc(50% - 1px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b)::after {
  --_distance: calc(83.33% + (2 * var(--_gap)) - 2px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(1) b):has(tr:nth-child(3) td:nth-child(1) b)::after {
  --_distance: calc(16.66% - (2 * var(--_gap)) - 1.5px);
  --_to: right;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(2) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(2) b)::after {
  --_distance: 50%;
  --_to: right;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(3) b):has(tr:nth-child(3) td:nth-child(3) b)::after {
  --_distance: calc(83.33% + (2 * var(--_gap)) + 1.5px);
  --_to: right;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(1) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(3) b)::after {
  --_distance: 50%;
  --_to: top right;
}
table.xo:has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(1) b):has(tr:nth-child(1) td:nth-child(3) b):has(tr:nth-child(2) td:nth-child(2) b):has(tr:nth-child(3) td:nth-child(1) b)::after {
  --_distance: 50%;
  --_to: top left;
}

table.xo:has(tr:nth-child(1) td:nth-child(1) i):has(tr:nth-child(1) td:nth-child(2) i):has(tr:nth-child(1) td:nth-child(3) i) {
  pointer-events: none;
  /* horizontal 1 */
  /* horizontal 2 */
  /* horizontal 3 */
  /* vertical 1 */
  /* vertical 2 */
  /* vertical 3 */
  /* diagonal 1 */
  /* diagonal 2 */
}
table.xo:has(tr:nth-child(1) td:nth-child(1) i):has(tr:nth-child(1) td:nth-child(2) i):has(tr:nth-child(1) td:nth-child(3) i) + footer button .new-game {
  display: unset;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) i):has(tr:nth-child(1) td:nth-child(2) i):has(tr:nth-child(1) td:nth-child(3) i) + footer button .reset {
  display: none;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) i):has(tr:nth-child(1) td:nth-child(2) i):has(tr:nth-child(1) td:nth-child(3) i) + footer button:has(.new-game) {
  filter: invert(1);
  letter-spacing: 1px;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) i):has(tr:nth-child(1) td:nth-child(2) i):has(tr:nth-child(1) td:nth-child(3) i) + footer button:has(.new-game):hover {
  background-color: #aaa;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) i):has(tr:nth-child(1) td:nth-child(2) i):has(tr:nth-child(1) td:nth-child(3) i) ~ footer .player-1 {
  display: block;
  color: var(--player-2-clr);
}
table.xo:has(tr:nth-child(1) td:nth-child(1) i):has(tr:nth-child(1) td:nth-child(2) i):has(tr:nth-child(1) td:nth-child(3) i).player-2s-turn ~ footer span.player-1 {
  display: none;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) i):has(tr:nth-child(1) td:nth-child(2) i):has(tr:nth-child(1) td:nth-child(3) i).player-2s-turn ~ footer span.player-2 {
  display: block;
  color: var(--player-1-clr);
}
table.xo:has(tr:nth-child(1) td:nth-child(1) i):has(tr:nth-child(1) td:nth-child(2) i):has(tr:nth-child(1) td:nth-child(3) i) ~ footer .turn {
  display: none;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) i):has(tr:nth-child(1) td:nth-child(2) i):has(tr:nth-child(1) td:nth-child(3) i) ~ .pyro {
  display: block;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) i):has(tr:nth-child(1) td:nth-child(2) i):has(tr:nth-child(1) td:nth-child(3) i) ~ .ttt-winner {
  display: grid;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) i):has(tr:nth-child(1) td:nth-child(2) i):has(tr:nth-child(1) td:nth-child(3) i)::after {
  display: block;
  --_color: light-dark( oklch(0.75 0.20 20 / 1), oklch(0.7 0.15 20 / .75) );
}
table.xo:has(tr:nth-child(1) td:nth-child(1) i):has(tr:nth-child(1) td:nth-child(2) i):has(tr:nth-child(1) td:nth-child(3) i):has(tr:nth-child(1) td:nth-child(1) i):has(tr:nth-child(1) td:nth-child(2) i):has(tr:nth-child(1) td:nth-child(3) i)::after {
  --_distance: calc(16.66% - (2 * var(--_gap)) + 0px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) i):has(tr:nth-child(1) td:nth-child(2) i):has(tr:nth-child(1) td:nth-child(3) i):has(tr:nth-child(2) td:nth-child(1) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(2) td:nth-child(3) i)::after {
  --_distance: calc(50% - 1px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) i):has(tr:nth-child(1) td:nth-child(2) i):has(tr:nth-child(1) td:nth-child(3) i):has(tr:nth-child(3) td:nth-child(1) i):has(tr:nth-child(3) td:nth-child(2) i):has(tr:nth-child(3) td:nth-child(3) i)::after {
  --_distance: calc(83.33% + (2 * var(--_gap)) - 2px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) i):has(tr:nth-child(1) td:nth-child(2) i):has(tr:nth-child(1) td:nth-child(3) i):has(tr:nth-child(1) td:nth-child(1) i):has(tr:nth-child(2) td:nth-child(1) i):has(tr:nth-child(3) td:nth-child(1) i)::after {
  --_distance: calc(16.66% - (2 * var(--_gap)) - 1.5px);
  --_to: right;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) i):has(tr:nth-child(1) td:nth-child(2) i):has(tr:nth-child(1) td:nth-child(3) i):has(tr:nth-child(1) td:nth-child(2) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(3) td:nth-child(2) i)::after {
  --_distance: 50%;
  --_to: right;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) i):has(tr:nth-child(1) td:nth-child(2) i):has(tr:nth-child(1) td:nth-child(3) i):has(tr:nth-child(1) td:nth-child(3) i):has(tr:nth-child(2) td:nth-child(3) i):has(tr:nth-child(3) td:nth-child(3) i)::after {
  --_distance: calc(83.33% + (2 * var(--_gap)) + 1.5px);
  --_to: right;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) i):has(tr:nth-child(1) td:nth-child(2) i):has(tr:nth-child(1) td:nth-child(3) i):has(tr:nth-child(1) td:nth-child(1) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(3) td:nth-child(3) i)::after {
  --_distance: 50%;
  --_to: top right;
}
table.xo:has(tr:nth-child(1) td:nth-child(1) i):has(tr:nth-child(1) td:nth-child(2) i):has(tr:nth-child(1) td:nth-child(3) i):has(tr:nth-child(1) td:nth-child(3) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(3) td:nth-child(1) i)::after {
  --_distance: 50%;
  --_to: top left;
}

table.xo:has(tr:nth-child(2) td:nth-child(1) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(2) td:nth-child(3) i) {
  pointer-events: none;
  /* horizontal 1 */
  /* horizontal 2 */
  /* horizontal 3 */
  /* vertical 1 */
  /* vertical 2 */
  /* vertical 3 */
  /* diagonal 1 */
  /* diagonal 2 */
}
table.xo:has(tr:nth-child(2) td:nth-child(1) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(2) td:nth-child(3) i) + footer button .new-game {
  display: unset;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(2) td:nth-child(3) i) + footer button .reset {
  display: none;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(2) td:nth-child(3) i) + footer button:has(.new-game) {
  filter: invert(1);
  letter-spacing: 1px;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(2) td:nth-child(3) i) + footer button:has(.new-game):hover {
  background-color: #aaa;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(2) td:nth-child(3) i) ~ footer .player-1 {
  display: block;
  color: var(--player-2-clr);
}
table.xo:has(tr:nth-child(2) td:nth-child(1) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(2) td:nth-child(3) i).player-2s-turn ~ footer span.player-1 {
  display: none;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(2) td:nth-child(3) i).player-2s-turn ~ footer span.player-2 {
  display: block;
  color: var(--player-1-clr);
}
table.xo:has(tr:nth-child(2) td:nth-child(1) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(2) td:nth-child(3) i) ~ footer .turn {
  display: none;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(2) td:nth-child(3) i) ~ .pyro {
  display: block;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(2) td:nth-child(3) i) ~ .ttt-winner {
  display: grid;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(2) td:nth-child(3) i)::after {
  display: block;
  --_color: light-dark( oklch(0.75 0.20 20 / 1), oklch(0.7 0.15 20 / .75) );
}
table.xo:has(tr:nth-child(2) td:nth-child(1) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(2) td:nth-child(3) i):has(tr:nth-child(1) td:nth-child(1) i):has(tr:nth-child(1) td:nth-child(2) i):has(tr:nth-child(1) td:nth-child(3) i)::after {
  --_distance: calc(16.66% - (2 * var(--_gap)) + 0px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(2) td:nth-child(3) i):has(tr:nth-child(2) td:nth-child(1) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(2) td:nth-child(3) i)::after {
  --_distance: calc(50% - 1px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(2) td:nth-child(3) i):has(tr:nth-child(3) td:nth-child(1) i):has(tr:nth-child(3) td:nth-child(2) i):has(tr:nth-child(3) td:nth-child(3) i)::after {
  --_distance: calc(83.33% + (2 * var(--_gap)) - 2px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(2) td:nth-child(3) i):has(tr:nth-child(1) td:nth-child(1) i):has(tr:nth-child(2) td:nth-child(1) i):has(tr:nth-child(3) td:nth-child(1) i)::after {
  --_distance: calc(16.66% - (2 * var(--_gap)) - 1.5px);
  --_to: right;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(2) td:nth-child(3) i):has(tr:nth-child(1) td:nth-child(2) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(3) td:nth-child(2) i)::after {
  --_distance: 50%;
  --_to: right;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(2) td:nth-child(3) i):has(tr:nth-child(1) td:nth-child(3) i):has(tr:nth-child(2) td:nth-child(3) i):has(tr:nth-child(3) td:nth-child(3) i)::after {
  --_distance: calc(83.33% + (2 * var(--_gap)) + 1.5px);
  --_to: right;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(2) td:nth-child(3) i):has(tr:nth-child(1) td:nth-child(1) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(3) td:nth-child(3) i)::after {
  --_distance: 50%;
  --_to: top right;
}
table.xo:has(tr:nth-child(2) td:nth-child(1) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(2) td:nth-child(3) i):has(tr:nth-child(1) td:nth-child(3) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(3) td:nth-child(1) i)::after {
  --_distance: 50%;
  --_to: top left;
}

table.xo:has(tr:nth-child(3) td:nth-child(1) i):has(tr:nth-child(3) td:nth-child(2) i):has(tr:nth-child(3) td:nth-child(3) i) {
  pointer-events: none;
  /* horizontal 1 */
  /* horizontal 2 */
  /* horizontal 3 */
  /* vertical 1 */
  /* vertical 2 */
  /* vertical 3 */
  /* diagonal 1 */
  /* diagonal 2 */
}
table.xo:has(tr:nth-child(3) td:nth-child(1) i):has(tr:nth-child(3) td:nth-child(2) i):has(tr:nth-child(3) td:nth-child(3) i) + footer button .new-game {
  display: unset;
}
table.xo:has(tr:nth-child(3) td:nth-child(1) i):has(tr:nth-child(3) td:nth-child(2) i):has(tr:nth-child(3) td:nth-child(3) i) + footer button .reset {
  display: none;
}
table.xo:has(tr:nth-child(3) td:nth-child(1) i):has(tr:nth-child(3) td:nth-child(2) i):has(tr:nth-child(3) td:nth-child(3) i) + footer button:has(.new-game) {
  filter: invert(1);
  letter-spacing: 1px;
}
table.xo:has(tr:nth-child(3) td:nth-child(1) i):has(tr:nth-child(3) td:nth-child(2) i):has(tr:nth-child(3) td:nth-child(3) i) + footer button:has(.new-game):hover {
  background-color: #aaa;
}
table.xo:has(tr:nth-child(3) td:nth-child(1) i):has(tr:nth-child(3) td:nth-child(2) i):has(tr:nth-child(3) td:nth-child(3) i) ~ footer .player-1 {
  display: block;
  color: var(--player-2-clr);
}
table.xo:has(tr:nth-child(3) td:nth-child(1) i):has(tr:nth-child(3) td:nth-child(2) i):has(tr:nth-child(3) td:nth-child(3) i).player-2s-turn ~ footer span.player-1 {
  display: none;
}
table.xo:has(tr:nth-child(3) td:nth-child(1) i):has(tr:nth-child(3) td:nth-child(2) i):has(tr:nth-child(3) td:nth-child(3) i).player-2s-turn ~ footer span.player-2 {
  display: block;
  color: var(--player-1-clr);
}
table.xo:has(tr:nth-child(3) td:nth-child(1) i):has(tr:nth-child(3) td:nth-child(2) i):has(tr:nth-child(3) td:nth-child(3) i) ~ footer .turn {
  display: none;
}
table.xo:has(tr:nth-child(3) td:nth-child(1) i):has(tr:nth-child(3) td:nth-child(2) i):has(tr:nth-child(3) td:nth-child(3) i) ~ .pyro {
  display: block;
}
table.xo:has(tr:nth-child(3) td:nth-child(1) i):has(tr:nth-child(3) td:nth-child(2) i):has(tr:nth-child(3) td:nth-child(3) i) ~ .ttt-winner {
  display: grid;
}
table.xo:has(tr:nth-child(3) td:nth-child(1) i):has(tr:nth-child(3) td:nth-child(2) i):has(tr:nth-child(3) td:nth-child(3) i)::after {
  display: block;
  --_color: light-dark( oklch(0.75 0.20 20 / 1), oklch(0.7 0.15 20 / .75) );
}
table.xo:has(tr:nth-child(3) td:nth-child(1) i):has(tr:nth-child(3) td:nth-child(2) i):has(tr:nth-child(3) td:nth-child(3) i):has(tr:nth-child(1) td:nth-child(1) i):has(tr:nth-child(1) td:nth-child(2) i):has(tr:nth-child(1) td:nth-child(3) i)::after {
  --_distance: calc(16.66% - (2 * var(--_gap)) + 0px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(3) td:nth-child(1) i):has(tr:nth-child(3) td:nth-child(2) i):has(tr:nth-child(3) td:nth-child(3) i):has(tr:nth-child(2) td:nth-child(1) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(2) td:nth-child(3) i)::after {
  --_distance: calc(50% - 1px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(3) td:nth-child(1) i):has(tr:nth-child(3) td:nth-child(2) i):has(tr:nth-child(3) td:nth-child(3) i):has(tr:nth-child(3) td:nth-child(1) i):has(tr:nth-child(3) td:nth-child(2) i):has(tr:nth-child(3) td:nth-child(3) i)::after {
  --_distance: calc(83.33% + (2 * var(--_gap)) - 2px);
  --_to: bottom;
}
table.xo:has(tr:nth-child(3) td:nth-child(1) i):has(tr:nth-child(3) td:nth-child(2) i):has(tr:nth-child(3) td:nth-child(3) i):has(tr:nth-child(1) td:nth-child(1) i):has(tr:nth-child(2) td:nth-child(1) i):has(tr:nth-child(3) td:nth-child(1) i)::after {
  --_distance: calc(16.66% - (2 * var(--_gap)) - 1.5px);
  --_to: right;
}
table.xo:has(tr:nth-child(3) td:nth-child(1) i):has(tr:nth-child(3) td:nth-child(2) i):has(tr:nth-child(3) td:nth-child(3) i):has(tr:nth-child(1) td:nth-child(2) i):has(tr:nth-child(2) td:nth-child(2) i):has(tr:nth-child(3) td:nth-child(2) i)::after {
  --_distance: 50%;
  --_to: right;
}
table.xo:has(tr:nth-child(3) td:nth-child(1) i):has(tr:nth-child(3) td:nth-child(2) i):has(tr:nth-child(3) td:nth-child(3) i):has(tr:nth-child(1) td:nth-child(3) i):has(tr:nth-child(2) td:nth-child.........完整代码请登录后点击上方下载按钮下载查看

网友评论0