:root {
  --page-bg: #e8ddc4;
  --felt-dark: #18442d;
  --felt-mid: #1f5a36;
  --felt-light: #2a7044;
  --panel-border: #d6c8a8;
  --text-main: #2c2418;
  --text-soft: #655845;
  --accent: #b8872f;
  --card-red: #b02828;
  --card-black: #1f1f22;
  --shadow-soft: 0 16px 40px rgba(24, 27, 20, 0.12);
  --shadow-card: 0 8px 18px rgba(16, 22, 17, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.55), transparent 24%),
    linear-gradient(180deg, #efe5cf 0%, var(--page-bg) 60%, #dccda9 100%);
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.page-shell {
  width: min(1480px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 18px 0 max(48px, env(safe-area-inset-bottom));
}

.hero {
  display: block;
  margin-bottom: 14px;
}

.hero-copy,
.hero-panel,
.intro-panel,
.content-panel,
.faq-panel,
.status-bar,
.mobile-play-panel {
  background: rgba(246, 239, 223, 0.9);
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}

.hero-copy {
  padding: 16px 18px;
}

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

.crumb-link {
  text-decoration: none;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
}

h1 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.15;
  margin-bottom: 10px;
}

.lead {
  max-width: 72ch;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-soft);
  margin: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.primary-button,
.secondary-button {
  border-radius: 999px;
  border: 0;
  padding: 13px 20px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.primary-button {
  background: linear-gradient(180deg, #d8ae53, #b8872f);
  color: #fff9ef;
  box-shadow: 0 8px 18px rgba(184, 135, 47, 0.28);
}

.secondary-button {
  background: #e7dcc2;
  color: var(--text-main);
  border: 1px solid #cfbf99;
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.secondary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

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

.status-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
  color: var(--text-soft);
}

.status-group strong {
  display: block;
  font-size: 1.12rem;
  line-height: 1.25;
  min-height: 1.4em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mobile-play-panel {
  padding: 12px 18px;
  margin-bottom: 12px;
}

.mobile-play-note {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.6;
}

.table-area {
  position: relative;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 28%),
    linear-gradient(180deg, var(--felt-light), var(--felt-mid) 28%, var(--felt-dark));
  border-radius: 28px;
  padding: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), var(--shadow-soft);
  border: 1px solid rgba(23, 52, 35, 0.4);
  overflow: hidden;
}

.game-board {
  min-height: 760px;
}

.board-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.deck-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
}

.deck-slot {
  position: relative;
  width: 104px;
  height: 144px;
  border-radius: 18px;
  border: 2px dashed rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.deck-slot.selected {
  border-color: rgba(255, 232, 173, 0.95);
  box-shadow: 0 0 0 4px rgba(255, 232, 173, 0.18);
}

.deck-slot:disabled {
  cursor: default;
  opacity: 0.8;
}

.deck-placeholder {
  text-align: center;
  color: rgba(255, 250, 239, 0.8);
  font-size: 0.88rem;
  line-height: 1.4;
  padding: 12px;
}

.deck-back {
  width: 88px;
  height: 128px;
  border-radius: 16px;
  background:
    radial-gradient(circle at center, rgba(238, 231, 209, 0.18), transparent 32%),
    linear-gradient(180deg, #43634b, #294631 62%, #1c3222);
  border: 2px solid rgba(247, 241, 226, 0.78);
  box-shadow: var(--shadow-card);
  display: grid;
  place-items: center;
}

.deck-back::before {
  content: "";
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.72);
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.8), transparent 32%),
    radial-gradient(circle at center, transparent 45%, rgba(255, 255, 255, 0.18) 46%, rgba(255, 255, 255, 0.18) 54%, transparent 55%);
}

.stack-badge,
.info-chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(250, 244, 231, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 250, 239, 0.92);
  font-size: 0.94rem;
}

.deck-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.sum-note {
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(12, 31, 21, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 250, 239, 0.92);
  max-width: 420px;
  line-height: 1.6;
}

.pyramid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 0 0;
}

.pyramid-row {
  display: flex;
  justify-content: center;
  min-height: 112px;
}

.pyramid-slot {
  position: relative;
  width: 96px;
  height: 132px;
}

.pyramid-slot + .pyramid-slot {
  margin-left: -22px;
}

.pyramid-slot.removed {
  opacity: 0;
  pointer-events: none;
}

.card {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(255, 251, 245, 0.98), rgba(245, 235, 217, 0.98));
  border: 2px solid rgba(78, 63, 41, 0.18);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  color: var(--card-black);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.card.red {
  color: var(--card-red);
}

.card.blocked {
  opacity: 0.72;
  filter: saturate(0.92);
}

.card.selected {
  transform: translateY(-5px);
  box-shadow: 0 0 0 4px rgba(255, 232, 173, 0.28), var(--shadow-card);
}

.card:hover {
  transform: translateY(-3px);
}

.corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 700;
  line-height: 1;
}

.corner-top {
  top: 8px;
  left: 8px;
}

.corner-bottom {
  right: 8px;
  bottom: 8px;
  transform: rotate(180deg);
}

.rank {
  font-size: 1.05rem;
}

.suit {
  font-size: 0.95rem;
  margin-top: 3px;
}

.card-center {
  font-size: 2.35rem;
  line-height: 1;
}

.win-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 22, 16, 0.42);
  backdrop-filter: blur(2px);
}

.win-overlay[hidden] {
  display: none;
}

.win-panel {
  width: min(420px, calc(100% - 32px));
  padding: 26px 28px;
  border-radius: 24px;
  background: rgba(250, 244, 231, 0.96);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.win-kicker {
  margin: 0 0 6px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 700;
}

.win-summary {
  color: var(--text-soft);
  line-height: 1.65;
  margin: 12px 0 20px;
}

.hero-panel,
.intro-panel,
.content-panel,
.faq-panel {
  padding: 22px 24px;
}

.hero-panel h2 {
  margin-bottom: 14px;
}

.hero-panel ul {
  margin: 0;
  padding-left: 22px;
  color: var(--text-soft);
  line-height: 1.7;
}

.intro-panel p,
.content-panel p,
.faq-panel p {
  margin: 10px 0 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.seo-content {
  margin-top: 12px;
}

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

.faq-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.faq-item {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 250, 241, 0.72);
  border: 1px solid rgba(214, 200, 168, 0.9);
}

@media (min-width: 961px) {
  .page-shell {
    width: min(1520px, calc(100vw - 56px));
  }

  .hero-copy {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 18px;
    align-items: center;
    padding: 14px 18px;
  }

  .hero-copy .eyebrow,
  .hero-copy .lead {
    grid-column: 1 / -1;
  }

  .hero-actions {
    margin-top: 0;
    justify-content: flex-end;
  }

  .status-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
    padding: 10px 14px;
  }

  .status-group {
    flex: 1 1 160px;
    min-width: 0;
  }

  .status-group strong {
    font-size: 1rem;
  }

  .table-area {
    padding: 12px 14px;
  }

  .game-board {
    min-height: min(620px, calc(100dvh - 180px));
  }

  .board-top {
    gap: 10px 14px;
    margin-bottom: 8px;
  }

  .deck-cluster {
    gap: 10px;
  }

  .deck-slot {
    width: 92px;
    height: 128px;
    border-radius: 16px;
  }

  .deck-back {
    width: 78px;
    height: 114px;
    border-radius: 14px;
  }

  .stack-badge,
  .info-chip {
    padding: 9px 12px;
    font-size: 0.9rem;
  }

  .sum-note {
    max-width: 360px;
    padding: 9px 12px;
    line-height: 1.5;
  }

  .pyramid {
    gap: 4px;
    padding-top: 0;
  }

  .pyramid-row {
    min-height: 70px;
  }

  .pyramid-slot {
    width: 70px;
    height: 98px;
  }

  .pyramid-slot + .pyramid-slot {
    margin-left: -15px;
  }

  .card {
    border-radius: 14px;
  }

  .card-center {
    font-size: 1.72rem;
  }

  .corner-top {
    top: 6px;
    left: 6px;
  }

  .corner-bottom {
    right: 6px;
    bottom: 6px;
  }

  .rank {
    font-size: 0.96rem;
  }

  .suit {
    font-size: 0.84rem;
    margin-top: 2px;
  }
}

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

@media (max-width: 720px) {
  .page-shell {
    width: min(100vw - 20px, 100%);
    padding: 12px 0 34px;
  }

  .hero-copy,
  .hero-panel,
  .intro-panel,
  .content-panel,
  .faq-panel,
  .status-bar,
  .mobile-play-panel {
    padding: 16px;
    border-radius: 18px;
  }

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

  .deck-slot {
    width: 92px;
    height: 132px;
  }

  .deck-back {
    width: 78px;
    height: 116px;
  }

  .pyramid-slot {
    width: 82px;
    height: 116px;
  }

  .pyramid-slot + .pyramid-slot {
    margin-left: -28px;
  }

  .card-center {
    font-size: 2rem;
  }
}

@media (max-width: 520px) {
  .hero-actions {
    gap: 8px;
  }

  .primary-button,
  .secondary-button {
    min-height: 44px;
    padding: 11px 16px;
    font-size: 0.95rem;
  }

  .table-area {
    padding: 12px;
  }

  .deck-cluster {
    width: 100%;
    justify-content: space-between;
  }

  .deck-meta {
    width: 100%;
  }

  .sum-note {
    max-width: none;
    width: 100%;
  }

  .pyramid {
    align-items: flex-start;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .pyramid-row {
    justify-content: flex-start;
    min-width: max-content;
  }

  .pyramid-slot {
    width: 74px;
    height: 104px;
  }

  .pyramid-slot + .pyramid-slot {
    margin-left: -32px;
  }

  .card-center {
    font-size: 1.72rem;
  }

  .corner-top {
    top: 6px;
    left: 6px;
  }

  .corner-bottom {
    right: 6px;
    bottom: 6px;
  }

  .rank {
    font-size: 0.92rem;
  }

  .suit {
    font-size: 0.82rem;
  }
}
