:root {
  --font: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Heiti TC", system-ui, sans-serif;
  --ink: #1a1030;
  --pink: #ff4f8b;
  --yellow: #ffd23f;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; position: fixed; top: 0; left: 0; right: 0; height: var(--app-h, 100%); overflow: hidden; /* (v194: a page that can't scroll can't be left shifted under the taps) */ background: #1a1030; color: #fff; font-family: var(--font);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; touch-action: none; }
canvas#game { position: fixed; top: 0; left: 0; width: 100%; height: var(--app-h, 100vh); display: block; touch-action: none; background: #f0d9bd; }
button { font-family: var(--font); cursor: pointer; border: 0; }
.hidden { display: none !important; }

#flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 30; }
#flash.on { animation: flash .5s ease-out; }
#flash.under { background: #1f7fc4; animation: under .9s ease-out; } /* v229 off the water slide in first person: under for a moment */
@keyframes under { 0% { opacity: 0; } 12% { opacity: .55; } 60% { opacity: .35; } 100% { opacity: 0; } }
@keyframes flash { 0% { opacity: var(--fo, .9) } 100% { opacity: 0 } }
#danger { position: fixed; inset: 0; pointer-events: none; opacity: 0; z-index: 2;
  background: radial-gradient(ellipse at center, rgba(255,0,0,0) 55%, rgba(220,0,30,.55) 100%); }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.panel { background: rgba(20, 12, 40, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.12); border-radius: 14px; }
#avatar-wrap { position: absolute; left: calc(10px + var(--sal)); top: calc(10px + var(--sat)); width: 54px; height: 54px; }
#avatar { width: 54px; height: 54px; border-radius: 50%; border: 3px solid #ffd23f; box-shadow: 0 3px 10px rgba(0,0,0,.35); object-fit: cover; transition: filter .3s, border-color .3s; }
#avatar-badge { position: absolute; right: -6px; bottom: -4px; font-size: 20px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
#avatar-wrap.st-happy #avatar { border-color: #ff6fa5; animation: av-bounce .5s ease-in-out infinite alternate; }
#avatar-wrap.st-hungry #avatar { border-color: #ffb300; filter: saturate(.5); animation: av-pulse .8s ease-in-out infinite alternate; }
#avatar-wrap.st-tired #avatar { border-color: #8fa3c9; filter: grayscale(.6) brightness(.8); }
#avatar-wrap.st-danger #avatar { border-color: #ff2d3d; box-shadow: 0 0 0 3px rgba(255,45,61,.45), 0 3px 10px rgba(0,0,0,.35); animation: av-shake .12s linear infinite; }
#avatar-wrap.st-hungry #avatar-badge, #avatar-wrap.st-danger #avatar-badge { animation: av-pulse .5s ease-in-out infinite alternate; }
@keyframes av-bounce { to { transform: translateY(-3px) rotate(-4deg); } }
@keyframes av-pulse { to { transform: scale(1.12); } }
@keyframes av-shake { 0% { transform: translateX(-1.5px) } 50% { transform: translateX(1.5px) } 100% { transform: translateX(-1.5px) } }
/* chaser direction arrows */
#arrows { position: absolute; inset: 0; pointer-events: none; }
.arrow { position: absolute; left: 0; top: 0; width: 0; height: 0; display: none; will-change: transform; }
.arrow b { position: absolute; left: -17px; top: -17px; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--ac, #ff2d3d); box-shadow: 0 2px 8px rgba(0,0,0,.45); }
.arrow em { position: absolute; left: -24px; top: -24px; width: 48px; height: 48px; }
.arrow em::before { content: ""; position: absolute; top: -6px; left: 50%; margin-left: -9px; border: 9px solid transparent; border-bottom: 12px solid var(--ac, #ff2d3d); border-top: 0; }
.arrow b::after { content: "!"; font-weight: 900; font-size: 18px; color: #fff; }
.arrow i { position: absolute; left: -24px; top: 20px; width: 48px; text-align: center; font-style: normal; font-weight: 900; font-size: 12px; color: #fff; text-shadow: 0 1px 3px #000; }
.arrow.near b { animation: av-pulse .3s ease-in-out infinite alternate; }
.arrow.onscreen em { display: none; }
/* sprint speed lines */
#speedlines { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .25s; background-size: cover; background-position: center; will-change: opacity; }
#stats { margin-left: 62px; }
#stats { position: absolute; left: calc(10px + var(--sal)); top: calc(10px + var(--sat)); padding: 8px 10px; width: min(220px, 42vw); }
.bar { display: flex; align-items: center; gap: 6px; height: 22px; }
.bar + .bar { margin-top: 4px; }
.bar .ico { width: 18px; font-size: 15px; text-align: center; }
.bar .lbl { font-size: 11px; font-weight: 800; opacity: .8; width: 26px; }
.track { flex: 1; height: 10px; border-radius: 6px; background: rgba(255,255,255,.14); overflow: hidden; position: relative; }
.fill { height: 100%; width: 50%; border-radius: 6px; transition: width .15s linear; }
#bar-mood .fill { background: linear-gradient(90deg, #ff9f1c, #ff3d7f); }
#bar-hunger .fill { background: linear-gradient(90deg, #c6872c, #ffd166); }
#bar-stamina .fill { background: linear-gradient(90deg, #2ec4ff, #7cffb2); }
.bar.low .fill { animation: blink .5s infinite alternate; background: #ff3b3b !important; }
@keyframes blink { to { opacity: .35 } }

#scorebox { position: absolute; left: 50%; top: calc(8px + var(--sat)); transform: translateX(-50%); text-align: center; }
#score { font-size: clamp(28px, 6vw, 44px); font-weight: 900; letter-spacing: 1px; line-height: 1;
  text-shadow: 0 3px 0 #b8255f, 0 0 18px rgba(255,79,139,.6); }
#score.bump { animation: bump .25s ease-out; }
@keyframes bump { 50% { transform: scale(1.18) } }
#scorebox .srow { display: flex; gap: 5px; justify-content: center; margin-top: 4px; }
#wave { font-size: 12px; font-weight: 900; padding: 2px 8px; border-radius: 10px; background: rgba(20,12,40,.72); color: #fff; border: 1px solid rgba(255,255,255,.25); white-space: nowrap; }
#wave.up { animation: bump .4s ease-out 2; background: rgba(255,82,82,.9); }
#mult { display: inline-block; margin-top: 0; font-size: 12px; font-weight: 900; padding: 2px 8px; border-radius: 10px; background: rgba(255,210,63,.9); color: #3b2300; }

#topright { position: absolute; right: calc(10px + var(--sar)); top: calc(10px + var(--sat)); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
#minimap { width: clamp(84px, 22vw, 120px); height: clamp(84px, 22vw, 120px); border-radius: 50%; border: 3px solid rgba(255,255,255,.85);
  box-shadow: 0 4px 14px rgba(0,0,0,.35); background: #2a2a3a; }
.tbtns { display: flex; gap: 8px; pointer-events: auto; }
.tbtn { width: 40px; height: 40px; border-radius: 12px; background: rgba(20,12,40,.6); color: #fff; font-size: 18px; border: 1px solid rgba(255,255,255,.18); }
.tbtn.down { transform: scale(.92); }

#toasts { position: absolute; left: 50%; top: calc(86px + var(--sat)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; width: 90vw; }
.toast { padding: 7px 14px; border-radius: 999px; font-weight: 900; font-size: clamp(13px, 3.4vw, 16px); background: rgba(20,12,40,.75); border: 2px solid rgba(255,255,255,.2);
  animation: tin .25s ease-out; white-space: nowrap; }
.toast.danger { background: rgba(200,20,40,.88); border-color: #ffb3b3; }
.toast.good { background: rgba(30,150,80,.88); border-color: #b9f6ca; }
.toast.out { animation: tout .3s ease-in forwards; }
@keyframes tin { from { transform: translateY(-10px) scale(.9); opacity: 0 } }
@keyframes tout { to { transform: translateY(-8px); opacity: 0 } }

#starve { position: absolute; left: 50%; top: 42%; transform: translateX(-50%); font-weight: 900; font-size: 18px; color: #ffd0d0;
  background: rgba(150,0,20,.75); padding: 8px 16px; border-radius: 14px; animation: blink .6s infinite alternate; }
#starve b { margin-left: 8px; font-size: 22px; color: #fff; }

#popups { position: fixed; inset: 0; pointer-events: none; z-index: 6; overflow: hidden; }
.pop { position: absolute; left: 0; top: 0; font-weight: 900; font-size: clamp(15px, 3.8vw, 20px); white-space: nowrap; color: #fff;
  text-shadow: 0 2px 0 rgba(0,0,0,.6), 0 0 6px rgba(0,0,0,.5); will-change: transform, opacity; }

/* joystick & buttons */
#joy { position: absolute; left: calc(90px + var(--sal)); bottom: calc(90px + var(--sab)); top: auto; width: 116px; height: 116px; margin: -58px 0 0 -58px;
  border-radius: 50%; background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.22); opacity: .55; transition: opacity .15s; }
#joy.active { opacity: 1; bottom: auto; }
#joy-knob { position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; border-radius: 50%; transform: translate(-50%,-50%);
  background: radial-gradient(circle at 35% 30%, #fff, #d9d2ff); box-shadow: 0 4px 12px rgba(0,0,0,.35); }
body.pc #joy { display: none; }
#controls { position: absolute; right: calc(16px + var(--sar)); bottom: calc(18px + var(--sab)); width: 210px; height: 190px; pointer-events: none; }
.cbtn { position: absolute; pointer-events: auto; border-radius: 50%; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 6px 0 rgba(0,0,0,.35), 0 8px 18px rgba(0,0,0,.3); border: 3px solid rgba(255,255,255,.8); touch-action: none; transition: transform .06s; }
.cbtn span { font-size: 28px; line-height: 1; }
.cbtn i { font-style: normal; font-weight: 900; font-size: 15px; margin-top: 2px; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.cbtn.down { transform: translateY(4px) scale(.95); box-shadow: 0 2px 0 rgba(0,0,0,.35); }
.cbtn.big { width: 104px; height: 104px; right: 0; bottom: 0; background: radial-gradient(circle at 35% 30%, #ff8ab3, #e8226a); }
.cbtn.big.push { background: radial-gradient(circle at 35% 30%, #a5e86a, #3c9a1c); }
.cbtn.big.pee { background: radial-gradient(circle at 35% 30%, #fff27a, #e0b000); }
.cbtn.big.play { background: radial-gradient(circle at 35% 30%, #ffab91, #e64a19); }
.cbtn.big.eat { background: radial-gradient(circle at 35% 30%, #ffe27a, #f39c12); animation: pulse .6s infinite alternate; }
.cbtn.big.steal { background: radial-gradient(circle at 35% 30%, #ce93d8, #7b1fa2); }
@keyframes pulse { to { transform: scale(1.06) } }
.cbtn.small { width: 66px; height: 66px; }
/* roar charge ring + cooldown on the action button */
#roar-ring { position: absolute; right: -8px; bottom: -8px; width: 120px; height: 120px; border-radius: 50%; pointer-events: none; display: none;
  background: conic-gradient(#ffd23f calc(var(--ch, 0) * 360deg), rgba(20,12,40,.6) 0); }
#roar-ring.on { display: block; }
#roar-ring.full { background: #fff; box-shadow: 0 0 20px #ffd23f; }
#btn-action.charging { animation: chshake .08s linear infinite; background: radial-gradient(circle at 35% 30%, #ffe27a, #ff6d00) !important; }
@keyframes chshake { 0% { transform: translate(-1px, 0) } 50% { transform: translate(1px, 1px) } 100% { transform: translate(-1px, 0) } }
#roar-cd { position: absolute; right: -2px; bottom: 80px; z-index: 2; pointer-events: none; min-width: 26px; height: 26px; border-radius: 13px; background: #1a1030; border: 2px solid #ffd23f; color: #ffd23f; font-size: 13px; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.cbtn.small span { font-size: 22px; }
.cbtn.small i { font-size: 12px; }
#btn-sprint { right: 118px; bottom: 6px; background: radial-gradient(circle at 35% 30%, #7fe3ff, #1f8fd6); }
#btn-lie { right: 92px; bottom: 100px; background: radial-gradient(circle at 35% 30%, #c3a6ff, #6d3fd6); }
#btn-lie.on { background: radial-gradient(circle at 35% 30%, #ffb27f, #d65a1f); }
#keyhint { position: absolute; left: 50%; bottom: calc(10px + var(--sab)); transform: translateX(-50%); font-size: 12px; opacity: .7; white-space: nowrap;
  background: rgba(20,12,40,.5); padding: 4px 12px; border-radius: 10px; }
body.touch #keyhint { display: none; }

/* screens */
.screen { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; overflow-y: auto; touch-action: pan-y;
  padding: calc(16px + var(--sat)) 16px calc(16px + var(--sab)); }
#menu { background: linear-gradient(180deg, rgba(26,16,48,.15) 0%, rgba(26,16,48,.35) 55%, rgba(26,16,48,.92) 100%); align-items: flex-end; }
.menu-inner { width: min(440px, 100%); text-align: center; margin: auto 0 0; }
.menu-inner.small { margin: auto; background: rgba(20,12,40,.85); padding: 22px; border-radius: 22px; }
.logo { line-height: .95; filter: drop-shadow(0 6px 0 rgba(0,0,0,.35)); }
.logo .l1 { display: block; font-size: clamp(54px, 15vw, 84px); font-weight: 900; color: var(--yellow); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill;
  transform: rotate(-4deg); animation: wobble 2.4s ease-in-out infinite; }
.logo .l2 { display: inline-block; font-size: clamp(26px, 7vw, 38px); font-weight: 900; background: var(--pink); color: #fff; padding: 2px 14px; border-radius: 10px; transform: rotate(3deg); margin-top: 4px; }
@keyframes wobble { 50% { transform: rotate(3deg) scale(1.03) } }
.tag { margin: 12px 0 14px; font-weight: 800; opacity: .9; font-size: 14px; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.mbtn { display: block; width: 100%; padding: 13px; margin: 8px 0; border-radius: 16px; font-size: 17px; font-weight: 900; color: #fff; background: rgba(255,255,255,.14);
  border: 2px solid rgba(255,255,255,.2); }
.mbtn.primary { background: linear-gradient(180deg, #ff6fa0, #e8226a); border-color: #ffd1e0; font-size: 22px; box-shadow: 0 6px 0 #9c1046; }
.mbtn.primary:active { transform: translateY(4px); box-shadow: 0 2px 0 #9c1046; }
.mbtn.ghost { background: transparent; }
.mbtn.line { background: #06c755; border-color: #9ff0c0; }
.opts { background: rgba(20,12,40,.7); border-radius: 16px; padding: 8px 12px; margin-top: 10px; }
.opt { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; font-weight: 800; font-size: 14px; }
.seg { display: flex; background: rgba(255,255,255,.1); border-radius: 10px; padding: 3px; }
.seg button { background: transparent; color: #fff; padding: 6px 10px; border-radius: 8px; font-weight: 800; font-size: 13px; opacity: .7; }
.seg button.on { background: var(--yellow); color: #3b2300; opacity: 1; }
.best { margin: 10px 0 4px; font-weight: 800; opacity: .9; }
.best b { color: var(--yellow); font-size: 20px; }
.howto-btn { padding: 10px; font-size: 15px; background: rgba(20,12,40,.7); border-color: rgba(255,255,255,.18); }
.hint { font-size: 12px; opacity: .8; margin-top: 6px; }
.ptitle { font-size: 28px; font-weight: 900; margin-bottom: 10px; }

#pause { background: radial-gradient(ellipse at center, rgba(40,18,70,.55), rgba(8,4,18,.78)); }
/* v125 the pause menu: 繼續 on its own, the rest two by two, each with its own colour */
#pause .menu-inner.small { width: min(460px, 100%); background: linear-gradient(160deg, rgba(58,30,96,.94), rgba(26,14,48,.96)); border: 1px solid rgba(255,214,140,.35); box-shadow: 0 14px 40px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.12); padding: 18px 18px 20px; }
#pause .ptitle { font-size: 26px; margin-bottom: 8px; color: #ffe7b0; text-shadow: 0 2px 0 rgba(0,0,0,.35); letter-spacing: 2px; }
#pause .mbtn.primary { margin: 6px 0 4px; }
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.pgrid .mbtn { margin: 0; min-width: 0; padding: 12px 6px; font-size: 15.5px; line-height: 1.25; display: flex; align-items: center; justify-content: center; gap: 4px; border-width: 1px; white-space: normal; overflow-wrap: anywhere;
  box-shadow: 0 4px 0 rgba(0,0,0,.28); transition: transform .08s; }
.pgrid .mbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.28); }
.pgrid .pk { background: linear-gradient(180deg, #8f6bff, #6240d8); border-color: #c9b8ff; }
.pgrid .pa { background: linear-gradient(180deg, #ffcf5a, #f29a1f); border-color: #ffe6a8; color: #3a2204; }
.pgrid .pv { background: linear-gradient(180deg, #4fb6ff, #2a7fd8); border-color: #b8e2ff; }
.pgrid .ps { background: linear-gradient(180deg, #3fd1b8, #1f9e8a); border-color: #b6f3e8; }
.pgrid .pc { background: linear-gradient(180deg, #7c86b8, #545e92); border-color: #c7cdf0; }
.pgrid .pq { background: rgba(255,255,255,.06); border-color: rgba(255,140,170,.6); color: #ffd0dc; box-shadow: none; }
.pgrid .pcs { background: linear-gradient(180deg, #c58bff, #9b55e0); border-color: #e9d2ff; }
.pgrid .pcr { background: rgba(255,255,255,.06); border-color: rgba(255,214,140,.5); color: #ffe7b0; box-shadow: none; font-size: 13.5px; }
@media (max-height: 460px) { #pause .menu-inner.small { padding: 10px 14px 12px; } #pause .ptitle { font-size: 20px; margin-bottom: 2px; } #pause .mbtn.primary { padding: 8px; font-size: 18px; }
  .pgrid { gap: 7px; margin-top: 7px; } .pgrid .mbtn { padding: 8px 4px; font-size: 14px; } }
#over { background: rgba(10,6,20,.8); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); overflow: hidden; touch-action: none;
  padding: calc(10px + var(--sat)) calc(10px + var(--sar)) calc(10px + var(--sab)) calc(10px + var(--sal)); }
/* the result card always fits the screen: the screenshot shrinks first, nothing scrolls */
.over-card { width: min(440px, 100%); max-height: 100%; margin: auto; display: flex; flex-direction: column; gap: clamp(4px, 1.2vh, 10px);
  background: radial-gradient(120% 60% at 50% 0%, #4a2a86 0%, #2b1850 45%, #170c2c 100%); border: 2px solid rgba(255,255,255,.16);
  border-radius: 24px; padding: clamp(10px, 2vh, 16px); text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.12);
  animation: pop .4s cubic-bezier(.2,1.6,.4,1); overflow: hidden; }
@keyframes pop { from { transform: scale(.7); opacity: 0 } }
.ocol { display: flex; flex-direction: column; gap: clamp(4px, 1.1vh, 9px); min-height: 0; }
.ocol.l { flex: 1 1 auto; }
.ocol.r { flex-shrink: 0; } /* upright: the numbers and buttons keep their size, only the screenshot gives way (all buttons stay on screen) */
.ohead { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; row-gap: 4px; }
.rip { font-size: clamp(22px, 4.2vh, 32px); font-weight: 900; color: #ff5470; -webkit-text-stroke: 2px #fff; paint-order: stroke fill; transform: rotate(-3deg); line-height: 1.15; padding: 2px 4px; }
.rank { font-size: clamp(12px, 1.9vh, 15px); font-weight: 900; color: #3b2300; background: linear-gradient(180deg, #ffe680, #ffb300); padding: 4px 10px; border-radius: 999px;
  box-shadow: 0 3px 0 #9c6a00; transform: rotate(2deg); white-space: nowrap; }
.rank::before { content: "🏅 "; }
.shot { position: relative; flex: 1 1 30vh; min-height: 70px; max-height: 34vh; margin: 0 4px; border-radius: 14px; overflow: hidden; border: 4px solid #fff; transform: rotate(0.6deg); background: #000;
  box-shadow: 0 8px 20px rgba(0,0,0,.45); }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.shot .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 7px; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.8)); }
.shot .cap span { font-size: clamp(22px, 3.6vh, 30px); filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
.shot .cap b { font-size: clamp(15px, 2.6vh, 21px); font-weight: 900; color: var(--yellow); text-shadow: 0 2px 0 rgba(0,0,0,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.line { font-size: clamp(11px, 1.7vh, 13px); opacity: .85; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.final { display: flex; align-items: baseline; justify-content: center; gap: 6px; line-height: 1.05; flex-wrap: wrap; }
.final b { font-size: clamp(34px, 6.5vh, 52px); font-weight: 900; color: #fff; text-shadow: 0 3px 0 #b8255f, 0 0 22px rgba(255,79,139,.55); }
.final span { font-weight: 900; color: var(--yellow); font-size: clamp(14px, 2.2vh, 18px); }
.final em { font-style: normal; font-size: 12px; font-weight: 900; color: var(--yellow); margin-left: 4px; }
.final em.new { color: #3b2300; background: var(--yellow); padding: 3px 8px; border-radius: 999px; animation: pulse .5s infinite alternate; }
.sub { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-height: calc(2 * (clamp(11px, 1.6vh, 12px) * 1.3 + 8px) + 4px); overflow: hidden; }
.sub span { font-size: clamp(10.5px, 1.55vh, 12px); font-weight: 800; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.1); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(3px, .8vh, 6px); }
.grid div { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: clamp(2px, .6vh, 5px) 2px; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.grid div.hot { background: rgba(255,210,63,.18); border-color: rgba(255,210,63,.4); }
.grid i { font-style: normal; font-size: clamp(12px, 2vh, 16px); line-height: 1.1; }
.grid b { font-size: clamp(13px, 2.2vh, 17px); font-weight: 900; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid span { font-size: clamp(9px, 1.35vh, 11px); opacity: .75; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.obtns .mbtn { margin: 0; }
.obtns .mbtn.primary { padding: clamp(8px, 1.6vh, 13px); font-size: clamp(17px, 2.8vh, 22px); }
.obtns .row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: clamp(6px, 1.2vh, 10px); }
.obtns .row .mbtn { font-size: 13px; padding: clamp(7px, 1.3vh, 11px) 2px; border-radius: 12px; }
/* phones held sideways: screenshot on the left, numbers on the right */
@media (min-aspect-ratio: 5/4) and (max-height: 620px) {
  .over-card { flex-direction: row; width: min(860px, 100%); align-items: stretch; }
  .ocol { flex: 1 1 0; justify-content: center; }
  .shot { flex: 1 1 auto; max-height: none; }
}

/* wardrobe / collection / achievements */
.closet-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; background: linear-gradient(180deg, rgba(255,210,63,.22), rgba(255,210,63,.1)); border-color: rgba(255,210,63,.45); }
.closet-btn span { font-size: 15px; }
.closet-btn em { font-style: normal; font-size: 13px; font-weight: 900; color: var(--yellow); white-space: nowrap; }
#closet { align-items: flex-end; background: linear-gradient(180deg, rgba(26,16,48,0) 30%, rgba(26,16,48,.6) 100%); overflow: hidden; touch-action: none; }
.closet-card { width: min(460px, 100%); height: min(56%, 470px); display: flex; flex-direction: column; background: rgba(24,14,46,.94); border: 2px solid rgba(255,255,255,.14);
  border-radius: 22px; overflow: hidden; box-shadow: 0 16px 50px rgba(0,0,0,.5); animation: pop .3s cubic-bezier(.2,1.5,.4,1); }
.chead { display: flex; align-items: center; gap: 8px; padding: 10px 10px 8px; border-bottom: 1px solid rgba(255,255,255,.1); }
.coins { font-weight: 900; font-size: 16px; color: var(--yellow); white-space: nowrap; }
.tabs { flex: 1; display: flex; background: rgba(255,255,255,.08); border-radius: 12px; padding: 3px; }
.tabs button { flex: 1; background: transparent; color: #fff; font-weight: 900; font-size: 14px; padding: 7px 4px; border-radius: 9px; opacity: .7; }
.tabs button.on { background: var(--yellow); color: #3b2300; opacity: 1; }
.chead .x { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.12); color: #fff; font-size: 16px; font-weight: 900; }
.cbody { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; padding: 10px; overscroll-behavior: contain; }
.wear { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.wear .it { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 2px 6px; border-radius: 14px; background: rgba(255,255,255,.07); border: 2px solid rgba(255,255,255,.08); color: #fff; }
.wear .it i { font-style: normal; font-size: 26px; line-height: 1.15; }
.wear .it b { font-size: 12px; font-weight: 900; white-space: nowrap; }
.wear .it span { font-size: 10px; opacity: .6; }
.wear .it em { font-style: normal; font-size: 11px; font-weight: 900; margin-top: 2px; color: #cfd8dc; }
.wear .it em.buy { color: var(--yellow); }
.wear .it em.lock { color: #ff8a80; }
.wear .it em.on { color: #7cffb2; }
.wear .it.on { border-color: #7cffb2; background: rgba(124,255,178,.14); }
.wear .it.locked { opacity: .65; }
.wear .it.nope { animation: av-shake .1s linear 4; }
.tip { font-size: 11px; opacity: .7; margin-top: 10px; line-height: 1.5; }
.dex, .deaths { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.card { display: flex; flex-direction: column; align-items: center; padding: 8px 2px; border-radius: 14px; background: rgba(255,255,255,.07); text-align: center; }
.card i { font-style: normal; font-size: 26px; line-height: 1.15; }
.card b { font-size: 12px; font-weight: 900; }
.card span { font-size: 10px; opacity: .8; white-space: nowrap; }
.card span.k { color: #ff8a80; }
.card.unk { opacity: .45; }
.sec { font-weight: 900; font-size: 13px; margin: 12px 0 6px; opacity: .85; }
.sec small { font-weight: 400; opacity: .7; margin-left: 4px; }
/* v65 動物圖鑑: bigger cards (a fact and the ★ to collect wrap onto several lines) */
.dex.zdex { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.zdex .card { padding: 8px 8px 9px; gap: 2px; }
.zdex .card span { white-space: normal; line-height: 1.35; }
.zdex .card span.k { color: #ffe0b2; opacity: .85; }
.zdex .card span.on { color: #ffd54f; opacity: 1; }
.ach { display: flex; flex-direction: column; gap: 6px; }
.ach .row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 12px; background: rgba(255,255,255,.06); opacity: .6; }
.ach .row.ok { opacity: 1; background: rgba(255,210,63,.14); }
.ach .row i { font-style: normal; font-size: 22px; width: 28px; text-align: center; }
.ach .row div { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; }
.ach .row b { font-size: 13px; }
.ach .row span { font-size: 11px; opacity: .75; }
.ach .row em { font-style: normal; font-weight: 900; font-size: 12px; color: var(--yellow); white-space: nowrap; }
@media (max-height: 560px) and (min-aspect-ratio: 13/10) {
  #closet { justify-content: flex-end; align-items: center; background: linear-gradient(90deg, rgba(26,16,48,0) 30%, rgba(26,16,48,.7) 62%); }
  .closet-card { width: min(440px, 56vw); height: 100%; }
}

/* in-game missions & combo */
#missions { width: clamp(138px, 34vw, 190px); padding: 5px 8px; display: flex; flex-direction: column; gap: 3px; }
#missions:empty { display: none; }
#missions .m { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; line-height: 1.25; }
#missions .m i { font-style: normal; width: 18px; text-align: center; font-size: 12px; }
#missions .m span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .92; }
#missions .m b { font-size: 11px; color: var(--yellow); }
#missions .m.fresh { animation: mfresh .6s ease-out 2; }
@keyframes mfresh { 50% { background: rgba(124,255,178,.25); transform: translateX(3px); } }
#combo { margin-top: 4px; display: none; flex-direction: column; align-items: center; }
#combo.on { display: flex; }
#combo b { font-size: 13px; font-weight: 900; color: #fff; background: linear-gradient(90deg, #ff8f00, #ff3d7f); padding: 2px 9px; border-radius: 10px; text-shadow: 0 1px 0 rgba(0,0,0,.35); }
#combo b.bump { animation: bump .25s ease-out; }
#combo i { display: block; height: 3px; width: 56px; margin-top: 3px; border-radius: 2px; background: #ffd23f; transform-origin: left; }

#loading { position: fixed; inset: 0; z-index: 50; background: radial-gradient(120% 80% at 50% 30%, #3a1d6e 0%, #1a1030 70%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; font-weight: 800; padding: 0 28px; transition: opacity .25s; }
#loading.hidden { display: flex !important; opacity: 0; pointer-events: none; }
#loading.gone { display: none !important; }
#loading.quick { background: rgba(20,10,40,.82); }
#loading.quick .ld-logo, #loading.quick .ld-tip { display: none; }
.ld-logo { font-size: 44px; font-weight: 900; color: var(--yellow); -webkit-text-stroke: 2px #1a1030; paint-order: stroke fill; text-shadow: 0 4px 0 #1a1030; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.ld-logo span { font-size: 20px; color: #fff; background: var(--pink); padding: 3px 12px; border-radius: 10px; margin-top: 6px; -webkit-text-stroke: 0; text-shadow: none; }
.ld-dog { font-size: 42px; animation: ld-shiver .12s linear infinite alternate; }
@keyframes ld-shiver { from { transform: translateX(-2px) rotate(-2deg); } to { transform: translateX(2px) rotate(2deg); } }
.ld-bar { width: min(320px, 80vw); height: 14px; border-radius: 10px; background: rgba(255,255,255,.14); border: 2px solid rgba(255,255,255,.35); overflow: hidden; }
.ld-bar b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ff6fa0, #ffd23f); border-radius: 8px; transition: width .2s ease-out; }
.ld-row { width: min(320px, 80vw); display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: #e6dcff; }
.ld-row em { font-style: normal; color: var(--yellow); font-weight: 900; }
.ld-tip { margin-top: 8px; font-size: 12px; opacity: .75; text-align: center; max-width: 320px; line-height: 1.5; }
.spin { width: 46px; height: 46px; border-radius: 50%; border: 5px solid rgba(255,255,255,.2); border-top-color: var(--pink); animation: rot 0.8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg) } }

@media (max-height: 460px) {
  #controls { transform: scale(.85); transform-origin: bottom right; }
  #missions { position: fixed; left: calc(72px + var(--sal)); top: calc(94px + var(--sat)); width: 180px; }
  #stats { width: 180px; padding: 6px 8px; }
  #toasts { top: calc(64px + var(--sat)); }
  .menu-inner { margin: auto; }
}

@media (max-height: 560px) and (min-aspect-ratio: 13/10) {
  #menu { justify-content: flex-end; align-items: flex-start; background: linear-gradient(90deg, rgba(26,16,48,0) 30%, rgba(26,16,48,.85) 62%); }
  .menu-inner { width: min(400px, 54vw); margin: auto 0; }
  .logo .l1 { font-size: 48px; } .logo .l2 { font-size: 22px; }
  .tag { margin: 6px 0 8px; font-size: 12px; }
  .mbtn.primary { padding: 9px; font-size: 19px; }
  .opts { padding: 4px 10px; margin-top: 6px; } .opt { padding: 2px 0; }
  .best { margin: 4px 0 2px; }
  .mrow { margin: 5px 0; } .mrow .mbtn { padding: 3px 6px; font-size: 14px; gap: 0; line-height: 1.2; }
  .logo .l1 { font-size: 38px; } .tag { margin: 4px 0 6px; }
}
@media (max-width: 560px) and (min-height: 561px) {
  #stats { width: calc(100vw - 190px); }
  #scorebox { top: calc(86px + var(--sat)); }
  #toasts { top: calc(222px + var(--sat)); }
}

#glmsg { position: fixed; inset: 0; z-index: 60; background: rgba(26,16,48,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; font-weight: 800; }
#debug { position: fixed; left: calc(6px + var(--sal)); bottom: calc(6px + var(--sab)); z-index: 70; font: 600 11px/1.3 ui-monospace, Menlo, monospace; color: #b9ff9a; background: rgba(0,0,0,.65); padding: 4px 8px; border-radius: 6px; pointer-events: none; max-width: 92vw; }

/* Full-screen layers use the measured app height. iOS home-screen apps with a translucent status bar
   report a viewport one status-bar shorter than the screen, which left an empty band at the bottom. */
#flash, #danger, #hud, #popups, .screen, #loading, #glmsg { inset: auto; top: 0; left: 0; width: 100%; height: var(--app-h, 100vh); }
/* never select text, show the copy/lookup bubble, or the save-image menu on long press */
*, *::before, *::after { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
img { pointer-events: none; -webkit-user-drag: none; }
button { touch-action: manipulation; }

/* menu: daily + closet side by side */
.mrow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.mrow .mbtn { margin: 0; padding: 9px 6px; font-size: 15px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mrow .mbtn em { font-style: normal; font-size: 11px; opacity: .85; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.daily-btn { background: linear-gradient(180deg, rgba(94,200,255,.35), rgba(30,110,200,.35)); border-color: rgba(150,220,255,.6); }
/* bark-off */
#barkoff { position: absolute; left: 50%; top: 24%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none;
  background: rgba(20,10,40,.55); border: 2px solid rgba(255,210,63,.6); border-radius: 18px; padding: 8px 14px 10px; z-index: 6; }
#barkoff.hidden { display: none; }
.bo-t { font-weight: 900; font-size: 16px; color: #fff; text-shadow: 0 2px 0 #000; }
.bo-t b { color: var(--yellow); margin-left: 6px; }
.bo-ring { position: relative; width: 74px; height: 74px; }
.bo-ring i { position: absolute; left: 50%; top: 50%; border-radius: 50%; transform: translate(-50%,-50%); }
#bo-target { width: 40px; height: 40px; border: 4px solid rgba(255,255,255,.55); }
#bo-target.on { border-color: var(--yellow); box-shadow: 0 0 16px var(--yellow); }
#bo-shrink { width: 40px; height: 40px; border: 3px solid #ff6fa0; will-change: transform; }
.bo-dots { display: flex; gap: 6px; }
.bo-dots i { width: 16px; height: 16px; border-radius: 50%; background: rgba(255,255,255,.25); font-style: normal; font-size: 11px; line-height: 16px; text-align: center; font-weight: 900; }
.bo-dots i.hit { background: #4cd964; } .bo-dots i.miss { background: #ff3b30; }
.bo-h { font-size: 11px; color: #e6dcff; }
#hud.bo #toasts { opacity: 0; }

/* wardrobe filters, rarity, capsule machine */
.chips { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.1); color: #fff; font-weight: 900; font-size: 12px; }
.chips button.on { background: var(--yellow); color: #3b2300; }
.wear .it span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wear .it.r-R { border-color: rgba(79,195,247,.35); } .wear .it.r-SR { border-color: rgba(206,147,216,.5); } .wear .it.r-SSR { border-color: rgba(255,213,79,.6); background: rgba(255,213,79,.08); }
.wear .it.on { border-color: #7cffb2; background: rgba(124,255,178,.14); }
.wear .it em.hw { color: #ffab40; }
.wear .it em.neon { color: #7cf1ff; }
.wear .it.neon i { text-shadow: 0 0 8px rgba(124,241,255,.9), 0 0 16px rgba(255,79,216,.6); }
#hw-badge { font-style: normal; margin-left: 2px; }
.banners { display: flex; gap: 6px; margin-bottom: 8px; }
.banners button { flex: 1; padding: 8px 4px; border-radius: 12px; background: rgba(255,255,255,.08); color: #fff; font-weight: 900; font-size: 13px; border: 2px solid transparent; }
.banners button.on { border-color: var(--yellow); background: rgba(255,210,63,.16); }
.banners button.off { opacity: .45; }
.gacha { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 16px; background: linear-gradient(135deg, rgba(94,200,255,.16), rgba(255,111,165,.12)); }
.gacha.hw { background: linear-gradient(135deg, rgba(255,140,0,.28), rgba(106,27,154,.35)); }
.gacha.neon { background: linear-gradient(135deg, rgba(41,232,255,.22), rgba(255,79,216,.26)); }
.gacha.neon .machine .body { background: linear-gradient(180deg, #29e8ff, #c07bff); }
.gacha.mumi { background: linear-gradient(135deg, rgba(255,105,180,.28), rgba(124,77,255,.32)); } /* v260 🐾 喵姆 */
.gacha.mumi .machine .body { background: linear-gradient(180deg, #ff8ad8, #7c4dff); }
img.mumi-ico { width: 1.25em; height: 1.25em; border-radius: 50%; vertical-align: -0.28em; margin-right: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255,255,255,.55); }
.wear .it em.mumi { color: #ff9ad8; }
.machine { position: relative; width: 92px; flex: none; padding-top: 8px; }
.machine::before, .machine::after { content: ''; position: absolute; top: 0; width: 22px; height: 24px; background: #c98a5a; border: 3px solid rgba(255,255,255,.7); border-bottom: 0; z-index: 0; }
.machine::before { left: 8px; border-radius: 4px 70% 0 0; transform: rotate(-16deg); } .machine::after { right: 8px; border-radius: 70% 4px 0 0; transform: rotate(16deg); } /* (v180: 汪汪扭蛋機: dog ears on the dome) */
.machine .dome { z-index: 1; }
.machine .body::before { content: '🐾'; position: absolute; right: 9px; bottom: 6px; font-size: 13px; opacity: .85; }
.machine .dome { position: relative; height: 70px; border-radius: 46px 46px 10px 10px; background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.55), rgba(255,255,255,.12) 60%); border: 3px solid rgba(255,255,255,.7); overflow: hidden; }
.machine .dome i { position: absolute; left: var(--x); top: var(--y); width: 18px; height: 23px; border-radius: 50% 50% 46% 46% / 56% 56% 44% 44%; transform: rotate(var(--r, -18deg)); background: radial-gradient(circle at 34% 26%, rgba(255,255,255,.95) 0 14%, rgba(255,255,255,0) 30%), var(--c); box-shadow: inset -2px -3px 4px rgba(0,0,0,.22), 0 0 0 1px rgba(0,0,0,.12); } /* (v180: jelly-bean capsules, no split line round the middle) */
.machine .body { height: 46px; margin-top: -4px; border-radius: 6px 6px 12px 12px; background: linear-gradient(180deg, #e8226a, #9c1046); position: relative; }
.gacha.hw .machine .body { background: linear-gradient(180deg, #ff8f00, #6a1b9a); }
.machine .slot { position: absolute; left: 12px; bottom: 8px; width: 22px; height: 16px; border-radius: 5px; background: #2a0f22; }
.machine .slot .capsule { position: absolute; left: 3px; top: -6px; width: 16px; height: 21px; border-radius: 50% 50% 46% 46% / 56% 56% 44% 44%; opacity: 0; background: radial-gradient(circle at 34% 26%, rgba(255,255,255,.95) 0 14%, rgba(255,255,255,0) 30%), var(--cap, #ffd54f); box-shadow: inset -2px -3px 3px rgba(0,0,0,.22), 0 0 0 1px rgba(0,0,0,.18); }
.machine .crank { position: absolute; right: 10px; top: 8px; width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle, #fff 55%, #e3e3e3); border: 4px solid #ffd54f; }
.machine .crank::after { content: ''; position: absolute; left: 50%; top: 50%; width: 30px; height: 6px; margin: -3px 0 0 -15px; background: #ffd54f; border-radius: 3px; box-shadow: 0 1px 0 rgba(0,0,0,.2); }
.machine .crank b { position: absolute; left: 50%; top: -5px; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; background: #ff6fa5; border: 2px solid #fff; z-index: 1; }
/* pulling: the machine stays put. The knob makes one full twist, the capsules inside hop around,
   then one capsule in the colour of the best rarity drops out of the chute and wobbles */
.machine.turning .crank { animation: crank 1s cubic-bezier(.45,.05,.35,1) both; }
.machine.turning .dome i { animation: ball-hop .2s var(--d, 0s) cubic-bezier(.3,.7,.4,1) 6 alternate both; }
.machine.turning .slot .capsule { animation: cap-out .55s .95s cubic-bezier(.3,.7,.4,1) both; }
.machine.turning.rare .dome { animation: rare-glow .25s .8s ease-in-out 3 alternate; }
@keyframes crank { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes ball-hop { to { transform: translate(var(--jx, 0px), var(--jy, -12px)) rotate(var(--jr, 0deg)); } }
@keyframes cap-out { 0% { transform: translateY(-14px) scale(.5); opacity: 0; } 35% { transform: translateY(6px) scale(1); opacity: 1; } 55% { transform: translateY(2px) scale(1.08, .9); } 75% { transform: translateY(5px) rotate(-14deg); } 100% { transform: translateY(5px) rotate(9deg); opacity: 1; } }
@keyframes rare-glow { to { box-shadow: 0 0 18px 6px var(--cap, #ffd54f); border-color: var(--cap, #ffd54f); } }
.ginfo { font-size: 12px; line-height: 1.45; }
.ginfo span { font-size: 10px; opacity: .75; }
.pulls { display: grid; grid-template-columns: 1fr 1.3fr; gap: 8px; margin: 10px 0 4px; }
.pulls .mbtn { margin: 0; padding: 8px 4px; font-size: 15px; display: flex; flex-direction: column; align-items: center; }
.pulls .mbtn em { font-style: normal; font-size: 11px; opacity: .9; }
.pulls .mbtn.nope { animation: av-shake .1s linear 4; }
.gres { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin-top: 8px; }
.gres.ten { grid-template-columns: repeat(5, 1fr); }
.gres .cap { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border-radius: 12px; color: #fff; background: rgba(255,255,255,.07); border: 2px solid var(--rc); box-shadow: 0 0 12px color-mix(in srgb, var(--rc) 45%, transparent); animation: pop .35s cubic-bezier(.2,1.5,.4,1) both; min-width: 0; }
.gres .cap i { font-style: normal; font-size: 24px; }
.gres .cap b { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.gres .cap span { font-size: 10px; color: var(--rc); font-weight: 900; }
.gres .cap em { font-style: normal; font-size: 9px; opacity: .8; white-space: nowrap; }
.gres .cap em.new { color: #7cffb2; font-weight: 900; opacity: 1; }
.gres .cap.r-SSR { background: linear-gradient(180deg, rgba(255,213,79,.3), rgba(255,213,79,.06)); }
.gres .cap:nth-child(2) { animation-delay: .05s; } .gres .cap:nth-child(3) { animation-delay: .1s; } .gres .cap:nth-child(4) { animation-delay: .15s; } .gres .cap:nth-child(5) { animation-delay: .2s; }
.gres .cap:nth-child(6) { animation-delay: .25s; } .gres .cap:nth-child(7) { animation-delay: .3s; } .gres .cap:nth-child(8) { animation-delay: .35s; } .gres .cap:nth-child(9) { animation-delay: .4s; } .gres .cap:nth-child(10) { animation-delay: .45s; }
.tabs button { padding: 7px 2px; font-size: 13px; }
#missions .m.ev { background: linear-gradient(90deg, rgba(255,111,165,.28), rgba(255,210,63,.18)); border-radius: 8px; padding: 2px 4px; }
#missions .m.ev span { display: flex; flex-direction: column; line-height: 1.15; }
#missions .m.ev small { font-size: 9.5px; opacity: .85; font-weight: 700; }

/* swimming */
#air { position: absolute; left: 50%; top: calc(36% + var(--sat, 0px)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; z-index: 6; }
#air.hidden { display: none; }
#air i { font-style: normal; font-weight: 900; font-size: 14px; color: #fff; text-shadow: 0 2px 0 #000; }
#air .abar { width: 160px; height: 12px; border-radius: 8px; background: rgba(0,0,0,.45); border: 2px solid rgba(255,255,255,.7); overflow: hidden; }
#air .abar b { display: block; height: 100%; background: linear-gradient(90deg, #4fc3f7, #b3e5fc); }
#air.low .abar b { background: linear-gradient(90deg, #ff5252, #ff8a80); }
#air span { font-size: 12px; font-weight: 900; color: #fff; text-shadow: 0 2px 0 #000; }
#air.low span { color: #ffcdd2; animation: pulse .3s infinite alternate; }
.cbtn.big.swim { background: radial-gradient(circle at 35% 30%, #81d4fa, #0277bd); }

/* install */
.install-pill { position: absolute; left: calc(12px + var(--sal, 0px)); top: calc(12px + var(--sat, 0px)); z-index: 3; padding: 8px 14px; border-radius: 999px; font-weight: 900; font-size: 14px; color: #3b2300; background: var(--yellow); box-shadow: 0 4px 0 #b38600, 0 6px 16px rgba(0,0,0,.35); }
.install-pill:active { transform: translateY(3px); box-shadow: 0 1px 0 #b38600; }
.install-pill.hidden { display: none; }
/* v66: on the old address, the way to the new one (in the menu, above 開始遊戲); on the new one, how the move went */
.mbtn.move-pill { width: 100%; padding: 10px 12px; font-size: 15px; line-height: 1.3; color: #fff; background: #ef6c00; box-shadow: 0 4px 0 #a84a00; }
.mbtn.move-pill.note { background: #2e7d32; box-shadow: 0 4px 0 #1b5e20; }
.mbtn.move-pill.hidden { display: none; }
#install-help { z-index: 40; background: rgba(10,6,20,.75); }
.ihelp { width: min(400px, calc(100vw - 32px)); text-align: left; }
.ihelp h3 { margin: 0 0 8px; font-size: 19px; }
.ihelp ol { margin: 6px 0 8px; padding-left: 22px; line-height: 1.7; font-size: 15px; }
.ihelp b { color: var(--yellow); }

.tier { font-size: clamp(12px, 1.9vh, 15px); font-weight: 900; color: #fff; background: var(--tc, #888); padding: 4px 10px; border-radius: 10px; transform: rotate(-3deg); white-space: nowrap; text-shadow: 0 1px 0 rgba(0,0,0,.4); box-shadow: 0 3px 0 rgba(0,0,0,.35); }
.tier::before { content: "評價 "; font-size: .8em; opacity: .9; }
.tier:empty { display: none; }

/* wardrobe v2: always fits the screen, only ever scrolls up/down (portrait and landscape) */
#closet { padding: 8px max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); overflow: hidden; }
.closet-card { width: min(470px, 100%); max-width: 100%; min-width: 0; height: min(58%, 520px); }
.closet-card, .cbody { overflow-x: hidden; }
.cbody { padding: 10px 10px 14px; }
.chead { flex-wrap: wrap; row-gap: 8px; padding: 10px 10px 9px; }
.chead .coins { order: 1; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.chead .x { order: 2; flex: none; }
.chead .tabs { order: 3; flex: 1 1 100%; min-width: 0; }
.tabs button { min-width: 0; white-space: nowrap; font-size: 14px; padding: 8px 2px; }
.chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; overflow: visible; padding-bottom: 0; margin-bottom: 10px; }
.chips button { min-width: 0; padding: 7px 2px; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wear, .dex, .deaths { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.wear .it, .card { min-width: 0; padding: 9px 4px 8px; }
.wear .it b, .card b, .wear .it em, .card span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wear .it i, .card i { font-size: 28px; }
.wear .it b { font-size: 13px; }
.wear .it em { font-size: 11.5px; }
.gacha { min-width: 0; }
.ginfo { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.banners button { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pulls .mbtn { min-width: 0; }
.pulls .mbtn em { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.gres.ten { grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); }
.gres .cap { min-width: 0; }
.gres .cap em { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ach .row b, .ach .row span { overflow-wrap: anywhere; }
@media (max-height: 560px) and (min-aspect-ratio: 13/10) {
  /* landscape phone: one-row header (coins · tabs · ✕), panel on the right, full height */
  .closet-card { width: min(460px, 58vw); height: 100%; }
  .chead { flex-wrap: nowrap; padding: 7px 8px; }
  .chead .coins { order: 1; flex: 0 1 auto; font-size: 14px; }
  .chead .tabs { order: 2; flex: 1 1 auto; }
  .chead .x { order: 3; width: 32px; height: 32px; }
  .tabs button { font-size: 13px; padding: 6px 2px; }
  .cbody { padding: 8px 8px 12px; }
  .wear, .dex, .deaths { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 6px; }
  .wear .it, .card { padding: 6px 3px 5px; }
  .wear .it i, .card i { font-size: 24px; }
  .chips { margin-bottom: 8px; gap: 5px; }
  .chips button { padding: 5px 2px; font-size: 12px; }
  .gacha { padding: 6px; }
  .machine { width: 78px; }
  .machine .dome { height: 58px; }
  .machine .body { height: 38px; }
  .pulls { margin: 8px 0 2px; }
}

/* missions: foldable (tap the header) */
#missions { pointer-events: none; }
#m-head { pointer-events: auto; display: flex; align-items: center; gap: 5px; width: 100%; padding: 1px 0 2px; background: none; border: 0; color: #fff; font: inherit; font-size: 10.5px; font-weight: 900; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
#m-head i { font-style: normal; width: 18px; text-align: center; font-size: 12px; }
#m-head span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .8; }
#m-head em { font-style: normal; font-size: 10px; opacity: .8; padding: 1px 6px; border-radius: 8px; background: rgba(255,255,255,.14); }
#m-list { display: flex; flex-direction: column; gap: 3px; }
#missions.closed { width: auto; max-width: min(230px, 42vw); padding: 4px 8px; border-radius: 14px; }
#missions.closed #m-list { display: none; }
#missions.closed #m-head { font-size: 11.5px; padding: 1px 0; }
#missions.closed #m-head span { opacity: 1; }
#missions.closed.peek { border-color: rgba(255,210,63,.8); box-shadow: 0 0 0 2px rgba(255,210,63,.35); }
#missions.closed.peek #m-head span { color: var(--yellow); }

/* how-to-play screen */
#guide { background: rgba(10,6,20,.72); overflow: hidden; touch-action: none;
  padding: calc(10px + var(--sat)) calc(10px + var(--sar)) calc(10px + var(--sab)) calc(10px + var(--sal)); }
.guide-card { width: min(560px, 100%); height: min(100%, 680px); margin: auto; display: flex; flex-direction: column; overflow: hidden;
  background: radial-gradient(120% 50% at 50% 0%, #432477 0%, #24143f 55%, #170c2c 100%); border: 2px solid rgba(255,255,255,.14);
  border-radius: 22px; box-shadow: 0 18px 50px rgba(0,0,0,.55); animation: pop .3s cubic-bezier(.2,1.5,.4,1); }
.g-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 6px 16px; }
.g-head b { font-size: 19px; font-weight: 900; color: var(--yellow); }
.g-head .x { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.12); color: #fff; font-size: 16px; font-weight: 900; }
.g-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; padding: 4px 12px 10px; border-bottom: 1px solid rgba(255,255,255,.1); }
.g-tabs button { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; border-radius: 12px; background: rgba(255,255,255,.07);
  color: #fff; font-weight: 900; font-size: 12px; white-space: nowrap; opacity: .75; border: 2px solid transparent; }
.g-tabs button i { font-style: normal; font-size: 19px; line-height: 1.1; }
.g-tabs button.on { opacity: 1; background: rgba(255,210,63,.16); border-color: var(--yellow); color: var(--yellow); }
.g-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; touch-action: pan-y; overscroll-behavior: contain; padding: 12px; }
.g-bars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.g-bars div { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1px; padding: 7px 4px; border-radius: 12px; background: rgba(0,0,0,.22); }
.g-bars i { font-style: normal; font-size: 18px; }
.g-bars b { font-size: 12.5px; }
.g-bars span { font-size: 10.5px; opacity: .75; line-height: 1.3; }
.g-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.g-card { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); text-align: left; min-width: 0; }
.g-card > i { font-style: normal; font-size: 26px; line-height: 1; flex: none; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: rgba(255,255,255,.08); }
.g-card > div { min-width: 0; }
.g-card b { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; font-weight: 900; }
.g-card p { margin: 2px 0 0; font-size: 12.5px; line-height: 1.45; opacity: .85; overflow-wrap: anywhere; }
.g-card kbd { font: 800 10.5px/1 inherit; padding: 3px 6px; border-radius: 6px; background: rgba(255,255,255,.14); border-bottom: 2px solid rgba(255,255,255,.25); color: #fff; opacity: .9; }
.g-card.meh { border-color: rgba(176,190,197,.35); } .g-card.love { border-color: rgba(255,111,165,.45); background: rgba(255,111,165,.09); } .g-card.angry { border-color: rgba(255,82,82,.5); background: rgba(255,82,82,.09); }
@media (max-height: 560px) and (min-aspect-ratio: 13/10) {
  .guide-card { width: min(760px, 100%); height: 100%; }
  .g-head { padding: 8px 10px 4px 14px; }
  .g-head b { font-size: 16px; }
  .g-tabs { padding: 2px 10px 8px; }
  .g-tabs button { flex-direction: row; justify-content: center; gap: 4px; padding: 5px 2px; font-size: 12px; }
  .g-tabs button i { font-size: 15px; }
  .g-body { padding: 8px 10px; }
  .g-cards { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; }
  .g-card { padding: 7px 10px; }
}
@media (min-width: 900px) and (min-height: 600px) { .guide-card { height: min(100%, 560px); } }

/* waves */
#wavebanner { position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; z-index: 7; text-align: center; }
#wavebanner.hidden { display: none; }
#wavebanner b { font-size: clamp(40px, 11vw, 72px); font-weight: 900; color: #fff; -webkit-text-stroke: 3px #1a1030; paint-order: stroke fill; text-shadow: 0 5px 0 #e8226a, 0 0 24px rgba(255,79,139,.6); white-space: nowrap; }
#wavebanner span { font-size: clamp(13px, 3.6vw, 17px); font-weight: 900; padding: 5px 14px; border-radius: 999px; background: rgba(20,12,40,.8); border: 2px solid var(--yellow); color: var(--yellow); white-space: nowrap; }
#wavebanner.show { animation: wave-in 2.6s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes wave-in { 0% { transform: translate(-50%, -50%) scale(.4); opacity: 0; } 12% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; } 20% { transform: translate(-50%, -50%) scale(1); } 85% { opacity: 1; } 100% { transform: translate(-50%, -60%) scale(1); opacity: 0; } }
/* death news card */
.obtns .row .mbtn.news { background: linear-gradient(180deg, #ff5252, #c62828); border-color: #ffcdd2; }
#dcard { background: rgba(10,6,20,.86); overflow: hidden; touch-action: none; padding: calc(10px + var(--sat)) calc(10px + var(--sar)) calc(10px + var(--sab)) calc(10px + var(--sal)); }
.dcard-box { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 10px; max-height: 100%; width: min(440px, 100%); animation: pop .3s cubic-bezier(.2,1.5,.4,1); }
.dcard-box img { display: block; max-width: 100%; max-height: calc(100% - 60px); min-height: 0; flex: 1 1 auto; object-fit: contain; border-radius: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.6); }
.dcard-btns { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 6px; width: 100%; flex: none; }
.dcard-btns .mbtn { margin: 0; font-size: 14px; padding: 10px 4px; }
.dcard-btns .mbtn.primary { font-size: 15px; box-shadow: 0 4px 0 #9c1046; }
@media (min-aspect-ratio: 13/10) and (max-height: 560px) { .dcard-box { flex-direction: row; width: auto; height: 100%; } .dcard-box img { max-height: 100%; height: 100%; } .dcard-btns { grid-template-columns: 1fr; width: 150px; } }

/* closet: quests & upgrades */
.sec small { font-weight: 700; font-size: 10.5px; opacity: .7; margin-left: 4px; }
.quests { display: flex; flex-direction: column; gap: 6px; }
.qrow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.07); }
.qrow.ok { background: rgba(124,255,178,.13); }
.qrow i { font-style: normal; font-size: 22px; width: 28px; text-align: center; flex: none; }
.qrow > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.qrow b { font-size: 13px; overflow-wrap: anywhere; }
.qbar { display: block; height: 7px; border-radius: 4px; background: rgba(255,255,255,.12); overflow: hidden; }
.qbar em { display: block; height: 100%; background: linear-gradient(90deg, #ff6fa0, #ffd23f); border-radius: 4px; }
.qrow.ok .qbar em { background: #7cffb2; }
.qhint { font-size: 11px; opacity: .7; overflow-wrap: anywhere; }
.qrow strong { font-size: 12px; color: var(--yellow); white-space: nowrap; flex: none; }
.qrow.ok strong { color: #7cffb2; font-size: 16px; }
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 7px; }
.sk { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 14px; background: rgba(255,255,255,.07); border: 2px solid rgba(255,255,255,.08); color: #fff; text-align: left; min-width: 0; }
.sk i { font-style: normal; font-size: 24px; width: 30px; text-align: center; flex: none; }
.sk > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sk b { font-size: 13.5px; font-weight: 900; } .sk b small { font-size: 11px; color: var(--yellow); margin-left: 2px; }
.sk span { font-size: 11px; opacity: .8; overflow-wrap: anywhere; line-height: 1.35; }
.sk .pips { display: flex; gap: 3px; opacity: 1; margin-top: 2px; }
.sk .pips u { display: block; width: 14px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.18); }
.sk .pips u.on { background: var(--yellow); }
.sk .pips { flex-wrap: wrap; } .sk .pips u { width: 11px; } .sk .pips u.star { width: 15px; box-shadow: 0 0 0 1.5px #ff9ce6 inset; } .sk .pips u.star.on { background: #ff7ad9; }
.sk .skadv { font-size: 10.5px; color: #ffb3ec; opacity: .75; } .sk .skadv i, .sk .skadv small { font-style: normal; font-size: inherit; width: auto; text-align: left; } .sk .skadv small { margin-right: 3px; }
.sk .skadv.on { opacity: 1; color: #ff9ce6; font-weight: 700; }
.sk.adv { border-color: rgba(255,122,217,.45); background: linear-gradient(135deg, rgba(255,122,217,.12), rgba(255,255,255,.06)); }
.sk em { font-style: normal; font-size: 12px; font-weight: 900; color: var(--yellow); white-space: nowrap; flex: none; padding: 5px 8px; border-radius: 10px; background: rgba(255,210,63,.14); }
.sk.poor em { color: #ff8a80; background: rgba(255,82,82,.12); }
.sk.max { border-color: rgba(124,255,178,.45); } .sk.max em { color: #7cffb2; background: rgba(124,255,178,.14); }
.sk.nope { animation: av-shake .1s linear 4; }

.obtns .row .mbtn { white-space: nowrap; overflow: hidden; text-overflow: clip; padding-left: 1px; padding-right: 1px; font-size: clamp(11px, 3.2vw, 13px); }
@media (min-aspect-ratio: 13/10) and (max-height: 560px) { .obtns .row { gap: 4px; } .obtns .row .mbtn { font-size: 11px; letter-spacing: -0.3px; } }

/* comfort (anti motion-sickness) mode */
#comfortvig { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse 62% 58% at 50% 52%, rgba(0,0,0,0) 55%, rgba(8,4,18,.55) 82%, rgba(8,4,18,.85) 100%); will-change: opacity; }
#reticle { position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; pointer-events: none; display: none; opacity: .45; filter: drop-shadow(0 0 1px rgba(0,0,0,.55)); }
#reticle::before, #reticle::after { content: ''; position: absolute; }
#reticle::before { left: 9px; top: 0; width: 2px; height: 20px; background: linear-gradient(#fff 0 7px, transparent 7px 13px, #fff 13px); }
#reticle::after { top: 9px; left: 0; width: 20px; height: 2px; background: linear-gradient(90deg, #fff 0 7px, transparent 7px 13px, #fff 13px); }

/* ===================== HUD v2: fewer, cleaner, glassier pieces ===================== */
:root { --glass: rgba(16,10,32,.56); --glass-b: rgba(255,255,255,.14); --glass-hi: inset 0 1px 0 rgba(255,255,255,.08); }
.panel { background: var(--glass); border: 1px solid var(--glass-b); border-radius: 16px; box-shadow: 0 6px 20px rgba(0,0,0,.22), var(--glass-hi); }
/* player card: avatar + three slim bars (the icons say what they are, the words are gone) */
#avatar-wrap { left: calc(17px + var(--sal)); top: calc(17px + var(--sat)); width: 42px; height: 42px; z-index: 1; }
#avatar { width: 42px; height: 42px; border-width: 2px; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
#avatar-badge { font-size: 15px; right: -5px; bottom: -4px; }
#stats { margin-left: 0; left: calc(10px + var(--sal)); top: calc(10px + var(--sat)); padding: 9px 12px 9px 60px; width: min(200px, 48vw); min-height: 56px; display: flex; flex-direction: column; justify-content: center; }
.bar { height: 12px; gap: 6px; } .bar + .bar { margin-top: 5px; }
.bar .ico { width: 14px; font-size: 11px; }
.bar .lbl { display: none; }
.track { height: 7px; border-radius: 4px; background: rgba(255,255,255,.12); box-shadow: inset 0 1px 2px rgba(0,0,0,.25); }
.fill { border-radius: 4px; }
/* score + one combined pill (multiplier | wave · weather) + combo */
#score { font-size: clamp(30px, 6.4vw, 44px); letter-spacing: .5px; font-variant-numeric: tabular-nums; text-shadow: 0 2px 0 rgba(160,30,90,.9), 0 0 16px rgba(255,79,139,.45); }
#scorebox .srow { display: inline-flex; gap: 0; margin-top: 5px; border-radius: 999px; overflow: hidden; background: var(--glass); border: 1px solid var(--glass-b); box-shadow: 0 3px 10px rgba(0,0,0,.2); }
#mult { border-radius: 0; padding: 3px 9px; background: linear-gradient(180deg, #ffe066, #ffc93c); color: #3b2300; font-size: 12px; }
#wave { border: 0; border-radius: 0; background: transparent; padding: 3px 10px; font-size: 12px; font-weight: 800; }
#wave.up { background: rgba(255,82,82,.85); }
#combo b { background: linear-gradient(90deg, #ff9f1c, #ff3d7f); border-radius: 999px; padding: 2px 10px; font-size: 12px; box-shadow: 0 3px 10px rgba(255,61,127,.35); }
#combo i { height: 2px; width: 50px; opacity: .9; }
/* top right: minimap + pause only (switching the view is in the pause menu / V key) */
#minimap { border: 2px solid rgba(255,255,255,.75); box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.tbtn { width: 38px; height: 38px; border-radius: 12px; background: var(--glass); border: 1px solid var(--glass-b); font-size: 15px; box-shadow: 0 4px 12px rgba(0,0,0,.2), var(--glass-hi); }
/* one message line at a time (old and new cross-fade in the same spot) */
#toasts { display: grid; justify-items: center; gap: 0; }
#toasts > .toast { grid-area: 1 / 1; }
.toast { display: flex; align-items: center; gap: 8px; padding: 7px 14px 7px 10px; border-radius: 12px; font-weight: 800; font-size: clamp(12.5px, 3.3vw, 15px);
  background: rgba(16,10,32,.8); border: 1px solid rgba(255,255,255,.14); box-shadow: 0 8px 22px rgba(0,0,0,.28); max-width: 88vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: tin2 .28s cubic-bezier(.2,1.2,.4,1); }
.toast::before { content: ''; width: 4px; height: 16px; border-radius: 2px; background: #b39ddb; flex: none; }
.toast.good, .toast.danger { background: rgba(16,10,32,.84); border-color: rgba(255,255,255,.14); }
.toast.good::before { background: #7cffb2; }
.toast.danger { border-color: rgba(255,82,99,.55); } .toast.danger::before { background: #ff5263; }
.toast.out { animation: tout2 .26s ease-in forwards; }
@keyframes tin2 { from { transform: translateY(-8px); opacity: 0; } }
@keyframes tout2 { to { transform: translateY(-6px); opacity: 0; } }
/* achievement / quest / mission cards: slide up at the bottom centre, between the joystick and the buttons */
#notes { position: absolute; left: 50%; bottom: calc(236px + var(--sab)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.note { display: flex; align-items: center; gap: 9px; max-width: min(280px, 72vw); padding: 7px 12px 7px 7px; border-radius: 14px; background: rgba(16,10,32,.84); border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 8px 22px rgba(0,0,0,.3), var(--glass-hi); animation: nin .38s cubic-bezier(.2,1.3,.4,1); }
.note i { font-style: normal; width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex: none; background: rgba(255,210,63,.16); border: 1px solid rgba(255,210,63,.5); }
.note.green i { background: rgba(124,255,178,.14); border-color: rgba(124,255,178,.5); }
.note.violet i { background: rgba(206,147,216,.16); border-color: rgba(206,147,216,.55); }
.note.blue i { background: rgba(94,200,255,.15); border-color: rgba(94,200,255,.55); }
.note div { min-width: 0; display: flex; flex-direction: column; text-align: left; }
.note b { font-size: 12.5px; font-weight: 900; color: #ffe082; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note.green b { color: #9dffc4; } .note.violet b { color: #e1bee7; } .note.blue b { color: #a5e3ff; }
.note span { font-size: 11px; opacity: .85; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
.note.out { animation: nout .28s ease-in forwards; }
@keyframes nin { from { transform: translateY(18px) scale(.94); opacity: 0; } }
@keyframes nout { to { transform: translateY(10px); opacity: 0; } }
/* score popups: only 10+ points now, slightly smaller */
.pop { font-size: clamp(14px, 3.5vw, 18px); letter-spacing: .3px; text-shadow: 0 2px 0 rgba(0,0,0,.55), 0 0 10px rgba(0,0,0,.35); }
#missions.closed { box-shadow: 0 4px 12px rgba(0,0,0,.2), var(--glass-hi); }
@media (max-width: 560px) and (min-height: 561px) {
  #stats { width: min(200px, 50vw); }
  #scorebox { top: calc(84px + var(--sat)); }
  #toasts { top: calc(186px + var(--sat)); }
}
@media (max-height: 460px) {
  #stats { width: 176px; padding: 7px 10px 7px 58px; }
  #toasts { top: calc(88px + var(--sat)); }
  #missions { top: calc(74px + var(--sat)); left: calc(10px + var(--sal)); }
  #notes { bottom: calc(14px + var(--sab)); }
}

.opt span small { font-size: 11px; font-weight: 800; color: var(--yellow); margin-left: 2px; white-space: nowrap; }
.opt .seg button { white-space: nowrap; }

/* ---------------------------------------------------------------- map select (covers) */
#mapsel { position: fixed; inset: 0; z-index: 55; background: radial-gradient(120% 80% at 50% 20%, #3a1d6e 0%, #1a1030 72%); overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
#mapsel.hidden { display: none; }
.ms-inner { max-width: 1180px; min-height: 100%; display: flex; flex-direction: column; justify-content: center; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); box-sizing: border-box; }
.ms-logo { font-size: 34px; font-weight: 900; color: var(--yellow); -webkit-text-stroke: 2px #1a1030; paint-order: stroke fill; text-shadow: 0 4px 0 #1a1030; text-align: center; line-height: 1; }
.ms-logo span { display: inline-block; font-size: 16px; color: #fff; background: var(--pink); padding: 3px 10px; border-radius: 9px; margin-left: 8px; vertical-align: middle; -webkit-text-stroke: 0; text-shadow: none; }
.ms-title { text-align: center; font-weight: 900; font-size: 17px; margin: 10px 0 14px; color: #e9ddff; letter-spacing: 2px; }
.ms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 12px; }
@media (min-width: 900px) { .ms-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.ms-card { position: relative; display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; width: 100%; padding: 0; border: 2px solid rgba(255,255,255,.18); border-radius: 18px; overflow: hidden; background: #2a1850; color: #fff; text-align: left; cursor: pointer; font-family: inherit;
  box-shadow: 0 6px 0 rgba(0,0,0,.35); transition: transform .12s, border-color .12s; -webkit-tap-highlight-color: transparent; }
.ms-card img, .ms-dice { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #3b2a66; }
.ms-dice { display: flex; align-items: center; justify-content: center; font-size: 64px; background: linear-gradient(135deg, #ff6fa0, #7b5cff 55%, #29b6f6); }
.ms-cap { padding: 9px 12px 11px; display: flex; flex-direction: column; gap: 3px; }
.ms-cap b { font-size: 18px; font-weight: 900; }
.ms-cap span { font-size: 12.5px; font-weight: 700; color: #cbbcf0; line-height: 1.35; }
.ms-card i { position: absolute; top: 8px; right: 8px; font-style: normal; font-size: 12px; font-weight: 900; background: var(--yellow); color: #1a1030; padding: 3px 9px; border-radius: 999px; }
.ms-card.last { border-color: var(--yellow); }
.ms-card:active, .ms-card.picked { transform: scale(.97); border-color: #fff; }
@media (hover: hover) { .ms-card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,.55); } }
@media (orientation: landscape) and (max-height: 520px) {
  .ms-inner { padding-top: 10px; }
  .ms-logo { font-size: 24px; } .ms-logo span { font-size: 13px; }
  .ms-title { margin: 6px 0 10px; font-size: 14px; }
  .ms-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
  .ms-cap { padding: 6px 8px 8px; } .ms-cap b { font-size: 14px; } .ms-cap span { font-size: 10.5px; }
}
@media (orientation: portrait) and (max-width: 520px) { .ms-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .ms-cap b { font-size: 15px; } .ms-cap span { font-size: 11px; } .ms-card.rnd { grid-column: span 2; } .ms-card.rnd .ms-dice { aspect-ratio: 32 / 9; } }
.map-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; background: linear-gradient(180deg, rgba(41,182,246,.24), rgba(41,182,246,.1)); border-color: rgba(41,182,246,.5); }
.map-btn span { font-size: 15px; } .map-btn em { font-style: normal; font-size: 13px; font-weight: 900; color: #b3e5fc; }
.ms-title { position: relative; }
.ms-x { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 16px; font-weight: 900; cursor: pointer; }
#mapsel { background: rgba(20,10,40,.86); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

/* ===================== HUD v3: one small status card at the edge, everything else out of the way =====================
   top-left: avatar + score + three hairline bars in one card · top-right: pause + minimap (wave on its rim) + a
   folded missions chip · centre stays empty for the game; messages are one quiet line */
/* in-game panels: no backdrop blur (it re-blurred the moving 3D view under them every frame on phones),
   a touch more opaque instead so they read the same */
#hud .panel { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(20, 12, 40, .7); }
#card { position: absolute; left: calc(8px + var(--sal)); top: calc(8px + var(--sat)); display: flex; align-items: center; gap: 8px;
  padding: 6px 10px 6px 6px; border-radius: 14px; width: auto; min-width: 0; }
#card #avatar-wrap { position: relative; left: auto; top: auto; width: 36px; height: 36px; flex: none; }
#card #avatar { width: 36px; height: 36px; border-width: 2px; }
#card #avatar-badge { font-size: 13px; right: -4px; bottom: -3px; }
#card .ccol { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
#card .crow { display: flex; align-items: baseline; gap: 6px; line-height: 1; }
#score { font-size: 17px; font-weight: 900; letter-spacing: .3px; line-height: 1; font-variant-numeric: tabular-nums; text-shadow: 0 1px 0 rgba(0,0,0,.5); color: #fff; }
#score.bump { animation: sbump .22s ease-out; }
@keyframes sbump { 50% { transform: scale(1.12); color: #ffe082; } }
#mult { font-size: 10px; font-weight: 900; padding: 1px 5px; border-radius: 6px; background: rgba(255,210,63,.92); color: #3b2300; line-height: 1.3; }
#card #stats { position: static; margin: 0; padding: 0; width: clamp(92px, 24vw, 118px); min-height: 0; background: none; border: 0; box-shadow: none; display: flex; flex-direction: column; gap: 3px; }
#card .bar { height: 9px; gap: 4px; } #card .bar + .bar { margin-top: 0; }
#card .bar .ico { width: 11px; font-size: 9px; line-height: 1; }
#card .bar .lbl { display: none; }
#card .track { height: 4px; border-radius: 2px; background: rgba(255,255,255,.16); box-shadow: none; }
#card .fill { border-radius: 2px; }
#combo { position: absolute; left: calc(8px + var(--sal)); top: calc(82px + var(--sat)); margin: 0; align-items: flex-start; }
#combo b { font-size: 11px; padding: 2px 8px; }
#combo i { width: 44px; height: 2px; }
#scorebox { display: none; }
/* top right */
#topright { right: calc(8px + var(--sar)); top: calc(8px + var(--sat)); gap: 6px; }
.mmrow { display: flex; align-items: flex-start; gap: 6px; }
.mmwrap { position: relative; }
#minimap { display: block; width: clamp(72px, 19vw, 96px); height: clamp(72px, 19vw, 96px); border-width: 2px; border-color: rgba(255,255,255,.7); }
#wave { position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); font-size: 10px; font-weight: 900; padding: 1px 7px; border-radius: 8px; line-height: 1.4;
  background: rgba(16,10,32,.88); border: 1px solid rgba(255,255,255,.22); white-space: nowrap; }
#wave.up { animation: wup .4s ease-out 2; background: rgba(255,82,82,.92); }
@keyframes wup { 50% { transform: translateX(-50%) scale(1.15); } }
#btn-pause { pointer-events: auto; width: 32px; height: 32px; border-radius: 10px; font-size: 13px; padding: 0; }
/* missions: a small chip that opens into the list on tap; progress peeks into the chip for a moment */
#missions { position: static; width: auto; max-width: clamp(150px, 40vw, 210px); padding: 0; margin-top: 4px; gap: 0; border-radius: 11px; pointer-events: auto; }
#missions #m-head { display: flex; align-items: center; gap: 5px; padding: 4px 9px; font-size: 11px; font-weight: 800; color: #fff; background: none; border: 0; font-family: inherit; max-width: 100%; }
#missions #m-head i { font-style: normal; font-size: 11px; }
#missions #m-sum { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#missions #m-tog { font-style: normal; font-size: 9px; opacity: .7; }
#missions:not(.closed) { width: clamp(150px, 40vw, 210px); }
#missions:not(.closed) #m-list { display: flex; flex-direction: column; gap: 3px; padding: 0 8px 6px; }
#missions.closed #m-list { display: none; }
#missions.peek { border-color: rgba(124,255,178,.6); }
#missions.peek #m-sum { color: #b9ffd4; }
/* messages: one quiet line, top centre (below the card on narrow portrait screens) */
#toasts { top: calc(10px + var(--sat)); max-width: calc(100vw - 2 * 190px); width: auto; }
.toast { padding: 5px 11px 5px 8px; border-radius: 10px; font-size: 12.5px; font-weight: 800; background: rgba(16,10,32,.72); box-shadow: 0 4px 14px rgba(0,0,0,.22); max-width: 100%; }
.toast::before { height: 12px; width: 3px; }
#notes { bottom: calc(150px + var(--sab)); }
.note { padding: 5px 10px 5px 5px; } .note i { width: 26px; height: 26px; font-size: 15px; border-radius: 8px; }
.note b { font-size: 11.5px; } .note span { font-size: 10.5px; }
@media (max-width: 640px) and (min-height: 561px) {
  #toasts { top: calc(112px + var(--sat)); max-width: 92vw; }
  #notes { bottom: calc(220px + var(--sab)); }
}
@media (max-height: 460px) {
  #toasts { top: calc(8px + var(--sat)); max-width: calc(100vw - 2 * 200px); }
  #missions { position: static; left: auto; top: auto; }
  #notes { bottom: calc(12px + var(--sab)); }
  #card #stats { width: 100px; }
}

/* first-play coach (tutorial.js) */
#tut { position: fixed; left: 50%; bottom: calc(12px + var(--sab, 0px)); transform: translateX(-50%); width: min(460px, 74vw); z-index: 8; padding: 9px 12px 8px; border-radius: 12px;
  background: rgba(20,12,40,.95); border: 1px solid rgba(255,214,140,.4); color: #fff; font-weight: 800; font-size: 14.5px; line-height: 1.45; text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
#tut.off { display: none; } #tut .tb { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 5px; font-size: 11px; font-weight: 700; }
#tut .tb .tn { opacity: .7; } #tut .tb > span:last-child { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 2px; } #tut .tb button { font: inherit; color: #ffd06b; background: none; border: 0; padding: 4px 6px; cursor: pointer; white-space: nowrap; } #tut .tb .nx { color: #2a1c08; background: #ffd06b; border-radius: 8px; margin-right: 4px; }
#tut .th { font-size: 16px; font-weight: 900; color: #ffd06b; } #tut .tt { font-size: 14px; } #tut .td { font-size: 12.5px; font-weight: 600; line-height: 1.45; opacity: .88; margin-top: 3px; }
@media (max-height: 460px) { #tut { padding: 6px 10px 5px; } #tut .th { font-size: 14px; } #tut .tt { font-size: 12.5px; } #tut .td { font-size: 11.5px; line-height: 1.35; } }
.tut-hl { animation: tutp 1.1s ease-in-out infinite; box-shadow: 0 0 0 3px #ffd06b !important; }
@keyframes tutp { 50% { transform: scale(1.1); } }
@media (max-aspect-ratio: 1/1) { #tut { bottom: calc(214px + var(--sab, 0px)); width: 90vw; } } /* (v124: upright, just above the stick and the buttons: the dog stays in sight; sideways between them) */

/* weekly leaderboard (leaderboard.js) */
.lb-layer { z-index: 60; background: rgba(10,6,20,.82); }
.lb-card { width: min(460px, 94vw); max-height: 88vh; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; background: #1d1430; border: 1px solid rgba(255,214,140,.3); border-radius: 16px; padding: 14px 16px; color: #fff; }
.lb-card h2 { margin: 0 0 8px; font-size: 19px; color: #ffd06b; }
.lb-big { font-size: 17px; font-weight: 900; margin: 4px 0 10px; } .lb-big b { color: #ffd06b; font-size: 22px; }
.lb-l { display: block; font-size: 12.5px; font-weight: 700; opacity: .9; } .lb-l input { display: block; width: 100%; margin-top: 5px; padding: 9px 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; font-size: 16px; font-weight: 800; }
.lb-dim { font-size: 12px; opacity: .72; line-height: 1.5; margin: 8px 0; } .lb-msg { min-height: 1.4em; font-size: 13.5px; font-weight: 800; color: #b9f6ca; }
.lb-row { display: flex; gap: 8px; margin-top: 10px; } .lb-row .mbtn { flex: 1; margin: 0; }
.lb-tabs { display: flex; gap: 4px; flex-wrap: wrap; } .lb-tabs button { flex: 1 0 auto; padding: 6px 7px; border-radius: 9px; font-size: 12.5px; font-weight: 900; background: rgba(255,255,255,.08); color: #fff; border: 0; }
.lb-tabs button.on { background: #ffd06b; color: #2a1c08; }
.lb-list { margin-top: 6px; } .lb-r { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-top: 1px solid rgba(255,255,255,.07); font-weight: 800; }
.lb-r i { width: 30px; text-align: center; font-style: normal; } .lb-r span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .lb-r b { color: #ffd06b; }
.lb-r.me { background: rgba(140,255,184,.12); border-radius: 8px; }
.lb-btn { width: 100%; } .lb-btn em { display: block; font-size: 11px; font-style: normal; opacity: .75; }
#over .lbup { width: 100%; margin-top: 6px; background: linear-gradient(180deg, #ffd06b, #f0a830); color: #2a1c08; font-weight: 900; }
/* v60: messages are never cut off. The box spans the screen width it may use (left: 50% left it only half of it) and a
   long message wraps onto a second line instead of being clipped. */
#toasts { left: 0; right: 0; margin: 0 auto; transform: none; width: max-content; }
@media (max-width: 640px) and (min-height: 561px) { #toasts { top: calc(126px + var(--sat)); } } /* (upright: clear of the 任務 chip) */
.toast { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.35; text-align: left; overflow-wrap: anywhere; }
/* v60: sideways phones: 再玩一次 and 上傳 side by side, so the share row (存圖 · 分享 · LINE · 快報 · 選單) always fits */
@media (min-aspect-ratio: 5/4) and (max-height: 620px) {
  .obtns { display: grid; grid-template-columns: 1fr 1fr; column-gap: 6px; }
  .obtns .row { grid-column: 1 / -1; }
  #over .lbup { margin-top: 0; font-size: clamp(13px, 2.6vh, 16px); padding-left: 4px; padding-right: 4px; white-space: nowrap; overflow: hidden; }
  #over .lbup .lbx { display: none; } /* (short label here: 🏆 上傳分數) */
  .obtns .mbtn.primary { white-space: nowrap; font-size: clamp(14px, 2.8vh, 19px); padding-left: 4px; padding-right: 4px; }
  #over .lbup.hidden + .row, .obtns:has(.lbup.hidden) .primary { grid-column: 1 / -1; }
}
/* ---------------------------------------------------------------- v62: the result card shows everything, on every phone
   (also short screens: Safari's bars showing, small phones, sideways). Fits first; if a screen is truly too small,
   the card scrolls instead of cutting anything off. Stat labels and numbers size themselves to their box, never "…". */
#over { touch-action: pan-y; }
.over-card { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.grid div { container-type: inline-size; }
.grid b { overflow: visible; text-overflow: clip; font-size: min(clamp(13px, 2.2vh, 17px), 24cqi); }
.grid span { overflow: visible; text-overflow: clip; font-size: min(clamp(9px, 1.35vh, 11px), 18.5cqi); }
.sub { max-height: none; }
.sub span { overflow: visible; text-overflow: clip; }
/* upright but short: each stat on two lines (icon + number, then its name) */
@media (max-aspect-ratio: 5/4) and (max-height: 720px) {
  .grid div { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: baseline; column-gap: 3px; padding: 3px 2px; }
  .grid i { font-size: 12px; } .grid span { flex-basis: 100%; text-align: center; line-height: 1.2; }
  .shot { min-height: 64px; }
/* the column is never smaller than its title + the smallest photo + the line; the photo grows into whatever is left */
.ocol.l { min-height: auto; }
@media (max-aspect-ratio: 5/4) { .over-card { height: 100%; } .ocol.l { flex: 1 1 auto; } .shot { flex: 1 1 0; max-height: 60vh; } }
  .ohead { row-gap: 2px; } .rip { font-size: clamp(20px, 3.8vh, 28px); }
  .final b { font-size: clamp(30px, 5.6vh, 46px); }
}
@media (max-aspect-ratio: 5/4) and (max-height: 600px) {
  .over-card { padding: 8px 10px; gap: 4px; } .ocol { gap: 4px; }
  .obtns .mbtn.primary, #over .lbup { padding-top: 7px; padding-bottom: 7px; font-size: 16px; }
  .obtns .row { margin-top: 5px; } .obtns .row .mbtn { padding-top: 6px; padding-bottom: 6px; }
}
/* sideways: the numbers column gets a fixed share (it was squeezed to a sliver and cut its labels short) */
@media (min-aspect-ratio: 5/4) and (max-height: 620px) {
  .ocol.l { flex: 1 1 0; min-width: 0; }
  .ocol.r { flex: 0 0 clamp(250px, 44%, 400px); min-width: 0; }
  .over-card { gap: 10px; }
}
/* sideways and very short (Safari's bars showing: ~300 px tall): compact everything in the numbers column */
@media (min-aspect-ratio: 5/4) and (max-height: 380px) {
  #over { padding-top: calc(6px + var(--sat)); padding-bottom: calc(6px + var(--sab)); }
  .over-card { padding: 8px 10px; border-radius: 18px; }
  .ocol { gap: 4px; }
  .rip { font-size: 20px; -webkit-text-stroke-width: 1.5px; } .rank, .tier { font-size: 11px; padding: 3px 8px; }
  .final b { font-size: 30px; } .final span { font-size: 13px; } .final em { font-size: 11px; }
  .sub span { font-size: 10px; padding: 1px 6px; }
  .grid { gap: 3px; }
  .grid div { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: baseline; column-gap: 3px; padding: 2px 1px; border-radius: 8px; }
  .grid i { font-size: 11px; } .grid b { font-size: min(14px, 22cqi); } .grid span { flex-basis: 100%; text-align: center; line-height: 1.15; font-size: min(10px, 18.5cqi); }
  .obtns .mbtn.primary, #over .lbup { padding-top: 6px; padding-bottom: 6px; font-size: 15px; }
  .obtns .row { margin-top: 4px; gap: 4px; } .obtns .row .mbtn { padding-top: 5px; padding-bottom: 5px; font-size: 11.5px; }
  .line { font-size: 11px; line-height: 1.25; }
}
/* v63: the zoo's chaos meter, beside the minimap under the pause button */
#chaos { position: absolute; right: calc(100% + 6px); top: 40px; min-width: 62px; padding: 2px 7px 5px; border-radius: 8px; background: rgba(16,10,32,.82); border: 1px solid rgba(255,255,255,.22); color: #fff; font-size: 10px; font-weight: 900; white-space: nowrap; pointer-events: none; overflow: hidden; }
#chaos b { position: relative; display: block; line-height: 1.3; }
#chaos i { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: #ffca28; transition: width .3s; }
#chaos.hot i { background: #ff7043; }
#chaos.max { background: rgba(198,40,40,.9); }
#chaos.max i { background: #fff; }
/* v72: the result card, upright too: the line under the picture is shown whole (no clamp: it was cut in half on
   home-screen apps), and 再玩一次 / 上傳分數 sit side by side (one row less, the card stays on screen) */
.line { display: block; -webkit-line-clamp: unset; overflow: visible; }
.obtns { display: grid; grid-template-columns: 1fr 1fr; column-gap: 6px; }
.obtns .row { grid-column: 1 / -1; }
#over .lbup { margin-top: 0; white-space: nowrap; overflow: hidden; padding-left: 4px; padding-right: 4px; font-size: clamp(14px, 2.4vh, 18px); }
#over .lbup .lbx { display: none; }
.obtns .mbtn.primary { white-space: nowrap; padding-left: 4px; padding-right: 4px; font-size: clamp(15px, 2.6vh, 20px); }
#over .lbup.hidden + .row, .obtns:has(.lbup.hidden) .primary { grid-column: 1 / -1; }
/* v72: 裝死 cooling down: the action button shows the seconds left, dimmed */
#btn-action.cd { filter: saturate(.35) brightness(.85); }
/* v72: a finger slid from 趴下 / 衝刺 onto 叫: the button lights up (let go there for 裝死 / 撲咬) */
#btn-action.combo { transform: scale(1.12); box-shadow: 0 0 0 4px #fff, 0 0 18px 6px rgba(255,214,79,.85); }
/* v72: tap the minimap: the whole map, full screen; the game waits until it is closed */
#minimap { cursor: pointer; pointer-events: auto; }
#bigmap { position: fixed; inset: 0; z-index: 300; background: rgba(10,6,20,.82); display: flex; align-items: center; justify-content: center;
  padding: calc(10px + var(--sat)) calc(10px + var(--sar)) calc(10px + var(--sab)) calc(10px + var(--sal)); }
#bigmap.hidden { display: none; }
.bm-box { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 100%; max-height: 100%; }
.bm-t { color: #fff; font-weight: 900; font-size: 16px; } .bm-t span { font-size: 12px; opacity: .7; font-weight: 700; }
#bigmap-c { width: min(92vw, calc(100vh - 120px), 720px); height: min(92vw, calc(100vh - 120px), 720px); border-radius: 16px; border: 3px solid rgba(255,255,255,.8); background: #3a3a48; touch-action: none; }
#bigmap-x { width: min(92vw, 360px); margin: 0; }
/* v72: the 升級 page from the pause menu (only that page), the reset ticket bar (one slim line) */
#closet.ingame .tabs button:not([data-t="skill"]) { display: none; } #closet.ingame[data-tab="ach"] .tabs button[data-t="skill"] { display: none; } #closet.ingame[data-tab="ach"] .tabs button[data-t="ach"] { display: inline-block; }
#closet.ingame { background: rgba(10,6,20,.6); }
.rtkbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; padding: 4px 6px 4px 10px; border-radius: 10px; background: rgba(255,255,255,.07); font-size: 13px; font-weight: 800; }
.rtkbar b { color: #ffd06b; } .rtkbar .mbtn { margin: 0; width: auto; padding: 5px 10px; font-size: 12px; } .rtkbar .mbtn.off { opacity: .45; }
.gres em.rtk { display: block; color: #8cffb8; font-size: 10px; font-style: normal; }
.lb-diff { margin-top: 4px; } .lb-diff button { font-size: 12px; padding: 4px 10px; }
/* v72 毛色: one slim row of coat chips above the outfit filters */
.coats { display: flex; gap: 5px; overflow-x: auto; padding: 0 0 6px; align-items: center; scrollbar-width: none; }
.coats > span { font-size: 12px; font-weight: 900; white-space: nowrap; opacity: .85; }
.coats button { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.07); color: #fff; font-size: 12px; font-weight: 800; }
.coats button i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); border: 1px solid rgba(0,0,0,.35); }
.coats button.on { background: #ffd06b; color: #2a1c08; } .coats button.lock { opacity: .55; }
.coats button i { background: linear-gradient(135deg, var(--c) 55%, var(--c2, var(--c)) 55%); }
/* v73: translated labels can be longer: tabs shrink their text instead of running into each other */
#closet .tabs button { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
html[lang=en] #closet .tabs button, html[lang=ja] #closet .tabs button { font-size: 12px; padding-left: 2px; padding-right: 2px; }
/* v73: English / Japanese stat names wrap inside their box (two short lines) instead of running into the next one */
html[lang=en] .grid span, html[lang=ja] .grid span { white-space: normal; line-height: 1.1; text-align: center; overflow-wrap: anywhere; }
html[lang=en] .obtns .row .mbtn, html[lang=ja] .obtns .row .mbtn { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* v73 語言版面: longer English / Japanese labels wrap inside their boxes instead of being cut or running off the screen */
.mrow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.mrow .mbtn { min-width: 0; } .mrow .mbtn > span { max-width: 100%; overflow-wrap: anywhere; line-height: 1.2; }
html[lang=en] .logo .l2, html[lang=ja] .logo .l2 { margin-top: 10px; }
.wear .it { min-width: 0; }
.wear .it b, .wear .it span { white-space: normal; overflow: visible; overflow-wrap: anywhere; text-align: center; line-height: 1.2; max-width: 100%; }
#keyhint { white-space: normal; text-align: center; width: max-content; max-width: calc(100vw - 24px); }
html[lang=en] #closet .tabs, html[lang=ja] #closet .tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
html[lang=en] #closet .tabs button, html[lang=ja] #closet .tabs button { white-space: normal; overflow: visible; line-height: 1.15; padding-top: 6px; padding-bottom: 6px; }
html[lang=en] .obtns .row .mbtn, html[lang=ja] .obtns .row .mbtn { white-space: normal; overflow: visible; line-height: 1.1; overflow-wrap: anywhere; }
.mrow .mbtn em { white-space: normal; overflow: visible; overflow-wrap: anywhere; line-height: 1.2; }
.wear .it em { white-space: normal; overflow: visible; overflow-wrap: anywhere; text-align: center; line-height: 1.2; max-width: 100%; }
.card { min-width: 0; } .card b, .card span { white-space: normal; overflow-wrap: anywhere; line-height: 1.2; max-width: 100%; }
.shot .cap b { white-space: normal; overflow: visible; text-align: center; line-height: 1.15; overflow-wrap: anywhere; }
@media (max-width: 600px) { #keyhint { display: none; } }
html[lang=en] .logo, html[lang=ja] .logo { line-height: 1.08; }
.opt { gap: 8px; } .opt .seg { flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
@media (max-width: 360px) { .seg button { padding: 6px 7px; font-size: 12.5px; } }
html[lang=en] .g-tabs, html[lang=ja] .g-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
html[lang=en] .g-tabs button, html[lang=ja] .g-tabs button { white-space: normal; line-height: 1.15; text-align: center; }
html[lang=en] .banners button, html[lang=ja] .banners button { white-space: normal; overflow: visible; line-height: 1.15; }
@media (max-height: 560px) and (min-aspect-ratio: 13/10) {
  html[lang=en] .chead, html[lang=ja] .chead { flex-wrap: wrap; row-gap: 5px; }
  html[lang=en] .chead .coins, html[lang=ja] .chead .coins { flex: 1 1 auto; overflow: visible; }
  html[lang=en] .chead .x, html[lang=ja] .chead .x { order: 2; }
  html[lang=en] .chead .tabs, html[lang=ja] .chead .tabs { order: 3; flex: 1 1 100%; grid-template-columns: repeat(6, minmax(0, 1fr)); }
  html[lang=en] #closet .tabs button, html[lang=ja] #closet .tabs button { font-size: 11px; overflow-wrap: anywhere; }
  html[lang=en] .g-tabs, html[lang=ja] .g-tabs { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
#m-head span { white-space: normal; overflow-wrap: anywhere; line-height: 1.15; }
@media (max-height: 500px) { #keyhint { display: none; } }

/* ===================================================================== v73 封面 (cover)
   One card of actions over the 3D dog: bottom sheet on an upright phone, a column on the right on a sideways phone and
   on a computer. Nothing on it scrolls. Settings · how to play · about are folded into the panel at the top left. */
:root { --glass: rgba(22, 14, 40, .58); --glass-hi: rgba(255,255,255,.10); --glass-line: rgba(255,255,255,.16); --sys: -apple-system, BlinkMacSystemFont, "SF Pro Text", var(--font); }
#menu.cover { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; overflow: hidden; touch-action: none; font-family: var(--sys);
  padding: calc(64px + var(--sat)) calc(12px + var(--sar)) calc(12px + var(--sab)) calc(12px + var(--sal));
  background: linear-gradient(180deg, rgba(20,12,36,.28) 0%, rgba(20,12,36,0) 22%, rgba(20,12,36,0) 46%, rgba(20,12,36,.55) 100%); }
#menu .cv-top { position: absolute; left: calc(12px + var(--sal)); right: calc(12px + var(--sar)); top: calc(12px + var(--sat)); display: flex; justify-content: space-between; align-items: center; gap: 10px; pointer-events: none; z-index: 2; }
#menu .cv-top > * { pointer-events: auto; }
.cv-hubbtn { display: inline-flex; align-items: center; gap: 8px; height: 42px; min-width: 42px; padding: 0 14px 0 11px; border-radius: 999px; color: #fff; font: 700 14px/1 var(--sys);
  background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5); box-shadow: 0 6px 18px rgba(0,0,0,.22); transition: transform .15s; }
.cv-hubbtn:active { transform: scale(.95); }
.cv-hubbtn.on { background: rgba(255,255,255,.92); color: #1c1230; }
.cv-hubbtn svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.cv-hubbtn span { white-space: nowrap; }
.cv-pill { height: 38px; padding: 0 14px; border-radius: 999px; font: 800 13.5px/1 var(--sys); color: #3b2300; background: var(--yellow); box-shadow: 0 4px 14px rgba(0,0,0,.25); white-space: nowrap; }
@media (max-width: 400px) { .cv-hubbtn span { display: none; } .cv-hubbtn { padding: 0; width: 42px; justify-content: center; } }

#menu .cv-card { width: min(420px, 100%); margin: 0; display: flex; flex-direction: column; gap: 9px; padding: 14px; text-align: center; border-radius: 28px;
  background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: 0 18px 50px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.12); }
#menu .cv-brand { display: flex; flex-direction: column; align-items: center; gap: 4px; }
#menu .cv-brand .logo { line-height: 1; filter: drop-shadow(0 4px 0 rgba(0,0,0,.3)); display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 2px 8px; }
#menu .cv-brand .logo .l1 { display: inline-block; font-size: clamp(30px, 9vw, 46px); line-height: 1.05; -webkit-text-stroke: 2.5px var(--ink); transform: rotate(-3deg); animation: none; }
#menu .cv-brand .logo .l2 { font-size: clamp(16px, 4.6vw, 22px); margin: 0; padding: 3px 11px; transform: rotate(3deg); border-radius: 9px; line-height: 1.15; }
#menu .cv-brand .tag { margin: 0; font-size: 12.5px; font-weight: 700; opacity: .82; text-shadow: none; line-height: 1.3; }
#menu .move-pill { margin: 0; }
.cv-start { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 100%; min-height: 58px; padding: 9px 12px; border-radius: 18px; color: #fff;
  background: linear-gradient(180deg, #ff74a6, #ec2a71); box-shadow: 0 8px 22px rgba(236,42,113,.45), inset 0 1px 0 rgba(255,255,255,.35); transition: transform .12s, box-shadow .12s; }
.cv-start:active { transform: scale(.97); box-shadow: 0 3px 10px rgba(236,42,113,.4); }
.cv-start b { font: 800 21px/1.15 var(--sys); letter-spacing: .5px; }
.cv-start small { font: 700 12.5px/1.25 var(--sys); opacity: .9; overflow-wrap: anywhere; }
.cv-map { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px; padding: 8px 14px; border-radius: 14px; color: #fff;
  background: var(--glass-hi); border: 1px solid rgba(255,255,255,.12); font: 700 15px/1.25 var(--sys); text-align: left; }
.cv-map span { min-width: 0; overflow-wrap: anywhere; }
.cv-map em { font-style: normal; font-size: 13px; font-weight: 700; color: #9fd3ff; flex: none; max-width: 50%; text-align: right; }
.cv-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cv-tile { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; padding: 9px 5px 8px; border-radius: 16px; color: #fff;
  background: var(--glass-hi); border: 1px solid rgba(255,255,255,.12); transition: transform .12s; }
.cv-tile:active { transform: scale(.96); }
.cv-tile i { font-style: normal; font-size: 22px; line-height: 1.1; position: relative; }
.cv-tile i s { text-decoration: none; position: absolute; right: -14px; top: -6px; font-size: 13px; }
.cv-tile b { font: 800 13px/1.2 var(--sys); max-width: 100%; overflow-wrap: anywhere; }
.cv-tile em { font: 600 10.5px/1.3 var(--sys); font-style: normal; opacity: .78; max-width: 100%; overflow-wrap: anywhere; }
.cv-tile.daily { background: linear-gradient(180deg, rgba(94,200,255,.26), rgba(30,110,200,.18)); border-color: rgba(150,220,255,.35); }
.cv-tile.closet { background: linear-gradient(180deg, rgba(255,210,63,.24), rgba(255,170,0,.12)); border-color: rgba(255,210,63,.38); }
.cv-tile.closet em { color: var(--yellow); opacity: 1; font-weight: 800; }
.cv-tile.lb { background: linear-gradient(180deg, rgba(186,140,255,.24), rgba(120,70,220,.14)); border-color: rgba(200,170,255,.35); }
#menu .best { margin: 0; font: 700 12.5px/1.2 var(--sys); opacity: .85; }
#menu .best b { font-size: 15px; }
/* short upright phones: tighter */
@media (max-height: 640px) and (max-aspect-ratio: 13/10) {
  #menu.cover { padding-top: calc(60px + var(--sat)); }
  #menu .cv-card { gap: 7px; padding: 11px; border-radius: 24px; }
  #menu .cv-brand .logo .l1 { font-size: 30px; } #menu .cv-brand .logo .l2 { font-size: 15px; }
  #menu .cv-brand .tag { font-size: 11.5px; }
  .cv-start { min-height: 50px; padding: 7px 10px; } .cv-start b { font-size: 19px; }
  .cv-map { min-height: 40px; padding: 6px 12px; font-size: 14px; }
  .cv-tile { padding: 7px 4px 6px; } .cv-tile i { font-size: 19px; }
}
/* sideways phones: the card on the right, full height, the dog on the left */
@media (max-height: 560px) and (min-aspect-ratio: 13/10) {
  #menu.cover { justify-content: center; align-items: flex-end; padding: calc(8px + var(--sat)) calc(10px + var(--sar)) calc(8px + var(--sab)) calc(10px + var(--sal));
    background: linear-gradient(90deg, rgba(20,12,36,0) 40%, rgba(20,12,36,.45) 100%); }
  #menu .cv-card { width: min(380px, 50vw); max-height: 100%; gap: 6px; padding: 10px 12px; border-radius: 22px; }
  #menu .cv-brand { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 2px 10px; }
  #menu .cv-brand .logo .l1 { font-size: 26px; -webkit-text-stroke: 2px var(--ink); } #menu .cv-brand .logo .l2 { font-size: 13px; padding: 2px 8px; }
  #menu .cv-brand .tag { font-size: 11px; }
  .cv-start { min-height: 44px; padding: 5px 10px; border-radius: 14px; } .cv-start b { font-size: 18px; } .cv-start small { font-size: 11.5px; }
  .cv-map { min-height: 34px; padding: 5px 12px; font-size: 13.5px; border-radius: 12px; } .cv-map em { font-size: 12px; }
  .cv-tiles { gap: 6px; } .cv-tile { padding: 5px 4px; border-radius: 12px; gap: 1px; } .cv-tile i { font-size: 17px; } .cv-tile b { font-size: 12px; } .cv-tile em { font-size: 10px; }
  #menu .best { font-size: 11.5px; } #menu .best b { font-size: 13px; }
  .cv-hubbtn { height: 38px; min-width: 38px; } .cv-pill { height: 34px; }
}
@media (max-height: 380px) and (min-aspect-ratio: 13/10) { #menu .cv-brand .tag { display: none; } }
/* computers / tablets sideways: a roomy column on the right */
@media (min-width: 900px) and (min-height: 561px) {
  #menu.cover { justify-content: center; align-items: flex-end; padding: calc(24px + var(--sat)) calc(6vw + var(--sar)) calc(24px + var(--sab)) 24px;
    background: linear-gradient(90deg, rgba(20,12,36,0) 45%, rgba(20,12,36,.42) 100%); }
  #menu .cv-card { width: 400px; gap: 11px; padding: 20px; border-radius: 30px; }
  #menu .cv-brand .logo .l1 { font-size: 54px; } #menu .cv-brand .logo .l2 { font-size: 24px; }
  #menu .cv-brand { gap: 8px; margin-bottom: 4px; }
  .cv-start { min-height: 64px; } .cv-start b { font-size: 23px; }
  .cv-tile { padding: 12px 6px 10px; } .cv-tile i { font-size: 26px; } .cv-tile b { font-size: 14px; } .cv-tile em { font-size: 11.5px; }
  .cv-hubbtn { height: 44px; font-size: 15px; }
  .cv-start:hover, .cv-tile:hover, .cv-map:hover, .cv-hubbtn:hover { filter: brightness(1.08); }
}
html[lang=en] #menu .cv-brand .logo .l1, html[lang=ja] #menu .cv-brand .logo .l1 { font-size: clamp(26px, 7.4vw, 40px); }
@media (min-width: 900px) and (min-height: 561px) { html[lang=en] #menu .cv-brand .logo .l1, html[lang=ja] #menu .cv-brand .logo .l1 { font-size: 46px; } }
@media (max-height: 560px) and (min-aspect-ratio: 13/10) { html[lang=en] #menu .cv-brand .logo .l1, html[lang=ja] #menu .cv-brand .logo .l1 { font-size: 22px; } }

/* the panel: ⚙️ 設定 · 📖 玩法 · ℹ️ 關於 (opens from the button at the top left, folds away with ✕ / Esc / a tap outside) */
#hub-scrim { position: fixed; inset: 0; z-index: 24; background: rgba(8,4,18,.28); }
.hub { position: fixed; z-index: 25; left: calc(10px + var(--sal)); top: calc(60px + var(--sat)); width: min(460px, calc(100vw - 20px - var(--sal) - var(--sar)));
  height: calc(var(--app-h, 100vh) - 70px - var(--sat) - var(--sab)); max-height: 720px; display: flex; flex-direction: column; overflow: hidden; font-family: var(--sys);
  background: rgba(24,16,44,.86); border: 1px solid var(--glass-line); border-radius: 24px; backdrop-filter: blur(26px) saturate(1.6); -webkit-backdrop-filter: blur(26px) saturate(1.6);
  box-shadow: 0 24px 60px rgba(0,0,0,.5); transform-origin: top left; animation: hub-in .22s cubic-bezier(.2,.9,.3,1.15); touch-action: pan-y; }
@keyframes hub-in { from { transform: scale(.94) translateY(-6px); } }
.hub-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 8px; border-bottom: 1px solid rgba(255,255,255,.08); }
.hub-tabs { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; padding: 3px; border-radius: 12px; background: rgba(255,255,255,.08); }
.hub-tabs button { min-width: 0; padding: 7px 4px; border-radius: 9px; background: transparent; color: rgba(255,255,255,.75); font: 700 13px/1.2 var(--sys); overflow-wrap: anywhere; }
.hub-tabs button.on { background: rgba(255,255,255,.95); color: #1c1230; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.hub-head .x { flex: none; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 15px; font-weight: 900; }
.hub-page { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 12px 14px 16px; }
.hub-page[data-p="howto"] { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.hub-page[data-p="howto"] .g-tabs { padding: 10px 12px; }
.hub .opts { background: transparent; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.hub .opt { flex-wrap: wrap; row-gap: 6px; padding: 9px 2px; border-bottom: 1px solid rgba(255,255,255,.07); font: 700 14px/1.25 var(--sys); }
.hub .opt > span { min-width: 0; overflow-wrap: anywhere; }
.hub .opt:last-child { border-bottom: 0; }
.hub .seg { border-radius: 10px; margin-left: auto; }
.hub .seg button { font-family: var(--sys); }
.hub-note { margin: 10px 2px 0; font-size: 12px; opacity: .6; line-height: 1.4; }
@media (max-height: 560px) and (min-aspect-ratio: 13/10) {
  .hub { top: calc(54px + var(--sat)); height: calc(var(--app-h, 100vh) - 62px - var(--sat) - var(--sab)); width: min(460px, 56vw); }
  .hub .opt { padding: 6px 2px; }
}
@media (min-width: 900px) and (min-height: 561px) { .hub { top: calc(66px + var(--sat)); left: calc(16px + var(--sal)); height: min(640px, calc(var(--app-h, 100vh) - 90px)); } #hub-scrim { background: transparent; } }

/* about */
.ab-dev { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.ab-app { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ab-app b { font-size: 18px; font-weight: 900; color: var(--yellow); }
.ab-app span { font-size: 12.5px; opacity: .6; }
html[lang=en] .ab-app span { display: none; }
.ab-threads { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.ab-threads:active { transform: scale(.98); }
.ab-ico { flex: none; width: 40px; height: 40px; border-radius: 11px; background: #000; border: 1px solid rgba(255,255,255,.25); color: #fff; display: flex; align-items: center; justify-content: center; font: 800 24px/1 var(--sys); font-style: normal; }
.ab-threads > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ab-threads b { font-size: 12px; opacity: .65; font-weight: 700; }
.ab-threads em { font-style: normal; font-size: 15px; font-weight: 800; overflow-wrap: anywhere; }
.ab-threads small { flex: none; max-width: 40%; text-align: right; font-size: 12px; color: #9fd3ff; font-weight: 700; }
.ab-itch .ab-ico { background: #fa5c5c; border-color: rgba(255,255,255,.3); font-size: 21px; } /* v255 */
.ab-donate { padding: 10px 12px; border-radius: 16px; background: rgba(255,213,79,.1); border: 1px solid rgba(255,213,79,.28); }
.ab-donate b { display: block; font: 800 13.5px/1.3 var(--sys); color: #ffd54f; margin-bottom: 3px; }
.ab-donate p { margin: 0; font: 600 12.5px/1.5 var(--sys); color: rgba(255,255,255,.85); }
.ab-doc { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); border-radius: 18px; padding: 14px 14px 12px; }
.ab-doc h3 { margin: 0; font-size: 16px; font-weight: 900; line-height: 1.35; }
.ab-date { margin: 4px 0 10px; font-size: 11.5px; opacity: .55; }
.ab-doc section { padding: 10px 0; border-top: 1px solid rgba(255,255,255,.07); }
.ab-doc section.warn { margin: 2px -6px; padding: 10px 6px 10px 12px; border-top: 0; border-left: 3px solid #ff6b6b; border-radius: 8px; background: rgba(255,82,82,.08); }
.ab-doc h4 { margin: 0 0 5px; font-size: 13.5px; font-weight: 800; color: #ffd98a; }
.ab-doc p { margin: 0 0 6px; font-size: 12.5px; line-height: 1.7; opacity: .88; overflow-wrap: anywhere; }
.ab-end { margin: 8px 0 0 !important; padding: 10px 12px; border-radius: 12px; background: rgba(255,210,63,.12); color: #ffe7a3; font-weight: 700; opacity: 1 !important; }
#guide.hub { padding: 0; background: rgba(24,16,44,.86); }
/* (no backdrop blur on the big surfaces: re-blurring the live 3D picture every frame cost frames on phones) */
#menu .cv-card { backdrop-filter: none; -webkit-backdrop-filter: none; background: linear-gradient(180deg, rgba(34,22,60,.80), rgba(20,12,38,.86)); }
.hub, #guide.hub { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(24,16,44,.97); }
.hub .g-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.hub .g-tabs button { white-space: normal; line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
@media (max-height: 560px) and (min-aspect-ratio: 13/10) { .hub { width: min(520px, 72vw); } .hub .g-tabs button { flex-direction: row; } }
html[lang=en] .tier::before { content: "Rating "; } html[lang=ja] .tier::before { content: "評価 "; }
html[lang=en] #over .lbup, html[lang=ja] #over .lbup { white-space: normal; line-height: 1.1; overflow: visible; }
@media (max-height: 360px) and (min-aspect-ratio: 13/10) {
  html[lang=en] .sub, html[lang=ja] .sub { max-height: none; gap: 3px; }
  html[lang=en] .sub span, html[lang=ja] .sub span { font-size: 9.5px; padding: 1px 6px; }
  html[lang=en] .ohead, html[lang=ja] .ohead { gap: 6px; }
}
/* v73: the page itself never moves (in-app browsers: LINE, Threads): pinned, no rubber band, nothing to select */
html, body { position: fixed; inset: 0; width: 100%; overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
input, textarea { -webkit-user-select: text; user-select: text; }
@media (max-height: 360px) and (min-aspect-ratio: 13/10) { html[lang=en] .sub, html[lang=ja] .sub { flex-shrink: 0; } }
@media (max-height: 360px) and (min-aspect-ratio: 13/10) {
  html[lang=en] .grid span, html[lang=ja] .grid span { font-size: 8.5px; line-height: 1.05; }
  html[lang=en] .grid div, html[lang=ja] .grid div { padding: 1px 2px; }
  html[lang=en] .grid, html[lang=ja] .grid { gap: 3px; }
  html[lang=en] .final b, html[lang=ja] .final b { font-size: 30px; }
}
#missions #m-sum { white-space: normal; overflow: visible; overflow-wrap: anywhere; line-height: 1.15; }
/* the panel is as tall as its page (up to the screen): settings is short, how to play / about scroll inside */
.hub { height: auto !important; max-height: calc(var(--app-h, 100vh) - 70px - var(--sat) - var(--sab)); }
@media (max-height: 560px) and (min-aspect-ratio: 13/10) { .hub { max-height: calc(var(--app-h, 100vh) - 62px - var(--sat) - var(--sab)); } }
@media (min-width: 900px) and (min-height: 561px) { .hub { max-height: min(680px, calc(var(--app-h, 100vh) - 90px)); } }
/* phones (upright or sideways): the panel opens in the middle of the screen; computers keep it at the top left */
@media not all and (min-width: 900px) and (min-height: 561px) {
  .hub { left: 50%; top: 50%; translate: -50% -50%; transform-origin: center; width: min(460px, calc(100vw - 24px - var(--sal) - var(--sar))); max-height: calc(var(--app-h, 100vh) - 24px - var(--sat) - var(--sab)); }
  #hub-scrim { background: rgba(8,4,18,.5); z-index: 24; }
  #menu .cv-top { z-index: 2; }
}
@media (max-height: 560px) and (min-aspect-ratio: 13/10) { .hub { width: min(560px, calc(100vw - 24px - var(--sal) - var(--sar))) !important; max-height: calc(var(--app-h, 100vh) - 16px - var(--sat) - var(--sab)) !important; } }
@keyframes hub-in { from { transform: scale(.94); } }
/* v76 phones: the panel is the same size on every page (settings / how to play / about), centred, with a margin
   above and below that clears the status bar and the home bar */
@media not all and (min-width: 900px) and (min-height: 561px) {
  .hub, #guide.hub { translate: none; left: calc(12px + var(--sal)); right: calc(12px + var(--sar)); top: calc(16px + var(--sat)); bottom: calc(16px + var(--sab));
    width: auto; max-width: 460px; height: auto !important; max-height: none !important; margin: auto; }
}
@media (max-height: 560px) and (min-aspect-ratio: 13/10) {
  .hub, #guide.hub { top: calc(10px + var(--sat)); bottom: calc(10px + var(--sab)); max-width: 600px; width: auto !important; max-height: none !important; }
}
/* v78: the panel is sized from the measured visible height (--app-h), not the web view's full height: inside other
   apps (the Claude app, LINE, Threads) the web view runs on under the app's own bottom bar */
@media not all and (min-width: 900px) and (min-height: 561px) {
  .hub, #guide.hub { bottom: auto; height: calc(var(--app-h, 100vh) - 32px - var(--sat) - var(--sab)) !important; }
}
@media (max-height: 560px) and (min-aspect-ratio: 13/10) {
  .hub, #guide.hub { bottom: auto; height: calc(var(--app-h, 100vh) - 20px - var(--sat) - var(--sab)) !important; }
}
#mapsel, #bigmap, #hub-scrim, #dcard { inset: auto; top: 0; left: 0; width: 100%; height: var(--app-h, 100vh); }
/* v79: sideways rows can be dragged with the mouse */
@media (hover: hover) and (pointer: fine) { .coats, .lb-tabs { cursor: grab; } .coats.dragging, .lb-tabs.dragging { cursor: grabbing; } .coats.dragging * , .lb-tabs.dragging * { pointer-events: none; } }
/* v81: slim dark scrollbars everywhere (computers / the desktop app showed the white system ones); the coat row
   hides its bar and fades at the edge instead (drag it, wheel it, or swipe) */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.22) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; background: transparent; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(255,255,255,.38); }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.coats, .lb-tabs { scrollbar-width: none !important; }
.coats::-webkit-scrollbar, .lb-tabs::-webkit-scrollbar { display: none; }
.coats { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); padding-right: 24px; }
/* v85: no live blur behind the cover's panel button either (the 3D picture under it changes every frame) */
.cv-hubbtn { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(28,18,50,.82); }
#debug { left: 50%; transform: translateX(-50%); bottom: auto; top: calc(4px + var(--sat)); text-align: center; max-width: 96vw; font-size: 10.5px; }
/* v90 成就 filter: chips that wrap (never cut, in any language), each with its own count */
.ach-cats { display: flex; flex-wrap: wrap; gap: 5px; margin: 2px 0 10px; }
.ach-cats button { flex: 0 1 auto; display: inline-flex; align-items: baseline; gap: 4px; padding: 5px 9px; border-radius: 999px; background: rgba(255,255,255,.1); color: #fff; font-weight: 900; font-size: 12px; max-width: 100%; }
.ach-cats button span { overflow-wrap: anywhere; }
.ach-cats button small { font-size: 10px; font-weight: 700; opacity: .7; white-space: nowrap; }
.ach-cats button.on { background: var(--yellow); color: #3b2300; }

/* v95 the level / title on the cover */
#menu #cv-lv { color: #ffe9a8; overflow-wrap: anywhere; }
.ach .row[data-title] { cursor: pointer; } .ach .row.ttl { outline: 2px solid var(--yellow); }
/* v95 精華照片 on the result photo: a row of small pictures at its top left */
.shot .hl { position: absolute; top: 6px; left: 6px; display: flex; gap: 5px; z-index: 2; }
.shot .hl img { position: static; inset: auto; width: 52px; height: 39px; object-fit: cover; border: 2px solid rgba(255,255,255,.75); border-radius: 6px; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.shot .hl img.on { border-color: var(--yellow); }
/* v96 結算畫面: the stats are compact (icon + number on one line, the name under it), so the photo gets the room:
   taller, and centred a bit low (where the dog is) so more of the moment shows */
@media (max-aspect-ratio: 5/4) {
  .grid { gap: 4px; }
  .grid div { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: baseline; column-gap: 3px; padding: 3px 2px 2px; border-radius: 8px; }
  .grid i { font-size: 12px; line-height: 1; }
  .grid b { font-size: min(15px, 22cqi); line-height: 1.1; }
  .grid span { flex-basis: 100%; text-align: center; line-height: 1.15; font-size: min(10px, 18cqi); }
  .shot { flex: 1 1 40vh; max-height: 44vh; }
  .shot > img { object-position: 50% 62%; }
}
/* v97: the 安裝成 App pill sits top right; on a sideways screen the card is on the right too, so it starts below the pill
   (no blank band inside the card any more) */
@media (min-aspect-ratio: 5/4) { #menu.cover:has(#btn-install:not(.hidden)) { padding-top: calc(56px + var(--sat)); } }
/* v97: Chinese tile lines break at the spaces (「週日 20:00 / 結算」), not in the middle of a word */
html:not([lang=en]):not([lang=ja]) .cv-tile em { word-break: keep-all; }
/* v99 每週排行榜: the card fits the screen (title, tabs and 關閉 always on it); the names scroll inside it — 10 rows tall,
   down to the top 50. Phones: the map tabs show only their icons. */
.lb-boardcard { display: flex; flex-direction: column; max-height: calc(var(--app-h, 100vh) - 24px - var(--sat) - var(--sab)); overflow: hidden; }
.lb-boardcard > * { flex-shrink: 0; }
.lb-boardcard .lb-board { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.lb-board .lb-scroll { flex: 0 1 auto; min-height: 74px; max-height: calc(10 * 37px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; border-bottom: 1px solid rgba(255,255,255,.07); }
.lb-board > .lb-r, .lb-board > .lb-dim { flex-shrink: 0; }
.lb-r { min-height: 37px; box-sizing: border-box; }
.lb-maps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lb-maps button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.lb-maps button i { font-style: normal; font-size: 18px; line-height: 1; }
@media (max-width: 700px), (max-height: 500px) {
  .lb-maps { grid-template-columns: repeat(6, minmax(0, 1fr)); } .lb-maps button { min-width: 0; padding: 7px 2px; }
  .lb-maps button span { display: none; }
  .lb-maps button i { font-size: 21px; }
}
@media (max-height: 500px) { .lb-boardcard { padding: 10px 14px; } .lb-boardcard h2 { font-size: 16px; margin-bottom: 5px; } .lb-boardcard .lb-dim { margin: 4px 0; line-height: 1.35; } .lb-boardcard .lb-row { margin-top: 6px; } .lb-boardcard .lb-row .mbtn { padding-top: 7px; padding-bottom: 7px; } }
/* v100: the photo is the only thing in the left column that gives way — the title, the line under the photo and the
   score never shrink, so when the screen is tight (iPhone home-screen app, big system fonts) nothing slides under
   the score any more */
.ocol.l > :not(.shot), .ocol.r > * { flex-shrink: 0; }
.shot { min-height: 64px; }
/* the column is never smaller than its title + the smallest photo + the line; the photo grows into whatever is left */
.ocol.l { min-height: auto; }
@media (max-aspect-ratio: 5/4) { .over-card { height: 100%; } .ocol.l { flex: 1 1 auto; } .shot { flex: 1 1 0; max-height: 60vh; } }
/* v102 sideways result card: fitSide() steps these on only when the numbers column doesn't fit */
.over-card.ov-c1 .grid { gap: 3px; }
.over-card.ov-c1 .grid div { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: baseline; column-gap: 3px; padding: 2px 1px; border-radius: 8px; }
.over-card.ov-c1 .grid i { font-size: 12px; } .over-card.ov-c1 .grid b { font-size: min(15px, 22cqi); } .over-card.ov-c1 .grid span { flex-basis: 100%; text-align: center; line-height: 1.15; font-size: min(10px, 18.5cqi); }
.over-card.ov-c1 .ocol { gap: 5px; }
.over-card.ov-c2 .final b { font-size: 30px; } .over-card.ov-c2 .final span { font-size: 13px; }
.over-card.ov-c2 .sub { gap: 3px; } .over-card.ov-c2 .sub span { font-size: 10px; padding: 1px 6px; }
.over-card.ov-c2 .obtns .mbtn.primary, .over-card.ov-c2 #btn-lbup { padding-top: 6px; padding-bottom: 6px; font-size: 15px; }
.over-card.ov-c2 .obtns .row { margin-top: 4px; } .over-card.ov-c2 .obtns .row .mbtn { padding-top: 5px; padding-bottom: 5px; font-size: 11.5px; }
.over-card.ov-c3 .grid div:nth-child(n+9) { display: none; }
.over-card.ov-c4 .grid div:nth-child(n+5) { display: none; }
.over-card.ov-c5 .grid { display: none; }
.over-card.ov-c6 .ocol.r { justify-content: flex-start; overflow-y: auto; overscroll-behavior: contain; }
/* v103 結算按鈕: 再玩一次 on its own, then one row — 分享 · 上傳分數 · 快報 · 選單 — all the same style (存圖 and LINE were
   the same thing as 分享; 分享 lets the phone pick LINE / save the picture). A hidden 上傳 leaves three. */
.obtns { display: block !important; }
.obtns .row { display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
#over .obtns .row .lbup { width: auto; margin: 0; background: rgba(255,255,255,.14); color: #fff; font-weight: 900; font-size: clamp(11px, 3.2vw, 13px); padding-left: 1px; padding-right: 1px; white-space: nowrap; overflow: visible; }
@media (min-aspect-ratio: 13/10) and (max-height: 560px) { #over .obtns .row .lbup { font-size: 11px; } }

/* ---------------------------------------------------------------- v135 多人連線: the menu button and the room panel */
.cv-row { display: flex; gap: 8px; width: 100%; }
.cv-row .cv-map { flex: 1 1 auto; min-width: 0; }
.cv-row .cv-mp { flex: 0 0 auto; width: auto; max-width: 46%; justify-content: center; background: linear-gradient(180deg, rgba(129,199,132,.26), rgba(46,125,50,.16)); border-color: rgba(165,214,167,.4); white-space: nowrap; }
.cv-row .cv-mp span { overflow: hidden; text-overflow: ellipsis; }
.cv-row .cv-mp.on { background: linear-gradient(180deg, rgba(129,199,132,.5), rgba(46,125,50,.35)); border-color: #a5d6a7; }
#mpov { position: fixed; inset: 0; z-index: 56; display: flex; align-items: center; justify-content: center; padding: max(12px, var(--sat)) max(12px, var(--sar)) max(12px, var(--sab)) max(12px, var(--sal));
  background: rgba(20,10,40,.82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font-family: var(--sys); touch-action: pan-y; user-select: text; -webkit-user-select: text; }
#mpov.hidden { display: none; }
#mp-pop { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; width: min(320px, calc(100% - 32px)); padding: 18px 16px 14px; border-radius: 20px; text-align: center; color: #fff;
  background: #1d1236; border: 2px solid #a5d6a7; box-shadow: 0 14px 44px rgba(0,0,0,.6); animation: mppop .18s ease-out; }
#mp-pop.bad { border-color: #ffb74d; }
#mp-pop.hidden { display: none; }
.mp-pop-i { font-size: 34px; line-height: 1.1; }
.mp-pop-t { font-weight: 900; font-size: 15px; line-height: 1.45; margin: 6px 0 8px; overflow-wrap: anywhere; }
.mp-pop-c { display: block; font: 900 28px/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 4px; color: #ffd23f; user-select: all; -webkit-user-select: all; margin-bottom: 10px; }
.mp-pop-ok { width: auto; min-width: 96px; margin: 0 auto; padding: 6px 16px; font-size: 15px; }
#mp-pop.ok .mp-pop-ok { display: none; }
@keyframes mppop { from { transform: translate(-50%, -50%) scale(.9); } to { transform: translate(-50%, -50%) scale(1); } }
.mp-box { width: min(440px, 100%); max-height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 16px 16px; border-radius: 22px; background: linear-gradient(180deg, #2c1a52, #1d1236); border: 1px solid rgba(255,255,255,.16); box-shadow: 0 12px 40px rgba(0,0,0,.45); }
.mp-t { position: relative; text-align: center; font-weight: 900; font-size: 18px; padding: 6px 40px 10px; color: #e9ddff; }
.mp-t small { font-size: 11px; font-weight: 800; color: #1a1030; background: #a5d6a7; border-radius: 8px; padding: 1px 6px; vertical-align: middle; }
.mp-l { display: block; font-size: 13px; font-weight: 700; opacity: .8; margin: 2px 0 4px; }
.mp-in { width: 100%; height: 42px; border-radius: 12px; border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.08); color: #fff; font: 700 16px var(--sys); padding: 0 12px; }
.mp-in::placeholder { color: rgba(255,255,255,.45); }
.mp-sec { margin-top: 12px; padding: 10px 12px; border-radius: 16px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); }
.mp-sec > b { display: block; font-size: 14px; margin-bottom: 8px; }
.mp-maps { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 6px; }
.mp-maps button { min-height: 38px; border-radius: 12px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; font: 700 13.5px/1.2 var(--sys); padding: 4px 6px; overflow-wrap: anywhere; }
.mp-maps button.on { background: rgba(129,199,132,.35); border-color: #a5d6a7; }
.mp-go { font-size: 18px; padding: 10px; margin: 10px 0 2px; }
.mp-join { display: flex; gap: 8px; }
.mp-join .mbtn { width: auto; flex: none; margin: 0; padding: 0 16px; font-size: 16px; }
.mp-codein { text-transform: uppercase; letter-spacing: 3px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.mp-msg { min-height: 1em; margin: 8px 0 0; font-size: 13.5px; font-weight: 700; color: #ffe082; overflow-wrap: anywhere; }
.mp-note { margin: 12px 2px 0; font-size: 12px; line-height: 1.5; opacity: .75; overflow-wrap: anywhere; }
.mp-code { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; padding: 10px; border-radius: 16px; background: rgba(255,255,255,.07); }
.mp-code span { font-size: 13px; opacity: .8; }
.mp-code b { font: 900 30px/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 4px; color: #ffd23f; }
.mp-code .mbtn { width: auto; margin: 0; padding: 6px 12px; font-size: 14px; }
.mp-mapnow { text-align: center; margin: 8px 0 4px; font-weight: 800; font-size: 14px; }
.mp-ppl { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.mp-ppl li { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 12px; background: rgba(255,255,255,.06); min-width: 0; }
.mp-ppl i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.mp-ppl b { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.mp-ppl em { flex: none; font-style: normal; font-size: 12px; opacity: .75; }
.mp-btns { display: flex; gap: 8px; margin-top: 10px; }
.mp-btns .mbtn { margin: 0; font-size: 17px; padding: 11px 8px; }
.mp-btns .mbtn.primary { flex: 1.4; } .mp-btns .mbtn:not(.primary) { flex: 1; }
@media (max-height: 560px) and (min-aspect-ratio: 13/10) { .mp-box { padding: 10px 14px 12px; } .mp-t { padding-bottom: 6px; font-size: 16px; } .mp-sec { margin-top: 8px; padding: 8px 10px; } }
.mp-codein::placeholder { letter-spacing: 0; font-family: var(--sys); }
@media (max-height: 560px) and (min-aspect-ratio: 13/10) { .mp-maps { grid-template-columns: repeat(5, minmax(0, 1fr)); } .mp-maps button { font-size: 12.5px; padding: 4px 3px; } .mp-go { padding: 7px; font-size: 16px; margin-top: 8px; } }

/* ===== v141 衣櫃 redesign: a calm, system-like sheet (bottom sheet on upright phones, a side panel on sideways
   phones and computers, where the dog stands on the left). Quiet translucent material, one accent at a time,
   system font weights, a real on/off switch for 已擁有 that narrows whichever category is picked. ===== */
#closet { --cl-bg: rgba(24,22,32,.80); --cl-bar: rgba(30,28,40,.94); --cl-line: rgba(255,255,255,.08); --cl-fill: rgba(118,118,128,.22);
  --cl-fill2: rgba(118,118,128,.34); --cl-t2: rgba(235,235,245,.62); --cl-t3: rgba(235,235,245,.38); --cl-yel: #ffd60a; --cl-grn: #30d158;
  background: linear-gradient(180deg, rgba(10,8,18,0) 35%, rgba(10,8,18,.45) 100%); font-family: var(--sys); }
#closet .closet-card { width: min(520px, 100%); height: min(62%, 600px); border-radius: 28px; border: 0.5px solid rgba(255,255,255,.14);
  background: var(--cl-bg); -webkit-backdrop-filter: blur(28px) saturate(1.6); backdrop-filter: blur(28px) saturate(1.6);
  box-shadow: 0 24px 60px rgba(0,0,0,.45), inset 0 0.5px 0 rgba(255,255,255,.12); animation: cl-up .42s cubic-bezier(.32,.72,0,1); transform-origin: 50% 100%; }
#closet .closet-card::before { content: ''; flex: none; width: 36px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.22); margin: 7px auto 0; }
/* (scale toward the edge the panel sits on: it never pokes past the screen while it settles) */
@keyframes cl-up { from { transform: scale(.94); } to { transform: none; } }
@keyframes cl-in { from { transform: scale(.94); } to { transform: none; } }
/* header: coins capsule · ✕, then the segmented control */
#closet .chead { padding: 8px 14px 10px; row-gap: 10px; border-bottom: 0.5px solid var(--cl-line); }
#closet .chead .coins { flex: 0 1 auto; padding: 5px 12px; border-radius: 999px; background: var(--cl-fill); color: var(--cl-yel); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .2px; }
#closet .chead .x { margin-left: auto; width: 30px; height: 30px; border-radius: 50%; background: var(--cl-fill); color: var(--cl-t2); font-size: 13px; font-weight: 700; display: grid; place-items: center; transition: background .15s; }
#closet .chead .x:hover { background: var(--cl-fill2); }
#closet .tabs { background: var(--cl-fill); border-radius: 10px; padding: 2px; gap: 0; }
#closet .tabs button { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.88); opacity: 1; padding: 7px 2px; border-radius: 8px; transition: background .2s, color .2s; }
#closet .tabs button.on { background: rgba(255,255,255,.94); color: #111; box-shadow: 0 3px 8px rgba(0,0,0,.18), 0 0 0 0.5px rgba(0,0,0,.04); }
#closet .cbody { padding: 12px 14px 18px; }
/* 毛色 */
#closet .coats { gap: 6px; padding: 0 24px 12px 0; }
#closet .coats > span { font-size: 12px; font-weight: 600; color: var(--cl-t2); opacity: 1; margin-right: 2px; }
#closet .coats button { height: 30px; padding: 0 11px; border: 0; border-radius: 999px; background: var(--cl-fill); font-size: 12.5px; font-weight: 600; color: #fff; gap: 6px; }
#closet .coats button i { width: 14px; height: 14px; border: 0.5px solid rgba(0,0,0,.4); box-shadow: inset 0 0 0 0.5px rgba(255,255,255,.3); }
#closet .coats button.on { background: #fff; color: #111; }
#closet .coats button.lock { opacity: 1; color: var(--cl-t3); }
/* the sticky bar: categories, then count · 只看已擁有 switch */
#closet .wbar { position: sticky; top: -12px; z-index: 2; margin: 0 -14px 12px; padding: 10px 14px 10px; background: var(--cl-bar);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border-bottom: 0.5px solid var(--cl-line); }
#closet .wchips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; touch-action: pan-x;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); padding-right: 22px; }
#closet .wchips::-webkit-scrollbar { display: none; }
#closet .wchips button { flex: none; height: 32px; padding: 0 14px; border-radius: 999px; background: var(--cl-fill); color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; transition: background .18s, color .18s; }
#closet .wchips button:hover { background: var(--cl-fill2); }
#closet .wchips button.on { background: #fff; color: #111; }
#closet .wrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; min-height: 28px; }
#closet .wcount { min-width: 0; font-size: 12.5px; font-weight: 500; color: var(--cl-t2); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.25; }
#closet .own-sw { flex: none; display: flex; align-items: center; gap: 9px; padding: 0; background: none; color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
#closet .own-sw span { white-space: nowrap; }
#closet .own-sw i { position: relative; width: 46px; height: 28px; border-radius: 999px; background: var(--cl-fill2); transition: background .25s; flex: none; }
#closet .own-sw u { position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25), 0 0 0 0.5px rgba(0,0,0,.04); transition: transform .25s cubic-bezier(.32,.72,0,1); }
#closet .own-sw.on i { background: var(--cl-grn); }
#closet .own-sw.on u { transform: translateX(18px); }
#closet .own-sw:focus-visible i, #closet .wchips button:focus-visible, #closet .wear .it:focus-visible { outline: 2px solid #0a84ff; outline-offset: 2px; }
/* the items */
#closet .wear { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
#closet .wear .it { position: relative; gap: 0; padding: 14px 6px 11px; border-radius: 18px; border: 0; background: rgba(255,255,255,.055); box-shadow: inset 0 0 0 0.5px rgba(255,255,255,.07); transition: background .15s, transform .15s, box-shadow .15s; }
#closet .wear .it:hover { background: rgba(255,255,255,.09); }
#closet .wear .it:active { transform: scale(.96); }
#closet .wear .it i { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: rgba(255,255,255,.07); font-size: 30px; line-height: 1; margin-bottom: 8px; }
#closet .wear .it b { font-size: 13px; font-weight: 600; letter-spacing: .1px; }
#closet .wear .it span { font-size: 11px; font-weight: 500; color: var(--cl-t2); opacity: 1; margin-top: 2px; }
#closet .wear .it .rar { position: absolute; top: 7px; left: 9px; font-size: 9.5px; font-weight: 700; letter-spacing: .4px; color: var(--cl-t3); }
#closet .wear .it.r-R .rar { color: #64d2ff; } #closet .wear .it.r-SR .rar { color: #bf5af2; } #closet .wear .it.r-SSR .rar { color: var(--cl-yel); }
#closet .wear .it.r-R, #closet .wear .it.r-SR { border: 0; }
#closet .wear .it.r-SSR { border: 0; background: linear-gradient(180deg, rgba(255,214,10,.10), rgba(255,255,255,.05)); box-shadow: inset 0 0 0 0.5px rgba(255,214,10,.35); }
#closet .wear .it em { margin-top: 7px; font-size: 11.5px; font-weight: 600; color: var(--cl-t2); }
#closet .wear .it em.on { color: var(--cl-grn); } #closet .wear .it em.buy { color: var(--cl-yel); } #closet .wear .it em.lock { color: #ff6961; }
#closet .wear .it em.hw { color: #ff9f0a; } #closet .wear .it em.neon { color: #64d2ff; }
#closet .wear .it.on { background: rgba(48,209,88,.12); box-shadow: inset 0 0 0 2px var(--cl-grn); }
#closet .wear .it.locked { opacity: 1; } #closet .wear .it.locked i { opacity: .5; filter: saturate(.5); }
#closet .wempty { grid-column: 1 / -1; padding: 34px 12px; text-align: center; font-size: 14px; font-weight: 500; color: var(--cl-t2); }
#closet .tip { margin-top: 16px; font-size: 12px; line-height: 1.55; color: var(--cl-t3); opacity: 1; }
/* sideways phones and computers: a full-height panel on the right, the dog on the left */
@media (max-height: 560px) and (min-aspect-ratio: 13/10), (min-width: 900px) and (min-aspect-ratio: 115/100) {
  #closet { justify-content: flex-end; align-items: stretch; background: linear-gradient(90deg, rgba(10,8,18,0) 40%, rgba(10,8,18,.5) 100%); }
  #closet .closet-card { height: 100%; width: clamp(400px, 36vw, 520px); animation-name: cl-in; transform-origin: 100% 50%; }
  #closet .closet-card::before { display: none; }
  #closet .chead { padding-top: 12px; }
}
@media (min-width: 900px) and (min-aspect-ratio: 115/100) {
  #closet { padding: 16px; }
  #closet .wear { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
}
@media (max-height: 560px) and (min-aspect-ratio: 13/10) {
  #closet .closet-card { width: min(460px, 56vw); border-radius: 22px; }
  #closet .chead { padding: 8px 10px; }
  #closet .cbody { padding: 10px 10px 14px; }
  #closet .wbar { top: -10px; margin: 0 -10px 10px; padding: 8px 10px; }
  #closet .wchips button { height: 30px; padding: 0 12px; font-size: 12.5px; }
  #closet .wrow { margin-top: 7px; }
  #closet .wear { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
  #closet .wear .it { padding: 11px 4px 8px; border-radius: 16px; }
  #closet .wear .it i { width: 44px; height: 44px; border-radius: 13px; font-size: 25px; margin-bottom: 6px; }
  #closet .coats { padding-bottom: 8px; }
}
@media (max-width: 360px) { #closet .wear { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; } #closet .own-sw { gap: 6px; font-size: 12px; } }
@media (max-height: 560px) and (min-aspect-ratio: 13/10) {
  /* sideways phone: categories and the switch share one row; the tabs stay one row in every language */
  #closet .wbar { display: flex; align-items: center; gap: 10px; }
  #closet .wchips { flex: 1 1 auto; min-width: 0; }
  #closet .wrow { flex: none; margin-top: 0; min-height: 0; }
  #closet .wcount { display: none; }
  html[lang=en] #closet .tabs, html[lang=ja] #closet .tabs { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  html[lang=en] #closet .tabs button, html[lang=ja] #closet .tabs button { font-size: 10.5px; padding: 5px 1px; }
}
@media (max-height: 560px) and (min-aspect-ratio: 13/10) {
  html[lang=en] #closet .closet-card, html[lang=ja] #closet .closet-card { width: min(500px, 60vw); }
  html[lang=en] #closet .tabs button, html[lang=ja] #closet .tabs button { overflow-wrap: normal; word-break: keep-all; letter-spacing: -.1px; }
}
@media (max-height: 560px) and (min-aspect-ratio: 13/10) {
  /* the switch leads the row (the categories run on to the right, under the fade) */
  #closet .wrow { order: -1; padding-right: 10px; border-right: 0.5px solid var(--cl-line); }
}
@media (max-height: 560px) and (min-aspect-ratio: 13/10) and (max-width: 760px) {
  /* small sideways phones: long English / Japanese tab names take two rows of three */
  html[lang=en] #closet .tabs, html[lang=ja] #closet .tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  html[lang=en] #closet .tabs button, html[lang=ja] #closet .tabs button { font-size: 11px; padding: 4px 2px; }
}

/* ===== v144 更新日誌: a quiet glass button at the bottom left of the cover, a clean list of every version ===== */
.cv-log { position: absolute; z-index: 2; left: calc(12px + var(--sal)); bottom: calc(var(--app-h, 100vh) - var(--cv-card-top, 70vh) + 10px);
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 6px 0 11px; border-radius: 999px; color: #fff; font: 600 13px/1 var(--sys);
  background: rgba(28,18,50,.78); border: 0.5px solid rgba(255,255,255,.22); box-shadow: 0 6px 18px rgba(0,0,0,.22); transition: transform .15s, background .15s; }
.cv-log:active { transform: scale(.95); }
.cv-log svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.cv-log span { white-space: nowrap; }
.cv-log em { font-style: normal; font: 600 11.5px/1 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: .2px; padding: 5px 8px; border-radius: 999px; background: rgba(255,255,255,.16); color: #ffd60a; font-variant-numeric: tabular-nums; }
#log-scrim { position: fixed; inset: 0; z-index: 57; background: rgba(8,6,14,.42); animation: log-fade .2s ease-out; }
#log-scrim.hidden, #logov.hidden { display: none; }
#logov { --lg-t2: rgba(235,235,245,.62); --lg-t3: rgba(235,235,245,.38); --lg-line: rgba(255,255,255,.08); --lg-fill: rgba(118,118,128,.24);
  position: fixed; z-index: 58; left: 0; right: 0; bottom: 0; height: min(78%, 640px); display: flex; flex-direction: column; color: #fff; font-family: var(--sys);
  padding-bottom: var(--sab); border-radius: 26px 26px 0 0; background: rgba(26,22,36,.97); border: 0.5px solid rgba(255,255,255,.12); border-bottom: 0;
  box-shadow: 0 -18px 50px rgba(0,0,0,.45); animation: log-up .38s cubic-bezier(.32,.72,0,1); transform-origin: 50% 100%; }
#logov::before { content: ''; flex: none; width: 36px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.22); margin: 7px auto 0; }
@keyframes log-up { from { transform: scale(.96); } to { transform: none; } }
@keyframes log-fade { from { opacity: 0; } to { opacity: 1; } }
.log-head { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 16px 12px 20px; border-bottom: 0.5px solid var(--lg-line); }
.log-tt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.log-tt b { font-size: 22px; font-weight: 700; letter-spacing: .2px; line-height: 1.2; }
.log-tt small { font-size: 12.5px; font-weight: 500; color: var(--lg-t2); }
.log-x { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--lg-fill); color: var(--lg-t2); transition: background .15s; }
.log-x:hover { background: rgba(118,118,128,.36); }
.log-x svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.log-list { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; list-style: none; margin: 0; padding: 4px 0 14px; }
.log-list li { display: flex; align-items: flex-start; gap: 12px; padding: 11px 20px; position: relative; }
.log-list li + li::before { content: ''; position: absolute; top: 0; left: 76px; right: 0; border-top: 0.5px solid var(--lg-line); }
.log-list .lv { flex: none; width: 44px; margin-top: 1px; text-align: center; padding: 4px 0; border-radius: 8px; background: var(--lg-fill); color: rgba(255,255,255,.86);
  font: 600 12px/1.1 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.log-list li.new .lv { background: #ffd60a; color: #1c1300; }
.log-list .lt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.log-list .lt b { font-size: 14.5px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; color: rgba(255,255,255,.94); }
.log-list li.new .lt b { font-weight: 650; color: #fff; }
.log-list .lt small { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--lg-t3); font-variant-numeric: tabular-nums; }
.log-list .lt em { font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: rgba(48,209,88,.18); color: #30d158; }
.log-x:focus-visible, .cv-log:focus-visible { outline: 2px solid #0a84ff; outline-offset: 2px; }
/* sideways phones and computers: the corner is free (the card is on the right): the button there, the list floating over it */
@media (max-height: 560px) and (min-aspect-ratio: 13/10), (min-width: 900px) and (min-height: 561px) {
  .cv-log { bottom: calc(12px + var(--sab)); }
  #logov { left: calc(12px + var(--sal)); right: auto; bottom: calc(56px + var(--sab)); width: min(420px, calc(100vw - 24px - var(--sal) - var(--sar))); height: auto; max-height: calc(100% - 80px - var(--sab) - var(--sat));
    border-radius: 20px; border-bottom: 0.5px solid rgba(255,255,255,.12); padding-bottom: 0; box-shadow: 0 24px 60px rgba(0,0,0,.5); transform-origin: 0% 100%; }
  #logov::before { display: none; }
  .log-head { padding: 14px 14px 12px 18px; }
  .log-list li { padding: 10px 18px; } .log-list li + li::before { left: 74px; }
}
@media (min-width: 900px) and (min-height: 561px) {
  .cv-log { left: calc(24px + var(--sal)); bottom: calc(24px + var(--sab)); height: 40px; font-size: 14px; padding: 0 7px 0 13px; }
  .cv-log:hover { background: rgba(40,28,66,.86); }
  #logov { left: calc(24px + var(--sal)); bottom: calc(74px + var(--sab)); width: 440px; max-height: min(620px, calc(100% - 110px)); }
  .log-list li:hover { background: rgba(255,255,255,.03); }
}
/* v144: no live blur over the 3D picture behind the closet either (v85's rule for the cover): solid glass instead */
#closet .closet-card { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(28,25,38,.96); }
#closet .wbar { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgb(32,29,43); }
/* v153 排行榜獎勵卡 (leaderboard.js gift): a gold-rimmed card, each board on its own row, the total, a word for the player */
.lb-hot { color: #ff8a65; } .lb-top3 { color: #ffe08a; opacity: 1; }
.lbg-layer { z-index: 70; background: radial-gradient(ellipse at 50% 35%, rgba(70,40,110,.75), rgba(8,4,16,.9)); }
.lbg-card { position: relative; width: min(440px, 94vw); max-height: calc(var(--app-h, 100vh) - 24px - var(--sat, 0px) - var(--sab, 0px)); display: flex; flex-direction: column; overflow: hidden; padding: 0 0 14px; text-align: center;
  background: linear-gradient(180deg, #2e1d4f 0%, #1d1430 46%); border: 1.5px solid rgba(255,208,107,.65); box-shadow: 0 0 0 4px rgba(255,208,107,.08), 0 18px 60px rgba(0,0,0,.6), 0 0 50px rgba(255,190,90,.18); animation: lbg-in .5s cubic-bezier(.2,1.4,.4,1); }
@keyframes lbg-in { from { transform: scale(.82) translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.lbg-card > * { flex-shrink: 0; }
.lbg-top { padding: 16px 18px 8px; background: radial-gradient(ellipse 70% 90% at 50% 0%, rgba(255,208,107,.28), transparent 70%); }
.lbg-cup { font-size: 44px; line-height: 1; filter: drop-shadow(0 0 14px rgba(255,200,90,.7)); animation: lbg-bob 2.4s ease-in-out infinite; }
@keyframes lbg-bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-4px) rotate(4deg); } }
.lbg-card h2 { margin: 6px 0 4px; font-size: 21px; letter-spacing: 1px; background: linear-gradient(90deg, #ffe7a3, #ffb648, #ffe7a3); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lbg-lead { margin: 0; font-size: 13px; line-height: 1.55; opacity: .88; overflow-wrap: anywhere; }
.lbg-list { flex: 0 1 auto; min-height: 56px; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; margin: 6px 14px 0; padding: 2px; text-align: left; }
.lbg-r { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 6px 0; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,208,107,.18); }
.lbg-r > i { flex: none; width: 30px; font-size: 22px; font-style: normal; text-align: center; }
.lbg-t { flex: 1; min-width: 0; } .lbg-t b { display: block; font-size: 14px; overflow-wrap: anywhere; } .lbg-t span { display: block; font-size: 11.5px; opacity: .72; margin-top: 1px; overflow-wrap: anywhere; }
.lbg-v { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.lbg-card em { font-style: normal; font-weight: 900; font-size: 13px; padding: 2px 8px; border-radius: 999px; background: rgba(255,208,107,.16); color: #ffd06b; white-space: nowrap; }
.lbg-card em.tk { background: rgba(140,200,255,.16); color: #9fd4ff; }
.lbg-sum { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 14px 0; padding: 10px 12px; border-radius: 12px; background: linear-gradient(90deg, rgba(255,208,107,.22), rgba(255,160,70,.12)); }
.lbg-sum > span { font-weight: 900; font-size: 15px; letter-spacing: 2px; } .lbg-sum > div { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; } .lbg-sum em { font-size: 15px; }
.lbg-sec { margin: 10px 2px 2px; font-size: 12.5px; font-weight: 900; color: #ffd06b; letter-spacing: 1px; }
.lbg-wish { margin: 12px 14px 0; font-size: 15px; font-weight: 800; color: #ffe08a; overflow-wrap: anywhere; }
.lbg-thx { margin: 4px 14px 0; font-size: 13px; opacity: .85; }
.lbg-card .lb-row { margin: 12px 18px 0; }
@media (max-height: 500px) { .lbg-top { padding: 8px 14px 4px; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; text-align: left; } .lbg-cup { font-size: 30px; grid-row: span 2; } .lbg-card h2 { font-size: 17px; margin: 0; } .lbg-lead { font-size: 12px; } .lbg-r { padding: 5px 8px; margin: 4px 0; } .lbg-wish { margin-top: 6px; font-size: 14px; } .lbg-card .lb-row { margin-top: 6px; } .lbg-sum { margin-top: 6px; padding: 6px 10px; } }
@media (prefers-reduced-motion: reduce) { .lbg-card, .lbg-cup { animation: none; } }

/* ===== v167 扭蛋機的 ! : a round button on each machine opens what it can give (by part, rarity, owned or not; the
   chance of each on one pull). Same calm sheet as the wardrobe: sticky filter bar, item cards, a ✓ on what you own. ===== */
.gacha { position: relative; }
.gacha .ginfo { padding-right: 30px; }
.gp-btn { position: absolute; top: 9px; right: 9px; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; padding: 0;
  background: radial-gradient(circle at 35% 28%, rgba(255,255,255,.55), rgba(255,255,255,0) 46%), linear-gradient(160deg, #ffe066, #ffb300);
  color: #3d2600; font: 800 16px/1 var(--sys, system-ui); letter-spacing: 0; box-shadow: 0 2px 6px rgba(0,0,0,.28), 0 0 0 2px rgba(255,255,255,.85); transition: transform .15s, box-shadow .15s; }
.gp-btn:hover { transform: scale(1.07); box-shadow: 0 3px 10px rgba(0,0,0,.32), 0 0 0 2px #fff; } .gp-btn:active { transform: scale(.94); }
#closet .gp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
#closet .gp-back { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--cl-fill); color: #fff; font-size: 24px; font-weight: 600; line-height: 1; display: grid; place-items: center; padding-bottom: 3px; }
#closet .gp-back:hover { background: var(--cl-fill2); }
#closet .gp-tt { min-width: 0; display: flex; flex-direction: column; }
#closet .gp-tt b { font-size: 16px; font-weight: 700; }
#closet .gp-tt small { font-size: 12px; color: var(--cl-t2); overflow-wrap: anywhere; }
#closet .gp-banners { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; padding: 2px; border-radius: 10px; background: var(--cl-fill); margin-bottom: 4px; }
#closet .gp-banners button { background: transparent; min-width: 0; padding: 7px 2px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,.88); overflow-wrap: anywhere; line-height: 1.2; }
#closet .gp-banners button.on { background: rgba(255,255,255,.94); color: #111; }
#closet .gp-banners button.off:not(.on) { color: var(--cl-t3); }
#closet .gp-bar { display: block; }
#closet .gp-bar .wchips + .wchips { margin-top: 7px; }
#closet .gp-rar button i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
#closet .gp-bar .wrow { display: flex; margin-top: 8px; }
#closet .gp-bar .wcount { display: block; }
#closet .gp-own { flex: none; display: flex; gap: 2px; padding: 2px; border-radius: 9px; background: var(--cl-fill); }
#closet .gp-own button { background: transparent; padding: 5px 10px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,.85); white-space: nowrap; }
#closet .gp-own button.on { background: rgba(255,255,255,.94); color: #111; }
#closet .gp-sec { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 2px; margin: 14px 2px 8px; font-size: 14px; font-weight: 700; }
#closet .gp-sec small { font-size: 11.5px; font-weight: 500; color: var(--cl-t2); overflow-wrap: anywhere; }
#closet .gp-grid .it.locked { cursor: default; }
#closet .gp-grid .it .gp-ok { position: absolute; top: 6px; right: 7px; width: 18px; height: 18px; border-radius: 50%; background: var(--cl-grn); color: #fff; font-size: 11px; font-weight: 800; text-decoration: none; display: grid; place-items: center; }
#closet .gp-grid .it em.gp-p { margin-top: 6px; font-variant-numeric: tabular-nums; color: var(--cl-t2); }
#closet .gp-grid .it.r-SSR em.gp-p { color: var(--cl-yel); }
#closet .gp-btn:focus-visible, #closet .gp-back:focus-visible, #closet .gp-banners button:focus-visible, #closet .gp-own button:focus-visible { outline: 2px solid #0a84ff; outline-offset: 2px; }
@media (max-height: 560px) and (min-aspect-ratio: 13/10) {
  #closet .gp-bar { display: block; }
  #closet .gp-bar .wrow { margin-top: 6px; }
  #closet .gp-bar .wcount { display: block; }
  #closet .gp-head { margin-bottom: 6px; }
}

/* ===== v168 衣櫃: 7 tabs; 毛色 its own page; 圖鑑 sections fold; 成就 redesigned; 🎃 萬聖節 daily quests ===== */
html[lang=en] #closet .tabs, html[lang=ja] #closet .tabs { grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); }
@media (max-height: 560px) and (min-aspect-ratio: 13/10) { html[lang=en] #closet .tabs, html[lang=ja] #closet .tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); } html[lang=en] #closet .tabs button, html[lang=ja] #closet .tabs button { font-size: 10.5px; padding-top: 4px; padding-bottom: 4px; } }
@media (min-width: 900px) and (min-aspect-ratio: 115/100) { html[lang=en] #closet .tabs, html[lang=ja] #closet .tabs { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
#closet .tabs button { padding-left: 1px; padding-right: 1px; }
/* 毛色 */
#closet .ct-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
#closet .ct-head b { display: block; font-size: 16px; font-weight: 700; }
#closet .ct-head small { display: block; font-size: 12px; color: var(--cl-t2); overflow-wrap: anywhere; }
#closet .ct-sw { position: relative; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; flex: none;
  box-shadow: inset 0 -6px 12px rgba(0,0,0,.28), inset 0 4px 8px rgba(255,255,255,.28), 0 0 0 0.5px rgba(255,255,255,.25), 0 4px 10px rgba(0,0,0,.3); }
#closet .ct-sw.big { width: 52px; height: 52px; }
#closet .ct-sw u { text-decoration: none; font-size: 18px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
#closet .coatgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
#closet .ct { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 14px 6px 11px; border-radius: 18px; background: rgba(255,255,255,.055); box-shadow: inset 0 0 0 0.5px rgba(255,255,255,.07); color: #fff; transition: background .15s, transform .15s; }
#closet .ct:hover { background: rgba(255,255,255,.09); } #closet .ct:active { transform: scale(.96); }
#closet .ct .ct-sw { margin-bottom: 6px; }
#closet .ct b { font-size: 13px; font-weight: 600; max-width: 100%; overflow-wrap: anywhere; text-align: center; line-height: 1.2; }
#closet .ct em { font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--cl-t2); text-align: center; overflow-wrap: anywhere; line-height: 1.2; }
#closet .ct em.on { color: var(--cl-grn); } #closet .ct em.need { color: #ffb340; }
#closet .ct small { font-size: 10.5px; color: var(--cl-t3); font-variant-numeric: tabular-nums; }
#closet .ct-bar { width: 80%; height: 4px; border-radius: 2px; background: var(--cl-fill2); overflow: hidden; margin-top: 3px; }
#closet .ct-bar i { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, #ff9f0a, #ffd60a); }
#closet .ct.on { background: rgba(48,209,88,.12); box-shadow: inset 0 0 0 2px var(--cl-grn); }
#closet .ct.lock .ct-sw { filter: saturate(.35) brightness(.7); }
#closet .ct.nope { animation: av-shake .1s linear 4; }
/* 圖鑑: folding sections */
#closet .dx { margin-bottom: 8px; border-radius: 16px; background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 0.5px rgba(255,255,255,.07); overflow: hidden; }
#closet .dx-h { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: none; color: #fff; text-align: left; }
#closet .dx-h span { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 700; overflow-wrap: anywhere; }
#closet .dx-h small { flex: none; padding: 2px 9px; border-radius: 999px; background: var(--cl-fill); font-size: 12px; font-weight: 600; color: var(--cl-t2); font-variant-numeric: tabular-nums; }
#closet .dx-h i { flex: none; font-style: normal; font-size: 20px; line-height: 1; color: var(--cl-t2); transition: transform .25s cubic-bezier(.32,.72,0,1); }
#closet .dx.open .dx-h i { transform: rotate(90deg); }
#closet .dx-h:hover { background: rgba(255,255,255,.04); }
#closet .dx-h:focus-visible { outline: 2px solid #0a84ff; outline-offset: -2px; }
#closet .dx-b { padding: 2px 10px 12px; animation: dx-in .25s ease-out; }
@keyframes dx-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
#closet .dx-tip { font-size: 12px; color: var(--cl-t3); margin: 0 4px 8px; line-height: 1.5; }
#closet .dx-b .dx-tip:last-child { margin: 10px 4px 0; }
/* 成就 */
#closet .ah-top { display: flex; align-items: center; gap: 14px; padding: 12px 14px; margin-bottom: 10px; border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,214,10,.14), rgba(255,159,10,.06)); box-shadow: inset 0 0 0 0.5px rgba(255,214,10,.3); }
#closet .ah-ring { --p: 0; flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(closest-side, rgb(36,33,46) 76%, transparent 78%), conic-gradient(#ffd60a calc(var(--p) * 1%), rgba(255,255,255,.12) 0); }
#closet .ah-ring b { font-size: 15px; font-weight: 800; color: #ffd60a; font-variant-numeric: tabular-nums; }
#closet .ah-sum { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#closet .ah-sum b { font-size: 16px; font-weight: 700; }
#closet .ah-sum span { font-size: 12px; color: var(--cl-t2); overflow-wrap: anywhere; line-height: 1.35; }
#closet .ah-sum .ah-ttl { color: #ffd60a; font-weight: 600; }
#closet .ah-bar .ach-cats { flex-wrap: nowrap; margin: 0; }
#closet .ah-bar .ach-cats button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--cl-fill); color: #fff; font-size: 13px; font-weight: 600; }
#closet .ah-bar .ach-cats button small { font-size: 11px; font-weight: 600; opacity: .65; font-variant-numeric: tabular-nums; }
#closet .ah-bar .ach-cats button.on { background: #fff; color: #111; }
#closet .ach { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 8px; }
#closet .ach .row { opacity: 1; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 16px; background: rgba(255,255,255,.045); box-shadow: inset 0 0 0 0.5px rgba(255,255,255,.06); outline: 0; transition: background .15s, transform .15s; }
#closet .ach .row i { flex: none; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 24px; background: rgba(255,255,255,.06); filter: grayscale(1); opacity: .55; }
#closet .ach .row div { min-width: 0; }
#closet .ach .row b { font-size: 13.5px; font-weight: 700; color: rgba(255,255,255,.75); }
#closet .ach .row span { font-size: 11.5px; color: var(--cl-t3); opacity: 1; line-height: 1.35; margin-top: 1px; }
#closet .ach .row em { flex: none; align-self: center; max-width: 34%; padding: 4px 9px; border-radius: 999px; background: var(--cl-fill); font-size: 11px; font-weight: 700; color: var(--cl-t2); text-align: center; line-height: 1.25; overflow-wrap: anywhere; white-space: normal; }
#closet .ach .row.ok { background: linear-gradient(135deg, rgba(255,214,10,.10), rgba(255,255,255,.04)); box-shadow: inset 0 0 0 0.5px rgba(255,214,10,.28); cursor: pointer; }
#closet .ach .row.ok:hover { background: linear-gradient(135deg, rgba(255,214,10,.16), rgba(255,255,255,.06)); } #closet .ach .row.ok:active { transform: scale(.98); }
#closet .ach .row.ok i { filter: none; opacity: 1; background: linear-gradient(160deg, rgba(255,214,10,.35), rgba(255,159,10,.18)); box-shadow: inset 0 0 0 0.5px rgba(255,214,10,.5); }
#closet .ach .row.ok b { color: #fff; } #closet .ach .row.ok span { color: var(--cl-t2); }
#closet .ach .row.ok em { background: rgba(255,214,10,.16); color: #ffd60a; }
#closet .ach .row.ttl { box-shadow: inset 0 0 0 2px #ffd60a; } #closet .ach .row.ttl em { background: #ffd60a; color: #2a1c00; }
#closet .ach .row.sec i { filter: none; opacity: .7; }
#closet .ach .wempty { grid-column: 1 / -1; }
/* 🎃 萬聖節限定每日任務 */
#closet .hwq { margin: 0 0 6px; padding: 12px; border-radius: 18px; background: linear-gradient(135deg, rgba(255,120,0,.28), rgba(106,27,154,.32)); box-shadow: inset 0 0 0 0.5px rgba(255,159,10,.5); }
#closet .hwq-h { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 2px; margin-bottom: 8px; }
#closet .hwq-h b { font-size: 14.5px; font-weight: 800; color: #ffb340; }
#closet .hwq-h small { font-size: 11.5px; color: var(--cl-t2); }
#closet .hwq .qrow { background: rgba(0,0,0,.22); }
#closet .hwq-f { margin-top: 8px; font-size: 12px; font-weight: 600; color: #ffd60a; overflow-wrap: anywhere; line-height: 1.4; }
#closet .xmq { background: linear-gradient(135deg, rgba(198,40,40,.32), rgba(27,94,32,.36)); box-shadow: inset 0 0 0 0.5px rgba(255,214,120,.5); } /* v346 the Christmas quests */
#closet .xmq .hwq-h b { color: #ffd54f; }
/* v171 裝扮屬性 (chips on the cards), 試穿 (the capsule list), the bonus line on 升級 */
#closet .wear .it span.gsts { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; opacity: 1; white-space: normal; overflow: visible; text-overflow: clip; margin: 3px 0 1px; max-width: 100%; }
#closet .gst { text-decoration: none; font-size: 9.5px; font-weight: 700; line-height: 1.3; padding: 1px 4px; border-radius: 6px; background: rgba(100,210,255,.16); color: #c4f1ff; white-space: nowrap; font-variant-numeric: tabular-nums; }
#closet .wear .it.r-SSR .gst { background: rgba(255,214,10,.16); color: #ffe58a; } #closet .wear .it.r-SR .gst { background: rgba(206,147,216,.2); color: #f0d4f7; }
#closet .gp-grid .it.locked { cursor: pointer; }
#closet .gp-grid .it.trying { opacity: 1; border-color: #ffd60a; background: rgba(255,214,10,.13); box-shadow: 0 0 0 1px rgba(255,214,10,.35) inset; }
#closet .gp-grid .it .gp-try { position: absolute; top: 5px; right: 5px; padding: 1px 5px; border-radius: 6px; background: #ffd60a; color: #2b2100; font-size: 9.5px; font-weight: 800; text-decoration: none; }
#closet .gp-trial { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 8px; margin: 0 0 8px; padding: 8px 10px; border-radius: 12px; background: rgba(40,34,10,.96); border: 1px solid rgba(255,214,10,.45); }
#closet .gp-trial span { flex: 1; min-width: 0; font-size: 12.5px; color: #fff; line-height: 1.35; overflow-wrap: anywhere; }
#closet .gp-trial span b { color: #ffd60a; font-weight: 800; } #closet .gp-trial span small { display: block; font-size: 11px; color: rgba(255,255,255,.7); }
#closet .gp-trial button { flex: none; padding: 6px 12px; border-radius: 9px; background: #ffd60a; color: #2b2100; font-size: 12.5px; font-weight: 800; }
.sk .skg { display: block; margin-top: 2px; font-size: 11px; font-weight: 700; color: #9fe8ff; opacity: 1; }
/* v171 the "?" buttons and their explanation (infotip.js) */
.qmark { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; margin-left: 6px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.55); background: rgba(255,255,255,.1); color: #fff; font: 800 13px/1 var(--sys); vertical-align: middle; cursor: pointer; }
.qmark:hover { background: rgba(255,255,255,.22); }
.itip-ov { position: fixed; inset: 0; z-index: 400; }
.itip-ov.mob { display: grid; place-items: center; padding: 16px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); background: rgba(8,6,16,.55); }
.itip { position: absolute; width: min(340px, calc(100vw - 20px)); max-height: calc(100% - 20px); overflow-y: auto; padding: 14px 16px 14px; border-radius: 16px; background: rgba(28,24,40,.98); border: 1px solid rgba(255,255,255,.16); box-shadow: 0 12px 32px rgba(0,0,0,.45); color: #fff; text-align: left; }
.itip-ov.mob .itip { position: relative; width: min(380px, 100%); max-height: min(78vh, 100%); }
.itip-t { display: block; padding-right: 30px; margin-bottom: 8px; font-size: 15px; font-weight: 800; }
.itip-x { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 13px; font-weight: 800; }
.itip-b { font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.itip-b ul { margin: 0; padding-left: 18px; } .itip-b li { margin: 3px 0; } .itip-b .lb-hot { color: #ff9f43; } .itip-b .lb-top3 { color: #ffd60a; }
.lb-card h2 { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; }
/* v171 封面 icons: a glossy rounded tile per action; the closet's own drawing (a hanger and a capsule) */
.cv-tile i.cvi { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; margin-bottom: 3px; font-size: 21px; box-shadow: 0 4px 10px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.45); }
.cv-tile.daily i.cvi { background: linear-gradient(160deg, #6fd3ff, #2a7fe0); }
.cv-tile.closet i.cvi { background: linear-gradient(160deg, #ffe07a, #ff9f1c); }
.cv-tile.lb i.cvi { background: linear-gradient(160deg, #c9a6ff, #7b4be0); }
.cv-tile i.cvi span { filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); line-height: 1; }
.cv-tile i.cvi svg { width: 30px; height: 30px; overflow: visible; }
/* v180 the closet tile: a little capsule machine with dog ears (glass dome, three jelly-bean capsules, a pink stand with a knob) */
.cv-tile i.cvi svg .gm * { stroke: #5a3300; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.cv-tile i.cvi svg .gm .ear { fill: #c98a5a; }
.cv-tile i.cvi svg .gm .dome { fill: rgba(255,255,255,.88); stroke-width: 1.8; }
.cv-tile i.cvi svg .gm .c1 { fill: #ff6fa5; stroke-width: 1.1; } .cv-tile i.cvi svg .gm .c2 { fill: #5ec8ff; stroke-width: 1.1; } .cv-tile i.cvi svg .gm .c3 { fill: #7ee08a; stroke-width: 1.1; }
.cv-tile i.cvi svg .gm .shine { fill: none; stroke: #fff; stroke-width: 1.8; opacity: .9; }
.cv-tile i.cvi svg .gm .base { fill: #ff4f8b; stroke-width: 1.8; }
.cv-tile i.cvi svg .gm .knob { fill: #fff3c4; } .cv-tile i.cvi svg .gm .bar { stroke-width: 1.6; }
.cv-tile.closet em { color: inherit; opacity: .78; font-weight: 600; }
@media (max-height: 500px) { .cv-tile i.cvi { width: 30px; height: 30px; border-radius: 9px; font-size: 17px; margin-bottom: 1px; } .cv-tile i.cvi svg { width: 24px; height: 24px; } }
@media (min-width: 900px) and (min-height: 600px) { .cv-tile i.cvi { width: 44px; height: 44px; border-radius: 14px; font-size: 24px; } .cv-tile i.cvi svg { width: 34px; height: 34px; } }
.cv-tile i.cvi s { right: -9px; top: -9px; font-size: 14px; }
.ab-age { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 9px 12px; border-radius: 12px; background: rgba(255,82,82,.12); border: 1px solid rgba(255,82,82,.45); }
.ab-age b { flex: none; display: grid; place-items: center; min-width: 42px; height: 30px; padding: 0 6px; border-radius: 8px; background: #e53935; color: #fff; font-size: 15px; font-weight: 900; }
.ab-age span { min-width: 0; font-size: 13.5px; font-weight: 800; overflow-wrap: anywhere; line-height: 1.35; }
/* v172 大講堂: the play's lines (scen_school.js), while the dog is in the hall */
#stage-sub { position: fixed; left: 50%; bottom: calc(62px + env(safe-area-inset-bottom)); transform: translate(-50%, 8px); z-index: 30; max-width: min(620px, 56vw); padding: 8px 16px 9px; border-radius: 14px;
  background: rgba(36,10,18,.82); border: 1px solid rgba(243,210,122,.55); color: #fff6dc; font: 700 14.5px/1.45 var(--sys); text-align: center; overflow-wrap: anywhere; pointer-events: none; opacity: 0; transition: opacity .25s, transform .25s; }
#stage-sub.on { opacity: 1; transform: translate(-50%, 0); }
/* v175 the plays: the speaker's name (their colour), the narrator in grey italics, an act's caption in gold */
#stage-sub .sn { display: inline-block; margin-right: 6px; padding: 0 7px; border-radius: 8px; background: rgba(0,0,0,.35); font-weight: 900; }
#stage-sub .sn::after { content: ''; }
#stage-sub.nar span { font-style: italic; color: #e0d6c8; font-weight: 600; }
#stage-sub.cap { background: rgba(60,30,6,.86); border-color: #f3d27a; color: #f3d27a; font-size: 1.12em; letter-spacing: .06em; }
@media (orientation: portrait) { #stage-sub { bottom: auto; top: calc(118px + env(safe-area-inset-top)); max-width: calc(100vw - 32px); width: max-content; font-size: 13.5px; } }
/* v174 an item drawn as SVG on its card (the smoking lollipop) */
#closet .ico-svg { width: 1.15em; height: 1.15em; vertical-align: -0.15em; }
/* v174 a locked achievement's hint (infotip) */
#closet .ach .row[data-ahint] { cursor: pointer; } #closet .ach .row[data-ahint] > i { cursor: pointer; }
.itip-b p { margin: 0 0 6px; } .itip-b p b { display: inline-block; min-width: 3.2em; margin-right: 6px; color: #ffd60a; font-weight: 800; }
.itip-b .ah-goal { font-weight: 700; } .itip-b .ah-rw { margin-top: 8px; color: rgba(255,255,255,.75); font-size: 12px; } .itip-b .ah-tip { color: rgba(255,255,255,.8); }

/* v180: someone off the screen is about to swing: that edge glows red (--ea: its direction, 0 = ahead, 90deg = right) */
#edgehit { position: fixed; inset: 0; pointer-events: none; z-index: 30; opacity: 0; background: conic-gradient(from calc(var(--ea, 180deg) - 55deg) at 50% 50%, rgba(255,30,30,0) 0deg, rgba(255,30,30,.6) 55deg, rgba(255,30,30,0) 110deg, rgba(255,30,30,0) 360deg); -webkit-mask: radial-gradient(ellipse at center, transparent 55%, #000 100%); mask: radial-gradient(ellipse at center, transparent 55%, #000 100%); }
#edgehit.on { animation: edgehit .9s ease-out; }
@keyframes edgehit { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }
#closet .gst.gx { background: rgba(255,90,140,.22); color: #ffc1d6; font-weight: 900; } /* v180: a piece on several slots: its bonuses × that many */

/* v180 ☁️ 雲端存檔 */
#cloudov { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(0,0,0,.55); padding: 16px; }
#cloudov.hidden { display: none; }
#cloudov .cl-card { width: min(420px, 100%); max-height: 92vh; overflow-y: auto; border-radius: 18px; background: linear-gradient(180deg, #2a2340, #1c1830); color: #fff; box-shadow: 0 12px 40px rgba(0,0,0,.5); padding: 14px 16px 16px; }
#cloudov .cl-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
#cloudov .cl-head b { font-size: 17px; }
#cloudov .cl-x { background: rgba(255,255,255,.1); color: #fff; border-radius: 10px; width: 34px; height: 34px; flex: none; }
#cloudov p { font-size: 13.5px; line-height: 1.55; margin: 6px 0; overflow-wrap: anywhere; }
#cloudov .cl-sub { opacity: .7; font-size: 12px; }
#cloudov .cl-code { font: 900 30px/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 3px; text-align: center; padding: 10px; margin: 8px 0; border-radius: 12px; background: rgba(255,214,10,.12); color: #ffe58a; user-select: all; -webkit-user-select: all; }
#cloudov .cl-in { display: block; width: 100%; box-sizing: border-box; margin: 6px 0; padding: 10px 12px; border-radius: 10px; border: 2px solid rgba(255,255,255,.18); background: rgba(0,0,0,.25); color: #fff; font-size: 16px; }
#cloudov .cl-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
#cloudov .cl-btns .mbtn { flex: 1 1 140px; margin: 0; }
#cloudov .cl-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
#cloudov .cl-side { min-width: 0; border-radius: 12px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); padding: 10px; }
#cloudov .cl-st { font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
#cloudov .cl-lv { font-size: 22px; font-weight: 800; color: #ffd54f; margin: 2px 0 4px; }
#cloudov .cl-side dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; margin: 0; font-size: 12.5px; }
#cloudov .cl-side dt { opacity: .7; white-space: nowrap; }
#cloudov .cl-side dd { margin: 0; text-align: right; font-weight: 700; overflow-wrap: anywhere; min-width: 0; }
#cloudov .cl-pick .mbtn { margin: 0; width: 100%; min-width: 0; white-space: normal; }
#cloudov .cl-warn { font-size: 12px; color: #ffcc80; margin: 8px 0 0; }
#cloudov .cl-msg { min-height: 1.4em; color: #9fe8b4; } #cloudov .cl-msg.bad { color: #ff9a9a; }
.opt .cl-open { margin: 0; padding: 6px 12px; font-size: 13px; }
/* v185 the concert's words (a song with a .lrc) */
#lyric { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 6px); z-index: 30; max-width: min(680px, 70vw); padding: 6px 16px 7px; border-radius: 14px;
  background: rgba(20,8,30,.6); color: #fff; font: 800 16px/1.4 var(--sys); text-align: center; text-shadow: 0 0 8px rgba(255,111,174,.8); pointer-events: none; opacity: 0; transition: opacity .3s, transform .3s; overflow-wrap: anywhere; }
#lyric.on { opacity: 1; transform: translate(-50%, 0); }
@media (orientation: portrait) { #lyric { bottom: auto; top: calc(160px + env(safe-area-inset-top)); max-width: calc(100vw - 32px); font-size: 14px; } }
/* v186 an error, on the screen (a phone has no console): tap to hide */
#errbar { position: fixed; left: 8px; right: 8px; top: calc(8px + env(safe-area-inset-top)); z-index: 90; padding: 8px 12px; border-radius: 10px; background: rgba(120,10,20,.92); color: #fff; font: 600 12px/1.4 var(--sys); display: none; overflow-wrap: anywhere; }
#errbar.on { display: block; }

/* v222 one row under the categories: the rarities (scroll sideways) · 已擁有 / 未擁有 (the closet and a machine's list) */
#closet .frow { justify-content: flex-start; gap: 8px; }
#closet .frow .rarc { flex: 1 1 auto; min-width: 0; gap: 5px; }
#closet .rarc button { height: 30px; padding: 0 11px; font-size: 12.5px; }
#closet .rarc button i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
#closet .ownseg { flex: none; display: flex; gap: 2px; padding: 2px; border-radius: 9px; background: var(--cl-fill); }
#closet .ownseg button { background: transparent; padding: 5px 9px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,.85); white-space: nowrap; }
#closet .ownseg button.on { background: rgba(255,255,255,.94); color: #111; }
#closet .ownseg button:focus-visible { outline: 2px solid #0a84ff; outline-offset: 2px; }
@media (max-width: 360px) { #closet .ownseg button { padding: 5px 7px; font-size: 12px; } #closet .rarc button { padding: 0 9px; } }
@media (max-height: 560px) and (min-aspect-ratio: 13/10) {
  /* sideways: the categories and this row side by side, half each */
  #closet .wbar:not(.gp-bar) > .wchips { flex: 1 1 45%; }
  #closet .wbar:not(.gp-bar) > .frow { flex: 1 1 55%; min-width: 0; order: 0; padding-right: 0; border-right: 0; }
  #closet .rarc button { height: 28px; padding: 0 9px; }
}
#closet .own-sw.sw2 { gap: 6px; font-size: 12.5px; }
#closet .own-sw.sw2 span { color: var(--cl-t3); transition: color .2s; }
#closet .own-sw.sw2 span.cur { color: #fff; }
#closet .own-sw.sw2 i { background: var(--cl-fill2); }
#closet .own-sw.sw2.on i { background: var(--cl-grn); }
@media (max-width: 360px) { #closet .own-sw.sw2 { gap: 4px; font-size: 11.5px; } #closet .own-sw.sw2 i { width: 40px; height: 24px; } #closet .own-sw.sw2 u { width: 20px; height: 20px; } #closet .own-sw.sw2.on u { transform: translateX(16px); } }

/* v223 the computer (keyboard + mouse, a big window): the HUD a size up so it reads from arm's length; the round
   buttons smaller and quieter, each with its key on it; the key hints as key caps; the closet a little wider */
@media (min-width: 1100px) and (min-height: 680px) {
  body.pc #card, body.pc #topright { zoom: 1.22; }
  body.pc #controls { zoom: .82; opacity: .9; }
  body.pc #controls .cbtn::after { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); padding: 2px 7px; border-radius: 6px; background: rgba(12,10,22,.82); border: 1px solid rgba(255,255,255,.3); box-shadow: 0 2px 0 rgba(255,255,255,.12); color: #fff; font: 700 11px/1.3 system-ui, sans-serif; letter-spacing: .3px; white-space: nowrap; }
  body.pc #btn-action::after { content: 'Space'; }
  body.pc #btn-sprint::after { content: 'Shift'; }
  body.pc #btn-lie::after { content: 'C'; }
  body.pc #keyhint { opacity: 1; font-size: 12.5px; padding: 6px 14px; border-radius: 12px; background: rgba(14,12,26,.55); border: 1px solid rgba(255,255,255,.12); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: rgba(255,255,255,.88); }
  body.pc #keyhint kbd { display: inline-block; min-width: 18px; padding: 1px 6px; margin: 0 2px; border-radius: 5px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); border-bottom-width: 2px; font: 700 11.5px/1.35 system-ui, sans-serif; color: #fff; text-align: center; }
}
@media (min-width: 1500px) and (min-height: 820px) {
  body.pc #card, body.pc #topright { zoom: 1.38; }
  body.pc #controls { zoom: .9; }
  body.pc #closet .closet-card { width: clamp(520px, 34vw, 640px); }
  body.pc #closet .wear { grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); }
}

/* v252 攻略書庫: the guide site in the panel (an iframe, loaded the first time the tab opens), and a way out to a new tab */
.hub-page[data-p="tips"] { display: flex; flex-direction: column; overflow: hidden; padding: 10px 12px 12px; gap: 6px; flex: 1 1 2000px; } /* (the panel sizes to its page: this one takes all the room it may) */
.tips-bar { display: flex; align-items: center; gap: 8px; }
.tips-t { font: 800 14px/1.2 var(--sys); color: #fff; }
.tips-note { margin: 0; font: 600 11.5px/1.3 var(--sys); color: rgba(255,255,255,.6); }
#tips-if { flex: 1; min-height: 0; width: 100%; border: 0; border-radius: 14px; background: #fff; }
.tips-ext { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.12); color: #fff; }
.tips-ext svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tips-ext:hover { background: rgba(255,255,255,.22); }
/* v256 landscape phone: the coins capsule never shrinks (🦴 840 · 🎟️2 was cut by a few px); the tabs give the room */
@media (max-height: 560px) and (min-aspect-ratio: 13/10) { #closet .chead .coins { flex: none; padding: 5px 10px; } #closet .chead .tabs { min-width: 0; } }
/* v260 four capsule machines: two rows of two on narrow screens (nothing cut) */
@media (max-width: 560px) { .banners { flex-wrap: wrap; } .banners button { flex: 1 1 calc(50% - 6px); } #closet .gp-banners { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
a.mumi-artist { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; padding: 3px 9px 3px 4px; border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; font-size: 12px; font-weight: 700; text-decoration: none; vertical-align: middle; } /* v262 the 喵姆 artist's Threads link */
a.mumi-artist svg { width: 18px; height: 18px; flex: none; }
a.mumi-artist:hover, a.mumi-artist:focus-visible { background: rgba(255,255,255,.22); outline: none; }
/* v269 the wardrobe: 全部脫掉 (a small round button at the top left of the free part of the screen); the dog area can be dragged */
#closet .closet-strip { position: absolute; top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); width: 44px; height: 44px; border-radius: 50%; border: 0.5px solid rgba(255,255,255,.3); background: rgba(24,22,32,.72); display: none; align-items: center; justify-content: center; padding: 0; box-shadow: 0 4px 14px rgba(0,0,0,.35); cursor: pointer; z-index: 3; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
#closet .closet-strip.on { display: flex; }
#closet .closet-strip svg { width: 28px; height: 28px; }
#closet .closet-strip:active { transform: scale(.92); }
#closet:not(.ingame) { cursor: grab; } #closet .closet-card { cursor: auto; }
/* v284 我的最愛搭配 · 🍀 clover machine & shop · the street duels and the big dog */
.banners { flex-wrap: wrap; }
.banners button { min-width: calc(33% - 6px); }
.favh { font-weight: 900; font-size: 13px; color: var(--yellow); margin: 2px 2px 6px; }
.favs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.fav { background: rgba(255,255,255,.08); border-radius: 12px; padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; border: 2px solid rgba(255,210,63,.35); }
.fav.empty { border-style: dashed; border-color: rgba(255,255,255,.2); }
.fav-top { display: flex; gap: 3px; align-items: center; }
.fav-top input { flex: 1; min-width: 0; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.15); border-radius: 8px; color: #fff; font-weight: 800; font-size: 12px; padding: 4px 6px; }
.fav-top input:disabled { opacity: .6; }
.fav-ed { background: none; border: 0; font-size: 13px; padding: 2px; }
.fav-ico { font-size: 16px; min-height: 22px; text-align: center; color: rgba(255,255,255,.6); font-size: 12px; line-height: 22px; white-space: nowrap; overflow: hidden; }
.fav-b { display: flex; flex-direction: column; gap: 4px; }
.fav-b .mbtn { flex: 1; padding: 6px 2px; font-size: 11px; min-width: 0; }
.cshop { margin-top: 10px; background: rgba(76,175,80,.14); border: 2px solid rgba(124,255,178,.35); border-radius: 14px; padding: 8px; }
.cshop-h { font-size: 13px; font-weight: 800; margin-bottom: 6px; }
.cshop-h b { color: #7cffb2; font-size: 16px; }
.cshop-r { display: flex; gap: 6px; flex-wrap: wrap; }
.cshop-r .mbtn { flex: 1; min-width: 30%; font-size: 12px; }
.cshop-r .mbtn em { display: block; font-style: normal; font-size: 11px; opacity: .85; }
.gacha.clover .machine .dome { background: radial-gradient(circle at 35% 30%, rgba(200,255,210,.55), rgba(76,175,80,.35)); }
.duel-ui { position: fixed; left: 50%; top: 14%; transform: translateX(-50%); z-index: 40; width: min(92vw, 420px); background: rgba(20,24,40,.88); border: 3px solid var(--yellow); border-radius: 18px; padding: 10px 12px; color: #fff; text-align: center; pointer-events: none; font-weight: 800; }
.duel-ui.boss { border-color: #ff5a5a; box-shadow: 0 0 24px rgba(255,80,80,.45); }
.duel-ui h3 { margin: 0 0 4px; font-size: 16px; }
.duel-ui .dsub { font-size: 12px; opacity: .85; margin-bottom: 6px; }
.duel-ui .dbar { position: relative; height: 16px; border-radius: 9px; background: rgba(255,255,255,.12); overflow: hidden; margin: 4px 0; }
.duel-ui .dbar i { position: absolute; top: 0; bottom: 0; left: 0; background: linear-gradient(90deg, #7cffb2, #3ddc84); }
.duel-ui .dbar.them i { background: linear-gradient(90deg, #ff8a80, #ff5252); }
.duel-ui .dbar.tug { background: linear-gradient(90deg, rgba(255,82,82,.35) 50%, rgba(61,220,132,.35) 50%); }
.duel-ui .dbar.tug b { position: absolute; top: -2px; width: 8px; height: 20px; margin-left: -4px; background: #ffd23f; border-radius: 4px; }
.duel-ui .drow { display: flex; justify-content: space-between; font-size: 13px; }
.duel-ui .dbeats { display: flex; justify-content: center; gap: 8px; margin: 6px 0; }
.duel-ui .dbeats i { width: 26px; height: 26px; border-radius: 50%; border: 3px solid rgba(255,255,255,.4); }
.duel-ui .dbeats i.now { border-color: #ffd23f; background: rgba(255,210,63,.35); }
.duel-ui .dbeats i.hit { background: #3ddc84; border-color: #3ddc84; }
.duel-ui .dbeats i.miss { background: #ff5252; border-color: #ff5252; }
.duel-ui .dhp { font-size: 18px; letter-spacing: 2px; }
.duel-ui .dtime { font-size: 12px; opacity: .8; }
.gacha.clover { background: linear-gradient(135deg, rgba(124,255,178,.22), rgba(46,125,50,.34)); }
.gacha.clover .machine .body { background: linear-gradient(180deg, #7cffb2, #2e7d32); }
/* v285 ⭐ starred pieces · 👗 outfit slots · 🎒 the pocket */
#closet-body .it, #closet-body .cap { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#closet-body .it { position: relative; }
#closet-body .it .fstar { position: absolute; top: 4px; right: 6px; text-decoration: none; font-size: 14px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
#closet-body .it .idesc { display: block; font-size: 10.5px; line-height: 1.3; color: #ffe08a; margin: 2px 0; }
.fav.buy { align-items: center; justify-content: center; text-align: center; color: #fff; font-weight: 900; border-style: dashed; border-color: rgba(255,210,63,.6); background: rgba(255,210,63,.08); min-height: 120px; }
.fav.buy b { font-size: 24px; line-height: 1; }
.fav.buy span { font-size: 12px; }
.fav.buy em { font-style: normal; font-size: 12px; color: var(--yellow); }
.favnote { font-size: 11px; opacity: .7; margin: -4px 2px 10px; }
.pocket { display: flex; flex-direction: column; gap: 6px; }
.pk-r { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.08); border-radius: 12px; padding: 8px 10px; }
.pk-r i { font-style: normal; font-size: 24px; width: 30px; text-align: center; }
.pk-r div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pk-r b { font-size: 14px; }
.pk-r span { font-size: 11px; opacity: .75; }
.pk-r em { font-style: normal; font-weight: 900; font-size: 18px; color: var(--yellow); }
.cshop-r .mbtn.owned { opacity: .55; }
.pgrid .pp { background: linear-gradient(180deg, #5fd38a, #2e9b5a); border-color: #b9f5cf; }
#closet.ingame[data-tab="pocket"] .tabs button[data-t="skill"] { display: none; } #closet.ingame[data-tab="pocket"] .tabs button[data-t="pocket"] { display: inline-block; }

.tcol { display: flex; flex-direction: column; gap: 6px; }
#btn-pocket { pointer-events: auto; width: 32px; height: 32px; border-radius: 10px; font-size: 15px; padding: 0; position: relative; }
#btn-pocket i { position: absolute; right: -6px; bottom: -6px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; background: #3ddc84; color: #08321a; font-style: normal; font-weight: 900; font-size: 10px; line-height: 16px; }
#btn-pocket i:empty { display: none; }
.pk-r span.say { color: #ffe08a; opacity: 1; }
/* v285 eight tabs: the row scrolls sideways when it can't fit them all (each keeps its whole word) */
#closet .tabs { min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; touch-action: pan-x; }
#closet .tabs::-webkit-scrollbar { display: none; }
#closet .tabs button { flex: 1 0 auto; overflow: visible; text-overflow: clip; padding-left: 6px; padding-right: 6px; }
@media (max-height: 560px) and (min-aspect-ratio: 13/10) {
  /* v285: eight tabs don't fit beside the coins and ✕: they get a row of their own */
  #closet .chead { flex-wrap: wrap; row-gap: 6px; }
  #closet .chead .tabs { order: 3; flex: 1 1 100%; }
  #closet .chead .coins { flex: 1 1 auto; }
  #closet .tabs button { flex: 1 1 0; font-size: 12.5px; padding: 5px 1px; }
}

/* v286 the 7-day login rewards */
.login7 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 8px 0 4px; }
.l7 { position: relative; background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.12); border-radius: 10px; padding: 4px 2px 5px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; }
.l7 small { font-size: 10px; opacity: .75; }
.l7 i { font-style: normal; font-size: 20px; line-height: 1.2; }
.l7 span { font-size: 10px; line-height: 1.2; font-weight: 800; overflow-wrap: anywhere; }
.l7.big { border-color: rgba(124,255,178,.5); background: rgba(76,175,80,.16); }
.l7.got { opacity: .55; }
.l7.now { opacity: 1; border-color: var(--yellow); box-shadow: 0 0 10px rgba(255,210,63,.5); }
.l7 u { position: absolute; top: 2px; right: 4px; text-decoration: none; color: #3ddc84; font-weight: 900; font-size: 13px; }
.l7:nth-child(7) { grid-column: span 2; }
.l7note { font-size: 11px; opacity: .75; margin: 2px 0 6px; text-align: center; }
#bless .lb-card { max-height: calc(100vh - 16px); overflow-y: auto; }
@media (max-height: 500px) {
  .login7 { grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 4px 0 2px; }
  .l7:nth-child(7) { grid-column: auto; }
  .l7 i { font-size: 16px; }
  #bless .lbg-top .lbg-lead { margin: 2px 0; }
  .l7note { margin: 0 0 4px; }
}
/* v288 🍀 the clover event card */
.ev-layer { position: fixed; inset: 0; z-index: 75; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; background: rgba(8,4,16,0); backdrop-filter: blur(0); transition: background .25s ease, backdrop-filter .25s ease; }
.ev-layer.show { display: flex; }
.ev-layer.in { background: rgba(8,4,16,.66); backdrop-filter: blur(3px); }
.ev-card { width: min(420px, 92vw); max-height: calc(var(--app-h, 100vh) - 110px); display: flex; flex-direction: column; background: #ff7eb6; border-radius: 18px; padding: 10px; box-shadow: 0 14px 40px rgba(0,0,0,.45); transform: scale(.82) translateY(14px); opacity: 0; transition: transform .28s cubic-bezier(.2,1.4,.4,1), opacity .2s ease; }
.ev-layer.in .ev-card { transform: none; opacity: 1; }
.ev-layer.out .ev-card { transform: scale(.88) translateY(10px); opacity: 0; transition: transform .2s ease-in, opacity .2s ease-in; }
.ev-card.flip { animation: evflip .26s ease; }
@keyframes evflip { 0% { opacity: .2; transform: rotateY(12deg) scale(.97); } 100% { opacity: 1; transform: none; } }
.ev-title { align-self: center; margin: 2px 0 8px; padding: 5px 22px; border-radius: 999px; background: #fff; color: #222; font-weight: 900; font-size: 19px; box-shadow: 0 2px 0 rgba(0,0,0,.08); }
.ev-panel { background: #fff5fa; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; overflow-y: auto; min-height: 0; color: #2b2033; }
.ev-img { width: min(200px, 46vw); aspect-ratio: 1; border-radius: 12px; object-fit: cover; box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.ev-call { margin: 2px 0; padding: 6px 16px; border-radius: 16px; background: #fff; font-weight: 900; font-size: 19px; line-height: 1.35; text-align: center; color: #1e1e1e; box-shadow: 0 2px 8px rgba(255,126,182,.25); }
.ev-more { padding: 7px 18px; border-radius: 999px; background: linear-gradient(180deg, #ff9cc8, #ff6fae); color: #fff; font-weight: 900; font-size: 14px; border: 2px solid #fff; box-shadow: 0 3px 0 #d94c8d; transition: transform .1s; }
.ev-more:active { transform: translateY(2px); box-shadow: 0 1px 0 #d94c8d; }
.ev-detail { align-items: stretch; text-align: left; }
.ev-detail h4 { margin: 4px 0 0; font-size: 15px; color: #d94c8d; }
.ev-detail ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.5; }
.ev-detail .ev-more { align-self: center; margin-top: 6px; }
.ev-x { width: 54px; height: 54px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff6b6b, #e02424); border: 3px solid #fff; box-shadow: 0 6px 16px rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; padding: 0; transform: scale(0) rotate(-90deg); transition: transform .32s cubic-bezier(.2,1.5,.4,1) .08s, box-shadow .15s; }
.ev-x svg { width: 26px; height: 26px; stroke: #fff; stroke-width: 3.6; stroke-linecap: round; fill: none; }
.ev-layer.in .ev-x { transform: none; }
.ev-layer.out .ev-x { transform: scale(0) rotate(90deg); transition: transform .2s ease-in; }
.ev-x:active { transform: scale(.9); }
.ev-hint { position: fixed; z-index: 76; max-width: 260px; padding: 8px 12px; border-radius: 12px; background: #fff; color: #2b2033; font-weight: 800; font-size: 13px; box-shadow: 0 6px 18px rgba(0,0,0,.35); opacity: 0; transform: translateY(-6px); transition: opacity .25s, transform .25s; }
.ev-hint::before { content: ''; position: absolute; top: -7px; left: 18px; border: 7px solid transparent; border-top: 0; border-bottom-color: #fff; }
.ev-hint.in { opacity: 1; transform: none; }
.ev-ping { animation: evping 1s ease-out 4; }
@keyframes evping { 0% { box-shadow: 0 0 0 0 rgba(124,255,178,.8); } 100% { box-shadow: 0 0 0 14px rgba(124,255,178,0); } }
@media (max-height: 500px) { .ev-img { width: min(130px, 30vh); } .ev-call { font-size: 16px; } .ev-x { width: 44px; height: 44px; } .ev-layer { gap: 8px; } .ev-card { max-height: calc(var(--app-h, 100vh) - 80px); } }
@media (prefers-reduced-motion: reduce) { .ev-card, .ev-x, .ev-layer { transition: none; } .ev-card.flip, .ev-ping { animation: none; } }
/* v293 🍀 the clover exchange like the closet: cards, try-on, a trade-or-just-try panel */
.cshop-h small { margin-left: 8px; font-size: 11px; font-weight: 700; opacity: .7; }
.cshop-w { grid-template-columns: repeat(3, 1fr); }
.cshop-w .it { position: relative; }
.cshop-w .it.trying { border-color: #7cffb2; box-shadow: 0 0 0 2px rgba(124,255,178,.35) inset; }
.cshop-w .it .gp-try { position: absolute; top: 3px; right: 4px; font-size: 10px; font-weight: 900; text-decoration: none; color: #0b3b22; background: #7cffb2; border-radius: 6px; padding: 0 4px; }
.cbuy { margin-top: 8px; padding: 10px; border-radius: 14px; background: rgba(10,30,18,.85); border: 2px solid #7cffb2; animation: cbuyin .22s cubic-bezier(.2,1.4,.4,1); }
@keyframes cbuyin { 0% { opacity: 0; transform: translateY(8px) scale(.96); } 100% { opacity: 1; transform: none; } }
.cbuy-t { display: flex; align-items: center; gap: 10px; }
.cbuy-t i { font-style: normal; font-size: 32px; }
.cbuy-t b { display: block; font-size: 14px; }
.cbuy-t span { display: block; font-size: 11px; opacity: .75; line-height: 1.35; }
.cbuy-q { margin: 8px 0; font-size: 13px; font-weight: 800; }
.cbuy-q b { color: #7cffb2; }
.cbuy-b { display: flex; gap: 8px; }
.cbuy-b .mbtn { flex: 1; font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .cbuy { animation: none; } }
/* v297 the 7-day login grid redone: in a soft panel with room round it (never against the card's edges), days 1-6 in
   two rows of three, day 7 (the big one) a wide card of its own under them; landscape: all seven in one row; a clear
   gap down to the note under it */
.login7 { grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 8px 10px; padding: 8px; border-radius: 14px; background: rgba(0,0,0,.18); }
.l7 { padding: 6px 4px 7px; gap: 2px; border-radius: 12px; min-height: 74px; justify-content: flex-start; }
.l7 i { font-size: 22px; }
.l7 span { font-size: 11px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: keep-all; overflow-wrap: anywhere; }
.l7 u { top: 3px; right: 6px; }
.l7:nth-child(7) { grid-column: auto; }
.l7.d7 { grid-column: 1 / -1; min-height: 0; flex-direction: row; justify-content: center; gap: 10px; padding: 8px 12px; }
.l7.d7 i { font-size: 26px; }
.l7.d7 span { font-size: 13px; }
.l7.d7 small { font-size: 11px; }
.l7note { margin: 0 6px 10px; line-height: 1.45; }
@media (orientation: landscape) and (max-height: 500px) {
  .login7 { grid-template-columns: repeat(7, 1fr); gap: 5px; margin: 6px 4px 8px; padding: 6px; }
  .l7 { min-height: 64px; padding: 4px 3px 5px; }
  .l7 i { font-size: 17px; }
  .l7 span { font-size: 9.5px; }
  .l7 small { font-size: 9.5px; }
  .l7 u { top: 1px; right: 3px; font-size: 11px; }
  .l7.d7 { grid-column: auto; flex-direction: column; gap: 2px; padding: 4px 3px 5px; min-height: 64px; justify-content: flex-start; }
  .l7.d7 i { font-size: 17px; } .l7.d7 span { font-size: 9.5px; } .l7.d7 small { font-size: 9.5px; }
  .l7note { margin: 0 6px 8px; }
}
/* v301 🎁 the login rewards card, after the player's sketch: a pink frame, black pills, a white panel */
#bless .lb-card.lg7-card { width: min(430px, 94vw); max-height: calc(var(--app-h, 100vh) - 20px); overflow-y: auto; padding: 12px 10px 12px; border-radius: 20px; background: linear-gradient(180deg, #ff8fc6, #ff6fb0); border: 3px solid #ff4f9e; box-shadow: 0 16px 44px rgba(0,0,0,.5), inset 0 2px 0 rgba(255,255,255,.45); display: flex; flex-direction: column; align-items: center; gap: 8px; color: #241b2b; animation: lg7in .3s cubic-bezier(.2,1.4,.4,1); }
@keyframes lg7in { 0% { opacity: 0; transform: scale(.86) translateY(14px); } 100% { opacity: 1; transform: none; } }
.lg7-title { display: flex; align-items: center; gap: 8px; padding: 4px 22px; border-radius: 999px; background: rgba(255,255,255,.2); color: #fff; font-weight: 900; font-size: 26px; letter-spacing: 3px; text-shadow: 0 0 10px rgba(255,255,255,.85), 0 2px 0 rgba(200,40,120,.45); } /* v311 after the player's sketch: white glowing words on the pink, a sparkle each side */
.lg7-title span { font-size: 20px; letter-spacing: 0; text-shadow: none; }
.lg7-words { margin: 0; align-self: stretch; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: rgba(255,255,255,.94); font-size: 12.5px; font-weight: 800; color: #1c9c50; text-align: center; line-height: 1.3; } /* v311 the kind words in green, in a white bar under the days, the clover point in front */
.lg7-words b { flex: none; font-size: 17px; font-weight: 900; color: #17a34a; white-space: nowrap; }
.lg7-body { align-self: stretch; display: flex; gap: 8px; padding: 10px; border-radius: 14px; background: #fff7fb; box-shadow: inset 0 0 0 2px rgba(255,111,176,.25); }
.lg7-grid { flex: 3; display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; min-width: 0; }
.lg7-d { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 3px; padding: 0 0 6px; border-radius: 10px; background: #fff; border: 3px solid #ff6fb0; min-width: 0; min-height: 88px; overflow: hidden; }
.lg7-d small { align-self: stretch; padding: 2px 2px 3px; background: #ff6fb0; font-size: 12px; font-weight: 900; color: #fff; text-align: center; white-space: nowrap; }
.lg7-d i { font-style: normal; font-size: 26px; line-height: 1.1; }
.lg7-d em { font-style: normal; max-width: 100%; padding: 0 4px; color: #ff4f9e; font-size: 12px; font-weight: 900; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.lg7-d.big em { font-size: 10.5px; }
.lg7-d.got em { position: relative; z-index: 3; color: #fff; text-shadow: 0 1px 2px rgba(60,10,40,.9); } /* (what the day gave stays easy to read over the dimming) */
.lg7-d u { position: absolute; inset: 20px 0 22px 0; z-index: 2; display: flex; align-items: center; justify-content: center; text-decoration: none; transform: rotate(-14deg); filter: drop-shadow(0 2px 3px rgba(0,0,0,.5)); pointer-events: none; }
.lg7-d u svg { width: 40px; height: 40px; opacity: .62; } /* (see-through: the prize under it still shows) */ /* v311 the paw stamp on a day had */
.lg7-d.got::after { content: ''; position: absolute; inset: 0; z-index: 1; background: rgba(58,18,44,.5); pointer-events: none; } /* v311 the whole box dimmed; what is in it stays to be read */
.lg7-d.now::after { animation: lg7dim .3s ease-out .55s both; }
.lg7-d.now u { animation: lg7paw .42s cubic-bezier(.3,1.5,.5,1) .5s both; }
@keyframes lg7dim { 0% { opacity: 0; } 100% { opacity: 1; } }
@keyframes lg7paw { 0% { opacity: 0; transform: rotate(-30deg) scale(3.2); } 55% { opacity: 1; transform: rotate(-10deg) scale(.86); } 100% { opacity: 1; transform: rotate(-14deg) scale(1); } }
.lg7-d.now { border-color: #ffb300; box-shadow: 0 0 0 3px rgba(255,193,7,.45); }
.lg7-d.now small { background: #ffb300; }
.lg7-d.d7 { flex: 1.15; justify-content: space-between; }
.lg7-d.d7 small { font-size: 15px; padding: 4px 2px 5px; }
.lg7-d.d7 em { font-size: 14px; }
.lg7-d.d7 u svg { width: 60px; height: 60px; }
.lg7-d.d7 i { font-size: 46px; align-self: stretch; flex: 1; min-height: 0; display: flex; padding: 0 4px; }
.lg7-d.d7 i img { width: 100%; height: 100%; min-height: 60px; object-fit: cover; object-position: 50% 15%; border-radius: 6px; display: block; } /* v313 the wreath's picture: the player's own shot */
.lg7-d.d7 b { padding: 1px 10px; border-radius: 999px; background: #ffe6f1; font-size: 11px; font-weight: 900; color: #ff2d6a; white-space: nowrap; }
.lg7-got { margin: 0; align-self: stretch; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 10px; padding: 6px 10px; border-radius: 12px; background: rgba(255,255,255,.9); font-size: 12.5px; font-weight: 900; }
.lg7-got b { padding: 2px 10px; border-radius: 999px; background: #ff4f9e; color: #fff; font-size: 13px; }
.lg7-got span { color: #1c9c50; }
.lg7-note { margin: 0; font-size: 10.5px; font-weight: 700; color: #fff; opacity: .92; text-align: center; line-height: 1.4; }
.lg7-close { padding: 5px 34px; border-radius: 6px; background: transparent; color: #fff; font-weight: 900; font-size: 22px; border: 4px solid #fff; transition: transform .1s, background .1s; }
.lg7-close:active { transform: scale(.94); background: rgba(255,255,255,.25); }
@media (orientation: landscape) and (max-height: 500px) {
  #bless .lb-card.lg7-card { width: min(600px, 92vw); padding: 8px 10px; gap: 5px; }
  .lg7-title { font-size: 18px; padding: 1px 18px; } .lg7-title span { font-size: 14px; } .lg7-words { font-size: 11.5px; padding: 4px 12px; } .lg7-words b { font-size: 14px; }
  .lg7-body { padding: 7px; } .lg7-grid { gap: 5px; grid-template-columns: repeat(6, 1fr); flex: 6; }
  .lg7-d { min-height: 70px; padding: 0 0 4px; } .lg7-d small { font-size: 10.5px; } .lg7-d i { font-size: 20px; } .lg7-d.d7 i { font-size: 26px; } .lg7-d em { font-size: 10.5px; } .lg7-d u svg { width: 30px; height: 30px; } .lg7-d.d7 u svg { width: 38px; height: 38px; } .lg7-d.d7 small { font-size: 11.5px; padding: 2px; } .lg7-d.d7 em { font-size: 11px; }
  .lg7-d.d7 { flex: 1.25; } .lg7-d.d7 b { font-size: 10.5px; padding: 1px 7px; }
  .lg7-d.d7 i { flex: none; } .lg7-d.d7 i img { height: 46px; min-height: 0; }
  .lg7-got { padding: 4px 10px; } .lg7-note { display: none; } .lg7-close { padding: 2px 28px; font-size: 16px; border-width: 3px; }
}
@media (prefers-reduced-motion: reduce) { #bless .lb-card.lg7-card, .lg7-d.now u, .lg7-d.now::after { animation: none; } }
/* v301 rarity tags: a frosted-glass corner tab on each card (N white, R blue, SR aqua, SSR pink) */
#closet .wear .it .rar { top: 0; left: 0; padding: 2px 8px 2px 7px; border-radius: 12px 0 10px 0; font-size: 10px; font-weight: 900; letter-spacing: .5px; color: #111; background: rgba(255,255,255,.78); -webkit-backdrop-filter: blur(8px) saturate(1.4); backdrop-filter: blur(8px) saturate(1.4); border-right: 1px solid rgba(255,255,255,.55); border-bottom: 1px solid rgba(255,255,255,.55); box-shadow: 0 2px 6px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.6); }
#closet .wear .it.r-R .rar { color: #fff; background: rgba(64,156,255,.72); }
#closet .wear .it.r-SR .rar { color: #062a2a; background: rgba(45,220,214,.8); }
#closet .wear .it.r-SSR .rar { color: #4a0626; background: linear-gradient(135deg, rgba(255,128,186,.9), rgba(255,92,160,.82)); }
/* v302 設定 shorter: the three on/off switches side by side, the four one-button things as two-by-two tiles */
.hub .opt-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.hub .opt-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 9px 0 2px; }
.hub .opt.mini, .hub .opt.tile { flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: space-between; gap: 6px; padding: 8px; border: 0; border-radius: 12px; background: rgba(255,255,255,.055); min-width: 0; }
.hub .opt.mini > span, .hub .opt.tile > span { font-size: 12px; line-height: 1.25; text-align: center; white-space: normal; overflow-wrap: anywhere; min-width: 0; max-width: 100%; align-self: center; }
.hub .opt.mini .seg { justify-content: center; flex-wrap: nowrap; align-self: center; }
.hub .opt.tile .cl-open { width: 100%; padding: 6px 4px; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (orientation: landscape) and (max-height: 500px) { .hub .opt-3 { padding: 5px 0; } .hub .opt-2 { grid-template-columns: repeat(4, 1fr); padding: 5px 0 0; } .hub .opt.mini, .hub .opt.tile { padding: 5px 6px; gap: 4px; } }
/* v302 rarity tags in the filter chips' own colours (N grey-blue, R sky, SR lilac, SSR gold): a gradient, a soft glow, still frosted */
#closet .wear .it .rar { color: #1b2126; background: linear-gradient(135deg, rgba(236,241,244,.92), rgba(176,190,197,.82)); border-right: 1px solid rgba(255,255,255,.6); border-bottom: 1px solid rgba(255,255,255,.6); box-shadow: 0 0 8px rgba(176,190,197,.55), 0 2px 5px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.7); text-shadow: 0 1px 0 rgba(255,255,255,.35); }
#closet .wear .it.r-R .rar { color: #06283a; background: linear-gradient(135deg, rgba(178,235,255,.95), rgba(79,195,247,.88) 55%, rgba(41,160,230,.88)); box-shadow: 0 0 10px rgba(79,195,247,.75), 0 2px 5px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.7); }
#closet .wear .it.r-SR .rar { color: #3a0d47; background: linear-gradient(135deg, rgba(243,214,250,.96), rgba(206,147,216,.9) 55%, rgba(171,99,196,.9)); box-shadow: 0 0 11px rgba(206,147,216,.8), 0 2px 5px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.7); }
#closet .wear .it.r-SSR .rar { color: #4a2c00; background: linear-gradient(135deg, rgba(255,244,196,.97), rgba(255,213,79,.93) 50%, rgba(255,170,44,.93)); box-shadow: 0 0 13px rgba(255,213,79,.9), 0 0 4px rgba(255,236,160,.9), 0 2px 5px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.8); animation: rarglow 2.4s ease-in-out infinite; }
@keyframes rarglow { 0%, 100% { box-shadow: 0 0 9px rgba(255,213,79,.7), 0 2px 5px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.8); } 50% { box-shadow: 0 0 17px rgba(255,213,79,1), 0 0 6px rgba(255,240,180,.95), 0 2px 5px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.8); } }
@media (prefers-reduced-motion: reduce) { #closet .wear .it.r-SSR .rar { animation: none; } }
/* v306 lighter to draw (phones): no frosted blur behind every rarity tag or behind the event card (a blur over the
   live 3D picture is redrawn every frame), and the SSR tag's glow no longer animates on every card at once */
#closet .wear .it .rar { -webkit-backdrop-filter: none; backdrop-filter: none; }
#closet .wear .it.r-SSR .rar { animation: none; box-shadow: 0 0 12px rgba(255,213,79,.9), 0 0 4px rgba(255,236,160,.9), 0 2px 5px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.8); }
.ev-layer, .ev-layer.in { -webkit-backdrop-filter: none; backdrop-filter: none; transition: background .25s ease; }
.ev-layer.in { background: rgba(8,4,16,.74); }
#bless .lb-card.lg7-card { box-shadow: 0 10px 26px rgba(0,0,0,.45), inset 0 2px 0 rgba(255,255,255,.45); }
