@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/baloo-2-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/baloo-2-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/baloo-2-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("fonts/baloo-2-latin-800-normal.woff2") format("woff2");
}
:root {
  --ink: #0f1b30;
  --ink-2: #16294a;
  --panel: rgba(255, 252, 244, 0.97);
  --text: #1d2a44;
  --muted: #6b7690;
  --sun: #ffd23f;
  --coral: #ff5a5f;
  --teal: #4ecdc4;
  --grass: #5cbf5a;
  --violet: #9b5cff;
  --radius: 22px;
  /* design system tokens: a season changes these on body, not the rules that use them */
  --button: #efe6cf;
  --button-lip: #cbbd98;
  --button-text: var(--text);
  --primary: var(--grass);
  --primary-lip: #2f8a3a;
  --secondary: var(--sun);
  --secondary-lip: #c99700;
  --on-secondary: var(--text);
  --on-daily: #3a2600;
  --panel-bg: var(--panel);
  --panel-text: var(--text);
  --panel-muted: var(--muted);
  --panel-shadow: 0 8px 0 #c9b98f, 0 24px 60px rgba(0, 0, 0, 0.45);
  --screen-bg: radial-gradient(
    ellipse at center,
    rgba(15, 27, 48, 0.45),
    rgba(15, 27, 48, 0.85)
  );
  --overlay-bg: rgba(15, 27, 48, 0.55);
  --close: #efe6cf;
  --close-hover: #e6dabd;
  --close-text: buttontext;
  --dock-group: rgba(0, 0, 0, 0.05);
  --dock: #fff;
  --dock-lip: #e2d8bd;
  --dock-text: var(--text);
  --dot: var(--coral);
  --input: #fff;
  --input-line: #e3dcc8;
  --input-text: var(--text);
  --name-input: #fffdf3;
  --name-line: var(--sun);
  --home-player: rgba(0, 0, 0, 0.06);
  --home-label: #b0373c;
  --tabs: #efe6cf;
  --tab-lip: #d8cfb5;
  font-family: "Baloo 2", ui-rounded, system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
canvas#game {
  position: fixed;
  inset: 0;
  display: block;
  touch-action: none;
  cursor: crosshair;
}
button {
  font: inherit;
  cursor: pointer;
}
input {
  font: inherit;
}

/* ---------- screens ---------- */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
  background: var(--screen-bg);
  backdrop-filter: blur(3px);
  overflow-y: auto;
}
.screen.active {
  display: flex;
}
/* only the content fades in: fading the whole screen made its dark backdrop vanish for a moment
   on every menu switch (the old screen goes at once), which flashed the bright background */
:where(.screen.active) > * {
  animation: fade 0.25s ease; /* zero specificity: a child's own animation (panel pop, floaty bob) wins */
}
/* menus on top of the main menu (shop, profile…) work the same way: switching from one to the
   next must not lose the dark layer for a moment, or the level flashes through */
.screen.overlay {
  background: var(--overlay-bg);
}
@keyframes fade {
  from {
    opacity: 0;
  }
}

.panel {
  position: relative;
  width: min(440px, 100%);
  --muted: var(--panel-muted);
  background: var(--panel-bg);
  color: var(--panel-text);
  border-radius: var(--radius);
  padding: 28px 26px 22px;
  text-align: center;
  box-shadow: var(--panel-shadow);
  animation: pop 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
  margin: auto;
}
.panel.wide {
  width: min(860px, 100%);
}
@keyframes pop {
  from {
    transform: scale(0.9) translateY(10px);
    opacity: 0;
  }
}

.logo {
  margin: 0;
  line-height: 0.85;
  font-size: clamp(56px, 13vw, 84px);
  font-weight: 800;
  letter-spacing: -1px;
}
.logo span {
  display: block;
}
.logo span:first-child {
  color: var(--grass);
  text-shadow: 0 5px 0 #2f8a3a;
  transform: rotate(-3deg);
}
.logo span:last-child {
  color: var(--coral);
  text-shadow: 0 5px 0 #b8343a;
  transform: rotate(2deg) translateX(18px);
}
.tag {
  color: var(--muted);
  margin: 14px 0 18px;
  font-size: 17px;
  line-height: 1.3;
}
.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}
h2 {
  margin: 0 0 12px;
  font-size: 32px;
  line-height: 1.1;
}
h3 {
  margin: 18px 0 6px;
  font-size: 16px;
  color: var(--muted);
  font-weight: 600;
}

.field {
  display: block;
  text-align: left;
  margin-bottom: 14px;
}
.field span {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 4px 6px;
}
input#name,
input#code {
  width: 100%;
  border: 3px solid var(--input-line);
  background: var(--input);
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 20px;
  font-weight: 600;
  color: var(--input-text);
  outline: none;
  transition: border-color 0.15s;
}
input:focus {
  border-color: var(--teal) !important;
}
input#code {
  text-transform: uppercase;
  letter-spacing: 6px;
  text-align: center;
  font-weight: 800;
  width: auto;
  flex: 1;
  min-width: 0;
}
.shake {
  animation: shake 0.4s;
  border-color: var(--coral) !important;
}
@keyframes shake {
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}

.btn-row {
  display: flex;
  gap: 10px;
}
.join-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.btn {
  flex: 1;
  border: 0;
  border-radius: 14px;
  padding: 11px 16px;
  font-size: 19px;
  font-weight: 800;
  color: var(--button-text);
  background: var(--button);
  box-shadow: 0 4px 0 var(--button-lip);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
}
/* these stay light in every season */
.btn:is(.google, .ad-google, .ghost-red, .target, .danger) {
  --button-text: var(--text);
  --button-lip: #cbbd98;
}
.btn:hover {
  filter: brightness(1.04);
}
.btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--button-lip);
}
.btn:disabled {
  opacity: 0.55;
  pointer-events: none;
}
.btn.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 0 var(--primary-lip);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}
.btn.primary:active {
  box-shadow: 0 1px 0 var(--primary-lip);
}
.btn.secondary {
  --button-text: var(--on-secondary);
  background: var(--secondary);
  box-shadow: 0 4px 0 var(--secondary-lip);
  flex: 0 0 auto;
  padding: 11px 22px;
}
.btn.small {
  flex: none;
  font-size: 15px;
  padding: 6px 14px;
}
.btn.big {
  width: 100%;
  font-size: 24px;
  padding: 14px;
  margin-top: 16px;
}
.pf-account {
  display: grid;
  gap: 10px;
  margin: 4px 0 14px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 3px solid #fff;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12);
  text-align: left;
}
.pf-account.guest {
  background: #fff4d6;
}
.pf-account.in {
  grid-template-columns: 1fr auto;
  align-items: center;
  background: #e3f7e8;
}
.pf-account small {
  display: block;
  opacity: 0.8;
  margin-top: 2px;
}
.pf-signin {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pf-signin input {
  flex: 1 1 200px;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 12px;
  border: 2px solid #d9cfb8;
  font: inherit;
}
.btn.google {
  justify-self: start;
  background: #fff;
}
.g-logo {
  font-weight: 800;
  color: #4285f4;
}
.pf-msg {
  margin: 0;
  color: #c0392b;
}
.pf-msg.ok {
  color: #1e7f43;
}
.gift-panel {
  max-width: 460px;
  text-align: center;
}
.gift-note {
  font-size: 17px;
  white-space: pre-line;
}
.gift-items {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 16px;
}
.gift-item {
  display: flex;
  flex-direction: column;
  padding: 8px 14px;
  border-radius: 14px;
  background: #fff4d6;
  border: 3px solid #fff;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.15);
}
.gift-item small {
  opacity: 0.7;
}
.btn.ghost {
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 16px;
  margin-top: 8px;
  width: 100%;
}
.note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  margin: 12px 0 0;
  min-height: 1em;
}
.note:empty {
  display: none;
}

.howto {
  text-align: left;
  margin-top: 14px;
  background: #f3ecd9;
  border-radius: 14px;
  padding: 8px 14px;
  font-size: 15px;
}
.howto summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
}
.howto ul {
  padding-left: 18px;
  margin: 8px 0 4px;
  line-height: 1.45;
}
.howto .q {
  background: var(--sun);
  border-radius: 5px;
  padding: 0 6px;
}

.code-big {
  font-size: 76px;
  font-weight: 800;
  letter-spacing: 12px;
  line-height: 1;
  margin: 4px 0 10px;
  color: var(--violet);
  text-shadow: 0 5px 0 #5d2fb3;
  padding-left: 12px;
}
.plist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}
.plist li {
  background: #fff;
  border-radius: 12px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}
.plist em {
  font-style: normal;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  background: #f1ead6;
  border-radius: 6px;
  padding: 1px 6px;
}
.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
}

/* ---------- HUD ---------- */
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  display: none;
  z-index: 5;
}
#hud.active {
  display: block;
}
.hud-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.pill {
  background: rgba(255, 252, 244, 0.95);
  border-radius: 14px;
  padding: 6px 14px;
  font-size: 17px;
  font-weight: 600;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}
.pill b {
  font-weight: 800;
}
.pill span {
  color: var(--muted);
}
.pill.strokes {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.pill.strokes b {
  font-size: 22px;
  line-height: 1;
}
#hud-players {
  margin-left: auto;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 55%;
}
.pchip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 27, 48, 0.75);
  color: #fff;
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 15px;
  font-weight: 600;
}
.pchip.me {
  background: rgba(255, 252, 244, 0.95);
  color: var(--text);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
}
.pchip .ps {
  font-weight: 800;
}
.pchip .pst {
  font-size: 12px;
  opacity: 0.8;
  min-width: 0;
}
#fx {
  position: absolute;
  top: 62px;
  left: 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.fx {
  border-radius: 10px;
  padding: 3px 10px;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  animation: pop 0.3s;
}
.fx.good {
  background: var(--grass);
}
.fx.bad {
  background: #3b8fd6;
}
.fx.warn {
  background: var(--coral);
}
.fx.combo {
  background: linear-gradient(90deg, #ff8a3d, #ffd23f);
  color: #2b2160;
}
/* Curveball: tap to switch the bend */
.fx.fx-btn {
  border: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
}
.toast b.combo {
  color: #ffd23f;
}
.toast .combo-ico {
  width: 44px;
  height: 44px;
  vertical-align: middle;
  margin-right: 6px;
}

.hud-bottom {
  position: absolute;
  left: 12px;
  right: 12px;
  /* the HUD stickers overhang their buttons, so leave room above the screen edge / home bar */
  bottom: calc(20px + env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
}
.hud-left {
  position: absolute;
  left: 0;
  bottom: 0;
  display: flex;
  gap: 6px;
}
.icon-btn {
  pointer-events: auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 0;
  background: rgba(255, 252, 244, 0.95);
  font-size: 18px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
}
.hint {
  position: absolute;
  right: 0;
  bottom: 6px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
  font-weight: 600;
}
#inv {
  display: flex;
  gap: 10px;
  pointer-events: auto;
}
.slot {
  position: relative;
  width: 74px;
  height: 66px;
  border-radius: 16px;
  border: 0;
  background: rgba(255, 252, 244, 0.95);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s;
  animation: pop 0.3s;
}
.slot:hover:not(:disabled) {
  transform: translateY(-3px);
}
.slot.empty {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
  animation: none;
}
.slot.attack {
  background: #ffe1e1;
}
.slot .ico {
  font-size: 28px;
  line-height: 1;
}
.slot .lbl {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 3px;
}
.slot .key {
  position: absolute;
  top: 3px;
  left: 7px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}
.slot.empty .key {
  color: rgba(255, 255, 255, 0.4);
}

#banner {
  position: fixed;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #fff;
  pointer-events: none;
  z-index: 6;
  opacity: 0;
}
#banner.go {
  animation: banner 2.2s ease forwards;
}
@keyframes banner {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.8);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  75% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -60%);
  }
}
.b-hole {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--sun);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.4);
}
.b-name {
  font-size: clamp(44px, 9vw, 72px);
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 5px 0 rgba(0, 0, 0, 0.35);
}
.b-par {
  font-size: 22px;
  font-weight: 700;
  opacity: 0.85;
}

#toasts {
  position: fixed;
  top: 134px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  z-index: 20;
  pointer-events: none;
  width: max-content;
  max-width: 92vw;
}
.toast {
  background: rgba(255, 252, 244, 0.97);
  color: var(--text);
  border-radius: 14px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 16px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
  animation: pop 0.3s;
  transition: opacity 0.4s, transform 0.4s;
  text-align: center;
}
.toast.hit {
  background: #ffe1e1;
}
.toast.warn {
  background: var(--sun);
}
.toast.out {
  opacity: 0;
  transform: translateY(-8px);
}

/* ---------- scorecard ---------- */
.close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 0;
  background: var(--close);
  color: var(--close-text);
  font-size: 16px;
}
.table-wrap {
  overflow-x: auto;
}
table {
  border-collapse: separate;
  border-spacing: 3px;
  width: 100%;
  font-size: 16px;
}
th {
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}
td,
th {
  padding: 5px 4px;
  text-align: center;
  min-width: 30px;
  border-radius: 8px;
}
td:first-child {
  text-align: left;
  font-weight: 700;
  white-space: nowrap;
  display: flex;
  gap: 8px;
  align-items: center;
  padding-right: 10px;
}
tr.par td {
  color: var(--muted);
  font-size: 14px;
}
tbody tr:not(.par) td {
  background: #fff;
}
tr.me td:first-child {
  color: var(--violet);
}
td.cur,
th.cur {
  box-shadow: inset 0 0 0 2px var(--sun);
}
td.ace {
  background: var(--sun) !important;
  font-weight: 800;
}
td.under {
  background: #c8f0c3 !important;
  font-weight: 800;
}
td.over {
  background: #ffe1e1 !important;
}
td.tot {
  font-weight: 800;
  white-space: nowrap;
}
td.tot small {
  color: var(--muted);
  font-weight: 600;
}
.live {
  color: var(--muted);
  font-style: italic;
}

.final {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 8px;
}
.final li {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 20px;
  font-weight: 700;
}
.final li.me {
  box-shadow: inset 0 0 0 3px var(--violet);
}
.final .rank {
  width: 32px;
  font-size: 24px;
}
.final .fn {
  flex: 1;
  text-align: left;
}
.final .ft {
  font-weight: 800;
}
.final .fd {
  color: var(--muted);
  width: 40px;
  text-align: right;
  font-size: 16px;
}
.final-actions {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}
.final-actions .btn {
  width: 100%;
  margin: 0;
}
.final-actions .btn.primary {
  font-size: 24px;
  padding: 14px;
}
.final-actions .note {
  margin: 0;
}
.final-actions [hidden] {
  display: none;
}

@media (max-width: 640px) {
  .hud-top {
    top: 8px;
    left: 8px;
    right: 8px;
    gap: 6px;
  }
  .pill {
    font-size: 14px;
    padding: 4px 10px;
  }
  #hud-players {
    max-width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    width: 100%;
    order: 3;
  }
  .pchip {
    font-size: 13px;
    padding: 2px 8px;
  }
  #fx {
    top: auto;
    bottom: 92px;
  }
  .hint {
    display: none;
  }
  .hud-bottom {
    justify-content: flex-end;
  }
  .slot {
    width: 56px;
    height: 54px;
  }
  .slot .lbl {
    font-size: 10px;
  }
  .slot .ico {
    font-size: 23px;
  }
  #inv {
    gap: 6px;
  }
  .icon-btn {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }
  .hud-left {
    gap: 4px;
  }
  .code-big {
    font-size: 60px;
  }
}

/* ---------- v1.4 ---------- */
.skip-btn {
  position: absolute;
  right: 16px;
  bottom: 96px;
  pointer-events: auto;
  border: 0;
  border-radius: 14px;
  padding: 8px 16px;
  font-size: 18px;
  font-weight: 800;
  background: var(--sun);
  color: #3a2600;
  box-shadow: 0 4px 0 #c99700;
  animation: pop 0.3s;
}
.skip-btn[hidden] {
  display: none;
}
.pass-btn {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 4px 0 #b83a3e;
}
.skip-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #c99700;
}
#celebrate {
  position: fixed;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  z-index: 7;
  pointer-events: none;
  text-align: center;
  opacity: 0;
}
#celebrate.go {
  animation: celeb 2.6s cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
}
#celebrate .c-label {
  font-size: clamp(40px, 9vw, 76px);
  font-weight: 800;
  line-height: 1;
  color: var(--sun);
  text-shadow: 0 5px 0 rgba(0, 0, 0, 0.35);
}
#celebrate .c-who {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.4);
}
#celebrate.t3 .c-label {
  font-size: clamp(48px, 11vw, 96px);
  color: #7bf0ff;
}
#celebrate.t4 .c-label {
  font-size: clamp(54px, 13vw, 120px);
  background: linear-gradient(
    90deg,
    #ff5a5f,
    #ffd23f,
    #7bd389,
    #4ecdc4,
    #9b5cff,
    #ff5a5f
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 5px 0 rgba(0, 0, 0, 0.35));
  animation: rainbow 0.8s linear infinite;
}
#celebrate.t4.go {
  animation-duration: 3.6s;
}
@keyframes celeb {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3) rotate(-8deg);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08) rotate(2deg);
  }
  25% {
    transform: translate(-50%, -50%) scale(1);
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -62%) scale(1);
  }
}
@keyframes rainbow {
  to {
    background-position: 200% 0;
  }
}
.whatsnew {
  margin-top: 12px;
}
.whatsnew summary b {
  color: var(--violet);
}
.whatsnew ul {
  font-size: 14px;
}
@media (max-width: 640px) {
  .skip-btn {
    bottom: 140px;
    right: 10px;
  }
}

/* ---------- splash ---------- */
#splash {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #0f1b30;
  cursor: pointer;
  touch-action: none;
  clip-path: circle(150% at var(--ix, 50%) var(--iy, 50%));
  transition: clip-path 0.7s cubic-bezier(0.6, 0, 0.4, 1);
}
#splash canvas {
  display: block;
}
#splash.leaving {
  clip-path: circle(0% at var(--ix, 50%) var(--iy, 50%));
}

/* ---------- what's new tour ---------- */
#tour {
  position: fixed;
  inset: 0;
  z-index: 60;
  color: #fff;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.4s, clip-path 0.6s cubic-bezier(0.6, 0, 0.4, 1);
  clip-path: circle(150% at 90% 84%);
  touch-action: pan-y;
}
#tour.in {
  opacity: 1;
}
#tour.leaving {
  clip-path: circle(0% at 90% 84%);
}
.tour-cv {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.tour-skip {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  z-index: 2;
  border: 0;
  border-radius: 999px;
  padding: 7px 14px;
  font: inherit;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  background: rgba(15, 27, 48, 0.45);
  backdrop-filter: blur(6px);
  cursor: pointer;
}
.tour-skip:hover {
  background: rgba(15, 27, 48, 0.7);
}
.tour-stage {
  position: absolute;
  inset: 0 0 26% 0;
  display: grid;
  place-items: center;
  padding: 56px 18px 0;
}
.tour-slide {
  grid-area: 1 / 1;
  width: min(640px, 100%);
  text-align: center;
  opacity: 0;
  transform: translateX(60px);
  pointer-events: none;
  transition: opacity 0.35s, transform 0.45s cubic-bezier(0.3, 1.2, 0.5, 1);
}
.tour-slide.left {
  transform: translateX(-60px);
}
.tour-slide.on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.tour-hero {
  display: flex;
  justify-content: center;
  gap: clamp(6px, 2vw, 18px);
  font-size: clamp(42px, 9vw, 72px);
  line-height: 1;
  margin-bottom: 8px;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.25));
}
.tour-slide.big .tour-hero {
  font-size: clamp(56px, 13vw, 104px);
}
.tour-hero span {
  display: inline-block;
}
.tour-art {
  margin: 0 auto 4px;
  display: flex;
  justify-content: center;
}
.tour-art img {
  display: block;
  width: min(560px, 86vw);
  max-height: 34vh;
  object-fit: contain;
  filter: drop-shadow(0 10px 0 rgba(15, 27, 48, 0.25))
    drop-shadow(0 18px 30px rgba(15, 27, 48, 0.35));
}
.tour-slide.has-art .tour-hero {
  display: none;
}
.tour-slide:not(.has-art) .tour-art {
  display: none;
}
.tour-slide.on .tour-art {
  animation: tour-pop 0.6s cubic-bezier(0.3, 1.6, 0.5, 1) both,
    tour-float 3.2s ease-in-out 0.6s infinite;
}
@keyframes tour-float {
  50% {
    transform: translateY(-8px);
  }
}
.tour-slide.on .tour-hero span {
  animation: tour-pop 0.55s cubic-bezier(0.3, 1.8, 0.5, 1) both,
    tour-bob 2.4s ease-in-out infinite;
  animation-delay: calc(var(--k) * 0.09s), calc(0.6s + var(--k) * 0.3s);
}
@keyframes tour-pop {
  from {
    transform: scale(0) rotate(-25deg);
  }
}
@keyframes tour-bob {
  50% {
    transform: translateY(-8px) rotate(4deg);
  }
}
.tour-title {
  margin: 0 0 6px;
  font-size: clamp(36px, 7.5vw, 64px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.5px;
}
.tour-slide.big .tour-title {
  font-size: clamp(42px, 10vw, 84px);
}
.tour-title span {
  display: inline-block;
  color: var(--c);
  text-shadow: 0 5px 0 rgba(0, 0, 0, 0.35), 0 0 30px rgba(0, 0, 0, 0.2);
}
.tour-slide.on .tour-title span {
  animation: tour-drop 0.6s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}
.tour-slide.on .tour-title span:nth-child(2) {
  animation-delay: 0.08s;
}
.tour-slide.on .tour-title span:nth-child(3) {
  animation-delay: 0.16s;
}
@keyframes tour-drop {
  from {
    transform: translateY(-40px) scale(0.8);
    opacity: 0;
  }
}
.tour-sub {
  margin: 0 auto 14px;
  max-width: 640px;
  font-size: clamp(16px, 2.6vw, 20px);
  font-weight: 700;
  color: #fff6e6;
  text-shadow: 0 2px 0 rgba(15, 27, 48, 0.75), 0 0 14px rgba(15, 27, 48, 0.85);
}
.tour-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  text-align: left;
}
.tour-slide:first-child .tour-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.tour-chips li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 14px;
  background: rgba(15, 27, 48, 0.7);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
  font-size: clamp(14px, 2.3vw, 17px);
  font-weight: 700;
  line-height: 1.25;
}
.tour-chips li span {
  font-size: 1.35em;
  flex: none;
}
.tour-slide.on .tour-chips li {
  animation: tour-chip 0.45s cubic-bezier(0.3, 1.4, 0.5, 1) both;
  animation-delay: calc(0.25s + var(--k) * 0.08s);
}
@keyframes tour-chip {
  from {
    transform: translateY(14px);
    opacity: 0;
  }
}
.tour-go {
  margin-top: 10px;
  border: 0;
  border-radius: 18px;
  padding: 14px 34px;
  font: inherit;
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  background: var(--grass);
  box-shadow: 0 6px 0 #2f8a3a, 0 12px 30px rgba(0, 0, 0, 0.35);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
  cursor: pointer;
  animation: tour-pulse 1.6s ease-in-out infinite;
}
.tour-go:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #2f8a3a;
}
@keyframes tour-pulse {
  50% {
    transform: scale(1.05);
  }
}
.tour-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 2;
}
.tour-nav {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  font: inherit;
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  background: var(--sun);
  box-shadow: 0 5px 0 #c99700;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
}
.tour-nav.back {
  background: #fff6e6;
  box-shadow: 0 5px 0 #cbbd98;
}
.tour-nav:active {
  transform: translateY(4px);
  box-shadow: none;
}
.tour-nav:disabled,
.tour-nav.hide {
  opacity: 0;
  pointer-events: none;
}
.tour-dots {
  display: flex;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 27, 48, 0.45);
}
.tour-dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: width 0.3s, background 0.3s;
}
.tour-dots button.done {
  background: rgba(255, 255, 255, 0.75);
}
.tour-dots button.on {
  width: 26px;
  background: var(--sun);
}
.news-tour {
  width: 100%;
  margin-bottom: 12px;
}
@media (max-height: 640px) {
  .tour-art img {
    max-height: 26vh;
  }
  .tour-stage {
    inset-block-end: 20%;
    padding-top: 44px;
  }
  .tour-hero {
    font-size: 40px;
  }
  .tour-chips li {
    padding: 6px 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tour-slide,
  .tour-slide.on .tour-hero span,
  .tour-slide.on .tour-title span,
  .tour-slide.on .tour-chips li,
  .tour-slide.on .tour-art,
  .tour-go {
    animation: none !important;
    transition: opacity 0.2s;
  }
}

/* ---------- v2: turns, power-ups, lobby, help, editor ---------- */
.screen.overlay {
  z-index: 30;
}
.small-row {
  margin-top: 12px;
}
.small-row .btn {
  flex: 1;
  font-size: 15px;
  padding: 7px 10px;
}
kbd {
  background: #fff;
  border: 1px solid #d8cfb5;
  border-bottom-width: 3px;
  border-radius: 6px;
  padding: 0 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.turn {
  position: absolute;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 27, 48, 0.82);
  color: #fff;
  border-radius: 16px;
  padding: 6px 16px;
  font-size: 17px;
  font-weight: 600;
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
  max-width: calc(100vw - 24px);
}
.turn:empty {
  display: none;
}
.turn.mine {
  background: rgba(255, 252, 244, 0.97);
  color: var(--text);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
}
.turn.done {
  background: var(--sun);
  color: #3a2600;
}
.turn .hint2 {
  color: var(--muted);
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.turn .tmr {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 0 8px;
  font-weight: 800;
  min-width: 38px;
  text-align: center;
}
.turn.mine .tmr {
  background: #efe6cf;
}
.turn .tmr.low {
  background: var(--coral);
  color: #fff;
  animation: pulse 0.6s infinite alternate;
}
@keyframes pulse {
  to {
    transform: scale(1.12);
  }
}
#fx {
  top: 100px;
}
/* chips are only as tall as their text: on phones #fx has a top and a bottom, and a stretched
   flex item (the Curveball button) filled the whole screen */
#fx {
  align-items: flex-start;
  align-content: flex-start;
}
#fx > .fx {
  align-self: flex-start;
  flex: none;
}
.pchip.is-turn {
  box-shadow: 0 0 0 2px var(--sun);
}
.pchip .pst {
  font-weight: 800;
  opacity: 1;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 0 5px;
}
.pchip.me .pst {
  background: #efe6cf;
}
.pchip .pfx {
  font-size: 13px;
}

.icon-btn.help {
  font-weight: 800;
  font-size: 20px;
  color: var(--violet);
}
.slot.wait {
  opacity: 0.55;
}
.slot.target,
.slot.global {
  background: #ffe1e1;
}
.slot.place {
  background: #ffe9cc;
}
.slot.active {
  box-shadow: 0 0 0 3px var(--sun), 0 4px 0 rgba(0, 0, 0, 0.3);
  transform: translateY(-4px);
}

.lobby-panel {
  width: min(520px, 100%);
}
.course-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.course {
  border: 0;
  border-radius: 14px;
  background: #fff;
  padding: 10px 12px;
  text-align: left;
  box-shadow: inset 0 0 0 2px #e8dfc7;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--text);
}
.course b {
  font-size: 17px;
}
.course span {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.2;
}
.course.sel {
  box-shadow: inset 0 0 0 3px var(--grass);
  background: #effaee;
}
.course:disabled {
  cursor: default;
  opacity: 0.8;
}
.course:disabled.sel {
  opacity: 1;
}
.course-summary {
  text-align: left;
}

.holes-panel {
  width: min(1000px, 100%);
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
}
.holes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  overflow-y: auto;
  padding: 4px;
  margin: 10px 0;
}
.hole-card {
  position: relative;
  border: 0;
  border-radius: 14px;
  background: #fff;
  padding: 6px;
  box-shadow: inset 0 0 0 2px #e8dfc7;
  text-align: left;
}
.hole-card canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}
.hole-card.sel {
  box-shadow: inset 0 0 0 3px var(--grass);
  background: #effaee;
}
.hc-label {
  padding: 4px 4px 0;
  display: flex;
  flex-direction: column;
}
.hc-label b {
  font-size: 15px;
  line-height: 1.15;
}
.hc-label span {
  font-size: 12px;
  color: var(--muted);
}
.hc-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--grass);
  color: #fff;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 0 #2f8a3a;
}
.hole-card.sel .hc-badge {
  display: flex;
}
.holes-foot {
  display: flex;
  gap: 10px;
  align-items: center;
}
.holes-foot span {
  flex: 1;
  text-align: left;
  color: var(--muted);
  font-weight: 700;
}
.holes-foot .btn {
  flex: none;
  width: auto;
  margin: 0;
}

.target-list {
  display: grid;
  gap: 8px;
  margin-bottom: 6px;
}
.btn.target {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: #fff;
  box-shadow: 0 4px 0 #ddd2b4;
}
.btn.target small {
  margin-left: auto;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}

.help-panel {
  width: min(900px, 100%);
  text-align: left;
  display: flex;
  flex-direction: column;
  height: min(680px, calc(100vh - 32px));
  height: min(680px, calc(100dvh - 32px));
  padding-bottom: 16px;
}
.help-panel h2,
.help-panel h3 {
  text-align: left;
  color: var(--text);
}
.help-panel h2 {
  margin-bottom: 10px;
}
.help-tabs {
  position: relative;
  display: flex;
  gap: 2px;
  background: var(--tabs);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.help-tabs::-webkit-scrollbar {
  display: none;
}
.help-tabs button {
  position: relative;
  z-index: 1;
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 7px 10px;
  font: inherit;
  font-weight: 800;
  font-size: 15px;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s;
}
.help-tabs button.on {
  color: var(--text);
}
.help-tab-ink {
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 0 #d8cfb5;
  transition: transform 0.3s cubic-bezier(0.3, 1.3, 0.5, 1), width 0.3s;
}
.help-view {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-radius: 14px;
}
.help-track {
  display: flex;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.3, 1, 0.4, 1);
}
.help-pane {
  flex: 0 0 100%;
  height: 100%;
  overflow-y: auto;
  padding: 2px 4px 8px 2px;
  overscroll-behavior: contain;
}
.help-lead {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
}
.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}
.help-card {
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
}
.help-card h4 {
  margin: 2px 0 4px;
  font-size: 18px;
}
.help-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  color: #3a4660;
}
.help-ico {
  font-size: 28px;
}
.pu-group + .pu-group {
  margin-top: 14px;
}
.pu-group h4,
.bio-card h5 {
  margin: 0 0 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text);
}
.pu-group h4 small,
.bio-card h5 small {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  color: var(--muted);
  margin-left: 6px;
}
.pu-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 8px;
}
.pu {
  display: flex;
  gap: 10px;
  background: #fff;
  border-radius: 12px;
  padding: 8px 10px;
  align-items: flex-start;
}
.pu.target,
.pu.global {
  background: #fff2f2;
}
.pu.place {
  background: #fff6e8;
}
.pu-ico {
  font-size: 26px;
  line-height: 1.2;
}
/* combos in the help: X + Y = Z */
.pu-ico.combo-sum {
  display: flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}
/* the + and = between the stickers: small badges on top, readable on any theme */
.combo-sum i {
  position: relative;
  z-index: 2;
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin: 0 1px;
  border-radius: 50%;
  background: var(--sun);
  color: #1d2a44;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
  font-style: normal;
  font-weight: 800;
  font-size: 15px;
  line-height: 1;
}
/* the stickers in a combo sum break out evenly on every side (not the card's top-left
   breakout), so the badges sit on their middle line with the same space either side */
.pu-ico.combo-sum .ico-img {
  margin: -12px -6px;
}
.pu-ico.combo-sum i {
  align-self: center;
  margin: 0 18px 0 8px; /* the next sticker's art starts at its box edge: more room on the right */
}
.pu-combos .pu-list {
  grid-template-columns: 1fr;
}
.pu b {
  font-size: 16px;
}
.pu p {
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
  color: #3a4660;
}
.hz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.hz {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  padding: 8px 10px;
}
.hz > span {
  font-size: 24px;
  line-height: 1;
}
.hz b {
  display: block;
  font-size: 15px;
}
.hz small {
  display: block;
  font-size: 13px;
  line-height: 1.25;
  color: #3a4660;
}

/* biomes slider */
.bio-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.bio-view {
  overflow: hidden;
  border-radius: 16px;
}
.bio-track {
  display: flex;
  align-items: flex-start;
  transition: transform 0.4s cubic-bezier(0.3, 1, 0.4, 1);
}
.bio-card {
  flex: 0 0 100%;
  border-radius: 16px;
  padding: 14px;
  color: var(--text);
}
.bio-card header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.bio-card h4 {
  margin: 0;
  font-size: 22px;
}
.bio-card header small {
  color: var(--muted);
  font-weight: 600;
}
.bio-ico {
  font-size: 40px;
  line-height: 1;
}
.bio-rule {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 700;
  font-size: 15px;
}
.bio-rule span {
  font-size: 20px;
}
.bio-card h5 {
  margin-top: 12px;
}
.bio-card .hz,
.bio-card .pu {
  color: var(--text);
}
.bio-desert {
  background: linear-gradient(160deg, #ffe7b3, #f6cf86);
}
.bio-night {
  background: linear-gradient(160deg, #2a2350, #141432);
  color: #f1ecff;
}
.bio-night h5,
.bio-night h4 {
  color: #fff;
}
.bio-night header small,
.bio-night h5 small {
  color: #b9b2e6;
}
.bio-night .bio-rule {
  background: rgba(255, 255, 255, 0.12);
}
.bio-jungle {
  background: linear-gradient(160deg, #c9ecb0, #8fcf7c);
}
.bio-haunted {
  background: linear-gradient(160deg, #d9d2ea, #9f93bd);
}
.bio-nav {
  flex: none;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #efe6cf;
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 3px 0 #cbbd98;
}
.bio-nav:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #cbbd98;
}
.bio-dots {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.bio-dots button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 2px solid transparent;
  background: #efe6cf;
  border-radius: 999px;
  padding: 5px 12px;
  font: inherit;
  font-weight: 800;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}
.bio-dots button span {
  font-size: 18px;
}
.bio-dots button.on {
  background: #fff;
  color: var(--text);
  border-color: var(--teal);
}
.keys-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
}
.keys-grid > div {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
}
.keys-grid span {
  margin-left: 6px;
  color: #3a4660;
  font-weight: 600;
}
@media (max-width: 560px) {
  .help-tabs button span {
    display: none;
  }
  .help-tabs button {
    font-size: 20px;
  }
  .bio-dots button b {
    display: none;
  }
}
.q {
  background: var(--sun);
  border-radius: 5px;
  padding: 0 6px;
}

/* editor */
.screen.editor {
  background: var(--ink);
  backdrop-filter: none;
  padding: 0;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  z-index: 40;
  overflow: hidden;
}
.ed-top {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255, 252, 244, 0.97);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
  flex-wrap: wrap;
}
.ed-name {
  border: 2px solid #e3dcc8;
  border-radius: 10px;
  padding: 4px 10px;
  font-size: 18px;
  font-weight: 700;
  width: 200px;
}
.ed-par {
  font-weight: 700;
  color: var(--muted);
}
.ed-par select {
  font: inherit;
  font-weight: 700;
  border-radius: 8px;
  border: 2px solid #e3dcc8;
  padding: 2px 4px;
}
.ed-spacer {
  flex: 1;
}
.ed-btn {
  border: 0;
  border-radius: 10px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 15px;
  background: #efe6cf;
  box-shadow: 0 3px 0 #cbbd98;
  color: var(--text);
}
.ed-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #cbbd98;
}
.ed-btn.save {
  background: var(--sun);
  box-shadow: 0 3px 0 #c99700;
}
.ed-btn.test {
  background: var(--grass);
  color: #fff;
  box-shadow: 0 3px 0 #2f8a3a;
}
.ed-btn.danger {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 3px 0 #b8343a;
  margin-top: 10px;
  width: 100%;
}
.ed-body {
  flex: 1;
  display: flex;
  min-height: 0;
}
.ed-tools {
  width: 112px;
  background: rgba(255, 252, 244, 0.08);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}
.ed-tool {
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 5px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}
.ed-tool span {
  font-size: 20px;
}
.ed-tool small {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.85;
}
.ed-tool.on {
  background: var(--sun);
  color: #3a2600;
}
.ed-opts {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  margin-top: 6px;
  display: grid;
  gap: 6px;
}
.ed-shape {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: none;
  gap: 4px;
  align-items: center;
  background: rgba(15, 27, 48, 0.85);
  border-radius: 12px;
  padding: 5px 6px;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}
.ed-shape span {
  padding: 0 6px;
  opacity: 0.8;
}
.ed-shape button {
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 4px 10px;
}
.ed-shape button.on {
  background: var(--teal);
  color: #0f1b30;
}
.ed-stage {
  flex: 1;
  position: relative;
  min-width: 0;
}
.ed-cv {
  position: absolute;
  inset: 0;
  touch-action: none;
  cursor: crosshair;
  display: block;
}
.ed-hint {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  background: rgba(15, 27, 48, 0.85);
  color: #fff;
  border-radius: 12px;
  padding: 5px 14px;
  font-weight: 600;
  font-size: 14px;
  pointer-events: none;
  max-width: 90%;
  text-align: center;
  transition: background 0.2s;
}
.ed-hint.flash {
  background: var(--grass);
}
.ed-props {
  width: 220px;
  background: rgba(255, 252, 244, 0.97);
  padding: 12px 14px;
  overflow-y: auto;
  font-size: 14px;
  color: #3a4660;
}
.ed-props h4 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--text);
}
.ed-props p {
  margin: 0 0 8px;
  line-height: 1.35;
}
.ed-sl {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
}
.ed-chk {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 10px;
  cursor: pointer;
}
.ed-chk input {
  margin-top: 3px;
}
.ed-chk small {
  opacity: 0.75;
}
.ed-sl span {
  display: flex;
  justify-content: space-between;
}
.ed-sl input {
  width: 100%;
  accent-color: var(--grass);
}
.ed-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 27, 48, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 5;
}
.ed-modal.on {
  display: flex;
}
.ed-modal-panel {
  width: min(640px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  text-align: left;
}
.ed-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 14px;
}
.ed-item {
  display: flex;
  gap: 12px;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  padding: 6px;
}
.ed-item canvas {
  width: 120px;
  height: auto;
  border-radius: 8px;
}
.ed-item > div:nth-child(2) {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.ed-item span {
  color: var(--muted);
  font-size: 13px;
}
.ed-item-btns {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.ed-item-btns .btn {
  flex: none;
}
.btn.ghost-red {
  background: #ffe1e1;
  box-shadow: 0 4px 0 #e8b9b9;
}
.ed-json {
  width: 100%;
  height: 180px;
  border-radius: 10px;
  border: 2px solid #e3dcc8;
  font: 12px ui-monospace, monospace;
  padding: 8px;
  margin-bottom: 10px;
}
.ed-base {
  font: inherit;
  padding: 4px;
  border-radius: 8px;
}
@media (max-width: 760px) {
  .ed-props {
    display: none;
  }
  .ed-tools {
    width: 76px;
  }
  .ed-tool small {
    display: none;
  }
  .ed-name {
    width: 130px;
  }
}
@media (max-width: 640px) {
  .turn {
    top: auto;
    bottom: 86px;
    font-size: 15px;
  }
  .turn .hint2 {
    display: none;
  }
  #fx {
    bottom: 128px;
  }
}

/* ---------- community holes ---------- */
.wn-prev {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}
#lobby-market-btn {
  margin-top: 8px;
}
.ed-btn.publish {
  background: var(--teal);
  color: #08403b;
  box-shadow: 0 3px 0 #2e9c94;
}
.market-panel {
  width: min(1040px, 100%);
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  text-align: left;
}
.market-panel h2 {
  text-align: left;
}
.mk-sub[data-offline="1"]::after {
  content: " (Offline mode: only holes published in this browser are shown.)";
  color: var(--coral);
}
.mk-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 12px 0 8px;
}
.mk-tabs {
  display: flex;
  gap: 4px;
  background: var(--tabs);
  border-radius: 12px;
  padding: 3px;
}
.mk-tabs button {
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: 4px 12px;
  font-weight: 700;
  color: var(--muted);
}
.mk-tabs button.on {
  background: #fff;
  color: var(--text);
  box-shadow: 0 2px 0 var(--tab-lip);
}
.mk-search {
  flex: 1;
  min-width: 160px;
  border: 2px solid #e3dcc8;
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 16px;
  outline: none;
}
.mk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  overflow-y: auto;
  padding: 4px;
}
.mk-grid > .note {
  grid-column: 1 / -1;
}
.mk-card {
  background: #fff;
  border-radius: 14px;
  padding: 8px;
  box-shadow: inset 0 0 0 2px #e8dfc7;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.mk-card canvas {
  width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
}
.mk-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.mk-info b {
  font-size: 17px;
}
.mk-info span {
  font-size: 13px;
  color: var(--muted);
}
.mk-info .mk-stats {
  font-weight: 700;
}
.mk-btns {
  display: flex;
  gap: 6px;
}
.mk-btns .btn {
  flex: 1;
  padding: 6px 8px;
  white-space: nowrap;
}
.mk-btns .mk-like {
  flex: none;
}
.mk-btns .btn.ghost-red {
  flex: none;
}
.mk-btns {
  flex-wrap: wrap;
}
.mk-card.hotw {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  box-shadow: inset 0 0 0 3px var(--sun);
  background: #fffbea;
  padding-top: 30px;
}
.mk-card.hotw canvas {
  width: min(320px, 45%);
}
.mk-card.hotw .mk-info {
  flex: 1;
}
.mk-card.hotw .mk-btns {
  flex-direction: column;
  min-width: 120px;
}
.mk-ribbon {
  position: absolute;
  top: 6px;
  left: 10px;
  font-weight: 800;
  font-size: 14px;
  color: #8a5a00;
}
.mk-remix {
  font-style: italic;
}
.mk-stars,
.hud-rate {
  display: inline-flex;
  align-items: center;
  gap: 1px;
}
.mk-stars button,
.hud-rate button {
  border: 0;
  background: none;
  padding: 0 1px;
  font-size: 18px;
  line-height: 1;
  color: #d9d0b8;
  cursor: pointer;
}
.mk-stars button.avg {
  color: #f5c96a;
}
.mk-stars button.on,
.hud-rate button.on {
  color: #ffb400;
}
.mk-stars:hover button,
.hud-rate:hover button {
  color: #ffb400;
}
.mk-stars button:hover ~ button,
.hud-rate button:hover ~ button {
  color: #d9d0b8;
}
.hud-rate {
  background: rgba(255, 252, 244, 0.95);
  border-radius: 14px;
  padding: 4px 10px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
  gap: 2px;
}
.hud-rate[hidden] {
  display: none;
}
.hud-rate span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-right: 4px;
}
.hud-rate button {
  font-size: 20px;
}
@media (max-width: 640px) {
  .mk-card.hotw {
    flex-direction: column;
    align-items: stretch;
  }
  .mk-card.hotw canvas {
    width: 100%;
  }
  .mk-card.hotw .mk-btns {
    flex-direction: row;
  }
}

/* ---------- v1.6: emotes ---------- */
.icon-btn.emote-btn.on {
  background: var(--sun);
}
.emote-bar {
  position: absolute;
  left: 12px;
  bottom: 66px;
  display: flex;
  gap: 6px;
  pointer-events: auto;
  background: rgba(15, 27, 48, 0.82);
  padding: 6px;
  border-radius: 16px;
  animation: pop 0.2s;
}
.emote-bar[hidden] {
  display: none;
}
.emote-bar .emote-close {
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  min-width: 34px;
}
.emote-bar button {
  border: 0;
  border-radius: 12px;
  background: rgba(255, 252, 244, 0.95);
  font-size: 20px;
  min-width: 42px;
  height: 40px;
  padding: 0 8px;
  font-weight: 800;
  color: var(--text);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
}
.emote-bar button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}
.emote-bar.cool {
  opacity: 0.5;
  pointer-events: none;
}
.emote-bar.cool::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 3px;
  height: 3px;
  border-radius: 2px;
  background: var(--sun);
  transform-origin: left;
  animation: emoteCool 2s linear forwards;
}
@keyframes emoteCool {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}
@media (max-width: 640px) {
  .emote-bar {
    bottom: 56px;
    left: 8px;
    gap: 4px;
  }
  .emote-bar button {
    min-width: 36px;
    height: 34px;
    font-size: 17px;
  }
}

/* ---------- v1.7: shop, profile, mystery ball, admin ---------- */
.coin-badge {
  background: var(--sun);
  color: #3a2600;
  border-radius: 8px;
  padding: 0 6px;
  font-size: 13px;
  margin-left: 4px;
}
.coin-badge:empty {
  display: none;
}
.rar {
  display: inline-block;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 6px;
  padding: 1px 7px;
  vertical-align: middle;
}
.shop-panel,
.profile-panel {
  width: min(980px, 100%);
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  text-align: left;
}
.shop-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.shop-head h2 {
  margin: 0;
  flex: 1;
  text-align: left;
}
.coins-pill {
  background: var(--sun);
  color: #3a2600;
  border-radius: 12px;
  padding: 4px 14px;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 3px 0 #c99700;
  margin-right: 44px;
}
.shop-panel .mk-tabs {
  align-self: flex-start;
  margin: 10px 0;
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  overflow-y: auto;
  padding: 4px;
}
.shop-card {
  background: #fff;
  border-radius: 14px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: inset 0 0 0 2px #e8dfc7;
}
.shop-card.r-rare {
  box-shadow: inset 0 0 0 2px #3ba7e0;
}
.shop-card.r-epic {
  box-shadow: inset 0 0 0 2px #9b5cff;
}
.shop-card.r-legendary {
  box-shadow: inset 0 0 0 3px #ffb52e, 0 0 14px rgba(255, 181, 46, 0.45);
}
.shop-card canvas {
  width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
}
.shop-info {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: space-between;
}
.shop-info b {
  font-size: 16px;
}
.shop-card .btn {
  width: 100%;
}
.pf-top {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.pf-look {
  width: 260px;
  max-width: 100%;
  height: auto;
  border-radius: 14px;
}
.pf-stats {
  flex: 1;
  min-width: 220px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
}
.pf-stats div {
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
}
.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
  overflow-y: auto;
  padding: 2px;
  margin-bottom: 10px;
}
.ach {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  padding: 8px 10px;
  opacity: 0.8;
}
/* not earned yet: a grey medal, but the progress bar stays readable */
.ach:not(.got) .ach-ico {
  filter: grayscale(1);
  opacity: 0.55;
}
.ach.got {
  opacity: 1;
  filter: none;
  box-shadow: inset 0 0 0 2px var(--sun);
}
.ach-ico {
  font-size: 26px;
}
.ach div {
  flex: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.ach small {
  color: var(--muted);
  font-size: 12px;
}
.ach .ach-bar {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.ach-prog {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: #ece4cf;
  overflow: hidden;
}
.ach-prog i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4ecdc4, #5cbf5a);
}
.ach-prog.done i {
  background: linear-gradient(90deg, #ffd23f, #ffb52e);
}
.ach-n {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}
.ach em {
  font-style: normal;
  font-weight: 800;
  font-size: 12px;
  color: #a47800;
  white-space: nowrap;
}
#mystery {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: radial-gradient(
    circle at 50% 45%,
    rgba(40, 30, 80, 0.85),
    rgba(10, 15, 30, 0.94)
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fade 0.3s;
}
#mystery canvas {
  width: min(360px, 90vw);
  height: auto;
}
.my-text {
  text-align: center;
  color: #fff;
  min-height: 120px;
}
.my-title {
  font-size: 30px;
  font-weight: 800;
  color: var(--sun);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.4);
}
#mystery.open .my-title {
  display: none;
}
.my-name {
  font-size: 26px;
  margin: 6px 0 12px;
}
.my-name span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
}
.my-name .rar {
  font-size: 14px;
  padding: 2px 10px;
}
.my-dupe {
  color: var(--sun);
  font-size: 18px;
  font-weight: 700;
  margin-top: 4px;
}
.my-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.my-btns[hidden] {
  display: none;
}
.my-btns .btn {
  min-width: 120px;
  flex: none;
}
#mystery.r-legendary .my-name b {
  background: linear-gradient(
    90deg,
    #ff5a5f,
    #ffd23f,
    #7bd389,
    #4ecdc4,
    #9b5cff
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.admin-screen {
  z-index: 70;
  background: radial-gradient(
      circle at 20% 10%,
      rgba(92, 191, 90, 0.25),
      transparent 50%
    ),
    radial-gradient(
      circle at 85% 90%,
      rgba(155, 92, 255, 0.22),
      transparent 55%
    ),
    var(--ink);
}
.panel.admin-panel {
  width: min(1180px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  text-align: left;
  padding: 22px 24px 24px;
}
.panel.admin-panel.is-login {
  width: min(420px, 100%);
  text-align: center;
}
.ad-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-right: 44px;
  margin-bottom: 14px;
}
.ad-head h2 {
  margin: 0;
  font-size: 28px;
  flex: 1;
}
.is-login .ad-head {
  justify-content: center;
  padding: 0;
}
.ad-user {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.ad-email {
  font-weight: 700;
  color: var(--muted);
  font-size: 14px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* login */
.ad-login {
  display: grid;
  gap: 12px;
  text-align: left;
}
.ad-lock {
  width: 76px;
  height: 76px;
  margin: 2px auto 0;
  display: grid;
  place-items: center;
  font-size: 38px;
  border-radius: 24px;
  background: linear-gradient(145deg, #fff6d6, #ffe08a);
  box-shadow: 0 5px 0 #d9b44a;
}
.ad-sub {
  margin: 0 0 4px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
}
.ad-field span:first-child {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  margin: 0 0 4px 4px;
}
.ad-field input {
  width: 100%;
  border: 3px solid #e3dcc8;
  background: #fff;
  border-radius: 14px;
  padding: 10px 14px;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.ad-pw {
  position: relative;
  display: block;
}
.ad-pw input {
  padding-right: 48px;
}
.ad-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  font-size: 18px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
}
.ad-eye:hover {
  background: #f3ecd9;
}
.ad-submit {
  margin-top: 4px;
  font-size: 19px;
  padding: 12px;
}
.ad-google {
  background: #fff;
}
.ad-err {
  color: var(--coral);
  font-weight: 700;
  margin: 0;
  text-align: center;
  font-size: 14px;
}
.ad-err:empty {
  display: none;
}
.ad-who {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.ad-link {
  border: 0;
  background: none;
  color: var(--violet);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}
.ad-shake {
  animation: shake 0.4s;
}

/* editor */
.ad-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(320px, 1.15fr);
  gap: 18px;
  align-items: start;
}
.ad-form {
  display: grid;
  gap: 12px;
  align-content: start;
}
.ad-tabs {
  justify-self: start;
}
.ad-tabs button {
  padding: 6px 16px;
  font-size: 15px;
}
.ad-sec,
.ad-card {
  background: #fff;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 3px 0 #e6dcc2;
}
.ad-sec {
  display: grid;
  gap: 10px;
}
.ad-sec h4 {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
}
.ad-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ad-f {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.ad-f > span {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  margin-left: 2px;
}
.ad-f input:not([type]),
.ad-f input[type="number"],
.ad-f select {
  width: 100%;
  border: 2px solid #e8e1cd;
  background: #fbf8f0;
  border-radius: 10px;
  padding: 7px 10px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.ad-f select:focus {
  border-color: var(--teal);
}
.ad-f input:focus,
.ad-f select:focus {
  background: #fff;
}
.ad-id input {
  font-family: ui-monospace, Menlo, monospace !important;
  font-size: 13px !important;
}
.ad-swatches {
  display: flex;
  gap: 6px;
}
.ad-swatches input[type="color"],
.ad-chip input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 38px;
  height: 36px;
  border: 2px solid #e8e1cd;
  border-radius: 10px;
  padding: 3px;
  background: #fff;
  cursor: pointer;
}
.ad-chip input[type="color"] {
  width: 28px;
  height: 24px;
  border-radius: 7px;
  padding: 2px;
}
input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 6px;
}
input[type="color"]::-moz-color-swatch {
  border: 0;
  border-radius: 6px;
}
.ad-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ad-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}
.ad-chip input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.ad-chip span {
  padding: 6px 12px;
  border-radius: 999px;
  border: 2px solid #e8e1cd;
  background: #fbf8f0;
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  transition: all 0.15s;
}
.ad-chip input:checked + span {
  border-color: var(--teal);
  background: #e3f8f6;
  color: var(--text);
}
.ad-chip input:focus-visible + span {
  outline: 3px solid rgba(78, 205, 196, 0.5);
}
.ad-ranges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
}
.ad-range input {
  width: 100%;
  accent-color: var(--teal);
}
.ad-range b {
  color: var(--text);
  float: right;
}

/* image drop zone */
.ad-drop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 2px dashed #d8ccab;
  border-radius: 14px;
  background: #fbf8f0;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  outline: none;
}
.ad-drop:hover,
.ad-drop:focus-visible,
.ad-drop.over {
  border-color: var(--teal);
  background: #eefaf8;
}
.ad-drop.over {
  transform: scale(1.01);
}
.ad-drop i {
  font-style: normal;
  font-size: 30px;
  width: 56px;
  height: 56px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 0 #e6dcc2;
}
.ad-drop img {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  image-rendering: auto;
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--teal);
}
.ad-drop b {
  display: block;
  font-size: 15px;
}
.ad-drop small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  margin-top: 2px;
}
.ad-x {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: var(--coral);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 0 #e6dcc2;
}
.ad-imgmsg {
  font-size: 13px;
  font-weight: 700;
  color: #2f8a3a;
  min-height: 0;
}
.ad-imgmsg.bad {
  color: var(--coral);
}

/* preview + list */
.ad-side {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 0;
}
.ad-stage {
  padding: 10px;
}
.ad-cv {
  width: 100%;
  height: auto;
  aspect-ratio: 420 / 260;
  border-radius: 12px;
  display: block;
}
.ad-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.ad-actions .btn {
  flex: 1;
  font-size: 15px;
  padding: 8px 10px;
}
.ad-actions .btn.primary {
  flex: 1.4;
}
.ad-msg {
  margin: 8px 2px 0;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}
.ad-msg:empty {
  display: none;
}
.ad-card-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.ad-card-h small {
  color: var(--muted);
  font-weight: 700;
}
.ad-list {
  display: grid;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
}
.ad-list .note {
  margin: 0;
}
.ad-item {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #fbf8f0;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 6px 8px;
}
.ad-item.on {
  border-color: var(--teal);
  background: #eefaf8;
}
.ad-thumb {
  width: 40px;
  height: 40px;
  flex: none;
}
.ad-meta {
  flex: 1;
  min-width: 0;
}
.ad-meta b {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ad-meta small {
  color: var(--muted);
  font-size: 12px;
}
.ad-meta .rar {
  font-size: 10px;
  padding: 1px 6px;
}
.ad-ibs {
  display: flex;
  gap: 4px;
}
.ad-ib {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 2px 0 #e6dcc2;
  transition: transform 0.08s;
}
.ad-ib:hover {
  transform: translateY(-1px);
}
.ad-ib.danger:hover {
  background: #ffe3e3;
}
.ad-jsonbox summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--muted);
}
.ad-json {
  width: 100%;
  height: 140px;
  margin: 8px 0;
  font: 12px ui-monospace, monospace;
  border-radius: 10px;
  border: 2px solid #e8e1cd;
  padding: 8px;
  resize: vertical;
}
@media (max-width: 820px) {
  .ad-grid {
    grid-template-columns: 1fr;
  }
  .ad-side {
    position: static;
    order: -1;
  }
}
@media (max-width: 460px) {
  .ad-row,
  .ad-ranges {
    grid-template-columns: 1fr;
  }
}

/* ---------- editor 2.0: add/cut, zoom, blocks ---------- */
.ed-shape .ed-mode {
  display: flex;
  gap: 4px;
  padding: 0 8px 0 0;
  margin-right: 4px;
  opacity: 1;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}
.ed-mode button[data-mode="add"].on {
  background: var(--grass);
  color: #fff;
}
.ed-mode button[data-mode="cut"].on {
  background: var(--coral);
  color: #fff;
}
.ed-mode-props {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.ed-mode-props button {
  flex: 1;
  border: 0;
  border-radius: 10px;
  padding: 6px;
  font-weight: 700;
  background: #efe6cf;
  color: var(--text);
}
.ed-mode-props button[data-op="add"].on {
  background: var(--grass);
  color: #fff;
}
.ed-mode-props button[data-op="cut"].on {
  background: var(--coral);
  color: #fff;
}
.ed-zoom {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  display: flex;
  gap: 4px;
  align-items: center;
  background: rgba(15, 27, 48, 0.85);
  border-radius: 12px;
  padding: 4px;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}
.ed-zoom button {
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  width: 30px;
  height: 28px;
}
.ed-zl {
  min-width: 44px;
  text-align: center;
}
.ed-xf {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin: 10px 0 4px;
}
.ed-xf .ed-btn {
  padding: 6px 0;
  font-size: 16px;
}
.ed-small {
  font-size: 13px;
  color: var(--muted);
}
.ed-blocks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.ed-block {
  position: relative;
  border: 0;
  border-radius: 10px;
  background: #fff;
  padding: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: inset 0 0 0 2px #e8dfc7;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
}
.ed-block canvas {
  width: 100%;
  height: auto;
  border-radius: 6px;
}
.ed-block.on {
  box-shadow: inset 0 0 0 3px var(--sun);
}
.ed-block i {
  position: absolute;
  top: 2px;
  right: 4px;
  font-style: normal;
  color: var(--coral);
  font-size: 12px;
}
.ed-pieces {
  display: grid;
  gap: 4px;
}
.ed-piece {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-radius: 8px;
  padding: 4px 8px;
  font-weight: 700;
}
.ed-piece .ed-btn {
  padding: 2px 8px;
  font-size: 12px;
}

/* ---------- title dock (v1.7) ---------- */
.dock {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 8px;
  margin-top: 16px;
}
.dock-group {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 5px;
  border-radius: 16px;
  background: var(--dock-group);
}
.dock-btn {
  position: relative;
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 12px;
  background: var(--dock);
  box-shadow: 0 2px 0 var(--dock-lip);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font: inherit;
  color: var(--dock-text);
  transition: transform 0.12s, box-shadow 0.12s;
}
.dock-btn span {
  font-size: 22px;
  line-height: 1;
}
.dock-btn small {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2px;
}
.dock-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 0 var(--dock-lip);
}
.dock-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 var(--dock-lip);
}
.dock-btn .coin-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  margin: 0;
  font-size: 10px;
  line-height: 16px;
  padding: 0 5px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}
.dock-dot {
  position: absolute;
  top: 5px;
  right: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dot);
  box-shadow: 0 0 0 2px var(--dock);
}
.dock-dot[hidden] {
  display: none;
}
.dock-btn[hidden] {
  display: none;
}
.news-panel {
  text-align: left;
}
.news-panel h2 {
  text-align: center;
}
.news-panel .whatsnew {
  max-height: 62vh;
  overflow-y: auto;
  margin-top: 4px;
  padding-right: 4px;
}
@media (max-width: 420px) {
  .dock {
    gap: 5px;
  }
  .dock-btn {
    height: 48px;
  }
  .dock-btn span {
    font-size: 19px;
  }
}

/* ---------- editor tools (v1.8) ---------- */
.ed-group {
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 6px 2px 0;
}
.ed-group:first-child {
  margin-top: 0;
}
.ed-btn.ed-toggle.on {
  background: var(--teal);
  box-shadow: 0 3px 0 #2a9d94;
  color: #0f1b30;
}
.ed-btn.test.ed-toggle {
  background: #3aa6a0;
  box-shadow: 0 3px 0 #23746f;
}
.ed-btn.test.ed-toggle.on {
  background: var(--sun);
  color: #3a2600;
  box-shadow: 0 3px 0 #c99700;
}
.ed-cv.picking {
  cursor: cell;
}
.ed-stage.ed-unreachable {
  box-shadow: inset 0 0 0 4px rgba(255, 90, 95, 0.85);
}
.ed-side {
  margin-top: 12px;
  border-top: 2px solid #ece3cb;
  padding-top: 8px;
}
.ed-side summary {
  font-weight: 800;
  color: var(--text);
  cursor: pointer;
  margin-bottom: 6px;
}
.ed-layer {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 0;
  font-weight: 700;
}
.ed-layer span {
  flex: 1;
  font-size: 13px;
}
.ed-layer.hidden span {
  opacity: 0.45;
}
.ed-lb {
  border: 0;
  border-radius: 8px;
  background: #efe6cf;
  width: 30px;
  height: 26px;
  font-size: 14px;
  padding: 0;
}
.ed-lb.on {
  background: var(--sun);
}
.ed-hist {
  display: grid;
  gap: 2px;
  max-height: 220px;
  overflow-y: auto;
}
.ed-h {
  border: 0;
  text-align: left;
  border-radius: 6px;
  background: transparent;
  padding: 3px 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #3a4660;
  cursor: pointer;
}
.ed-h:hover {
  background: #efe6cf;
}
.ed-h.now {
  background: var(--sun);
  color: #3a2600;
}
.ed-h.future {
  opacity: 0.5;
  font-style: italic;
}
.ed-templates {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.ed-template {
  padding: 6px;
  font-size: 14px;
}
.ed-template canvas {
  width: 100%;
  border-radius: 8px;
}
.ed-bot {
  margin-top: 12px;
}
.ed-bar {
  height: 12px;
  border-radius: 6px;
  background: #ece3cb;
  overflow: hidden;
}
.ed-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--grass);
  transition: width 0.2s;
}
.ed-bot-out {
  margin-top: 12px;
  font-size: 16px;
}
.ed-bot-out .btn-row {
  margin-top: 12px;
}

/* ---------- sudden death & daily challenge (v2.0) ---------- */
.mode-cards {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 4px;
}
.pchip.out {
  opacity: 0.5;
  filter: grayscale(0.7);
}
tr.out td {
  opacity: 0.55;
}
.final .out-note {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  margin-left: 6px;
}
.daily-btn {
  width: 100%;
  margin-top: 10px;
  background: linear-gradient(90deg, #ffe7a3, #ffd23f);
  box-shadow: 0 4px 0 #c99700;
  color: #3a2600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.daily-btn small {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.75;
}
.daily-btn small:empty {
  display: none;
}
.daily-panel {
  text-align: left;
}
.daily-panel h2 {
  text-align: center;
}
.daily-hole {
  display: flex;
  gap: 14px;
  align-items: center;
  background: #fff;
  border-radius: 14px;
  padding: 10px;
  margin: 10px 0;
}
.daily-thumb canvas {
  width: 200px;
  height: auto;
  border-radius: 10px;
  display: block;
}
.daily-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 14px;
  color: #3a4660;
}
.daily-meta b {
  font-size: 20px;
  color: var(--text);
}
.daily-meta em {
  color: var(--violet);
  font-style: normal;
  font-weight: 800;
}
.daily-tries {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pips {
  display: inline-flex;
  gap: 4px;
}
.pips i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e3dcc8;
}
.pips i.on {
  background: var(--grass);
}
.daily-result {
  text-align: center;
  font-size: 20px;
  margin: 6px 0 10px;
}
.daily-done {
  text-align: center;
  font-weight: 700;
  color: var(--muted);
}
.daily-panel .btn.big {
  width: 100%;
}
.daily-board {
  list-style: none;
  padding: 0;
  margin: 6px 0;
  display: grid;
  gap: 4px;
  max-height: 240px;
  overflow-y: auto;
}
.daily-board li {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #fff;
  border-radius: 10px;
  padding: 6px 12px;
  font-weight: 700;
}
.daily-board li.me {
  box-shadow: inset 0 0 0 3px var(--violet);
}
.daily-board li.note {
  background: none;
  font-weight: 600;
}
.daily-board .rank {
  width: 28px;
}
.daily-board .fn {
  flex: 1;
}
.daily-next {
  text-align: center;
}
@media (max-width: 520px) {
  .daily-hole {
    flex-direction: column;
    align-items: stretch;
  }
  .daily-thumb canvas {
    width: 100%;
  }
}

/* ---------- sticker icons (js/icons.js) ---------- */
/* Sized in em so they take the slot's emoji font-size; a bit larger since stickers carry a white border */
.ico-img {
  width: 1.3em;
  height: 1.3em;
  object-fit: contain;
  vertical-align: -0.3em;
  user-select: none;
}
.slot .ico .ico-img,
.pu-ico .ico-img,
.bio-ico .ico-img,
.ach-ico .ico-img {
  display: block;
  vertical-align: 0;
}

/* scene illustrations (modal banners, empty states) and moment stickers */
.scene-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  pointer-events: none;
  user-select: none;
}
.scene-img[hidden] {
  display: none;
}
.scene-img.banner {
  max-height: 150px;
  margin: -4px auto 6px;
}
.scene-img.empty {
  max-height: 130px;
  margin: 8px auto;
}
#celebrate .c-art {
  display: block;
  width: clamp(140px, 30vw, 240px);
  margin: 0 auto -8px;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.25));
}
#moment {
  position: fixed;
  left: 50%;
  top: 30%;
  transform: translate(-50%, -50%);
  z-index: 7;
  pointer-events: none;
  opacity: 0;
}
#moment img {
  display: block;
  width: clamp(110px, 22vw, 170px);
  filter: drop-shadow(0 5px 0 rgba(0, 0, 0, 0.25));
}
#moment.go {
  animation: celeb 1.8s cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
}
@media (max-width: 600px) {
  .scene-img.banner {
    max-height: 110px;
  }
}

/* ---------- v2.3: wider panels, big sticker icons, floating stickers ---------- */
@media (min-width: 900px) {
  .panel.title-panel,
  .panel.lobby-panel,
  .panel.final-panel {
    width: 820px;
  }
  .panel.wide {
    width: min(920px, 100%);
  }
}

/* logo art replaces the text logo once img/brand/logo.webp exists */
.logo-img {
  display: block;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.12));
}
.logo:has(.logo-img) span {
  display: none;
}

/* big stickers in buttons, menu tiles, cards and headings (inline text keeps the small size) */
.btn-row .btn > .ico-img,
.daily-btn > .ico-img,
.final-actions .btn > .ico-img {
  width: 3em;
  height: 3em;
  margin: -0.7em 0.1em -0.7em -0.4em;
  vertical-align: middle;
}
.daily-btn > .ico-img {
  margin: -0.7em 0;
}
.dock-btn {
  height: auto;
  padding: 8px 4px 7px;
}
.dock-btn span {
  font-size: 20px;
}
.dock-btn .ico-img {
  width: 3em;
  height: 3em;
}
.pu-ico .ico-img,
.ach-ico .ico-img {
  width: 3em;
  height: 3em;
}
.pu-ico,
.ach-ico {
  font-size: 20px;
}
.bio-ico .ico-img {
  width: 3em;
  height: 3em;
}
.bio-ico {
  font-size: 30px;
}
.bio-dots button span {
  font-size: 14px;
}
.bio-dots button .ico-img {
  width: 3em;
  height: 3em;
  margin: -0.6em 0;
}
.shop-head h2 .ico-img,
.market-panel h2 .ico-img {
  width: 2em;
  height: 2em;
  vertical-align: -0.6em;
}

/* floating stickers over panel corners */
.floaty {
  position: absolute;
  z-index: 3;
  width: 180px;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 8px 0 rgba(0, 0, 0, 0.18));
  animation: bob 5s ease-in-out infinite;
}
.floaty.tl {
  top: -72px;
  left: -96px;
  --r: -9deg;
}
.floaty.tr {
  top: -66px;
  right: -88px;
  --r: 8deg;
  animation-delay: -1.6s;
}
.floaty.bl {
  bottom: -56px;
  left: -100px;
  --r: -6deg;
  animation-delay: -3.1s;
}
.floaty.br {
  bottom: -64px;
  right: -96px;
  --r: 7deg;
  animation-delay: -2.2s;
}
@keyframes bob {
  0%,
  100% {
    transform: translateY(0) rotate(var(--r, 0deg));
  }
  50% {
    transform: translateY(-12px) rotate(calc(var(--r, 0deg) + 3deg));
  }
}
@media (max-width: 1150px) {
  .floaty {
    width: 130px;
  }
  .floaty.tl,
  .floaty.bl {
    left: -54px;
  }
  .floaty.tr,
  .floaty.br {
    right: -50px;
  }
}
@media (max-width: 899px) {
  .floaty {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .floaty {
    animation: none;
    transform: rotate(var(--r, 0deg));
  }
}
.emote-bar {
  flex-wrap: wrap;
  max-width: min(420px, calc(100vw - 24px));
}
.emote-bar button {
  height: 52px;
  padding: 0 4px;
  background: none;
  box-shadow: none;
  min-width: 0;
  cursor: pointer;
}
.emote-bar .ico-img {
  width: 2.2em;
  height: 2.2em;
  vertical-align: middle;
}
/* create / solo: sticker on top, label under it */
.btn-row .btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 10px 10px;
  line-height: 1.1;
}
.btn-row .btn > .ico-img {
  margin: 0;
}
.floaty.bl {
  bottom: -84px;
}
/* tall panels sit against the top of the screen, so their corner sticker hangs off the side instead */
.panel.wide > .floaty.tr {
  top: 18px;
}
@media (max-width: 1150px) {
  .panel.wide > .floaty {
    display: none;
  }
}
@media (max-width: 520px) {
  .daily-btn > .ico-img {
    width: 2em;
    height: 2em;
  }
  .daily-btn {
    white-space: nowrap;
  }
}

/* ---------- v2.3b: stickers break out of their boxes ---------- */
/* header stickers: twice as wide, poking out over the top edge of the panel */
.scene-img.banner {
  width: min(600px, 92%);
  max-height: none;
  margin: -170px auto 4px;
  filter: drop-shadow(0 10px 0 rgba(0, 0, 0, 0.16));
  position: relative;
  z-index: 2;
}
.screen:has(> .panel > .scene-img.banner:not([hidden])) {
  padding-top: 190px;
}
.screen:has(> .panel > .scene-img.banner) .market-panel,
.screen:has(> .panel > .scene-img.banner) .profile-panel {
  max-height: calc(100vh - 210px);
}
@media (max-width: 640px) {
  .scene-img.banner {
    width: 88%;
    margin-top: -90px;
  }
  .screen:has(> .panel > .scene-img.banner:not([hidden])) {
    padding-top: 100px;
  }
  .screen:has(> .panel > .scene-img.banner) .market-panel,
  .screen:has(> .panel > .scene-img.banner) .profile-panel {
    max-height: calc(100vh - 116px);
  }
}

/* sticker look shared by bag, help cards and quips */
.slot .ico .ico-img,
.pu-ico .ico-img,
.emote-bar .ico-img {
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.22));
  transform: rotate(var(--tilt, -6deg));
  transition: transform 0.15s;
}

/* bag: the sticker rises out of a small coloured tab that keeps the name, key and type colour */
/* the tab has room for a two-line name ("Grappling Hook") under the sticker */
.slot:has(.ico-img) {
  height: 50px;
  margin-top: 30px;
  justify-content: flex-end;
  padding-bottom: 5px;
  overflow: visible;
}
.slot:has(.ico-img) .lbl {
  font-size: 11px;
  line-height: 1.05;
  max-width: 70px;
}
.slot .ico:has(.ico-img) {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
}
.slot .ico .ico-img {
  width: 76px;
  height: 76px;
}
.slot:nth-child(2n) {
  --tilt: 5deg;
}
.slot:hover .ico-img,
.slot.active .ico-img {
  transform: rotate(0deg) scale(1.1);
}
/* the number sits as a little badge on the tab's corner, clear of the sticker and the name */
.slot:has(.ico-img) .key {
  top: -7px;
  bottom: auto;
  left: -6px;
  z-index: 2;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: #1d2a44;
  color: #fff;
  text-align: center;
}
@media (max-width: 640px) {
  .slot:has(.ico-img) {
    height: 42px;
    margin-top: 22px;
  }
  .slot:has(.ico-img) .lbl {
    font-size: 9.5px;
    max-width: 54px;
  }
  .slot .ico:has(.ico-img) {
    bottom: 24px;
  }
  .slot .ico .ico-img {
    width: 60px;
    height: 60px;
  }
}

/* help cards: bigger sticker that breaks out of the card corner */
.pu {
  overflow: visible;
}
.pu-ico .ico-img {
  width: 4em;
  height: 4em;
  margin: -16px -4px -10px -14px;
}
.pu:nth-child(2n) {
  --tilt: 6deg;
}

/* quips: just the stickers, no buttons around them */
.emote-bar {
  gap: 2px;
  padding: 6px 8px;
  max-width: min(560px, calc(100vw - 24px));
  bottom: 128px;
}
.emote-bar button {
  width: auto;
  height: auto;
  padding: 0;
}
.emote-bar .ico-img {
  width: 64px;
  height: 64px;
}
.emote-bar button:nth-child(2n) {
  --tilt: 6deg;
}
.emote-bar button:hover .ico-img {
  transform: rotate(0deg) scale(1.15);
}
.emote-bar button:active .ico-img {
  transform: scale(0.92);
}
/* sit above the bag, whose stickers now rise out of their slots */
.screen:has(> .panel > .scene-img.banner) .shop-panel {
  max-height: calc(100vh - 210px);
}
@media (max-width: 640px) {
  .screen:has(> .panel > .scene-img.banner) .shop-panel {
    max-height: calc(100vh - 116px);
  }
}
/* only the item grid scrolls; the header sticker and texts keep their size */
.shop-panel > :not(.shop-grid),
.profile-panel > .scene-img,
.market-panel > .scene-img {
  flex-shrink: 0;
}
/* 21:9 headers: wider still, same share poking out over the top */
.scene-img.banner.wide {
  width: min(880px, 98%);
  margin-top: -160px;
}
@media (max-width: 640px) {
  .scene-img.banner.wide {
    width: 96%;
    margin-top: -70px;
  }
}

/* course & mode cards: a sticker poking out over the top edge */
.course-cards {
  row-gap: 26px;
  padding-top: 18px;
}
.course {
  position: relative;
  overflow: visible;
}
.course .card-art {
  width: 64px;
  height: 64px;
  margin: -34px 0 2px -6px;
  object-fit: contain;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.2));
  transform: rotate(-6deg);
  transition: transform 0.15s;
  pointer-events: none;
}
.course:nth-child(2n) .card-art {
  transform: rotate(6deg);
}
.course:not(:disabled):hover .card-art,
.course.sel .card-art {
  transform: rotate(0deg) scale(1.12);
}

/* ---------- logo around the game ---------- */
#splash-logo {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.3) rotate(-10deg);
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 10px 0 rgba(0, 0, 0, 0.3));
}
/* slapped on like a sticker: drops in big, squashes flat, springs back, with a quick shine */
#splash-logo.show {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(-2deg);
  animation: logo-slap 0.75s cubic-bezier(0.3, 0.7, 0.4, 1) both;
}
@keyframes logo-slap {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.5) rotate(-8deg);
    filter: drop-shadow(0 30px 0 rgba(0, 0, 0, 0)) brightness(1);
  }
  45% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.97, 0.93) rotate(0deg);
    filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.35)) brightness(1.2);
  }
  70% {
    transform: translate(-50%, -50%) scale(1.02, 1.03) rotate(-3deg);
    filter: drop-shadow(0 11px 0 rgba(0, 0, 0, 0.3)) brightness(1.05);
  }
  100% {
    transform: translate(-50%, -50%) scale(1) rotate(-2deg);
    filter: drop-shadow(0 10px 0 rgba(0, 0, 0, 0.3)) brightness(1);
  }
}
@keyframes logo-float {
  50% {
    transform: translate(-50%, -52%) rotate(-1deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  #splash-logo.show {
    animation: none;
  }
}
.hud-logo {
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.3));
  pointer-events: none;
  height: 84px;
  margin: -10px -2px -40px -6px;
  transform: rotate(-4deg);
}
@media (max-width: 640px) {
  .hud-logo {
    display: none;
  }
}

/* "Your name": big sticker hanging over the input, bold label, chunky sunny box */
.name-field {
  position: relative;
}
.name-field > span {
  font-size: 19px;
  font-weight: 800;
  color: var(--coral);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 0 0 6px 80px;
}
.name-field input#name {
  font-size: 24px;
  font-weight: 800;
  padding: 12px 16px 12px 82px;
  border: 3px solid var(--sun);
  background: var(--name-input);
  box-shadow: 0 4px 0 #c99700;
}
.name-ico {
  position: absolute;
  left: -14px;
  bottom: -10px;
  width: 88px;
  height: 88px;
  object-fit: contain;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.22));
  transform: rotate(-8deg);
  transition: transform 0.2s;
}
.name-field:focus-within .name-ico {
  transform: rotate(4deg) scale(1.08);
}

/* profile stats: a sticker per stat, poking out of the card's left edge */
.pf-stats {
  gap: 10px 12px;
}
.pf-stats div {
  align-items: center;
  padding: 8px 12px 8px 4px;
  overflow: visible;
}
.pf-stats span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat-ico {
  width: 48px;
  height: 48px;
  margin: -10px 0 -10px -14px;
  object-fit: contain;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.2));
  transform: rotate(-6deg);
  flex-shrink: 0;
}
.pf-stats div:nth-child(2n) .stat-ico {
  transform: rotate(6deg);
}
/* the stats grid got taller with its stickers; don't let the row stretch the preview canvas */
.pf-look {
  align-self: flex-start;
  flex-shrink: 0;
  aspect-ratio: 260 / 140;
}

/* How to play: stickers on the basics cards and the tabs */
.help-card {
  position: relative;
}
.help-ico img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin: -26px 0 -6px -10px;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.2));
  transform: rotate(-6deg);
}
.help-card:nth-child(2n) .help-ico img {
  transform: rotate(6deg);
}
.help-grid {
  row-gap: 26px;
  padding-top: 14px;
}
.tab-ico {
  width: 30px;
  height: 30px;
  object-fit: contain;
  vertical-align: middle;
  margin: -8px 0;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.18));
}

/* a header that spans the whole card (scorecard) */
.scene-img.banner.full {
  width: 100%;
  max-width: none;
}

/* hazards: a sticker breaking out of each card's left edge */
.hz {
  overflow: visible;
  padding-left: 4px;
}
.hz-ico {
  display: block;
  width: 58px;
  height: 58px;
  object-fit: contain;
  margin: -12px -2px -12px -14px;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.2));
  transform: rotate(-6deg);
}
.hz:nth-child(2n) .hz-ico {
  transform: rotate(6deg);
}
.hz-grid,
#hz-list {
  gap: 12px;
}

/* ---------- editor tool bar: wider, cream panel with sticker tiles like the menus ---------- */
.ed-tools {
  width: 248px;
  background: var(--panel);
  padding: 12px 12px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: start;
  gap: 8px;
  box-shadow: 4px 0 0 #c9b98f, 8px 0 24px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
}
.ed-group {
  grid-column: 1 / -1;
  justify-self: start;
  margin: 10px 0 2px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.06em;
  box-shadow: 0 2px 0 #b8343a;
}
.ed-group:first-child {
  margin-top: 0;
}
.ed-tool {
  background: #fff;
  color: var(--text);
  border-radius: 14px;
  padding: 6px 4px 7px;
  gap: 2px;
  box-shadow: 0 3px 0 #e2d8bd;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}
.ed-tool:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 #e2d8bd;
}
.ed-tool:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #e2d8bd;
}
.ed-tool span {
  font-size: 26px;
  line-height: 1;
}
.ed-tool span img {
  display: block;
  width: 50px;
  height: 50px;
  object-fit: contain;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.18));
  transform: rotate(-5deg);
  transition: transform 0.15s;
}
.ed-tool:nth-of-type(2n) span img {
  transform: rotate(5deg);
}
.ed-tool small {
  font-size: 12px;
  font-weight: 800;
  opacity: 1;
  text-align: center;
}
.ed-tool.on {
  background: var(--sun);
  color: #3a2600;
  box-shadow: 0 3px 0 #c99700, 0 0 0 3px #fff6c2;
}
.ed-tool.on span img,
.ed-tool:hover span img {
  transform: rotate(0deg) scale(1.12);
}
.ed-opts {
  grid-column: 1 / -1;
  color: var(--text);
  background: #fff;
  border-radius: 12px;
  padding: 8px 10px;
  margin-top: 10px;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 760px) {
  .ed-tools {
    width: 84px;
    grid-template-columns: 1fr;
    padding: 8px 6px;
  }
  .ed-group {
    justify-self: stretch;
    text-align: center;
    padding: 2px 4px;
    font-size: 9px;
  }
  .ed-tool span img {
    width: 42px;
    height: 42px;
  }
  .ed-opts {
    grid-template-columns: 1fr;
  }
}

/* profile on phones: no fixed height with an inner scroller (the stats alone are taller than
   the screen); the whole panel grows and the screen scrolls instead. Stats go two-up. */
@media (max-width: 640px) {
  .profile-panel,
  .screen:has(> .panel > .scene-img.banner) .profile-panel {
    max-height: none;
  }
  .profile-panel .ach-grid {
    overflow: visible;
  }
  .pf-look {
    width: 100%;
  }
  .pf-stats {
    min-width: 0;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .pf-stats div {
    padding: 6px 8px 6px 2px;
    font-size: 12px;
    line-height: 1.15;
  }
  .stat-ico {
    width: 38px;
    height: 38px;
    margin: -8px -2px -8px -10px;
  }
}

/* podium rosettes in the results and the daily leaderboard */
.rank-ico {
  width: 40px;
  height: 40px;
  object-fit: contain;
  vertical-align: middle;
  margin: -8px 0;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.2));
}
.final .rank {
  width: 40px;
}

/* HUD buttons as free-standing stickers (the square comes back with the emoji fallback) */
.icon-btn:has(.hud-ico) {
  background: none;
  box-shadow: none;
  padding: 0;
}
.hud-ico {
  display: block;
  width: 46px;
  height: 46px;
  margin: -2px;
  object-fit: contain;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.3));
  transform: rotate(-4deg);
  transition: transform 0.15s;
}
.icon-btn:nth-child(2n) .hud-ico {
  transform: rotate(4deg);
}
.icon-btn:hover .hud-ico {
  transform: rotate(0deg) scale(1.12);
}
.icon-btn:active .hud-ico {
  transform: scale(0.92);
}
@media (max-width: 640px) {
  .hud-ico {
    width: 40px;
    height: 40px;
  }
}

/* ---------- v2.4: mystery box, collections, daily reward ---------- */
/* the shop's big draw: hard to miss */
.box-bar {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 50px 0 12px; /* room for the crate sticking out of the top */
  padding: 14px 18px 14px 128px;
  border-radius: 20px;
  background: #ffd23f;
  color: #3a2600;
  box-shadow: 0 5px 0 #c99700, 0 0 26px rgba(255, 210, 63, 0.45);
}
.box-bar .box-ico {
  position: absolute;
  left: 4px;
  bottom: 6px;
  width: 124px;
  height: 124px;
  object-fit: contain;
  transform: rotate(-7deg);
  filter: drop-shadow(0 5px 0 rgba(0, 0, 0, 0.25));
}
.box-bar > div {
  flex: 1 1 240px;
  min-width: 0;
  text-align: left;
  line-height: 1.25;
}
.box-bar b {
  display: block;
  font-size: 28px;
  line-height: 1.1;
}
.box-bar small {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  font-weight: 600;
  color: #5c4300;
}
.box-open {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  font-size: 21px;
  white-space: nowrap;
}
.box-open span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.box-open img {
  width: 26px;
  height: 26px;
}
@media (max-width: 560px) {
  .box-bar {
    margin-top: 16px;
    padding: 14px 14px 14px 96px;
  }
  .box-bar .box-ico {
    width: 92px;
    height: 92px;
    bottom: auto;
    top: 2px;
  }
  .box-bar b {
    font-size: 23px;
  }
  .box-open {
    flex: 1 1 100%;
    margin-left: -82px;
  }
}
.set-card {
  background: #fff;
  border-radius: 14px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: inset 0 0 0 2px #e8dfc7;
}
.set-card.ready {
  box-shadow: inset 0 0 0 3px var(--sun), 0 0 14px rgba(255, 210, 63, 0.5);
}
.set-card.claimed {
  background: #f3fbf6;
  box-shadow: inset 0 0 0 2px #8fdc9a;
}
.set-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
}
.set-ico {
  font-size: 22px;
}
.set-head b {
  flex: 1;
  text-align: left;
}
.set-n {
  font-weight: 800;
  color: #5a6478;
}
.set-bar {
  height: 8px;
  border-radius: 8px;
  background: #ece5d2;
  overflow: hidden;
}
.set-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), #8fdc5a);
  border-radius: 8px;
}
.set-faces {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  gap: 4px;
}
.set-faces img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
}
.set-faces img.missing {
  filter: grayscale(1) brightness(0.35);
  opacity: 0.45;
}
.set-prize {
  font-size: 13px;
  color: #3a4660;
  text-align: left;
}
.set-prize .ico-img {
  width: 1.2em;
  height: 1.2em;
}
.daily-panel {
  max-width: 560px;
}
.dr-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin: 14px 0 18px;
}
.dr-day {
  background: #fff;
  border-radius: 12px;
  padding: 6px 2px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: inset 0 0 0 2px #e8dfc7;
  font-weight: 800;
}
.dr-day small {
  font-size: 11px;
  color: #5a6478;
}
.dr-day img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}
.dr-day .ico-img {
  width: 24px;
  height: 24px;
}
.dr-day.past {
  opacity: 0.45;
}
.dr-day.today {
  background: #fff6d6;
  box-shadow: inset 0 0 0 3px var(--sun), 0 4px 0 #c99700;
  transform: translateY(-4px) scale(1.06);
}
@media (max-width: 480px) {
  .dr-days {
    gap: 3px;
  }
  .dr-day small {
    font-size: 9px;
  }
}

/* ---------- v2.4: practice hole coach and first-visit welcome ---------- */
#coach {
  position: fixed;
  left: 50%;
  top: 74px;
  transform: translateX(-50%);
  z-index: 8; /* over the HUD, under menus and the help screen */
  width: min(560px, calc(100% - 32px));
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  align-items: center;
  background: #fffaf0;
  color: var(--ink);
  border-radius: 18px;
  padding: 12px 14px 12px 10px;
  box-shadow: 0 0 0 3px var(--ink), 0 0 0 7px #fff,
    0 10px 24px rgba(0, 0, 0, 0.35);
  animation: coach-in 0.35s cubic-bezier(0.3, 1.5, 0.5, 1);
}
#coach.final {
  top: auto;
  bottom: 24px;
  z-index: 12; /* over the results screen */
}
@keyframes coach-in {
  from {
    transform: translateX(-50%) translateY(-12px) scale(0.92);
    opacity: 0;
  }
}
.coach-ball {
  grid-row: span 2;
  width: 64px;
  height: 64px;
  margin: -22px 0 -10px -24px;
  transform: rotate(-8deg);
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.25));
  animation: coach-bob 2.2s ease-in-out infinite;
}
@keyframes coach-bob {
  50% {
    transform: rotate(4deg) translateY(-4px);
  }
}
.coach-text {
  font-size: 16px;
  line-height: 1.35;
  text-align: left;
}
.coach-text small {
  display: block;
  margin-top: 4px;
  color: #5a6478;
}
.coach-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.help-tut {
  margin: 6px auto 22px;
}
.welcome-panel {
  max-width: 520px;
  text-align: center;
}
.welcome-panel p {
  font-size: 17px;
}
.welcome-btns {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.btn.ghost {
  background: none;
  box-shadow: none;
  text-decoration: underline;
  opacity: 0.8;
}
@media (max-width: 640px) {
  #coach {
    top: 96px;
  }
  .coach-text {
    font-size: 14px;
  }
  .coach-ball {
    width: 48px;
    height: 48px;
  }
}

/* ---------- menus scroll as a whole ---------- */
/* no small inner scroll boxes: the panel grows to its full height and the screen behind it scrolls,
   with a scrollbar you can see (the help carousel and the editor keep their own scrolling) */
.holes-panel,
.market-panel,
.shop-panel,
.profile-panel,
.screen:has(> .panel > .scene-img.banner) .market-panel,
.screen:has(> .panel > .scene-img.banner) .profile-panel,
.screen:has(> .panel > .scene-img.banner) .shop-panel {
  max-height: none;
}
.holes-grid,
.shop-grid,
.ach-grid,
.mk-grid,
.news-panel .whatsnew,
.daily-board {
  max-height: none;
  overflow: visible;
}
.screen,
.help-pane {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.55) transparent;
}
.screen::-webkit-scrollbar,
.help-pane::-webkit-scrollbar {
  width: 10px;
}
.screen::-webkit-scrollbar-thumb,
.help-pane::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.55);
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 10px;
}
.help-pane::-webkit-scrollbar-thumb {
  background-color: rgba(58, 38, 0, 0.3);
}
.screen::-webkit-scrollbar-track,
.help-pane::-webkit-scrollbar-track {
  background: transparent;
}
.help-pane {
  scrollbar-color: rgba(58, 38, 0, 0.3) transparent;
}
/* help: the tabs' pages keep their natural height; the view takes the open page's height */
.help-panel {
  height: auto;
}
.help-view {
  flex: none;
  transition: height 0.3s ease;
}
.help-track {
  height: auto;
  align-items: flex-start;
}
.help-pane {
  height: auto;
  overflow: visible;
}
/* "← Back" to the menu this one was opened from (nav.js); sits where ✕ does, on the left */
.nav-back {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 0;
  background: var(--close);
  font: inherit;
  font-weight: 800;
  font-size: 15px;
  color: var(--button-text);
  cursor: pointer;
}
.nav-back:hover {
  background: var(--close-hover);
}

/* ---------- ranked board ---------- */
.ranked-panel {
  width: min(640px, 100%);
  text-align: left;
}
.rk-me {
  margin: 4px 0 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #fff4d6;
  border: 3px solid #fff;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12);
}
.rk-board {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 4px;
}
.rk-board li {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 2px 10px;
  padding: 7px 12px;
  border-radius: 12px;
  background: #fff;
}
.rk-board li.me {
  background: #e3f7e8;
  box-shadow: inset 0 0 0 2px #5cbf5a;
}
.rk-board li small {
  grid-column: 2 / -1;
  opacity: 0.65;
  margin-top: -4px;
}
.rk-board li.note {
  display: block;
}
.rk-board .rank {
  font-weight: 800;
  text-align: center;
}
.rk-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rk-r {
  font-weight: 800;
  font-size: 18px;
}
.rk-hall-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.pf-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.pf-badges span {
  padding: 4px 10px;
  border-radius: 10px;
  background: #fff4d6;
  font-weight: 700;
}

/* ---------- custom rules (lobby) ---------- */
.custom-rules {
  margin: 10px 0 4px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.1);
  text-align: left;
}
.custom-rules h3 {
  margin: 0 0 8px;
}
.custom-rules h3 small {
  font-weight: 600;
  opacity: 0.6;
}
.cr-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0;
  flex-wrap: wrap;
}
.cr-row > span {
  width: 80px;
  font-weight: 800;
}
.cr-seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  background: #efe6cf;
  padding: 3px;
  border-radius: 12px;
}
.cr-seg button {
  border: 0;
  background: none;
  font: inherit;
  font-weight: 800;
  font-size: 14px;
  padding: 5px 11px;
  border-radius: 9px;
  cursor: pointer;
  color: var(--muted);
}
.cr-seg button.on {
  background: #fff;
  color: var(--text);
  box-shadow: 0 2px 0 #d8cfb5;
}
/* wacky extras: cards with a switch */
.cr-togs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 6px;
  margin: 4px 0 6px;
}
.cr-tog {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f4efe2;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.cr-tog:has(input:checked) {
  background: #fff4d6;
  border-color: #ffd23f;
}
.cr-tog > span {
  flex: 1;
  min-width: 0;
}
.cr-tog b {
  display: block;
  line-height: 1.2;
}
.cr-tog small {
  display: block;
  opacity: 0.7;
  font-size: 12px;
  line-height: 1.25;
}
/* the switch itself */
.cr-tog input {
  order: 2;
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 42px;
  height: 24px;
  margin: 0;
  border-radius: 999px;
  background: #d8cfb5;
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.08);
}
.cr-tog input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s;
}
.cr-tog input:checked {
  background: #5cbf5a;
}
.cr-tog input:checked::after {
  transform: translateX(18px);
}
.cr-tog input:focus-visible {
  outline: 3px solid #3ba7e0;
  outline-offset: 2px;
}
/* rules (segments) in one soft box */
.cr-rows {
  background: #faf6ec;
  border-radius: 12px;
  padding: 6px 10px;
}
.cr-rows .cr-tog {
  margin: 6px 0;
}
.custom-rules h4.cr-h-pu {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cr-h-pu .cr-seg button {
  font-size: 13px;
  padding: 3px 10px;
}
.cr-pu {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 6px;
  margin: 6px 0;
}
.cr-pu button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: #f4efe2;
  font: inherit;
  cursor: pointer;
  opacity: 0.45;
  filter: grayscale(0.8);
}
.cr-pu button.on {
  opacity: 1;
  filter: none;
  background: #fff4d6;
  border-color: #ffd23f;
}
.cr-pu .ico-img {
  width: 34px;
  height: 34px;
}
.cr-pu small {
  font-size: 11px;
  line-height: 1.1;
  text-align: center;
}
.custom-rules button:disabled,
.custom-rules input:disabled {
  cursor: default;
}
.custom-rules h4 {
  margin: 16px 0 6px;
  font-size: 15px;
}
/* game type: golf or one of the arena games */
.cr-types {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
  margin: 4px 0 10px;
}
.cr-types button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
  padding: 7px 9px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: #f4efe2;
  font: inherit;
  cursor: pointer;
}
.cr-types button .ico-img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin-bottom: 4px;
}
.cr-types button small {
  font-size: 11px;
  line-height: 1.2;
  opacity: 0.7;
}
.cr-types button.on {
  background: #fff4d6;
  border-color: #ffd23f;
}
/* team games in the lobby */
.team-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.plist li.team-pick {
  cursor: pointer;
}
.plist li.team-pick:hover .team-tag {
  filter: brightness(1.1);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
}
/* lives / flag in the player chips */
.ar-ico {
  width: 13px;
  height: 13px;
  vertical-align: -2px;
  margin-right: 1px;
}
/* stickers in the custom rules toggles, medals, and stickers inside toasts and headers */
.cr-tog > .ico-img {
  width: 40px;
  height: 40px;
  flex: none;
}
.ico-img.medal {
  width: 26px;
  height: 26px;
  vertical-align: middle;
}
.toast .ico-img,
.ranked-panel h2 .ico-img,
.gift-panel h2 .ico-img {
  width: 1.6em;
  height: 1.6em;
  vertical-align: middle;
}
.rk-me:empty {
  display: none;
}
/* month-end ranked results card */
.rk-result {
  width: min(420px, 100%);
  text-align: center;
}
.rk-res-medal .ico-img {
  width: 96px;
  height: 96px;
  animation: rk-pop 0.6s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}
@keyframes rk-pop {
  from {
    transform: scale(0.3) rotate(-20deg);
    opacity: 0;
  }
}
.rk-res-month {
  font-weight: 700;
  opacity: 0.65;
}
.rk-result h2 {
  margin: 2px 0 10px;
}
.rk-res-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.rk-res-stats span {
  display: flex;
  flex-direction: column;
  padding: 8px 4px;
  border-radius: 12px;
  background: #fff;
}
.rk-res-stats b {
  font-size: 20px;
}
.rk-res-stats small {
  opacity: 0.65;
}
.rk-result h3 {
  margin: 0 0 6px;
  text-align: left;
}
.rk-res-why {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: grid;
  gap: 6px;
  text-align: left;
}
.rk-res-why li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: #fff4d6;
  border: 3px solid #fff;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12);
}
.rk-res-why li > b {
  white-space: nowrap;
  font-size: 18px;
}
.rk-res-why .ico-img {
  width: 30px;
  height: 30px;
  vertical-align: middle;
}

/* ---------- tour, v2.5: the splash's sticker look ---------- */
.tour-chips li {
  position: relative;
  gap: 12px;
  padding: 8px 16px 8px 52px;
  background: #fffaf0;
  color: var(--text);
  border: 4px solid #fff;
  border-radius: 16px;
  backdrop-filter: none;
  box-shadow: 0 5px 0 rgba(15, 27, 48, 0.28), 0 10px 24px rgba(15, 27, 48, 0.25);
  transform: rotate(calc((var(--k) - 1.5) * 0.4deg));
}
.tour-chips li img {
  position: absolute;
  left: -10px;
  top: 50%;
  width: 54px;
  height: 54px;
  object-fit: contain;
  transform: translateY(-50%) rotate(-6deg);
  filter: drop-shadow(0 3px 0 rgba(15, 27, 48, 0.25));
}
.tour-title span {
  -webkit-text-stroke: 7px #fffdf3;
  paint-order: stroke fill;
}
.tour-sub {
  text-shadow: 0 2px 0 rgba(15, 27, 48, 0.55), 0 0 18px rgba(15, 27, 48, 0.5);
}
.tour-skip {
  background: #fffaf0;
  color: var(--text);
  border: 3px solid #fff;
  box-shadow: 0 3px 0 rgba(15, 27, 48, 0.3);
}
@media (max-width: 640px) {
  .tour-chips li {
    padding-left: 44px;
  }
  .tour-chips li img {
    width: 44px;
    height: 44px;
    left: -6px;
  }
}
.whatsnew .wn-ico {
  width: 28px;
  height: 28px;
  vertical-align: -8px;
  margin-right: 6px;
}

/* ---------- seasons (seasons.js) ---------- */
/* Halloween: a darker, purple tint over the menu's backdrop */
body.season-halloween #screen-title {
  background: radial-gradient(
    ellipse at 50% 30%,
    rgba(43, 21, 70, 0.55),
    rgba(8, 5, 18, 0.9)
  );
}
/* Halloween colours for every menu: night-purple panels and pumpkin buttons. Light cards inside
   the panels keep their dark text (the editor and admin keep their own look) */
/* the admin panel keeps its light look in every season, its screen takes the season's backdrop */
.admin-panel {
  --panel-bg: var(--panel);
  --panel-text: var(--text);
  --panel-muted: #6b7690;
  --panel-shadow: 0 8px 0 #c9b98f, 0 24px 60px rgba(0, 0, 0, 0.45);
}
body.season-halloween .screen.admin-screen {
  background: var(--screen-bg);
}
body.season-halloween .panel a {
  color: #ffb36b;
}
body:is(.season-halloween, .season-legends) .help-panel > :is(h2, h3),
body:is(.season-halloween, .season-legends) .help-panel .pu-group > h4 {
  color: inherit;
}
body:is(.season-halloween, .season-legends)
  .panel
  :is(
    .howto,
    .plist li,
    .pill,
    .gift-item,
    .pf-account,
    .course,
    .hole-card,
    .help-card,
    .help-tabs,
    .pu,
    .hz,
    .keys-grid > div,
    .mk-tabs,
    .mk-card,
    .shop-card,
    .pf-stats div,
    .ach,
    .daily-hole,
    .daily-board li,
    .set-card,
    .dr-day,
    .rk-me,
    .rk-board li,
    .rk-res-stats span,
    .rk-res-why li,
    .pf-badges span,
    .custom-rules,
    .tour-chips li,
    .season-lines li,
    .final li,
    kbd,
    tbody td,
    .box-bar,
    .bio-card:not(.bio-night),
    .bio-dots button
  ) {
  --muted: #6b7690;
  color: var(--text);
}
body.season-halloween {
  --button: #4b2a73;
  --button-lip: #26123f;
  --button-text: #f6ecff;
  --primary: #ff7a1f;
  --primary-lip: #a9480b;
  --secondary: #ffb52e;
  --secondary-lip: #b9760c;
  --on-secondary: #2a1600;
  --on-daily: #2a1600;
  --panel-bg: linear-gradient(180deg, #2d1747, #1b0e2c);
  --panel-text: #f6ecff;
  --panel-muted: #c7b3e3;
  --panel-shadow: inset 0 0 0 3px #4a2b6e, 0 8px 0 #0b0614,
    0 24px 60px rgba(0, 0, 0, 0.6);
  --screen-bg: radial-gradient(
    ellipse at center,
    rgba(43, 21, 70, 0.5),
    rgba(8, 5, 18, 0.88)
  );
  --overlay-bg: var(--screen-bg);
  --close: #3b2260;
  --close-hover: #3b2260;
  --close-text: #f6ecff;
  --dock-group: rgba(255, 255, 255, 0.05);
  --dock: #3b2260;
  --dock-lip: #140a22;
  --dock-text: #f6ecff;
  --dot: #ff7a1f;
  --input: #140a22;
  --input-line: #5b3a85;
  --input-text: #fff3e0;
  --name-input: #140a22;
  --name-line: #ff7a1f;
  --name-text: #fff3e0;
  --home-player: rgba(0, 0, 0, 0.28);
  --home-label: #ffb45e;
}
/* Gaming Legends: the "legends" theme in the design system */
body.season-legends {
  --button: #2c3190;
  --button-lip: #14174f;
  --button-text: #eef1ff;
  --primary: #e8332e;
  --primary-lip: #8f1614;
  --secondary: #ffcc2f;
  --secondary-lip: #b98a00;
  --on-secondary: #241a00;
  --on-daily: #241a00;
  --panel-bg: linear-gradient(180deg, #20246e, #121442);
  --panel-text: #eef1ff;
  --panel-muted: #b6bcef;
  --panel-shadow: inset 0 0 0 3px #3a40a8, 0 8px 0 #090a26,
    0 24px 60px rgba(0, 0, 0, 0.6);
  --screen-bg: radial-gradient(
    ellipse at center,
    rgba(32, 36, 110, 0.5),
    rgba(7, 8, 32, 0.88)
  );
  --overlay-bg: var(--screen-bg);
  --close: #2c3190;
  --close-hover: #2c3190;
  --close-text: #eef1ff;
  --dock-group: rgba(255, 255, 255, 0.05);
  --dock: #2c3190;
  --dock-lip: #0e1038;
  --dock-text: #eef1ff;
  --dot: #e8332e;
  --input: #0e1038;
  --input-line: #3f45a8;
  --input-text: #eef1ff;
  --name-input: #0e1038;
  --name-line: #ffcc2f;
  --name-text: #eef1ff;
  --home-player: rgba(0, 0, 0, 0.28);
  --home-label: #ffcc2f;
  --card-solid: #1a1d5c;
}
body.season-legends #screen-title {
  background: radial-gradient(ellipse at 50% 30%, rgba(32, 36, 110, 0.55), rgba(7, 8, 32, 0.9));
}
body.season-legends .panel a {
  color: #ffcc2f;
}
body.season-legends .btn.daily-btn {
  background: linear-gradient(90deg, #ffe07a, #ffcc2f);
  color: #241a00;
  box-shadow: 0 4px 0 #b98a00;
}
body.season-legends :is(input#name, input#code)::placeholder {
  color: #8f95d6;
}
body.season-legends .name-field > span {
  color: #ffcc2f;
}
body.season-legends .name-field input#name {
  border-color: #ffcc2f;
  box-shadow: 0 4px 0 #b98a00;
}
body.season-legends #card-table tr.par td {
  color: #b6bcef;
}
body:is(.season-halloween, .season-legends) .btn.secondary:active {
  box-shadow: 0 1px 0 var(--secondary-lip);
}
body.season-halloween .btn.daily-btn {
  background: linear-gradient(90deg, #ffcf70, #ff9a2e);
  color: #2a1600;
  box-shadow: 0 4px 0 #b25a0c;
}
body:is(.season-halloween, .season-legends) .btn.ghost {
  color: inherit;
}
body.season-halloween :is(input#name, input#code)::placeholder {
  color: #8f7aae;
}
body.season-halloween .name-field > span {
  color: #ff9a3d;
}
body.season-halloween .name-field input#name {
  border-color: #ff7a1f;
  box-shadow: 0 4px 0 #a9480b;
}

/* ---------- season news ("Halloween is here!") ---------- */
.season-panel {
  width: min(760px, 100%);
  text-align: center;
}
.season-title {
  margin: 4px 0 6px;
  font-size: clamp(34px, 7vw, 56px);
  line-height: 1;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #ff8a3d;
  -webkit-text-stroke: 8px #fffdf3;
  paint-order: stroke fill;
  text-shadow: 0 6px 0 rgba(43, 21, 70, 0.55);
  animation: season-pop 0.7s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}
@keyframes season-pop {
  from {
    transform: scale(0.6) rotate(-4deg);
    opacity: 0;
  }
}
.season-sub {
  margin: 0 auto 14px;
  max-width: 560px;
  font-size: 17px;
}
.season-lines {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: grid;
  gap: 10px;
  text-align: left;
}
.season-lines li {
  position: relative;
  padding: 10px 14px 10px 66px;
  min-height: 46px;
  display: flex;
  align-items: center;
  border-radius: 16px;
  border: 4px solid #fff;
  background: #fff4d6;
  box-shadow: 0 4px 0 rgba(15, 27, 48, 0.18);
  transform: rotate(calc((var(--k) - 2) * 0.35deg));
  animation: tour-chip 0.45s cubic-bezier(0.3, 1.4, 0.5, 1) both;
  animation-delay: calc(0.2s + var(--k) * 0.07s);
}
.season-lines img {
  position: absolute;
  left: -8px;
  top: 50%;
  width: 62px;
  height: 62px;
  object-fit: contain;
  transform: translateY(-50%) rotate(-6deg);
  filter: drop-shadow(0 3px 0 rgba(15, 27, 48, 0.25));
}
.season-btns {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.season-btns .btn.big {
  flex: 1 1 240px;
  width: auto;
  margin-top: 0;
}
/* Halloween dresses the panel for the night */
body:not(.season-halloween) .season-news-halloween .season-panel {
  background: linear-gradient(180deg, #2b1546, #160c2a);
  color: #f3eaff;
  box-shadow: 0 8px 0 #0b0717, 0 24px 60px rgba(0, 0, 0, 0.6);
}
.season-news-halloween .season-lines li {
  background: #fffaf0;
  color: var(--text);
}
body:not(.season-halloween) .season-news-halloween .close {
  background: #3b2260;
  color: #f3eaff;
}
.season-news-legends .sp-pack::before {
  background: conic-gradient(#ffcc2f, #35b8ff, #e8332e, #5cbf5a, #ffcc2f);
}
.season-news-legends .sp-pack::after {
  background: radial-gradient(ellipse at top, rgba(255, 204, 47, 0.22), transparent 60%), #121442;
}
/* the season's ball packs: a glowing frame running round each pack, balls spinning in one by one */
.season-packs {
  display: grid;
  gap: 14px;
  margin: 4px 0 18px;
}
.sp-pack {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 20px;
  padding: 12px 12px 10px;
  animation: tour-chip 0.5s cubic-bezier(0.3, 1.4, 0.5, 1) both;
  animation-delay: calc(0.15s + var(--k) * 0.15s);
}
.sp-pack::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 200%;
  aspect-ratio: 1;
  translate: -50% -50%;
  z-index: -2;
  background: conic-gradient(#ff7a1f, #9b5cff, #7cff4a, #ff3b30, #ff7a1f);
  animation: sp-spin 5s linear infinite;
}
.sp-pack::after {
  content: "";
  position: absolute;
  inset: 3px;
  z-index: -1;
  border-radius: 17px;
  background: radial-gradient(
      ellipse at 50% 0%,
      rgba(255, 138, 61, 0.3),
      transparent 70%
    ),
    #1a0d2b;
}
.sp-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  text-align: left;
}
.sp-head > img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.35));
  animation: sp-wiggle 2.4s ease-in-out infinite;
}
.sp-head > div > b {
  display: block;
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #ffb36b;
  text-shadow: 0 3px 0 #5a1f00;
}
.sp-head small {
  font-size: 14px;
  color: #d9c8f2;
}
.sp-head small b {
  color: #7cff4a;
}
.sp-balls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 4px;
  /* big packs split evenly over two rows */
  width: min(100%, calc(var(--cols, 6) * var(--sp-ball, 76px) + (var(--cols, 6) - 1) * 4px));
  margin-inline: auto;
}
.sp-ball {
  margin: 0;
  width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: default;
  animation: sp-pop 0.6s cubic-bezier(0.3, 1.6, 0.5, 1) both;
  animation-delay: calc(0.45s + var(--i) * 0.06s);
}
.sp-ball img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--r), 0 0 14px 2px var(--r),
    0 5px 0 rgba(0, 0, 0, 0.35);
  animation: sp-bob 2.2s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.23s);
  transition: scale 0.2s, rotate 0.2s;
}
.sp-ball.r-legendary img {
  animation: sp-bob 2.2s ease-in-out infinite,
    sp-glow 1.2s ease-in-out infinite alternate;
  animation-delay: calc(var(--i) * -0.23s), 0s;
}
.sp-ball:hover img {
  scale: 1.18;
  rotate: -10deg;
}
.sp-ball figcaption {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  color: #f3eaff;
}
@keyframes sp-pop {
  from {
    opacity: 0;
    transform: scale(0.2) rotate(-200deg);
  }
}
@keyframes sp-bob {
  50% {
    translate: 0 -6px;
  }
}
@keyframes sp-glow {
  to {
    box-shadow: 0 0 0 3px var(--r), 0 0 28px 8px var(--r),
      0 5px 0 rgba(0, 0, 0, 0.35);
  }
}
@keyframes sp-spin {
  to {
    transform: rotate(1turn);
  }
}
@keyframes sp-wiggle {
  50% {
    rotate: 8deg;
    scale: 1.08;
  }
}
@media (max-width: 640px) {
  .sp-balls {
    --sp-ball: 62px;
  }
  .sp-ball {
    width: 62px;
  }
  .sp-ball img {
    width: 48px;
    height: 48px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sp-pack::before,
  .sp-head > img,
  .sp-ball,
  .sp-ball img {
    animation: none;
  }
}

/* ---------- sign-in prompt (guests, once per visit) and the lobby hint ---------- */
.signin-panel {
  max-width: 460px;
  text-align: center;
}
.signin-panel .pf-account {
  text-align: left;
  margin: 12px 0;
}
.signin-panel > .btn[data-x] {
  margin-top: 4px;
}
.lobby-signin {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.lobby-signin[hidden] {
  display: none;
}

/* ---------- profile: manage account (change email, delete) ---------- */
.pf-manage {
  grid-column: 1 / -1;
  font-size: 14px;
}
.pf-manage summary {
  cursor: pointer;
  font-weight: 700;
  opacity: 0.75;
}
.pf-manage[open] {
  display: grid;
  gap: 8px;
}
.pf-manage .note {
  margin: 4px 0 0;
}
.btn.danger {
  background: #ffe1e1;
  color: #b3261e;
  justify-self: start;
}

/* ---------- game dialog (instead of the browser's confirm / prompt / alert) ---------- */
.game-dialog {
  z-index: 500;
}
.dialog-preview {
  display: block;
  margin: 4px auto 0;
  border-radius: 14px;
  border: 3px solid #fff;
  max-width: 100%;
}
.dialog-panel {
  max-width: 420px;
  text-align: center;
}
.dialog-panel h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.dialog-panel h2 .ico-img {
  width: 2.2em;
  height: 2.2em;
}
.dialog-input {
  width: 100%;
  margin: 6px 0 4px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 3px solid #fff;
  font: inherit;
  text-align: center;
}
.dialog-btns {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.dialog-btns .btn {
  flex: 1 1 auto;
  min-width: 120px;
  white-space: nowrap;
}
.daily-prize {
  white-space: nowrap;
}
.dialog-buy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* editor: tools and buttons that don't apply (golf-only on an arena map and the other way round) */
.ed-tool[hidden],
.ed-group[hidden],
.ed-top [hidden] {
  display: none !important;
}

/* ---------- v2.9: phones ---------- */
/* the in-game buttons fold behind one menu button on a phone (they overlapped the power-ups) */
.hud-menu-btn {
  display: none;
}
.burger {
  display: grid;
  gap: 4px;
  width: 18px;
}
.burger i {
  display: block;
  height: 3px;
  border-radius: 2px;
  background: var(--ink, #1d2a44);
  transition: transform 0.2s, opacity 0.2s;
}
.hud-left.open .burger i:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hud-left.open .burger i:nth-child(2) {
  opacity: 0;
}
.hud-left.open .burger i:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
/* the fold headers are plain headings on bigger screens */
.fold-sum {
  display: none;
}
@media (max-width: 640px) {
  .fold-sum {
    display: inline;
  }
}
@media (max-width: 640px) {
  /* notifications: small, at most two lines, two at a time (main.js toast) */
  #toasts {
    top: 96px;
    max-width: 88vw;
    gap: 5px;
  }
  .toast {
    font-size: 13px;
    line-height: 1.25;
    padding: 5px 11px;
    border-radius: 10px;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.22);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
  }
  .toast .ico-img {
    width: 1.35em;
    height: 1.35em;
  }
  .toast .combo-ico {
    width: 26px;
    height: 26px;
  }
  /* effect chips sit just above the power-ups (a later "top: 100px" won over the old "top: auto") */
  #fx {
    top: auto;
    right: 12px;
  }
  #fx .fx {
    font-size: 12px;
    padding: 2px 8px;
  }

  /* shop, profile looks: two cards per row */
  .shop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .shop-card {
    padding: 6px;
  }
  .shop-card .shop-info {
    flex-wrap: wrap;
    gap: 2px 6px;
  }
  .shop-card .shop-info b {
    font-size: 13px;
    line-height: 1.15;
  }
  .shop-card .btn {
    font-size: 13px;
    padding: 6px 8px;
  }

  /* in-game menu: one button, the rest opens upwards above it */
  .hud-menu-btn {
    display: grid;
    place-items: center;
  }
  .hud-left {
    flex-direction: column-reverse;
    align-items: flex-start;
  }
  .hud-left > .icon-btn:not(.hud-menu-btn) {
    display: none;
  }
  .hud-left.open > .icon-btn:not(.hud-menu-btn) {
    display: grid;
    place-items: center;
    animation: pop 0.2s;
  }

  /* custom game types: two per row, smaller pictures */
  .cr-types {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cr-types button {
    padding: 6px;
  }
  .cr-types button .ico-img {
    width: 64px;
    height: 64px;
  }
  .cr-types button b {
    font-size: 13px;
  }
  .cr-types button small {
    font-size: 10.5px;
  }

  /* lobby: Tee off stays in reach at the bottom, Mode and Course fold away */
  #start-btn {
    position: sticky;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 5;
    box-shadow: 0 6px 0 #b4561f, 0 10px 24px rgba(0, 0, 0, 0.45);
  }
  .fold-h {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 8px 12px;
    margin: 10px 0 6px;
  }
  .fold-h::after {
    content: "";
    width: 9px;
    height: 9px;
    border-right: 3px solid currentColor;
    border-bottom: 3px solid currentColor;
    transform: rotate(45deg);
    margin: -4px 4px 0 auto;
    transition: transform 0.2s;
  }
  .folded > .fold-h::after {
    transform: rotate(-45deg);
    margin-top: 0;
  }
  .fold-sum {
    font-size: 13px;
    font-weight: 700;
    opacity: 0.75;
    text-align: right;
  }
  .folded > :not(.fold-h) {
    display: none !important;
  }
}

/* Lucky Clover: pick 2 of 3 */
.clover-pick {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 4px;
}
.clover-pick button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 6px;
  border-radius: 12px;
  border: 3px solid transparent;
  background: #f4efe2;
  font: inherit;
  cursor: pointer;
  text-align: center;
}
.clover-pick button .ico-img {
  width: 54px;
  height: 54px;
}
.clover-pick button b {
  font-size: 14px;
}
.clover-pick button small {
  font-size: 11px;
  line-height: 1.2;
  opacity: 0.7;
}
.clover-pick button.on {
  background: #fff4d6;
  border-color: #ffd23f;
}
.dialog-btns .btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* power-up card over the bag (hover / long-press) */
#pu-tip {
  position: fixed;
  z-index: 60;
  width: min(300px, calc(100vw - 16px));
  padding: 12px 14px;
  border-radius: 16px;
  background: #fffaf0;
  color: #1d2a44;
  border: 3px solid #fff;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.18), 0 14px 30px rgba(0, 0, 0, 0.3);
  font-size: 14px;
  pointer-events: none;
  animation: pt-in 0.15s ease-out;
}
@keyframes pt-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
#pu-tip p {
  margin: 6px 0 0;
}
.pt-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pt-head .ico-img {
  width: 44px;
  height: 44px;
}
.pt-head b {
  display: block;
  font-size: 17px;
}
.pt-head small,
.pt-combos small {
  opacity: 0.6;
  font-weight: 700;
}
.pt-how {
  font-weight: 700;
  color: #2b7a4b;
}
.pt-combos {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 2px dashed #e6dabd;
}

/* chat */
.chat-form {
  display: flex;
  gap: 8px;
  width: 100%;
  margin: 8px 0 2px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}
.chat-form input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 12px;
  border: 2px solid #e6dabd;
  font: inherit;
  font-size: 15px;
}
#chat-feed {
  position: fixed;
  left: 12px;
  top: 104px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: min(360px, calc(100vw - 24px));
  pointer-events: none;
}
.chat-line {
  padding: 7px 12px;
  border-radius: 12px;
  background: rgba(15, 27, 48, 0.82);
  color: #fff;
  font-size: 14px;
  overflow-wrap: anywhere;
  animation: pt-in 0.15s ease-out;
  transition: opacity 0.6s;
}
.chat-line.old {
  opacity: 0;
}
.emote-bar .chat-form button {
  height: auto;
  padding: 8px 14px;
}

/* ---------- v2.9.2 mobile ---------- */
/* nothing on the page can be selected, dragged out or saved by a long-press (inputs still work) */
body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
img,
canvas {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}
input,
textarea,
[contenteditable] {
  -webkit-user-select: text;
  user-select: text;
}
/* your turn: a glowing frame round the screen and a badge that stays above help and cards */
#turn-cue {
  position: fixed;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  z-index: 70;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--sun, #ffd23f);
  color: #3a2600;
  font-weight: 800;
  box-shadow: 0 4px 0 #c99700;
  pointer-events: none;
  animation: turn-pulse 1.2s ease-in-out infinite;
}
#turn-cue[hidden] {
  display: none;
}
body.my-turn #hud::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 4px rgba(255, 210, 63, 0.85), inset 0 0 28px rgba(255, 210, 63, 0.45);
  animation: turn-pulse 1.6s ease-in-out infinite;
}
@keyframes turn-pulse {
  50% {
    opacity: 0.55;
  }
}
.pass-menu-btn {
  display: none;
}
@media (max-width: 640px) {
  /* the skip buttons keep clear of the bag; skipping your turn lives in the menu */
  .skip-btn {
    bottom: 176px;
  }
  .pass-btn {
    display: none !important;
  }
  .hud-left.open > .pass-menu-btn:not([hidden]) {
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    background: var(--coral, #ff5a5f);
  }
  /* 8 players: one scrolling row of small chips (name, strokes) */
  #hud-players {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 4px;
  }
  #hud-players::-webkit-scrollbar {
    display: none;
  }
  .pchip {
    flex: none;
    gap: 4px;
    padding: 2px 7px;
    font-size: 12px;
  }
  .pchip .pn {
    max-width: 56px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .pchip .ps,
  .pchip .pfx {
    display: none;
  }
  .pchip.is-turn {
    outline: 2px solid var(--sun, #ffd23f);
  }
  /* biomes help: the card fits the screen */
  .bio-card {
    min-width: 0;
    padding: 10px;
  }
  .bio-card * {
    min-width: 0;
  }
  .bio-card .hz-list,
  .bio-card .pu-list,
  .bio-card [class$="-list"] {
    grid-template-columns: 1fr !important;
  }
  .bio-dots button b {
    display: none;
  }
}
/* quips from players whose ball is already in the cup */
#quip-side {
  position: fixed;
  left: 12px;
  top: 40%;
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.quip-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: pop 0.25s;
}
.quip-side .ico-img {
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.25));
}
.quip-side b {
  margin-top: -6px;
  padding: 1px 8px;
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* power-ups that fuse into a combo: a wiggle and a badge */
.slot.fuse .ico .ico-img {
  animation: fuse-wiggle 0.9s ease-in-out infinite;
}
@keyframes fuse-wiggle {
  0%,
  100% {
    transform: rotate(-8deg);
  }
  50% {
    transform: rotate(8deg) scale(1.06);
  }
}
.fuse-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 2;
  padding: 1px 6px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffd23f, #ff5a5f);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}
button.fx {
  border: 0;
  font: inherit;
  cursor: pointer;
}
/* shop: how you look now, and filters */
.shop-you {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 4px 0 8px;
}
.shop-look {
  width: 100%;
  height: auto;
  border-radius: 14px;
}
.shop-you small {
  opacity: 0.65;
  font-weight: 700;
}
.shop-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0 10px;
}
.shop-filters[hidden],
.shop-filters select[hidden] {
  display: none;
}
.shop-filters select {
  padding: 6px 10px;
  border-radius: 10px;
  border: 2px solid #e6dabd;
  font: inherit;
  font-weight: 700;
}
.shop-filters .cr-seg button {
  color: #1d2a44;
  opacity: 0.75;
}
.shop-filters .cr-seg button.on {
  opacity: 1;
}
/* help panes never grow wider than the view (the biome dots used to push the Biomes tab to 880px) */
.help-pane,
.bio-dots,
.bio-view {
  min-width: 0;
}

/* ---------- v2.9.3 phones ---------- */
/* scorecard: names and the total stay put while the holes scroll */
#card-table th:first-child,
#card-table td:first-child,
#card-table tr > :last-child {
  position: sticky;
  z-index: 1;
}
#card-table th:first-child,
#card-table td:first-child {
  left: 0;
}
#card-table tr > :last-child {
  right: 0;
}
#card-table th:first-child,
#card-table th:last-child,
#card-table tr.par td:first-child,
#card-table tr.par td:last-child {
  background: var(--card-solid, #fffcf4);
}
body.season-halloween {
  --card-solid: #2c1746;
}
/* the par row sits on the dark card, not on a white cell: light text */
body.season-halloween #card-table tr.par td {
  color: #c7b3e3;
}
/* What's new: older versions fold away */
.wn-older > summary {
  cursor: pointer;
  margin: 14px 0 4px;
  font-weight: 800;
  color: var(--violet);
}
/* custom setup: the fold button for the power-up picker only shows on phones */
.cr-fold {
  display: none;
}
body.my-turn #hud::after {
  box-shadow: inset 0 0 0 7px rgba(255, 210, 63, 0.9), inset 0 0 44px 8px rgba(255, 210, 63, 0.5);
}
.fuse-badge {
  font-size: 11px;
}
.dock-btn .coin-badge {
  font-size: 11.5px;
}
@media (max-width: 640px) {
  /* the tee is at the bottom of the screen: only the bag stays down there, the turn pill and the
     status chips sit under the player row at the top */
  .turn {
    top: 80px;
    bottom: auto;
    left: 8px;
    transform: none;
    max-width: calc(100vw - 16px);
  }
  .turn.mine {
    box-shadow: 0 0 0 3px var(--sun), 0 4px 0 rgba(0, 0, 0, 0.25);
  }
  #fx {
    top: 80px;
    bottom: auto;
    left: auto;
    right: 8px;
    justify-content: flex-end;
    max-width: calc(100vw - 180px);
  }
  #fx .fx {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 13px;
  }
  .skip-btn {
    bottom: 118px;
  }
  #toasts {
    top: 120px;
  }
  #chat-feed {
    top: 124px;
    left: 8px;
  }
  /* bigger text and tap targets */
  .slot:has(.ico-img) .lbl {
    font-size: 10.5px;
  }
  .pu-group h4 small {
    font-size: 12.5px;
  }
  .help-tabs button {
    min-height: 40px;
  }
  .cr-seg button {
    min-height: 38px;
  }
  /* custom setup: the power-up picker folds, four to a row */
  .cr-fold {
    display: inline-block;
    margin-left: auto;
    border: 0;
    border-radius: 10px;
    padding: 8px 12px;
    min-height: 38px;
    background: #efe6cf;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    color: var(--text);
    cursor: pointer;
  }
  .cr-fold::after {
    content: " ▾";
  }
  .cr-pu-wrap:not(.folded) .cr-fold::after {
    content: " ▴";
  }
  .cr-h-pu {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
  }
  .cr-pu-wrap.folded > .cr-pu {
    display: none;
  }
  .cr-pu {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }
  .cr-pu button {
    padding: 4px 2px;
  }
  .cr-pu .ico-img {
    width: 30px;
    height: 30px;
  }
  .cr-pu small {
    font-size: 10.5px;
    overflow-wrap: anywhere;
  }
  .cr-tog {
    padding: 6px 8px;
    gap: 8px;
  }
  .cr-tog > .ico-img {
    width: 32px;
    height: 32px;
  }
}
/* iPhone keyboard: the quips/chat bar rises above it (main.js sets --kb) */
.emote-bar {
  margin-bottom: var(--kb, 0px);
}

/* a phone on its side: a short screen, so the HUD runs along the edges. Hole and players in one
   row at the top, status chips down the left, the bag down the right, the turn pill at the bottom */
@media (max-height: 500px) and (orientation: landscape) {
  .hud-top {
    top: 6px;
    left: calc(8px + env(safe-area-inset-left));
    right: calc(8px + env(safe-area-inset-right));
    gap: 6px;
    flex-wrap: nowrap;
  }
  .hud-logo,
  .hint,
  .turn .hint2 {
    display: none;
  }
  .pill {
    font-size: 13px;
    padding: 3px 9px;
  }
  #hud-players {
    flex: 1;
    min-width: 0;
    margin-left: 0;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 4px;
  }
  #hud-players::-webkit-scrollbar {
    display: none;
  }
  .pchip {
    flex: none;
    gap: 4px;
    padding: 2px 7px;
    font-size: 12px;
  }
  .pchip .pn {
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .pchip .ps,
  .pchip .pfx {
    display: none;
  }
  .pchip.is-turn {
    outline: 2px solid var(--sun, #ffd23f);
  }
  .turn {
    top: auto;
    bottom: calc(8px + env(safe-area-inset-bottom));
    font-size: 14px;
    padding: 4px 12px;
  }
  .turn.mine {
    box-shadow: 0 0 0 3px var(--sun), 0 4px 0 rgba(0, 0, 0, 0.25);
  }
  #fx {
    top: 46px;
    bottom: auto;
    left: calc(8px + env(safe-area-inset-left));
    right: auto;
    flex-direction: column;
    max-width: 84px;
  }
  #fx .fx {
    font-size: 12px;
    padding: 4px 8px;
  }
  .hud-bottom {
    left: calc(8px + env(safe-area-inset-left));
    right: calc(8px + env(safe-area-inset-right));
    bottom: calc(8px + env(safe-area-inset-bottom));
    justify-content: flex-end;
  }
  #inv {
    flex-direction: column;
    gap: 6px;
  }
  .slot {
    width: 60px;
    height: 52px;
  }
  .slot:has(.ico-img) {
    height: 42px;
    margin-top: 22px;
  }
  .slot:has(.ico-img) .lbl {
    font-size: 10.5px;
    max-width: 58px;
  }
  .slot .ico:has(.ico-img) {
    bottom: 22px;
  }
  .slot .ico .ico-img {
    width: 48px;
    height: 48px;
  }
  .icon-btn {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }
  /* in-game menu: one button, the rest opens sideways along the bottom (clear of the chips) */
  .hud-menu-btn {
    display: grid;
    place-items: center;
  }
  .hud-left {
    flex-direction: row;
    align-items: flex-end;
    gap: 4px;
  }
  .hud-left > .icon-btn:not(.hud-menu-btn) {
    display: none;
  }
  .hud-left.open > .icon-btn:not(.hud-menu-btn) {
    display: grid;
    place-items: center;
    animation: pop 0.2s;
  }
  .pass-btn {
    display: none !important;
  }
  .hud-left.open > .pass-menu-btn:not([hidden]) {
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    background: var(--coral, #ff5a5f);
  }
  .skip-btn {
    bottom: 52px;
    right: 84px;
    font-size: 15px;
    padding: 6px 12px;
  }
  .emote-bar {
    bottom: 52px;
    left: 52px;
  }
  #toasts {
    top: 44px;
  }
  #chat-feed {
    top: 46px;
    left: 100px;
  }
}
/* stickers inside the Tee off / practice / skip buttons (gone until the art exists, then plain text) */
.btn .btn-stk {
  width: 1.7em;
  height: 1.7em;
  margin: -0.45em 0 -0.45em 0.1em;
  vertical-align: middle;
}
.skip-btn .ico-img {
  width: 1.5em;
  height: 1.5em;
  margin: -0.35em 0.25em -0.35em -0.3em;
  vertical-align: middle;
}
/* phones: a combo card stacks, the sticker sum on top (smaller, centred), the text below */
@media (max-width: 640px) {
  .pu.combo {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 10px;
  }
  .pu.combo .combo-sum {
    justify-content: center;
    padding-top: 4px;
  }
  .pu.combo .combo-sum .ico-img {
    width: 3em;
    height: 3em;
    margin: -6px -2px;
  }
  .pu.combo .combo-sum i {
    margin: 0 12px 0 6px;
  }
  .pu.combo > div {
    min-width: 0;
    text-align: center;
  }
}
/* ranked results: confetti for a top-10 finish, the month's podium */
.rk-confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.rk-confetti i {
  position: absolute;
  top: -20px;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  opacity: 0;
  animation: rk-fall linear forwards;
}
@keyframes rk-fall {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg);
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--sx, 0), 105vh) rotate(var(--rot, 360deg));
  }
}
#screen-ranked-result .panel {
  position: relative;
  z-index: 2;
}
.rk-res-beat {
  margin: -4px 0 10px;
  font-weight: 700;
  opacity: 0.85;
}
.rk-res-podium h3 {
  margin-top: 12px;
}
.rk-res-podium .rk-hall-list span.me {
  outline: 2px solid var(--sun);
  border-radius: 10px;
}
@media (prefers-reduced-motion: reduce) {
  .rk-confetti {
    display: none;
  }
}
/* game dialogs also open over the level editor (z-index 40) and the admin page */
.screen.overlay.game-dialog {
  z-index: 90;
}
/* profile: more stat groups (arena, tricks) and secret achievements */
.pf-group {
  margin: 14px 0 6px;
}
.pf-stats.pf-more {
  min-width: 0;
}
.ach.secret {
  opacity: 0.8;
  border: 2px dashed rgba(155, 92, 255, 0.5);
}
.ach.secret .ach-ico .ico-img {
  filter: grayscale(0.4);
}

/* editor: tips you can close, and the phone menu. On a big screen the menu's buttons just sit in
   the top bar, in their usual places */
.ed-hint {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ed-hint[hidden] {
  display: none;
}
.ed-hint-x {
  display: none;
  flex: none;
  pointer-events: auto;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.ed-menu {
  display: contents;
}
.ed-burger,
.ed-tips {
  display: none;
}
.ed-spacer {
  order: 1;
}
.ed-undo {
  order: 2;
}
.ed-late {
  order: 3;
}
.ed-btn.save,
.ed-top > .ed-btn.test {
  order: 4;
}
.ed-last {
  order: 5;
}
@media (max-width: 960px), (pointer: coarse) {
  .ed-top {
    position: relative;
    z-index: 30;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 6px 8px;
  }
  .ed-top > .ed-btn {
    flex: none;
    padding: 6px 9px;
    font-size: 14px;
  }
  .ed-name {
    flex: 1 1 60px;
    min-width: 60px;
    width: auto;
    font-size: 15px;
  }
  .ed-spacer {
    display: none;
  }
  .ed-burger {
    display: inline-flex;
    align-items: center;
    order: 6;
  }
  .ed-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 8px;
    width: min(440px, calc(100vw - 16px));
    grid-template-columns: 1fr 1fr;
    max-height: calc(100vh - 70px);
    max-height: calc(100dvh - 70px);
    overflow-y: auto;
    padding: 10px;
    gap: 8px;
    background: #fffcf4;
    border-radius: 0 0 14px 14px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  }
  .ed-top.menu-on .ed-menu {
    display: grid;
  }
  .ed-modal {
    z-index: 40;
  }
  .ed-menu > * {
    order: 0;
    width: 100%;
    min-height: 40px;
  }
  .ed-menu .ed-par {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .ed-menu .ed-par select {
    min-width: 0;
    max-width: 170px;
  }
  .ed-tips {
    display: block;
  }
  .ed-hint-x {
    display: block;
  }
  .ed-hint {
    max-width: calc(100% - 16px);
    width: max-content;
    padding: 5px 6px 5px 12px;
    font-size: 13px;
    text-align: left;
    z-index: 2;
  }
}
/* ---------- home screen: who you are on top, then play, then the rest by what it's for ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.panel.title-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}
.home-top {
  display: contents;
}
.home-player {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 5px 7px 5px 5px;
  border-radius: 999px;
  background: var(--home-player);
}
.home-ava {
  flex: none;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  transition: transform 0.12s;
}
.home-ava:hover {
  transform: scale(1.08);
}
.home-ava .ico-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.home-name {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  color: var(--name-text, inherit);
}
.home-name input#name {
  width: 100%;
  min-width: 0;
  height: 42px;
  margin: 0;
  padding: 0 26px 0 8px;
  font-size: 20px;
  font-weight: 800;
  text-align: left;
  color: inherit;
  border: 2px solid transparent;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
}
.home-name input#name:focus,
.home-name input#name:placeholder-shown {
  border-color: var(--name-line);
  background: var(--name-input);
  color: var(--input-text);
  outline: 0;
}
.home-name svg {
  position: absolute;
  right: 8px;
  opacity: 0.55;
  pointer-events: none;
}
.home-pill {
  flex: none;
  display: flex;
  align-items: center;
  gap: 5px;
  height: 44px;
  padding: 0 12px 0 6px;
  border: 0;
  border-radius: 999px;
  background: var(--secondary);
  box-shadow: 0 2px 0 var(--secondary-lip);
  color: var(--on-daily);
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}
.home-pill .coin-badge {
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  background: none;
  box-shadow: none;
  color: inherit;
  font-size: inherit;
  line-height: 1;
}
.home-pill .coin-badge img {
  width: 28px;
  height: 28px;
  margin: 0;
}
.home-pill span::before {
  content: "· ";
}
.title-panel .logo {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  min-width: 0;
}
.title-panel .logo-img {
  width: min(100%, 240px);
  margin: 0 auto;
}
.home-icons {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.home-icons .dock-btn {
  flex: none;
  width: 50px;
  height: 50px;
  padding: 0;
}
.home-icons .dock-btn small {
  display: none;
}
.home-icons .dock-btn span {
  font-size: 13px;
  line-height: 0;
}
.home-play,
.home-shelves,
.title-panel > .note {
  grid-column: 1 / -1;
}
.title-panel > .note {
  margin: 0;
}
.home-label {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  color: var(--home-label);
}
.home-play .btn-row {
  margin: 0;
}
.home-play .join-row {
  margin: 0;
}
.home-shelves {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.home-shelf .dock-group {
  flex-direction: row;
}
/* every tile the same height, whatever it holds and whichever shelf it's on */
.home-shelf .dock-btn {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  height: 104px;
  padding: 4px 2px;
  justify-content: center;
}
.dock-btn.home-daily {
  flex-grow: 1.3;
  background: var(--secondary);
  box-shadow: 0 2px 0 var(--secondary-lip);
  color: var(--on-daily);
}
.home-tries {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.8;
  line-height: 1;
}
.home-tries:empty {
  display: none;
}
/* a phone: tight enough that the shelves are in reach */
@media (max-width: 699px) {
  .panel.title-panel {
    gap: 8px;
    padding: 12px 14px 14px;
  }
  .title-panel .logo-img {
    width: min(100%, 190px);
  }
  .home-play .btn-row .btn > .ico-img {
    width: 2.4em;
    height: 2.4em;
  }
  .home-play .btn-row .btn {
    padding: 6px 8px 8px;
  }
  .home-shelf .dock-btn {
    height: 84px;
  }
  .home-shelf .dock-btn .ico-img {
    width: 2.3em;
    height: 2.3em;
  }
  .home-shelves {
    gap: 6px;
  }
  .home-label {
    margin-bottom: 3px;
  }
}
@media (min-width: 700px) {
  .panel.title-panel {
    width: min(820px, 100%);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 32px;
    row-gap: 14px;
    padding: 18px 36px 20px;
  }
  .home-top {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .home-player {
    flex: 0 1 400px;
  }
  .home-icons {
    flex-direction: row;
  }
  /* a phone on its side: everything a bit smaller so less has to scroll */
  @media (max-height: 520px) {
    .panel.title-panel {
      row-gap: 8px;
      padding: 10px 24px 12px;
    }
    .panel.title-panel .logo-img {
      width: min(100%, 190px);
    }
    .panel.title-panel .home-play .btn-row .btn {
      padding: 4px 8px 6px;
    }
    .panel.title-panel .home-play .btn-row .btn > .ico-img {
      width: 2.6em;
      height: 2.6em;
    }
    .home-shelf .dock-btn .ico-img {
      width: 2.2em;
      height: 2.2em;
    }
    .panel.title-panel .home-shelf .dock-btn {
      height: 80px;
    }
  }
  .title-panel .logo-img {
    width: min(100%, 300px);
  }
  .home-play {
    grid-column: 2;
    grid-row: 2;
  }
  .home-shelves {
    flex-direction: row;
    gap: 12px;
  }
  .home-shelf {
    flex: 2 1 0;
    min-width: 0;
  }
  .home-shelf.home-compete {
    flex-grow: 3.2;
  }
  .home-play .btn-row .btn {
    padding: 12px 10px;
  }
  .home-play .btn-row .btn > .ico-img {
    width: 4.2em;
    height: 4.2em;
  }
}
#hud-daily-time[hidden] {
  display: none;
}
#hud-daily-time b {
  font-variant-numeric: tabular-nums;
}
/* the menus sit on a still pattern, so the corner stickers can bob without anything being blurred
   over and over. The panels need to stay easy to read, hence the dim layer on top */
body.menu-bg {
  background: #322968 var(--menu-pattern, url("img/bg/mayhem.webp")) 0 0 / 700px;
}
body.menu-bg canvas#game {
  visibility: hidden;
}
#screen-title,
body.season-halloween #screen-title {
  backdrop-filter: none;
  background: rgba(15, 12, 35, 0.7);
}
@media (max-width: 699px) {
  body.menu-bg {
    background-size: 480px;
  }
}
.title-panel > .floaty {
  filter: none;
  will-change: transform;
}
/* the corner stickers stay off the player bar and the buttons */
@media (min-width: 900px) {
  .title-panel > .floaty.tl {
    left: -128px;
    top: 4px;
  }
  .title-panel > .floaty.bl {
    left: -104px;
  }
}

/* editor: floating buttons on phones, for what has a keyboard shortcut on a computer */
.ed-float {
  display: none;
}
@media (max-width: 960px), (pointer: coarse) {
  .ed-float {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 5px;
    border-radius: 14px;
    background: rgba(15, 27, 48, 0.85);
  }
  .ed-float[hidden],
  .ed-float button[hidden],
  .ed-float.closed button:not(.ed-float-x) {
    display: none;
  }
  .ed-float-x svg {
    transition: transform 0.15s;
  }
  .ed-float.closed .ed-float-x svg {
    transform: rotate(180deg);
  }
  .ed-float button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
  }
}
/* a short screen without the side panel: the buttons side by side, so they don't run off it */
@media (max-height: 620px) and (max-width: 760px) {
  .ed-float:not(.closed) {
    display: grid;
    grid-template-columns: repeat(3, 44px);
  }
}
.ed-tool.folded:not(.on) {
  display: none;
}
button.ed-group {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  font-family: inherit;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
}
.ed-group svg {
  flex: none;
  transition: transform 0.15s;
}
.ed-group.folded svg {
  transform: rotate(-90deg);
}
.ed-xf .ed-btn {
  display: grid;
  place-items: center;
}
.ed-xf .ed-btn svg {
  width: 20px;
  height: 20px;
}
.ed-sheet-x {
  display: none;
}
/* the side panel as a sheet on narrow phones: only the options of what you picked */
@media (max-width: 760px) {
  .ed-props.sheet {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    width: auto;
    max-height: 45vh;
    padding-right: 48px;
    background: #fffcf4;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.35);
  }
  .ed-props.sheet .ed-side,
  .ed-props.sheet .ed-xf,
  .ed-props.sheet [data-del] {
    display: none;
  }
  .ed-props.sheet .ed-sheet-x {
    display: grid;
    place-items: center;
    position: sticky;
    top: 0;
    float: right;
    margin-right: -36px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 27, 48, 0.85);
    color: #fff;
    font-weight: 700;
  }
  .ed-float.up {
    top: 10px;
    transform: none;
  }
}
/* on its side there is more room next to the course than under it */
@media (max-width: 760px) and (orientation: landscape) {
  .ed-props.sheet {
    left: auto;
    top: 48px;
    width: 250px;
    max-height: none;
    border-radius: 16px 0 0 16px;
    box-shadow: -6px 0 20px rgba(0, 0, 0, 0.35);
  }
  .ed-float.up {
    right: 260px;
  }
}
/* editor: the hole's power-ups */
.ed-pus {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 6px;
  margin: 6px 0 14px;
}
.ed-pu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 3px;
  border: 2px solid #e3dcc8;
  border-radius: 12px;
  background: #fff;
  font: inherit;
  cursor: pointer;
}
.ed-pu span {
  font-size: 24px;
  line-height: 36px;
  height: 36px;
}
.ed-pu .ico-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.ed-pu small {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  color: #3a4660;
}
.ed-pu.on {
  border-color: var(--teal);
  background: #dff7f4;
}
.ed-pu-clear {
  margin-left: 8px;
  padding: 2px 10px;
  font-size: 12px;
}
.ed-modal-panel h4 small {
  font-weight: 600;
}

/* admin: power-ups, course packs, trail layers */
.ad-grid.ad-full {
  display: block;
}
.ad-grid.ad-full .ad-side {
  display: none;
}
.ad-pus {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 6px;
}
.ad-pu {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(127, 127, 127, 0.1);
  cursor: pointer;
}
.ad-pu.off {
  opacity: 0.55;
}
.ad-pu-i {
  flex: none;
  width: 34px;
  font-size: 24px;
  text-align: center;
}
.ad-pu-i .ico-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}
.ad-pu small {
  display: block;
  font-size: 11px;
  opacity: 0.75;
}
.ad-layer {
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(127, 127, 127, 0.1);
}
.ad-layer-h {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.ad-layer-h select {
  flex: 1;
  min-width: 0;
}
.ad-packs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.ad-pack {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 118px;
  padding: 8px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: rgba(127, 127, 127, 0.1);
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.ad-pack.on {
  border-color: var(--teal);
}
.ad-pack img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}
.ad-pack small {
  font-size: 11px;
  opacity: 0.75;
}
.ad-hole-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 0;
}
.ad-holesearch {
  width: 100%;
  margin: 8px 0;
  padding: 6px 10px;
  font: inherit;
  border-radius: 8px;
  border: 2px solid rgba(127, 127, 127, 0.3);
  box-sizing: border-box;
}
.ad-holes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
}
.ad-holepick {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: rgba(127, 127, 127, 0.1);
  font: inherit;
  font-size: 12px;
  color: inherit;
  cursor: pointer;
}
.ad-holepick.on {
  border-color: var(--teal);
  background: rgba(78, 205, 196, 0.25);
}
.ad-holepick small {
  font-size: 10px;
  opacity: 0.75;
}
.ad-holethumb {
  display: block;
  width: 112px;
  height: 72px;
}
.ad-holethumb canvas {
  width: 100%;
  height: 100%;
  border-radius: 6px;
}
.ad-sticker img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

/* leaderboards and the daily challenge popups */
/* leaderboards: which course, and a way to go and play it */
.boards-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 8px;
}
.boards-current {
  flex: 1 1 220px;
  width: auto;
  min-width: 0;
  min-height: 56px;
  flex-direction: row;
  justify-content: flex-start;
  gap: 8px;
  padding: 4px 12px 4px 6px;
  font-size: 18px;
  text-align: left;
}
.boards-pick .boards-current img {
  position: static;
  flex: none;
  width: 46px;
  height: 46px;
  max-width: none;
  margin: 0;
  transform: none;
  object-fit: contain;
}
.boards-current b {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.boards-current svg {
  flex: none;
  transition: transform 0.15s;
}
.boards-current[aria-expanded="true"] svg {
  transform: rotate(180deg);
}
.boards-play {
  flex: 1 1 180px;
  margin: 0;
}
.boards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 6px;
  max-height: 44vh;
  overflow-y: auto;
  margin-bottom: 8px;
  padding: 5px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.06);
}
.boards-grid[hidden] {
  display: none;
}
.boards-tile {
  height: 92px;
  padding: 4px 2px;
}
.boards-grid .boards-tile img {
  position: static;
  flex: none;
  width: 48px;
  height: 48px;
  max-width: none;
  margin: 0;
  transform: none;
  object-fit: contain;
}
.boards-tile small {
  line-height: 1.1;
}
.boards-tile.on {
  outline: 3px solid var(--sun);
  outline-offset: -3px;
}
.daily-prizes {
  margin: 8px 0;
  font-size: 13px;
  font-weight: 700;
}
.daily-prizes > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}
.daily-prizes span {
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}
.daily-prizes img {
  width: 20px;
  height: 20px;
  vertical-align: -4px;
}
.daily-board .ft small {
  opacity: 0.65;
  font-weight: 600;
}
.daily-pop-thumb {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 0 auto 8px;
  border-radius: 12px;
}
.game-dialog .daily-result {
  font-size: 18px;
}
.gift-coins {
  font-size: 22px;
  margin: 6px 0;
}
.gift-coins img {
  width: 26px;
  height: 26px;
  vertical-align: -5px;
}
/* readable on the dark panels too */
body.season-halloween .daily-board li.note {
  color: #d9cdf5;
}
/* the leaderboards' "nobody yet" line and the like */
.daily-board li.note {
  font-size: 15px;
  color: var(--text);
}
body:is(.season-halloween, .season-legends) .daily-board li.note {
  color: #fff !important; /* the season's "light cards keep dark text" rule would win otherwise */
}
/* home screen: my ball in the middle of things, the logo riding on the panel's top edge */
.home-look {
  grid-column: 1;
  grid-row: 2;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: none;
  cursor: pointer;
  transition: transform 0.12s;
  align-self: end;
}
.home-look:hover {
  transform: scale(1.02);
}
.home-look canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.panel.title-panel {
  position: relative;
  margin-top: 100px;
}
.title-panel .logo {
  position: absolute;
  grid-column: auto;
  grid-row: auto;
  left: 50%;
  top: 0;
  width: 200px;
  margin: 0;
  transform: translate(-50%, -94%);
  pointer-events: none;
  z-index: 2;
}
.title-panel .logo-img {
  width: 100%;
}
@media (min-width: 700px) {
  .panel.title-panel {
    margin-top: 170px;
  }
  .title-panel .logo {
    width: 240px;
  }
}
@media (min-width: 700px) and (max-height: 760px) {
  .panel.title-panel {
    margin-top: 110px;
  }
  .title-panel .logo {
    width: 160px;
  }
}
@media (max-width: 699px) {
  .panel.title-panel {
    margin-top: 88px;
  }
  .title-panel .logo {
    width: 130px;
  }
}
/* Split Shot: in reach while the ball rolls */
#split-btn {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 6;
  transform: translateX(-50%);
  padding: 16px 44px;
  font-size: 26px;
  box-shadow: 0 5px 0 #a9480b, 0 0 24px rgba(255, 138, 61, 0.7);
  touch-action: none;
  pointer-events: auto;
}
.pf-account[hidden] {
  display: none;
}
#split-btn[hidden] {
  display: none;
}
#cut-btn {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 6;
  transform: translateX(-50%);
  padding: 14px 36px;
  font-size: 22px;
  white-space: nowrap;
  touch-action: none;
  pointer-events: auto;
}
#split-btn:not([hidden]) ~ #cut-btn {
  bottom: 176px;
}
#dash-btn {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 6;
  transform: translateX(-50%);
  padding: 16px 44px;
  font-size: 26px;
  touch-action: none;
  pointer-events: auto;
}
#dash-btn[hidden],
#cut-btn[hidden],
#restart-btn[hidden] {
  display: none !important;
}
