/* Shared compact toolbar for the modern game interfaces. SDK owns behavior. */
:is(.zh-stars,.zh-pairs,.zh-islands).zh-game-active .zh-shell-toolbar{display:flex;flex-wrap:nowrap;gap:8px;margin:0;min-height:48px}
:is(.zh-stars,.zh-pairs,.zh-islands) .zh-shell-toolbar .zh-shell-hud{min-width:0;margin:0;padding:0;border:0;background:transparent;gap:8px;flex:none;width:190px;border-radius:0}
:is(.zh-stars,.zh-pairs,.zh-islands) .zh-shell-toolbar .zh-shell-hud img{width:38px;height:38px}
:is(.zh-stars,.zh-pairs,.zh-islands) .zh-shell-toolbar .zh-shell-hud strong{font-size:10px;letter-spacing:.03em}
:is(.zh-stars,.zh-pairs,.zh-islands) .zh-shell-toolbar .zh-shell-hud small{font-size:10px;color:#a8bfd8}
:is(.zh-stars,.zh-pairs,.zh-islands) .zh-shell-toolbar .zh-shell-hud>div{gap:3px}
:is(.zh-stars,.zh-pairs,.zh-islands) .zh-shell-toolbar .zh-shell-hud progress{height:4px}
.zh-arcade-title{margin:auto;font-size:17px;letter-spacing:.01em;color:#e7f3ff}
:is(.zh-stars,.zh-pairs,.zh-islands) .zh-shell-toolbar>[data-streak],:is(.zh-stars,.zh-pairs,.zh-islands) .zh-shell-toolbar>[data-clock]{font-size:12px;color:#afc6dc;font-variant-numeric:tabular-nums}
:is(.zh-stars,.zh-pairs,.zh-islands) .zh-shell-toolbar>button{display:grid;place-items:center;flex:none;width:44px;height:44px;min-height:44px;padding:0;border:1px solid #b6dcff25;border-radius:14px;background:#b6dcff0d;color:#deefff;font-size:23px}
:is(.zh-stars,.zh-pairs,.zh-islands) .zh-shell-toolbar>button:hover{background:#b6dcff20}
:is(.zh-stars,.zh-pairs,.zh-islands) .zh-shell-toolbar>button:focus-visible,.zh-stars-controls button:focus-visible{outline:3px solid #ffd34f;outline-offset:2px}
@media(max-width:600px){
 .zh-arcade-title,:is(.zh-stars,.zh-pairs,.zh-islands) .zh-shell-toolbar>[data-streak]{display:none}
 :is(.zh-stars,.zh-pairs,.zh-islands) .zh-shell-toolbar .zh-shell-hud{width:auto;flex:1;min-width:0}
 :is(.zh-stars,.zh-pairs,.zh-islands) .zh-shell-toolbar .zh-shell-hud img{width:30px;height:30px}
 :is(.zh-stars,.zh-pairs,.zh-islands) .zh-shell-toolbar .zh-shell-hud strong{font-size:8px}
 :is(.zh-stars,.zh-pairs,.zh-islands).zh-game-active .zh-shell-toolbar{gap:6px}
 :is(.zh-stars,.zh-pairs,.zh-islands) .zh-shell-toolbar>[data-clock]{font-size:10px}
}
@media(max-height:550px) and (min-width:600px){.zh-arcade-title{font-size:14px}}
.zh-game-shell .zh-shell-hud strong{white-space:normal;overflow-wrap:anywhere;text-transform:none}.zh-game-shell .zh-shell-hud>div{min-width:0}

/* Shared game result screen; rules retain their own lightweight dialog. */
dialog.zh-adventure-result{width:min(650px,calc(100% - 24px));max-height:calc(100dvh - 28px);padding:30px 34px 28px;border:2px solid #82d5ed;border-radius:32px;background:radial-gradient(ellipse at 50% 0,#33759c 0,transparent 62%),linear-gradient(150deg,#123d60,#071f36);color:#e2f5ff;box-shadow:0 0 0 6px #0b2945,0 0 0 8px #d8b36888,0 28px 100px #000a,inset 0 2px 0 #e6faff55;text-align:center}
dialog.zh-adventure-result::backdrop{background:#031727b5;backdrop-filter:blur(5px)}
.zh-adventure-result .zh-result-kicker{margin:0 0 8px;color:#9be5ef;font-size:11px;font-weight:900;letter-spacing:.23em}
.zh-adventure-result h2{margin:0;color:#fff0ba;font-size:clamp(28px,5vw,40px);font-weight:900;text-shadow:0 3px 0 #082138;line-height:1.2}
.zh-adventure-result .zh-level-rating{display:flex;justify-content:center;align-items:center;gap:12px;margin:22px 0 16px;min-height:88px}
.zh-rating-text{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.zh-victory-star{display:block;width:78px;height:78px;color:#506d80;filter:grayscale(1);opacity:.55}
.zh-victory-star:nth-of-type(3){width:98px;height:98px}
.zh-victory-star svg{width:100%;height:100%;display:block}
.zh-victory-star.is-earned{color:#ffd25b;opacity:1;filter:drop-shadow(0 4px 0 #97651f) drop-shadow(0 0 15px #ffc84755);animation:zh-star-arrive .55s var(--star-delay) both}
@keyframes zh-star-arrive{from{transform:scale(.4) rotate(-16deg);opacity:0}70%{transform:scale(1.12) rotate(3deg)}to{transform:scale(1) rotate(0);opacity:1}}
.zh-adventure-result [data-copy]{font-size:14px;line-height:1.6;color:#bad8e8;margin:12px auto 18px;max-width:490px}
.zh-result-rewards{display:flex;justify-content:center;gap:10px;margin:0 0 20px}
.zh-reward-card{display:grid;grid-template-columns:30px auto;align-items:center;gap:3px 7px;padding:12px 14px;border:1px solid #b2defb3d;border-radius:16px;background:linear-gradient(#255777,#153c59);box-shadow:inset 0 1px 0 #ffffff1a;flex:1;max-width:180px}
.zh-reward-symbol{grid-row:1/3;display:grid;place-items:center;color:#ffdf7f;font-size:12px;font-weight:900}
.zh-reward-symbol svg{width:30px;height:30px}
.zh-reward-card strong{font-size:24px;color:#ffe3a1;line-height:1}
.zh-reward-card small{font-size:10px;color:#bcd7e4;line-height:1.3}
.zh-result-saved{margin:0;padding:10px 16px;color:#aed3df;font-size:12px;border:1px solid #75bfd52b;border-radius:14px}
.zh-adventure-result .zh-shell-hud{min-width:0;justify-content:center;text-align:left;padding:17px 20px;background:#071f35b3;border:1px solid #76c9e955;border-radius:20px;box-shadow:inset 0 2px 10px #0002}
.zh-adventure-result .zh-shell-hud>div{flex:1;min-width:0}
.zh-adventure-result .zh-shell-hud strong{color:#eaf8ff}
.zh-adventure-result .zh-shell-hud small{color:#afcede}
.zh-adventure-result .zh-shell-hud progress{height:12px}
.zh-adventure-result [data-unlocks]{color:#ffe09a;font-size:13px;margin:14px 0}
.zh-adventure-result [data-unlocks]:empty{display:none}
.zh-adventure-result button{min-height:48px;padding:12px 24px;margin:18px 5px 4px;border:1px solid #b5ecff;border-radius:15px;background:linear-gradient(#4f9aba,#296587);color:#fff;font-weight:900;box-shadow:0 4px 0 #062138,inset 0 2px 0 #ffffff40;text-shadow:0 1px 1px #15394f;cursor:pointer}
.zh-adventure-result button[data-again]{background:linear-gradient(#ffe38a,#efb53f);border-color:#fff0b4;color:#4e3516;text-shadow:none;box-shadow:0 4px 0 #976323,inset 0 2px 0 #fff6c4}
.zh-adventure-result button:hover{filter:brightness(1.12)}
.zh-adventure-result button:active{transform:translateY(3px);box-shadow:none}
.zh-adventure-result button:focus-visible{outline:3px solid #fff3b9;outline-offset:4px}
.zh-adventure-result[data-outcome="failure"] h2{color:#c4eaff}
@media(max-width:480px){dialog.zh-adventure-result{padding:22px 16px;border-radius:24px}.zh-adventure-result .zh-level-rating{gap:8px;margin:16px 0}.zh-victory-star{width:64px;height:64px}.zh-victory-star:nth-of-type(3){width:80px;height:80px}.zh-result-rewards{gap:6px;flex-wrap:wrap}.zh-reward-card{padding:10px 7px;min-width:70px;grid-template-columns:1fr}.zh-reward-symbol{grid-row:auto}.zh-reward-card strong{font-size:22px}.zh-adventure-result .zh-shell-hud{padding:12px;gap:10px}.zh-adventure-result button{padding:12px 16px;font-size:14px}}
@media(prefers-reduced-motion:reduce){.zh-victory-star.is-earned{animation:none}}
/* Short landscape screens: keep the complete result readable above the controls. */
@media (max-height:540px) and (min-width:481px){
 dialog.zh-adventure-result{width:min(780px,calc(100% - 32px));max-height:calc(100dvh - 24px);padding:12px 20px 14px;border-radius:22px;scroll-padding:10px;overscroll-behavior:contain}
 .zh-adventure-result .zh-result-kicker{font-size:9px;margin:0 0 3px}
 .zh-adventure-result h2{font-size:27px;line-height:1.1}
 .zh-adventure-result .zh-level-rating{min-height:0;gap:10px;margin:6px 0}
 .zh-adventure-result .zh-victory-star{width:42px;height:42px}
 .zh-adventure-result .zh-victory-star:nth-of-type(3){width:52px;height:52px}
 .zh-adventure-result [data-copy]{max-width:680px;font-size:12px;line-height:1.35;margin:5px auto 8px}
 .zh-adventure-result .zh-result-rewards{margin:0 0 8px;gap:8px}
 .zh-adventure-result .zh-result-saved{padding:6px 10px;font-size:11px}
 .zh-adventure-result .zh-reward-card{padding:6px 10px;gap:2px 7px;max-width:190px}
 .zh-adventure-result .zh-reward-card strong{font-size:19px}
 .zh-adventure-result .zh-reward-symbol svg{width:24px;height:24px}
 .zh-adventure-result .zh-shell-hud{padding:7px 12px;gap:10px;border-radius:14px}
 .zh-adventure-result .zh-shell-hud img{width:42px;height:42px}
 .zh-adventure-result .zh-shell-hud strong{font-size:12px;overflow-wrap:anywhere}
 .zh-adventure-result .zh-shell-hud small{font-size:10px}
 .zh-adventure-result .zh-shell-hud>div{gap:3px}
 .zh-adventure-result .zh-shell-hud progress{height:8px}
 .zh-adventure-result [data-unlocks]{font-size:11px;margin:6px 0}
 .zh-adventure-result button{min-height:44px;padding:9px 14px;margin:9px 4px 3px;font-size:13px;border-radius:12px}
}
@media (max-height:540px) and (min-width:481px){
 .zh-adventure-result .zh-result-kicker{display:none}
 .zh-adventure-result .zh-shell-hud{line-height:1.2}
 .zh-adventure-result [data-unlocks]{line-height:1.25;margin:4px 0}
 .zh-adventure-result button{line-height:1.2;margin-top:6px}
}
@media (max-height:360px) and (min-width:481px){
 dialog.zh-adventure-result{padding:8px 16px 10px}
 .zh-adventure-result .zh-level-rating{margin:3px 0}
 .zh-adventure-result .zh-victory-star{width:32px;height:32px}
 .zh-adventure-result .zh-victory-star:nth-of-type(3){width:40px;height:40px}
 .zh-adventure-result .zh-shell-hud{padding:5px 10px}
 .zh-adventure-result .zh-shell-hud img{width:36px;height:36px}
 .zh-adventure-result .zh-reward-card{padding:4px 8px}
}
@media (max-height:340px) and (min-width:481px){
 dialog.zh-adventure-result{padding-top:5px;padding-bottom:6px}
 .zh-adventure-result h2{font-size:24px}
 .zh-adventure-result [data-copy]{font-size:11px;line-height:1.25;margin-bottom:5px}
}

/* Explicit game-menu selection: programmatic gamepad focus is not always :focus-visible. */
.zh-game-shell .zh-result-dialog button.is-menu-selected{position:relative;outline:3px solid #fff4bc;outline-offset:4px;box-shadow:0 0 0 7px #153d55,0 0 22px 6px #8be8ff99,inset 0 0 0 2px #fff7d6}
.zh-game-shell .zh-result-dialog button.is-menu-selected::after{content:"";position:absolute;left:50%;top:-15px;transform:translateX(-50%);width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:7px solid #fff4bc;pointer-events:none}
