/* Hajiwei 4.0.2: tactile tabletop shell + upright printed standees. */
:root{--ink:#263450;--muted:#697387;--green:#2956b0;--line:#b9c4d53d;--glass:#fffaf2;--blue:#315db0;--navy:#1b3c79;--yellow:#ffda64;--cream:#fff8e9;--coral:#dc8d7e;font-family:'Microsoft YaHei','PingFang SC',system-ui,sans-serif;background:#f3e8de;color:var(--ink)}
body{background:radial-gradient(ellipse at 0% 0%,#dce7ef 0,transparent 48%),radial-gradient(ellipse at 100% 60%,#eaccc1 0,transparent 50%),#f3e8de;background-attachment:fixed;min-height:100svh}
#app{padding-top:0}h1,h2,h3,.brand strong{font-family:inherit;font-weight:800;letter-spacing:-.035em}h1{color:var(--ink)}button{font-family:inherit}button:focus-visible,a:focus-visible{outline:3px solid #bd6700;outline-offset:4px}button:disabled{opacity:.5}
header,header.home-header,header.page-header{position:relative;inset:auto;margin:0 auto;max-width:1192px;width:100%;height:88px;padding:22px 28px;display:flex;align-items:center;justify-content:space-between;background:none;border:0;box-shadow:none;backdrop-filter:none;border-radius:0}
.brand-stack .brand{gap:12px}.brand-stack .brand strong{font-size:23px;letter-spacing:1px;color:var(--navy)}.brand-stack .brand small{font-size:8px;letter-spacing:2px;color:#697793}.brand-stack .mark{width:30px;height:30px;border:4px solid var(--blue);border-radius:9px;transform:rotate(-9deg);background:var(--yellow);box-shadow:3px 4px 0 #9eaec8}.brand .mark:before,.brand .mark:after{display:none}.header-tools{gap:10px}.back-nav{width:auto}.back-nav button{white-space:nowrap}
button.primary,button.secondary,nav .text-button,dialog .close{border-radius:15px;min-height:46px;padding:11px 18px;background:linear-gradient(#fffdf7,#ece7dc);color:var(--navy);border:1px solid #ffffffc9;box-shadow:inset 0 2px 1px #fff,0 4px 0 #c3c8cc,0 8px 16px #34446110;text-shadow:none;font-weight:700;font-size:13px;backdrop-filter:none;transition:transform .15s,box-shadow .15s;isolation:auto}
button.primary{background:linear-gradient(#4777ca,#315eb2);color:#fff;border-color:#6486c8;box-shadow:inset 0 2px 1px #ffffff54,0 5px 0 #213f7a,0 10px 18px #24457121}
button.primary:before,button.secondary:before,nav .text-button:before{display:none}button.primary:hover,button.secondary:hover,nav .text-button:hover{transform:translateY(-2px)}button.primary:active,button.secondary:active{transform:translateY(3px);box-shadow:inset 0 1px 1px #fff5,0 1px 0 #244a8d}.icon{stroke:currentColor}.full{width:100%}.text-button{color:var(--navy)}
.glass{background:linear-gradient(140deg,#fffdf6ed,#f7ede2e6);border:1px solid #fff9;box-shadow:inset 0 2px 0 #fff,0 9px 24px #4a56620b;backdrop-filter:none}.bubble{display:none}
/* Lobby: the miniature is made from the same pieces, rather than a screenshot. */
.club-home{max-width:1140px;margin:auto;padding:2px 28px 35px}.club-heading{text-align:center;margin:4px 0 20px}.club-kicker{font-size:12px;letter-spacing:3px;font-weight:700;color:#66758b}.club-heading h1{position:relative;display:inline-block;font-size:80px;line-height:1.3;margin:4px 0;color:#fffdf4;letter-spacing:3px;-webkit-text-stroke:2px #3860a9;text-shadow:0 5px 0 #3c62a6,0 9px 0 #254780,0 15px 20px #54657838;transform:rotate(-3deg)}.title-spark{position:absolute;font-size:39px;color:var(--yellow);right:-35px;top:-7px;-webkit-text-stroke:1px #b78127;text-shadow:2px 3px 0 #bc8832;transform:rotate(20deg)}.club-heading>p{font-size:13px;color:var(--muted);margin:10px 0 0}
.club-lobby{display:grid;grid-template-columns:1.15fr 1fr;gap:30px;align-items:center}.club-stage{position:relative;min-height:375px;isolation:isolate}.stage-pill{position:absolute;left:18px;top:15px;background:#fffbefae;border:1px solid #fff;padding:7px 13px;border-radius:30px;font-size:10px;color:#6c7080;transform:rotate(-5deg)}.cast-portrait{object-fit:contain;user-select:none;pointer-events:none}.stage-cast{position:absolute;top:28px;width:130px;z-index:3;filter:drop-shadow(0 6px 2px #614d3420)}.stage-cast.dragon{left:34px;transform:rotate(-9deg)}.stage-cast.cat{right:16px;transform:rotate(8deg)}.stage-cast img{width:100%;height:150px;object-fit:contain}.stage-cast>span{display:block;text-align:center;margin-top:-15px;background:#335daa;color:#fff;width:66px;padding:4px 0;font-size:12px;border-radius:10px;border:1px solid #80a0d4;box-shadow:0 4px 0 #1f407b}.stage-cast.dragon>span{margin-left:25px;background:var(--yellow);color:#604d21;border-color:#fff4b6;box-shadow:0 4px 0 #b78a2f}
.club-mini{position:absolute;width:76%;aspect-ratio:1;left:12%;top:98px;transform:perspective(800px) rotateX(43deg) rotateZ(-9deg);transform-style:preserve-3d;background:linear-gradient(145deg,#fff8e7,#e9ddc7);border:11px solid #3864b3;border-radius:25px;box-shadow:0 12px 0 #214580,0 18px 0 #416bb7,0 24px 30px #3b45644a;isolation:auto}.club-mini>svg{width:100%;height:100%}.mini-piece{position:absolute;width:13%;height:19%;transform-style:preserve-3d;transform-origin:bottom center;transform:translate(-50%,-100%) rotateX(-43deg);pointer-events:none}.mini-piece img{position:absolute;bottom:0;width:100%;height:100%;object-fit:contain;filter:drop-shadow(2px 3px 0 #fff9)}.piece-base{position:absolute;display:block;width:64%;height:18%;bottom:-5%;left:18%;border-radius:50%;background:linear-gradient(#ffeaa4,#e5b532);box-shadow:0 3px 0 #b38b28,0 7px 5px #3b3c4830;pointer-events:none}.player-2 .piece-base,.piece.white .piece-base{background:linear-gradient(#6e92d0,#315cb0);box-shadow:0 3px 0 #224783,0 7px 5px #3b3c4830}.stage-sticker{position:absolute;bottom:32px;right:2px;font-size:24px;font-weight:900;background:#ffdf75;color:#805625;border:3px solid #fff2b1;border-radius:13px;padding:3px 13px;transform:rotate(-8deg);box-shadow:0 4px 0 #bd934b;z-index:4}.stage-caption{position:absolute;bottom:-12px;left:12px;right:12px;text-align:center;font-size:12px;color:#566880}.stage-caption>span{margin-left:10px;color:#8490a0;font-size:11px}.yellow-dot{display:inline-block;width:8px;height:8px;background:#ddb93d;border-radius:50%;margin-right:6px}
.club-play{position:relative;padding:30px;border-radius:29px;background:linear-gradient(145deg,#fffdf8,#f6ece0);border:1px solid #fff;box-shadow:inset 0 3px 0 #fff,0 7px 0 #d9d2c9,0 17px 27px #6154400d}.club-mode-tag{font-size:11px;color:#7d8b9f;font-weight:700;letter-spacing:1px}.club-play h2{font-size:31px;margin:10px 0}.club-play>p{font-size:13px;color:var(--muted);line-height:1.9;margin:0 0 22px}.club-play>.primary{height:53px;font-size:15px}.resume-button{margin-top:12px}.club-pvp{display:flex;align-items:center;justify-content:space-between;gap:14px;padding-top:24px;margin-top:27px;border-top:1px solid var(--line)}.club-pvp h3{font-size:16px;margin:0}.club-pvp p{font-size:11px;color:var(--muted);margin:6px 0}.club-pvp button{font-size:12px;white-space:nowrap}
.club-puzzles{display:flex;align-items:center;gap:20px;margin-top:44px;padding:23px 28px;border-radius:25px;border:1px solid #fff;background:linear-gradient(120deg,#e4ebf3,#e7e5e9);box-shadow:inset 0 2px 0 #fff,0 5px 0 #c9d1de}.puzzle-token{display:grid;place-items:center;width:67px;height:67px;border-radius:18px;transform:rotate(-9deg);background:#456fb9;color:#fff3b9;box-shadow:0 5px 0 #274e91}.puzzle-token svg{width:32px;height:32px}.club-puzzles h2{font-size:22px;margin:4px 0}.club-puzzles p{font-size:12px;margin:0;color:var(--muted)}.club-puzzles button{margin-left:auto;white-space:nowrap}.club-foot{display:flex;justify-content:space-between;align-items:center;padding-top:24px;color:#7b8190;font-size:10px}.club-foot button{display:flex;align-items:center;gap:8px;font-size:12px}
/* Keep every existing mode, dialog, rank filter and tutorial in the same material system. */
.subpage{max-width:1060px;padding:25px 28px 50px;margin:auto}.page-heading h1{font-size:34px}.eyebrow,.section-label{color:#7d879b}.board-choices{gap:24px}.board-choice{background:linear-gradient(135deg,#fffdf7,#f1e5d3);border:1px solid white;border-radius:28px;padding:27px;box-shadow:0 7px 0 #d8cebd,0 14px 28px #806b4410}.board-choice h2{color:#355ba0;font-size:35px;font-weight:900}.choice-preview{background:linear-gradient(#faf5e7,#ebe2d1);border:8px solid #5177b8;border-radius:16px;box-shadow:0 5px 0 #2c508e;transform:perspective(500px) rotateX(18deg)}.board-choice p,.choice-note{color:#6f7685}.tabs,.chapters,.difficulty,.rank-segment,.rank-periods{background:#e3e7ed;border:1px solid #d1d7e0;box-shadow:inset 0 2px 3px #53668014}.tabs button.selected,.chapters button.selected,.difficulty button.selected,.rank-segment button[aria-pressed=true],.rank-periods button[aria-pressed=true]{color:#fff;background:linear-gradient(#5c7db5,#3a5e9e);border-color:#6787b9;box-shadow:0 2px 0 #264477}.tabs button,.chapters button,.difficulty button{color:#69768b}.level-card{background:linear-gradient(135deg,#fffdf7,#eee5d9);border-radius:22px;border:1px solid #fff;box-shadow:0 5px 0 #d5d0c9}.level-card h3{color:#2d4c85}.challenge-preview{background:#f9f3e5;border-radius:12px}.level-card.complete{border-color:#83a4d1}.level-card .done{color:#3861a1}.rule-more{color:var(--navy)}
.shell{max-width:1176px;padding:16px 28px 40px}.workspace{display:grid;grid-template-columns:minmax(0,1fr) 285px;gap:26px;align-items:start}.game-section{min-width:0}.board-panel{border:0;background:none;padding:0;box-shadow:none;backdrop-filter:none;overflow:visible}.game-sidebar{min-width:0;padding-top:0}.side-info{padding:22px;border-radius:24px}.side-info h2{font-size:21px}.side-info p{font-size:12px}.side-info .records{max-height:250px}.game-difficulty{display:block;padding:16px;margin:0 0 18px;border-radius:21px}.game-difficulty>span{display:block;margin-bottom:11px;color:#65758b;font-size:12px}.game-difficulty .difficulty{width:100%;min-width:0;max-width:none;border-radius:12px}.game-difficulty .difficulty button{min-height:42px;border-radius:10px;font-size:12px}
.score-strip{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:4px 6px 20px}.compact-score{position:relative;display:grid;grid-template-columns:1fr auto;gap:4px 10px;border:1px solid #fff;border-radius:23px;background:#fff8eb;padding:16px 20px 14px 87px;box-shadow:inset 0 2px 0 #fff,0 4px 0 #d8c496;min-height:92px}.compact-score:nth-child(2){background:#dce7f4;box-shadow:inset 0 2px 0 #fff,0 4px 0 #adbfd9}.compact-score.active{outline:2px solid #d4a73c;outline-offset:3px;background:#fff4ce}.compact-score:nth-child(2).active{outline-color:#4e74b2;background:#d8e6fd}.compact-player{grid-column:1;display:block;font-size:11px;color:#5f6571;font-weight:700;white-space:normal}.compact-player .cast-portrait{position:absolute;left:12px;bottom:11px;width:66px;height:90px;filter:drop-shadow(0 3px 0 #fff8)}.compact-score strong{grid-column:2;grid-row:1/3;font:900 42px/1 system-ui,sans-serif;align-self:center;color:#886624;letter-spacing:-2px}.compact-score:nth-child(2) strong{color:#3d639b}.compact-score small{grid-column:1;font-size:10px;color:#838590}.board-top{font-size:11px;margin:0 10px 4px;color:#536a8a;gap:8px}.board-top .badge{background:#fffbf0b3;border:1px solid #fff;font-size:10px;padding:5px 8px}.dot{background:#5478b4;box-shadow:none}
/* The board surface is tilted; each standee counter-rotates toward the camera. */
.board-scene{perspective:1100px;padding:0 4px 15px;overflow:visible}.board-area{position:relative;width:100%;aspect-ratio:1;background:radial-gradient(ellipse at 30% 10%,#fffcf0,#f1e7d0 65%,#e5d9c0);border:0;border-radius:28px;transform:rotateX(23deg);transform-style:preserve-3d;box-shadow:inset 0 0 0 11px #4972b9,inset 0 0 0 14px #6c91cc,0 9px 0 #2d5393,0 15px 0 #24477e,0 21px 22px #3f4a632c;isolation:auto;overflow:visible;touch-action:none;user-select:none}
.board-svg{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible}.grid-line{stroke:#88909a;stroke-width:.9;opacity:.75}.axis{fill:#68778b;font:700 9px system-ui}.cell-grid{transform-style:preserve-3d;overflow:visible;z-index:1}.cell{overflow:visible;transform-style:preserve-3d;background:none!important;border:0!important;border-radius:0;box-shadow:none!important;opacity:1!important;padding:0;touch-action:none;isolation:auto}.cell:after,.cell:before{display:none!important}.hit-anchor{position:absolute;left:50%;top:50%;width:2px;height:2px;transform:translate(-50%,-50%);border-radius:50%;background:#7e899680;pointer-events:none}.piece{position:absolute;left:50%;top:50%;width:80%;height:98%;transform-origin:50% 100%;transform:translate(-50%,-100%) rotateX(-23deg);pointer-events:none;display:block;transform-style:preserve-3d}.piece>img{position:absolute;width:100%;height:100%;left:0;bottom:0;object-fit:contain;pointer-events:none;filter:drop-shadow(1px 0 0 #fff) drop-shadow(-1px 0 0 #fff)}.piece .piece-base{bottom:-5%;width:68%;left:16%;height:19%;transform:rotateX(15deg)}.piece.ghost{opacity:.5;animation:none}.cell.latest .piece-base{outline:2px solid #fff;outline-offset:1px}.cell.hint .hit-anchor{width:64%;height:64%;border:3px dashed #aa7511;background:#ffe89b8a;box-shadow:0 0 0 4px #ffdc6440}.cell:focus-visible{outline:none}.cell:focus-visible .hit-anchor{width:65%;height:65%;outline:3px solid #a7771b;outline-offset:2px;background:#ffdf702f}
.piece.celebrate{animation:none}.square{stroke:#d09b10;fill:#ffda6040;stroke-width:3}.square.white{stroke:#4574c5;fill:#638bca33}.area-label,.score-overlay .area-label{fill:#9b6508;stroke:#fff9e2;font:bold 20px system-ui;stroke-width:5}.area-label.white{fill:#365f9e}.preview-square{stroke:#ad7b13;fill:#ffdc6033}.board-bottom{padding:4px 12px 4px;font-size:10px;color:#7e8492}.toolbar{gap:12px;margin:14px 6px 0}.toolbar button.secondary{font-size:13px;border-radius:15px;min-height:48px}.toolbar #hint{background:linear-gradient(#ffe996,#f4cf59);color:#6b531a;box-shadow:inset 0 2px 0 #fff6,0 4px 0 #be9c3b}.assistance-status{color:#65758b;font-size:11px;margin:14px 10px 0}.assistance-status .secondary{font-size:10px;min-height:34px;box-shadow:none;background:#fff9ee87;border:1px solid #fff}.status-message{color:#486895;background:#ffffff66;border-radius:13px;padding:10px 13px;margin:15px 5px 0;min-height:0}.result-panel{border-radius:22px;margin-top:20px}.result-panel h2{font-size:23px}.result-action-grid button{font-size:12px;min-height:45px}.points{color:#916a19!important}.record{border-bottom-color:#bdc7d53d}.mini-stone{background:linear-gradient(#ffe68f,#d8b550);border:1px solid #cbb363;box-shadow:0 2px 0 #b79942}.mini-stone.white{background:linear-gradient(#799bd2,#456db0);border-color:#6685b8;box-shadow:0 2px 0 #315794}
dialog,.settings-dialog{background:linear-gradient(145deg,#fffdf5,#f4eade);border:2px solid #fff;padding:30px;border-radius:25px;box-shadow:0 8px 0 #c7c7c8,0 30px 80px #243b6660;color:var(--ink);backdrop-filter:none}dialog::backdrop{background:#26344e55;backdrop-filter:blur(5px)}dialog h2{font-weight:800;color:#2f4d7e}dialog p,dialog li{color:#64728a}.switch[aria-checked=true]{background:#416fba}.switch{background:#c5cbd3}.volume{accent-color:#416fba}.stat,.rule-pill{background:#fffaf0;border-color:#d5dce5}.stat strong{color:#3d6096;font-family:inherit}.stat span,.setting-row small{color:#748096}.rank-results{border-radius:22px}.rank-mine{background:#e2eaf6;color:#385989}.reward-targets button[aria-pressed=true]{background:#d5e3fa;color:#2c4f8b;border-color:#668bc0}#toast{background:#fffcf0b8!important;color:#31496e!important;border:1px solid #fff;box-shadow:0 10px 30px #29477124;backdrop-filter:blur(13px);width:min(460px,calc(100vw - 36px));text-align:center}

@media(max-width:900px){.workspace{grid-template-columns:minmax(0,1fr) 235px;gap:20px}.shell{padding:12px 18px 35px}.compact-score{padding-left:65px}.compact-player .cast-portrait{left:7px;width:52px;height:76px}.compact-score strong{font-size:34px}.club-stage{min-height:330px}.club-play{padding:22px}.club-lobby{gap:18px}.stage-cast{width:110px}.stage-cast img{height:128px}.club-mini{top:93px}.stage-sticker{bottom:30px;font-size:21px}}
@media(max-width:700px){.workspace{display:flex;flex-direction:column;gap:20px}.shell{max-width:570px;padding:10px 12px 30px}.game-sidebar{width:100%}.game-difficulty{display:flex;align-items:center;gap:12px;padding:10px 13px;margin:17px 4px 0}.game-difficulty>span{margin:0;white-space:nowrap;font-size:11px}.game-difficulty .difficulty{flex:1}.game-difficulty .difficulty button{min-height:42px}.compact-score{padding:12px 16px 11px 78px;min-height:84px}.compact-player .cast-portrait{width:60px;height:82px;left:10px}.compact-score strong{font-size:37px}.board-area{border-radius:23px}.club-home{max-width:560px;padding:0 20px 30px}.club-heading h1{font-size:67px}.club-lobby{display:flex;flex-direction:column;gap:20px}.club-stage{width:100%;height:340px;min-height:0;max-width:390px}.club-mini{width:73%;left:13.5%;top:67px}.stage-cast{top:3px;width:103px}.stage-cast.dragon{left:5px}.stage-cast.cat{right:0}.stage-cast img{height:125px}.stage-pill{top:1px;left:110px;right:85px;white-space:nowrap;text-align:center;font-size:8px;padding:5px}.stage-sticker{right:0;bottom:32px}.stage-caption{bottom:2px}.club-play{width:100%;padding:24px}.club-play h2{font-size:27px}.club-pvp{padding-top:19px;margin-top:23px}.club-puzzles{margin-top:27px;padding:20px;gap:14px;flex-wrap:wrap}.puzzle-token{width:48px;height:48px;border-radius:12px}.club-puzzles h2{font-size:20px}.club-puzzles>div:nth-child(2){flex:1}.club-puzzles p{font-size:11px}.club-puzzles button{width:100%;margin:5px 0 0}.club-foot{gap:8px}.club-foot button{font-size:11px}.club-foot>span{font-size:9px}.club-heading{margin:0 0 5px}}
@media(max-width:650px){header,header.home-header,header.page-header{height:76px;padding:15px 18px;top:auto;left:auto;right:auto;margin:0;gap:8px}#app{padding-top:0}.brand-stack .brand strong{font-size:20px;letter-spacing:0}.brand-stack .brand small{display:none}.brand-stack .mark{width:25px;height:25px}.brand-stack .brand{gap:8px}header nav{gap:7px}header nav .text-button{padding:9px 11px;font-size:11px;min-height:42px}.back-nav .text-button{font-size:11px;padding:10px}.header-tools .icon{width:15px;height:15px}.subpage{padding:18px 18px 35px}.page-heading h1{font-size:29px}.board-title-row .preview-promo{font-size:11px;min-height:40px;padding:9px 11px}.board-choices{gap:24px}.board-choice{padding:23px}.board-choice .choice-preview{width:112px;height:112px}.score-strip{gap:12px;margin:8px 4px 19px}.compact-score{padding:12px 10px 9px 59px;min-height:76px;border-radius:18px}.compact-player{font-size:10px}.compact-player .cast-portrait{width:48px;height:71px;left:7px;bottom:10px}.compact-score strong{font-size:32px}.compact-score small{font-size:9px}.board-top{font-size:10px;margin:0 8px}.board-top .badge{font-size:9px;padding:4px 7px}.board-scene{padding:0 2px 14px;perspective:900px}.board-area{box-shadow:inset 0 0 0 8px #4972b9,inset 0 0 0 10px #6c91cc,0 7px 0 #2d5393,0 12px 0 #24477e,0 17px 18px #3f4a632c}.toolbar{gap:9px;margin:11px 3px 0}.toolbar button.secondary{min-height:47px;font-size:11px;padding:10px 6px}.toolbar .icon{width:15px;height:15px}.assistance-status{margin:13px 3px 0;font-size:10px}.assistance-status #assistance-rewards{min-height:34px;font-size:10px;padding:6px 9px;justify-self:center}.status-message{font-size:11px}.side-info{padding:20px}.side-info p{font-size:12px}.side-info .records{max-height:170px}.result-action-grid button{font-size:11px}.result-panel p{font-size:12px}.level-card h3{font-size:17px}.level-card p{font-size:11px}dialog{padding:25px 22px}dialog .close{min-height:38px;padding:8px}.settings-dialog{padding:24px}.setting-row small{font-size:11px}.board-bottom{font-size:9px}.club-kicker{font-size:10px;letter-spacing:2px}.club-heading>p{font-size:11px}}
@media(max-width:370px){header,header.home-header,header.page-header{padding:13px 12px}.brand-stack .mark{display:none}.header-tools{gap:5px}.compact-score{padding-left:50px}.compact-player .cast-portrait{width:41px;left:5px}.compact-score strong{font-size:28px}.board-top .badge{font-size:8px}.club-stage{height:300px}.club-heading h1{font-size:59px}.stage-pill{display:none}.stage-sticker{bottom:18px}.club-pvp button{padding:9px 11px}.club-heading>p{font-size:10px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}
/* Reserve projected space for the nearer edge; the page itself must never scroll sideways. */
.club-heading>.club-kicker{display:block}.club-stage{min-height:400px}.club-mini{width:62%;left:19%;top:58px}.stage-caption{bottom:8px}
.shell{max-width:1040px}.workspace{grid-template-columns:minmax(0,1fr) 280px}.board-scene{width:90%;margin:0 auto}.side-info h2,.result-panel h2{font-family:inherit;font-weight:800}
@media(max-width:900px){.workspace{grid-template-columns:minmax(0,1fr) 230px}.club-stage{min-height:350px}}
@media(max-width:700px){.shell{max-width:570px}.workspace{display:flex}.club-stage{height:340px;min-height:0}.club-mini{width:73%;left:13.5%;top:67px}.stage-caption{bottom:2px}}
@media(max-width:370px){.club-stage{height:300px}}
/* The ellipse's geometric center, not its lower edge, is the stored grid point. */
.piece .piece-base{bottom:-9.5%}.mini-piece .piece-base{bottom:-9%}
input.volume{accent-color:#416fba}input:focus-visible{outline:3px solid #416fba;outline-offset:3px}

/* 4.0.3: reference-matched tabletop scene and empty board texture. */
body{background:#dcae9b url('./table.webp') center center/cover fixed no-repeat}
.board-area{background:#fff2d9 url('./board.webp') center/100% 100% no-repeat!important;border:0;box-shadow:0 7px 0 #3158a6,0 14px 0 #214181,0 21px 24px #482b3c40!important;border-radius:6%}
.club-mini{background:#fff2d9 url('./board.webp') center/100% 100% no-repeat;border:0;box-shadow:0 9px 0 #254b98,0 17px 20px #523c4240}
.club-stage{background:transparent;border:0;box-shadow:none}
.club-play,.club-puzzles{background:linear-gradient(145deg,#fffaf0f5,#fceadbf0);backdrop-filter:blur(8px)}
.cast-controls{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:18px 0 22px}
.cast-choice{display:flex;align-items:center;gap:8px;min-height:70px;padding:8px 10px;border:1px solid #e0b949;border-radius:15px;background:linear-gradient(#fff4bf,#f5d97e);color:#4a3a16;text-align:left;box-shadow:0 3px 0 #bd9742;cursor:pointer}
.cast-choice:nth-child(2){border-color:#7396d8;background:linear-gradient(#e2edff,#bdd2f2);color:#193766;box-shadow:0 3px 0 #7191c3}
.cast-choice>.cast-portrait{position:static;width:45px;height:52px;object-fit:contain}.cast-choice>span:last-child{margin-left:auto}.cast-choice small,.cast-choice strong{display:block}.cast-choice small{font-size:10px;margin-bottom:4px}.cast-choice strong{font-size:14px;white-space:nowrap}
.cast-picker-dialog{width:min(460px,calc(100vw - 28px));max-height:90svh;overflow:auto}.cast-picker-dialog h2{margin-right:38px}.cast-picker-note{font-size:13px;line-height:1.6}.cast-picker-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:20px}.cast-option{min-width:0}.cast-select{display:flex;flex-direction:column;align-items:center;width:100%;padding:12px;gap:8px;background:#fff9ed;border:2px solid #ded9d0;border-radius:18px;color:#263450;cursor:pointer}.cast-select.selected{border-color:#315db0;background:#e6efff;box-shadow:0 3px 0 #315db0}.cast-select img{height:110px;width:100%;object-fit:contain}.cast-audition{display:block;width:100%;margin-top:8px;min-height:44px;border:0;border-radius:12px;background:#e6e9ef;color:#284c8a;font-size:12px;cursor:pointer}
.cast-choice:hover,.cast-select:hover{filter:brightness(1.04)}.cast-select:focus-visible,.cast-audition:focus-visible,.cast-choice:focus-visible{outline:3px solid #27539d;outline-offset:3px}
@media(max-width:700px){body{background-attachment:scroll;background-position:center top}.cast-controls{margin:16px 0 20px}.cast-choice{padding:8px;gap:5px}.cast-choice>.cast-portrait{width:40px}.cast-choice strong{font-size:13px}.cast-choice small{font-size:9px}.cast-select img{height:100px}}
/* Align the visible cutout feet with the colored base despite source alpha margins. */
.piece{width:92%;height:105%}.piece>img{object-position:center bottom;bottom:-6%}.mini-piece img{object-position:center bottom;bottom:-6%}

/* Six-character roster: three columns on desktop, compact two-column touch layout. */
.cast-picker-dialog{width:min(580px,calc(100vw - 28px))}.cast-picker-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.cast-select strong{font-size:14px;white-space:nowrap}.cast-picker-dialog .cast-select img{height:96px}
@media(max-width:600px){.cast-picker-dialog{padding:22px 18px;max-height:90svh}.cast-picker-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px}.cast-picker-dialog .cast-select{padding:8px;gap:4px}.cast-picker-dialog .cast-select img{height:66px}.cast-audition{margin-top:7px;min-height:44px}.cast-picker-note{margin:10px 0;font-size:12px}}

/* Frame changes affect only the character silhouette, never the base or hit target. */
.character-motion{position:absolute;left:0;bottom:-6%;width:100%;aspect-ratio:1;background-repeat:no-repeat;pointer-events:none;image-rendering:auto}.character-motion.finished{display:none}.piece:has(>.character-motion:not(.finished))>img,.motion-demo:has(>.character-motion:not(.finished))>img{visibility:hidden}.piece.celebrate{animation:none!important}
.cast-motion-button{display:block;width:100%;min-height:38px;margin-top:6px;border:1px solid #bacbe4;border-radius:10px;color:#315db0;background:#f0f5ff;cursor:pointer;font-size:12px}.cast-motion-button:disabled{opacity:.5;cursor:default}.motion-demo-dialog{width:min(440px,calc(100vw - 28px));text-align:center}.motion-demo{position:relative;width:min(240px,75vw);aspect-ratio:1;margin:25px auto 10px}.motion-demo>img{position:absolute;width:100%;height:100%;object-fit:contain;bottom:0;left:0}.motion-demo .character-motion{bottom:0}.motion-demo-base{position:absolute;bottom:-2%;left:25%;width:50%;height:9%;border-radius:50%;background:linear-gradient(#ffe29a,#cc9d31);box-shadow:0 4px 0 #a87820}.motion-caption{font-size:12px;color:#68778b}.motion-demo-actions{display:flex;gap:10px;margin-top:20px;justify-content:center}.motion-demo-actions button{flex:1}.cast-picker-dialog{max-height:94svh}
@media(max-width:600px){.cast-picker-dialog .cast-select img{height:54px}.cast-picker-grid{gap:8px}.cast-audition{min-height:38px}.cast-motion-button{min-height:36px}}
@media(prefers-reduced-motion:reduce){.character-motion{display:none!important}.piece>img,.motion-demo>img{visibility:visible!important}}

/* 4.2.2：圆形实体底座在斜视下呈椭圆，所有角色共用相同的尺寸和脚底锚点。 */
.character-figure,.motion-demo{position:relative;display:block;aspect-ratio:1;isolation:isolate}
.character-figure{width:100%;height:auto}
.piece,.mini-piece{aspect-ratio:1;height:auto!important;isolation:isolate}
.character-idle,.character-motion{position:absolute;inset:0;width:100%;height:100%;aspect-ratio:1;pointer-events:none;transform:none!important;overflow:visible}
.character-idle{z-index:1}.character-motion{z-index:2}.character-motion.finished{display:none}
.character-frame{position:absolute;display:block;background-repeat:no-repeat;pointer-events:none;filter:drop-shadow(.5px 0 0 #fff9) drop-shadow(-.5px 0 0 #fff9)}
.piece .piece-base,.mini-piece .piece-base,.character-figure .piece-base,.motion-demo .piece-base{left:13%;top:85%;bottom:auto;width:74%;height:13%;border-radius:50%;transform:none;z-index:0;background:linear-gradient(170deg,#fff0ac 5%,#e6ba43 80%);border:1px solid #b78e29;box-shadow:0 3px 0 #ab7c20,0 5px 3px #30395740}
.piece.white .piece-base,.player-2 .piece-base{background:linear-gradient(170deg,#a8c8f3,#4a78c4 80%);border-color:#31599c;box-shadow:0 3px 0 #26457e,0 5px 3px #30395740}
.cast-select .character-figure{width:96px;height:96px;flex:none}
.cast-choice>.character-figure{width:52px;height:52px;flex:none;margin:0}
.compact-player .character-figure{height:66px;width:66px}
.stage-cast .character-figure{width:130px;height:130px}
.motion-demo{width:min(240px,75vw);height:auto}
@media(max-width:600px){.cast-select .character-figure{width:64px;height:64px}.cast-choice>.character-figure{width:40px;height:40px}.compact-player .character-figure{width:48px;height:48px}}
@media(prefers-reduced-motion:reduce){.character-motion{display:none!important}.character-idle{opacity:1!important}}
/* 裁去图集透明外沿的布局溢出，不裁切容器内的角色。 */
.character-idle,.character-motion{overflow:hidden}
/* 首页角色容器不继承其下方姓名贴纸的背景与偏移。 */
.stage-cast>.character-figure,.stage-cast.dragon>.character-figure,.stage-cast.cat>.character-figure{background:none;border:0;box-shadow:none;padding:0;margin:0;border-radius:0}
/* 角色按钮中的图层以自身为定位容器。 */
.cast-choice>.character-figure{position:relative}

/* 4.2.2：上窄下宽的圆台底座，厚度随棋子尺寸缩放。 */
.piece .piece-base,.mini-piece .piece-base,.character-figure .piece-base,.motion-demo .piece-base{left:10%;top:85%;width:80%;height:24%;border:0;background:none;box-shadow:none;border-radius:0;--base-top:#ffe99a;--base-wall:#d4a434;--base-rim:#a8781c}
.piece.white .piece-base,.player-2 .piece-base{background:none;border:0;box-shadow:none;--base-top:#aacbf5;--base-wall:#507cbf;--base-rim:#2b4b83}
.piece-base svg{display:block;width:100%;height:100%;overflow:visible;filter:drop-shadow(0 2px 1px #24334d35)}
.base-top{fill:var(--base-top);stroke:#ffffff70;stroke-width:1}.base-wall{fill:var(--base-wall)}.base-rim{fill:var(--base-rim)}.base-highlight{fill:none;stroke:#ffffff85;stroke-width:1.5;stroke-linecap:round}
.cast-choice:disabled{opacity:1;cursor:default}.cast-choice:disabled>span:last-child{font-size:10px;color:#6a7483;white-space:nowrap}.cast-lock-note{font-size:12px!important;color:#707b8b!important;margin:-8px 0 16px!important}
.cast-select .character-figure{margin-bottom:7px}.motion-demo{margin-bottom:30px}

/* 4.2.2：以加厚底座的下缘为接触点，使整个棋子位于棋盘表面之上。 */
.piece{transform-origin:50% 110%;transform:translate(-50%,-110%) translateZ(1px) rotateX(-23deg)}
.mini-piece{transform-origin:50% 110%;transform:translate(-50%,-110%) translateZ(1px) rotateX(-43deg)}
.hit-anchor{width:clamp(4px,.8vw,6px);height:clamp(4px,.8vw,6px);background:#65768c;box-shadow:0 0 0 1px #fff7}
.cell:has(>.piece:not(.ghost))>.hit-anchor{opacity:0}

/* 参考图布局：桌面背景、蓝色实体 UI 和居中的桌游棋盘。只作用于对局页。 */
body[data-view="game"]{background-color:#df9c86;background-image:url('./table-portrait.webp');background-size:100% auto;background-position:center top;background-attachment:scroll}
body[data-view="game"] header{height:66px;max-width:1140px;padding:12px 22px}
body[data-view="game"] header .text-button{background:linear-gradient(#6689d5 0%,#3e65b7 35%,#254887 100%);border:1px solid #91acf0;color:#fff;box-shadow:inset 0 2px 2px #d2e2ff75,0 4px 0 #19376d,0 7px 8px #633b3140;border-radius:16px;min-height:42px;font-size:13px;padding:10px 14px}
body[data-view="game"] header #back{background:#fff5e7b8;color:#35588c;box-shadow:0 3px 0 #b6958e;border-color:#fff5}
.tabletop-shell{max-width:1140px;padding:0 22px 36px}
.tabletop-shell .workspace{grid-template-columns:minmax(0,730px) 265px;gap:26px;justify-content:center}
.tabletop-shell .game-sidebar{padding-top:160px}
.tabletop-shell .board-panel{overflow:visible}
.tabletop-hero{position:relative;padding:0 0 8px;margin-bottom:18px;isolation:isolate}




.tabletop-duel{display:grid;grid-template-columns:minmax(0,1fr) minmax(150px,1.4fr) minmax(0,1fr);align-items:center;gap:0;margin-top:-7px}
.tabletop-mascot{position:relative;display:flex;flex-direction:column;align-items:center;min-width:0;z-index:2}
.tabletop-mascot>.character-figure{width:clamp(110px,14vw,170px);height:clamp(110px,14vw,170px);filter:drop-shadow(0 5px 3px #81493025)}
.tabletop-mascot>strong{position:relative;margin-top:4px;background:linear-gradient(#ffe897,#dfb44d);color:#684910;border:1px solid #fff6bd;border-radius:10px;padding:3px 14px;font-size:17px;box-shadow:0 4px 0 #ad7d2c;z-index:3}
.tabletop-mascot.player-2>strong{background:linear-gradient(#6489ca,#365ba5);border-color:#8ab0ea;color:#fff;box-shadow:0 4px 0 #254377}
.tabletop-mascot.is-turn:after{content:'';position:absolute;bottom:-14px;width:8px;height:8px;border-radius:50%;background:#ffeb86;box-shadow:0 0 9px #fff0a6}
.tabletop-score{position:relative;z-index:1;margin:0 -9px 9px;border-radius:24px;padding:9px 10px 19px;text-align:center;background:linear-gradient(145deg,#456db4,#1c3269 80%);border:3px solid #648bd1;box-shadow:inset 0 2px 5px #a5c3ff5c,0 6px 0 #244579,0 9px 10px #643c3d55}
.tabletop-score-values{display:flex;justify-content:center;align-items:center;gap:10px;font-weight:900;font-size:clamp(35px,5.7vw,66px);line-height:1.15;color:#f3f4ff;text-shadow:0 3px 2px #142448}
.tabletop-score-values strong{font:inherit;letter-spacing:-.05em;min-width:1ch}.tabletop-score-values>span{font-size:.7em}
.tabletop-score-values .score-yellow{color:#ffe576}.tabletop-score-values .score-blue{color:#ffb3a1}
.tabletop-mode{display:inline-block;position:absolute;white-space:nowrap;left:50%;bottom:-14px;transform:translateX(-50%);background:linear-gradient(#5477b4,#294580);border:2px solid #6c95d5;color:#e4edff;border-radius:18px;padding:4px 12px;font-size:13px;font-weight:800;box-shadow:0 3px 0 #1c3265}
.tabletop-score>small{position:absolute;top:calc(100% + 24px);left:-20px;right:-20px;font-size:10px;color:#785b54;white-space:nowrap;text-shadow:none}
.tabletop-burst{position:absolute;left:50%;bottom:-24px;transform:translateX(-50%) rotate(-6deg);z-index:6;white-space:nowrap;color:#fff0a1;background:linear-gradient(#ffc458,#ec803a);border:3px solid #fff0a0;border-radius:12px;padding:1px 18px;font-size:30px;font-weight:1000;-webkit-text-stroke:1px #9a481e;paint-order:stroke fill;text-shadow:0 3px 0 #863519;box-shadow:0 5px 0 #a74b27,0 8px 14px #9a59396b;pointer-events:none}
.tabletop-shell .board-top{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.tabletop-shell .board-scene{position:relative;width:100%;max-width:730px;margin:0 auto;padding:0 2px 29px;perspective:1250px}
.tabletop-shell .board-scene:before{content:'';position:absolute;left:6%;right:6%;bottom:9px;height:17%;border-radius:50%;background:#623b344f;filter:blur(16px);pointer-events:none}
.tabletop-shell .board-area{box-shadow:0 8px 0 #3057a5,0 18px 0 #193977,0 25px 19px #593a3d6b!important}
.board-turn-plaque{position:absolute;left:20%;right:20%;bottom:8px;z-index:7;display:flex;align-items:center;justify-content:center;gap:8px;min-height:28px;border-radius:8px;background:linear-gradient(#3e66b3,#244987);color:#fff;font-size:22px;font-weight:900;letter-spacing:.04em;text-shadow:0 2px #183161;pointer-events:none;box-shadow:inset 0 1px #8bacdc40}
.turn-triangle{width:0;height:0;border-left:7px solid transparent;border-right:7px solid transparent;border-top:12px solid #ffe671;filter:drop-shadow(0 0 4px #ffd770)}
.tabletop-shell .board-bottom{justify-content:center;text-align:center;padding:1px 0 6px;color:#765b50;font-size:10px}.tabletop-shell .board-bottom>span:first-child:empty{display:none}
.tabletop-shell .toolbar{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:6px 8px 0}
.tabletop-shell .toolbar button.secondary{display:flex;align-items:center;justify-content:center;gap:7px;background:linear-gradient(#7296df,#3f69bd 42%,#27498c);border:1px solid #92b5ee;border-radius:18px;color:#fff;min-height:59px;padding:10px 9px;font-size:19px;font-weight:900;text-shadow:0 2px #28477c;box-shadow:inset 0 2px 2px #c3dbff80,0 5px 0 #1c376e,0 8px 9px #6e463c40}
.tabletop-shell .toolbar button:disabled{opacity:.62}.tabletop-shell .toolbar .icon{width:26px;height:26px;stroke-width:2.7;filter:drop-shadow(0 2px #274778)}
.action-count{display:grid;place-items:center;min-width:26px;height:28px;border-radius:50%;background:linear-gradient(#ff9b92,#db5251);border:1px solid #ffb7a2;box-shadow:0 2px 0 #9d383a;color:white;font-size:17px;text-shadow:0 1px #a84041}






.tabletop-shell .assistance-status{margin:14px 8px 18px}.tabletop-shell .game-difficulty,.tabletop-shell .side-info{background:#fff4e5e8;border-color:#fff6;box-shadow:0 5px 0 #bd928267,0 10px 18px #68443c13}
.tabletop-shell .status-message{margin:12px 8px;color:#624c45}.tabletop-shell .square{stroke:#ffd451;fill:#ffd33d38;filter:drop-shadow(0 0 3px #ffd042)}.tabletop-shell .square.white{stroke:#91c4ff;fill:#709ee738;filter:drop-shadow(0 0 3px #accfff)}
.tabletop-shell .area-label{fill:#ffd64c;stroke:#914d22;stroke-width:3;paint-order:stroke fill;font-weight:900}
@media(min-width:1101px){body[data-view="game"]{background-image:url('./table.webp');background-size:cover;background-attachment:fixed}}
@media(max-width:1100px){.tabletop-shell{max-width:760px}.tabletop-shell .workspace{display:flex;flex-direction:column;gap:18px}.tabletop-shell .game-section,.tabletop-shell .game-sidebar{width:100%}.tabletop-shell .game-sidebar{padding-top:0}.tabletop-shell .game-difficulty{margin-top:15px}}
@media(max-width:600px){body[data-view="game"] header{padding:9px 14px;height:59px}body[data-view="game"] header .text-button{min-height:38px;font-size:11px;padding:8px 10px;border-radius:12px}body[data-view="game"] header .icon{width:15px;height:15px}.tabletop-shell{padding:0 13px 25px}.tabletop-hero{margin-bottom:16px;padding-bottom:8px}.tabletop-duel{grid-template-columns:minmax(0,1fr) minmax(120px,1.22fr) minmax(0,1fr);margin-top:-6px}.tabletop-mascot>.character-figure{width:106px;height:106px}.tabletop-mascot>strong{font-size:12px;padding:2px 9px;border-radius:7px}.tabletop-score{border-width:2px;border-radius:17px;padding:8px 4px 16px;margin:0 -6px 8px}.tabletop-score-values{font-size:40px;gap:5px}.tabletop-mode{font-size:10px;padding:3px 8px;bottom:-12px}.tabletop-score>small{font-size:8px;top:calc(100% + 19px)}.tabletop-burst{font-size:23px;bottom:-20px;padding:1px 12px}.tabletop-shell .board-scene{padding-bottom:25px}.board-turn-plaque{left:19%;right:19%;bottom:7px;font-size:17px;min-height:24px}.turn-triangle{border-left-width:5px;border-right-width:5px;border-top-width:9px}.tabletop-shell .toolbar{gap:10px;margin:5px 3px 0}.tabletop-shell .toolbar button.secondary{font-size:15px;gap:5px;min-height:49px;border-radius:14px;padding:8px 4px}.tabletop-shell .toolbar .icon{width:21px;height:21px}.action-count{min-width:22px;height:24px;font-size:14px}}
@media(max-width:370px){.tabletop-duel{grid-template-columns:1fr 1.2fr 1fr}.tabletop-mascot>.character-figure{width:88px;height:88px}.tabletop-score-values{font-size:33px}.tabletop-shell .toolbar button.secondary{font-size:13px}.tabletop-shell .toolbar .icon{width:18px;height:18px}}

/* 提示按钮与另外两颗操作按钮使用同一蓝色材质。 */
.tabletop-shell .toolbar #hint{background:linear-gradient(#7296df,#3f69bd 42%,#27498c);color:#fff;box-shadow:inset 0 2px 2px #c3dbff80,0 5px 0 #1c376e,0 8px 9px #6e463c40}

@media(min-width:380px) and (max-width:600px){}
.tabletop-score-values.large-score{font-size:clamp(28px,4.5vw,52px)}@media(max-width:600px){.tabletop-score-values.large-score{font-size:30px}}@media(max-width:370px){.tabletop-score-values.large-score{font-size:25px}}

/* 4.2.2：比分紧邻棋盘，取消重复角色展示；电脑侧栏同步上移。 */
.tabletop-hero{margin-bottom:10px;padding-bottom:6px}
.tabletop-duel{margin-top:0}
.tabletop-shell .game-sidebar{padding-top:60px}
.tabletop-shell .assistance-status{margin-bottom:10px}
@media(max-width:1100px){.tabletop-shell .game-sidebar{padding-top:0}.tabletop-shell .workspace{gap:12px}}
@media(max-width:600px){.tabletop-hero{margin-bottom:10px;padding-bottom:6px}.tabletop-duel{margin-top:0}}

/* 4.2.2：抵消棋盘透视产生的上方空白，连同下方操作区一起上移。
   只调整文档流间距，不改变棋盘变换或落子坐标；窄屏保留角色与首行棋子的间隔。 */
.tabletop-hero{margin-bottom:4px;padding-bottom:2px}
.tabletop-shell .board-scene{margin-top:-32px}
@media(max-width:600px){.tabletop-shell .board-scene{margin-top:-14px}}

/* 4.2.2：桌面、角色底座和棋盘共用暖色接触阴影，滚动时保持同一桌面位置。 */
body[data-view="game"]{background-attachment:scroll;--desk-shadow:#603b32;--desk-perspective:1250px}
.tabletop-shell .board-panel{isolation:isolate}
.tabletop-shell .board-scene{perspective:var(--desk-perspective);padding-bottom:22px}
.tabletop-shell .board-scene:before{display:none}
.tabletop-shell .board-area{box-shadow:0 5px 0 #274b91,0 7px 3px #603b3259,4px 11px 10px #603b3240!important}
.tabletop-mascot{padding-bottom:12px}
.tabletop-mascot>.character-figure{filter:none}
.tabletop-mascot>.character-figure:before{content:'';position:absolute;left:8%;top:102%;width:87%;height:9%;border-radius:50%;background:#603b3257;filter:blur(2px);transform:skewX(-12deg);z-index:-1;pointer-events:none}
.tabletop-mascot .piece-base svg{filter:drop-shadow(1px 2px 1px #603b323d)}
/* 姓名印在底座前沿，不再悬浮成独立卡片；回合信息由棋盘前沿承担。 */
.tabletop-mascot>strong,.tabletop-mascot.player-2>strong{position:absolute;bottom:0;left:7%;right:7%;margin:0;padding:0 2px;background:none;border:0;border-radius:0;box-shadow:none;text-align:center;font-size:14px;line-height:1.2;color:#66470f;text-shadow:0 1px #fff3;z-index:4}
.tabletop-mascot.player-2>strong{color:#fff7df;text-shadow:0 1px #243f75}
.tabletop-mascot.is-turn:after{display:none}
/* SVG 底座下层圆心：85% + 24% × (28 / 36) = 103.6667%。
   锚点、旋转中心都使用该圆心，移除额外 Z 偏移，8/9 路及所有角色共用。 */
.piece{transform-origin:50% 103.6667%;transform:translate(-50%,-103.6667%) rotateX(-23deg)}
.mini-piece{transform-origin:50% 103.6667%;transform:translate(-50%,-103.6667%) rotateX(-43deg)}
.piece .piece-base svg{filter:drop-shadow(.5px 1px .6px #603b323d)}
/* 顶栏贴近概念图：短返回、排行榜、方形齿轮；小外观保留44px触摸区。 */
body[data-view="game"] header{height:54px;padding-top:8px;padding-bottom:8px}
body[data-view="game"] header .text-button{position:relative;min-height:34px;height:34px;padding:6px 11px;border-radius:10px;font-size:12px;gap:5px;box-shadow:inset 0 1px 1px #d2e2ff75,0 2px 0 #19376d,0 4px 5px #633b312e}
body[data-view="game"] header .icon{width:16px;height:16px}
body[data-view="game"] header #back{background:linear-gradient(#6689d5,#315698);color:#fff;border-color:#91acf0;box-shadow:inset 0 1px 1px #d2e2ff75,0 2px 0 #19376d,0 4px 5px #633b312e}
body[data-view="game"] header #settings{width:36px;min-width:36px;padding:7px}
body[data-view="game"] header .header-tools{gap:10px}
body[data-view="game"] header .text-button:after{content:'';position:absolute;left:0;right:0;top:50%;height:44px;transform:translateY(-50%);background:transparent}
/* 扁操作按钮与较薄侧壁，同时保留独立44px点击范围。 */
.tabletop-shell .toolbar button.secondary{position:relative;min-height:44px;height:44px;padding:6px 9px;border-radius:12px;font-size:17px;box-shadow:inset 0 1px 2px #c3dbff80,0 3px 0 #1c376e,0 5px 5px #6e463c30}
.tabletop-shell .toolbar #hint{box-shadow:inset 0 1px 2px #c3dbff80,0 3px 0 #1c376e,0 5px 5px #6e463c30}
.tabletop-shell .toolbar .icon{width:22px;height:22px}
.tabletop-shell .action-count{min-width:23px;height:24px;font-size:14px}
.tabletop-shell .toolbar button:after{content:'';position:absolute;left:0;right:0;top:50%;height:44px;transform:translateY(-50%);background:transparent}
@media(max-width:600px){
 body[data-view="game"] header{height:49px;padding:7px 14px}
 body[data-view="game"] header .text-button{min-height:32px;height:32px;padding:5px 9px;font-size:11px;border-radius:9px}
 body[data-view="game"] header #settings{width:34px;min-width:34px;padding:6px}
 body[data-view="game"] header .icon{width:15px;height:15px}
 .tabletop-mascot>strong,.tabletop-mascot.player-2>strong{font-size:11px}
 .tabletop-shell .board-scene{padding-bottom:19px;margin-top:-8px}
 .tabletop-shell .toolbar button.secondary{min-height:38px;height:38px;padding:4px 5px;font-size:14px;border-radius:10px}
 .tabletop-shell .toolbar .icon{width:18px;height:18px}
 .tabletop-shell .action-count{min-width:20px;height:21px;font-size:12px}
}

/* 4.2.2：棋子先作为完整的2D图层合成，再随棋盘整体倾斜。
   保留103.6667%的底盘圆心，scaleY抵消23度俯视缩短；不把底盘旋入棋盘背面。 */
.tabletop-shell .board-area,.tabletop-shell .cell-grid,.tabletop-shell .cell{transform-style:flat}
.tabletop-shell .cell-grid{z-index:5}
.tabletop-shell .piece{transform-style:flat;transform-origin:50% 103.6667%;transform:translate(-50%,-103.6667%) scaleY(1.08636);z-index:2}
.tabletop-shell .piece .piece-base{z-index:0}
.tabletop-shell .score-overlay{z-index:6}
/* 所有页面统一固定顶栏，容器留出安全区；按钮之间的空白不拦截页面操作。 */
#app{padding-top:calc(62px + env(safe-area-inset-top,0px))}
html{scroll-padding-top:calc(70px + env(safe-area-inset-top,0px))}
body #app>header.floating-topbar{position:fixed;inset:auto;top:calc(5px + env(safe-area-inset-top,0px));left:50%;transform:translateX(-50%);width:calc(100% - 28px);max-width:1096px;height:44px;padding:5px 0;margin:0;display:flex;justify-content:space-between;align-items:center;background:none;border:0;box-shadow:none;backdrop-filter:none;z-index:1000;pointer-events:none}
body #app>header.floating-topbar nav{display:flex;width:auto;gap:10px;pointer-events:none}
body #app>header.floating-topbar .text-button{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:5px;height:34px;min-height:34px;padding:6px 11px;border-radius:10px;font-size:12px;background:linear-gradient(#6689d5,#315698);color:#fff;border:1px solid #91acf0;box-shadow:inset 0 1px 1px #d2e2ff75,0 2px 0 #19376d,0 4px 5px #633b3140;pointer-events:auto}
body #app>header.floating-topbar .icon{display:block;width:16px;height:16px;flex:none;fill:none;stroke:currentColor}
body #app>header.floating-topbar #settings{width:36px;min-width:36px;padding:0;gap:0}
body #app>header.floating-topbar .text-button:after{content:'';position:absolute;left:0;right:0;top:50%;height:44px;transform:translateY(-50%);background:transparent}
@media(max-width:600px){
 #app{padding-top:calc(55px + env(safe-area-inset-top,0px))}
 html{scroll-padding-top:calc(63px + env(safe-area-inset-top,0px))}
 body #app>header.floating-topbar{width:calc(100% - 28px);height:42px;top:calc(3px + env(safe-area-inset-top,0px))}
 body #app>header.floating-topbar .text-button{height:32px;min-height:32px;padding:5px 9px;font-size:11px;border-radius:9px}
 body #app>header.floating-topbar .icon{width:15px;height:15px}
 body #app>header.floating-topbar #settings{width:34px;min-width:34px;padding:0}
}

/* 4.2.2：使用概念图立体贴牌原有的字形、颜色、斜度及彩纸；不再叠加SVG描边。 */
.board-burst{position:absolute;left:50%;top:1%;width:clamp(158px,40.5%,273px);aspect-ratio:2/1;z-index:20;pointer-events:none;transform:translate(-50%,-45%);transform-origin:50% 75%;filter:drop-shadow(1px 2px 1px #6b3a2529);animation:board-burst-stamp 1600ms both}
.board-burst img{display:block;width:100%;height:auto;max-width:none;pointer-events:none;user-select:none}
@keyframes board-burst-stamp{0%{opacity:0;transform:translate(-50%,-45%) scale(.88)}12%{opacity:1;transform:translate(-50%,-45%) scale(1.04)}23%,80%{opacity:1;transform:translate(-50%,-45%) scale(1)}100%{opacity:0;transform:translate(-50%,-45%) scale(.99)}}
@media(prefers-reduced-motion:reduce){.board-burst{animation:none;transform:translate(-50%,-45%)}}

/* 4.2.2：补偿棋盘透视带来的纵向压缩，保持原素材的立体字面和透明边缘。 */
.board-burst{top:calc(1% - 5px)}
.board-burst img{transform:scaleY(1.22);transform-origin:50% 50%}
/* 姓名直接嵌入底座SVG侧壁，横向居中并随底盘整体缩放。 */
.tabletop-mascot{padding-bottom:clamp(12px,1.65vw,20px)}
.tabletop-mascot .base-name{font-family:'Microsoft YaHei','PingFang SC',sans-serif;font-weight:900;fill:#654311;stroke:none;letter-spacing:.3px;paint-order:stroke fill;text-shadow:0 .35px .15px #fff5}
.tabletop-mascot.player-2 .base-name{fill:#fff2d4;text-shadow:0 .5px .3px #26477c}

/* 4.2.2：首页没有左侧按钮时，排行榜和设置仍靠右悬浮。 */
body #app>header.floating-topbar .header-tools{margin-left:auto}


/* 4.2.9：规则与新手演示采用统一黄方配色，深金文字保证浅底可读。 */
.rule-example{background:linear-gradient(150deg,#fffdf3,#fff0bb)}
.rule-example b,.tutorial-formula{color:#805a0b}
.tutorial-copy .tutorial-caption{color:#866317}
.tutorial-visual{border-color:#e0c476;background:linear-gradient(140deg,#fffaf0,#f9e9b7)}
.demo-square{fill:#ffd84d45;stroke:#c39119}
.demo-points{fill:#805a0b;stroke:#fff8df}
