/* 404 PAGE + GAMES */
.top-home {
  padding-top: 2px;
}

.top-home .badge {
  grid-column: 5;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
}

.top-home .dot {
  width: 4.6px;
  height: 4.6px;
  border-radius: 50%;
  background: #bfc1c0;
  display: block;
  margin-top: 1px;
}

.top-home .current {
  transition: color 0.2s;
}

.top-home .current:hover,
.top-home .logo:hover {
  color: var(--fg);
}

.hero {
  container-type: inline-size;
  display: grid;
  grid-template-columns: var(--cols);
  align-content: center;
  min-height: calc(906 * var(--u));
  min-height: max(calc(906 * var(--u)), 100svh);
  padding: calc(56 * var(--u))
    calc(max(var(--pad), env(safe-area-inset-right, 0px)) - 1px) 0
    calc(max(var(--pad), env(safe-area-inset-left, 0px)) - 1px);
}

.hero-label {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  color: var(--muted);
  align-self: start;
  padding-top: calc(1 * var(--u));
}

.hero-title {
  grid-column: 3/-1;
  grid-row: 1;
  margin: 0 0 0 -0.069em;
  font-size: 3.088cqw;
  line-height: 1.018;
  font-weight: 400;
  letter-spacing: 0;
}

.play-link {
  grid-column: 3;
  grid-row: 2;
  justify-self: start;
  margin-top: calc(77 * var(--u));
  color: var(--muted);
  transition: color 0.2s;
}

.play-link:hover {
  color: var(--fg);
}

.games {
  container-type: inline-size;
  display: grid;
  grid-template-columns: var(--cols);
  align-items: start;
  padding: calc(80 * var(--u))
    calc(max(var(--pad), env(safe-area-inset-right, 0px)) - 1px)
    calc(176 * var(--u))
    calc(max(var(--pad), env(safe-area-inset-left, 0px)) - 1px);
}

.games-title {
  grid-column: 1;
  margin: -3px 0 0;
  font-size: 16px;
  line-height: 20px;
  font-weight: 400;
  color: var(--fg);
}

.board {
  grid-column: 2/4;
  justify-self: start;
  width: 35.59cqw;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  border: 1px solid #666;
}

.cell {
  position: relative;
  background: none;
  border: 0;
  border-right: 1px solid #666;
  border-bottom: 1px solid #666;
  padding: 0;
  cursor: pointer;
  color: #8f8f8f;
  transition: background 0.2s;
}

.cell:nth-child(3n) {
  border-right: 0;
}

.cell:nth-child(n + 7) {
  border-bottom: 0;
}

.cell:not(:disabled):hover,
.cell:not(:disabled):focus-visible {
  background: #222;
}

.cell:disabled {
  cursor: default;
}

.cell svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.86;
  stroke-linecap: round;
  pointer-events: none;
}

.cell.win {
  color: #fff;
}

.cell .draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw 0.35s ease-out both;
}

@keyframes draw {
  from {
    stroke-dashoffset: 1;
  }

  to {
    stroke-dashoffset: 0;
  }
}

.panel {
  grid-column: 4/-1;
  align-self: stretch;
  display: grid;
  grid-template-rows: 131.2fr 68.5fr 68.5fr 113.8fr 68.5fr;
  gap: 8.1px;
}

.card {
  background: #1a1a1a;
  min-width: 0;
}

.panel p {
  margin: 0;
}

.label {
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

.status {
  padding: calc(16.5 * var(--u)) 32px 0 32px;
  display: block;
}

.status .status-title {
  margin-top: calc(12 * var(--u));
  font-size: 24px;
  line-height: 30px;
  color: var(--fg);
}

.status .status-sub {
  margin-top: calc(15 * var(--u));
}

.player-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 32px;
  transition: background 0.25s;
}

.player-row.active {
  background: #333;
}

.player-row .player-icon {
  flex: none;
  color: #8f8f8f;
}

.player-row .player-name {
  color: var(--fg);
}

.player-row .player-role {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8.1px;
}

.score-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding-bottom: 4px;
}

.score-tile .score {
  font-size: 42px;
  line-height: 42px;
  color: var(--fg);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8.1px;
}

.actions button {
  border: 0;
  border-radius: 0;
  font: inherit;
  font-size: 18px;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s;
}

.btn-new {
  background: #8f8f8f;
  color: #000;
}

.btn-new:hover {
  background: #a6a6a6;
}

.btn-reset {
  background: #1a1a1a;
  color: var(--fg);
}

.btn-reset:hover {
  background: #262626;
}

@media (max-width: 1100px) {
  .top-home {
    padding-top: 2px;
  }

  .top-home .badge {
    grid-column: 3;
  }

  .top-home {
    grid-template-columns: 1fr 1fr auto;
  }

  .hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    padding-top: 100px;
    padding-bottom: 40px;
  }

  .hero-label {
    padding: 0;
    margin-bottom: 24px;
  }

  .hero-title {
    margin: 0 0 0 -0.05em;
    font-size: clamp(26px, 5.6vw, 42px);
    line-height: 1.02;
  }

  .play-link {
    margin-top: 36px;
  }

  .games {
    display: block;
    padding-top: 48px;
    padding-bottom: 96px;
  }

  .games-title {
    margin: 0 0 20px;
  }

  .board {
    width: 100%;
  }

  .panel {
    width: 100%;
    margin-top: 8px;
    grid-template-rows: none;
    grid-auto-rows: auto;
  }

  .panel .status {
    padding-bottom: 20px;
  }

  .player-row {
    height: 68.5px;
  }

  .score-tile {
    height: 114px;
  }

  .actions button {
    height: 68.5px;
  }
}

@media (max-width: 600px) {
  .panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .panel .status {
    order: 1;
    padding: 16px 20px;
  }

  .panel .status .label:first-child {
    display: none;
  }

  .panel .status .status-title {
    margin-top: 0;
  }

  .panel .status .status-sub {
    margin-top: 6px;
  }

  .panel .actions {
    order: 2;
  }

  .panel .player-row {
    order: 3;
  }

  .panel .scoreboard {
    order: 4;
  }

  .actions button {
    height: 56px;
  }

  .top-home {
    display: flex;
    justify-content: space-between;
  }

  .top-home .games-link {
    display: none;
  }

  .status,
  .player-row {
    padding-left: 20px;
    padding-right: 20px;
  }
}
