.four-puzzle {
  background: #f6efe3;
}
.four-puzzle #content {
  max-width: 960px;
  padding-block: 22px 40px;
}
.challenge-intro {
  max-width: 680px;
  margin-bottom: 24px;
}
.challenge-name {
  margin: 0 0 10px;
  color: #902b24;
  font-weight: 750;
  letter-spacing: .035em;
}
.challenge-intro h1 {
  max-width: 19ch;
  margin: 0;
  font-size: clamp(2rem, 5.8vw, 3.55rem);
  line-height: 1.02;
  letter-spacing: -.04em;
}
.challenge-intro .longview-swoosh {
  width: 118px;
  margin: 11px 0 13px;
}
.challenge-prompt {
  max-width: 58ch;
  margin: 0;
  color: #3f3a34;
  font-size: clamp(1rem, 2.6vw, 1.16rem);
  line-height: 1.5;
}
.challenge-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(0, 1fr);
  gap: clamp(16px, 3.2vw, 28px);
  align-items: start;
}
.board-panel, .challenge-controls {
  min-width: 0;
  border-radius: 20px;
}
.board-panel {
  padding: clamp(8px, 2.5vw, 18px);
  background: #16191d;
  color: #f7f0e0;
  box-shadow: 0 10px 28px #31282126;
}
.challenge-board {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: clamp(3px, 1vw, 7px);
}
.challenge-board th, .challenge-board td { padding: 0; }
.challenge-board th:first-child, .challenge-board thead td { width: 0; }
.challenge-board thead th {
  text-align: center;
  padding-bottom: 5px;
  color: #e9dfce;
  font-weight: 700;
  font-size: .88rem;
}
.disc, .board-key i {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #35363a;
}
.disc.ivory, .board-key .ivory {
  background: #f7f0e0;
  color: #15171a;
}
.disc.black, .board-key .black {
  background: #101215;
  color: #f7f0e0;
  border: 1px solid #868075;
}
.disc.ivory::before, .disc.black::before {
  position: absolute;
  inset: 19% 5% 34%;
  content: "";
  border-radius: 0 0 56% 58%;
  border-bottom: clamp(2px, .52vw, 4px) solid #e90802;
  transform: rotate(-9deg);
}
.disc.ivory::after, .disc.black::after {
  position: absolute;
  left: 44%;
  bottom: 13%;
  width: 12%;
  aspect-ratio: 1;
  background: currentColor;
  content: "";
}
.disc.ivory::after { border-radius: 50%; }
.disc.black::after { transform: rotate(45deg); }
.disc.winning {
  outline: 2px solid #ffc077;
  outline-offset: 1px;
}
.disc.new-drop { animation: appear .23s ease-out; }
@keyframes appear {
  from { transform: translateY(-18%) scale(.82); opacity: .48; }
}
.board-key {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin: 8px 0 3px;
  font-size: .85rem;
}
.board-key span { display: inline-flex; align-items: center; gap: 7px; }
.board-key i { width: 12px; }
.challenge-controls {
  padding: clamp(16px, 3vw, 26px);
  background: #fffcf5;
  border: 1px solid #d7cdbb;
}
.challenge-controls fieldset { min-width: 0; padding: 0; margin: 0; border: 0; }
.challenge-controls legend, .challenge-controls h2 {
  margin: 0;
  padding: 0;
  font-weight: 780;
  font-size: clamp(1.2rem, 3vw, 1.55rem);
  letter-spacing: -.02em;
  line-height: 1.18;
}
#plan-hint, .plan-reply, #pair-detail, #result-detail {
  margin: 8px 0 13px;
  color: #4c453d;
  line-height: 1.42;
}
.plan-option {
  min-height: 50px;
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 11px;
  margin-bottom: 8px;
  background: #f6efe3;
  border: 1px solid #d7cdbb;
  border-radius: 10px;
  cursor: pointer;
}
.plan-option:hover { border-color: #8c6855; }
.plan-option:has(input:checked) {
  border-color: #902b24;
  background: #fff1e9;
  box-shadow: inset 0 0 0 1px #902b24;
}
.plan-option input { accent-color: #902b24; margin: 0; width: 17px; height: 17px; }
.plan-letter { font-size: .81rem; font-weight: 780; color: #625c55; }
.plan-order { font-weight: 750; font-size: 1.02rem; white-space: nowrap; }
.challenge-primary, .challenge-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 9px;
  font: inherit;
  line-height: 1.22;
  font-weight: 740;
  cursor: pointer;
}
.challenge-primary { color: #fff9ef; background: #8e2820; }
.challenge-primary:hover { background: #731e18; }
.challenge-primary:disabled { background: #ded5c9; color: #514941; cursor: default; }
.challenge-secondary { color: #231c16; background: #fffcf5; border-color: #aa9a85; }
.challenge-secondary:hover { background: #efe4d2; }
.challenge-primary:focus-visible, .challenge-secondary:focus-visible, .plan-option input:focus-visible {
  outline: 3px solid #902b24;
  outline-offset: 3px;
}
#plan-form button { width: 100%; margin-top: 5px; }
.challenge-buttons, .challenge-footer nav {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.challenge-share { margin: 22px 0 18px; }
.challenge-share h2 { font-size: 1.12rem; margin: 0 0 8px; }
.share-status { margin: 8px 0; }
#manual-link {
  width: min(100%, 420px);
  padding: 8px;
  background: #fffcf5;
  border: 1px solid #aa9a85;
  border-radius: 7px;
  color: #231c16;
  font: inherit;
}
.challenge-rules {
  padding: 13px 0;
  border-block: 1px solid #d7cdbb;
}
.challenge-rules summary { cursor: pointer; font-weight: 740; }
.challenge-rules p { max-width: 65ch; margin: 7px 0 0; }
.challenge-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 16px; }
.challenge-footer a { font-size: .9rem; text-underline-offset: .18em; }
.challenge-footer a[aria-current] { font-weight: 750; color: #902b24; }
.four-puzzle [hidden] { display: none; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
@media (max-width: 665px) {
  .challenge-layout { grid-template-columns: minmax(0, 1fr); }
  .four-puzzle #content { padding-top: 9px; }
  .challenge-intro { margin-bottom: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .four-puzzle { scroll-behavior: auto; }
  .disc.new-drop { animation: none; }
}
.challenge-footer .challenge-buttons a { text-decoration: none; }
.challenge-footer .challenge-primary:hover { color: #fff9ef; }

.puzzle-games { margin-top: 24px; }
.puzzle-games h2 { font-size: 1.25rem; margin: 0 0 12px; }
.game-downloads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.game-download { padding: 18px; border: 1px solid #d7cdbb; border-radius: 12px; background: #fffcf5; }
.game-download h3 { margin: 0 0 12px; font-size: 1.1rem; }
.game-download .challenge-primary { font-size: .9rem; text-decoration: none; }
.game-download .challenge-primary:hover { color: #fff9ef; }
@media (max-width: 665px) { .game-downloads { grid-template-columns: minmax(0, 1fr); } }
