#challengeOverlay, #challengeHud {
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    color: #fff7e7;
}
#challengeOverlay[hidden], #challengeOverlay [hidden], #challengeHud[hidden] { display: none; }
#challengeOverlay {
    position: absolute; inset: 0; z-index: 45; display: grid; place-items: center;
    container-type: size; background: rgba(19, 12, 7, .34); touch-action: manipulation;
}
.challenge-card {
    position: relative; isolation: isolate; container-type: inline-size;
    width: min(86cqw, 74cqh, 338px); aspect-ratio: 250 / 311;
    color: #fff5d2; text-align: center; font-weight: 900;
    filter: drop-shadow(0 3px 2px #1c100c7a);
    -webkit-tap-highlight-color: transparent; user-select: none;
}
.round-logo {
    position: absolute; top: 2%; left: 12%; width: 76%; height: 26%;
    object-fit: contain; pointer-events: none; opacity: 1;
}
.round-heading, .round-stats, #roundScore, .arcade-action b, #adError {
    paint-order: stroke fill; -webkit-text-stroke: .12em #361b0e;
    text-shadow: .025em .09em 0 #27160c;
}
.round-heading, .round-stats, #roundScore, .round-actions, #challengeItems, #adError {
    position: absolute; left: 0; width: 100%; margin: 0;
}
.round-heading, .round-stats, .round-actions, #challengeItems {
    display: flex; align-items: center; justify-content: center;
}
.round-heading { top: 29%; gap: 2.7cqw; line-height: 1.12; }
#challengeRound { font-size: 7.8cqw; }
#roundCity { font-size: 4.8cqw; color: #ffe0a1; }
.round-stats { top: 39.4%; gap: 3.1cqw; line-height: 1; }
#challengeTitle { margin: 0; font-size: 6.3cqw; font-weight: 900; }
#roundBalls { display: inline-flex; align-items: center; gap: .7cqw; font: 900 6.2cqw/1 Arial, sans-serif; }
#roundBalls img { width: 6.5cqw; height: 6.5cqw; opacity: 1; }
#roundScore { top: 38%; font-size: 7.1cqw; line-height: 1.1; }
.round-actions { top: 49.3%; gap: 6cqw; }
.arcade-action {
    display: flex; width: 29%; flex-direction: column; align-items: center; gap: .7cqw;
    padding: 0; border: 0; background: transparent; color: inherit; font: inherit;
    cursor: pointer; touch-action: manipulation;
}
.arcade-action b { display: block; white-space: nowrap; font-size: 5.1cqw; font-weight: 900; line-height: 1.18; }
.action-art, .reward-art {
    display: block; width: 70%; aspect-ratio: 90 / 93; background: center / contain no-repeat;
    transform-origin: center; transition: transform 100ms;
}
.arcade-action:focus-visible, .reward-ad:focus-visible { outline: 2px dashed #fff9d7; outline-offset: 3px; border-radius: 8px; }
@media (hover:hover) {
    .arcade-action:enabled:hover .action-art, .arcade-action:enabled:hover .reward-art { transform: scale(1.06); }
    .reward-ad:enabled:hover { filter: brightness(1.11); }
}
.arcade-action:enabled:active .action-art, .arcade-action:enabled:active .reward-art { transform: translateY(2px) scale(.96); }
.arcade-action:disabled { opacity: .55; cursor: default; }
#challengeNext .action-art { background-image: url("img/btnStart.png"); }
.challenge-card[data-mode="setup"] #challengeNext .action-art { width: 90%; }
.challenge-card[data-mode="setup"] #challengeNext b {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
}
.challenge-card:not([data-mode="setup"]) .round-stats { top: 46.2%; }
.challenge-card:not([data-mode="setup"]) .round-actions { top: 54%; }
.challenge-card[data-mode="retry"] #challengeNext .action-art { background-image: url("img/btnRestart.png"); }
#challengeItems { top: 79.2%; gap: 3%; }
.reward-ad {
    box-sizing: border-box; width: 42%; min-height: max(42px,15.6cqw);
    display: flex; align-items: center; justify-content: center; gap: 1.7cqw;
    border: max(2px,.65cqw) solid #432315; border-radius: 2.5cqw;
    background: linear-gradient(#ffce66 0%, #ffb239 47%, #ed8a14 50%, #df7d0b 100%);
    box-shadow: inset 0 1px 0 1px #ffe6a2, inset 0 -2px 0 #bf620b, 0 .8cqw 0 #5c2b16;
    color: #452412; padding: .8cqw 1cqw; font: inherit; text-align: left; cursor: pointer;
    touch-action: manipulation;
}
.reward-ad > svg { width: 10cqw; height: 10cqw; flex: none; }
.reward-ad > span { display: flex; flex-direction: column; gap: .65cqw; white-space: nowrap; }
.reward-ad small { font-size: max(10px,3.7cqw); font-weight: 800; line-height: 1; }
.reward-ad b { font-size: max(12px,4.9cqw); font-weight: 900; line-height: 1; }
.reward-ad:enabled:active { transform: translateY(2px); box-shadow: inset 0 1px 0 #ffe6a2, 0 1px 0 #5c2b16; }
.reward-ad:disabled { color: #f8eac6; background: #685845; box-shadow: inset 0 1px 0 #998873, 0 .7cqw 0 #402c1e; cursor: default; }
.reward-ad .claimed-icon, .reward-ad:disabled .video-icon { display: none; }
.reward-ad:disabled .claimed-icon { display: inline; }
#adError { bottom: 1.2%; font-size: max(10px,3.7cqw); line-height: 1.1; }
#challengeHud { position:absolute; z-index:9; top:3%; left:2%; padding:6px 11px; border-radius:6px; background:#142932e8; font-weight:700; font-size:clamp(11px,2.8cqh,16px); pointer-events:none; }
#gameContainer.challenge-open #btnOrbitCamera, #gameContainer.challenge-open #hudDiv { visibility: hidden; }
#challengeAd {
    box-sizing: border-box; width: min(410px, 92%); margin: 10px auto;
    border: 1px solid #67848c; border-radius: 14px; box-shadow: 0 12px 40px #06101666; padding: clamp(14px, 3cqh, 26px);
    background: linear-gradient(0deg,#101d2a 7%,#101d2adc 49%,#101d2a66 100%),url("img/challenge-promo.jpg") center/cover;
}
#challengeAd small { font-size: 13px; font-weight: 700; color: #ffb17e; }
#challengeAdTitle { margin: 5px 0; font-size: clamp(23px,5cqh,34px); line-height: 1.15; }
#challengeAd p { color: #d3e0df; font-size: 14px; margin: 8px 0 14px; }
.challenge-ad-copy { padding-top: clamp(36px,12cqh,85px); }
.challenge-ad-actions { display: flex; justify-content:space-between; align-items:center; gap:8px; margin-top:14px; font-size:13px; }
#challengeAdClose { padding:10px 12px; border:1px solid #729198; border-radius:8px; background:#243e47; color:#fff7e7; font:inherit; cursor:pointer; }
#challengeAdClose:focus-visible { outline:3px solid #ffe8ad; outline-offset:2px; }
@media(prefers-reduced-motion:reduce){.action-art,.reward-art{transition:none;}}
