.arcade-root{position:fixed;inset:0;z-index:9000;color:#3f5645;background:#e8eee5;font-family:"Microsoft YaHei",system-ui;overflow:hidden;touch-action:none}.arcade-root *{box-sizing:border-box}.arcade-root [hidden]{display:none!important}.arcade-root button{font:inherit;cursor:pointer;touch-action:manipulation;min-height:40px;padding:8px 14px;color:#486954;background:#fffaf0;border:1px solid #d1c2a4;border-radius:5px}.arcade-root button:focus-visible{outline:2px solid #aa8549;outline-offset:3px}.arcade-play{position:absolute;inset:0;overflow:hidden}.arcade-canvas,.arcade-three{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none}.arcade-head{position:absolute;top:max(18px,env(safe-area-inset-top));right:12px;z-index:10;display:flex;gap:7px}.arcade-head button{width:40px;height:40px;padding:0;background:#fffaf0dc;border:0;font-size:20px;position:relative}.arcade-sound.muted:after{content:'';position:absolute;width:26px;height:2px;background:currentColor;transform:rotate(-45deg);right:7px;top:19px}.arcade-hud{position:absolute;top:max(18px,env(safe-area-inset-top));left:12px;display:flex;align-items:center;gap:16px;z-index:5;padding:8px 12px;background:#fffaf0ee;border-radius:6px;max-width:calc(100% - 112px);box-shadow:0 3px 16px #27453110;pointer-events:none}.arcade-hud>div{min-width:0}.arcade-hud small{display:block;font-size:9px;letter-spacing:1px;color:#8a795b;margin-bottom:4px}.arcade-hud b{display:block;font:600 24px Georgia,serif;line-height:1}.arcade-hud #arcade-goal{font-size:11px;color:#557b5e;max-width:110px;line-height:1.6}.arcade-feedback{position:absolute;left:50%;top:16%;transform:translate(-50%,-8px);opacity:0;transition:opacity .2s,transform .2s;pointer-events:none;background:#fffaf0e8;padding:8px 12px;border-radius:5px;white-space:nowrap;font-size:12px;z-index:20}.arcade-feedback.on{opacity:1;transform:translate(-50%,0)}.arcade-dialog{position:absolute;bottom:max(76px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);z-index:30;display:flex;flex-direction:column;align-items:stretch;width:min(calc(100% - 24px),420px);max-height:calc(100% - 115px);overflow:auto;background:#f8f4e9;border:1px solid #d1c2a4;border-radius:16px;box-shadow:0 8px 32px #223b3528;padding:14px;text-align:left}.arcade-dialog h2{font:600 18px 'Songti SC',SimSun,serif;margin:0 0 18px;letter-spacing:1px}.arcade-dialog p:empty{display:none}.arcade-dialog p{font-size:12px;line-height:1.65;color:#8a795b}.arcade-dialog-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:center}.arcade-dialog-actions button{flex:1;white-space:nowrap;font-size:13px}.arcade-dialog-actions button:first-child{background:#486954;color:#fff9e5;border-color:#486954}.arcade-audio-settings{display:flex;flex-direction:column;gap:10px;margin:0 0 18px}.arcade-audio-settings label{display:flex;align-items:center;justify-content:space-between;font-size:14px}.arcade-audio-settings input[type=checkbox]{accent-color:#2ca0ad;width:20px;height:20px}.arcade-audio-settings input[type=range]{accent-color:#8b7547;width:100%}.arcade-foot{position:absolute;bottom:max(22px,env(safe-area-inset-bottom));left:0;width:100%;pointer-events:none;z-index:4}.bridge-charge{width:196px;margin:auto;background:#fffaf0e6;border:1px solid #d5c7a5;border-radius:9px;padding:10px 12px;box-shadow:0 4px 18px #254f3020}.bridge-charge-numbers{display:flex;justify-content:space-between;gap:14px;margin-bottom:8px;font:11px system-ui;color:#56795f;font-variant-numeric:tabular-nums}.bridge-meter{height:5px;width:100%;border-radius:6px;background:#dbe4d6;overflow:hidden}.bridge-meter i{display:block;height:100%;background:linear-gradient(90deg,#709e82,#dfb967);width:0}.arcade-result{top:5%;bottom:5%;max-height:90%;border-radius:12px;width:min(calc(100% - 32px),440px);padding:24px;background:linear-gradient(140deg,#fffdf5,#f1eadb);text-align:center;align-items:center;gap:12px}.arcade-result:before{content:'';width:40px;height:2px;background:#b39253;flex:none}.arcade-result h2{font:500 27px 'Songti SC',SimSun,serif;letter-spacing:3px;margin:5px 0}.arcade-result .result-honor{font-size:13px;color:#997438;margin:0}.arcade-result-score{display:flex;flex-direction:column;gap:4px}.arcade-result-score small{font-size:10px;letter-spacing:3px;color:#8a795b}.arcade-result-score strong{font:500 48px Georgia,serif;color:#3e634f}.arcade-result-score span{font-size:11px;color:#8c836e}.result-memento{min-height:80px;flex:1;overflow:hidden;width:100%;background:#e3ebe2;border:1px solid #d2c6ab;border-radius:6px;display:flex;justify-content:center}.result-memento canvas{max-width:100%;max-height:100%;object-fit:contain;height:100%;display:block}.arcade-result .arcade-dialog-actions{width:100%;flex:none}.merge-gift-open{width:100%;background:#efe1bb!important;color:#7a5f37!important;font-size:13px!important;flex:none}.settled .arcade-head,.settled .arcade-hud,.settled .arcade-foot{visibility:hidden}.merge-gift-sheet{position:absolute;z-index:45;inset:0;background:#f7f2e9;display:flex;flex-direction:column;gap:10px;padding:max(12px,env(safe-area-inset-top)) 16px max(14px,env(safe-area-inset-bottom));overflow:auto;touch-action:pan-y}.merge-gift-sheet header{display:flex;align-items:center;justify-content:space-between;flex:none}.merge-gift-sheet h2{font:500 19px 'Songti SC',SimSun,serif;letter-spacing:2px;margin:0}.arcade-root .merge-gift-close{border:0;background:none;font-size:28px;min-width:44px;padding:0}.merge-gift-preview{flex:1;min-height:140px;display:flex;align-items:center;justify-content:center;overflow:hidden;color:#9c8669}.merge-gift-preview canvas{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;box-shadow:0 6px 25px #5b452025}.merge-gift-fields{display:grid;grid-template-columns:1fr;gap:7px;max-width:520px;width:100%;margin:0 auto;flex:none}.merge-gift-fields input{font:13px system-ui;border:1px solid #ddcfb6;background:#fffdf8;border-radius:5px;min-height:40px;padding:10px 12px;width:100%;color:#6c5845}.merge-gift-actions{display:flex;gap:10px;justify-content:center;flex:none}.merge-gift-actions button{width:min(45%,250px)}.merge-gift-actions button:last-child{background:#486954;color:#fff9e5;border-color:#486954}@media(max-width:380px){.arcade-hud{gap:8px;padding:8px}.arcade-hud b{font-size:20px}.arcade-hud #arcade-goal{font-size:10px;max-width:85px}.arcade-result{padding:18px}}@media(min-aspect-ratio:4/3) and (max-height:600px){.arcade-result{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto auto auto 1fr auto;gap:8px;width:min(90%,780px)}.arcade-result:before{display:none}.result-memento{grid-column:2;grid-row:1/6;height:100%}.arcade-result h2{font-size:22px}.arcade-result-score strong{font-size:38px}.merge-gift-sheet{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto 1fr auto}.merge-gift-sheet header{grid-column:1/-1}.merge-gift-preview{grid-row:2/4}.merge-gift-fields{align-content:center}}@media(prefers-reduced-motion:reduce){.arcade-feedback{transition:none}}

.arcade-ranking-button{order:-1}.arcade-ranking-button svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.6}
.arcade-rank-panel{position:absolute;z-index:9;right:8px;top:76px;width:176px;padding:7px 9px;color:#304f40;background:#fffcf0b8;border:1px solid #ffffff90;border-radius:10px;box-shadow:0 2px 9px #26382b18;pointer-events:none;font:12px system-ui;max-height:154px}
.arcade-rank-panel nav{display:flex;gap:3px;align-items:center;border-bottom:1px solid #8198853b;padding-bottom:4px}.arcade-rank-panel button{pointer-events:auto;border:0;border-radius:5px;background:transparent;color:inherit;min-height:28px;padding:3px 8px;font:12px system-ui}.arcade-rank-panel button.on{background:#557e5620;font-weight:600}.arcade-rank-panel [data-rank="close"]{margin-left:auto;font-size:19px;padding:0 6px}.arcade-rank-panel ol{list-style:none;padding:0;margin:5px 0}.arcade-rank-panel li{display:flex;justify-content:space-between;gap:7px;line-height:23px}.arcade-rank-panel li span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:115px}.arcade-rank-panel small{display:block;font-size:10px;line-height:17px;color:#527160}
/* Compact content-sized results; both preview and controls have explicit bounds. */
.arcade-result{top:50%;bottom:auto;transform:translate(-50%,-50%);max-height:calc(100% - 32px);height:auto;padding:20px;gap:10px}.result-memento{flex:none;height:min(34dvh,300px);min-height:100px;width:100%;border:0;background:transparent;align-items:center}.result-memento canvas{max-width:100%;max-height:100%;height:auto;width:auto;border-radius:5px;border:1px solid #d2c6ab}.arcade-result-score strong{font-size:42px}.arcade-result .arcade-dialog-actions button,.arcade-result .merge-gift-open{min-height:42px;max-height:48px}.merge-gift-sheet{display:flex;flex-direction:column;min-height:0}.merge-gift-preview{min-height:0;flex:1;align-items:center;justify-content:center}.merge-gift-preview canvas{flex:none;max-width:100%;max-height:100%}.merge-gift-actions{height:48px;min-height:48px;max-height:48px;width:100%;align-items:stretch}.merge-gift-actions button{height:48px;min-height:48px;max-height:48px;white-space:nowrap;flex:1;max-width:250px;font-size:14px;padding:8px}.merge-gift-sheet h2{font-size:18px}.merge-gift-fields{gap:6px}.merge-gift-fields input{min-height:38px;height:38px;padding:8px 10px}
@media(min-aspect-ratio:4/3) and (max-height:600px){.arcade-result{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto auto auto auto auto;max-height:calc(100% - 24px)}.result-memento{height:min(65dvh,300px);grid-row:1/6}.merge-gift-sheet{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto minmax(0,1fr) 48px}.merge-gift-preview{grid-column:1;grid-row:2/4}.merge-gift-actions{grid-column:2;grid-row:3}.merge-gift-fields{grid-column:2;grid-row:2}.merge-gift-sheet:not(:has(form)) .merge-gift-preview{grid-column:1/-1;grid-row:2}.merge-gift-sheet:not(:has(form)) .merge-gift-actions{grid-column:1/-1;grid-row:3}}

/* Merge settlement uses the very same high-resolution gift illustration as sharing. */
.merge-result h2,.merge-result .result-honor,.merge-result .arcade-result-score,.merge-result:before{display:none}.merge-result .result-memento{height:auto;min-height:0;aspect-ratio:9/16;max-height:calc(100dvh - 180px);width:100%}.merge-result .result-memento canvas{max-height:100%;border:0;border-radius:0}.merge-result{gap:10px;padding:12px;width:min(calc(100% - 24px),430px)}
@media(min-aspect-ratio:4/3) and (max-height:600px){.merge-result{width:min(calc(100% - 24px),700px);grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:1fr auto;gap:16px}.merge-result .result-memento{grid-column:1;grid-row:1/3;max-height:calc(100dvh - 60px)}.merge-result .arcade-dialog-actions{flex-direction:column;grid-column:2;grid-row:1;align-self:end}.merge-result .merge-gift-open{grid-column:2;grid-row:2}}

.merge-settled{background:#f7f2e9}.merge-settled .arcade-canvas{visibility:hidden}

.arcade-canvas,.arcade-three{touch-action:none;user-select:none;-webkit-user-select:none}.arcade-root{overscroll-behavior:none}

/* One compact top row: metrics and controls share the same height at every width. */
.arcade-topline{position:absolute;z-index:10;top:max(18px,env(safe-area-inset-top));left:12px;right:12px;display:flex;align-items:center;gap:6px;height:36px;pointer-events:none}.arcade-topline .arcade-head{position:static;display:flex;align-items:center;gap:5px;flex:none;height:36px;pointer-events:auto}.arcade-topline .arcade-head button{width:36px;height:36px;min-height:36px;max-height:36px;padding:0;font-size:19px}.arcade-topline .arcade-hud{position:static;display:flex;align-items:center;justify-content:space-between;flex:1;min-width:0;max-width:none;gap:4px;height:36px;padding:4px 6px;box-shadow:0 2px 10px #2745310b}.arcade-hud small{font-size:9px;line-height:10px;margin-bottom:1px;letter-spacing:0}.arcade-hud b{font-size:clamp(14px,4.4vw,18px);line-height:17px;font-variant-numeric:tabular-nums;white-space:nowrap}.arcade-hud #arcade-goal{font-size:10px;line-height:12px;max-width:72px;text-align:center}.arcade-rank-panel{top:calc(max(18px,env(safe-area-inset-top)) + 44px)}@media(max-width:350px){.arcade-topline{left:8px;right:8px;gap:4px}.arcade-topline .arcade-head{gap:3px}.arcade-topline .arcade-head button{width:34px}.arcade-hud #arcade-goal{max-width:46px;font-size:9px}}

.arcade-topline{top:max(18px,env(safe-area-inset-top),var(--native-safe-top,0px));left:max(12px,var(--native-safe-left,0px));right:max(12px,var(--native-safe-right,0px))}.arcade-rank-panel{top:calc(max(18px,env(safe-area-inset-top),var(--native-safe-top,0px)) + 44px)}@media(max-width:350px){.arcade-topline{left:max(8px,var(--native-safe-left,0px));right:max(8px,var(--native-safe-right,0px))}}
