:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", "Geist", system-ui, sans-serif;
  color: #1c1c1e;
  background: #f0f0f0;
  --ink: #1c1c1e;
  --paper: #f0f0f0;
  --gold: #ffb003;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  min-width: 300px;
  min-height: 100svh;
  margin: 0;
  background: radial-gradient(ellipse at 10% 26%, #fff5d9 0, transparent 42%),
    radial-gradient(ellipse at 92% 62%, #f3e5c5 0, transparent 52%), var(--paper);
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button:disabled { cursor: default; }
button:focus-visible { outline: 3px solid #7959b5; outline-offset: 3px; }
.meadow {
  position: relative;
  isolation: isolate;
  width: min(100%, 454px);
  min-height: 100svh;
  margin-inline: auto;
  padding: max(11px, env(safe-area-inset-top)) 13px max(11px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  background: linear-gradient(#fffef9 0%, #fffaf0 55%, #fff0bf 100%);
  overflow: hidden;
}
.grassland, .ground-art { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.grassland::before, .grassland::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: #ffe08e;
  width: 130%;
  height: 31%;
  top: 31%;
  right: -44%;
  opacity: .39;
  transform: rotate(-15deg);
}
.grassland::after { background: #ffdb73; width: 110%; left: -40%; top: 60%; transform: rotate(14deg); }
.grass { position: absolute; z-index: 1; color: #d79116; opacity: .55; font-size: 20px; line-height: 1; }
.grass:nth-child(1) { top: 15%; left: 8%; }
.grass:nth-child(2) { top: 22%; right: 8%; font-size: 12px; }
.grass:nth-child(3) { top: 28%; left: 20%; font-size: 11px; }
.grass:nth-child(4) { top: 45%; left: 4%; }
.grass:nth-child(5) { top: 58%; right: 4%; }
.grass:nth-child(6) { top: 64%; left: 11%; font-size: 14px; }
.grass:nth-child(7) { top: 67%; right: 16%; font-size: 11px; }
.grass:nth-child(8) { top: 36%; right: 11%; font-size: 15px; }
.grass:nth-child(9) { top: 72%; left: 33%; font-size: 14px; }
.grass:nth-child(10) { top: 8%; left: 24%; font-size: 10px; }
.grass:nth-child(11) { top: 92%; left: 8%; font-size: 14px; }
.grass:nth-child(12) { top: 91%; right: 11%; font-size: 14px; }
.cloud {
  position: absolute;
  width: 112px;
  height: 22px;
  border-radius: 50px;
  opacity: .8;
  background: #fff;
  animation: cloud 8s ease-in-out infinite alternate;
}
.cloud::before, .cloud::after { content: ""; position: absolute; border-radius: 50%; background: inherit; }
.cloud::before { width: 42px; height: 43px; left: 16px; bottom: 1px; }
.cloud::after { width: 58px; height: 48px; left: 40px; bottom: 0; }
.cloud-left { left: -32px; top: 92px; }
.cloud-right { right: -30px; top: 104px; animation-delay: -4s; }
@keyframes cloud { to { transform: translateX(12px); } }
.game-header {
  position: relative;
  display: grid;
  grid-template-columns: 1fr max-content 1fr;
  align-items: start;
  gap: 3px;
  height: 79px;
}
.side-buttons { display: flex; gap: 4px; padding-top: 4px; }
.side-buttons:last-child { justify-content: flex-end; }
.bubble {
  width: 36px; height: 36px; border: 2px solid #252427; border-radius: 12px;
  background: linear-gradient(#fff, #f0f0f0);
  box-shadow: 0 3px 0 #252427, inset 0 1px 0 #fff;
  font-weight: 1000; font-size: 23px; line-height: 1; padding: 0;
}
.bubble:active { transform: translateY(2px); box-shadow: 0 1px 0 #252427; }
.ranking-button { width: auto; min-width: 42px; padding-inline: 4px; font-size: 12px; white-space: nowrap; }
#sound[aria-pressed="false"] { color: #676366; }
#sound[aria-pressed="true"] { background: linear-gradient(#ffe88c, #ffc140); }
.title-group { position: relative; text-align: center; padding-inline: 8px; }
.title-group::before, .title-group::after {
  content: "✦"; position: absolute; top: 12px; color: var(--gold);
  -webkit-text-stroke: 1px #483926; font-size: 20px; animation: twinkle 1.1s ease-in-out infinite alternate;
}
.title-group::before { left: -15px; }
.title-group::after { right: -11px; top: 31px; font-size: 13px; animation-delay: -.5s; }
@keyframes twinkle { to { transform: scale(.75) rotate(15deg); } }
h1 {
  margin: -2px 0 0; font-size: clamp(35px, 10vw, 48px); line-height: 1.18;
  letter-spacing: -.09em; font-weight: 1000; white-space: nowrap; color: #fff;
  paint-order: stroke fill; -webkit-text-stroke: 6px var(--ink);
  text-shadow: 0 5px 0 var(--ink), 0 8px 0 #daa33a;
  transform: rotate(-3deg);
}
h1 span { color: var(--gold); font-size: .86em; }
.title-group p {
  display: inline-block; margin: 5px 0 0; font: 900 9px/1.4 "Geist Mono", Consolas, monospace;
  letter-spacing: .13em; color: #535056;
}
.level-strip { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; padding: 2px 4px; }
.level-strip h2 { margin: 0; font-size: 19px; font-weight: 1000; text-shadow: 0 1px 0 #fff; }
#level-badge {
  justify-self: start; background: var(--ink); border: 1px solid var(--ink); color: #fff;
  padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 900; white-space: nowrap;
}
#remaining { justify-self: end; font-size: 12px; font-weight: 900; white-space: nowrap; }
.run-strip { display: flex; align-items: center; justify-content: space-between; margin: 8px 6px 0; padding: 5px 10px; border: 1px solid #e0c887; border-radius: 9px; background: #fff9e8; font-size: 11px; font-weight: 800; }
.run-clock { display: flex; align-items: center; gap: 6px; }
#run-time { font: 900 16px/1.1 Consolas, monospace; font-variant-numeric: tabular-nums; }
.playfield { position: relative; isolation: isolate; flex: 1; display: grid; align-content: center; }
.ground-art { z-index: -1; }
.tuft { position: absolute; font-family: system-ui; color: #e1b14c; text-shadow: 7px 2px 0 #ffdc7f; font-size: 23px; }
.tuft-a { top: 12%; left: 5%; }.tuft-b { top: 21%; right: 9%; }.tuft-c { top: 63%; left: 12%; color: #e2bef1; }
.tuft-d { top: 75%; right: 12%; color: #d9b5ea; }.tuft-e { top: 54%; left: 4%; }.tuft-f { top: 35%; right: 4%; }
.tuft-g { top: 8%; right: 18%; color: #f5c359; }.tuft-h { top: 74%; left: 6%; color: #e2bef1; font-size: 17px; }
.board { aspect-ratio: 10 / 9.55; position: relative; isolation: isolate; }
.board::before {
  content: ""; position: absolute; inset: 8% 5% 9%; z-index: -1;
  background: radial-gradient(ellipse at center, #ffb00322, transparent 70%);
  pointer-events: none;
}
.level-tip {
  z-index: 1; position: absolute; pointer-events: none; left: 50%; bottom: 11%; transform: translateX(-50%);
  margin: 0; width: max-content; max-width: 94%; text-align: center; font-size: 12px; font-weight: 900;
  color: #57441b; border-radius: 999px; border: 1px dashed #bb9340; background: #fff9e9e8; padding: 5px 11px;
}
.blind-depth {
  position: absolute; z-index: 150; pointer-events: none; left: var(--x); top: var(--y);
  transform: translate(-50%, -20%);
  color: #fff; background: var(--ink); border: 1px solid #ffe38c; border-radius: 9px;
  padding: 1px 4px; font: 900 10px/1.2 Consolas, monospace;
}
.tile {
  --face: #fffaf0; --edge: #ffb003;
  display: flex; flex-direction: column; gap: 1px; align-items: center; justify-content: center;
  width: 100%; height: 100%; min-width: 0; padding: 0 1px; user-select: none; line-height: 1;
  border: 1.5px solid var(--ink); border-radius: 14%; background: var(--face);
  box-shadow: 0 3px 0 var(--edge), 0 4px 0 #937135, 0 5px 5px #60482d50;
  color: var(--ink); font-weight: 1000;
}
.tile-art {
  display: grid; place-items: center; position: relative;
  width: 96%; aspect-ratio: 1.26; flex: none; overflow: hidden;
  mix-blend-mode: multiply;
}
.tile-icon {
  display: block; position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden;
}
.tile-label {
  max-width: 100%; overflow: hidden; text-overflow: clip; white-space: nowrap;
  font-size: var(--label-size, 9px); line-height: 1.14; letter-spacing: -.065em;
}
.tile[data-tone="anyrouter"] .tile-label { font-size: calc(var(--label-size, 9px) * .78); letter-spacing: -.04em; }
.board .tile {
  position: absolute; width: 12.5%; height: auto; aspect-ratio: 1;
  left: var(--x); top: var(--y); z-index: var(--z);
  container-type: inline-size;
  --icon-size: 59cqi; --symbol-size: 37cqi; --label-size: 20cqi;
  transition: filter .09s ease-out, box-shadow .09s ease-out;
}
.board .tile:disabled { filter: brightness(.72) saturate(.68); pointer-events: none; }
.board .tile:enabled:active .tile-art, .reserve .tile:enabled:active .tile-art { transform: translateY(2px) scale(.87); }
@media (hover:hover) {
  .board .tile:enabled:hover {
    filter: brightness(1.08);
    box-shadow: inset 0 0 0 2px #ffb003, 0 3px 0 var(--edge), 0 4px 0 #937135, 0 0 13px #ffb0038c;
  }
}
.board.dealing .tile:enabled { animation: deal .4s cubic-bezier(.18,.86,.48,1.13) backwards; animation-delay: var(--deal, 0ms); }
@keyframes deal { from { transform: translateY(-17px) scale(.86); opacity: .16; } to { transform: none; opacity: 1; } }
.board.shuffling .tile:enabled { animation: shuffle .39s ease-in-out; animation-delay: var(--deal, 0ms); }
@keyframes shuffle {
  28% { transform: translate(-5px, -8px) rotate(-12deg); filter: brightness(1.3); }
  66% { transform: translate(5px, 2px) rotate(9deg); }
}

.bottom { position: relative; flex: none; padding: 0 5px; }
.notice {
  min-height: 23px; margin: 0 0 3px; text-align: center; color: #524832;
  font-weight: 900; font-size: 11px; padding: 3px 0;
}
.reserve { position: relative; display: flex; justify-content: center; margin: -5px 0 8px; }
.reserve > div { display: flex; gap: 7px; padding: 4px 8px 7px; border-radius: 10px; background: #dbbd7d66; }
.reserve .tile { width: 37px; height: 37px; --icon-size: 19px; --symbol-size: 13px; --label-size: 8px; }
.fence {
  position: relative; isolation: isolate; padding: 9px 8px 10px; margin: 0 0 15px;
  border: 2px solid #8b5726; border-radius: 10px;
  background: repeating-linear-gradient(1deg, #c48a3020 0 1px, transparent 1px 12px),
    linear-gradient(#ffdb84, #dba344);
  box-shadow: 0 5px 0 #a56b33, 0 7px 0 #89723b, 0 11px 18px #654a2240, inset 0 2px 0 #ffe6a8;
}
.fence::before, .fence::after {
  content:""; position:absolute; z-index: -1; height: 132%; width: 16px; left: -7px; bottom: -7px;
  border: 2px solid #8b5726; border-radius: 5px; transform: rotate(-6deg);
  background: repeating-linear-gradient(89deg,#bd7b421f 0 2px, transparent 2px 6px), #f1bd73;
  box-shadow: inset 2px 0 #ffdda0, 0 3px #8b5726;
}
.fence::after { left: auto; right: -7px; transform: rotate(6deg); }
.slots { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 3px; }
.slot {
  display: grid; place-items: center; min-width: 0; aspect-ratio: 1; position: relative; container-type: inline-size;
  color: #ffe3a068; background: #372d28; border: 1px solid #5a3a24; border-radius: 6px;
  box-shadow: inset 0 2px 2px #1c1c1e9c, 0 1px 0 #ffd89a;
}
.slot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #f7cb83; opacity: .24; }
.slot.filled::before { display: none; }
.slot .tile { position: absolute; inset: 0; --icon-size: 53cqi; --symbol-size: 36cqi; --label-size: 19cqi; }
.slot.receiving .tile { visibility: hidden; }
.slot .tile.landed { animation: land .22s cubic-bezier(.18,.85,.43,1.3); }
@keyframes land { 32% { transform: translateY(3px) scale(.96,.86); } 65% { transform: translateY(-2px) scale(1.03,1.06); } }
.slot-counter {
  position: absolute; right: 9px; top: -10px; background: #fff4be; color: #774b28;
  border: 1px solid #976337; border-radius: 999px; padding: 1px 5px; font: 900 9px/1.15 Consolas, monospace;
}
.fence.danger { border-color: #ae412e; box-shadow: 0 5px 0 #c15d38, 0 7px 0 #983f26, 0 0 13px #f86f3366; }
.fence.danger .slot-counter { background: #ffdb9f; color: #a83823; border-color: #ca603d; }
.fence.hit { animation: tray-hit .34s cubic-bezier(.18,.84,.34,1.2); }
@keyframes tray-hit { 20% { transform: scale(1.035,.93); } 51% { transform: scale(.986,1.025); } }
.meadow.overflow .fence { animation: overflow .34s linear; }
@keyframes overflow {
  20%,60% { transform: translateX(-4px) rotate(-1deg); }
  40%,80% { transform: translateX(4px) rotate(1deg); }
}
.tools { display: grid; grid-template-columns: repeat(3, 1fr); padding: 0 9px; gap: 12px; }
.tool {
  position: relative; min-height: 58px; border: 2px solid var(--ink); border-radius: 12px;
  background: linear-gradient(#ffe282 0 13%, #ffc32d 16%, var(--gold) 93%);
  box-shadow: inset 0 0 0 2px #ffefab9e, 0 4px 0 #262324, 0 6px 0 #a6824b;
  color: var(--ink); display: grid; justify-items: center; align-content: center; gap: 1px;
  padding: 3px 0 6px; line-height: 1;
}
.tool > span {
  font-size: 27px; font-weight: 1000; line-height: .9;
  text-shadow: 0 1px 0 #fff1b6; font-family: system-ui;
}
.tool b { font-size: 12px; text-shadow: 0 1px 0 #ffeb9a; }
.tool small {
  position: absolute; top: -5px; right: -3px; display: grid; place-items: center; width: 19px; height: 19px;
  border: 1px solid var(--ink); border-radius: 50%; background: var(--ink); color: #fff;
  font: 1000 11px/1 Consolas, monospace; box-shadow: 0 1px 0 #846a3c;
}
.tool:disabled { filter: saturate(.42) brightness(.93); opacity: .78; }
.tool:enabled:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
@media (hover:hover) { .tool:enabled:hover { filter: brightness(1.065); } }
.record { margin: 13px 0 0; text-align: center; color: #514739; font-size: 10px; font-weight: 700; }
.record b { font: 1000 11px Consolas, monospace; margin-left: 3px; }

.effects { position: fixed; inset: 0; z-index: 9; pointer-events: none; overflow: hidden; }
.flying { position: absolute; height: auto; aspect-ratio: 1; will-change: transform; }
.tap-ring { position: absolute; width: 28px; height: 28px; border: 3px solid #ffb003; border-radius: 50%; box-shadow: 0 0 0 3px #fff5d5ad; }
.spark { position: absolute; font: 1000 17px/1 system-ui; color: var(--color); -webkit-text-stroke: .7px #ba7724; text-shadow: 0 1px 0 #fff4c3; }
.pop-score {
  position: absolute; color: #fff9b9; z-index: 1; font-size: 26px; font-weight: 1000;
  paint-order: stroke fill; -webkit-text-stroke: 4px #6d6a2f; text-shadow: 0 3px #605b26; white-space: nowrap;
}
dialog {
  width: min(340px, calc(100% - 26px)); max-width: none; text-align: center; color: var(--ink);
  background: linear-gradient(#fffef8, #fff2cb); border: 3px solid var(--ink);
  border-radius: 22px; padding: 17px 22px 24px; box-shadow: 0 7px 0 #715229, 0 18px 52px #19161078;
}
dialog::backdrop { background: #1c1c1e76; }
.dialog-head { display: flex; justify-content: end; height: 19px; }
.dialog-head button { border: 0; background: none; line-height: 1; font-size: 26px; padding: 0; color: #6b683f; }
.dialog-icon {
  display: grid; place-items: center; width: 54px; height: 51px; margin: 0 auto 9px; color: #fffef0;
  background: var(--gold); border: 2px solid var(--ink); border-radius: 17px;
  box-shadow: 0 3px 0 #9b732f; font: 1000 28px/1 system-ui;
}
dialog h2 { margin: 0 0 8px; font-size: 24px; font-weight: 1000; }
dialog p { margin: 0 0 17px; color: #5f6340; white-space: pre-line; font-size: 13px; font-weight: 700; line-height: 1.65; }
#victory-burst { display: none; }
dialog.victory { position: fixed; width: min(420px, calc(100% - 24px)); overflow: hidden; background: radial-gradient(ellipse at 50% 16%, #fff1a6, #fffaf0 62%); border-color: #1c1c1e; }
dialog.victory[open] { animation: victory-pop .55s cubic-bezier(.17,.85,.31,1.25); }
.victory .dialog-icon { position: relative; z-index: 1; width: 86px; height: 82px; margin-top: 8px; font-size: 48px; border-radius: 24px; transform: rotate(-7deg); animation: trophy-bounce .7s cubic-bezier(.2,.8,.3,1.2); }
.victory #dialog-title { position: relative; z-index: 1; font-size: clamp(29px,8.5vw,40px); margin-top: 18px; color: #1c1c1e; text-shadow: 0 3px #ffd952; letter-spacing: -.06em; }
.victory #dialog-text { position: relative; z-index: 1; font-size: 15px; line-height: 1.85; color: #534124; margin: 12px 0 20px; }
.victory #victory-burst { display: block; position: absolute; top: 100px; left: 50%; width: 0; height: 0; pointer-events: none; }
#victory-burst span { position: absolute; width: max-content; left: 43px; top: -61px; transform: rotate(13deg); color: #ff6948; font-size: 26px; font-weight: 1000; paint-order: stroke fill; -webkit-text-stroke: 3px #1c1c1e; text-shadow: 0 2px #1c1c1e; }
#victory-burst i { position: absolute; color: #ffb003; font-size: 26px; font-style: normal; --dx: -118px; --dy: -55px; transform: translate(var(--dx),var(--dy)); animation: win-confetti 1.2s ease-out both; }
#victory-burst i:nth-child(3) { --dx: 103px; --dy: 20px; color: #ff7255; font-size: 20px; }
#victory-burst i:nth-child(4) { --dx: -95px; --dy: 31px; color: #aa82d3; font-size: 16px; }
#victory-burst i:nth-child(5) { --dx: 102px; --dy: -65px; font-size: 16px; }
#victory-burst i:nth-child(6) { --dx: -48px; --dy: -73px; color: #ff7255; font-size: 13px; }
#victory-burst i:nth-child(7) { --dx: 60px; --dy: 45px; color: #aa82d3; font-size: 14px; }
@keyframes win-confetti { from { transform: translate(0,0) rotate(-90deg) scale(.1); opacity: 0; } 30% { opacity: 1; } to { transform: translate(var(--dx),var(--dy)) rotate(30deg); } }
@keyframes victory-pop { from { transform: scale(.65) translateY(35px); opacity: 0; } 65% { transform: scale(1.04) translateY(-5px); } to { transform: none; opacity: 1; } }
@keyframes trophy-bounce { from { transform: scale(.3) rotate(-30deg); } 60% { transform: scale(1.2) rotate(9deg); } to { transform: rotate(-7deg); } }
#surge {
  width: min(520px, calc(100% - 26px)); padding: 0 24px 22px; overflow: hidden;
  border: 4px solid #191719; border-radius: 25px; background: #ffc322;
  box-shadow: 0 9px 0 #1c1c1e, 0 20px 70px #17131090;
}
#surge::backdrop { background: #171310d6; backdrop-filter: blur(4px); }
#surge[open] { animation: surge-slam .48s cubic-bezier(.17,.8,.25,1.2); }
.surge-tape { margin: 0 -25px 22px; padding: 9px 0; background: repeating-linear-gradient(125deg,#1c1c1e 0 17px,#40391e 17px 29px); color: #ffc322; white-space: nowrap; font: 1000 13px/1.2 Consolas, monospace; letter-spacing: .12em; }
#surge .surge-eyebrow { margin: 0 0 8px; color: #382d1d; font-size: 14px; }
#surge h2 { position: relative; margin: 0 0 20px; font-size: clamp(52px, 15vw, 86px); line-height: .98; font-weight: 1000; letter-spacing: -.08em; color: white; paint-order: stroke fill; -webkit-text-stroke: 7px #1c1c1e; text-shadow: 4px 7px 0 #1c1c1e; transform: rotate(-5deg); }
#surge h2 span { display: block; color: #ff583e; }
#surge h2 i { position: absolute; right: 0; top: 24%; font-style: normal; font-size: .82em; color: #fff7b3; animation: arrow-hop .65s ease-in-out infinite alternate; }
.surge-comparison { display: flex; justify-content: center; gap: 18px; align-items: center; }
.surge-comparison > span { padding: 8px 13px; border: 2px solid #1c1c1e; border-radius: 13px; background: #fff7d3; font-size: 13px; font-weight: 900; box-shadow: 0 3px #1c1c1e; }
.surge-comparison > span:last-child { background: #1c1c1e; color: #ffcb34; transform: rotate(4deg); }
.surge-comparison b { font: 1000 33px/1 Consolas, monospace; }
.surge-comparison > strong { font-size: 32px; }
#surge .surge-copy { color: #30261b; margin: 16px 0; font-size: 14px; line-height: 1.6; }
#surge-start { width: 100%; padding: 15px 9px; border: 3px solid #1c1c1e; border-radius: 15px; background: #fffdf1; box-shadow: 0 5px #1c1c1e; font-size: 20px; font-weight: 1000; }
#surge-start span { display: inline-block; margin-left: 12px; }
#surge-start:active { transform: translateY(3px); box-shadow: 0 2px #1c1c1e; }
#surge-start:disabled { opacity: .65; cursor: wait; }
#surge .surge-note { color: #473617; font-size: 11px; margin: 17px 0 0; line-height: 1.5; }
.text-button { border: 0; padding: 8px 0 0; background: none; text-decoration: underline; font-size: 12px; font-weight: 700; }
@keyframes surge-slam { 0% { transform: scale(2) rotate(-11deg); opacity: 0; } 65% { transform: scale(.94) rotate(2deg); } 100% { transform: none; opacity: 1; } }
@keyframes arrow-hop { to { transform: translate(3px,-5px); } }
#leaderboard { width: min(560px,calc(100% - 24px)); max-height: calc(100dvh - 30px); padding: 0; text-align: left; }
.ranking-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 18px; background: #ffcf48; border-bottom: 2px solid #1c1c1e; }
.ranking-head p { margin: 0 0 3px; color: #544121; font-size: 11px; }
.ranking-head h2 { margin: 0; font-size: 27px; }
.ranking-body { padding: 16px; }
.ranking-profile { display: flex; gap: 10px; align-items: center; }
.ranking-profile > div:last-child { min-width: 0; }
.ranking-profile strong { display: block; font-size: 15px; overflow-wrap: anywhere; }
.ranking-profile small { display: block; margin-top: 3px; color: #776d59; font-size: 11px; overflow-wrap: anywhere; }
.player-avatar { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border: 2px solid #282622; border-radius: 50%; background: #ffd359; overflow: hidden; font-weight: 900; }
.player-avatar img { width: 100%; height: 100%; object-fit: cover; }
#leaderboard .ranking-identity { margin: 6px 0 14px; font-size: 10px; color: #776d59; }
.ranking-tabs { display: flex; gap: 8px; }
.ranking-tabs button { flex: 1; border: 2px solid #1c1c1e; border-radius: 9px; padding: 9px; background: white; font-weight: 900; }
.ranking-tabs button[aria-pressed="true"] { background: #1c1c1e; color: #ffcf48; }
#leaderboard .ranking-summary { font-size: 11px; margin: 12px 0 8px; color: #756444; }
.ranking-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ranking-table th { padding: 9px 4px; font-size: 10px; color: #796d53; border-bottom: 1px solid #d8c899; }
.ranking-table td { padding: 12px 4px; border-bottom: 1px dashed #e6d9b6; font-weight: 700; overflow-wrap: anywhere; }
.ranking-table td:first-child { width: 38px; font: 1000 16px Consolas, monospace; }
.ranking-table td:nth-child(3) { white-space: nowrap; font: 900 14px Consolas, monospace; }
.ranking-table th:last-child,.ranking-table td:last-child { text-align: right; white-space: nowrap; }
.ranking-table tbody tr:first-child td:first-child { color: #bf7c00; }
.ranking-me { background: #ffeaa8; }
#leaderboard .ranking-status { margin: 20px 0; font-size: 12px; color: #625132; text-align: center; }
.ranking-refresh { width: 100%; padding: 10px; border: 1px solid #c5aa64; background: #fff0c5; border-radius: 8px; font-weight: 800; }
#leaderboard .ranking-rules { margin: 14px 0 0; font-size: 10px; font-weight: 500; color: #776d59; line-height: 1.6; }
#dialog-action {
  width: 100%; min-height: 42px; border: 2px solid var(--ink); border-radius: 10px;
  background: linear-gradient(#ffe38a, var(--gold)); color: var(--ink); box-shadow: 0 3px #3d3323; font-weight: 1000;
}
#dialog-secondary {
  width: 100%; margin-top: 10px; min-height: 40px; border: 2px solid #8e77b0; border-radius: 10px;
  background: linear-gradient(#fbf6ff, #e6d6f6); color: #563d76; box-shadow: 0 3px #9680b2; font-weight: 1000;
}
@media (min-width: 455px) {
  .meadow { border-inline: 2px solid #e3d7b9; box-shadow: 0 0 44px #92782c2b; }
}
@media (min-width: 650px) and (hover: hover) and (pointer: fine) {
  .meadow { width: min(calc(100% - 24px), clamp(540px, calc((100svh - 244px) / .955 + 36px), 744px)); padding-inline: 18px; }
  .game-header { height: 69px; }
  .level-strip { padding-inline: 10px; }
  .level-strip h2 { font-size: 21px; }
  #level-badge, #remaining { font-size: 13px; }
  .board .tile { border-width: 2px; --icon-size: 61cqi; --symbol-size: 38cqi; --label-size: 21cqi; }
  .level-tip { font-size: 14px; }
  .bottom {
    display: grid; grid-template-columns: minmax(0, 1fr) 185px; gap: 3px 14px;
    grid-template-areas: "notice notice" "reserve reserve" "tray tools" "record record";
    align-items: center;
  }
  .notice { grid-area: notice; margin: 0; }
  .reserve { grid-area: reserve; margin: -5px 0 6px; }
  .fence { grid-area: tray; margin: 0; }
  .tools { grid-area: tools; gap: 6px; padding: 0; }
  .record { grid-area: record; margin-top: 12px; }
}
@media (max-width: 365px) {
  .meadow { padding-inline: 9px; }
  .bubble { width: 32px; height: 32px; font-size: 20px; }
  .ranking-button { width: auto; min-width: 34px; font-size: 11px; }
  .game-header { height: 69px; }
  .title-group::before { display: none; }
  .tools { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; }
}
