.four-page {
  max-width: 760px;
  margin-inline: auto;
  padding-block: 4px 38px;
}

.four-intro {
  margin-bottom: 8px;
}

.four-intro h1 {
  margin-bottom: 3px;
  font-size: clamp(32px, 8vw, 42px);
  letter-spacing: -2px;
  line-height: 1.1;
}

.four-intro p,
.four-how-to-play p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.four-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  box-shadow: 0 12px 30px #29234a0a;
}

.four-status {
  width: min(100%, 380px);
  min-height: 21px;
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

.four-board {
  width: min(100%, 520px);
  aspect-ratio: 7 / 6;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #dcd5fa;
  border-radius: 14px;
  background: #e9e3ff;
  touch-action: manipulation;
}

.four-column {
  min-width: 0;
  display: grid;
  grid-template-rows: repeat(6, minmax(0, 1fr));
  gap: 0;
  padding: 3px 0;
  border: 0;
  border-right: 1px solid #dcd5fa;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.four-column:last-child {
  border-right: 0;
}

.four-column:focus-visible,
.four-restart:focus-visible {
  position: relative;
  z-index: 1;
  outline: 3px solid #5f45d2;
  outline-offset: -3px;
}

.four-column[aria-disabled="true"] {
  cursor: default;
}

.four-slot {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
}

.four-disc {
  width: min(84%, 48px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 2px solid #d6d0e8;
  border-radius: 50%;
  background: white;
  color: transparent;
  font-size: clamp(11px, 3.2vw, 16px);
  font-weight: 800;
  line-height: 1;
}

.four-disc[data-player="human"] {
  border-color: #5f45d2;
  background: #7257e8;
  color: white;
}

.four-disc[data-player="computer"] {
  border-color: #205d41;
  background: #287452;
  color: white;
}

.four-restart {
  min-width: 160px;
  min-height: 44px;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.four-how-to-play {
  margin-top: 20px;
}

.four-how-to-play h2 {
  margin-bottom: 6px;
  font-size: 20px;
  letter-spacing: -0.5px;
}

.four-related-games {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.four-related-games a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--purple-dark);
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (hover: hover) {
  .four-column:not([aria-disabled="true"]):hover {
    background: #ded6ff;
  }
}

@media (min-width: 600px) {
  .four-page {
    padding-block: 8px 48px;
  }

  .four-panel {
    gap: 9px;
    padding: 12px;
  }

  .four-board {
    border-radius: 16px;
  }

  .four-column {
    padding-block: 5px;
  }
}

@media (max-width: 520px) {
  .four-panel {
    width: calc(100% + 36px);
    margin-inline: -18px;
    padding-inline: 0;
    border-inline: 0;
    border-radius: 0;
  }

  .four-board {
    border-radius: 0;
  }

  .four-column {
    padding-block: 2px;
  }
}

@media (max-height: 700px) {
  .four-page {
    padding-top: 2px;
  }

  .four-intro {
    margin-bottom: 5px;
  }

  .four-panel {
    gap: 5px;
    padding: 6px 0;
  }

  .four-column {
    padding-block: 1px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .four-column {
    transition: none;
  }
}
