/* Phase 5: live interface, using the existing approved timber and foliage assets. */
:root {
 --panel-border:url('assets/ui/carved-frame.png');
 --panel-grain:url('assets/ui/wood-grain.png');
 --panel-wood:linear-gradient(#572a1338,#2c140d65),var(--panel-grain);
 --panel-ink:#fff0ce;--panel-muted:#e6c8a1;--panel-gold:#e4b565;
 --panel-line:#c0904d66;--panel-radius:12px;
}
#modal-layer {padding:24px;background:#0c1c1187;backdrop-filter:blur(6px)}
#modal {
 width:min(1200px,100%);max-height:calc(100dvh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
 padding:16px 22px 18px;border:14px solid transparent;border-image:var(--panel-border) 18 stretch;
 border-radius:22px;background-image:var(--panel-wood);background-color:#4d2815;
 box-shadow:0 24px 70px #04140bbb,inset 0 0 0 1px #dfaf5f55;scrollbar-gutter:stable;
 color:var(--panel-ink);scroll-padding-top:120px;
}
#modal[data-route=login],#modal[data-route=wallet],#modal[data-route=controls],#modal[data-route=reference] {width:min(760px,100%)}
#modal-content {position:relative;z-index:1;min-width:0}
.panel-heading {
 position:sticky;top:-16px;display:flex;align-items:start;justify-content:space-between;
 margin:-2px -4px 20px;padding:14px 10px 14px;gap:16px;z-index:5;
 background-image:var(--panel-wood);background-color:#4d2815;border-bottom:2px solid #b37c3580;
 box-shadow:0 5px 8px #210c0544;border-radius:8px;
}
.panel-title-group {flex:1;min-width:0;text-align:center}
.panel-heading::before,.panel-heading::after {content:'';position:absolute;pointer-events:none;background:url('assets/ui/foliage.png') center/contain no-repeat;width:105px;height:65px;z-index:0;opacity:.85}
.panel-heading::before {left:-16px;top:-18px;transform:rotate(-16deg)}
.panel-heading::after {right:54px;top:-18px;transform:rotate(16deg)}
.panel-title-group>* {position:relative;z-index:1}
.eyebrow {display:table;margin:0 auto 5px;padding:3px 12px;border:1px solid #bd8a4780;border-radius:5px;background:#30170db0;color:#f5cc84;font-size:10px;letter-spacing:2px}
#modal h1 {font:400 clamp(32px,3.2vw,46px)/1.1 Lilita,sans-serif;color:#ffe5a3;text-shadow:0 2px #311409,0 4px 5px #14090588;margin:0;padding:0;border:0;background:none;max-width:none;box-shadow:none}
.panel-description {font-size:13px;line-height:1.5;color:var(--panel-muted);margin:7px 0 0;text-wrap:balance}
.close-button {flex:none;width:46px;height:46px;border:3px double #ecc16b;border-radius:12px;background-image:linear-gradient(#a56a2244,#4a200544),var(--panel-grain);background-color:#724619;color:#ffe5a6;font-size:31px;line-height:1;box-shadow:0 3px 4px #190b0799}
.lede {font-size:14px;line-height:1.6;color:var(--panel-muted);margin:0 0 16px}
.notice {background:#28160ab8;border-left:3px solid #d5a44f;padding:10px 13px;border-radius:0 8px 8px 0;color:var(--panel-muted);font-size:12px;line-height:1.6;margin:12px 0 0;overflow-wrap:anywhere}
.notice:empty {display:none}
.revision {text-align:center;font-size:10px;letter-spacing:2px;margin-top:16px;padding-top:12px;color:#d9b278;border-top:1px solid var(--panel-line)}
.wood-button {
 min-height:46px;padding:11px 16px;border:2px solid #c59149;border-radius:10px;
 background-image:linear-gradient(#bd884540,#48230c77),var(--panel-grain);background-color:#815022;
 color:#fff0c7;font-size:14px;line-height:1.35;font-weight:900;text-shadow:0 2px #341908;
 box-shadow:inset 0 1px #f3d59055,inset 0 0 0 1px #49270999,0 3px 4px #1c0d0866;
 transition:filter .15s,transform .15s;white-space:normal;
}
.wood-button.primary {background:linear-gradient(#b9da48,#6f951f);border-color:#ddc173;color:#1f3209;text-shadow:0 1px #e8ff9299;box-shadow:inset 0 2px 2px #edff8e66,0 3px 4px #1c0d0866}
.wood-button:hover:not(:disabled) {filter:brightness(1.12)}
.wood-button:disabled {opacity:.6;cursor:default;transform:none}
.wood-button:focus-visible,.filter-button:focus-visible,.close-button:focus-visible,summary:focus-visible,a:focus-visible {outline:3px solid #fff0a6;outline-offset:3px}
.wood-button>.painted-icon {width:24px;height:24px}
.actions {display:flex;flex-wrap:wrap;gap:12px;margin-top:18px}
.actions>.wood-button {flex:1;min-width:140px}
.panel-footer {border-top:1px solid var(--panel-line);padding-top:16px}
.painted-icon {width:32px;height:32px;object-fit:contain;flex:none}
.timber-section {min-width:0;padding:16px;border:2px solid #b78846;border-radius:var(--panel-radius);background-image:linear-gradient(#3d1d09bb,#291409bf),var(--panel-grain);box-shadow:inset 0 0 0 2px #65371577,0 4px 8px #1d0d0844}
.section-title {display:flex;align-items:center;gap:10px;font:400 25px/1.2 Lilita,sans-serif;color:#ffe5ad;text-shadow:0 2px #2e1309;border-bottom:1px solid var(--panel-line);padding-bottom:12px;margin:0 0 12px}
.settings-grid {display:grid;grid-template-columns:1fr 1fr;gap:16px}
.settings-grid>.timber-section:nth-child(1) {grid-column:1;grid-row:1}
.settings-grid>.timber-section:nth-child(2) {grid-column:1;grid-row:2}
.settings-grid>.timber-section:nth-child(3) {grid-column:2;grid-row:2}
.settings-grid>.timber-section:nth-child(4) {grid-column:2;grid-row:1}
.setting {display:flex;gap:12px;margin:0;padding:12px 0;border-bottom:1px solid #b183403d;font-size:14px;line-height:1.4}
.setting:last-child {border-bottom:0}
.setting>span:first-of-type {flex:1;min-width:0}
.setting>.painted-icon {width:30px;height:30px;align-self:center}
.setting small {font-size:11px;line-height:1.5;color:#d7b991;margin-top:4px}
.setting select {min-width:132px;max-width:170px;min-height:46px;background:#211109;color:#ffebbf;border:1px solid #c69750;border-radius:8px;font-size:14px;padding:8px}
.setting input[type=checkbox] {appearance:none;-webkit-appearance:none;flex:none;width:48px;height:28px;border-radius:18px;border:2px solid #bf9848;background:#312514;position:relative;cursor:pointer;box-shadow:inset 0 2px 4px #160d0888}
.setting input[type=checkbox]::after {content:'';position:absolute;left:2px;top:2px;width:20px;height:20px;border-radius:50%;background:linear-gradient(#ffeab0,#d6a240);box-shadow:0 1px 3px #231106}
.setting input[type=checkbox]:checked {background:linear-gradient(#a0c334,#506a1e)}
.setting input[type=checkbox]:checked::after {left:22px}
.range-control {display:flex;align-items:center;gap:8px;flex:none}
.range-control output {font-size:12px;min-width:34px;text-align:right;color:#ffe2a3}
.setting .range-control input[type=range] {width:clamp(90px,9vw,150px);min-height:44px;accent-color:#b2d94a;cursor:pointer}
.offline-scene {width:100%;height:80px;object-fit:cover;object-position:70% 60%;border-radius:8px;margin-bottom:12px;content:url('assets/game/jungle-desktop.webp')}
.pwa-options {display:grid;gap:10px;margin:0}
.pwa-options>h2 {display:none}
.pwa-options .notice {margin:0}
.pwa-options .wood-button {width:100%;font-size:13px}
.field {font-size:13px;color:#ffe0a5;gap:7px;margin:14px 0}
.field input,.field select {background:#251309;border:1px solid #b68b4d;border-radius:8px;min-height:46px;color:#fff0c6;padding:10px 12px;font-size:16px;max-width:100%;min-width:0}
.field:focus-within {color:#ffefb8}
.field input::placeholder {color:#bea47c}
.field input:read-only {color:#dec7a0}
.account-form {max-width:560px;margin:auto}
.account-form>.wood-button,.profile-form>.wood-button {width:100%}
#modal[data-route=profile] #modal-content {display:grid;grid-template-columns:.8fr 1.2fr;gap:18px 24px;align-items:start}
#modal[data-route=profile] #modal-content>.stats,#modal[data-route=profile] #modal-content>.notice,#modal[data-route=profile] #modal-content>.actions,#modal[data-route=profile] .revision,#modal[data-route=profile] .cloud-history {grid-column:1/-1}
.profile-header {flex-direction:column;text-align:center;margin:0;padding:24px 16px;border:2px solid #b78846;border-radius:12px;background-image:var(--panel-wood);gap:12px;box-shadow:inset 0 0 0 2px #6c421977}
.profile-avatar {width:124px;height:124px;border:4px double #e4bd73;border-radius:50%;box-shadow:0 5px 12px #170d08a0}
.profile-header>div {width:100%}
.profile-header strong {font:400 28px/1.2 Lilita;color:#ffecbc;overflow-wrap:anywhere}
.profile-header p {font-size:13px;color:var(--panel-muted)}
.profile-form {min-width:0;border:1px solid var(--panel-line);border-radius:12px;padding:8px 20px 20px;background:#2c170cb0}
.experience-track {height:12px;border:1px solid #c39040;border-radius:8px;background:#211307;overflow:hidden;margin:12px auto;max-width:260px}
.experience-track span {display:block;height:100%;background:linear-gradient(#c1e54e,#6c9c26);box-shadow:inset 0 1px #f5ffb7}
.stats {gap:12px;margin:16px 0}
.stat {min-width:0;padding:14px 12px;border:1px solid #b68b4d;border-radius:10px;background-image:linear-gradient(#673e1a40,#20100988),var(--panel-grain);box-shadow:inset 0 1px #d5a56022,0 3px 4px #27130744}
.stat strong {font:400 30px/1.2 Lilita;color:#ffe1a4;overflow-wrap:anywhere}
.stat small {font-size:12px;line-height:1.5;color:var(--panel-muted);margin-top:5px}
#modal[data-route=profile] .stats {grid-template-columns:repeat(4,minmax(0,1fr));margin:0}
.cloud-history {grid-column:1/-1;margin:0;border:1px solid var(--panel-line);padding:0 14px;border-radius:8px;background:#29140b70}
.cloud-history summary,.balance-details summary,.season-details summary,.public-room-details summary {cursor:pointer;min-height:44px;padding:11px 0;color:#ffe0a7;font-size:12px;line-height:1.5}
.cloud-history p {padding:10px;background:#1e120966;border-radius:6px;font-size:13px}
.balance-details {margin:10px 0}
.balance-details .notice {margin-top:0}
.wallet-summary {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0}
.wallet-summary .stat {display:grid;grid-template-columns:42px minmax(0,1fr);grid-template-rows:auto auto;align-items:center;padding:10px 12px}
.wallet-icon {width:38px;height:42px;object-fit:contain;grid-row:1/3}
.wallet-summary strong,.wallet-summary small {text-align:right}
.stat-line {font-size:12px;line-height:1.6;color:#e3c89c;margin:12px 0;padding-bottom:10px;border-bottom:1px solid var(--panel-line)}
.filters {display:flex;flex-wrap:wrap;gap:8px;margin:0 0 18px}
.filter-button {min-height:44px;padding:10px 16px;border:1px solid #bb8b49;border-radius:8px;background-image:var(--panel-wood);color:#ffe2ae;font-size:13px;font-weight:900;line-height:1.4}
.filter-button.selected {background:linear-gradient(#e6bf62,#b47e2d);border-color:#ffe7a4;color:#321c08;text-shadow:0 1px #f8d886;box-shadow:inset 0 0 0 1px #895119,0 0 8px #e1b34833}
.shop-overview {display:grid;grid-template-columns:1fr 370px;gap:20px;align-items:center;margin-bottom:20px}
.shop-overview .lede {margin:0;max-width:560px}
.store-layout {display:grid;grid-template-columns:230px minmax(0,1fr);gap:18px;align-items:start}
.shop-sidebar {padding:14px;position:sticky;top:124px}
.shop-sidebar .section-title {font-size:22px}
.shop-sidebar .shop-filters {display:grid;grid-template-columns:1fr;gap:8px;margin-bottom:14px}
.shop-sidebar .filter-button {text-align:left}
.shop-bear {display:block;width:110px;height:110px;border:4px double #d9b373;border-radius:50%;margin:18px auto;box-shadow:0 5px 12px #170d08aa}
.shop-sidebar .notice,.shop-sidebar .stat-line {font-size:12px}
.store-products {min-width:0}
.shop-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:0}
.shop-card {display:flex;flex-direction:column;min-width:0;padding:10px;border:2px solid #be8d48;border-radius:12px;background-image:var(--panel-wood);box-shadow:0 4px 8px #1c0d0666;text-align:center}
.item-stage {display:grid;place-items:center;height:108px;border-radius:8px;background:linear-gradient(#16331822,#10250c90),url('assets/game/jungle-desktop.webp') center/cover;border:1px solid #b7995644;overflow:hidden}
.item-art {width:98px;height:102px;object-fit:contain;margin:0;filter:drop-shadow(0 4px 4px #0c150aa0)}
.shop-card h2 {font:400 21px/1.2 Lilita;color:#ffe8b2;margin:10px 0 0;min-height:50px;display:grid;place-items:center}
.shop-price {font-size:12px;line-height:1.5;color:#ecd3a4;margin:8px 0 12px;min-height:36px}
.shop-card .wood-button {width:100%;margin-top:auto;font-size:13px;padding:10px 6px}
.coupon-card {border:1px solid #b78846;border-radius:10px;background-image:var(--panel-wood);padding:16px;overflow-wrap:anywhere;margin:14px 0;text-align:left}
.coupon-card .wood-button {margin-top:8px}
.empty {border:1px solid #aa8244;border-radius:12px;background:#21120970;text-align:center;padding:30px 18px;margin:18px 0}
.empty img {width:78px;height:78px;object-fit:contain}
.empty h2 {font:400 25px Lilita;color:#ffdda3;margin:12px 0}
.empty p {font-size:13px;line-height:1.6;color:var(--panel-muted)}
.community-grid {display:grid;grid-template-columns:1.2fr 1fr;gap:18px;align-items:start}
.share-section .notice {margin:10px 0 14px}
.share-link {width:100%;background:#1b130cbf;border:1px solid #c1944e;border-radius:8px;padding:12px;color:#ffe9bd;min-height:46px;font-size:16px;user-select:text;-webkit-user-select:text}
.qr-box {display:flex;justify-content:center;margin:18px 0;padding:16px;background:radial-gradient(ellipse,#dca24635,transparent 72%);border-bottom:1px solid var(--panel-line)}
.qr-box canvas {width:min(216px,90%);height:auto;border:8px solid #fff;border-radius:9px;image-rendering:pixelated;box-shadow:0 5px 14px #160e0999}
.share-section .actions {margin-top:14px}
.share-section .actions .wood-button {min-width:120px;font-size:13px}
.share-section>a.wood-button {width:100%;margin-top:12px;background:linear-gradient(#53852c,#315920);border-color:#a6c670;color:#f2ffd8;text-decoration:none}
.adventure-stats {display:grid;grid-template-columns:1fr;gap:12px;margin:0}
.adventure-stat {display:grid;grid-template-columns:70px 1fr;grid-template-rows:auto auto;align-items:center;text-align:left;padding:16px}
.adventure-stat .stat-icon {grid-row:1/3;width:58px;height:58px;object-fit:contain;filter:drop-shadow(0 3px 3px #160e0988)}
.adventure-stat strong {font-size:32px}
.adventure-stat small {margin-top:3px}
.race-choices {display:grid;grid-template-columns:1fr 1fr;gap:18px;margin:18px 0}
.race-choice {padding:14px;display:flex;flex-direction:column}
.race-preview {width:100%;height:150px;object-fit:cover;border-radius:8px;margin-bottom:14px}
.race-choice .wood-button {width:100%;font-size:17px}
.race-choice p {font-size:13px;color:var(--panel-muted);line-height:1.6;margin:12px 0 0}
.private-race-form {display:flex;align-items:end;gap:14px;border-top:1px solid var(--panel-line);padding:18px 0}
.private-race-form .field {flex:1;min-width:0;margin:0}
.private-race-form .wood-button {margin:0}
.private-race-form input {letter-spacing:3px}
.public-room-details {border-top:1px solid var(--panel-line);padding:0 0 12px}
.public-room-details>.wood-button {margin-top:12px}
.room-code,.quick-race-title {text-align:center;font:400 32px Lilita;color:#ffe3a1;margin:20px 0}
.room-code {letter-spacing:.16em;user-select:text}
.lobby-summary {text-align:center;font-size:14px;font-weight:900;color:#ffe3a7;padding:12px;border:1px solid #b78a4666;border-radius:8px;background:#2c251290}
.lobby-members {display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:18px 0}
.lobby-members .ranking-row {display:grid;grid-template-columns:48px 1fr;padding:14px;border:1px solid #b38b4a;border-radius:10px;background:#292012aa}
.lobby-members .ranking-row img {grid-row:1/3}
.lobby-members .ranking-row span {font-size:12px}
.lobby-vacancy {display:grid;place-items:center;border:1px dashed #b7925b;border-radius:10px;padding:20px;min-height:92px;text-align:center;font-size:13px;color:#d0b790}
.ranking-layout {display:grid;grid-template-columns:minmax(0,1fr) 230px;gap:18px;align-items:start}
.ranking-board {min-width:0}
.ranking-profile {text-align:center;padding:18px 12px}
.ranking-profile .section-title {font-size:22px;justify-content:center}
.ranking-profile .profile-avatar {width:98px;height:98px;margin:8px auto 12px}
.ranking-profile-name {display:block;font:400 23px Lilita;color:#ffe8b2;overflow-wrap:anywhere}
.ranking-profile .stats {grid-template-columns:1fr;gap:10px}
.ranking-profile .wood-button {width:100%}
.ranking-podium {display:flex;align-items:end;justify-content:center;gap:12px;max-width:750px;margin:16px auto 22px}
.podium-card {display:grid;justify-items:center;gap:7px;padding:16px 10px 14px;width:32%;min-width:0;border:2px solid #bcaa89;border-radius:12px;background-image:var(--panel-wood);box-shadow:0 5px 8px #160b0988}
.podium-card.place-1 {order:2;min-height:230px;border-color:#efc76b;background-image:linear-gradient(#b6802538,#69421733),var(--panel-grain);box-shadow:0 0 16px #dab64e22,0 5px 8px #160b0988}
.podium-card.place-2 {order:1;border-color:#bac8be}
.podium-card.place-3 {order:3;border-color:#cb9455}
.podium-avatar {width:78px;height:78px;object-fit:contain}
.podium-card .podium-place {display:grid;place-items:center;width:36px;height:36px;font:400 24px Lilita;border-radius:50%;border:1px solid #dbb064;background:#25120788;color:#ffe5ad}
.podium-name {font-size:14px;text-align:center;overflow-wrap:anywhere}
.podium-card small {font-size:11px;color:#e2cda7}
.podium-score {font:400 23px Lilita;color:#ffe2a7}
.ranking-table {border:1px solid #b28a47;border-radius:10px;overflow:hidden;background:#2013078c}
.ranking-table:empty {display:none}
.ranking-row {padding:13px 14px;font-size:13px;border-bottom:1px solid var(--panel-line)}
.ranking-row:last-child {border-bottom:0}
.ranking-row>strong:first-child {min-width:32px;color:#e9c788}
.ranking-row>strong:last-child {color:#ffe3a5;font-size:16px;white-space:nowrap}
.ranking-table .ranking-row:nth-child(even) {background:#66402233}
.rank-avatar {width:40px;height:40px;object-fit:contain}
.season-panel {padding:16px;border:1px solid #c49650;border-radius:12px;background-image:var(--panel-wood)}
.season-panel h2 {font:400 27px Lilita;color:#ffe4ae;margin:0 0 10px}
.season-panel>p {font-size:13px;line-height:1.6}
.season-prizes {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:12px 0 0}
.season-prizes .stat {padding:12px 8px}
.season-details .notice {font-size:12px}
.season-qualification {display:block;font-size:11px;line-height:1.5;color:var(--panel-muted);margin-top:5px}
.game-panel {padding:20px;background:#0e1c1180;backdrop-filter:blur(5px)}
.game-panel-box {position:relative;width:min(820px,96%);max-height:min(88dvh,calc(100% - 20px));padding:22px 24px;border:14px solid transparent;border-image:var(--panel-border) 18 stretch;border-radius:20px;background-image:var(--panel-wood);background-color:#4d2815;text-align:center;scrollbar-width:thin;scrollbar-color:#ba8c49 #30190d;scroll-padding-top:16px;overscroll-behavior:contain;box-shadow:0 20px 55px #071307aa}
.game-panel-box h1 {font:400 clamp(28px,3vw,42px)/1.15 Lilita;color:#ffe4a8;text-shadow:0 3px #2e1409;margin:0 0 10px}
.game-panel-box .panel-brand {display:table;margin:0 auto 12px;padding:5px 12px;border:1px solid #c39450;border-radius:6px;background:#2e160b77;color:#ecc381;font-size:10px;letter-spacing:2px}
.game-panel-box .course-subtitle {border-bottom:1px solid var(--panel-line);padding:4px 0 14px;margin:0 0 18px;font-size:13px;color:var(--panel-muted)}
.game-panel-box .stats {grid-template-columns:repeat(4,minmax(0,1fr));margin:14px 0}
.game-panel-box .stat {padding:12px 8px}
.game-panel-box .stat img {width:36px;height:36px;object-fit:contain;margin-bottom:6px}
.game-panel-box .stat strong {font-size:28px}
.game-panel-box .reward-receipt {grid-template-columns:1fr 1fr}
.reward-receipt .stat {border-color:#9aaf51;background:linear-gradient(#455a1b66,#26341877)}
.game-panel-box .reward-explanation {font-size:12px;color:#efe0bb;line-height:1.6}
.game-panel-box .balance-details {text-align:left}
.game-panel-box .balance-details p {font-size:12px;line-height:1.6}
.game-panel-box .balance-details summary {text-align:center}
.game-panel-actions {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;border-top:1px solid var(--panel-line);padding-top:16px;margin-top:18px}
.game-panel-actions .wood-button {width:100%;min-height:46px;font-size:14px}
.game-panel-actions [data-panel-action=next],.game-panel-actions [data-panel-action=resume] {background:linear-gradient(#f1c661,#b47a27);color:#2b1907;text-shadow:0 1px #ffdf9880;border-color:#f1cc75}
.game-panel-actions [data-panel-action=menu]:last-child {grid-column:1/-1}
.game-panel-box[data-panel=pause] {width:min(900px,96%)}
.pause-layout {display:grid;grid-template-columns:.8fr 1.2fr;gap:20px;align-items:start}
.pause-layout .game-panel-actions {grid-template-columns:1fr;border:0;margin:0;padding:0;gap:12px}
.pause-layout .game-panel-actions .wood-button {min-height:58px;font-size:18px}
.pause-overview {text-align:left;padding:16px}
.pause-scene {width:100%;height:100px;object-fit:cover;border-radius:8px;object-position:65% 55%;margin-bottom:12px}
.pause-overview .lede {font-size:13px;margin:0}
.pause-progress {margin:12px 0 0;color:#ffe6a6;font:400 22px Lilita;text-align:right}
.pause-overview .experience-track {max-width:none;margin:6px 0 14px}
.pause-audio {display:flex;flex-wrap:wrap;gap:10px;margin:12px 0}
.pause-audio p {display:flex;align-items:center;gap:8px;font-size:12px;margin:0}
.pause-audio .painted-icon {width:24px;height:24px}
.pause-overview>.wood-button {width:100%}
.game-panel-close {position:absolute;right:14px;top:14px}
.competition-panel {margin:12px 0;text-align:left}
.competition-panel h2 {font:400 28px Lilita;text-align:center;color:#ffe2a6;margin:12px 0}
.race-winner {display:flex;align-items:center;justify-content:center;gap:16px;padding:16px;border:2px solid #dfb158;border-radius:12px;background:linear-gradient(110deg,#91632066,#b7903022);margin:14px 0}
.race-winner img {width:68px!important;height:68px!important;object-fit:contain}
.race-winner>div {display:grid;gap:6px;text-align:left;min-width:0}
.race-winner small {font-size:12px;color:#ffe4a6}
.race-winner strong {font:400 26px Lilita;color:#fff0ca;overflow-wrap:anywhere}
.race-winner span {font-size:14px;color:#ffeac4}
.podium-list {list-style:none;padding:0;margin:14px 0}
.podium-row {display:grid;grid-template-columns:36px minmax(0,1fr) auto;gap:12px;align-items:center;padding:12px 10px;border-bottom:1px solid var(--panel-line);font-size:13px}
.podium-row.winner {background:#d6b35322;border-radius:8px}
.podium-row.self {box-shadow:inset 3px 0 #c9db69}
.podium-identity {display:flex;align-items:center;gap:10px;min-width:0}
.podium-identity strong {overflow-wrap:anywhere}
.podium-result {display:grid;gap:4px;text-align:right}
.podium-result small {font-size:12px}
.rematch-status {background:#2d261186;border-radius:8px;font-size:13px!important;line-height:1.6;text-align:center;padding:10px}
.race-rematch {margin:12px 0 16px}
.race-rematch .rematch-status {margin:0 0 8px}
.race-rematch .wood-button {display:flex;width:100%;min-height:46px;margin:0;justify-content:center}
@media (max-width:1020px) and (min-width:761px) {
 .store-layout {grid-template-columns:190px minmax(0,1fr)}
 .shop-grid {grid-template-columns:repeat(2,minmax(0,1fr))}
 .shop-overview {grid-template-columns:1fr 320px}
 .setting {gap:8px}.setting>.painted-icon {display:none}
 .ranking-layout {grid-template-columns:minmax(0,1fr) 190px}
}
@media (max-width:760px) {
 #modal-layer {padding:14px}
 #modal {padding:12px;max-height:calc(100dvh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom));border-width:10px;border-radius:16px;scroll-padding-top:115px}
 .panel-heading {top:-12px;padding:10px 2px 12px;margin:0 0 16px;gap:10px}
 .panel-heading::before {width:65px;left:-12px;height:45px}
 .panel-heading::after {width:70px;right:35px;height:45px}
 .panel-description {font-size:12px;line-height:1.4;max-width:360px;margin:7px auto 0}
 #modal h1 {font-size:31px}
 .close-button {width:44px;height:44px;font-size:28px}
 .eyebrow {font-size:9px;letter-spacing:1.7px}
 .settings-grid,.community-grid,.ranking-layout {grid-template-columns:1fr;gap:14px}
 .settings-grid>.timber-section:nth-child(n) {grid-column:auto;grid-row:auto}
 .timber-section {padding:14px}
 .section-title {font-size:24px}
 .settings-grid .timber-section:nth-child(2) {order:1}
 .settings-grid .timber-section:nth-child(3) {order:2}
 .settings-grid .timber-section:nth-child(4) {order:3}
 .setting select {min-width:112px;max-width:140px;font-size:16px}
 .setting .range-control input[type=range] {width:100px}
 .setting {font-size:13px;gap:10px}
 .setting small {font-size:11px}
 .setting>.painted-icon {width:26px;height:26px}
 .settings-grid .offline-scene {height:85px}
 .actions {gap:10px}
 .actions>.wood-button {min-width:130px;font-size:13px}
 #modal[data-route=profile] #modal-content {grid-template-columns:1fr;gap:14px}
 .profile-header {flex-direction:row;gap:14px;text-align:left;padding:16px}
 .profile-header .profile-avatar {width:86px;height:86px}
 .profile-header strong {font-size:25px}
 .profile-header .experience-track {margin-left:0}
 .profile-form {padding:4px 14px 14px}
 #modal[data-route=profile] .stats {grid-template-columns:1fr 1fr}
 .shop-overview {grid-template-columns:1fr;gap:12px;margin-bottom:14px}
 .shop-overview .lede {font-size:13px;line-height:1.5}
 .wallet-summary .stat {grid-template-columns:32px minmax(0,1fr);padding:10px 8px}
 .wallet-icon {width:29px;height:32px}
 .wallet-summary strong {font-size:28px}
 .wallet-summary small {font-size:11px}
 .store-layout {grid-template-columns:1fr;gap:14px}
 .shop-sidebar {position:static;padding:12px}
 .shop-sidebar .section-title,.shop-bear {display:none}
 .shop-sidebar .shop-filters {grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0}
 .shop-sidebar .filter-button {text-align:center}
 .shop-sidebar .balance-details {margin-bottom:0}
 .shop-sidebar .stat-line {margin-bottom:0}
 .shop-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .shop-card {padding:8px}
 .shop-card h2 {font-size:19px;min-height:46px}
 .item-stage {height:92px}
 .item-art {width:83px;height:87px}
 .shop-price {font-size:11px;line-height:1.5;min-height:36px}
 .shop-card .wood-button {min-height:46px;font-size:12px}
 .adventure-stats {grid-template-columns:1fr 1fr;gap:10px}
 .adventure-stat {display:flex;flex-direction:column;justify-content:center;padding:14px 8px;text-align:center}
 .adventure-stat .stat-icon {width:42px;height:42px;margin-bottom:8px}
 .adventure-stat strong {font-size:27px}
 .adventure-stat small {font-size:11px}
 .share-section .actions>.wood-button {min-width:110px}
 .qr-box {padding:12px;margin:14px 0}
 .qr-box canvas {width:min(210px,95%)}
 .race-choices {gap:12px;margin:16px 0}
 .race-choice {padding:10px}
 .race-preview {height:95px;margin-bottom:12px}
 .race-choice .wood-button {font-size:14px;padding:10px 8px}
 .race-choice p {font-size:12px;line-height:1.5}
 .private-race-form {flex-wrap:wrap;gap:12px}
 .private-race-form .field {flex-basis:100%}
 .private-race-form .wood-button {width:100%}
 .lobby-members {gap:10px}
 .lobby-members .ranking-row {grid-template-columns:34px 1fr;gap:7px;padding:10px;font-size:12px}
 .lobby-vacancy {font-size:12px;padding:12px}
 .ranking-profile {display:grid;grid-template-columns:65px 1fr;gap:10px;text-align:left;padding:12px}
 .ranking-profile .section-title {grid-column:1/-1;justify-content:start}
 .ranking-profile .profile-avatar {width:60px;height:60px;margin:0}
 .ranking-profile-name {font-size:23px;align-self:center}
 .ranking-profile .stats {grid-column:1/-1;grid-template-columns:1fr 1fr;margin:0}
 .ranking-profile .wood-button {grid-column:1/-1}
 .ranking-podium {gap:8px;margin:16px 0}
 .podium-card {width:33%;padding:12px 6px;gap:6px}
 .podium-card.place-1 {min-height:212px}
 .podium-avatar {width:60px;height:60px}
 .podium-name {font-size:12px}
 .podium-score {font-size:20px}
 .ranking-row {font-size:12px;padding:12px 10px;gap:8px}
 .ranking-row>strong:first-child {min-width:24px}
 .ranking-row>strong:last-child {font-size:14px}
 .rank-avatar {width:34px;height:34px}
 .season-panel {padding:12px}
 .season-prizes {gap:8px}
 .season-prizes .stat {padding:12px 6px}
 .season-prizes .stat small {font-size:11px}
 .game-panel {padding:12px}
 .game-panel-box {width:96%;border-width:10px;padding:16px 14px;max-height:min(88dvh,calc(100% - 16px))}
 .game-panel-box h1 {font-size:29px}
 .game-panel-box .stats {grid-template-columns:1fr 1fr;gap:10px}
 .game-panel-box .stat strong {font-size:26px}
 .game-panel-box .stat small {font-size:11px}
 .game-panel-actions {gap:10px}
 .game-panel-actions .wood-button {font-size:13px;padding:10px 8px}
 .pause-layout {grid-template-columns:1fr;gap:18px}
 .pause-layout .game-panel-actions {grid-template-columns:1fr 1fr;gap:10px}
 .pause-layout .game-panel-actions .wood-button {min-height:50px;font-size:14px}
 .pause-layout .game-panel-actions [data-panel-action=resume] {grid-column:1/-1}
 .pause-scene {height:75px}
 .pause-overview .section-title {font-size:23px}
 .game-panel-close {top:12px;right:10px;width:38px;height:38px;min-height:38px;font-size:25px}
 .game-panel-box[data-panel=pause] h1 {padding:0 34px}
 .competition-panel h2 {font-size:25px}
 .race-winner {padding:12px;gap:12px;margin:12px 0}
 .race-winner img {width:54px!important;height:54px!important}
 .race-winner strong {font-size:23px}
 .podium-row {grid-template-columns:26px minmax(0,1fr) auto;gap:8px;padding:12px 6px;font-size:12px}
 .podium-identity {gap:6px}
 .game-panel-box .rank-avatar {width:32px;height:32px}
 .rematch-status {font-size:12px!important}
}
@media (max-width:380px) {
 #modal-layer {padding:10px}#modal {padding:10px;border-width:8px;max-height:calc(100dvh - 20px)}
 #modal h1 {font-size:28px}.panel-description {font-size:11px}
 .setting>.painted-icon {display:none}.setting select {min-width:106px}
 .setting .range-control input[type=range] {width:90px}
 .section-title {font-size:22px}.shop-card h2 {font-size:18px}.stat strong {font-size:27px}
 .podium-avatar {width:48px;height:48px}.podium-card.place-1 {min-height:196px}
 .game-panel-box {padding:14px 10px}.game-panel-box h1 {font-size:27px}
}
@media (max-height:540px) and (orientation:landscape) {
 #modal-layer {padding:10px}#modal {max-height:calc(100dvh - 20px);padding:10px 16px;border-width:8px;scroll-padding-top:86px}
 .panel-heading {top:-10px;padding:6px 0 10px;margin-bottom:14px}.panel-heading::before,.panel-heading::after {display:none}
 #modal h1 {font-size:29px}.panel-description {font-size:11px}.eyebrow {font-size:9px}
 .game-panel-box {border-width:8px;padding:14px;max-height:calc(100% - 10px)}
 .game-panel-box h1 {font-size:27px}
}
@media (prefers-reduced-motion:reduce) {.wood-button {transition:none}}
/* Keep primary actions visible while preserving readable labels. */
@media(min-width:761px) {
 .panel-heading {padding:10px 10px 12px}
 .panel-heading .eyebrow {position:absolute;left:12px;top:20px;margin:0}
 .panel-heading .panel-title-group {padding:0 105px}
 #modal[data-route=shop] {width:min(1280px,100%)}
 .shop-card {padding:8px}.shop-card h2 {min-height:44px;margin-top:8px}
 .item-stage {height:96px}.item-art {height:92px;width:90px}
 .shop-price {margin:6px 0 10px;min-height:32px}
 .settings-grid>.timber-section {padding:14px}
 .settings-grid .section-title {padding-bottom:10px;margin-bottom:10px}
 .settings-grid .setting {padding:10px 0}
 .settings-grid .offline-scene {height:54px;margin-bottom:10px}
 .settings-grid .pwa-options .notice {padding:8px 12px}
}
.wallet-mode {grid-column:1/-1;color:#e3c894;font-size:11px;line-height:1.3;text-align:right}
@media(max-width:760px) {
 .shop-overview>.lede {display:none}
 .shop-sidebar .shop-filters {margin-bottom:8px}
 .shop-sidebar .balance-details {margin:4px 0 0}
 .wallet-mode {text-align:left;font-size:11px}
 .setting:has(input[type=range]) {display:grid;grid-template-columns:26px minmax(0,1fr);gap:6px 10px}
 .setting:has(input[type=range])>.range-control {grid-column:1/-1;display:flex;width:100%}
 .setting .range-control input[type=range] {flex:1;width:100%;min-width:0}
 .panel-title-group {padding-right:2px}
 #modal h1 {font-size:28px;overflow-wrap:anywhere;text-wrap:balance}
}

/* Phase 6: tighter panels sized per route for desktop and landscape phones. */
#modal{width:min(980px,100%);padding:12px 18px 16px}
#modal[data-route=shop]{width:min(1080px,100%)}
#modal[data-route=settings]{width:min(1000px,100%)}
#modal[data-route=profile]{width:min(900px,100%)}
#modal[data-route=play]{width:min(980px,100%)}
#modal:has(#modal-content>.empty:first-child){width:min(640px,100%)}
#modal h1{font-size:clamp(26px,2.5vw,38px)}
.panel-heading{margin-bottom:14px}
.panel-description{margin-top:4px}
/* Compact empty / unavailable state: icon beside text. */
#modal-content>.empty{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:6px 18px;text-align:left;padding:18px 22px;margin:4px 0 0}
#modal-content>.empty img{grid-row:1/3;width:68px;height:68px;border-radius:12px}
#modal-content>.empty h2{margin:0;font-size:24px;line-height:1.15}
#modal-content>.empty p{margin:0;font-size:13px;line-height:1.5}
#modal-content>.empty+.panel-footer{margin-top:14px;padding-top:14px}
.actions.panel-footer>.wood-button{min-height:44px}
/* Adventure picker: three world cards, two stage cards. */
.worlds{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.world-card{display:flex;flex-direction:column;align-items:stretch;gap:0;padding:0;min-height:0;overflow:hidden;border-radius:12px;transition:transform .15s,border-color .15s}
.world-card img{width:100%;height:auto;aspect-ratio:16/8;border-radius:0;object-position:50% 45%;display:block}
.world-card>span{display:block;padding:10px 12px 12px}
.world-card strong{font-size:22px}
.world-card small{display:block;color:#ead6b0}
.world-card .tag{display:inline-block;margin-top:8px;padding:2px 8px;border-radius:5px;background:#1a0f0899;border:1px solid #8a6a3a;font-size:10px;font-weight:900}
.world-card.selected{box-shadow:0 0 0 2px #b5db48,0 6px 14px #0006}.world-card.selected .tag{background:#5c7a1d;border-color:#c5e36a;color:#f4ffd8}
.world-card:hover{transform:translateY(-2px)}
.stage-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0 0}
.stage-card.wood-button{display:grid;grid-template-columns:minmax(110px,38%) minmax(0,1fr);grid-template-rows:auto 1fr auto;column-gap:14px;row-gap:4px;align-items:start;justify-content:stretch;padding:10px;text-align:left;min-height:0}
.stage-card .stage-scene-preview{grid-row:1/4;width:100%;height:100%;min-height:92px;aspect-ratio:auto;margin:0;border-radius:8px;object-fit:cover;object-position:50% 50%;border:1px solid #c5975244}
.stage-card strong{font-size:19px;line-height:1.15;align-self:end}
.stage-card small{font-size:12px;line-height:1.4}
.stage-card .stage-record{align-self:end}
.stage-card.selected{outline:0;border-color:#f0c35f;box-shadow:0 0 0 3px #efc15e,0 6px 14px #0006}
#modal[data-route=play] .actions{margin-top:14px}
#modal[data-route=play] .notice{margin-top:12px}
/* Settings banner and profile. */
.offline-scene,.settings-grid .offline-scene{content:normal;height:auto;aspect-ratio:16/5;object-position:50% 42%;border:1px solid #c5975255}
@media(min-width:761px){
 .settings-grid .offline-scene{height:auto;aspect-ratio:16/4.4}
 #modal[data-route=profile] #modal-content{grid-template-columns:300px minmax(0,1fr);gap:14px 18px}
 .profile-header{padding:18px 14px}
 .profile-avatar{width:104px;height:104px}
 .profile-form{padding:4px 18px 18px}
 #modal[data-route=profile] .stat{padding:10px 8px}
 #modal[data-route=profile] .stat strong{font-size:26px}
 .shop-overview{grid-template-columns:1fr 340px;margin-bottom:14px}
 .store-layout{grid-template-columns:200px minmax(0,1fr);gap:14px}
 .shop-bear{width:86px;height:86px;margin:12px auto}
 .shop-sidebar{top:110px}
}
/* Landscape phones (Android/iOS): use the width, keep everything compact. */
@media (max-height:540px) and (orientation:landscape){
 #modal-layer{padding:max(6px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))}
 #modal{max-height:calc(100dvh - 12px - env(safe-area-inset-top) - env(safe-area-inset-bottom));padding:6px 12px 10px;border-width:7px;scroll-padding-top:64px}
 .panel-heading{top:-6px;padding:4px 0 6px;margin:0 0 10px;align-items:center}
 .panel-heading .eyebrow{display:none}
 .panel-heading .panel-title-group{padding:0 48px}
 #modal h1{font-size:22px}.panel-description{font-size:10.5px;margin-top:2px}
 .close-button{width:36px;height:36px;font-size:24px;border-width:2px;border-radius:9px}
 #modal-content>.empty{padding:10px 14px;gap:4px 12px}
 #modal-content>.empty img{width:46px;height:46px}
 #modal-content>.empty h2{font-size:18px}#modal-content>.empty p{font-size:11.5px;line-height:1.4}
 #modal-content>.empty+.panel-footer{margin-top:8px;padding-top:8px}
 .actions{margin-top:10px;gap:8px}.actions>.wood-button,.actions.panel-footer>.wood-button{min-height:38px;padding:7px 12px;font-size:12px}
 .wood-button>.painted-icon{width:20px;height:20px}
 .notice{font-size:11px;padding:7px 10px}
 .lede{font-size:12px;margin-bottom:8px}
 .timber-section{padding:10px}
 .section-title{font-size:18px;padding-bottom:6px;margin-bottom:4px;gap:8px}.section-title .painted-icon{width:24px;height:24px}
 .settings-grid{gap:10px}
 .setting{padding:7px 0;gap:8px;font-size:12.5px}.setting small{font-size:10.5px;line-height:1.35}
 .setting>.painted-icon{width:22px;height:22px}
 .setting select{min-height:38px;min-width:110px;font-size:13px}
 .setting .range-control input[type=range]{width:90px;min-height:34px}
 .setting input[type=checkbox]{width:42px;height:24px}.setting input[type=checkbox]::after{width:16px;height:16px}.setting input[type=checkbox]:checked::after{left:20px}
 .settings-grid .offline-scene{aspect-ratio:16/3.6;margin-bottom:6px}
 .pwa-options{gap:6px}.pwa-options .wood-button{min-height:36px;padding:6px 10px;font-size:12px}
 #modal[data-route=profile] #modal-content{grid-template-columns:220px minmax(0,1fr);gap:10px 12px}
 .profile-header{padding:10px;gap:6px}.profile-avatar{width:70px;height:70px}.profile-header strong{font-size:20px}.profile-header p{font-size:11px;margin:1px 0}
 .experience-track{margin:6px auto;height:9px}
 .profile-form{padding:2px 12px 10px}.field{margin:6px 0;font-size:11.5px;gap:4px}.field input,.field select{min-height:38px;padding:6px 10px;font-size:14px}
 #modal[data-route=profile] .stat{padding:6px}.stat strong{font-size:20px}.stat small{font-size:10.5px;margin-top:2px}
 .shop-overview{grid-template-columns:1fr 300px;gap:10px;margin-bottom:10px}.shop-overview .lede{font-size:11.5px;line-height:1.4}
 .wallet-summary .stat{padding:6px 8px}.wallet-summary strong{font-size:22px}.wallet-icon{width:28px;height:30px}
 .store-layout{grid-template-columns:1fr;gap:10px}
 .shop-sidebar{position:static;padding:8px}.shop-sidebar .section-title,.shop-bear,.shop-sidebar .stat-line{display:none}
 .shop-sidebar .shop-filters{display:flex;flex-wrap:wrap;gap:6px;margin:0}.shop-sidebar .filter-button{min-height:34px;padding:6px 12px;font-size:12px;text-align:center}
 .shop-sidebar .balance-details{margin:4px 0 0}
 .shop-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
 .shop-card{padding:6px}.item-stage{height:70px}.item-art{width:64px;height:66px}
 .shop-card h2{font-size:15px;min-height:36px;margin-top:4px}.shop-price{font-size:10.5px;margin:2px 0 6px;min-height:28px}
 .shop-card .wood-button{min-height:34px;padding:6px;font-size:11.5px}
 .worlds{gap:8px}.world-card img{aspect-ratio:16/6}.world-card>span{padding:6px 10px 8px}.world-card strong{font-size:17px}.world-card small{font-size:10.5px;line-height:1.3}.world-card .tag{margin-top:4px;font-size:9px}
 .stage-list{gap:8px;margin-top:10px}.stage-card.wood-button{padding:7px;column-gap:10px}.stage-card .stage-scene-preview{min-height:64px}
 .stage-card strong{font-size:15px}.stage-card small{font-size:10.5px;line-height:1.3}
 .ranking-layout{grid-template-columns:minmax(0,1fr) 190px;gap:10px}
 .ranking-podium{margin:8px auto 10px}.podium-card.place-1{min-height:160px}.podium-avatar{width:48px;height:48px}
 .race-choices{gap:10px;margin:10px 0}.race-preview{height:80px;margin-bottom:8px}
}
#modal:has(#modal-content>.empty:first-child) .panel-heading .panel-title-group{padding:0 64px}
@media(min-width:761px){.settings-grid{align-items:start}}
@media(max-width:760px){
 .worlds{grid-template-columns:1fr;gap:10px}
 .world-card{flex-direction:row;align-items:stretch}
 .world-card img{width:34%;max-width:140px;aspect-ratio:auto;height:auto;min-height:92px;object-fit:cover}
 .world-card>span{flex:1;min-width:0;padding:10px 12px}
 .world-card strong{font-size:20px}
 .stage-list{grid-template-columns:1fr;gap:10px}
 .stage-card.wood-button{grid-template-columns:minmax(96px,34%) minmax(0,1fr)}
 .stage-card strong{font-size:17px}
}
/* Shop products: transparent art on a soft spotlight, no square photo backdrop. */
.item-stage{position:relative;background:radial-gradient(ellipse 55% 60% at 50% 55%,#f7c75a33,#f2b2400d 55%,transparent 75%),linear-gradient(#2a150b55,#1a0c0655);border:1px solid #c5975233;box-shadow:inset 0 0 18px #0006}
.item-stage::after{content:'';position:absolute;left:28%;right:28%;bottom:9%;height:9%;border-radius:50%;background:radial-gradient(#0009,transparent 70%);z-index:0}
.item-art{position:relative;z-index:1;object-fit:contain;filter:drop-shadow(0 5px 6px #0009)}
.item-art[data-icon=bear]{width:auto;height:88%;max-width:92%}
.item-art.tinted{filter:sepia(.45) saturate(1.5) brightness(1.12) hue-rotate(-8deg) drop-shadow(0 0 10px #ffd36a99) drop-shadow(0 5px 6px #0009)}
.shop-card:hover .item-art{transform:translateY(-3px) scale(1.04);transition:transform .2s}
.shop-bear{object-fit:cover;background:#2a150b}
/* Pause: carved title sign, gold primary, icon buttons and a compact adventure card. */
.game-panel-box[data-panel=pause]{width:min(900px,96%);padding:96px 26px 34px;overflow-y:auto;max-height:calc(100% - 16px);scrollbar-width:thin;border-width:16px;border-radius:26px;background-image:linear-gradient(#5a2f1544,#2a130a55),var(--panel-grain);box-shadow:0 0 0 2px #e2b65d,0 0 0 6px #4a2410,0 22px 60px #000b,inset 0 0 0 2px #8a5a2a}
.game-panel-box[data-panel=pause]::before,.game-panel-box[data-panel=pause]::after{content:'';position:absolute;width:150px;height:100px;background:url('assets/ui/foliage.png') center/contain no-repeat;pointer-events:none;z-index:2}
.game-panel-box[data-panel=pause]::before{display:none}
.game-panel-box[data-panel=pause]::after{display:none}
.game-panel-box[data-panel=pause] h1{position:absolute;left:50%;top:-6px;transform:translateX(-50%);margin:0;top:12px;padding:6px 46px 10px;min-width:300px;font-size:clamp(38px,4.6vw,62px);line-height:1;color:#ffd970;background:linear-gradient(#a8692e,#6e3d17 55%,#4d270d);border:3px solid #3b1c08;border-radius:16px;box-shadow:inset 0 2px 0 #e7b06a,inset 0 -3px 0 #2c1406,0 6px 10px #0008;-webkit-text-stroke:2px #5a2a08;paint-order:stroke fill;text-shadow:0 4px 0 #3a1806,0 6px 8px #0009;z-index:3}
.game-panel-box[data-panel=pause] h1::before,.game-panel-box[data-panel=pause] h1::after{content:'';position:absolute;top:50%;width:88px;height:56px;transform:translateY(-55%);background:url('assets/ui/cacao-emblem.svg') center/contain no-repeat;filter:drop-shadow(0 3px 3px #0008)}
.game-panel-box[data-panel=pause] h1::before{left:-62px;transform:translateY(-55%) rotate(-12deg)}
.game-panel-box[data-panel=pause] h1::after{right:-62px;transform:translateY(-55%) rotate(12deg)}
.game-panel-box[data-panel=pause] .panel-brand{margin:0 auto 4px;padding:4px 18px;letter-spacing:5px;font-size:12px;color:#ffd98a;border:2px solid #d4a24f;background:linear-gradient(#5a2c10,#3a1a08);border-radius:7px}
.game-panel-box[data-panel=pause] .course-subtitle{border:0;margin:0 0 16px;padding:0;display:flex;justify-content:center;align-items:center;gap:10px;color:#f6deb0;font-size:15px}
.game-panel-box[data-panel=pause] .course-subtitle::before,.game-panel-box[data-panel=pause] .course-subtitle::after{content:'❧';color:#e0b45a;font-size:16px}
.game-panel-box[data-panel=pause] .course-subtitle::before{transform:scaleX(-1)}
.pause-layout{grid-template-columns:1fr 1.05fr;gap:22px;text-align:left}
.pause-layout .game-panel-actions{gap:14px}
.pause-layout .game-panel-actions .wood-button{position:relative;display:flex;align-items:center;justify-content:center;gap:14px;min-height:64px;font:400 clamp(18px,1.9vw,24px)/1 Lilita,sans-serif;letter-spacing:.01em;border-radius:14px;border:2px solid #d9a856;background:linear-gradient(#7a4520,#4e2810);box-shadow:inset 0 1px 0 #f0c47a88,inset 0 -3px 0 #2a1306,0 4px 6px #0007;color:#ffeccb}
.pause-layout .game-panel-actions .wood-button::before{content:'';width:28px;height:28px;flex:none;background-position:center;background-size:contain;background-repeat:no-repeat}
.pause-layout .game-panel-actions [data-panel-action=resume]{background:linear-gradient(#ffe48c,#f3bd45 50%,#d99224);border-color:#fff0b0;color:#3a1d05;text-shadow:0 1px #ffeeb0;box-shadow:0 0 0 2px #8a5010,0 0 18px #ffc94a77,inset 0 2px 0 #fff6c8}
.pause-layout [data-panel-action=resume]::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 3l15 9-15 9z' fill='%233a1d05'/%3E%3C/svg%3E")}
.pause-layout [data-panel-action=settings]::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23f3c24e' d='M19.4 13a7.5 7.5 0 0 0 0-2l2.1-1.6-2-3.4-2.5 1a7.6 7.6 0 0 0-1.7-1L15 3.3h-4l-.4 2.7a7.6 7.6 0 0 0-1.7 1l-2.5-1-2 3.4L6.6 11a7.5 7.5 0 0 0 0 2l-2.1 1.6 2 3.4 2.5-1a7.6 7.6 0 0 0 1.7 1l.4 2.7h4l.4-2.7a7.6 7.6 0 0 0 1.7-1l2.5 1 2-3.4zM13 15.5a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7z' transform='translate(-1 0)'/%3E%3C/svg%3E")}
.pause-layout [data-panel-action=restart]::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 4a8 8 0 1 1-7.7 10' fill='none' stroke='%23f3c24e' stroke-width='3' stroke-linecap='round'/%3E%3Cpath d='M12 0v8l-5-4z' fill='%23f3c24e'/%3E%3C/svg%3E")}
.pause-layout [data-panel-action=menu]::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3 2 12h3v9h5v-6h4v6h5v-9h3z' fill='%23f3c24e'/%3E%3C/svg%3E")}
.pause-overview{padding:16px 18px;border:2px solid #c99549;border-radius:14px;background:linear-gradient(#3f1f0dcc,#2a1408d9)}
.pause-overview .section-title{font-size:26px;margin-bottom:10px}
.pause-scene{height:auto;aspect-ratio:16/7;border:2px solid #d4a24f;border-radius:10px;object-position:50% 55%;margin:0 0 10px}
.pause-overview .lede{font-size:14px;color:#f3dcb5;margin:0 0 10px}
.pause-progress-row{display:flex;align-items:center;gap:12px;margin:0 0 12px}
.pause-progress-row .experience-track{flex:1;margin:0;height:20px;max-width:none;border:2px solid #c99549;border-radius:12px;background:#1d0d05}
.pause-progress-row .experience-track span{background:linear-gradient(#a8f04e,#5fb51c);border-radius:10px}
.pause-progress-row .pause-progress{margin:0;font:400 24px Lilita;color:#ffd970;min-width:56px;text-align:right}
.pause-audio{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0 0 12px}
.pause-audio-card{display:flex;align-items:center;gap:10px;margin:0;padding:10px 12px;border:1px solid #b8843f;border-radius:10px;background:#2a1408aa}
.pause-audio-card>span{flex:1;min-width:0;font-size:13px;color:#ffe9c2}
.pause-audio-bar{display:block;height:8px;margin-top:6px;border:1px solid #9b6a30;border-radius:6px;background:#1a0c05;overflow:hidden}
.pause-audio-bar b{display:block;height:100%;background:linear-gradient(#ffe08a,#e2a632)}
.pause-audio .painted-icon{width:30px;height:30px}
.pause-overview>.wood-button{display:flex;align-items:center;justify-content:center;gap:12px;width:100%;min-height:54px;font:400 20px Lilita,sans-serif;border-radius:12px;border:2px solid #d9a856;background:linear-gradient(#7a4520,#4e2810)}
.game-panel-box[data-panel=pause] .game-panel-close{right:18px;top:16px;width:50px;height:50px;border-radius:50%;border:3px solid #e8bd62;background:radial-gradient(circle at 50% 35%,#8a5526,#4a2410);color:#ffe2a0;font-size:30px;box-shadow:0 4px 6px #0008}
@media(max-width:760px),(max-aspect-ratio:1/1){
 .game-panel-box[data-panel=pause]{width:94%;padding:84px 16px 26px}
 .game-panel-box[data-panel=pause] h1{min-width:220px;font-size:44px;padding:6px 30px 9px}
 .game-panel-box[data-panel=pause] h1::before,.game-panel-box[data-panel=pause] h1::after{width:64px;height:42px}
 .game-panel-box[data-panel=pause] h1::before{left:-44px}.game-panel-box[data-panel=pause] h1::after{right:-44px}
 .pause-layout{grid-template-columns:1fr;gap:16px}
 .pause-layout .game-panel-actions{grid-template-columns:1fr}
 .pause-layout .game-panel-actions .wood-button{min-height:58px;font-size:22px}
 .pause-layout .game-panel-actions [data-panel-action=resume]{grid-column:auto}
 .game-panel-box[data-panel=pause] .game-panel-close{right:8px;top:8px;width:44px;height:44px}
}
@media (max-height:540px) and (orientation:landscape){
 .game-panel-box[data-panel=pause]{padding:56px 16px 14px;max-height:calc(100% - 8px);border-width:10px}
 .game-panel-box[data-panel=pause] h1{font-size:28px;min-width:180px;padding:4px 26px 6px;top:6px}
 .game-panel-box[data-panel=pause] h1::before,.game-panel-box[data-panel=pause] h1::after{width:52px;height:34px}.game-panel-box[data-panel=pause] h1::before{left:-38px}.game-panel-box[data-panel=pause] h1::after{right:-38px}
 .game-panel-box[data-panel=pause] .panel-brand{font-size:9px;padding:2px 10px}.game-panel-box[data-panel=pause] .course-subtitle{font-size:12px;margin-bottom:8px}
 .pause-layout{gap:12px}.pause-layout .game-panel-actions{gap:8px}.pause-layout .game-panel-actions .wood-button{min-height:42px;font-size:16px}
 .pause-overview{padding:10px}.pause-overview .section-title{font-size:18px}.pause-scene{aspect-ratio:16/5}.pause-overview .lede{font-size:11px}
 .pause-audio-card{padding:6px 8px}.pause-overview>.wood-button{min-height:40px;font-size:15px}
 .game-panel-box[data-panel=pause]::before,.game-panel-box[data-panel=pause]::after{width:90px;height:60px}
 .game-panel-box[data-panel=pause] .game-panel-close{width:38px;height:38px;font-size:24px}
}
/* Gameplay visual direction: framed previews, device captions and a gold back button. */
#modal[data-route=reference]{width:min(900px,100%)}
.reference-hero{display:none}
.reference-intro{display:flex;align-items:center;gap:10px;margin:0 0 14px;padding:10px 16px;border:1px solid #c5975266;border-radius:10px;background:linear-gradient(90deg,#3a1b0bcc,#2a1308cc);font:400 clamp(15px,1.5vw,19px)/1.3 Lilita,sans-serif;color:#ffe9c0}
.reference-intro::before{content:'';flex:none;width:26px;height:26px;background:url('assets/ui/cacao-pod.svg') center/contain no-repeat}
#modal[data-route=reference] .art-gallery{display:grid;grid-template-columns:1.75fr 1fr;gap:16px;margin:0}
#modal[data-route=reference] figure{display:flex;flex-direction:column;align-items:center;gap:10px;margin:0;padding:12px;border:2px solid #d4a24f;border-radius:16px;background:radial-gradient(ellipse at 50% 30%,#4a240f,#22100699);box-shadow:inset 0 0 0 2px #6b3c16,0 6px 14px #0007}
.reference-frame{width:100%;flex:1;display:grid;place-items:center;border-radius:12px;background:#140904;overflow:hidden;border:2px solid #8a5a26;aspect-ratio:16/9.6}
#modal[data-route=reference] figure img{width:100%;height:100%;object-fit:contain;background:none;border-radius:10px}
#modal[data-route=reference] figure[data-device=mobile] .reference-frame{aspect-ratio:auto;height:100%}
#modal[data-route=reference] figure[data-device=mobile] img{height:100%;max-height:300px;width:auto}
#modal[data-route=reference] figcaption{display:inline-flex;align-items:center;gap:8px;margin:0;padding:6px 18px;border:1px solid #c59752;border-radius:999px;background:#2a1408;font:400 16px Lilita,sans-serif;color:#ffe2a6}
#modal[data-route=reference] figcaption::before{content:'';width:18px;height:18px;background:center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 4h18v12H3zM9 20h6M12 16v4' fill='none' stroke='%23ffe2a6' stroke-width='2'/%3E%3C/svg%3E")}
#modal[data-route=reference] figure[data-device=mobile] figcaption::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='7' y='2' width='10' height='20' rx='2' fill='none' stroke='%23ffe2a6' stroke-width='2'/%3E%3Cpath d='M11 18h2' stroke='%23ffe2a6' stroke-width='2'/%3E%3C/svg%3E")}
#modal[data-route=reference] .actions{margin-top:16px}
.wood-button.reference-back{flex:1;min-height:58px;border-radius:999px;border:2px solid #fff0b0;background:linear-gradient(#ffe48c,#f3bd45 50%,#d99224);color:#3a1d05;font:400 26px Lilita,sans-serif;text-shadow:0 1px #ffeeb0;box-shadow:0 0 0 2px #8a5010,0 0 16px #ffc94a66,inset 0 2px 0 #fff6c8}
@media(max-width:760px),(max-aspect-ratio:1/1){
 #modal[data-route=reference]{overflow-x:hidden}
 .reference-hero{display:block;position:relative;height:clamp(150px,34vw,230px);margin:-4px -6px 12px;border-radius:12px;overflow:hidden;background:url('assets/art/loading-mobile.webp') 50% 12%/cover no-repeat;box-shadow:inset 0 -40px 30px -10px #2a1408}
 .reference-plane{position:absolute;top:8%;width:78%;left:-80%;animation:reference-plane 9s linear infinite;filter:drop-shadow(0 4px 4px #0006)}
 #modal[data-route=reference] .art-gallery{grid-template-columns:1.6fr 1fr;gap:10px}
 #modal[data-route=reference] figure{padding:8px;gap:8px}
 #modal[data-route=reference] figcaption{font-size:13px;padding:4px 12px}
 .wood-button.reference-back{font-size:22px;min-height:52px}
}
@keyframes reference-plane{to{left:110%}}
@media (max-height:540px) and (orientation:landscape){
 #modal[data-route=reference] figure[data-device=mobile] img{max-height:180px}
 .reference-frame{aspect-ratio:16/8}
 .wood-button.reference-back{min-height:42px;font-size:19px}
 .reference-intro{font-size:13px;padding:6px 12px;margin-bottom:8px}
}
@media(prefers-reduced-motion:reduce){.reference-plane{animation:none;left:10%}}

.item-stage .item-art,.item-stage .item-art[data-icon=bear]{position:absolute;inset:6px;width:calc(100% - 12px);height:calc(100% - 12px);max-width:none;margin:0;padding:0;object-fit:contain}
.item-stage .item-art[data-icon=bear]{inset:4px 8px 2px;width:calc(100% - 16px);height:calc(100% - 6px)}
@media (max-height:760px) and (min-width:761px){
 .game-panel-box[data-panel=pause]{padding-top:78px;padding-bottom:20px}
 .game-panel-box[data-panel=pause] h1{font-size:44px}
 .pause-layout .game-panel-actions .wood-button{min-height:52px;font-size:20px}
 .pause-scene{aspect-ratio:16/5.5}
}
@media (max-height:540px) and (orientation:landscape){
 .pause-scene{display:none}
 .pause-layout .game-panel-actions .wood-button::before{width:20px;height:20px}
 .pause-audio{gap:6px;margin-bottom:8px}.pause-progress-row{margin-bottom:8px}.pause-progress-row .experience-track{height:14px}.pause-progress-row .pause-progress{font-size:18px}
}

/* Foliage as panel corners (inside the frame, scrolls with it). */
.game-panel[data-kind] {}
@media (max-height:540px) and (orientation:landscape){
 .game-panel-box[data-panel=pause]{padding:52px 14px 12px}
 .game-panel-box[data-panel=pause] h1{font-size:28px}
 .pause-layout .game-panel-actions .wood-button{min-height:40px;font-size:16px}
 .pause-overview .lede{display:none}
 .pause-audio-card{padding:5px 8px}.pause-audio-card>span{font-size:11px}
}

#modal[data-route=reference] figure{min-width:0}
#modal[data-route=reference] figure[data-device=mobile] img{max-width:100%}
@media(max-width:760px),(max-aspect-ratio:1/1){
 #modal[data-route=reference] .art-gallery{grid-template-columns:minmax(0,1.7fr) minmax(0,1fr);align-items:stretch}
 #modal[data-route=reference] figure[data-device=desktop] .reference-frame{aspect-ratio:auto}
 #modal[data-route=reference] figure img{object-fit:contain}
 #modal[data-route=reference] figure[data-device=mobile] img{max-height:none;height:auto;width:100%}
 .game-panel-box[data-panel=pause] h1{font-size:38px;min-width:0;padding:6px 22px 8px}
 .game-panel-box[data-panel=pause] h1::before{left:-40px}.game-panel-box[data-panel=pause] h1::after{right:-40px}
 .game-panel-box[data-panel=pause] .game-panel-close{top:4px;right:4px;width:40px;height:40px;font-size:24px}
 .pause-audio{grid-template-columns:1fr}
}

/* Portrait phones: titles never break mid-word; unavailable card stacks. */
@media(max-width:760px){
 #modal h1{overflow-wrap:normal;word-break:normal;hyphens:none;font-size:clamp(24px,7.4vw,30px)}
 .panel-heading .panel-title-group,#modal:has(#modal-content>.empty:first-child) .panel-heading .panel-title-group{padding:0 50px}
 .panel-heading .close-button{position:absolute;right:4px;top:8px}
 #modal-content>.empty{grid-template-columns:1fr;justify-items:center;text-align:center;padding:16px 14px;gap:8px}
 #modal-content>.empty img{grid-row:auto;width:72px;height:72px}
 #modal-content>.empty h2{font-size:22px}
 #modal-content>.empty+.panel-footer .wood-button{min-width:0;flex:1 1 140px}
}

/* Phase C: connection states and accessible competition controls. */
.connection-warning,.my-ranking{border:1px solid #e0bd79;border-radius:8px;padding:10px 12px;background:#25190f;color:#fff1d5;font-weight:800;line-height:1.5}
.ranking-controls{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;margin:12px 0}
.ranking-controls .field{min-width:0}.ranking-controls select{width:100%;min-width:0}
.ranking-row.self{background:#ffe09b18;box-shadow:inset 3px 0 #edc26e;padding-left:10px}
.historic-run{font-size:13px;border-left:2px solid #b18e62;padding-left:10px}
#modal :is(button,a,input,select,summary):focus-visible,.game-panel :is(button,a):focus-visible{outline:3px solid #fff3bb;outline-offset:3px;box-shadow:0 0 0 5px #25180c}
#modal :is(button,input,select),#modal summary{min-height:44px}#modal .notice{color:#f0d9b8}
.race-standings{position:absolute;right:12px;top:16%;width:240px;max-width:40%;padding:10px 12px;border:1px solid #c99a50;border-radius:12px;background:#21170fee;color:#fff1d5;font:700 12px Nunito;pointer-events:none}
.race-standings p{margin:0 0 6px}.race-position{font-size:15px;color:#ffe3a5}.race-connection{color:#ffe1b4;line-height:1.3}
.race-progress-list{list-style:none;padding:0;margin:0}.race-progress-row{display:grid;grid-template-columns:minmax(0,1fr) 56px 36px;gap:6px;align-items:center;min-height:26px}
.race-peer-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.race-progress-row.self{color:#ffe09b}.race-progress-row.disconnected{color:#e0c8aa}
.race-peer-progress{width:100%;height:8px;accent-color:#e5b85c}.race-peer-value{text-align:right;font-size:10px;overflow-wrap:anywhere}.race-metrics{font-size:9px;color:#e5cfae;line-height:1.3;margin-top:6px!important}
@media(max-width:760px){.ranking-controls{grid-template-columns:1fr}.race-standings{left:auto;right:8px;top:12%;width:220px;max-width:62%;padding:8px}.race-progress-row{grid-template-columns:minmax(0,1fr) 48px 32px;min-height:23px}}
@media(max-height:540px) and (orientation:landscape){
 #modal-layer{padding:8px}#modal{max-height:calc(100dvh - 16px);scroll-padding-top:88px;padding:8px 12px}
 #modal .panel-heading{position:sticky;top:-8px;z-index:5;background:#4b2b1c}#modal .panel-title-group{padding-right:50px}
 #modal .actions{gap:8px}#modal .wood-button{min-height:44px}.ranking-controls{grid-template-columns:repeat(3,minmax(0,1fr))}
 .race-standings{top:31%;left:auto;right:8px;width:195px;max-width:28%;padding:6px 8px;font-size:10px}.race-position{font-size:12px}.race-progress-row{min-height:20px;grid-template-columns:minmax(0,1fr) 38px 28px}.race-metrics{font-size:8px}
}

@media(max-height:540px) and (orientation:landscape){
 .game-panel-box:has(.competition-panel) h1{font-size:25px;margin-bottom:8px}
 .game-panel-box:has(.competition-panel) .panel-brand{display:none}
 .game-panel-box:has(.competition-panel) .course-subtitle{font-size:12px;margin:4px 0}
 .game-panel-box .competition-panel h2{font-size:23px;margin:6px 0}
 .game-panel-box .race-winner{padding:8px;min-height:0;margin-bottom:8px}
 .game-panel-box .race-winner img{width:44px;height:44px}
 .game-panel-box .race-winner strong{font-size:20px}
 .game-panel-box .race-rematch{margin:6px 0}.game-panel-box .rematch-status{font-size:11px;line-height:1.3;margin:4px 0}
 .game-panel-box .race-rematch .wood-button{min-height:44px;padding:8px 16px}
}

/* r5: clear campaign progression and a visible, unobstructed victory dance. */
.campaign-progress{padding:12px 16px;border:1px solid #aa8749;border-radius:10px;background:#1d301be6;color:#fff0bd;line-height:1.5}
.world-card.locked,.stage-card.locked{opacity:1;cursor:not-allowed;border-color:#776345;background:#271c15;box-shadow:none}
.world-card.locked img,.stage-card.locked img{filter:grayscale(.82) brightness(.62)}
.world-card.locked .tag,.stage-card.locked .stage-record{color:#ffe6b4;background:#251a12;border-color:#a48758}
.world-card.locked:hover{transform:none}
#game-ui.celebrating .game-control{visibility:hidden;pointer-events:none}
#game-ui.celebrating .game-hud{opacity:.5}
#game-ui.celebrating .game-notice,#game-ui.celebrating .net-status{visibility:hidden}
.celebration-banner{position:absolute;top:25%;left:50%;transform:translateX(-50%);display:grid;gap:6px;width:max-content;max-width:92%;padding:14px 24px;border:1px solid #f8d674;border-radius:16px;background:linear-gradient(120deg,#42230eee,#152c1eee);box-shadow:0 5px 24px #0006;text-align:center;color:#ffebaf;pointer-events:none}
.celebration-banner strong{font:400 clamp(22px,3vw,42px)/1.12 Lilita,serif;text-shadow:0 2px 3px #170900}
.celebration-banner span{font:800 clamp(14px,1.6vw,22px)/1.3 Nunito,sans-serif;color:#fff1ce}
.game-panel.campaign-finale{padding:16px;background:#081008b8}
.game-panel-box.campaign-box{width:min(1000px,96%);padding:0;border:2px solid #d7aa55;border-radius:20px;text-align:left;background:#23150e;max-height:calc(100% - 12px);overflow:auto;overscroll-behavior:contain;box-shadow:0 14px 70px #000b}
.campaign-hero{position:relative;min-height:310px;aspect-ratio:2.25/1;isolation:isolate;background:#122013;overflow:hidden}
.campaign-art{position:absolute;width:100%;height:100%;object-fit:cover;object-position:center;z-index:-2}
.campaign-hero::after{content:'';position:absolute;inset:0;background:linear-gradient(90deg,#0b1608d9 0%,#13210a55 40%,transparent 67%);z-index:-1}
.campaign-copy{width:54%;padding:24px 32px;box-sizing:border-box}
.campaign-logo{width:88px;height:88px;object-fit:contain;border:1px solid #bd9255;border-radius:12px;box-shadow:0 3px 12px #0006}
.campaign-box .campaign-eyebrow{font:900 10px/1.5 Nunito,sans-serif;letter-spacing:.12em;color:#f2d080;margin:16px 0 7px}
.campaign-box h1{font:400 clamp(36px,5vw,62px)/1.03 Lilita,serif;color:#fff0b0;margin:0 0 12px;text-shadow:0 3px 12px #001b00}
.campaign-box .campaign-done{font-size:16px;color:#fff5db;max-width:300px;line-height:1.4;margin:0}
.campaign-body{padding:18px 28px 24px;background:radial-gradient(ellipse at top,#483014 0%,#28180f 70%)}
.campaign-box .campaign-places{margin:0 0 14px;color:#d8e89e;font-size:13px;font-weight:900}
.campaign-body h2{font:400 28px/1.12 Lilita,serif;margin:0 0 8px;color:#ffdfa1}
.campaign-body>p{margin:0 0 18px;font-size:15px;color:#f0ddbf;line-height:1.5}
.campaign-actions{display:flex;gap:10px;flex-wrap:wrap}
.campaign-actions .wood-button{min-height:48px;flex:1 1 160px;font-size:14px}
@media(max-width:600px){
 .game-panel.campaign-finale{padding:8px}
 .game-panel-box.campaign-box{width:100%;border-radius:14px}
 .campaign-hero{min-height:300px;aspect-ratio:auto}
 .campaign-art{object-position:63% center}
 .campaign-copy{width:66%;padding:16px}
 .campaign-logo{width:66px;height:66px}
 .campaign-box .campaign-eyebrow{font-size:9px;max-width:170px;letter-spacing:.06em}
 .campaign-box h1{font-size:40px}
 .campaign-box .campaign-done{font-size:13px;max-width:175px}
 .campaign-body{padding:18px 16px}.campaign-body h2{font-size:25px}
 .campaign-actions{display:grid;grid-template-columns:1fr}.campaign-actions .wood-button{width:100%}
 .celebration-banner{top:29%;padding:12px 16px}.celebration-banner strong{font-size:25px}.celebration-banner span{font-size:16px}
}
@media(orientation:landscape) and (max-height:480px){
 .campaign-hero{min-height:210px;aspect-ratio:3/1}.campaign-copy{padding:14px 24px}.campaign-logo{width:58px;height:58px}
 .campaign-box .campaign-eyebrow{margin:6px 0}.campaign-box h1{font-size:38px;margin:0 0 6px}.campaign-box .campaign-done{font-size:13px;max-width:270px}
 .campaign-body{padding:14px 20px}.campaign-body h2{font-size:23px}.campaign-body>p{font-size:13px;margin-bottom:12px}
 .campaign-actions .wood-button{min-height:46px}.celebration-banner{top:26%;padding:8px 18px}.celebration-banner strong{font-size:26px}.celebration-banner span{font-size:15px}
}
@media(orientation:landscape) and (max-height:480px){
 .campaign-art{object-fit:contain;object-position:right center}
}

/* Fix: victory / timeout / race panels overflowed short screens (phones in landscape) and hid the Next / Restart / Menu buttons. */
.game-panel-box{overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch}
.game-panel-actions [data-panel-action=restart]:first-child:nth-last-child(2){grid-column:1/-1}
@media (max-height:480px){
 .game-panel{padding:6px}
 .game-panel-box:not([data-panel=pause]){max-height:calc(100% - 12px);padding:10px 14px}
 .game-panel-box:not([data-panel=pause]) h1{font-size:24px;margin-bottom:4px}
 .game-panel-box:not([data-panel=pause]) .panel-brand{margin-bottom:6px}
 .game-panel-box:not([data-panel=pause]) .course-subtitle{padding:0 0 6px;margin:0 0 8px}
 .game-panel-box:not([data-panel=pause]) .stats{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin:6px 0}
 .game-panel-box:not([data-panel=pause]) .stat{padding:6px 4px}
 .game-panel-box:not([data-panel=pause]) .stat img{width:24px;height:24px;margin-bottom:2px}
 .game-panel-box:not([data-panel=pause]) .stat strong{font-size:20px}
}
