: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;
  background: linear-gradient(135deg, #f7f5ef 0%, #e8f1ed 48%, #f3ece1 100%);
}

button,
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 {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  line-height: 1;
  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: 700;
}

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: 700;
}

.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: 900;
  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: 900;
  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-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: 900;
  background: var(--table-dark);
}

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

.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;
}

.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: 900;
  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: 900;
  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%;
  }
}
