/* Layout: full-bleed 2D canvas; square board centered, dice tray to the right (landscape) or below (portrait). Single deliberate dark night-table look. */
:root {
  --table: #0c0a22;
  --ink: #f6f3ff;
  --ink-dim: #bcb3ea;
  --panel: rgba(26, 20, 72, 0.72);
  --red: #ff4b5c;
  --green: #1fcb7b;
  --yellow: #ffc23a;
  --blue: #3a8dff;
  --font-display: "Fredoka", system-ui, sans-serif;
  --font-body: "Fredoka", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
html,
body {
  height: 100%;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background: var(--table);
  color: var(--ink);
  font-family: var(--font-body);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
#fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  touch-action: manipulation;
}
.app {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  box-sizing: border-box;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 8px 12px;
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 50px;
  flex: none;
}
.logo {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0.5px;
  text-shadow:
    0 3px 0 #0b0628,
    0 0 24px rgba(120, 90, 255, 0.45);
  display: flex;
  align-items: center;
  gap: 6px;
}
.logo span {
  display: inline-block;
  color: #2a1600;
  background: var(--yellow);
  padding: 3px 8px 2px;
  border-radius: 10px;
  font-size: 18px;
  transform: rotate(-6deg);
  box-shadow: 0 3px 0 #9c6400;
  text-shadow: none;
}
.actions {
  display: flex;
  gap: 8px;
}
.icon-btn {
  pointer-events: auto;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 0;
  background: rgba(255, 255, 255, 0.09);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  font: 800 15px/1 var(--font-body);
  box-shadow:
    inset 0 -3px 0 rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition:
    transform 0.12s,
    background 0.2s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}
.icon-btn:active {
  transform: translateY(2px) scale(0.95);
}
.icon-btn svg {
  width: 20px;
  height: 20px;
}
:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}
.stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.stage.wide {
  flex-direction: row;
  gap: 24px;
}
.slot {
  flex: none;
}
.tray {
  pointer-events: auto;
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 16px 6px 6px;
  border-radius: 26px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-sizing: border-box;
  max-width: 100%;
}
.stage.wide .tray {
  flex-direction: column;
  width: 236px;
  padding: 20px 16px 22px;
  text-align: center;
}
.tray.bump {
  animation: bump 0.28s ease-out;
}
@keyframes bump {
  0% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(4px) scale(1.01, 0.98);
  }
  60% {
    transform: translateY(-2px);
  }
  100% {
    transform: none;
  }
}
.info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.stage.wide .info {
  align-items: center;
  width: 100%;
}
.turn {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.05;
}
.turn .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--pc, #fff);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.14),
    0 0 16px var(--pc, #fff);
  flex: none;
}
.hint {
  color: var(--ink-dim);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.25;
  min-height: 1.25em;
}
.score {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 3px;
}
.stage.wide .score {
  justify-content: center;
}
.chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  font-weight: 800;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  transition:
    box-shadow 0.2s,
    background 0.2s,
    transform 0.2s;
}
.chip i {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.6) 0 18%, transparent 40%), var(--cc);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.25);
}
.chip.on {
  box-shadow:
    0 0 0 2px var(--cc),
    0 0 14px var(--cc);
  background: rgba(255, 255, 255, 0.13);
  transform: translateY(-1px);
}
.chip.gold {
  background: var(--cc);
  color: #1a1040;
}
@media (max-width: 480px) {
  .score {
    flex-wrap: nowrap;
    gap: 4px;
  }
  .chip {
    padding: 2px 6px 2px 3px;
    font-size: 12px;
    gap: 4px;
  }
}

.dice-btn {
  position: relative;
  width: 110px;
  height: 110px;
  border: 0;
  border-radius: 28px;
  cursor: pointer;
  flex: none;
  padding: 0;
  background: radial-gradient(
    circle at 50% 66%,
    rgba(255, 255, 255, 0.13),
    rgba(255, 255, 255, 0) 66%
  );
}
/* The dice canvas reaches above and beside its slot so high bounces are never clipped. */
.dice-btn canvas {
  position: absolute;
  left: -20%;
  top: -70%;
  width: 140%;
  height: 170%;
  display: block;
  pointer-events: none;
}
.dice-btn[aria-disabled="true"] {
  cursor: default;
}
.dice-btn.ready::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 26px;
  border: 3px solid var(--pc, #fff);
  box-shadow:
    0 0 18px var(--pc, #fff),
    inset 0 0 14px var(--pc, #fff);
  animation: ringPulse 1.1s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ringPulse {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.94);
  }
  50% {
    opacity: 1;
    transform: scale(1.02);
  }
}
@media (max-width: 480px) {
  .dice-btn {
    width: 96px;
    height: 96px;
  }
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  overflow: auto;
  background: radial-gradient(ellipse at center, rgba(12, 8, 48, 0.2), rgba(8, 5, 32, 0.62));
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  box-sizing: border-box;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: calc(16px + env(safe-area-inset-top, 0px))
    calc(16px + env(safe-area-inset-bottom, 0px));
}
.card {
  width: min(100%, 500px);
  box-sizing: border-box;
  background: linear-gradient(180deg, rgba(48, 32, 132, 0.93) 0%, rgba(28, 18, 88, 0.95) 100%);
  border-radius: 32px;
  padding: 26px 22px 22px;
  text-align: center;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 0 1px rgba(255, 255, 255, 0.07);
  animation: cardIn 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) both;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
@keyframes cardIn {
  from {
    transform: translateY(30px) scale(0.9);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
.big-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(64px, 19vw, 104px);
  line-height: 0.88;
  display: flex;
  justify-content: center;
  gap: 2px;
  position: relative;
  margin: 4px 0 0;
}
.big-title span {
  display: inline-block;
  text-shadow:
    0 7px 0 rgba(0, 0, 0, 0.35),
    0 0 30px currentColor;
  animation: letter 2.6s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.14s);
}
@keyframes letter {
  0%,
  60%,
  100% {
    transform: translateY(0) rotate(0);
  }
  20% {
    transform: translateY(-12px) rotate(-5deg);
  }
  35% {
    transform: translateY(2px) scale(1.06, 0.94);
  }
}
.sticker {
  position: absolute;
  right: max(4%, calc(50% - 150px));
  bottom: -8px;
  font-size: 20px;
  color: #2a1600 !important;
  background: var(--yellow);
  padding: 5px 12px 3px;
  border-radius: 12px;
  transform: rotate(-9deg);
  box-shadow: 0 4px 0 #9c6400;
  text-shadow: none !important;
  animation: none !important;
}
.sub {
  color: var(--ink-dim);
  font-weight: 700;
  margin: 22px 0 14px;
  font-size: 15px;
}
.seats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.seat {
  border: 0;
  border-radius: 20px;
  padding: 12px;
  background: var(--sc);
  color: var(--tc);
  font: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  box-shadow:
    inset 0 -5px 0 rgba(0, 0, 0, 0.22),
    inset 0 2px 0 rgba(255, 255, 255, 0.3),
    0 5px 0 rgba(0, 0, 0, 0.3);
  transition:
    transform 0.12s,
    box-shadow 0.12s,
    background 0.2s;
}
.seat:active {
  transform: translateY(4px);
  box-shadow:
    inset 0 -3px 0 rgba(0, 0, 0, 0.22),
    0 1px 0 rgba(0, 0, 0, 0.3);
}
.seat.off {
  background: #3a3176;
  color: var(--ink-dim);
}
.seat svg {
  width: 30px;
  height: 38px;
  flex: none;
}
.seat b {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 21px;
  display: block;
  line-height: 1;
}
.seat small {
  font-weight: 700;
  font-size: 12.5px;
  opacity: 0.85;
  display: block;
  margin-top: 3px;
}
.warn {
  color: #ffb1bb;
  font-weight: 700;
  font-size: 14px;
  margin-top: 10px;
  min-height: 1.3em;
}
.play {
  margin-top: 8px;
  width: 100%;
  border: 0;
  border-radius: 20px;
  padding: 15px;
  font-family: var(--font-display);
  font-size: 28px;
  color: #3a2200;
  cursor: pointer;
  background: linear-gradient(180deg, #ffdb6e, #ffb400);
  box-shadow:
    inset 0 -6px 0 rgba(150, 80, 0, 0.35),
    inset 0 2px 0 rgba(255, 255, 255, 0.5),
    0 7px 0 #8a5200,
    0 16px 34px rgba(255, 190, 40, 0.3);
  transition:
    transform 0.1s,
    box-shadow 0.1s;
}
.play:active {
  transform: translateY(6px);
  box-shadow:
    inset 0 -4px 0 rgba(150, 80, 0, 0.35),
    0 1px 0 #8a5200;
}
.play:disabled {
  filter: grayscale(0.8) brightness(0.7);
  cursor: not-allowed;
}
.ghost {
  margin-top: 10px;
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 11px;
  font: 800 16px var(--font-body);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}
.ghost:hover {
  background: rgba(255, 255, 255, 0.14);
}
.rules {
  margin: 16px auto 0;
  color: var(--ink-dim);
  font-size: 14px;
  line-height: 1.45;
  max-width: 44ch;
}
.rules b {
  color: var(--ink);
}
.fatal {
  max-width: 40ch;
  text-align: center;
  font-weight: 700;
  color: var(--ink-dim);
  line-height: 1.5;
}
@media (prefers-reduced-motion: reduce) {
  .big-title span,
  .dice-btn.ready::before {
    animation: none;
  }
  .card {
    animation: none;
  }
}

/* Cat theme */
:root {
  --table: #fbf5e9;
  --ink: #493831;
  --ink-dim: #806e60;
  --panel: #fffaf1;
  color-scheme: light;
}
.logo {
  color: #493831;
  text-shadow: none;
}
.logo span {
  background: #f8c85a;
  color: #493831;
  box-shadow: 0 3px 0 #d9a63e;
}
.icon-btn {
  background: #fffaf1;
  color: #493831;
  box-shadow:
    0 2px 0 #dfd0bf,
    inset 0 0 0 1px #e5d7c7;
}
.icon-btn:hover {
  background: #f5e6d6;
}
.tray {
  position: relative;
  background: #fffaf1;
  border: 2px solid #755c50;
  box-shadow: 0 7px 0 #eaddca;
  backdrop-filter: none;
}
.stage.wide .tray:before,
.stage.wide .tray:after {
  content: "";
  position: absolute;
  top: -14px;
  width: 27px;
  height: 27px;
  background: #fffaf1;
  border: 2px solid #755c50;
  border-radius: 5px;
  transform: rotate(45deg);
  z-index: -1;
}
.stage.wide .tray:before {
  left: 22px;
}
.stage.wide .tray:after {
  right: 22px;
}
.stage.wide .turn {
  background: #f9dcd5;
  border: 1px solid #e7bcb3;
  border-radius: 20px;
  padding: 9px 14px;
}
.dice-btn {
  background: #f5e9da;
}
.hint {
  color: #806e60;
}
.chip {
  background: #f3e8da;
}
.chip.on {
  background: #f8dfd6;
  box-shadow: 0 0 0 2px var(--cc);
}
.dice-btn.ready::before {
  box-shadow: none;
  border-width: 2px;
}
.turn .dot {
  box-shadow: 0 0 0 3px #f1e4d6;
}
.overlay {
  background: rgba(91, 68, 56, 0.28);
  backdrop-filter: blur(2px);
}
.card {
  background: #fffaf1;
  color: #493831;
  box-shadow:
    0 12px 0 #dbcbb8,
    0 20px 50px #68534444;
  border: 2px solid #755c50;
  backdrop-filter: none;
}
.big-title span {
  text-shadow: 0 3px 0 #60463b;
  animation: none;
}
.sticker {
  background: #f8c85a;
  color: #493831 !important;
  box-shadow: 0 3px 0 #c99a38;
}
.seat.off {
  background: #e8ddd0;
  color: #6d5b50;
}
.ghost {
  color: #493831;
  background: #f0e5d7;
}
.ghost:hover {
  background: #e7d7c5;
}
.rules b {
  color: #493831;
}

:root {
  --table: #e8eaff;
  --ink: #343363;
  --ink-dim: #777bad;
  --panel: #f9f9ff;
}
.logo {
  font-size: 32px;
  color: #343363;
}
.logo span {
  font-size: 17px;
  background: #ffda58;
  color: #343363;
  box-shadow: none;
  border-radius: 14px;
}
.icon-btn {
  background: #f8f8ff;
  color: #555889;
  box-shadow:
    0 2px 0 #c3c7ea,
    inset 0 0 0 1px #c6caec;
}
.icon-btn:hover {
  background: #eeefff;
}
.tray {
  background: #f9f9ff;
  border: 3px solid #8c90c7;
  box-shadow: 0 8px 24px #9298d12e;
  border-radius: 30px;
}
.stage.wide .tray:before,
.stage.wide .tray:after {
  background: #f9f9ff;
  border-color: #8c90c7;
  border-width: 3px;
  width: 35px;
  height: 35px;
  top: -18px;
  border-radius: 8px;
}
.stage.wide .tray:before {
  left: 25px;
}
.stage.wide .tray:after {
  right: 25px;
}
.stage.wide .turn {
  background: #ffe0ef;
  color: #343363;
  border: 0;
  padding: 11px 20px;
  min-width: 140px;
  justify-content: center;
}
.dice-btn {
  background: #e5e6ff;
  border-radius: 30px;
  box-shadow: inset 0 0 0 5px #d6d9fb;
}
.dice-btn.ready::before {
  box-shadow: none;
  border: 0;
}
.hint {
  color: #777bad;
}
.turn .dot {
  box-shadow: none;
}
.chip {
  background: #ebecfc;
  color: #343363;
  padding: 6px 10px;
  min-width: 60px;
  justify-content: space-between;
}
.chip.on {
  background: #ffdeec;
  box-shadow: 0 0 0 2px var(--cc);
}
.chip i {
  width: 21px;
  height: 18px;
  border-radius: 45% 45% 40% 40%;
  position: relative;
  background: var(--cc);
  box-shadow: inset 0 0 0 2px #37365e;
}
.chip i:before,
.chip i:after {
  content: "";
  position: absolute;
  top: -3px;
  width: 8px;
  height: 8px;
  background: var(--cc);
  border-top: 2px solid #37365e;
  transform: rotate(45deg);
}
.chip i:before {
  left: 1px;
}
.chip i:after {
  right: 1px;
}
.stage.wide .score {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  gap: 7px;
}
.stage.wide .info {
  gap: 12px;
}
.overlay {
  background: rgba(53, 53, 105, 0.3);
}
.card {
  background: #f9f9ff;
  color: #343363;
  border-color: #8c90c7;
  box-shadow:
    0 10px 0 #b8bce1,
    0 20px 50px #555a9b44;
}
.big-title span {
  text-shadow: 0 3px 0 #7776ac;
}
.sticker {
  background: #ffda58;
  color: #343363 !important;
  box-shadow: 0 3px 0 #e9b935;
}
.seat.off {
  background: #e2e4fa;
  color: #777bad;
}
.ghost {
  color: #343363;
  background: #e8e9fa;
}
.rules b {
  color: #343363;
}

@media (max-width: 620px) {
  .tray {
    gap: 8px;
    padding: 8px 10px;
    max-width: 100%;
  }
  .dice-btn {
    width: 76px;
    height: 76px;
    flex-shrink: 0;
  }
  .info {
    min-width: 0;
  }
  .turn {
    font-size: 19px;
  }
  .hint {
    font-size: 12px;
  }
  .score {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
    width: 100%;
  }
  .chip {
    min-width: 0;
    padding: 3px 4px;
    gap: 2px;
    font-size: 11px;
  }
  .chip i {
    width: 14px;
    height: 13px;
    flex: none;
  }
  .chip i:before,
  .chip i:after {
    width: 5px;
    height: 5px;
    top: -2px;
  }
}

.stage.wide .tray {
  width: 300px;
  padding: 57px 20px 27px;
  border: 0;
  background: transparent;
  box-shadow: none;
  isolation: isolate;
  gap: 17px;
}
.cat-panel {
  display: none;
}
.stage.wide .cat-panel {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  filter: drop-shadow(0 12px 16px #777db638);
}
.stage.wide .tray:before,
.stage.wide .tray:after {
  display: none;
}
.stage.wide .dice-btn {
  width: 146px;
  height: 146px;
  background: #e3e4fc;
  box-shadow:
    0 0 0 6px #eeeefe,
    inset 0 0 0 3px #bfc4eb;
}
.stage.wide .turn {
  min-width: 175px;
  font-size: 25px;
  padding: 13px 18px;
}
.stage.wide .hint {
  font-size: 16px;
  line-height: 1.25;
}
.stage.wide .score {
  gap: 9px;
}
.stage.wide .chip {
  padding: 6px 12px;
  font-size: 17px;
  min-height: 32px;
}
.stage.wide .chip i {
  width: 36px;
  height: 34px;
}
.chip i {
  display: inline-block;
  background: none !important;
  box-shadow: none !important;
  border-radius: 0;
}
.chip i:before,
.chip i:after {
  display: none;
}
@media (max-width: 620px) {
  .chip i {
    width: 20px;
    height: 20px;
  }
  .tray {
    isolation: isolate;
  }
}

@media (min-width: 1000px) {
  .stage.wide {
    padding-left: 70px;
  }
  .stage.wide .tray {
    width: 320px;
    padding: 65px 22px 34px;
    gap: 19px;
  }
  .stage.wide .dice-btn {
    width: 150px;
    height: 150px;
  }
  .stage.wide .hint {
    font-size: 18px;
    max-width: 210px;
  }
  .stage.wide .turn {
    font-size: 27px;
    min-width: 185px;
  }
  .stage.wide .chip {
    font-size: 18px;
    min-height: 39px;
  }
  .stage.wide .chip i {
    width: 38px;
    height: 38px;
  }
}
.stage.wide .dice-btn {
  background: linear-gradient(135deg, #eeedff, #d4d5f4);
  box-shadow:
    0 0 0 6px #f3f1ff,
    inset 0 2px 2px #fff,
    inset 0 -3px 4px #bfc1e4,
    0 8px 13px #777da52b;
}
.chip i canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.seat-cat {
  width: 40px;
  height: 34px;
  flex: none;
}
.seat.off .seat-cat {
  filter: grayscale(1);
  opacity: 0.55;
}
@media (max-height: 500px) and (min-width: 621px) {
  .stage.wide .tray {
    padding: 36px 16px 18px;
    gap: 8px;
  }
  .stage.wide .dice-btn {
    width: 95px;
    height: 95px;
  }
  .stage.wide .info {
    gap: 6px;
  }
  .stage.wide .turn {
    font-size: 20px;
    padding: 8px 13px;
  }
  .stage.wide .hint {
    font-size: 12px;
  }
  .stage.wide .score {
    gap: 5px;
  }
  .stage.wide .chip {
    font-size: 14px;
    min-height: 24px;
    padding: 4px 10px;
  }
  .stage.wide .chip i {
    width: 26px;
    height: 25px;
  }
}
/* Tutorial coach: Mia talks from a bubble over the top of the board. */
.coach {
  position: fixed;
  z-index: 4;
  transform: translateX(-50%);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 8px;
  border-radius: 22px;
  background: #fffdf9;
  border: 3px solid #8c90c7;
  box-shadow:
    0 8px 0 #d9dbf5,
    0 14px 26px #5b5f9e40;
  color: #343363;
  font-family: var(--font-body);
  pointer-events: auto;
}
.coach canvas {
  width: 76px;
  height: 60px;
  flex: none;
}
.coach-body {
  flex: 1;
  min-width: 0;
}
.coach p {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
  font-weight: 600;
}
.coach-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}
#coachNext {
  border: 0;
  border-radius: 999px;
  padding: 8px 18px;
  min-height: 40px;
  background: linear-gradient(#ffd75a, #ffb51e);
  box-shadow: 0 4px 0 #d38a12;
  color: #4a2c00;
  font: 700 15px/1 var(--font-body);
  cursor: pointer;
}
#coachNext:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #d38a12;
}
#coachSkip {
  border: 0;
  background: none;
  color: #7c78a8;
  font: 600 13px/1 var(--font-body);
  text-decoration: underline;
  cursor: pointer;
  padding: 8px 4px;
  min-height: 40px;
}
.coach-pop {
  animation: coach-pop 0.32s cubic-bezier(0.2, 0.8, 0.25, 1.3);
}
@keyframes coach-pop {
  0% {
    transform: translateX(-50%) scale(0.92);
  }
  60% {
    transform: translateX(-50%) scale(1.03);
  }
  100% {
    transform: translateX(-50%) scale(1);
  }
}
@media (max-width: 480px) {
  .coach p {
    font-size: 14px;
  }
  .coach canvas {
    width: 56px;
    height: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .coach-pop {
    animation: none;
  }
}
/* A soft sun patch drifting over the garden; transform-only so the compositor does the work. */
.sunlight {
  position: fixed;
  left: -30vmax;
  top: -30vmax;
  width: 110vmax;
  height: 110vmax;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    circle at center,
    rgba(255, 246, 214, 0.2),
    rgba(255, 246, 214, 0) 60%
  );
  animation: sun-drift 70s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes sun-drift {
  0% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(28vw, 8vh);
  }
  100% {
    transform: translate(8vw, 22vh);
  }
}
@media (prefers-reduced-motion: reduce) {
  .sunlight {
    animation: none;
  }
}
#coachCat.talking {
  animation: mia-talk 0.55s ease-in-out infinite;
  transform-origin: 50% 90%;
}
@keyframes mia-talk {
  0%,
  100% {
    transform: rotate(-3deg);
  }
  50% {
    transform: rotate(3deg) translateY(-2px);
  }
}
@media (prefers-reduced-motion: reduce) {
  #coachCat.talking {
    animation: none;
  }
}
/* The illustrated pad is the point that lands on the tutorial target. */
.tut-paw {
  position: fixed;
  left: 0;
  top: 0;
  width: 76px;
  height: 83px;
  z-index: 4;
  pointer-events: none;
  filter: drop-shadow(0 6px 6px rgba(52, 51, 99, 0.3));
}
.tut-paw img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  animation: paw-tap 0.9s ease-in-out infinite;
  transform-origin: 42% 70%;
}
@keyframes paw-tap {
  0%,
  100% {
    transform: translate(10px, -12px) rotate(-4deg);
  }
  45% {
    transform: translate(0, 0) scale(0.96);
  }
  60% {
    transform: translate(0, 0) scale(0.96);
  }
}
@media (prefers-reduced-motion: reduce) {
  .tut-paw img {
    animation: none;
  }
}
/* In-game settings reuse the menu overlay without its own backdrop; the board stays visible behind the card. */
#setup.in-game {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#btnSettings svg {
  width: 20px;
  height: 20px;
}
.aux-jump {
  width: 100%;
  margin-bottom: 12px;
}
/* Tap-to-start: first screen, sits over the blurred garden until the player taps (unlocks audio). */
.tap-start {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: #fff;
  font: 700 clamp(26px, 5vw, 40px)/1.1 var(--font-display);
  background: radial-gradient(
    circle at 50% 55%,
    rgba(255, 255, 255, 0) 0,
    rgba(70, 50, 130, 0.28) 100%
  );
  transition: opacity 0.22s;
}
.tap-start .tap-label {
  text-shadow:
    0 3px 0 rgba(86, 62, 150, 0.55),
    0 0 24px rgba(255, 255, 255, 0.55);
  animation: tap-pulse 1.6s ease-in-out infinite;
}
.tap-paw {
  display: block;
  width: clamp(72px, 14vw, 112px);
  height: clamp(72px, 14vw, 112px);
  color: #fff;
  filter: drop-shadow(0 6px 0 rgba(86, 62, 150, 0.5));
  animation: tap-bounce 1.6s ease-in-out infinite;
}
.tap-paw svg {
  width: 100%;
  height: 100%;
  display: block;
}
.tap-start:focus-visible {
  outline: 4px solid #fff;
  outline-offset: -12px;
}
.tap-start.tap-leaving {
  opacity: 0;
}
body.tap-wait #setup .menu-shell,
body.tap-wait #setup .menu-hud {
  visibility: hidden;
}
@keyframes tap-pulse {
  0%,
  100% {
    opacity: 0.75;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}
@keyframes tap-bounce {
  0%,
  100% {
    transform: translateY(0) rotate(-6deg);
  }
  50% {
    transform: translateY(-10px) rotate(6deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .tap-start .tap-label,
  .tap-paw {
    animation: none;
  }
}
/* In-game logo is a little larger on desktop so the brand stays readable. */
@media (min-width: 900px) {
  .logo .hud-logo {
    width: 150px;
    height: 72px;
  }
  .top {
    height: 76px;
  }
}

.garden-foreground {
  position: fixed;
  left: -20px;
  bottom: -20px;
  width: 150px;
  z-index: 2;
  pointer-events: none;
  transition: transform 0.5s ease-out;
}
.garden-foreground[hidden] {
  display: none;
}
.garden-foreground img {
  display: block;
  width: 100%;
  transform-origin: 8% 96%;
  animation: garden-breeze 8s ease-in-out infinite;
  filter: drop-shadow(2px 5px 3px #3e494027);
}
@keyframes garden-breeze {
  0%,
  100% {
    transform: rotate(-1.8deg);
  }
  50% {
    transform: rotate(1.8deg) translateY(-1px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .garden-foreground {
    transition: none;
  }
  .garden-foreground img {
    animation: none;
  }
}
/* Color symbols (accessibility option): a small white badge with one shape per color. */
.chip i {
  position: relative;
}
.chip .sym {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 16px;
  height: 16px;
}
.seat .sym {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
}

/* End of css/game.css */
