:root {
  --page: #f3f0e8;
  --panel: #fffdf6;
  --panel-border: #d9cda9;
  --text-main: #2d261c;
  --text-soft: #675d4d;
  --accent: #23543a;
  --accent-warm: #c89037;
  --board: #8f5f3a;
  --board-dark: #5f3b22;
  --black: #2d261c;
  --white: #f8ecd8;
  --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,
.game-layout,
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.85fr);
  gap: 24px;
  align-items: stretch;
}

.hero {
  margin-bottom: 24px;
}

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

.hero-copy {
  padding: 34px;
  border-radius: 24px;
}

.hero-panel,
.round-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,
.dice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.button,
.game-button,
.bear-off-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,
.bear-off-button:focus-visible,
.point:focus-visible {
  outline: 3px solid rgba(200, 144, 55, 0.28);
  outline-offset: 2px;
}

.game-button:disabled,
.bear-off-button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.game-shell {
  margin-bottom: 24px;
  padding: 22px;
  border-radius: 24px;
}

.status-bar {
  display: grid;
  grid-template-columns: repeat(3, 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;
}

.board-wrap {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 560px;
  padding: 18px;
  border: 1px solid rgba(35, 84, 58, 0.16);
  border-radius: 20px;
  background: #fbf6eb;
}

.game-status {
  width: min(100%, 720px);
  min-height: 32px;
  margin: 0 0 14px;
  color: var(--text-soft);
  font-weight: 700;
  text-align: center;
}

.board {
  display: grid;
  grid-template-columns: repeat(12, minmax(28px, 1fr));
  grid-template-rows: minmax(190px, 1fr) 42px minmax(190px, 1fr);
  gap: 0;
  width: min(100%, 760px);
  overflow: hidden;
  border: 8px solid var(--board-dark);
  border-radius: 16px;
  background: var(--board);
  box-shadow: inset 0 0 0 4px rgba(255, 253, 246, 0.18);
}

.point {
  position: relative;
  display: flex;
  gap: 3px;
  align-items: center;
  min-width: 0;
  min-height: 0;
  padding: 24px 4px 8px;
  border: 0;
  border-left: 1px solid rgba(255, 253, 246, 0.15);
  background: linear-gradient(180deg, #c89037 0 68%, transparent 69%);
  clip-path: polygon(0 0, 100% 0, 50% 82%);
  cursor: pointer;
}

.point:nth-child(even) {
  background: linear-gradient(180deg, #f1d7a1 0 68%, transparent 69%);
}

.point.bottom {
  grid-row: 3;
  flex-direction: column-reverse;
  padding: 8px 4px 24px;
  background: linear-gradient(0deg, #c89037 0 68%, transparent 69%);
  clip-path: polygon(50% 18%, 100% 100%, 0 100%);
}

.point.bottom:nth-child(even) {
  background: linear-gradient(0deg, #f1d7a1 0 68%, transparent 69%);
}

.point.top {
  flex-direction: column;
}

.point.selected {
  filter: brightness(1.12);
}

.point.target {
  outline: 4px solid rgba(35, 84, 58, 0.55);
  outline-offset: -6px;
}

.point-number {
  position: absolute;
  left: 50%;
  color: rgba(45, 38, 28, 0.74);
  font-size: 0.72rem;
  font-weight: 700;
  transform: translateX(-50%);
}

.point.top .point-number {
  top: 4px;
}

.point.bottom .point-number {
  bottom: 4px;
}

.checker {
  display: block;
  width: min(34px, 76%);
  aspect-ratio: 1;
  border-radius: 999px;
  box-shadow: 0 2px 5px rgba(47, 40, 28, 0.26), inset 0 2px 4px rgba(255, 255, 255, 0.35);
}

.checker.black {
  background: radial-gradient(circle at 32% 24%, #5f5546 0 18%, var(--black) 19% 72%, #15120e 73%);
}

.checker.white {
  background: radial-gradient(circle at 32% 24%, #fff8ec 0 18%, var(--white) 19% 72%, #d8c29b 73%);
}

.stack-count {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 253, 246, 0.9);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 700;
}

.board-rail {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: var(--board-dark);
  color: #fffaf0;
  font-size: 0.9rem;
  font-weight: 700;
}

.bear-off-button {
  min-height: 32px;
  padding: 5px 14px;
  border-color: rgba(255, 250, 240, 0.42);
  background: rgba(255, 250, 240, 0.12);
  color: #fffaf0;
}

.bear-off-button.target {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 250, 240, 0.32);
}

.round-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 320px;
  box-shadow: none;
}

#round-message {
  color: var(--text-soft);
}

.dice-row {
  min-height: 44px;
  margin: 8px 0 18px;
}

.die,
.dice-empty {
  display: grid;
  place-items: center;
  min-width: 42px;
  min-height: 42px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #fffaf0;
  font-weight: 700;
}

.die.used {
  opacity: 0.38;
}

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

.panel,
.faq-panel,
.related-panel {
  padding: 24px;
  border-radius: 18px;
}

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

details {
  padding: 14px 16px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: rgba(255, 253, 246, 0.72);
}

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

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

.related-panel {
  margin-top: 24px;
}

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

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

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

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

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

  .hero-copy,
  .hero-panel,
  .game-shell,
  .panel,
  .faq-panel,
  .related-panel,
  .round-panel {
    border-radius: 14px;
  }

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

  .status-bar {
    grid-template-columns: 1fr;
  }

  .board-wrap {
    min-height: 0;
    padding: 10px;
  }

  .board {
    grid-template-columns: repeat(12, minmax(20px, 1fr));
    grid-template-rows: 142px 38px 142px;
    border-width: 5px;
  }

  .point {
    padding-left: 2px;
    padding-right: 2px;
  }

  .checker {
    width: min(24px, 82%);
  }

  .point-number {
    font-size: 0.62rem;
  }
}
