:root {
  color-scheme: light;
  --paper: #f7f5ef;
  --ink: #1d2430;
  --muted: #687080;
  --line: #d9d4c8;
  --table: #167a63;
  --table-dark: #0f574a;
  --gold: #d49b35;
  --red: #bf2f39;
  --blue: #1d5c9c;
  --white: #fffdf8;
  --shadow: 0 16px 40px rgba(24, 32, 41, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  color: var(--ink);
  font-family:
    "Noto Sans TC",
    "Microsoft JhengHei",
    system-ui,
    sans-serif;
  font-weight: 800;
  background: linear-gradient(135deg, #f7f5ef 0%, #e8f1ed 48%, #f3ece1 100%);
}

button,
input,
select {
  font: inherit;
}

.game-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 8px;
  width: min(1680px, 100%);
  height: 100vh;
  margin: 0 auto;
  padding: 8px;
}

.top-panel {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(420px, 480px);
  gap: 14px;
  align-items: end;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.84);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--table-dark);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p,
h3,
h4,
h5,
h6,
strong,
b {
  margin-top: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
strong,
b {
  font-weight: 800;
}

h1 {
  margin-bottom: 4px;
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  line-height: 1.15;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.summary {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.setup-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.player-name-panel {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

select,
.player-name-input,
.primary-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

select,
.player-name-input {
  width: 100%;
  padding: 0 12px;
  color: var(--ink);
  background: var(--white);
}

.primary-button {
  grid-column: 1 / -1;
  padding: 0 18px;
  border-color: var(--table-dark);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  background: var(--table-dark);
}

.primary-button:hover {
  background: var(--table);
}

.ad-slot {
  display: grid;
  place-items: center;
  min-height: 52px;
  border: 1px dashed #b9afa0;
  border-radius: 8px;
  color: #756c61;
  text-align: center;
  background: rgba(255, 253, 248, 0.68);
}

.ad-slot span {
  display: block;
  font-size: 0.8rem;
}

.ad-slot strong {
  font-size: 0.95rem;
}

.ad-slot-top {
  display: none;
  margin: 0;
}

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

.status-bar > div,
.score-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.9);
}

.status-bar > div {
  padding: 8px 12px;
}

.status-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.status-bar strong {
  font-size: 1.05rem;
}

.play-area {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 240px;
  gap: 10px;
  align-items: stretch;
  min-height: 0;
}

.score-panel {
  min-height: 0;
  padding: 12px;
  overflow: auto;
}

.scoreboard {
  display: grid;
  gap: 10px;
}

.player-score {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.player-score.is-active {
  border-color: var(--gold);
  box-shadow: inset 4px 0 0 var(--gold);
}

.board-wrap {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  padding-bottom: 0;
}

.message {
  min-height: 34px;
  margin-bottom: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  background: var(--table-dark);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  padding: 8px;
  border: 8px solid #7c5130;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    var(--table);
  background-size: 24px 24px;
  box-shadow: var(--shadow);
}

.card-grid.is-empty {
  display: none;
}

.card {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 2.5 / 3.5;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  perspective: 900px;
  background: transparent;
}

.card:disabled {
  cursor: default;
}

.card-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 220ms ease;
}

.card.is-flipped .card-inner,
.card.is-matched .card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  backface-visibility: hidden;
  box-shadow: 0 4px 12px rgba(10, 18, 24, 0.16);
}

.card-back {
  border: 2px solid #f7f0df;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.34), transparent 22%),
    repeating-linear-gradient(45deg, #214c86 0 8px, #173966 8px 16px);
}

.card-front {
  overflow: hidden;
  padding: 3px;
  border: 1px solid #d9d4c8;
  transform: rotateY(180deg);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(248, 244, 236, 0.92)),
    var(--white);
}

.corner {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: clamp(14px, 28%, 24px);
  line-height: 0.72;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
  pointer-events: none;
}

.corner b {
  font-size: clamp(0.54rem, 0.95vw, 0.86rem);
}

.corner span {
  font-size: clamp(0.5rem, 0.9vw, 0.8rem);
}

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

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

.pip-layout {
  position: absolute;
  inset: 28% 31% 32%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(5, 1fr);
  place-items: center;
  width: 38%;
  height: 34%;
  pointer-events: none;
}

.pip {
  display: grid;
  place-items: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.56rem, 0.82vw, 0.82rem);
  font-weight: 800;
  line-height: 0.85;
}

.top-left {
  grid-area: 1 / 1;
}

.top-center {
  grid-area: 1 / 2;
}

.top-right {
  grid-area: 1 / 3;
}

.upper-left {
  grid-area: 2 / 1;
}

.upper-center {
  grid-area: 2 / 2;
}

.upper-right {
  grid-area: 2 / 3;
}

.middle-left {
  grid-area: 3 / 1;
}

.center {
  grid-area: 3 / 2;
}

.middle-right {
  grid-area: 3 / 3;
}

.lower-left {
  grid-area: 4 / 1;
  transform: rotate(180deg);
}

.lower-center {
  grid-area: 4 / 2;
  transform: rotate(180deg);
}

.lower-right {
  grid-area: 4 / 3;
  transform: rotate(180deg);
}

.bottom-left {
  grid-area: 5 / 1;
  transform: rotate(180deg);
}

.bottom-center {
  grid-area: 5 / 2;
  transform: rotate(180deg);
}

.bottom-right {
  grid-area: 5 / 3;
  transform: rotate(180deg);
}

.court-card {
  position: absolute;
  inset: 16% 8%;
  display: block;
  overflow: hidden;
  border-radius: 3px;
  pointer-events: none;
}

.court-portrait {
  display: block;
  width: 100%;
  height: 100%;
}

.red-card {
  color: #c1121f;
}

.black-card {
  color: #11151c;
}

.card.is-matched {
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease 180ms;
}

.game-picker-shell {
  width: min(1080px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(32px, 8vw, 88px) 0;
}

.picker-back-link,
.poker-picker-link {
  display: inline-flex;
  margin-bottom: 30px;
  color: var(--table-dark);
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  font-weight: 800;
  text-decoration: none;
}

.picker-back-link:hover,
.picker-back-link:focus-visible,
.poker-picker-link:hover,
.poker-picker-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.poker-picker-link {
  font-size: 26px;
  line-height: 1;
}

.picker-hero { max-width: none; }

.picker-hero h1 {
  margin: 0;
  font-size: clamp(2.6rem, 7vw, 5.6rem);
  line-height: 0.94;
  letter-spacing: -0.065em;
}

@media (min-width: 761px) {
  .picker-title {
    font-size: clamp(3.35rem, 7.2vw, 6.4rem);
    white-space: nowrap;
  }
}

body:has(.game-shell) [data-game-stage-toggle] { display: none; }

@media (max-width: 760px) {
  .picker-title { white-space: normal; }
}

.picker-hero > p:last-child {
  max-width: 430px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.7;
}

.game-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 42px;
}

.game-choice {
  display: flex;
  min-height: 350px;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(26px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 22px;
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.game-choice:hover,
.game-choice:focus-visible {
  transform: translateY(-5px);
  box-shadow: 0 18px 36px rgba(24, 32, 41, 0.18);
}

.poker-choice { background: linear-gradient(145deg, #f7f3e6, #d9e7df); }
.carrot-choice { background: linear-gradient(145deg, #fff1df, #dcebc8); }
.trivia-choice { background: linear-gradient(145deg, #e8f3f4, #dce6f6); }
.number-maze-choice { background: linear-gradient(145deg, #f9efd5, #d9e9e5); }

.game-choice-icon {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border-radius: 20px;
  font-size: 2.6rem;
  background: rgba(255, 253, 248, 0.82);
  box-shadow: 0 8px 20px rgba(24, 32, 41, 0.1);
}

.game-choice-type {
  margin-top: 34px;
  color: var(--table-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.game-choice h2 {
  margin: 10px 0 0;
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.game-choice p {
  max-width: 310px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.game-choice-action {
  margin-top: auto;
  padding-top: 26px;
  font-weight: 800;
}

@media (max-width: 760px) {
  body:has(.game-picker-shell) { display: grid; height: 100svh; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
  body:has(.game-picker-shell) .global-page-nav { margin: .45rem auto 0; }
  .game-picker-shell { min-height: 0; height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: .65rem; padding: .7rem 0 .4rem; }
  .picker-hero { align-self: center; }
  .picker-hero h1, .picker-title { font-size: clamp(1.75rem, 9vw, 2.3rem); }
  .picker-hero > p:last-child { margin-top: .4rem; font-size: .75rem; line-height: 1.35; }
  .game-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
  .game-choice { min-height: 0; padding: .65rem .45rem; border-radius: 16px; }
  .game-choice-icon { width: 42px; height: 42px; border-radius: 12px; font-size: 1.45rem; }
  .game-choice-type { margin-top: .55rem; font-size: .52rem; letter-spacing: .06em; }
  .game-choice h2 { margin-top: .35rem; font-size: .96rem; line-height: 1.05; letter-spacing: -.03em; }
  .game-choice p { display: none; }
  .game-choice-action { padding-top: .65rem; font-size: .68rem; }
}

.game-over {
  background: #2d5b8a;
}

.leaderboard-panel {
  min-height: 0;
  margin-top: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.9);
  overflow: auto;
}

.leaderboard-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.leaderboard-heading h2 {
  margin-bottom: 0;
}

.leaderboard {
  display: grid;
  gap: 8px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.leaderboard-row > span:not(.leaderboard-rank) {
  display: grid;
  gap: 2px;
}

.leaderboard-row > span:nth-child(n + 3) {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.82rem;
}

.leaderboard-rank {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
  background: var(--table-dark);
}

.leaderboard-name {
  font-weight: 800;
}

.leaderboard-meta,
.leaderboard-empty {
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 0;
  padding: 2px 4px 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.site-footer nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.site-footer a,
.back-link {
  color: var(--table-dark);
  font-weight: 800;
  text-decoration: none;
}

.site-footer a:hover,
.back-link:hover {
  text-decoration: underline;
}

.jaze96-signature {
  display: grid;
  width: min(92%, 1100px);
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 1rem;
  row-gap: .18rem;
  margin: 0 auto clamp(.5rem, 1.5vh, .9rem);
  padding: .55rem .8rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: clamp(.62rem, 1vw, .78rem);
  line-height: 1.3;
  font-weight: 800;
}
.jaze96-signature p { margin: 0; }
.jaze96-signature p:first-child { color: var(--table-dark); font-weight: 800; }
.jaze96-signature p:nth-child(2) { color: var(--ink); font-weight: 800; }
.jaze96-signature p:nth-child(3) { grid-column: 2; text-align: right; }
.jaze96-signature p:nth-child(4) { grid-column: 1 / -1; padding-top: .28rem; border-top: 1px solid var(--line); }
.site-footer.jaze96-signature { width: 100%; margin: 0; padding: .35rem .15rem 0; border-top: 0; }
.site-footer.jaze96-signature nav { grid-column: 1 / -1; gap: .45rem .8rem; font-size: .68rem; }

.content-page {
  width: min(820px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.content-page h1 {
  margin: 18px 0 20px;
  font-size: clamp(2rem, 4vw, 3rem);
}

.content-page h2 {
  margin: 28px 0 8px;
  color: var(--table-dark);
}

.content-page p {
  color: #344052;
  font-size: 1rem;
  line-height: 1.9;
}

.carrot-page {
  overflow: auto;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.92), rgba(231, 242, 229, 0.84)),
    radial-gradient(circle at 18% 20%, rgba(242, 200, 75, 0.32), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(216, 59, 53, 0.2), transparent 24%),
    #f5f1e7;
}

.carrot-shell {
  display: grid;
  gap: 12px;
  width: min(1500px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 12px;
}

.carrot-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: var(--shadow);
}

.secondary-link,
.secondary-button {
  display: inline-grid;
  place-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #b9afa0;
  border-radius: 8px;
  color: var(--table-dark);
  font-weight: 800;
  text-decoration: none;
  background: var(--white);
}

.secondary-button {
  cursor: pointer;
}

.secondary-link:hover,
.secondary-button:hover:not(:disabled) {
  border-color: var(--table-dark);
  background: #eef6ef;
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.carrot-layout {
  display: grid;
  grid-template-columns: 280px minmax(460px, 1fr) 300px;
  gap: 12px;
  align-items: stretch;
  min-height: 0;
}

.carrot-setup,
.carrot-control-panel,
.carrot-board-zone {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 10px 28px rgba(24, 32, 41, 0.1);
}

.carrot-setup {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
}

.carrot-setup .player-name-panel {
  grid-template-columns: 1fr;
}

.carrot-rules {
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.carrot-rules ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: #44505f;
  font-size: 0.92rem;
  line-height: 1.55;
}

.carrot-board-zone {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  min-width: 0;
}

.carrot-message {
  margin-bottom: 0;
  background: #567726;
}

.carrot-board-frame {
  display: grid;
  place-items: center;
  min-height: 520px;
  padding: 24px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    #86a958;
  background-size: 34px 34px;
}

.carrot-board-frame-3d {
  position: relative;
  display: block;
  min-height: 620px;
  overflow: hidden;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(255, 232, 195, 0.28), transparent 34%),
    radial-gradient(circle at 50% 58%, rgba(72, 38, 18, 0.2), transparent 46%),
    #8b5a35;
}

.carrot-canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 620px;
  cursor: pointer;
  touch-action: manipulation;
}

.carrot-board-fallback {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.carrot-board-fallback .carrot-access-button {
  width: 1px;
  height: 1px;
}

.carrot-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(78px, 1fr));
  gap: clamp(12px, 2.2vw, 22px);
  width: min(560px, 100%);
  aspect-ratio: 1;
  padding: clamp(22px, 4vw, 44px);
  border: 14px solid #8d5d35;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 247, 219, 0.42), transparent 30%),
    radial-gradient(circle at 67% 70%, rgba(88, 47, 22, 0.16), transparent 34%),
    #c58c55;
  box-shadow:
    inset 0 0 0 10px rgba(92, 51, 26, 0.16),
    0 18px 36px rgba(47, 31, 22, 0.28);
}

.carrot-hole {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background:
    radial-gradient(circle at 48% 54%, #382013 0 42%, #5e351f 44% 56%, #9b6439 58% 100%);
  box-shadow:
    inset 0 7px 14px rgba(0, 0, 0, 0.32),
    0 5px 0 rgba(92, 51, 26, 0.42);
}

.carrot-hole:disabled {
  cursor: default;
}

.carrot-hole:not(:disabled):hover .carrot-root {
  transform: translateY(-8%) rotate(-4deg);
}

.carrot-shadow {
  position: absolute;
  inset: 24% 19% 15%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.22);
  filter: blur(2px);
}

.carrot-root {
  position: relative;
  z-index: 2;
  width: 44%;
  height: 58%;
  border-radius: 48% 48% 54% 54% / 36% 36% 72% 72%;
  transform-origin: center bottom;
  transition: transform 180ms ease;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.24), transparent 34%),
    repeating-linear-gradient(0deg, transparent 0 9px, rgba(119, 58, 18, 0.2) 10px 12px),
    var(--carrot-color, #ee7d2b);
  box-shadow: inset -7px -8px 0 rgba(91, 41, 16, 0.18);
  clip-path: polygon(18% 0, 82% 0, 68% 84%, 50% 100%, 32% 84%);
}

.carrot-leaf {
  position: absolute;
  left: 50%;
  bottom: 89%;
  width: 78%;
  height: 42%;
  transform: translateX(-50%);
}

.carrot-leaf::before,
.carrot-leaf::after,
.carrot-leaf {
  border-radius: 999px 999px 220px 220px;
  background: #2f8f46;
}

.carrot-leaf::before,
.carrot-leaf::after {
  position: absolute;
  content: "";
  bottom: 5%;
  width: 65%;
  height: 90%;
}

.carrot-leaf::before {
  left: -38%;
  transform: rotate(-32deg);
}

.carrot-leaf::after {
  right: -38%;
  transform: rotate(32deg);
}

.carrot-reveal {
  position: absolute;
  z-index: 3;
  display: none;
  min-width: 52px;
  padding: 4px 8px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  background: var(--reveal-color);
  box-shadow: 0 8px 16px rgba(22, 18, 14, 0.22);
}

.carrot-hole.is-revealed .carrot-root,
.carrot-hole.is-staged .carrot-root,
.carrot-hole.is-collected .carrot-root {
  opacity: 0;
  transform: translateY(-42%) scale(0.82);
}

.carrot-hole.is-revealed .carrot-reveal,
.carrot-hole.is-staged .carrot-reveal {
  display: inline-grid;
  place-items: center;
}

.carrot-hole.is-collected {
  background:
    radial-gradient(circle at 48% 54%, #2a170e 0 38%, #432617 42% 56%, #875936 58% 100%);
  opacity: 0.72;
}

.carrot-hole.is-collected .carrot-reveal {
  display: none;
}

.carrot-control-panel {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
}

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

.carrot-status-card {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.target-color {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 28px;
}

.color-dot {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(29, 36, 48, 0.14);
  border-radius: 50%;
  background: var(--dot-color);
}

.color-dot.is-empty {
  background:
    linear-gradient(45deg, transparent 44%, #b9afa0 45% 55%, transparent 56%),
    #efe9dd;
}

.carrot-actions {
  display: grid;
  gap: 8px;
}

.carrot-actions .primary-button {
  grid-column: auto;
}

.carrot-die {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin: 4px auto;
  border: 4px solid #7d5f44;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(245, 232, 211, 0.9)),
    #f5e8d3;
  box-shadow: 0 12px 24px rgba(47, 31, 22, 0.2);
}

.carrot-die span {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(29, 36, 48, 0.14);
  border-radius: 50%;
  background: var(--die-color, #d9d4c8);
}

.carrot-die.is-rolling {
  animation: carrot-die-pop 420ms ease;
}

.carrot-score-panel {
  padding: 12px;
}

@keyframes carrot-die-pop {
  0% {
    transform: rotate(-10deg) scale(0.92);
  }

  55% {
    transform: rotate(12deg) scale(1.08);
  }

  100% {
    transform: rotate(0deg) scale(1);
  }
}

@media (min-width: 1500px) {
  .game-shell {
    width: min(1840px, 100%);
  }

  .play-area {
    grid-template-columns: 190px minmax(0, 1fr) 230px;
  }

  .card-grid {
    grid-template-rows: repeat(4, minmax(0, 1fr));
  }

  .card {
    justify-self: center;
    width: auto;
    height: 100%;
  }

  .corner {
    width: clamp(18px, 24%, 26px);
    line-height: 0.74;
  }

  .corner b {
    font-size: clamp(0.78rem, 0.9vw, 1rem);
  }

  .corner span {
    font-size: clamp(0.72rem, 0.82vw, 0.92rem);
  }

  .pip-layout {
    inset: 25% 26% 28%;
    width: 48%;
    height: 47%;
  }

  .pip {
    font-size: clamp(0.8rem, 0.88vw, 1rem);
    line-height: 0.8;
  }
}

@media (max-width: 1100px) {
  body {
    overflow: auto;
  }

  .game-shell {
    display: block;
    height: auto;
    min-height: 100vh;
    padding: 12px;
  }

  .top-panel,
  .play-area {
    grid-template-columns: 1fr;
  }

  .top-panel {
    grid-template-columns: 1fr;
  }

  .setup-panel {
    grid-template-columns: 1fr 1fr;
  }

  .primary-button {
    grid-column: 1 / -1;
  }

  .ad-slot-side {
    min-height: 76px;
  }

  .ad-slot-top {
    display: grid;
    margin: 12px 0;
  }

  .board-wrap {
    overflow-x: hidden;
  }

  .card-grid {
    height: auto;
  }

  .leaderboard-panel {
    margin-top: 12px;
    overflow: visible;
  }

  .site-footer {
    margin-top: 18px;
    padding: 18px 4px 4px;
    font-size: 0.9rem;
  }

  .carrot-hero,
  .carrot-layout {
    grid-template-columns: 1fr;
  }

  .carrot-hero {
    display: grid;
    align-items: start;
  }

  .carrot-board-frame {
    min-height: auto;
  }

  .carrot-board-frame-3d,
  .carrot-canvas {
    min-height: 560px;
  }

  .carrot-board {
    width: min(620px, 100%);
  }
}

@media (max-width: 760px) {
  .game-shell {
    padding: 12px;
  }

  .top-panel {
    padding: 16px;
  }

  .eyebrow {
    margin-bottom: 8px;
    font-size: 30px;
    line-height: 1;
  }

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

  .player-name-panel {
    grid-template-columns: 1fr;
  }

  .card-grid {
    grid-template-columns: repeat(4, minmax(76px, 1fr));
    gap: 8px;
    min-width: 0;
    padding: 10px;
    border-width: 6px;
  }

  .corner {
    width: 32px;
    line-height: 0.84;
  }

  .corner b {
    font-size: clamp(1rem, 4.5vw, 1.28rem);
  }

  .corner span {
    font-size: clamp(0.96rem, 4.2vw, 1.2rem);
  }

  .pip-layout {
    inset: 38px 16px 37px;
    width: calc(100% - 32px);
    height: calc(100% - 75px);
  }

  .pip {
    font-size: clamp(1.18rem, 5.2vw, 1.5rem);
  }

  .court-card {
    inset: 19px 7px;
  }

  .leaderboard-row {
    align-items: flex-start;
  }

  .leaderboard-row {
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .carrot-shell {
    padding: 10px;
  }

  .carrot-hero,
  .carrot-setup,
  .carrot-control-panel,
  .carrot-board-zone {
    padding: 12px;
  }

  .carrot-hero h1 {
    font-size: clamp(2.1rem, 12vw, 3.2rem);
  }

  .carrot-board-frame {
    padding: 12px;
  }

  .carrot-board-frame-3d {
    padding: 0;
  }

  .carrot-board-frame-3d,
  .carrot-canvas {
    min-height: 430px;
  }

  .carrot-board {
    grid-template-columns: repeat(4, minmax(52px, 1fr));
    gap: 10px;
    padding: 18px;
    border-width: 9px;
  }

  .carrot-reveal {
    min-width: 42px;
    padding: 3px 6px;
    font-size: 0.74rem;
  }

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

  .secondary-link,
  .secondary-button,
  .carrot-actions .primary-button {
    width: 100%;
  }
}

.card-grid.is-preview {
  min-width: 720px;
}

.card-grid.is-preview .card {
  cursor: default;
}

@media (max-width: 760px) {
  .board-wrap {
    overflow-x: auto;
  }
}
 .global-page-nav { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; margin: 1.25rem auto 0; width: min(92%, 1100px); }
.global-page-nav a, .global-page-nav button { border: 0; border-radius: 999px; background: #f2ead9; color: #183c35; cursor: pointer; font: inherit; font-weight: 800; padding: .55rem .85rem; text-decoration: none; }
.global-page-nav button { background: #0f574a; color: #fff; }
.global-page-nav label { display: grid; gap: .25rem; color: var(--muted); font-size: .76rem; font-weight: 800; }
.language-choice-label { color: var(--muted); font-size: .76rem; font-weight: 800; }

@media (min-width: 761px) {
  body:has(.game-picker-shell) { display: grid; height: 100svh; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
  body:has(.game-picker-shell) .global-page-nav { margin: clamp(.65rem, 1.8vh, 1rem) auto 0; }
  .game-picker-shell { min-height: 0; height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: clamp(.8rem, 2vh, 1.25rem); padding: clamp(.75rem, 2.5vh, 1.5rem) 0; }
  .picker-hero h1, .picker-title { font-size: clamp(2.4rem, 5.4vw, 4.25rem); }
  .picker-hero > p:last-child { margin-top: .55rem; font-size: clamp(.86rem, 1.4vw, 1rem); line-height: 1.45; }
  .game-choice-grid { min-height: 0; height: 100%; margin-top: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(.8rem, 2vw, 1.25rem); }
  .game-choice { min-height: 0; height: 100%; padding: clamp(1rem, 2.3vw, 1.5rem); }
  .game-choice-icon { width: 58px; height: 58px; border-radius: 16px; font-size: 2rem; }
  .game-choice-type { margin-top: clamp(.7rem, 1.8vh, 1rem); }
  .game-choice h2 { margin-top: .45rem; font-size: clamp(1.35rem, 2.4vw, 1.8rem); }
  .game-choice p { margin-top: .45rem; font-size: .86rem; line-height: 1.45; }
  .game-choice-action { padding-top: .7rem; }
}

@media (min-width: 761px) and (max-height: 800px) {
  .jaze96-signature { padding: .32rem .55rem; font-size: .62rem; }
  .jaze96-signature p:nth-child(3) { display: none; }
  body[data-static-page] { display: grid; height: 100svh; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
  body[data-static-page] .global-page-nav { padding: .4rem .8rem; }
  body[data-static-page] .content-page { width: min(920px, calc(100% - 32px)); padding: .35rem 0 .45rem; overflow: hidden; }
  body[data-static-page] .content-page h1 { margin: .2rem 0 .35rem; font-size: clamp(1.45rem, 2.6vw, 2rem); }
  body[data-static-page] .content-page h2 { margin: .45rem 0 .08rem; font-size: .92rem; }
  body[data-static-page] .content-page p { margin: 0 0 .28rem; font-size: .78rem; line-height: 1.42; }
  .picker-hero h1, .picker-title { font-size: clamp(2.15rem, 4.8vw, 3.35rem); }
  .game-choice { padding: .85rem 1rem; }
  .game-choice-icon { width: 50px; height: 50px; font-size: 1.7rem; }
  .game-choice-type { margin-top: .55rem; font-size: .64rem; }
  .game-choice h2 { font-size: 1.25rem; }
  .game-choice p { margin-top: .35rem; font-size: .76rem; line-height: 1.35; }
  .game-choice-action { padding-top: .5rem; font-size: .86rem; }
}

@media (min-width: 761px) {
  body:has(.game-shell) { display: grid; height: 100svh; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
  body:has(.game-shell) .global-page-nav, body.carrot-page .global-page-nav { margin: clamp(.65rem, 1.8vh, 1rem) auto 0; }
  body:has(.game-shell) .global-page-nav, body.carrot-page .global-page-nav { position: relative; }
  .global-page-nav > label { position: absolute; left: 50%; transform: translateX(-50%); }
  .global-page-nav > label .language-choice-label { justify-self: center; text-align: center; }
  .game-shell { display: grid; height: 100%; min-height: 0; }

  body.carrot-page { display: grid; height: 100svh; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
  .carrot-shell { height: 100%; min-height: 0; grid-template-rows: auto minmax(0, 1fr) auto; padding: clamp(.5rem, 1.8vh, .75rem); gap: clamp(.5rem, 1.5vh, .75rem); }
  .carrot-hero { padding: clamp(.65rem, 1.8vh, 1rem) clamp(.8rem, 2vw, 1.25rem); }
  .carrot-layout { min-height: 0; }
  .carrot-setup, .carrot-control-panel, .carrot-board-zone { min-height: 0; }
  .carrot-board-zone { padding: clamp(.5rem, 1.4vh, .75rem); gap: clamp(.45rem, 1vh, .6rem); }
  .carrot-board-frame-3d, .carrot-canvas { height: 100%; min-height: 0; }
  .carrot-score-panel { padding: 10px; overflow: hidden; }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .top-panel { grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr); }
  .play-area { grid-template-columns: 160px minmax(0, 1fr) 180px; }
  .carrot-layout { grid-template-columns: minmax(170px, .7fr) minmax(300px, 1.5fr) minmax(180px, .75fr); }
  .carrot-actions, .carrot-control-panel > .carrot-actions { grid-template-columns: 1fr; }
  .carrot-actions button { white-space: normal; line-height: 1.15; }
}

@media (min-width: 761px) and (max-height: 800px) {
  .game-shell { gap: 6px; padding: 6px; }
  .top-panel { gap: 10px; padding: 8px 12px; }
  .top-panel h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
  .summary { font-size: .8rem; }
  .status-bar > div { padding: 6px 8px; }
  .message { min-height: 28px; margin-bottom: 4px; padding: 6px 9px; font-size: .86rem; }
  .card-grid { grid-template-columns: repeat(13, minmax(0, 40px)); grid-template-rows: repeat(4, minmax(0, 1fr)); justify-content: center; gap: 4px; padding: 6px; border-width: 6px; }
  .card { width: 100%; height: 100%; aspect-ratio: auto; }
  .corner b { font-size: .63rem; }
  .corner span { font-size: .58rem; }
  .pip { font-size: .6rem; }
  .carrot-hero h1 { font-size: clamp(2rem, 3.3vw, 2.8rem); }
  .carrot-hero p { margin-bottom: 0; font-size: .82rem; }
  .carrot-setup { gap: 4px; padding: 8px; }
  .carrot-control-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto auto auto minmax(0, 1fr); gap: 6px; padding: 10px; }
  .carrot-control-panel > .carrot-status-card:nth-child(1) { grid-column: 1; grid-row: 1; }
  .carrot-control-panel > .carrot-status-card:nth-child(2) { grid-column: 2; grid-row: 1; }
  .carrot-control-panel > .carrot-status-grid { grid-column: 1 / -1; grid-row: 2; }
  .carrot-control-panel > .carrot-actions { grid-column: 1 / -1; grid-row: 3; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .carrot-control-panel > .carrot-die { grid-column: 1; grid-row: 4; align-self: center; }
  .carrot-control-panel > .carrot-score-panel { grid-column: 2; grid-row: 4; padding: 6px; }
  .carrot-score-panel h2 { margin-bottom: 4px; font-size: .92rem; }
  .carrot-score-panel:has(.player-score) { grid-column: 1 / -1; padding: 6px; }
  .carrot-score-panel:has(.player-score) h2 { display: none; }
  .carrot-score-panel .scoreboard:has(.player-score) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; }
  .carrot-score-panel .player-score { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px; padding: 3px 5px; font-size: .68rem; line-height: 1.1; }
  .carrot-control-panel:has(.player-score) > .carrot-die { display: none; }
  .carrot-setup label { gap: 2px; font-size: .72rem; }
  .carrot-setup select, .carrot-setup .player-name-input, .carrot-setup .primary-button { min-height: 30px; }
  .carrot-rules ol { gap: 5px; font-size: .76rem; line-height: 1.32; }
  .carrot-status-grid { gap: 6px; }
  .carrot-status-card { gap: 3px; padding: 6px; }
  .target-color { min-height: 20px; gap: 5px; font-size: .78rem; }
  .color-dot { width: 16px; height: 16px; }
  .carrot-actions { gap: 5px; }
  .carrot-actions .primary-button { min-height: 30px; padding: 0 8px; }
  .carrot-actions .secondary-button { min-height: 30px; padding: 0 8px; }
  .carrot-die { width: 44px; height: 44px; margin: 2px auto; }
  .carrot-die span { width: 26px; height: 26px; }
}

@media (min-width: 761px) and (max-height: 920px) {
  .carrot-setup { gap: 4px; padding: 8px; }
  .carrot-setup label { gap: 2px; font-size: .72rem; }
  .carrot-setup select, .carrot-setup .player-name-input, .carrot-setup .primary-button { min-height: 30px; }
  .carrot-rules ol { gap: 5px; font-size: .76rem; line-height: 1.32; }
  .carrot-control-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto auto auto minmax(0, 1fr); gap: 6px; padding: 10px; }
  .carrot-control-panel > .carrot-status-card:nth-child(1) { grid-column: 1; grid-row: 1; }
  .carrot-control-panel > .carrot-status-card:nth-child(2) { grid-column: 2; grid-row: 1; }
  .carrot-control-panel > .carrot-status-grid { grid-column: 1 / -1; grid-row: 2; }
  .carrot-control-panel > .carrot-actions { grid-column: 1 / -1; grid-row: 3; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .carrot-control-panel > .carrot-die { grid-column: 1; grid-row: 4; align-self: center; }
  .carrot-control-panel > .carrot-score-panel { grid-column: 2; grid-row: 4; padding: 6px; }
  .carrot-status-grid { gap: 6px; }
  .carrot-status-card { gap: 3px; padding: 6px; }
  .target-color { min-height: 20px; gap: 5px; font-size: .78rem; }
  .color-dot { width: 16px; height: 16px; }
  .carrot-actions { gap: 5px; }
  .carrot-actions .primary-button, .carrot-actions .secondary-button { min-height: 30px; padding: 0 8px; }
  .carrot-die { width: 44px; height: 44px; margin: 2px auto; }
  .carrot-die span { width: 26px; height: 26px; }
}

@media (min-width: 761px) and (max-width: 1100px) and (max-height: 800px) {
  .card-grid.is-preview { min-width: 0; }
  .carrot-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .carrot-hero .secondary-link { width: auto; }
  .carrot-setup { grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr); grid-template-rows: auto auto auto minmax(0, 1fr); }
  .carrot-setup > h2 { grid-column: 1 / -1; grid-row: 1; margin: 0; }
  .carrot-setup > label { grid-column: 1; grid-row: 2; }
  .carrot-setup .player-name-panel { grid-column: 2; grid-row: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .carrot-setup > .primary-button { grid-column: 1 / -1; grid-row: 3; }
  .carrot-setup > .carrot-rules { grid-column: 1 / -1; grid-row: 4; padding-top: 3px; }
  .carrot-rules h2 { margin: 0 0 4px; font-size: .9rem; }
  .carrot-rules ol { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; row-gap: 3px; padding-left: 16px; font-size: .68rem; line-height: 1.22; }
  .carrot-score-panel .scoreboard { font-size: .82rem; line-height: 1.22; }
  .carrot-control-panel > .carrot-actions { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body:has(.game-shell), body.carrot-page { display: grid; height: 100svh; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
  body[data-game-stage="setup"] .play-area, body[data-game-stage="setup"] .status-bar, body[data-game-stage="setup"] .ad-slot, body[data-game-stage="setup"] .site-footer { display: none; }
  body[data-game-stage="play"] .top-panel, body[data-game-stage="play"] .carrot-hero, body[data-game-stage="play"] .carrot-setup, body[data-game-stage="play"] .ad-slot { display: none; }
  body[data-game-stage="play"]:has(.game-shell) [data-game-stage-toggle]:not([hidden]) { display: inline-flex; }

  body:has(.game-shell) .game-shell,
  body.carrot-page .carrot-shell {
    display: grid;
    height: 100%;
    min-height: 0;
    padding: .45rem;
    gap: .45rem;
    overflow: hidden;
  }

  body:has(.game-shell) .game-shell { grid-template-rows: minmax(0, 1fr) auto; }
  body.carrot-page .carrot-shell { grid-template-rows: minmax(0, 1fr) auto; }
  body[data-game-stage="setup"] .game-shell,
  body[data-game-stage="setup"] .carrot-shell { grid-template-rows: minmax(0, 1fr); }
  body[data-game-stage="setup"] .carrot-shell { grid-template-rows: minmax(0, .42fr) minmax(0, .58fr); }

  .global-page-nav { margin: .45rem auto 0; gap: .4rem; }
  .global-page-nav a, .global-page-nav button { padding: .4rem .6rem; font-size: .78rem; }
  .global-page-nav label { display: flex; align-items: center; gap: .35rem; font-size: .64rem; }
  .global-page-nav select { max-width: 7.4rem; min-height: 2rem; }

  body[data-game-stage="setup"] .top-panel,
  body[data-game-stage="setup"] .carrot-hero,
  body[data-game-stage="setup"] .carrot-layout { min-height: 0; height: 100%; overflow: hidden; }
  body[data-game-stage="setup"] .top-panel { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: .5rem; padding: .75rem; }
  body[data-game-stage="setup"] .top-panel h1,
  body[data-game-stage="setup"] .carrot-hero h1 { font-size: clamp(1.65rem, 8vw, 2.25rem); }
  body[data-game-stage="setup"] .top-panel .summary,
  body[data-game-stage="setup"] .carrot-hero .summary { font-size: .72rem; line-height: 1.35; }
  body[data-game-stage="setup"] .setup-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
  body[data-game-stage="setup"] .setup-panel .player-name-panel { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-game-stage="setup"] .setup-panel .primary-button { min-height: 2.3rem; }
  body[data-game-stage="setup"] .carrot-hero { padding: .75rem; }
  body[data-game-stage="setup"] .carrot-layout { display: block; }
  body[data-game-stage="setup"] .carrot-control-panel,
  body[data-game-stage="setup"] .carrot-board-zone { display: none; }
  body[data-game-stage="setup"] .carrot-setup { height: 100%; padding: .75rem; }
  body[data-game-stage="setup"] .carrot-rules { display: none; }

  body[data-game-stage="play"] .game-shell { grid-template-rows: auto minmax(0, 1fr) auto; }
  body[data-game-stage="play"] .status-bar { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .25rem; }
  body[data-game-stage="play"] .status-bar > div { padding: .35rem; font-size: .68rem; }
  body[data-game-stage="play"] .play-area { display: grid; min-height: 0; grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); gap: .35rem; }
  body[data-game-stage="play"] .score-panel { display: none; }
  body[data-game-stage="play"] .leaderboard-panel { display: none; }
  body[data-game-stage="play"] .board-wrap { min-height: 0; overflow: auto hidden; }
  body[data-game-stage="play"] .card-grid { grid-template-columns: repeat(13, minmax(28px, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr)); width: max-content; min-width: 30rem; height: 100%; gap: 3px; padding: 4px; }
  body[data-game-stage="play"] .card { min-height: 0; }

  body[data-game-stage="play"] .carrot-shell { grid-template-rows: minmax(0, 1fr) auto; }
  body[data-game-stage="play"] .carrot-layout { display: grid; min-height: 0; grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; gap: .4rem; }
  body[data-game-stage="play"] .carrot-board-zone { min-height: 0; padding: .35rem; }
  body[data-game-stage="play"] .carrot-board-frame,
  body[data-game-stage="play"] .carrot-board-frame-3d,
  body[data-game-stage="play"] .carrot-canvas { min-height: 0; height: 100%; }
  body[data-game-stage="play"] .carrot-control-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto auto auto; gap: .35rem; padding: .45rem; }
  body[data-game-stage="play"] .carrot-status-grid { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem; }
  body[data-game-stage="play"] .carrot-actions { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .3rem; }
  body[data-game-stage="play"] .carrot-actions button { min-height: 2rem; padding: .25rem; font-size: .68rem; }
  body[data-game-stage="play"] .carrot-die { display: none; }
  body[data-game-stage="play"] .carrot-score-panel { display: none; }
  body[data-game-stage="play"] .site-footer.jaze96-signature { font-size: .56rem; }
  body[data-game-stage="play"] .site-footer.jaze96-signature p:nth-child(3),
  body[data-game-stage="play"] .site-footer.jaze96-signature nav { display: none; }
}

/* Number Maze */
.number-maze-page { display: grid; min-height: 100svh; grid-template-rows: auto minmax(0, 1fr); background: linear-gradient(160deg, #f8f5e9, #e6f0ed); }
.number-maze-page .global-page-nav { position: relative; margin: clamp(.55rem, 1.8vh, 1rem) auto 0; }
.number-maze-page .global-page-nav > label { position: absolute; left: 50%; transform: translateX(-50%); }
.number-maze-shell { display: grid; min-height: 0; place-items: center; padding: clamp(.55rem, 1.5vh, 1rem); }
.number-maze-board { display: grid; width: min(100%, 760px); gap: clamp(.55rem, 1.5vh, .9rem); padding: clamp(.85rem, 2vw, 1.25rem); border: 1px solid rgba(86, 117, 110, .16); border-radius: 24px; background: rgba(255, 253, 247, .82); box-shadow: 0 14px 34px rgba(55, 85, 77, .1); }
.number-maze-hero { text-align: center; }
.number-maze-hero .eyebrow { margin: 0; color: #466f70; }
.number-maze-hero h1 { margin: .2rem 0 0; color: #244d51; font-size: clamp(1.55rem, 4vw, 2.45rem); letter-spacing: -.05em; }
.number-maze-hero p:last-child { margin: .25rem 0 0; color: var(--muted); font-size: clamp(.72rem, 1.6vw, .92rem); }
.number-maze-setup { display: grid; justify-items: center; gap: .65rem; }
.number-maze-setup[hidden], .number-maze-game[hidden] { display: none; }
.number-maze-setup > p { margin: 0; color: #3e6264; font-size: .9rem; }
.number-maze-levels, .number-maze-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.number-maze-level, .number-maze-actions > button { border: 1px solid rgba(55, 92, 94, .25); border-radius: 999px; padding: .46rem .72rem; background: #f7fbf8; color: #285256; font: inherit; font-size: .82rem; font-weight: 800; cursor: pointer; }
.number-maze-level.is-selected { border-color: transparent; background: #315e62; color: #fff; }
.number-maze-setup .primary-button, .number-maze-actions .primary-button { min-height: 0; padding: .52rem .9rem; font-size: .84rem; }
.number-maze-game { display: grid; grid-template-columns: minmax(210px, .52fr) minmax(0, 1fr); grid-template-areas: "status grid" "message grid" "actions grid"; align-items: center; gap: .65rem 1rem; }
.number-maze-status { grid-area: status; display: grid; gap: .35rem; padding: .72rem .85rem; border-radius: 16px; background: #e5efec; color: #21494c; }
.number-maze-status p { display: flex; justify-content: space-between; gap: .6rem; margin: 0; font-size: .84rem; }
.number-maze-status strong { color: #a84a24; font-weight: 900; }
.number-maze-grid { grid-area: grid; display: grid; grid-template-columns: repeat(var(--number-maze-size), minmax(0, 1fr)); gap: clamp(2px, .5vw, 5px); width: min(100%, 480px); justify-self: center; }
.number-maze-cell { aspect-ratio: 1; min-width: 0; border: 0; border-radius: clamp(5px, 1.3vw, 10px); background: #e6f0ed; color: #244d51; font: inherit; font-size: clamp(.58rem, 1.7vw, .95rem); font-weight: 900; cursor: pointer; transition: transform .16s ease, background-color .16s ease; }
.number-maze-cell:hover:not(:disabled), .number-maze-cell:focus-visible:not(:disabled) { background: #c7ded7; transform: translateY(-1px); }
.number-maze-cell:disabled { cursor: default; }
.number-maze-cell.is-path { background: #cbdcf0; color: #294866; }
.number-maze-cell.is-start { background: #82b7a8; color: #173f40; }
.number-maze-cell.is-exit { background: #f2b365; color: #563516; }
.number-maze-message { grid-area: message; min-height: 2.6em; margin: 0; color: #536d6b; font-size: .82rem; line-height: 1.35; }
.number-maze-actions { grid-area: actions; justify-content: flex-start; }
.number-maze-actions > button:disabled { cursor: not-allowed; opacity: .5; }

@media (max-width: 760px) {
  body.number-maze-page { height: 100svh; overflow: hidden; }
  .number-maze-page .global-page-nav { margin-top: .4rem; }
  .number-maze-page .global-page-nav > label { position: static; transform: none; }
  .number-maze-shell { align-items: start; padding: .5rem .35rem; }
  .number-maze-board { gap: .5rem; padding: .65rem; border-radius: 20px; }
  .number-maze-hero h1 { font-size: 1.38rem; }
  .number-maze-hero p:last-child { font-size: .67rem; }
  .number-maze-level, .number-maze-actions > button { padding: .36rem .5rem; font-size: .7rem; }
  .number-maze-game { grid-template-columns: 1fr; grid-template-areas: "status" "grid" "message" "actions"; gap: .45rem; }
  .number-maze-status { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: .5rem .65rem; }
  .number-maze-status p { font-size: .7rem; }
  .number-maze-grid { width: min(100%, 360px); }
  .number-maze-cell { font-size: clamp(.56rem, 3.4vw, .78rem); }
  .number-maze-message { min-height: 1.35em; text-align: center; font-size: .7rem; }
  .number-maze-actions { justify-content: center; }
}

/* Trivia Tug of War */
.trivia-tug-page {
  display: grid;
  height: 100svh;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 221, 159, .48), transparent 25%),
    linear-gradient(140deg, #edf5f1, #e8eef9);
}

.trivia-tug-page .global-page-nav { position: relative; margin: clamp(.55rem, 1.8vh, 1rem) auto 0; }
.trivia-tug-page .global-page-nav > label { position: absolute; left: 50%; transform: translateX(-50%); }

.trivia-tug-shell {
  min-height: 0;
  display: grid;
  place-items: center;
  padding: clamp(.45rem, 1.8vh, 1.15rem);
}

.trivia-tug-board {
  display: grid;
  width: min(100%, 920px);
  max-height: 100%;
  min-height: 0;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: clamp(.45rem, 1.4vh, .85rem);
  padding: clamp(.8rem, 2.4vw, 1.5rem);
  border: 1px solid rgba(34, 73, 88, .12);
  border-radius: 28px;
  background: rgba(255, 253, 248, .88);
  box-shadow: 0 18px 45px rgba(43, 64, 81, .14);
}

.trivia-tug-hero { text-align: center; }
.trivia-tug-hero .eyebrow { margin: 0; color: #3b697d; }
.trivia-tug-hero h1 { margin: .25rem 0 0; color: #1a3f4d; font-size: clamp(1.65rem, 4vw, 2.65rem); letter-spacing: -.05em; }
.trivia-tug-hero p:last-child { margin: .35rem auto 0; max-width: 640px; color: var(--muted); font-size: clamp(.76rem, 1.8vw, .94rem); }

.trivia-status { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem .75rem; border-radius: 14px; background: #e8f1ed; color: #1b4d47; font-weight: 800; }
.trivia-status p { margin: 0; }
.trivia-timer { min-width: 4.5rem; border-radius: 999px; padding: .35rem .65rem; background: #fff7e7; color: #a84a24; text-align: center; }

.trivia-tug-track { position: relative; display: grid; grid-template-columns: minmax(145px, .75fr) minmax(320px, 1.8fr) minmax(145px, .75fr); align-items: end; min-height: 164px; gap: .2rem; padding: .15rem .5rem .35rem; border-radius: 20px; background: linear-gradient(180deg, rgba(226, 239, 235, .36), rgba(244, 231, 206, .55)); }
.trivia-winner { position: absolute; z-index: 7; top: .45rem; left: 50%; margin: 0; transform: translateX(-50%); color: #b64e27; font-size: clamp(.92rem, 2vw, 1.12rem); font-weight: 900; text-align: center; white-space: nowrap; }
.trivia-team-zone { display: grid; gap: .25rem; color: #466174; }
.trivia-team-zone.is-left { justify-items: end; }
.trivia-team-zone.is-right { justify-items: start; }
.trivia-team-label { font-size: clamp(.62rem, 1.5vw, .78rem); font-weight: 800; line-height: 1.2; }
.trivia-team { position: relative; z-index: 3; display: grid; min-height: 122px; align-items: end; }
.trivia-team-art { display: block; width: min(100%, 190px); aspect-ratio: 3 / 2; height: auto; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 4px 3px rgba(31, 44, 50, .17)); }
.trivia-team-art--win { display: none; --victory-base: translateY(-2px) scale(.92); transform: var(--victory-base); transform-origin: center bottom; }
.trivia-team.is-winner .trivia-team-art--pull { display: none; }
.trivia-team.is-winner .trivia-team-art--win { display: block; animation: trivia-victory-jump 920ms cubic-bezier(.25, .72, .32, 1) both; }
.trivia-team-one .trivia-team-art { transform-origin: 82% 70%; }
.trivia-team-two .trivia-team-art--pull { transform: translateY(-9px) scale(.846); transform-origin: center bottom; }
.trivia-team-two .trivia-team-art--win { --victory-base: translateY(-4px) scale(.89); }
.trivia-team.is-pulling-left { animation: trivia-pull-left 560ms ease-out; }
.trivia-team.is-pulling-right { animation: trivia-pull-right 560ms ease-out; }
.trivia-rope { position: relative; z-index: 1; min-height: 104px; overflow: visible; pointer-events: none; border-radius: 999px; background: linear-gradient(90deg, #d9e9e2, #fff5d7 50%, #dfe8f5); }
.trivia-rope::before, .trivia-rope::after { position: absolute; top: 0; bottom: 0; width: 12px; background: #467f7a; content: ""; }
.trivia-rope::before { left: 0; }
.trivia-rope::after { right: 0; background: #5878a9; }
.trivia-rope-line { position: absolute; top: 40%; right: -34%; left: -34%; z-index: 2; height: 7px; transform: translateY(-50%); border-radius: 99px; background: repeating-linear-gradient(90deg, #8b5637 0 12px, #deb379 12px 20px); box-shadow: 0 2px 3px rgba(65, 42, 29, .2); }
.trivia-rope-marker { position: absolute; top: 40%; left: 50%; z-index: 4; display: grid; width: auto; height: auto; place-items: center; transform: translate(-50%, -50%); border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: 1.45rem; line-height: 1; transition: left 180ms ease; }
.trivia-celebration { position: absolute; z-index: 5; top: calc(40% - 17px); width: 1px; height: 1px; pointer-events: none; transform: translate(-50%, -50%); opacity: 0; }
.trivia-celebration.is-celebrating { animation: trivia-celebration-glow 900ms ease-out both; }
.trivia-celebration span { position: absolute; top: 0; left: 0; width: 5px; height: 13px; border-radius: 999px; background: #ffbe4a; box-shadow: 0 0 8px rgba(255, 177, 56, .75); transform: rotate(var(--spark-angle)) translateY(-3px) scaleY(.55); transform-origin: 50% 100%; opacity: 0; }
.trivia-celebration.is-celebrating span { animation: trivia-spark-burst 780ms cubic-bezier(.18, .76, .36, 1) both; }
.trivia-celebration span:nth-child(2n) { background: #ff7f4a; animation-delay: 55ms; }
.trivia-celebration span:nth-child(3n) { background: #ffe381; animation-delay: 100ms; }
.trivia-rope.is-pulling-left .trivia-rope-line { animation: trivia-rope-left 560ms ease-out; }
.trivia-rope.is-pulling-right .trivia-rope-line { animation: trivia-rope-right 560ms ease-out; }

@keyframes trivia-pull-left { 40% { transform: translateX(-13px) rotate(-5deg); } 100% { transform: translateX(0); } }
@keyframes trivia-pull-right { 40% { transform: translateX(13px) rotate(5deg); } 100% { transform: translateX(0); } }
@keyframes trivia-rope-left { 45% { transform: translate(-9px, -50%); } 100% { transform: translateY(-50%); } }
@keyframes trivia-rope-right { 45% { transform: translate(9px, -50%); } 100% { transform: translateY(-50%); } }
@keyframes trivia-victory-jump { 0%, 100% { transform: var(--victory-base); } 31% { transform: translateY(-20px) var(--victory-base) rotate(-2deg); } 51% { transform: translateY(0) var(--victory-base) rotate(1deg); } 73% { transform: translateY(-11px) var(--victory-base) rotate(-1deg); } }
@keyframes trivia-celebration-glow { 0% { opacity: 0; } 12%, 58% { opacity: 1; } 100% { opacity: 0; } }
@keyframes trivia-spark-burst { 0% { opacity: 0; transform: rotate(var(--spark-angle)) translateY(-3px) scaleY(.45); } 15% { opacity: 1; } 72% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--spark-angle)) translateY(-36px) scaleY(1); } }

.trivia-start-panel { display: grid; min-height: 0; place-items: center; gap: .75rem; padding: clamp(.9rem, 2.5vw, 1.35rem); border: 1px dashed #b9cbce; border-radius: 20px; background: rgba(248, 252, 249, .82); text-align: center; }
.trivia-start-panel p { max-width: 440px; margin: 0; color: #49606d; font-size: clamp(.8rem, 1.8vw, .95rem); font-weight: 700; line-height: 1.5; }
.trivia-start { min-height: 44px; padding: 0 1.3rem; }
.trivia-start:disabled { cursor: not-allowed; opacity: .52; }
.trivia-mode-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(100%, 420px); gap: .6rem; }
.trivia-mode-choice { min-height: 44px; border: 1px solid #b9cbce; border-radius: 13px; background: #f7fbf9; color: #254d55; cursor: pointer; font: inherit; font-size: clamp(.78rem, 1.7vw, .9rem); font-weight: 800; transition: transform 160ms ease, border-color 160ms ease, background 160ms ease; }
.trivia-mode-choice:hover { transform: translateY(-2px); border-color: #3a7580; background: #e3f0ed; }
.trivia-mode-choice.is-selected { border-color: #17685b; background: #dcefe9; box-shadow: inset 0 0 0 1px #17685b; }
.trivia-mode-choice:focus-visible { outline: 3px solid #e59a42; outline-offset: 3px; }

.trivia-question-card { min-height: 220px; display: grid; grid-template-rows: 2.6em 100px 2.6em auto; align-content: start; gap: clamp(.4rem, 1.2vh, .7rem); margin-top: calc(-1 * clamp(.2rem, .7vh, .45rem)); padding: clamp(.75rem, 2vw, 1.25rem); border: 1px solid #e5ddd0; border-radius: 20px; background: #fffdf8; text-align: center; transition: background 180ms ease, border-color 180ms ease; }
.trivia-question-card.is-player-one-turn { border-color: #b9d5e8; background: #edf7ff; }
.trivia-question-card.is-player-two-turn { border-color: #e7beb9; background: #fff1ef; }
.trivia-question-card[hidden], .trivia-status[hidden], .trivia-start-panel[hidden] { display: none; }
.trivia-question-card h2 { min-height: 2.6em; align-self: center; display: grid; max-height: 2.6em; margin: 0; overflow: hidden; place-items: center; color: #263e4a; font-size: clamp(1rem, 2.5vw, 1.35rem); line-height: 1.3; }
.trivia-game-over { margin: 0; color: #b64e27; font-weight: 900; }
.trivia-options { min-height: 100px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, 44px); gap: .55rem; align-content: center; }
.trivia-option { min-height: 44px; border: 1px solid #c9d7dc; border-radius: 13px; background: #f5faf9; color: #214552; cursor: pointer; font: inherit; font-size: clamp(.78rem, 1.7vw, .92rem); font-weight: 800; transition: transform 160ms ease, border-color 160ms ease, background 160ms ease; }
.trivia-option:hover:not(:disabled) { transform: translateY(-2px); border-color: #3a7580; background: #e3f0ed; }
.trivia-option:focus-visible { outline: 3px solid #e59a42; outline-offset: 3px; }
.trivia-option:disabled { cursor: not-allowed; opacity: .62; }
.trivia-question-card.is-player-one-turn .trivia-option { background: rgba(255, 255, 255, .7); }
.trivia-question-card.is-player-two-turn .trivia-option { background: rgba(255, 255, 255, .72); }
.trivia-message { min-height: 2.6em; display: grid; margin: 0; place-items: center; color: #775332; font-size: clamp(.73rem, 1.6vw, .88rem); font-weight: 800; }
.trivia-restart { justify-self: center; min-height: 40px; }

@media (prefers-reduced-motion: reduce) {
  .trivia-rope-marker, .trivia-option, .trivia-question-card, .trivia-mode-choice { transition: none; }
  .trivia-team.is-pulling-left, .trivia-team.is-pulling-right, .trivia-team.is-winner .trivia-team-art--win, .trivia-rope.is-pulling-left .trivia-rope-line, .trivia-rope.is-pulling-right .trivia-rope-line, .trivia-celebration.is-celebrating, .trivia-celebration.is-celebrating span { animation: none; }
  .trivia-celebration { display: none; }
}

@media (max-width: 760px) {
  body.trivia-tug-page { grid-template-rows: auto minmax(0, 1fr); }
  .trivia-tug-page .global-page-nav { margin-top: .4rem; }
  .trivia-tug-page .global-page-nav > label { position: static; transform: none; }
  .trivia-tug-shell { align-items: start; padding: .7rem .35rem .35rem; }
  .trivia-tug-board { gap: .4rem; padding: .65rem; border-radius: 20px; }
  .trivia-tug-hero h1 { font-size: 1.42rem; }
  .trivia-tug-hero p:last-child { margin-top: .2rem; font-size: .68rem; }
  .trivia-status { padding: .38rem .55rem; font-size: .75rem; }
  .trivia-timer { padding: .28rem .45rem; }
  .trivia-tug-track { grid-template-columns: 102px minmax(0, 1fr) 102px; min-height: 94px; gap: 0; padding: .1rem .15rem .2rem; }
  .trivia-winner { top: .2rem; font-size: .72rem; }
  .trivia-team-label { font-size: .56rem; }
  .trivia-team { min-height: 76px; }
  .trivia-team-art { width: min(100%, 116px); aspect-ratio: 3 / 2; height: auto; }
  .trivia-team-two .trivia-team-art--pull { transform: translateY(-5px) scale(.846); }
  .trivia-team-art--win { --victory-base: translateY(-1px) scale(.88); }
  .trivia-team-two .trivia-team-art--win { --victory-base: translateY(-2px) scale(.86); }
  .trivia-rope { min-height: 70px; }
  .trivia-rope-line { top: 40%; right: -58%; left: -58%; height: 6px; }
  .trivia-rope-marker { width: auto; height: auto; font-size: 1.05rem; }
  .trivia-question-card { min-height: 188px; grid-template-rows: 2.6em 96px 2.6em auto; gap: .4rem; margin-top: -.2rem; padding: .65rem; }
  .trivia-question-card h2 { font-size: .95rem; }
  .trivia-options { min-height: 96px; grid-template-rows: repeat(2, 44px); gap: .4rem; }
  .trivia-option { min-height: 44px; padding: .3rem; font-size: .72rem; }
  .trivia-message { font-size: .66rem; }
  .trivia-start-panel { gap: .55rem; padding: .8rem; }
  .trivia-start-panel p { font-size: .72rem; }
  .trivia-mode-choices { gap: .4rem; }
  .trivia-mode-choice { min-height: 40px; font-size: .68rem; }
}
