:root {
  --bg: #f7f1e5;
  --card: #fffdf8;
  --card2: #fff7ea;
  --ink: #2c261e;
  --muted: #7d7263;
  --line: #e8dcc6;
  --accent: #f08a2c;
  --accent2: #ff5f6d;
  --accent-ink: #fff;
  --good: #3c9a4a;
  --bad: #d4453c;
  --gold: #c88a12;
  --shadow: 0 8px 24px rgba(80, 50, 10, 0.09);
  --shadow-lg: 0 18px 40px rgba(80, 50, 10, 0.16);
  --blob1: rgba(255, 190, 110, 0.45);
  --blob2: rgba(140, 210, 120, 0.4);
  --blob3: rgba(255, 140, 170, 0.3);
  --radius: 18px;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1814;
    --card: #27241e;
    --card2: #2e2a22;
    --ink: #f2ecdf;
    --muted: #a99e8c;
    --line: #3b362c;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.5);
    --blob1: rgba(240, 138, 44, 0.16);
    --blob2: rgba(90, 170, 80, 0.13);
    --blob3: rgba(255, 95, 109, 0.1);
  }
}
/* The header toggle overrides the system setting. */
:root[data-theme="dark"] {
  --bg: #1a1814;
  --card: #27241e;
  --card2: #2e2a22;
  --ink: #f2ecdf;
  --muted: #a99e8c;
  --line: #3b362c;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.5);
  --blob1: rgba(240, 138, 44, 0.16);
  --blob2: rgba(90, 170, 80, 0.13);
  --blob3: rgba(255, 95, 109, 0.1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}
/* Slow coloured light behind everything. */
body::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(30% 28% at 20% 22%, var(--blob1), transparent 70%),
    radial-gradient(28% 26% at 82% 18%, var(--blob2), transparent 70%),
    radial-gradient(34% 30% at 62% 82%, var(--blob3), transparent 70%);
  animation: drift 26s ease-in-out infinite alternate;
}
/* The 3D pages and the farm field redraw every frame, so nothing behind or over them should repaint or re-blur with it. */
body:has(.tv-3d, .ck-scene, .farm .field)::before { animation: none; }
body:has(.tv-3d, .ck-scene, .farm .field) .top { backdrop-filter: none; background: var(--bg); }
@keyframes drift { to { transform: translate3d(5%, -4%, 0) rotate(8deg) scale(1.1); } }
a { color: inherit; }
img { display: block; }
h1, h2 { line-height: 1.25; margin: 0 0 12px; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.warn { color: var(--accent); font-weight: 700; }
.big { font-size: 20px; font-weight: 800; }

/* header */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 18px;
  padding: 10px max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.logo {
  font-weight: 900; font-size: 19px; text-decoration: none; white-space: nowrap; letter-spacing: 0.5px;
  background: linear-gradient(90deg, var(--accent), var(--accent2), #b57bff, var(--accent));
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: hue 8s linear infinite;
}
@keyframes hue { to { background-position: 300% 0; } }
.top nav { display: flex; gap: 6px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.top nav a { flex: none; }
.top nav a { position: relative; text-decoration: none; color: var(--muted); font-weight: 700; padding: 6px 10px; border-radius: 10px; transition: color .2s, background .2s; }
.top nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--card) 70%, transparent); }
.top nav a.on { color: var(--ink); }
.top nav a.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 1px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent2)); animation: grow .35s var(--spring); }
@keyframes grow { from { transform: scaleX(0); } }
#who { position: relative; }
.chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px;
  border: 1px solid var(--line); border-radius: 99px; background: var(--card); color: var(--ink); cursor: pointer; font: inherit;
  box-shadow: var(--shadow); transition: transform .15s;
}
@media (hover: hover) { .chip:hover { transform: translateY(-1px); } }
.chip .name { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.coins { display: flex; align-items: center; gap: 4px; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
.coins img { width: 18px; height: 18px; }
.coins.bump { animation: bump .5s var(--spring); }
.coins.bump.up img { animation: spinY .7s ease-out; }
.coins.bump.down { color: var(--bad); animation: bump .5s var(--spring), back-gold 1.2s .4s forwards; }
@keyframes bump { 40% { transform: scale(1.3); } }
@keyframes spinY { to { transform: rotateY(720deg); } }
@keyframes back-gold { to { color: var(--gold); } }
.av { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--line); flex: none; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 140px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
  animation: drop .2s var(--spring); transform-origin: top right;
}
@keyframes drop { from { transform: scale(.85); opacity: 0; } }
.menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; color: var(--ink); font: inherit; border-radius: 8px; cursor: pointer; }
.menu button:hover { background: var(--bg); }
#who { flex: none; }
#tools { display: flex; align-items: center; gap: 6px; flex: none; }
.tool { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; box-shadow: var(--shadow); transition: transform .15s, color .2s; }
.tool svg { width: 19px; height: 19px; }
@media (hover: hover) { .tool:hover { transform: translateY(-1px); color: var(--accent); } }
.vol { position: relative; }
.vol-pop { display: flex; align-items: center; gap: 10px; min-width: 240px; padding: 10px 12px; }
.vol-pop input { flex: 1; min-width: 0; accent-color: var(--accent); }
.vol-pop b { width: 2.2em; text-align: right; font-variant-numeric: tabular-nums; }
.vol-pop .btn { flex: none; width: auto; padding: 5px 11px; text-align: center; }
.vol-pop input { width: 130px; }
@media (max-width: 600px) { .vol { position: static; } .vol-pop { left: 12px; right: 12px; min-width: 0; } .vol-pop input { width: auto; } }
@media (max-width: 600px) {
  .top { gap: 6px; justify-content: space-between; padding-inline: max(12px, env(safe-area-inset-left)); }
  .top nav { display: none; }
  .chip .name { display: none; }
  /* The logo gives way first so the balance and refresh button never push the page wider than the screen. */
  .logo { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 17px; }
  .chip { padding-right: 9px; gap: 6px; }
  #tools { gap: 4px; }
  .tool { width: 32px; height: 32px; }
  .top #who .reload { width: 24px; }
}

main { max-width: 1040px; margin: 0 auto; padding: 20px 16px 56px; }
/* Page change: sections rise in one after another. */
#view.enter > * { animation: rise .5s var(--spring) both; }
#view.enter > *:nth-child(2) { animation-delay: .07s; }
#view.enter > *:nth-child(3) { animation-delay: .14s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } }
/* Page changes: the header stays put, the old page sinks and fades over the new one, which rises in. */
.top { view-transition-name: top; }
::view-transition-old(root) { animation: page-out .22s ease-in both; z-index: 1; }
::view-transition-new(root) { animation: none; }
@keyframes page-out { to { opacity: 0; transform: translateY(10px) scale(.985); filter: blur(2px); } }
/* A page whose code is still downloading. */
body.loading::before {
  content: ''; position: fixed; inset: 0 0 auto; height: 3px; z-index: 200; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent2), transparent) 0 0 / 40% 100% no-repeat;
  animation: loadbar 1s ease-in-out infinite;
}
@keyframes loadbar { from { background-position: -70% 0; } to { background-position: 170% 0; } }

/* buttons */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform .12s, box-shadow .2s, filter .2s;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) { .btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); } }
.btn:active { transform: scale(.95); }
.btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }
.btn.primary { background: linear-gradient(135deg, #ff9d3c, var(--accent) 45%, var(--accent2)); border-color: transparent; color: var(--accent-ink); box-shadow: 0 6px 16px rgba(240, 120, 40, .3); }
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 10px 22px rgba(240, 120, 40, .38); }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--bg); }
.btn.small { padding: 5px 11px; font-size: 13px; border-radius: 10px; }
.btn.big { padding: 12px 22px; font-size: 17px; border-radius: 14px; }
.btn.round { width: 34px; height: 34px; padding: 0; border-radius: 50%; font-size: 20px; }
.btn.icon { padding: 5px 8px; }
.btn.icon img { width: 20px; height: 20px; }
.btn .pc { width: 12px; height: 12px; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(240, 138, 44, 0); transform: scale(1.04); } 0%, 100% { box-shadow: 0 0 0 0 rgba(240, 138, 44, .45); } }
.ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .25; transform: scale(0); pointer-events: none; animation: ripple .6s ease-out forwards; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* home */
.hero { position: relative; text-align: center; padding: 28px 0 34px; }
.ascii { position: relative; display: block; width: min(360px, 80vw); margin: 0 auto 4px; touch-action: pan-y; }
.hero h1 {
  position: relative; font-size: clamp(38px, 9vw, 64px); font-weight: 900; margin: 0; letter-spacing: 2px;
  background: linear-gradient(100deg, var(--ink) 30%, var(--accent) 45%, var(--accent2) 55%, var(--ink) 70%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheen 5s ease-in-out infinite;
}
@keyframes sheen { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.decos { position: absolute; inset: -10px 0 0; pointer-events: none; }
.deco { position: absolute; width: 42px; height: 42px; opacity: .9; animation: float 6s ease-in-out infinite; animation-delay: calc(var(--i) * -0.7s); filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .15)); }
.deco:nth-child(1) { left: 4%; top: 18%; }
.deco:nth-child(2) { left: 16%; top: 70%; width: 34px; height: 34px; }
.deco:nth-child(3) { left: 27%; top: 6%; width: 30px; height: 30px; }
.deco:nth-child(4) { right: 6%; top: 12%; width: 48px; height: 48px; }
.deco:nth-child(5) { right: 18%; top: 66%; }
.deco:nth-child(6) { right: 30%; top: 2%; width: 30px; height: 30px; }
.deco:nth-child(7) { left: 40%; top: 84%; width: 28px; height: 28px; }
.deco:nth-child(8) { right: 42%; top: 86%; width: 30px; height: 30px; }
.deco:nth-child(9) { left: 9%; top: 46%; width: 26px; height: 26px; }
.deco:nth-child(10) { right: 3%; top: 54%; width: 32px; height: 32px; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-16px) rotate(8deg); } }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.cards.home { max-width: 900px; margin: 0 auto; }
/* Six games, two rows of three. */
@media (min-width: 860px) {
  .cards.home { grid-template-columns: repeat(3, 1fr); }
}
.game-card {
  --rx: 0deg; --ry: 0deg;
  position: relative; overflow: hidden; display: grid; justify-items: center; gap: 6px; padding: 30px 18px 24px;
  border-radius: 26px; text-decoration: none; color: #3a2a12;
  background: linear-gradient(160deg, #ffe6c2, #ffc978);
  box-shadow: var(--shadow-lg);
  transform: perspective(700px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .25s ease-out, box-shadow .25s;
}
.game-card.t-farm { background: linear-gradient(160deg, #e3f5c8, #9fd46a); color: #23401a; }
.game-card.t-tv { background: linear-gradient(160deg, #ece4ff, #a98bff); color: #24135a; }
.game-card.t-cook { background: linear-gradient(160deg, #ffe4d2, #ff9f6e); color: #4a1c08; }
.game-card.t-cook .art img { animation-delay: -2.4s; }
.game-card .tags { display: flex; gap: 6px; }
.game-card:hover { box-shadow: 0 26px 50px rgba(80, 50, 10, .25); }
.game-card .shine { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .55), transparent 45%); opacity: 0; transition: opacity .25s; }
.game-card:hover .shine { opacity: 1; }
.game-card .art { width: 128px; height: 128px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .45); box-shadow: inset 0 -8px 20px rgba(0, 0, 0, .06); }
.game-card .art img { width: 96px; height: 96px; animation: bob 3.2s ease-in-out infinite; filter: drop-shadow(0 10px 10px rgba(0, 0, 0, .18)); transition: transform .3s var(--spring); }
.game-card.t-farm .art img { animation-delay: -1.6s; }
.game-card.t-pool { background: linear-gradient(160deg, #c9f2d6, #3fae6a); color: #0d3a1e; }
.game-card.t-gomoku { background: linear-gradient(160deg, #f6e9cc, #dcb878); color: #3b2a10; }
.go-stones { position: relative; width: 96px; height: 96px; animation: bob 3.2s ease-in-out infinite; animation-delay: -.8s; filter: drop-shadow(0 10px 10px rgba(0, 0, 0, .2)); transition: transform .3s var(--spring); }
.go-stones i { position: absolute; width: 60px; height: 60px; border-radius: 50%; }
.go-stones .b { left: 4px; top: 8px; background: radial-gradient(circle at 35% 30%, #8a8a8a, #2b2b2b 30%, #050505); }
.go-stones .w { right: 4px; bottom: 8px; background: radial-gradient(circle at 35% 30%, #fff, #f0ece3 55%, #bdb4a3); }
.game-card:hover .go-stones { transform: scale(1.15) rotate(-8deg); }
.home-live { max-width: 900px; margin: 10px auto 0; }
.game-card:hover .art img { transform: scale(1.15) rotate(-8deg); }
@keyframes bob { 50% { translate: 0 var(--bob, -10px); } }
.game-card h2 { margin: 8px 0 0; font-size: 24px; font-weight: 900; }
.tag { font-size: 12px; font-weight: 800; padding: 2px 10px; border-radius: 99px; background: rgba(255, 255, 255, .6); }

.panel { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.panel-art { width: 56px; height: 56px; margin-bottom: 8px; animation: bob 3.2s ease-in-out infinite; }
.panel.ai { display: grid; justify-items: start; align-content: start; text-decoration: none; transition: transform .2s, box-shadow .2s; }
@media (hover: hover) { .panel.ai:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); } }
.panel.ai .btn { margin-top: auto; }
.field { display: flex; align-items: center; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.ico { width: 26px; height: 26px; }
.field input { width: 88px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-weight: 700; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 3px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--card2); color: var(--ink); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: transform .12s; }
.chip-btn:active { transform: scale(.92); }
.chip-btn img { width: 14px; height: 14px; }
.seg { position: relative; display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; flex-wrap: wrap; background: var(--card2); }
.seg button { position: relative; overflow: hidden; border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 700; padding: 7px 13px; cursor: pointer; min-width: 38px; transition: background .2s, color .2s; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: linear-gradient(135deg, #ff9d3c, var(--accent2)); color: #fff; animation: bump .35s var(--spring); }
.pill { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); white-space: nowrap; }
.pill img { width: 13px; height: 13px; }
.pill.gold { color: var(--gold); border-color: currentColor; }
.pill.good { color: var(--good); border-color: currentColor; }
.pill.bad { color: var(--bad); border-color: currentColor; }
.pills { display: flex; gap: 6px; margin-bottom: 10px; }

/* toasts, dialogs, flights, banners */
#toasts { position: fixed; left: 50%; top: 72px; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 14px; box-shadow: var(--shadow-lg); font-weight: 700; animation: toast-in .4s var(--spring); transition: opacity .3s, transform .3s; text-align: center; }
.toast.bad { background: var(--bad); color: #fff; animation: toast-in .4s var(--spring), shake .4s .1s; }
.toast.good { background: var(--good); color: #fff; }
.toast.out { opacity: 0; transform: translateY(-10px) scale(.95); }
@keyframes toast-in { from { transform: translateY(-20px) scale(.8); opacity: 0; } }
@keyframes shake { 25% { translate: -6px 0; } 50% { translate: 5px 0; } 75% { translate: -3px 0; } }
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(20, 14, 6, .5); backdrop-filter: blur(4px); display: grid; grid-template-columns: 100%; place-items: center; padding: 16px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
/* A width capped by max-width 100% (not min()), older phone WebViews drop min() and the dialog then ran off the screen with its close button. */
.dlg { position: relative; width: 420px; max-width: 100%; background: var(--card); border-radius: 24px; padding: 26px; box-shadow: var(--shadow-lg); animation: pop-in .4s var(--spring); }
/* A long dialog (装饰 lists every decoration) scrolls inside instead of running off the screen. 100vh first for WebViews without svh. */
.dlg { max-height: calc(100vh - 32px); max-height: calc(100svh - 32px); overflow-y: auto; overscroll-behavior: contain; }
.dlg.small { width: 340px; }
@keyframes pop-in { from { transform: scale(.7) translateY(20px); opacity: 0; } }
.dlg .x, .promo .x { position: absolute; right: 12px; top: 8px; border: 0; background: none; font-size: 26px; color: var(--muted); cursor: pointer; }
/* A long dialog scrolls inside, so its close button stays at the top while it does. */
.dlg > .x { position: sticky; top: -12px; float: right; z-index: 2; width: 36px; height: 36px; margin: -20px -16px 0 8px; padding: 0; border-radius: 50%; background: var(--card); line-height: 1; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions.end { justify-content: flex-end; margin-top: 18px; }
.code { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0 16px; padding: 14px 16px; border-radius: 16px; background: var(--bg); border: 2px dashed var(--accent); font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; }
.code i { display: inline-block; font-style: normal; animation: digit .5s var(--spring) both; animation-delay: calc(var(--i) * 60ms + .1s); }
@keyframes digit { from { transform: translateY(-14px) scale(.4); opacity: 0; } }
.wait { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); margin: 0; }
.spin { width: 18px; height: 18px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fly { position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .25)); will-change: transform; }
.float-text { position: fixed; z-index: 70; pointer-events: none; transform: translate(-50%, -50%); font-weight: 900; font-size: 22px; color: var(--good); text-shadow: 0 2px 0 #fff, 0 0 12px rgba(255, 255, 255, .8); animation: float-up 1.2s ease-out forwards; }
.float-text.gold { color: var(--gold); }
@keyframes float-up { 0% { opacity: 0; translate: 0 10px; scale: .5; } 20% { opacity: 1; scale: 1.2; } 100% { opacity: 0; translate: 0 -60px; scale: 1; } }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 80; pointer-events: none; }
.banner { position: fixed; inset: 0; z-index: 75; display: grid; place-items: center; pointer-events: auto; background: radial-gradient(circle, rgba(0, 0, 0, .25), transparent 70%); animation: fade .25s; transition: opacity .4s; }
.banner.out { opacity: 0; }
.banner-card { display: grid; justify-items: center; gap: 4px; padding: 26px 40px; border-radius: 28px; background: var(--card); box-shadow: var(--shadow-lg); animation: banner-in .6s var(--spring); }
.banner-card img { width: 84px; height: 84px; animation: bob 1.6s ease-in-out infinite, spinY 1s ease-out; }
.banner-card b { font-size: 34px; font-weight: 900; background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.banner-card span { color: var(--muted); font-weight: 700; }
@keyframes banner-in { from { transform: scale(.3) rotate(-12deg); opacity: 0; } }

/* chess */
.chess-lobby .cards { margin-bottom: 26px; }
/* Game lobbies: a banner in the game's colours with a little game playing itself. */
.lobby-hero {
  position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px;
  margin-bottom: 22px; padding: 28px 36px; border-radius: 28px; color: #fff7e8; box-shadow: var(--shadow-lg);
  background: radial-gradient(circle at 85% 20%, rgba(255, 196, 110, .35), transparent 45%), linear-gradient(135deg, #251833, #4a2a5c 55%, #7a4426);
}
.lobby-hero::before { content: ''; position: absolute; inset: 0; z-index: -1; opacity: .08; background: repeating-conic-gradient(#fff 0 25%, transparent 0 50%) 0 0 / 56px 56px; mask: linear-gradient(100deg, #000, transparent 70%); }
.lobby-gomoku .lobby-hero { color: #3b2a10; background: radial-gradient(circle at 80% 30%, rgba(255, 255, 255, .55), transparent 50%), linear-gradient(135deg, #f6e7c4, #d7ae66); }
.lobby-gomoku .lobby-hero::before { opacity: .18; background: linear-gradient(#5e3f1c 1px, transparent 1px) 0 0 / 34px 34px, linear-gradient(90deg, #5e3f1c 1px, transparent 1px) 0 0 / 34px 34px; }
.lobby-pool .lobby-hero { background: radial-gradient(circle at 75% 30%, rgba(120, 255, 170, .3), transparent 50%), linear-gradient(135deg, #0c3b22, #157a43 60%, #5a3417); }
.lobby-pool .lobby-hero::before { display: none; }
:root[data-theme="dark"] .lobby-gomoku .lobby-hero { color: #f6e9cc; background: radial-gradient(circle at 80% 30%, rgba(255, 210, 140, .18), transparent 50%), linear-gradient(135deg, #4a3518, #22180a); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lobby-gomoku .lobby-hero { color: #f6e9cc; background: radial-gradient(circle at 80% 30%, rgba(255, 210, 140, .18), transparent 50%), linear-gradient(135deg, #4a3518, #22180a); } }
.lobby-hero h1 { margin: 0 0 18px; font-size: clamp(34px, 6vw, 58px); font-weight: 900; letter-spacing: .04em; line-height: 1.05; text-shadow: 0 4px 18px rgba(0, 0, 0, .25); animation: rise .6s var(--spring) both; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.stat { display: grid; min-width: 76px; padding: 8px 14px; border-radius: 16px; background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .18); animation: rise .5s var(--spring) both; }
.stat:nth-child(2) { animation-delay: .06s; }
.stat:nth-child(3) { animation-delay: .12s; }
.lobby-gomoku .stat { background: rgba(255, 255, 255, .35); border-color: rgba(94, 63, 28, .2); }
.stat b { font-size: 26px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; font-weight: 700; opacity: .75; }
.lobby-hero .demo { width: 230px; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .35)); transition: opacity .5s; animation: bob 5s ease-in-out infinite; --bob: -6px; }
.lobby-hero .mini-board.demo { transform: perspective(900px) rotateX(16deg) rotateZ(-4deg); }
.lobby-hero .mini-go.demo { transform: perspective(900px) rotateX(16deg) rotateZ(3deg); }
.lobby-hero .mini-pool.demo { width: 330px; transform: perspective(900px) rotateX(18deg); }
.demo.out { opacity: 0; }
@media (max-width: 640px) {
  .lobby-hero { grid-template-columns: 1fr; padding: 22px 20px; justify-items: center; text-align: center; }
  .hero-stats { justify-content: center; }
  .lobby-hero .demo { width: min(52vw, 200px); }
  .lobby-hero h1 { margin-bottom: 12px; }
  .lobby-hero .mini-pool.demo { width: min(86vw, 330px); }
}
/* A chess position: pieces slide between squares. */
.mini-board { position: relative; width: 100%; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: repeating-conic-gradient(#b58863 0 25%, #f0d9b5 0 50%) 0 0 / 25% 25%; box-shadow: 0 0 0 4px #6b4a2b, 0 0 0 5px #3e2a17; }
.mini-board > * { position: absolute; left: 0; top: 0; width: 12.5%; height: 12.5%; translate: calc(var(--x) * 100%) calc(var(--y) * 100%); }
.mini-board img { transition: translate .45s cubic-bezier(.5, 0, .2, 1), opacity .3s, scale .3s, rotate .6s var(--spring), filter .3s; }
.mini-board .mb-last { background: rgba(155, 199, 0, .45); transition: translate .45s cubic-bezier(.5, 0, .2, 1); }
.mini-board img.taken { opacity: 0; scale: 1.6; }
.mini-board img.mated { rotate: 80deg; filter: drop-shadow(0 0 5px #ff2a2a); }
/* A gomoku position: lines through the middle of n by n cells, stones on the crossings. */
.mini-go { position: relative; width: 100%; aspect-ratio: 1; border-radius: 6px; background: radial-gradient(circle at 30% 20%, #f0cd85, #d9a955); box-shadow: inset 0 0 0 1px rgba(94, 63, 28, .3); }
.mini-go::before {
  content: ''; position: absolute; inset: calc(50% / var(--n)); border-right: 1px solid rgba(94, 63, 28, .7); border-bottom: 1px solid rgba(94, 63, 28, .7);
  background: linear-gradient(rgba(94, 63, 28, .7) 1px, transparent 1px) 0 0 / calc(100% / (var(--n) - 1)) calc(100% / (var(--n) - 1)), linear-gradient(90deg, rgba(94, 63, 28, .7) 1px, transparent 1px) 0 0 / calc(100% / (var(--n) - 1)) calc(100% / (var(--n) - 1));
}
.mini-go i { position: absolute; width: calc(92% / var(--n)); aspect-ratio: 1; border-radius: 50%; left: calc((var(--x) + .5) * 100% / var(--n)); top: calc((var(--y) + .5) * 100% / var(--n)); translate: -50% -50%; box-shadow: 0 1px 2px rgba(0, 0, 0, .45); }
.mini-go i.b { background: radial-gradient(circle at 35% 30%, #6b6b6b, #111 60%); }
.mini-go i.w { background: radial-gradient(circle at 35% 30%, #fff, #d6d1c6 70%); }
.mini-go.demo i { animation: stone-in .35s var(--spring) both; }
.mini-go i.win { animation: stone-win 1s ease-in-out infinite; }
@keyframes stone-in { from { scale: 1.8; opacity: 0; } }
@keyframes stone-win { 50% { box-shadow: 0 0 0 2px #ffd34d, 0 0 14px 4px #ffb300; scale: 1.12; } }
.mini-pool { display: block; width: 100%; height: auto; border-radius: 10px; }
/* Running games as cards with the position drawn small. */
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.live-card { display: grid; gap: 10px; padding: 12px; color: inherit; text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: 18px; transition: transform .2s, box-shadow .2s; }
@media (hover: hover) { .live-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); } }
.live-card.new { animation: rise .45s var(--spring) both; animation-delay: calc(var(--i) * 50ms); }
.live-card.mine { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.live-mini { position: relative; display: grid; place-items: center; padding: 14px; border-radius: 12px; background: linear-gradient(135deg, #2c1f3a, #4a2d52); }
.lobby-gomoku .live-mini { background: linear-gradient(135deg, #5a4020, #3a2810); }
.lobby-pool .live-mini { padding: 8px; background: linear-gradient(135deg, #12301f, #0b2215); }
.live-mini .mini-board, .live-mini .mini-go { width: 74%; }
.live-mini .eye { position: absolute; right: 8px; top: 8px; }
.live-who { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 800; }
.live-who b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.live-who b:last-of-type { text-align: right; }
.live-who i { font-style: italic; font-weight: 900; font-size: 12px; color: var(--accent2); }
.live-who .av { width: 26px; height: 26px; }
.live-meta { display: flex; align-items: center; gap: 6px; }
.live-meta .btn { margin-left: auto; }
.lists h2 { display: flex; align-items: center; gap: 8px; margin-top: 22px; }
.count { font-size: 12px; min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 11px; color: #fff; background: var(--accent); animation: bump .4s var(--spring); }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #ff3b3b; box-shadow: 0 0 0 0 rgba(255, 59, 59, .6); animation: live 1.4s infinite; display: inline-block; margin-left: 6px; vertical-align: middle; }
@keyframes live { 70% { box-shadow: 0 0 0 8px rgba(255, 59, 59, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 59, 59, 0); } }
.row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; transition: transform .2s, box-shadow .2s; }
@media (hover: hover) { .row:hover { transform: translateX(4px); box-shadow: var(--shadow); } }
.row.new { animation: rise .45s var(--spring) both; animation-delay: calc(var(--i) * 50ms); }
.row .pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: pre; font-weight: 700; }
.duo { display: flex; }
.duo .av + .av { margin-left: -10px; border: 2px solid var(--card); }
.empty { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 14px; border: 2px dashed var(--line); border-radius: 14px; }
.empty img { width: 28px; height: 28px; opacity: .6; animation: bob 3s ease-in-out infinite; }
.chess-game { display: grid; grid-template-columns: minmax(0, 600px) minmax(240px, 320px); gap: 22px; justify-content: center; align-items: start; }
@media (max-width: 860px) { .chess-game { grid-template-columns: minmax(0, 600px); } }
.board {
  position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1; min-width: 0;
  max-width: min(600px, calc(100vh - 190px)); max-width: min(600px, calc(100svh - 190px));
  margin: 0 auto; border-radius: 8px; overflow: hidden; background: #6b4a2b;
  box-shadow: 0 0 0 6px #6b4a2b, 0 0 0 8px #3e2a17, var(--shadow-lg); touch-action: none; user-select: none; -webkit-user-select: none;
}
.board canvas { display: block; }
.col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.pbar { display: flex; align-items: center; gap: 10px; min-height: 44px; max-width: min(600px, calc(100vh - 190px)); max-width: min(600px, calc(100svh - 190px)); margin: 0 auto; width: 100%; min-width: 0; padding: 4px 8px 4px 4px; border-radius: 99px; transition: background .3s, box-shadow .3s; }
.pbar .av { width: 36px; height: 36px; transition: box-shadow .3s; }
.pbar.turn { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.pbar.turn .av { box-shadow: 0 0 0 3px var(--accent), 0 0 14px var(--accent); animation: glow 1.4s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 3px var(--accent2), 0 0 22px var(--accent2); } }
.pbar.waiting .av { opacity: .5; animation: bob 2s ease-in-out infinite; }
.pbar .pname { flex: 1; min-width: 0; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #8a7a62; flex: none; }
.pc.w { background: #fff; }
.pc.b { background: #222; }
.clock { min-width: 78px; text-align: center; padding: 4px 10px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font: 800 20px/1.2 ui-monospace, "SF Mono", Consolas, monospace; font-variant-numeric: tabular-nums; transition: background .3s, color .3s, transform .3s; }
.clock.run { background: var(--ink); color: var(--bg); transform: scale(1.06); }
.clock.run.low { background: var(--bad); color: #fff; animation: tick 1s steps(1) infinite; }
@keyframes tick { 50% { transform: scale(1.12); } }
.side { display: grid; gap: 12px; align-content: start; }
/* A glow in the game's colour behind the board. */
.chess-game .col { position: relative; isolation: isolate; }
.chess-game .col::before { content: ''; position: absolute; inset: -60px -40px; z-index: -1; pointer-events: none; background: radial-gradient(closest-side, rgba(140, 90, 200, .22), transparent); }
.chess-game.gomoku .col::before { background: radial-gradient(closest-side, rgba(230, 170, 70, .3), transparent); }
.chess-game.pool .col::before { background: radial-gradient(closest-side, rgba(40, 190, 100, .22), transparent); }
.status:has(.your-turn) { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent), 0 10px 30px color-mix(in srgb, var(--accent) 25%, transparent); animation: turn-glow 1.6s ease-in-out infinite; }
@keyframes turn-glow { 50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent2) 45%, transparent), 0 10px 34px color-mix(in srgb, var(--accent2) 30%, transparent); } }
.status .big { font-size: 22px; font-weight: 900; }
.status { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.status p:last-child { margin: 0; }
.your-turn { color: var(--accent); animation: bump .5s var(--spring); }
.dots::after { content: "..."; display: inline-block; width: 1.2em; overflow: hidden; vertical-align: bottom; animation: dots 1.2s steps(4) infinite; margin-left: 2px; }
@keyframes dots { from { width: 0; } to { width: 1.2em; } }
.moves { margin: 0; padding: 10px 10px 10px 36px; max-height: 260px; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; font-variant-numeric: tabular-nums; columns: 2; column-gap: 24px; }
.moves:empty { display: none; }
.moves li span { display: inline-block; min-width: 4em; font-weight: 700; }
.moves li:last-child { animation: rise .3s var(--spring); }
.promo { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px; background: rgba(0, 0, 0, .5); animation: fade .2s; }
.promo button:not(.x) { width: 22%; aspect-ratio: 1; border: 0; border-radius: 14px; background: #f0d9b5; cursor: pointer; padding: 4px; animation: pop-in .35s var(--spring) both; transition: transform .15s; }
.promo button:nth-child(2) { animation-delay: .04s; }
.promo button:nth-child(3) { animation-delay: .08s; }
.promo button:nth-child(4) { animation-delay: .12s; }
.promo button:not(.x):hover { transform: scale(1.08); }
.promo button img { width: 100%; height: 100%; }
.promo .x { color: #fff; }
.result { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .35); cursor: pointer; animation: fade .3s; }
.result > div { display: grid; justify-items: center; gap: 2px; padding: 20px 34px; border-radius: 24px; background: var(--card); box-shadow: var(--shadow-lg); animation: banner-in .6s var(--spring); }
.result img { width: 72px; height: 72px; animation: bob 1.8s ease-in-out infinite; }
.result b { font-size: 28px; font-weight: 900; }
.result span { font-weight: 800; color: var(--muted); }
.result.win b { background: linear-gradient(90deg, #f7b500, var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.result.win span { color: var(--gold); font-size: 18px; }
.result.lose { background: rgba(0, 0, 0, .5); }
.result.lose span { color: var(--bad); }
.levels button { min-width: 34px; padding: 7px 0; }

/* farm */
.farm { max-width: 592px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.hud { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.meter { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 140px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px 10px; box-shadow: var(--shadow); }
.meter > img { width: 28px; height: 28px; }
.meter > div { flex: 1; font-size: 13px; }
.meter small { color: var(--muted); font-variant-numeric: tabular-nums; }
.meter.pop > img { animation: bump .45s var(--spring); }
.energy > img { animation: zap 2.4s ease-in-out infinite; }
@keyframes zap { 0%, 88%, 100% { transform: none; } 92% { transform: rotate(-12deg) scale(1.15); } 96% { transform: rotate(10deg); } }
.meter.low .bar i { background: linear-gradient(90deg, #ff6b6b, #ff3b3b); }
.meter.low > img { animation: shake .5s infinite; }
.bar { position: relative; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 3px; }
.bar i { position: relative; display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ffb238, #ff8a1f); transition: width .5s var(--spring); overflow: hidden; }
.bar i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%); background-size: 200% 100%; animation: shimmer 2.2s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -100% 0; } }
.level .bar i { background: linear-gradient(90deg, #7dd36f, #3c9a4a); }
.level.pop > img, .level > img.pop { animation: spinY .8s ease-out; }
.level > img { transition: transform .3s; }
.btn.gift { padding: 4px 10px; animation: wiggle 1.4s infinite; }
.btn.gift img { width: 28px; height: 28px; }
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-10deg) scale(1.1); } 90% { transform: rotate(10deg) scale(1.1); } 95% { transform: rotate(-4deg); } }
.orders { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.order { position: relative; display: grid; gap: 6px; justify-items: center; padding: 26px 6px 8px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); transition: border-color .3s, transform .3s var(--spring); }
.order.ready { border-color: var(--good); animation: ready 1.6s ease-in-out infinite; transform: translateY(-2px); }
@keyframes ready { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 30%, transparent), 0 8px 20px color-mix(in srgb, var(--good) 25%, transparent); } }
.order.ready .btn.primary { animation: pulse 1.6s ease-in-out infinite; }
.order.enter { animation: card-in .55s var(--spring) .45s both; }
@keyframes card-in { from { transform: scale(.4) rotate(-6deg); opacity: 0; } }
.need { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; }
/* A fixed square that never shrinks or stretches in a narrow card (a flex row would squeeze one and stretch another). */
.want { --w: clamp(30px, 10vw, 42px); flex: none; position: relative; width: var(--w); height: var(--w); box-sizing: border-box; border-radius: 12px; background: var(--bg); display: grid; place-items: center; transition: background .3s; }
.want img { width: 80%; height: 80%; object-fit: contain; opacity: .5; filter: grayscale(.6); transition: opacity .3s, filter .3s; }
.want.have { background: color-mix(in srgb, var(--good) 20%, var(--bg)); }
.want.have img { opacity: 1; filter: none; }
.want.have::after { content: "✓"; position: absolute; left: -3px; bottom: -4px; width: 16px; height: 16px; border-radius: 50%; background: var(--good); color: #fff; font: 900 10px/16px system-ui; text-align: center; }
.want.got img { animation: bump .5s var(--spring); }
.want.got::after { animation: pop-in .4s var(--spring); }
.want em { position: absolute; right: -3px; top: -4px; font: 800 11px/16px system-ui; min-width: 16px; text-align: center; border-radius: 8px; background: #fff; color: #3d6b1a; border: 1px solid #5b8f2a; font-style: normal; }
.reward { display: flex; align-items: center; gap: 3px; font-weight: 800; color: var(--gold); font-size: 14px; font-variant-numeric: tabular-nums; }
.reward img { width: 17px; height: 17px; }
.obtns { display: flex; gap: 2px; align-items: center; }
.obtns .btn.primary { padding: 5px 12px; }
.obtns .icon { font-size: 16px; color: var(--muted); }
.farm .field { margin: 0; min-width: 0; justify-content: center; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.farm .field canvas { border-radius: 20px; box-shadow: 0 0 0 4px #4e8726, var(--shadow-lg); }
/* Always takes its room, so tapping empty soil does not shrink the page and jump it up. */
.info { display: flex; visibility: hidden; min-height: 72px; box-sizing: border-box; align-items: center; gap: 12px; padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.info.show { visibility: visible; animation: rise .35s var(--spring); }
.info > div { flex: 1; min-width: 0; }
.info p { margin: 4px 0 0; }
.info img.big { width: 46px; height: 46px; animation: bob 2.4s ease-in-out infinite; }
.info .lv { margin-left: 8px; font-size: 12px; font-weight: 800; color: var(--muted); }
.cost { display: flex; align-items: center; gap: 2px; font-weight: 800; }
.cost img { width: 18px; height: 18px; }
.chain { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.chain img { width: 22px; height: 22px; opacity: .3; filter: grayscale(1); transition: transform .3s; }
.chain img.done { opacity: .85; filter: none; }
.chain img.cur { opacity: 1; filter: none; transform: scale(1.35); margin: 0 3px; }
.gate { display: grid; justify-items: center; gap: 14px; padding: 60px 0; text-align: center; }
.gate h1 { font-size: 30px; font-weight: 900; margin: 0; }
.gate-art { width: 120px; height: 120px; animation: bob 2.6s ease-in-out infinite; filter: drop-shadow(0 14px 14px rgba(0, 0, 0, .18)); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* gomoku */
.board.gomoku { background: #e2b866; border-radius: 6px; box-shadow: 0 0 0 6px #c8974a, 0 0 0 8px #7a5428, var(--shadow-lg); }
.pill.eye { gap: 4px; }

/* 圈地大作战 */
.small { font-size: 13px; }

/* 8号桌球 */
.chess-game.pool { grid-template-columns: minmax(0, 900px) minmax(220px, 280px); }
@media (max-width: 1100px) { .chess-game.pool { grid-template-columns: minmax(0, 900px); } }
.pool .pbar { max-width: none; }
.board.pool { max-width: none; aspect-ratio: 1108 / 608; background: #1e140c; border-radius: 18px; box-shadow: var(--shadow-lg); }
@media (max-width: 600px) and (orientation: portrait) { .board.pool { aspect-ratio: 608 / 1108; max-height: calc(100svh - 290px); width: auto; } }
.pool-deck { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 8px 12px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.pool-hit { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.pool-cueball { position: relative; flex: none; width: 54px; height: 54px; border-radius: 50%; cursor: crosshair; touch-action: none; background: radial-gradient(circle at 36% 30%, #fff, #efebe0 45%, #b7b0a0); box-shadow: inset 0 -5px 10px rgba(0, 0, 0, .16), 0 2px 6px rgba(0, 0, 0, .22); }
.pool-cueball u { position: absolute; inset: 10%; border-radius: 50%; border: 1px dashed rgba(0, 0, 0, .2); pointer-events: none; }
.pool-cueball u::before, .pool-cueball u::after { content: ''; position: absolute; background: rgba(0, 0, 0, .12); }
.pool-cueball u::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.pool-cueball u::after { top: 50%; left: 0; right: 0; height: 1px; }
.pool-cueball i { position: absolute; left: 50%; top: 50%; width: 24%; height: 24%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff8080, #d42a2a); box-shadow: 0 0 0 2px rgba(255, 255, 255, .8), 0 1px 3px rgba(0, 0, 0, .4); transform: translate(-50%, -50%); transition: left .12s, top .12s; pointer-events: none; }
.pool-meter { position: relative; flex: 1 1 160px; height: 34px; border-radius: 17px; background: rgba(127, 110, 80, .14); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .12); overflow: hidden; cursor: ew-resize; touch-action: none; }
.pool-lift { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.pool-lift input { width: 96px; accent-color: var(--accent); }
.pool-lift b { min-width: 2.4em; color: var(--ink); font-variant-numeric: tabular-nums; }
.pool-meter i { position: absolute; inset: 0; background: linear-gradient(90deg, #5ee07a, #ffd43b 55%, #ff4d4d); clip-path: inset(0 100% 0 0); }
.pool-meter span, .pool-meter b { position: absolute; top: 50%; transform: translateY(-50%); font-size: 13px; pointer-events: none; }
.pool-meter span { left: 14px; font-weight: 700; color: var(--muted); }
.pool-meter b { right: 14px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }
.pool-badge { display: flex; flex-wrap: wrap; gap: 2px; justify-content: flex-end; max-width: 50%; }
.pool-badge i { width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; font: 800 9px/1 system-ui, sans-serif; font-style: normal; color: #fff; background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .45), transparent 50%), var(--c); box-shadow: inset 0 -2px 3px rgba(0, 0, 0, .3); }
.pool-badge i.st { color: #222; background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .5), transparent 50%), linear-gradient(#f6f3ea 25%, var(--c) 25% 75%, #f6f3ea 75%); }
.pool-badge i.open { background: var(--line); color: var(--muted); }

/* 许由直播 home tile and mask icons (the pages themselves load tv.css) */
main:has(> .tv) { max-width: 1240px; }
.ic { display: inline-block; width: 1.15em; height: 1.15em; flex: none; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; vertical-align: -0.2em; }
.t-tv .art { display: grid; place-items: center; }
.tv-tile { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 16px; background: linear-gradient(135deg, #2b1f5c, #7b2ff7 55%, #ff3d8b); color: #fff; box-shadow: 0 8px 20px rgba(123, 47, 247, .35); }
.tv-tile .ic { width: 34px; height: 34px; }
.tv-tile b { font-size: 13px; letter-spacing: .1em; padding: 1px 6px; border-radius: 6px; background: #ff2d55; animation: onair 1.6s ease-in-out infinite; }
@keyframes onair { 50% { opacity: .55; } }
.result .again { display: grid; justify-items: center; gap: 6px; margin-top: 10px; cursor: default; }
.result .again p { margin: 0; }
#who:has(.chip) { display: flex; align-items: center; gap: 4px; }
#who .reload { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--gold); font-size: 18px; font-weight: 800; line-height: 1; cursor: pointer; }
#who .reload:disabled { opacity: .35; cursor: default; }
#who .reload:not(:disabled):active { transform: rotate(180deg); transition: transform .2s; }
.busy .dlg { display: flex; align-items: center; gap: 12px; font-weight: 800; z-index: 70; }
.busy { z-index: 70; }
#net { position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: 80; display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 14px; background: var(--bad); color: #fff; font-weight: 800; box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); }
#net[hidden] { display: none; }
#net .spin { border-color: rgba(255, 255, 255, .4); border-top-color: #fff; flex: none; }
/* farm yard: decorations and the shop */
.yard { display: flex; align-items: center; gap: 6px; min-height: 44px; }
.ydecos { flex: 1; min-width: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.ydecos::-webkit-scrollbar { display: none; }
.ydecos > .ydeco { flex: none; }
.ytool { flex: none; display: grid; justify-items: center; gap: 1px; min-width: 40px; padding: 3px 4px; border: 0; border-radius: 12px; background: none; color: var(--ink); cursor: pointer; font: inherit; transition: background .15s; }
.ytool:hover { background: color-mix(in srgb, var(--card) 70%, transparent); }
.ytool img { width: 26px; height: 26px; }
.ytool small { font-size: 11px; font-weight: 700; white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.ytool.pop img { animation: bump .45s var(--spring); }
.order .ask-btn { position: absolute; top: 3px; right: 4px; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; opacity: .7; transition: opacity .15s, transform .15s; }
.order .ask-btn:hover { opacity: 1; transform: scale(1.1); }
.order .ask-btn img { width: 16px; height: 16px; }
.yard .ydeco { width: 40px; height: 40px; padding: 0; border: 0; border-radius: 12px; background: color-mix(in srgb, var(--card) 70%, transparent); cursor: pointer; display: grid; place-items: center; }
.yard .ydeco img { --bob: -3px; width: 32px; height: 32px; animation: bob 2.6s ease-in-out infinite; animation-delay: calc(var(--i) * -.4s); }
.yard .ydeco.pop img { animation: bump .45s var(--spring); }
.shop { display: grid; gap: 4px; margin-top: 8px; }
.shop-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.shop-row:last-child { border-bottom: 0; }
.shop-row > img { width: 40px; height: 40px; }
.shop-row > div { flex: 1; min-width: 0; display: grid; }
.shop-row small { color: var(--muted); }
.shop-row.own > img { animation: bob 2.6s ease-in-out infinite; }
.yard .fest { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(135deg, #ffe7c2, #ffd08a); color: #6b3d0b; cursor: pointer; font: inherit; }
.yard .fest img { --bob: -3px; width: 30px; height: 30px; animation: bob 2.2s ease-in-out infinite; }
.yard .fest span { display: grid; line-height: 1.15; text-align: left; }
.yard .fest small { font-size: 11px; opacity: .75; }
.shop-row.locked > img { filter: grayscale(1); opacity: .5; }
.shop-row .how { color: var(--muted); white-space: nowrap; }
.pill.fest-tag { margin-left: 6px; font-size: 11px; background: #ffd08a; color: #6b3d0b; border: 0; }
.chain.big { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 10px; }
.chain.big img { width: 30px; height: 30px; }
.fest-rules { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--muted); }
.yard .ytool.weather img { --bob: -2px; animation: bob 3s ease-in-out infinite; }
.wx-day { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.wx-day > img { width: 48px; height: 48px; flex: none; }
.wx-fx { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 2px; font-size: 14px; }
.wx-fx .good, .fhelp .good { color: var(--good); }
.wx-fx .bad, .fhelp .bad { color: var(--bad); }
.dlg.fhelp-dlg { width: 640px; }
.fhelp-dlg h3 { margin: 16px 0 8px; font-size: 15px; }
.fhelp-scroll { overflow-x: auto; margin-bottom: 10px; }
.fhelp { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.45; }
.fhelp th, .fhelp td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.fhelp thead th { color: var(--muted); font-weight: 700; white-space: nowrap; }
.fhelp tbody th { white-space: nowrap; }
.fhelp td { white-space: nowrap; }
.fhelp td:last-child { white-space: normal; }
.fhelp-wx { display: inline-flex; align-items: center; gap: 4px; }
.fhelp-wx img { width: 20px; height: 20px; }
.vtabs { margin: 4px 0 10px; }
/* One height for every tab, so switching does not resize the window. */
.vbody { display: grid; align-content: start; gap: 2px; height: min(60vh, 440px); overflow-y: auto; }
.vrow { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.vrow:last-child { border-bottom: 0; }
.vrow.link { border-radius: 12px; transition: background .15s; }
.vrow.link:hover { background: var(--bg); }
.vrow > div { flex: 1; min-width: 0; display: grid; }
.vrow p { flex: 1; margin: 0; }
.vrow small { color: var(--muted); white-space: nowrap; }
.pill.water { display: inline-flex; align-items: center; gap: 2px; background: #d6efff; color: #1d5f8a; border: 0; }
.pill.water img { width: 16px; height: 16px; }
.vhead { display: flex; align-items: center; gap: 10px; }
.vhead > div { display: grid; }
.vhead small { color: var(--muted); }
.vhead .back { margin-right: auto; color: var(--muted); text-decoration: none; font-weight: 700; }
.vhead .av { width: 36px; height: 36px; }
.vacts { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.vact { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; padding: 10px 14px; text-align: left; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--ink); box-shadow: var(--shadow); cursor: pointer; font: inherit; transition: transform .15s; }
.vact img { grid-row: span 2; width: 36px; height: 36px; }
.vact small { color: var(--muted); }
.vact:not(:disabled):hover { transform: translateY(-2px); }
.vact:disabled { opacity: .55; cursor: default; }
.vact.water:not(:disabled) { border-color: #6cc4ff; }
.pill.thief { display: inline-flex; align-items: center; gap: 2px; background: #ffe0c7; color: #8a3d0b; border: 0; }
.pill.thief img { width: 16px; height: 16px; }
.vact.thief { cursor: default; border-color: #ffb27a; }
.vact.thief.off { opacity: .55; border-color: var(--line); }
.info .muted { color: var(--muted); font-size: 12px; }
.obtns .icon { padding: 4px 5px; }
.obtns .icon img { width: 18px; height: 18px; }
@media (max-width: 420px) { .obtns .btn.primary { padding: 5px 8px; } }
.vrow.ask .need { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 4px; margin: 4px 0 2px; }
.vrow.ask .want { --w: 34px; }
.vrow.ask.mine { background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 12px; }
.vrow .btn { flex: none; }
.vrow.rank .medal { width: 28px; height: 28px; flex: none; }
.vrow.rank .no { width: 28px; text-align: center; color: var(--muted); flex: none; }
.vrow.rank.me { background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 12px; }
.vrow.rank .coins img { width: 16px; height: 16px; }
.vbody > .muted { margin: 0 0 6px; font-size: 12px; color: var(--muted); }
/* 议事厅 on the home page */
.home-forum { position: relative; overflow: hidden; max-width: 900px; margin: 22px auto 0; padding: 14px 16px; border-radius: 24px; color: #fff; box-shadow: var(--shadow-lg); background: linear-gradient(120deg, #1e1b4b, #5b21b6 42%, #c026d3 78%, #f97316) 0 0 / 200% 200%; animation: card-in .5s var(--spring) both, hf-aurora 14s ease-in-out infinite alternate; }
@keyframes hf-aurora { to { background-position: 100% 100%; } }
.hf-head { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.hf-head .ic { width: 30px; height: 30px; animation: hf-shout 2.6s ease-in-out infinite; }
@keyframes hf-shout { 0%, 100% { transform: rotate(-8deg); } 10% { transform: rotate(6deg) scale(1.12); } 22% { transform: rotate(0) scale(1); } }
.hf-head b { font-size: 20px; font-weight: 900; letter-spacing: .06em; }
.hf-head span { margin-left: auto; padding: 6px 14px; border-radius: 99px; background: rgba(255, 255, 255, .18); font-weight: 800; transition: background .2s, transform .2s; }
.hf-head:hover span { background: rgba(255, 255, 255, .3); transform: translateX(3px); }
.hf-rows { display: grid; gap: 8px; margin-top: 12px; }
.hf-rows:empty { display: none; }
.hf-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 14px; color: #fff; text-decoration: none; background: rgba(255, 255, 255, .12); animation: card-in .5s var(--spring) both; animation-delay: calc(var(--i) * .08s + .1s); transition: background .2s, transform .2s; }
.hf-row:hover { background: rgba(255, 255, 255, .22); transform: translateX(4px); }
.hf-row b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hf-score, .hf-n { display: inline-flex; align-items: center; gap: 4px; font-weight: 900; font-variant-numeric: tabular-nums; }
.hf-score { min-width: 3.4em; color: #ffd9a0; }
.hf-n { font-size: 13px; opacity: .85; }
.hf-row .ic { width: 15px; height: 15px; }
/* Phones have no nav bar, so 议事厅 comes right under the banner there. */
@media (max-width: 600px) {
  #view:has(> .home-forum) { display: flex; flex-direction: column; }
  #view:has(> .home-forum) > * { width: 100%; box-sizing: border-box; }
  #view > .hero { order: -2; }
  #view > .home-forum { order: -1; width: 100%; box-sizing: border-box; margin: 0 0 18px; }
}
.home-top:empty { display: none; }
.home-top h2 { display: flex; align-items: center; gap: 8px; font-size: 18px; margin: 18px 0 10px; }
.home-top h2 img { width: 26px; height: 26px; }
.podium { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.podium-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); animation: card-in .5s var(--spring) both; animation-delay: calc(var(--i) * .08s); transition: transform .15s; }
.podium-row:hover { transform: translateY(-2px); }
.podium-row > img:first-child { width: 30px; height: 30px; }
.podium-row b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-row .coins img { width: 16px; height: 16px; }
.ytool { position: relative; }
.ytool .dot { position: absolute; top: 0; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--bad); color: #fff; font: 800 10px/16px system-ui; font-style: normal; animation: bump .45s var(--spring); }
.vhead .next { flex: none; }
/* 合成农场: a 许由餐厅 dish's buff in the HUD */
.farm-buff { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px 5px 6px; border-radius: 99px; font-size: 12px; text-decoration: none; color: #fff; background: linear-gradient(135deg, #3aa64a, #7ccf4a); box-shadow: var(--shadow); animation: pop-in .4s var(--spring); }
.farm-buff img { width: 20px; height: 20px; }
.farm-buff small { opacity: .85; }

/* 中国象棋 */
.game-card.t-xiangqi { background: linear-gradient(160deg, #fbe3c4, #d9944f); color: #4a1a08; }
.xq-tile { position: relative; width: 96px; height: 96px; animation: bob 3.2s ease-in-out infinite; animation-delay: -2s; filter: drop-shadow(0 10px 10px rgba(0, 0, 0, .22)); transition: transform .3s var(--spring); }
.xq-tile i { position: absolute; width: 62px; height: 62px; background: center / contain no-repeat; }
.xq-tile .r { left: 2px; top: 4px; background-image: url(/xiangqi/red_king.svg); }
.xq-tile .b { right: 2px; bottom: 4px; background-image: url(/xiangqi/black_king.svg); }
.game-card:hover .xq-tile { transform: scale(1.15) rotate(8deg); }
.lobby-xiangqi .lobby-hero { color: #fff4e2; background: radial-gradient(circle at 80% 30%, rgba(255, 210, 140, .35), transparent 50%), linear-gradient(135deg, #7a1e12, #b4442a 55%, #d9944f); }
.lobby-xiangqi .lobby-hero::before { opacity: .12; background: linear-gradient(#fff 1px, transparent 1px) 0 0 / 40px 40px, linear-gradient(90deg, #fff 1px, transparent 1px) 0 0 / 40px 40px; }
.lobby-hero .mini-xq.demo { width: 210px; transform: perspective(900px) rotateX(14deg) rotateZ(-3deg); }
@media (max-width: 640px) { .lobby-hero .mini-xq.demo { width: min(48vw, 190px); } }
.lobby-xiangqi .live-mini { background: linear-gradient(135deg, #5a2414, #33130a); }
.live-mini .mini-xq { width: 66%; }
/* A xiangqi position on the real board picture: points are 100 apart from (51, 51) on its 902 by 1002. */
.mini-xq { position: relative; width: 100%; aspect-ratio: 902 / 1002; border-radius: 4px; background: url(/xiangqi/board.svg) center / 100% 100%; box-shadow: 0 0 0 3px #b07a3c, 0 0 0 4px #5a3a18; }
.mini-xq i { position: absolute; width: 10.6%; aspect-ratio: 1; left: calc((51.4 + var(--x) * 100) / 902.4 * 100%); top: calc((51 + var(--y) * 100) / 1002 * 100%); translate: -50% -50%; background: center / contain no-repeat; transition: left .45s cubic-bezier(.5, 0, .2, 1), top .45s cubic-bezier(.5, 0, .2, 1); }
.board.xiangqi { aspect-ratio: 902 / 1002; max-width: min(560px, calc((100vh - 190px) * .9)); max-width: min(560px, calc((100svh - 190px) * .9)); background: #e1be86; border-radius: 4px; box-shadow: 0 0 0 7px #b07a3c, 0 0 0 9px #5a3a18, var(--shadow-lg); }
.chess-game.xiangqi .col::before { background: radial-gradient(closest-side, rgba(220, 70, 40, .22), transparent); }
.pc.xq { width: 18px; height: 18px; border: 0; background: center / contain no-repeat; }
.pc.xq.w { background-image: url(/xiangqi/red_king.svg); }
.pc.xq.b { background-image: url(/xiangqi/black_king.svg); }
.btn .pc.xq { width: 16px; height: 16px; }
.xq-moves li span { min-width: 5.5em; font-family: KaiTi, STKaiti, "Kaiti SC", serif; font-size: 16px; }

/* 管理员面板 */
.adm { max-width: 1100px; margin: 0 auto; }
.adm-cols { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
@media (max-width: 760px) { .adm-cols { grid-template-columns: 1fr; } }
.adm-list { display: grid; gap: 6px; margin-top: 8px; max-height: 70vh; overflow-y: auto; }
.adm-p { display: grid; gap: 2px; text-align: left; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.adm-p.on { border-color: var(--accent); }
.adm-p small { color: var(--muted); }
.adm-p code, .adm code { font-size: 11px; color: var(--muted); word-break: break-all; }
.adm-detail { display: grid; gap: 10px; min-width: 0; }
.adm-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.adm-row .input { width: 160px; }
.adm-json { width: 100%; min-height: 50vh; font: 12px/1.5 ui-monospace, Consolas, monospace; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); box-sizing: border-box; }
.adm .input { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; box-sizing: border-box; }
.adm > div > div > .input { width: 100%; }
/* 公告 */
.notice-btn { position: fixed; left: 16px; bottom: 16px; z-index: 30; padding: 8px 14px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 800; box-shadow: var(--shadow-lg); cursor: pointer; }
.notices { display: grid; gap: 12px; max-height: 60vh; overflow-y: auto; }
.notice { padding: 12px 14px; border-radius: 14px; background: var(--bg); }
.notice small { color: var(--muted); }
.notice .md { margin-top: 6px; overflow-wrap: anywhere; line-height: 1.6; }
/* 公告 Markdown */
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 8px; }
.md h3, .md h4, .md h5, .md h6 { margin: 14px 0 6px; line-height: 1.3; }
.md h3 { font-size: 18px; }
.md h4 { font-size: 16px; }
.md h5, .md h6 { font-size: 14px; }
.md ul, .md ol { margin: 0 0 8px; padding-left: 1.4em; }
.md li { margin: 2px 0; }
.md li > ul, .md li > ol { margin: 2px 0 0; }
.md blockquote { margin: 0 0 8px; padding: 6px 12px; border-left: 4px solid var(--accent); border-radius: 4px 10px 10px 4px; background: var(--card); color: var(--muted); }
.md hr { margin: 12px 0; border: 0; border-top: 1px solid var(--line); }
.md code { padding: 1px 5px; border-radius: 6px; background: var(--card); font-size: .92em; }
.md pre { margin: 0 0 8px; padding: 10px 12px; border-radius: 10px; background: var(--card); overflow-x: auto; }
.md pre code { padding: 0; background: none; }
.md a { color: var(--accent); }
.md del { opacity: .6; }
.md-table { margin: 0 0 8px; overflow-x: auto; }
.md table { border-collapse: collapse; font-size: 14px; min-width: 100%; }
.md th, .md td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.md th, .md td:first-child { white-space: nowrap; }
.md-preview { margin: 8px 0 12px; border: 1.5px dashed var(--line); }
.md-preview > small { display: block; margin-bottom: 4px; }
.notice-hint { margin: 6px 0 0; }
.notice-hint small { margin-left: 6px; }
.notice .actions { margin-top: 8px; justify-content: flex-end; }
.notice-edit { width: 100%; min-height: 160px; box-sizing: border-box; padding: 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; resize: vertical; }
.notice-gift { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.notice-gift .btn { margin-left: auto; }
.notice-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: var(--card); font-weight: 700; font-size: 14px; }
.notice-chip img { width: 22px; height: 22px; }
.notice-gifts { display: grid; gap: 8px; }
.notice-gift-row { display: flex; flex-wrap: wrap; gap: 6px; }
.notice-gift-row select { flex: 1 1 120px; min-width: 0; }
.notice-gift-row input { width: 80px; }

/* farm: plots, the warehouse, festival stars, the village goal */
.btn.gift.reap { background: linear-gradient(135deg, #8be05a, #4caf50); color: #fff; }
.want.team { box-shadow: inset 0 0 0 2px #f2b632; } /* 村子合作 (not .coop, the goal banner's class); inside, so it looks the same size as the rest */
.yard .ydeco { position: relative; }
.yard .ydeco .stars { position: absolute; left: 50%; bottom: -3px; translate: -50% 0; font: 800 9px/1 system-ui; font-style: normal; letter-spacing: -1px; color: #f2b632; text-shadow: 0 0 2px #fff, 0 0 2px #fff; white-space: nowrap; }
.info .grow { margin: 2px 0 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.store-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 8px 0 12px; }
.store-cell { position: relative; aspect-ratio: 1; border: 0; border-radius: 12px; background: var(--bg); display: grid; place-items: center; padding: 0; cursor: pointer; }
.store-cell img { width: 72%; height: 72%; }
.store-cell.empty { cursor: default; border: 1px dashed var(--line); background: none; }
.store-cell em { position: absolute; right: 2px; top: 2px; font: 800 11px/16px system-ui; min-width: 16px; text-align: center; border-radius: 8px; background: #fff; color: #3d6b1a; border: 1px solid #5b8f2a; font-style: normal; }
.coop { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 8px; border-radius: 14px; background: linear-gradient(135deg, #fff4d6, #ffe3a8); color: #6b3d0b; }
.coop:empty { display: none; }
.coop > div { flex: 1; min-width: 0; display: grid; gap: 4px; }
.coop img.big { width: 40px; height: 40px; flex: none; }
.coop b { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.coop b small { font-weight: 600; opacity: .75; }
.coop small { font-size: 12px; }
.coop .bar { height: 10px; border-radius: 99px; background: rgba(107, 61, 11, .15); overflow: hidden; }
.coop .bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f2b632, #ff8a3d); transition: width .6s var(--spring); }
.coop .bar.done i { background: linear-gradient(90deg, #4caf50, #8be05a); }
/* Phones: the decorations take their own line under the tools, which then all fit. */
@media (max-width: 560px) {
  .yard { flex-wrap: wrap; row-gap: 4px; }
  .yard .ydecos { order: 9; flex-basis: 100%; }
  .yard .ydecos:empty { display: none; }
  .yard .fest { margin-right: auto; }
}
@media (max-width: 420px) {
  .yard { gap: 2px; }
  .ytool { min-width: 34px; padding: 3px 2px; }
  .ytool img { width: 24px; height: 24px; }
  .ytool small { font-size: 10px; }
  .yard .fest { padding-right: 6px; }
}
@media (max-width: 380px) {
  .yard .fest { padding: 4px; }
  .yard .fest span { display: none; }
}
/* The HUD keeps energy, level and the 玩法 book on one line: the meters share what is left. */
.hud .meter { flex: 1 1 110px; min-width: 0; gap: 6px; padding: 6px 8px; }
.hud .meter > img { width: 24px; height: 24px; }
.hud .meter > div { min-width: 0; }
.hud .meter > div > div:first-child { display: flex; align-items: baseline; gap: 4px; white-space: nowrap; overflow: hidden; }
.hud .meter small { font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.hud .btn.help { padding: 0; display: grid; place-items: center; }
.hud .btn.help img { width: 22px; height: 22px; }
/* 体力 bubble over a tapped bolt, and the 存进仓库 area while dragging */
.farm .field { position: relative; }
.ebubble { position: absolute; z-index: 5; translate: -50% -100%; padding: 4px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow-lg); white-space: nowrap; }
.ebubble::after { content: ""; position: absolute; left: 50%; bottom: -6px; translate: -50% 0; border: 6px solid transparent; border-bottom: 0; border-top-color: var(--card); }
.ebubble .btn b { font-weight: 800; }
.store-zone { position: fixed; z-index: 30; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); translate: -50% 0; display: flex; align-items: center; gap: 8px; padding: 12px 26px; border-radius: 99px; border: 2px dashed #8a6a3f; background: color-mix(in srgb, var(--card) 92%, transparent); color: var(--ink); box-shadow: var(--shadow-lg); pointer-events: none; animation: pop-in .25s var(--spring); }
.store-zone img { width: 30px; height: 30px; }
.store-zone.hot { border-style: solid; border-color: #f2b632; background: #fff4d6; color: #6b3d0b; scale: 1.08; }
.store-zone.full { opacity: .7; }
.ytool .dot.n { background: var(--muted); }
.store-zone[hidden], .ebubble[hidden] { display: none; }
.meter.energy.over b { color: #e8900c; }
/* 第 4 个订单栏: four across, two by two on phones. 加急订单 takes a row of its own. */
.orders.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 520px) { .orders.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.order.rush { grid-column: 1 / -1; grid-template-columns: auto 1fr auto auto; align-items: center; justify-items: start; gap: 8px; padding: 8px 10px; background: linear-gradient(135deg, #fff1df, #ffd9b0); border-color: #ffb36b; }
.rush-head { display: grid; justify-items: center; line-height: 1.1; color: #8a4a0b; }
.rush-head img { width: 26px; height: 26px; animation: wiggle 2.4s infinite; }
.rush-head small { font-variant-numeric: tabular-nums; font-size: 11px; }
.order.rush .need { justify-content: flex-start; }
.rush-gift { display: inline-flex; align-items: center; margin-left: 4px; color: var(--muted); }
.rush-gift img { width: 18px; height: 18px; }
@media (max-width: 420px) { .order.rush { grid-template-columns: auto 1fr auto; } .order.rush .reward { grid-column: 2; } .order.rush .btn { grid-row: 1 / 3; grid-column: 3; } .order.rush .need { grid-column: 2; } .rush-head { grid-row: 1 / 3; } }
/* 每日任务 and 等级奖励 */
.task-btn { display: inline-flex; align-items: center; gap: 3px; padding: 4px 8px; }
.task-btn img { width: 22px; height: 22px; }
.task-btn.ready { animation: wiggle 1.4s infinite; background: linear-gradient(135deg, #ffe08a, #f2b632); }
.hud .meter.level { cursor: pointer; }
.tasks { display: grid; gap: 8px; margin: 10px 0; }
.task { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: var(--bg); }
.task > b { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: #fff; font-size: 13px; flex: none; }
.task.done > b { background: var(--good); border-color: var(--good); }
.task > div { flex: 1; min-width: 0; display: grid; gap: 4px; }
.task .bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.task .bar i { display: block; height: 100%; border-radius: inherit; background: var(--good); }
.task small { font-variant-numeric: tabular-nums; color: var(--muted); }
.task-prize { display: grid; gap: 8px; justify-items: start; }
.task-prize p { margin: 0; }
.task-items { display: flex; flex-wrap: wrap; gap: 6px; }
.lvlist { display: grid; gap: 4px; margin-top: 8px; }
.lvrow { display: flex; align-items: baseline; gap: 10px; padding: 6px 8px; border-radius: 10px; }
.lvrow b { flex: none; width: 48px; }
.lvrow span { flex: 1; }
.lvrow.got { color: var(--muted); }
.lvrow small { color: var(--good); font-weight: 800; }
/* 图鉴 */
.dex { display: grid; gap: 6px; margin-top: 8px; }
.dex-row { display: grid; gap: 4px; padding: 8px; border-radius: 14px; background: var(--bg); }
.dex-row.full { background: linear-gradient(135deg, #fff4d6, #ffe3a8); color: #6b3d0b; }
.dex-row.full .dex-name small { color: #8a5a20; }
.dex-items { display: flex; gap: 2px; }
.dex-items span { flex: 1; display: grid; place-items: center; }
.dex-items img { width: min(36px, 100%); aspect-ratio: 1; }
.dex-items .no img { filter: brightness(0); opacity: .18; }
.dex-name { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dex-name small { color: var(--muted); }
/* 周榜奖杯 and titles */
.yard .ydeco.cup .medal { position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px; animation: none; }
.vrow img.mini { display: inline-block; width: 16px; height: 16px; vertical-align: -2px; margin-left: 4px; }
.lastweek { display: flex; align-items: center; gap: 8px; padding: 8px; margin: 6px 0 4px; border-radius: 14px; background: linear-gradient(135deg, #fff4d6, #ffe3a8); color: #6b3d0b; flex: none; flex-wrap: wrap; }
.lastweek > small { font-weight: 800; flex: none; }
.lastweek a { display: flex; align-items: center; gap: 4px; color: inherit; text-decoration: none; min-width: 0; flex: none; }
.lastweek .medal { width: 20px; height: 20px; }
.lastweek .av { width: 24px; height: 24px; }
.lastweek span { display: grid; line-height: 1.1; }
.lastweek span b { font-size: 12px; max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lastweek span small { font-size: 11px; }
.info .odds { margin-left: 6px; font-weight: 600; }
.task-items .store-cell { width: 48px; }
/* Icons inside the new farm buttons stay icon sized. */
.task-prize .btn, .info .btn { display: inline-flex; align-items: center; gap: 4px; }
.task-prize .btn img { width: 22px; height: 22px; }
.info .btn img { width: 18px; height: 18px; flex: none; }
