:root {
  --page: #f3f0e8;
  --panel: #fffdf6;
  --panel-border: #d9cda9;
  --text-main: #2d261c;
  --text-soft: #675d4d;
  --accent: #23543a;
  --accent-warm: #c89037;
  --shadow-soft: 0 18px 44px rgba(47, 40, 28, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(120deg, rgba(35, 84, 58, 0.1), transparent 34%),
    radial-gradient(circle at 82% 14%, rgba(200, 144, 55, 0.14), transparent 28%),
    var(--page);
  color: var(--text-main);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.65;
}

a {
  color: var(--accent);
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.breadcrumb {
  margin: 0 0 18px;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.breadcrumb a {
  text-decoration: none;
  border-bottom: 1px solid rgba(102, 88, 69, 0.28);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.85fr);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-copy,
.hero-panel,
.game-shell,
.panel,
.faq-panel,
.related-panel {
  border: 1px solid var(--panel-border);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.hero-copy {
  position: relative;
  overflow: hidden;
  padding: 34px;
  border-radius: 24px;
}

.hero-copy::after {
  content: "";
  position: absolute;
  right: 30px;
  bottom: 26px;
  width: 144px;
  height: 72px;
  background:
    radial-gradient(circle at 12% 50%, #d85a56 0 12px, transparent 13px),
    radial-gradient(circle at 34% 50%, #4f83bf 0 12px, transparent 13px),
    radial-gradient(circle at 56% 50%, #e3af3f 0 12px, transparent 13px),
    radial-gradient(circle at 78% 50%, #4f9b72 0 12px, transparent 13px);
  opacity: 0.22;
  pointer-events: none;
}

.hero-panel {
  padding: 28px;
  border-radius: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  line-height: 1.15;
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  letter-spacing: 0;
}

h2 {
  margin: 0 0 12px;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

p,
ul,
ol {
  margin-top: 0;
}

.lead {
  max-width: 760px;
  color: var(--text-soft);
  font-size: 1.13rem;
}

.hero-actions,
.game-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.button,
.game-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #fffdf6;
  color: var(--text-main);
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}

.button.primary,
.game-button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fffaf0;
}

.button:hover,
.button:focus-visible,
.game-button:hover,
.game-button:focus-visible,
.slot-button:focus-visible,
.color-button:focus-visible {
  outline: 3px solid rgba(200, 144, 55, 0.28);
  outline-offset: 2px;
}

.game-shell {
  position: relative;
  margin-bottom: 24px;
  padding: 22px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 253, 246, 0.96), rgba(248, 244, 234, 0.96)),
    var(--panel);
}

.status-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.status-item {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: rgba(246, 240, 228, 0.7);
  text-align: center;
}

.status-label {
  display: block;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.status-item strong {
  display: block;
  min-height: 28px;
  font-size: 1.25rem;
}

.code-board {
  display: grid;
  gap: 14px;
  max-width: 660px;
  margin: 0 auto 16px;
  padding: 18px;
  border: 1px solid rgba(35, 84, 58, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(35, 84, 58, 0.07) 1px, transparent 1px),
    linear-gradient(180deg, rgba(35, 84, 58, 0.07) 1px, transparent 1px),
    #fbf6eb;
  background-size: 28px 28px;
}

.secret-row,
.current-guess,
.guess-row,
.guess-pegs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.secret-row {
  padding: 10px 0 12px;
  border-bottom: 1px solid rgba(35, 84, 58, 0.13);
}

.secret-dot,
.peg,
.feedback-dot,
.slot-button,
.color-button {
  border-radius: 50%;
}

.secret-dot {
  width: 30px;
  height: 30px;
  border: 2px solid rgba(45, 38, 28, 0.18);
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.72), transparent 18%),
    #d6ccb1;
}

.guess-history {
  display: grid;
  gap: 8px;
  min-height: 260px;
}

.guess-row {
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(35, 84, 58, 0.11);
  border-radius: 10px;
  background: rgba(255, 253, 246, 0.78);
}

.guess-pegs {
  justify-content: flex-start;
}

.peg,
.slot-button,
.color-button {
  width: 34px;
  height: 34px;
  border: 2px solid rgba(45, 38, 28, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.48);
}

.slot-button,
.color-button {
  cursor: pointer;
}

.slot-button {
  background: #eee5d3;
}

.slot-button.is-active {
  border-color: var(--accent-warm);
  box-shadow: 0 0 0 4px rgba(200, 144, 55, 0.18);
}

.feedback {
  display: grid;
  grid-template-columns: repeat(4, 13px);
  gap: 5px;
}

.feedback-dot {
  width: 13px;
  height: 13px;
  border: 1px solid rgba(45, 38, 28, 0.2);
  background: #e8deca;
}

.feedback-dot.exact {
  background: #23543a;
}

.feedback-dot.color {
  background: #c89037;
}

.color-palette {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}

.color-button {
  width: 42px;
  height: 42px;
}

.game-toolbar {
  justify-content: center;
}

.game-note {
  margin: 12px auto 0;
  max-width: 680px;
  color: var(--text-soft);
  text-align: center;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.panel,
.faq-panel,
.related-panel {
  padding: 24px;
  border-radius: 18px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.panel li,
.hero-panel li {
  margin-bottom: 6px;
}

.faq-list {
  display: grid;
  gap: 8px;
}

details {
  padding: 14px 0;
  border-bottom: 1px solid var(--panel-border);
}

details:last-child {
  border-bottom: 0;
}

summary {
  cursor: pointer;
  font-weight: 700;
}

summary + p {
  margin: 10px 0 0;
  color: var(--text-soft);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.related-card {
  display: grid;
  gap: 6px;
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: rgba(246, 240, 228, 0.66);
  color: inherit;
  text-decoration: none;
}

.related-card span {
  color: var(--text-soft);
  font-size: 0.94rem;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  border-radius: inherit;
  background: rgba(45, 38, 28, 0.55);
}

.overlay[hidden] {
  display: none;
}

.overlay-panel {
  width: min(420px, 100%);
  padding: 30px;
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  background: var(--panel);
  text-align: center;
  box-shadow: 0 24px 60px rgba(30, 28, 22, 0.28);
}

@media (max-width: 880px) {
  .hero,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .page-shell {
    width: min(100% - 22px, 1120px);
    padding-top: 18px;
  }

  .hero-copy,
  .hero-panel,
  .game-shell,
  .panel,
  .faq-panel,
  .related-panel {
    border-radius: 16px;
    padding: 18px;
  }

  .status-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .code-board {
    padding: 12px;
  }

  .guess-row {
    gap: 8px;
    padding: 8px;
  }

  .peg,
  .slot-button {
    width: 29px;
    height: 29px;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }
}
