/* Shared safe-area and portrait layout; text remains native-resolution HTML. */
:root{--safe-top:env(safe-area-inset-top,0px);--safe-bottom:env(safe-area-inset-bottom,0px)}
.dragon-native-modal #layaContainer{z-index:9!important}
#dragon-collection{z-index:30;background:transparent}
#dragon-home[inert]{filter:none;opacity:1}
#dragon-home,.collection-shell{overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
#dragon-home{padding-top:max(14px,var(--safe-top));padding-left:max(10px,env(safe-area-inset-left));padding-right:max(10px,env(safe-area-inset-right))}
.collection-shell{touch-action:pan-y}
.collection-shell button,.home-mode-switch button,.home-upgrade-grid button{min-height:44px}
#notice{z-index:50;bottom:calc(16px + var(--safe-bottom));pointer-events:none}
@media(max-width:600px) and (orientation:portrait){
 #dragon-home{gap:12px;padding-bottom:calc(18px + var(--safe-bottom))}
 .home-header{min-height:102px}
 .home-account>button{width:44px;height:44px}
 .home-stage{grid-template-columns:72px minmax(0,1fr) 8px;flex:1 0 260px;min-height:260px;max-height:440px}
 .home-navigation{gap:16px}:is(.home-navigation,.home-daily-entry) .home-nav-art{width:52px;height:52px}.home-navigation b{font-size:14px;margin-top:4px}.home-navigation small{font-size:10px;line-height:1.3}
 .home-orbit{min-height:204px}.home-hero-bottom h2{max-width:100%;padding:6px 12px;font-size:14px}.home-hero-bottom p{font-size:11px;line-height:1.4}
 .home-launch{width:100%;max-width:440px}.home-mode-switch{gap:8px}.home-mode-switch button{font-size:13px}.home-mode-description,.home-input-help{font-size:11px;line-height:1.4}.home-play{width:94%;min-height:54px}
 .home-tip-grid,.home-upgrade-grid{gap:6px}.home-tip-grid h3,.home-upgrade-grid h3{font-size:12px}.home-upgrade-grid button{flex-wrap:wrap;gap:2px;padding:4px 2px;font-size:11px;min-height:48px}.home-upgrade-grid button svg{width:23px;height:20px}.home-upgrade-grid p{font-size:10px;min-height:38px}.home-tip-grid p{font-size:11px;line-height:1.35;min-height:44px}
 #dragon-collection{padding:max(8px,var(--safe-top)) 8px max(8px,var(--safe-bottom))}
 .collection-shell{max-height:calc(100dvh - max(8px,var(--safe-top)) - max(8px,var(--safe-bottom)));padding:12px;border-radius:28px;border-width:3px}
 .collection-shell>header{display:grid;grid-template-columns:1fr 44px;gap:3px 8px;position:sticky;top:-12px;z-index:1;background:#f1f5e9;padding:10px 0;border-radius:15px}
 .collection-wallet{grid-row:2;grid-column:1;margin:0;font-size:14px}.collection-shell>header button{grid-column:2;grid-row:1/3;width:44px;padding:0;font-size:28px}
 .collection-layout{gap:16px}.collection-showcase{padding:12px;min-width:0}.collection-showcase canvas{height:190px}.collection-showcase h2{font-size:23px}.collection-actions button,.collection-once{font-size:14px;min-height:48px}.collection-rule{font-size:13px;line-height:1.5}.collection-list nav{gap:5px}.collection-list nav button{font-size:12px;padding:7px 3px;min-height:44px}.collection-card b{font-size:15px}.collection-card small{font-size:11px;line-height:1.35}
 #arena-minimap{top:calc(10px + var(--safe-top));left:10px;width:84px;padding:6px;border-radius:22px}#arena-minimap>strong{font-size:9px;letter-spacing:0;margin:0 0 4px}#arena-minimap>div{font-size:7px;flex-wrap:wrap;justify-content:center;gap:3px}#arena-minimap canvas{border-radius:15px}
 .dragon-run-info{top:calc(10px + var(--safe-top));width:94px;max-width:none;padding:8px 4px;border-radius:22px;box-sizing:border-box}.dragon-run-info>strong{font-size:23px}.dragon-run-info>span{font-size:9px}#dragon-bank{font-size:10px;min-height:44px;width:100%;line-height:1.2}
 #dragon-live-ranking{top:calc(110px + var(--safe-top));right:6px;width:136px;font-size:11px}#dragon-live-ranking header{font-size:9px;line-height:1.3;padding:3px 2px 5px;letter-spacing:0}#dragon-live-ranking ol{gap:1px}#dragon-live-ranking li{min-height:20px;padding:1px 2px;grid-template-columns:18px minmax(0,1fr) 36px;gap:3px}#dragon-live-ranking .king{min-height:30px}#dragon-live-ranking .rank-index .sky-king-crown{width:23px;height:23px;margin-left:-2px}#dragon-live-ranking small{font-size:8px}.dragon-own-rank{margin-top:3px;padding:5px 0;font-size:11px}
 #dragon-buffs{left:10px;top:calc(190px + var(--safe-top));transform:none;width:95px;max-width:none;padding:5px;box-sizing:border-box;font-size:10px}
 #dragon-supply-dock{left:10px;bottom:calc(14px + var(--safe-bottom));width:calc(100vw - 114px);max-width:none;gap:6px;flex-wrap:wrap}#dragon-supply-dock button{width:44px;height:54px;border-radius:16px;padding:3px;min-height:44px}#dragon-supply-dock img,#dragon-supply-dock svg{width:33px;height:33px}#dragon-supply-dock small{font-size:11px;line-height:13px}
 #dragon-sprint{right:12px;bottom:calc(24px + var(--safe-bottom));width:82px;height:82px}#dragon-sprint strong{font-size:31px}#dragon-sprint span{font-size:9px}#dragon-sprint small{font-size:9px}
}
@media(max-width:359px) and (orientation:portrait){.home-brand{padding-right:112px}.home-brand h1{font-size:16px}.home-tip-grid h3,.home-upgrade-grid h3{font-size:11px}.home-upgrade-grid button{font-size:10px}.home-tip-art,.home-upgrade-art{width:52px;height:52px}#dragon-live-ranking{width:127px}#dragon-chest-objective{gap:4px}#dragon-chest-objective time{font-size:11px}}

/* Compact landscape home: fit the mode and start controls inside short viewports. */
#dragon-home{z-index:6;scrollbar-width:none}
#dragon-home::-webkit-scrollbar{display:none}
.home-stage{isolation:isolate;overflow:hidden}
.home-hero-bottom{pointer-events:none;line-height:1.25}
.home-launch{position:relative;z-index:2;flex-shrink:0;pointer-events:auto}
.home-launch button{position:relative;z-index:1;pointer-events:auto}
.home-input-help{max-width:100%;line-height:1.35}
.home-input-help::before{content:'Move: WASD / ↑↓←→ · Boost: Space\A Mouse: click arena, then move to steer · Hold click to boost';white-space:pre-line;}
.dragon-touch-controls:not(.dragon-keyboard-controls) .home-input-help::before{content:'Drag to steer · Hold BOOST to speed up';}
.home-input-help{font-size:0}
.home-input-help::before{font-size:11px}
@media(orientation:landscape) and (max-height:720px){
 .home-logo{height:44px}.home-brand p{display:none}
 #dragon-home{height:100dvh;max-height:100dvh;overflow:hidden;gap:clamp(3px,1vh,8px);padding-top:max(6px,var(--safe-top));padding-bottom:max(6px,var(--safe-bottom))}
 .home-header{min-height:48px;flex:0 0 48px}
 .home-brand{padding-top:2px}.home-brand h1{font-size:clamp(18px,3vh,23px)}.home-brand p{margin:3px 0;font-size:10px}
 .home-account{right:4px;flex-direction:row;align-items:center;gap:8px}.home-account>button{width:40px;height:40px}.home-wallet{height:34px;min-width:116px}.home-wallet b{font-size:18px}.home-wallet svg{width:40px;height:40px}
 .home-account>.home-daily-entry{display:none}
 .home-stage{width:min(760px,100%);height:auto;min-height:0;flex:1 1 0;grid-template-columns:72px minmax(0,1fr) 72px}
 .home-navigation{gap:8px}.home-nav-art{width:48px;height:48px}.home-navigation b{font-size:13px;margin-top:3px}.home-navigation small{font-size:8px}
 .home-hero{min-height:0}.home-orbit{min-height:0;flex:1 1 0}.home-hero-bottom h2{font-size:13px;padding:3px 14px}.home-hero-bottom p{font-size:9px;margin-top:2px}
 .home-launch{width:min(480px,88%)}.home-mode-switch{gap:8px}.home-mode-switch button{min-height:40px;padding:6px;font-size:13px}.home-mode-description{font-size:10px;line-height:1.2;margin:4px 0}.home-play{width:88%;min-height:44px;padding:7px;font-size:18px!important}.home-input-help{margin-top:4px}.home-input-help::before{font-size:9px}
 .home-bottom{display:none}
}
@media(orientation:landscape) and (max-height:720px){
 .home-bottom{display:block;flex:0 0 auto;width:min(720px,100%)}
 .home-tip-grid,.home-upgrade-grid{gap:6px}
 .home-tip-grid article,.home-upgrade-grid article{min-height:0;padding:4px;border-width:2px;border-radius:18px;box-shadow:0 3px 0 #63949035}
 .home-tip-grid h3,.home-upgrade-grid h3{font-size:11px;line-height:1.1;padding:4px 2px}
 .home-tip-art,.home-upgrade-art{width:44px;height:44px;margin:3px 0}
 .home-tip-grid p,.home-upgrade-grid p{font-size:9px;line-height:1.15;min-height:18px;margin:2px 0}
 .home-upgrade-level{width:94%;font-size:12px;padding:2px}
 .home-upgrade-grid button{min-height:34px;font-size:10px;padding:3px;box-shadow:0 2px 0 #759e8e4d}
 .home-upgrade-grid button svg{width:18px;height:16px}
}
/* The border is a clipping shell; only the inset content region scrolls. */
#dragon-supply-shop section,.collection-shell{display:flex;flex-direction:column;overflow:hidden;min-height:0}
#dragon-supply-shop header,.collection-shell>header{position:relative;top:auto;flex-shrink:0}
.supply-scroll,.collection-scroll{min-height:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:#6caa9a #dcebdd;border-radius:16px;padding:4px 10px 10px 4px;margin-top:8px;-webkit-overflow-scrolling:touch}
.supply-scroll>p{font-size:14px;line-height:1.6;margin:8px 0 16px}
.supply-scroll::-webkit-scrollbar,.collection-scroll::-webkit-scrollbar{width:6px}
.supply-scroll::-webkit-scrollbar-track,.collection-scroll::-webkit-scrollbar-track{background:#dcebdd;border-radius:10px;margin:12px 0}
.supply-scroll::-webkit-scrollbar-thumb,.collection-scroll::-webkit-scrollbar-thumb{background:#6caa9a;border-radius:10px}
.supply-scroll::-webkit-scrollbar-button,.collection-scroll::-webkit-scrollbar-button{display:none;width:0;height:0}
.collection-grid{max-height:none;overflow:visible}
.collection-layout{min-height:initial}
@media(max-width:600px){.supply-scroll,.collection-scroll{padding-right:7px;border-radius:12px}.supply-scroll>p{font-size:13px}.collection-shell>header{padding-bottom:8px}}
/* Keep the carried inventory centered on every viewport, in one scrollable row. */
#dragon-supply-dock{left:50%;right:auto;bottom:calc(16px + var(--safe-bottom));transform:translateX(-50%);width:max-content;max-width:calc(100vw - 32px);box-sizing:border-box;flex-wrap:nowrap;gap:7px;padding:7px 9px 10px;border:1px solid #deedda99;border-radius:26px;background:#205763bd;overflow-x:auto;overflow-y:hidden;overscroll-behavior:contain;touch-action:pan-x;scrollbar-width:thin;scrollbar-color:#8fcdbc transparent}
#dragon-supply-dock button{flex:0 0 auto}
.dragon-touch-controls #dragon-sprint{display:flex}
#layaCanvas{touch-action:none}
#dragon-live-ranking{top:max(154px,18%)}
#dragon-chest-objective .chest-progress-compact{display:none}
#dragon-chest-objective[data-status="earned"] progress{accent-color:#efd071}
#dragon-chest-objective[data-status="expired"] progress{accent-color:#9ca9aa}
@media(max-width:760px) and (orientation:portrait){
 #dragon-live-ranking{top:calc(112px + var(--safe-top))}
 #dragon-supply-dock{left:50%;bottom:calc(10px + var(--safe-bottom));width:max-content;max-width:calc(100vw - 20px);gap:6px;padding:6px 7px 9px;flex-wrap:nowrap;border-radius:23px}
 #dragon-supply-dock button{width:44px;height:54px;border-radius:16px;padding:3px;min-height:44px}
 #dragon-supply-dock img,#dragon-supply-dock svg{width:33px;height:33px}
 /* Keep the objective with the map, away from the steering and boost area. */
 #dragon-chest-objective{left:max(10px,env(safe-area-inset-left));right:auto;top:var(--chest-hud-top,calc(164px + var(--safe-top)));bottom:auto;transform:none;width:min(240px,calc(100vw - 162px));max-width:none;gap:6px;padding:6px 8px;border-radius:16px;pointer-events:none}
 #dragon-chest-objective strong{font-size:10px;line-height:1.25;margin-bottom:4px}
 #dragon-chest-objective progress{height:4px;margin-bottom:3px}
 #dragon-chest-objective .chest-progress{display:none}
 #dragon-chest-objective .chest-progress-compact{display:block;font-size:10px;line-height:13px;white-space:nowrap}
 #dragon-chest-objective time{flex:0 0 28px;font-size:11px;text-align:right}
 #dragon-chest-objective button{flex:0 0 44px;width:44px;min-width:44px;min-height:44px;pointer-events:none}
 #dragon-chest-objective button:not(:disabled){pointer-events:auto}
 #dragon-chest-objective button svg{width:28px;height:28px}
 #dragon-chest-objective button span{font-size:9px;line-height:11px;white-space:nowrap}
 .dragon-chest-visible #dragon-buffs{left:max(10px,env(safe-area-inset-left));top:var(--chest-buffs-top,calc(244px + var(--safe-top)));transform:none;width:95px;max-width:none;box-sizing:border-box;padding:5px;font-size:10px}
 #dragon-sprint{bottom:calc(100px + var(--safe-bottom));right:15px;width:82px;height:82px}
}
/* Native CSS clipping avoids the hard alpha edges of the engine's preview mask. */
/* Keyboard guidance follows input capability, including narrow PC windows. */
#dragon-control-help{display:none;position:absolute;left:50%;bottom:calc(128px + var(--safe-bottom));transform:translateX(-50%);width:max-content;max-width:calc(100vw - 24px);box-sizing:border-box;padding:7px 12px;border:1px solid #b6d8c6;border-radius:16px;background:#205763ed;color:#fff4dc;font:12px/1.6 'Trebuchet MS',Arial,sans-serif;text-align:center;pointer-events:none}
.dragon-keyboard-controls #dragon-control-help{display:grid;gap:2px}
#dragon-control-help kbd{display:inline-block;padding:0 4px;border:1px solid #bfdac9;border-radius:5px;background:#fff9e8;color:#244e53;font:700 11px/16px 'Trebuchet MS',Arial,sans-serif;white-space:nowrap}
#dragon-control-help small{font-size:11px;line-height:1.5}
.dragon-keyboard-controls:not(.dragon-touch-controls) #dragon-sprint{display:none}
.dragon-keyboard-controls #dragon-supply-dock button{box-sizing:border-box;height:84px;padding:18px 3px 4px}
.dragon-keyboard-controls #dragon-supply-dock kbd{display:block;top:2px;left:50%;transform:translateX(-50%);min-width:18px;padding:0 2px;border-color:#f5eccd;border-radius:5px;background:#24535b;color:#fff8dc;font-size:11px;line-height:14px;text-align:center;box-sizing:border-box}
@media(max-width:760px) and (orientation:portrait){
 .dragon-keyboard-controls #dragon-supply-dock button{height:72px;padding:18px 3px 3px}
 #dragon-control-help{bottom:calc(108px + var(--safe-bottom));padding:7px 8px}
 .dragon-keyboard-controls.dragon-touch-controls #dragon-control-help{bottom:calc(194px + var(--safe-bottom))}
}
@media(orientation:landscape) and (max-height:560px){
 .dragon-keyboard-controls #dragon-supply-dock button{height:70px;padding-top:18px}
 #dragon-control-help{bottom:calc(114px + var(--safe-bottom));padding:5px 10px}
}
/* The collection shell never changes size when a filter changes its card count. */
#dragon-collection{box-sizing:border-box}
.collection-shell{box-sizing:border-box;width:min(1100px,100%);height:min(840px,calc(100dvh - 40px));max-height:calc(100dvh - 40px)}
.collection-scroll{flex:1;overflow:hidden;padding-bottom:8px;scrollbar-gutter:auto}
.collection-layout{height:100%;min-height:0;grid-template-rows:minmax(0,1fr)}
.collection-showcase{align-self:stretch;min-height:0;max-height:100%;box-sizing:border-box;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#aad8c7 transparent;scrollbar-gutter:stable}
.collection-showcase canvas{height:clamp(160px,29dvh,285px)}
.collection-list{min-height:0;overflow:hidden}
.collection-list nav{flex-shrink:0}
.collection-grid{flex:1;min-height:0;max-height:none;overflow-x:hidden;overflow-y:auto;grid-auto-rows:max-content;align-content:start;overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:thin;scrollbar-color:#6caa9a #dcebdd;scrollbar-gutter:stable;border-radius:18px;padding-right:10px}
.collection-grid::-webkit-scrollbar,.collection-showcase::-webkit-scrollbar{width:6px}
.collection-grid::-webkit-scrollbar-track,.collection-showcase::-webkit-scrollbar-track{background:#dcebdd66;border-radius:10px;margin:12px 0}
.collection-grid::-webkit-scrollbar-thumb,.collection-showcase::-webkit-scrollbar-thumb{background:#6caa9a;border-radius:10px}
.collection-grid::-webkit-scrollbar-button,.collection-showcase::-webkit-scrollbar-button{display:none;width:0;height:0}
.collection-empty{flex-shrink:0;text-align:center;font-size:13px}
@media(max-width:760px){
 .collection-shell{height:calc(100dvh - max(10px,var(--safe-top)) - max(10px,var(--safe-bottom)));max-height:calc(100dvh - max(10px,var(--safe-top)) - max(10px,var(--safe-bottom)))}
 .collection-layout{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,42fr) minmax(0,58fr);gap:12px}
 .collection-showcase{display:grid;grid-template-columns:minmax(90px,.85fr) minmax(0,1.15fr);align-content:start;align-items:start;gap:8px 12px;padding:12px}
 .collection-showcase canvas{grid-column:1;grid-row:1/5;height:150px;position:sticky;top:0}
 .collection-showcase>:not(canvas){grid-column:2;margin:0;max-width:100%;min-width:0}
 .collection-showcase h2{font-size:20px}.collection-family{font-size:11px}.collection-duration{font-size:11px;padding:6px 8px}.collection-rule{font-size:11px;line-height:1.4}
 .collection-showcase .collection-actions,.collection-showcase .collection-once,.collection-showcase .collection-base,.collection-showcase>small{grid-column:1/-1}
 .collection-showcase .collection-actions{margin:4px 0 7px}.collection-showcase .collection-base{margin:5px auto 12px}.collection-showcase>small{line-height:1.4}
 .collection-grid{grid-template-columns:repeat(2,minmax(0,1fr));padding-right:7px}
}
#dragon-trial{position:fixed;inset:0;z-index:31;display:grid;place-items:center;padding:max(12px,var(--safe-top)) max(12px,env(safe-area-inset-right)) max(12px,var(--safe-bottom)) max(12px,env(safe-area-inset-left));box-sizing:border-box;pointer-events:auto;font-family:'Trebuchet MS',Arial,sans-serif}
.trial-shell{display:flex;flex-direction:column;box-sizing:border-box;width:min(720px,100%);max-height:calc(100dvh - max(12px,var(--safe-top)) - max(12px,var(--safe-bottom)));overflow:hidden;border:2px solid #f6eddaaa;border-radius:38px;background:linear-gradient(155deg,color-mix(in srgb,var(--trial-dark) 72%,transparent),color-mix(in srgb,var(--trial-light) 76%,transparent)),url('./assets/cloud-islands.webp') center/cover,var(--trial-dark);box-shadow:0 7px 0 #24485340,inset 0 1px 1px #fff5;color:#fff5df}
.trial-shell header{display:flex;align-items:center;gap:14px;margin:18px;padding:12px 14px 12px 24px;border-radius:25px;background:var(--trial-dark);flex-shrink:0}
.trial-shell header>div{flex:1;text-align:center}.trial-shell h2{font-size:clamp(20px,3vw,32px);margin:7px 0}.trial-mode{font-size:13px;letter-spacing:.04em;color:var(--trial-ink)}
.trial-shell button{cursor:pointer;font:700 17px 'Trebuchet MS',Arial,sans-serif;min-height:48px;border:2px solid #d0edce;border-radius:26px;padding:10px 18px;background:linear-gradient(#b4e4ce,#68bca8);color:#173f49;box-shadow:0 4px 0 #345e5933,inset 0 1px 1px #fff8;touch-action:manipulation}
.trial-shell button:disabled{cursor:wait;opacity:.6}.trial-shell button:focus-visible{outline:3px solid #fff4c6;outline-offset:3px}.trial-shell [data-close]{flex:none;width:48px;height:48px;padding:0;font-size:30px;border-radius:50%}
.trial-scroll{overflow:auto;min-height:0;scrollbar-width:thin;scrollbar-color:var(--trial-ink) transparent;margin:0 16px;border-radius:24px;text-align:center;overscroll-behavior:contain}
.trial-scroll canvas{display:block;width:100%;height:clamp(200px,43dvh,430px)}.trial-scroll h3{margin:0 12px 12px;font-size:27px;color:var(--trial-ink)}.trial-scroll p{font-size:17px;line-height:1.5;margin:0 auto 16px;padding:0 16px;max-width:540px}
.trial-shell footer{flex-shrink:0;padding:16px 22px 18px;background:color-mix(in srgb,var(--trial-dark) 84%,transparent);text-align:center}.trial-actions{display:grid;grid-template-columns:1fr 1fr;gap:18px}.trial-actions>button{min-height:60px;display:flex;align-items:center;justify-content:center;gap:10px}.trial-actions [data-video]{background:linear-gradient(#ffe4a4,#efbe60);border-color:#f6d888;color:#533913}.trial-actions svg{width:32px;height:25px;flex:none}
@media(max-width:600px){.trial-shell{border-radius:28px}.trial-shell header{margin:10px;padding:8px 10px;border-radius:20px;gap:5px}.trial-shell h2{font-size:20px}.trial-mode{font-size:11px}.trial-scroll canvas{height:clamp(185px,36dvh,330px)}.trial-scroll h3{font-size:22px}.trial-scroll p{font-size:14px;padding:0 4px}.trial-shell footer{padding:12px}.trial-actions{gap:10px}.trial-actions>button{font-size:14px;padding:8px;min-height:54px}.trial-actions svg{width:24px}}

/* Loading feedback stays inside the trial preview; gameplay actions remain available. */
.trial-preview{position:relative;isolation:isolate}
.trial-preview-status{position:absolute;z-index:1;left:50%;top:50%;transform:translate(-50%,-50%);display:flex;flex-direction:column;align-items:center;gap:7px;width:min(290px,calc(100% - 24px));box-sizing:border-box;padding:14px 16px;border:1px solid #fff0cb80;border-radius:22px;background:var(--trial-dark,#205763);box-shadow:0 4px 14px #173f4933;color:#fff8e8;pointer-events:none}
.trial-preview-status strong{font-size:16px;line-height:1.3}
.trial-preview-hint{font-size:12px;line-height:1.4}
.trial-preview-spinner{display:block;flex:none;width:24px;height:24px;box-sizing:border-box;border:3px solid #fff4;border-top-color:#ffe3a0;border-radius:50%;animation:trial-preview-spin .9s linear infinite}
.trial-shell .trial-preview-status button{pointer-events:auto;min-height:44px;margin:2px 0 4px;padding:7px 16px;font-size:13px;line-height:1.2}
.trial-preview.has-cover .trial-preview-status{top:auto;bottom:8px;transform:translateX(-50%);padding:9px 12px;gap:5px}
.trial-preview.has-cover .trial-preview-spinner,.trial-preview[data-preview-state="error"] .trial-preview-spinner,.trial-preview[data-preview-state="timeout"] .trial-preview-spinner{display:none}
@keyframes trial-preview-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.trial-preview-spinner{animation:none}}

/* Keep the collection controls in place while only the skin cards scroll. */
@media(max-width:760px) and (orientation:portrait){
 #dragon-collection{display:flex;align-items:stretch;justify-content:center;overflow:hidden;overscroll-behavior:contain;padding:max(8px,var(--safe-top)) max(8px,env(safe-area-inset-right)) max(8px,var(--safe-bottom)) max(8px,env(safe-area-inset-left))}
 .collection-shell{box-sizing:border-box;width:min(100%,600px);height:100%;min-height:0;max-height:100%;overflow:hidden;margin:0 auto;padding:8px;border-radius:24px}
 .collection-shell>header{position:relative;top:auto;z-index:1;flex:0 0 auto;grid-template-columns:minmax(0,1fr) 44px;gap:3px 8px;padding:7px 5px 8px;background:#f1f5e9;box-shadow:0 3px 7px #e8efe188;border-radius:15px}
 .collection-shell h1{font-size:21px}.collection-shell>header small{font-size:9px}.collection-shell .dialog-wallet{margin-top:2px;margin-bottom:3px}
 .collection-scroll{display:flex;flex:1 1 auto;min-height:0;overflow:hidden;padding:0;margin:7px 0 0;border-radius:0;touch-action:pan-y}
 .collection-layout{display:grid;width:100%;height:100%;min-height:0;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:8px}
 .collection-showcase{display:grid;grid-template-columns:minmax(76px,.65fr) minmax(0,1.35fr);align-content:start;align-items:center;gap:5px 8px;max-height:none;min-height:0;overflow:hidden;padding:9px;border-radius:22px}
 .collection-showcase canvas{grid-column:1;grid-row:1/5;height:clamp(78px,12dvh,112px);position:static;top:auto}
 .collection-showcase>:not(canvas){grid-column:2;margin:0;max-width:100%;min-width:0}
 .collection-showcase h2{font-size:19px}.collection-family{font-size:10px}.collection-duration{font-size:10px;padding:4px 7px}.collection-rule{font-size:10px;line-height:1.3}
 .collection-showcase .collection-actions,.collection-showcase .collection-once,.collection-showcase .collection-base,.collection-showcase>small{grid-column:1/-1}
 .collection-showcase .collection-actions{grid-template-columns:minmax(0,1fr);gap:5px;margin:4px 0}.collection-showcase .collection-actions button{grid-column:1/-1;width:100%;min-width:0;padding:5px;font-size:12px}.collection-showcase .collection-base{margin:2px auto 4px}.collection-showcase>small{font-size:10px;line-height:1.25}
 .collection-list{display:flex;flex-direction:column;overflow:hidden;min-height:0}
 .collection-list nav{flex:0 0 auto;gap:5px;margin:0 0 6px}.collection-list nav button{min-width:0;padding:6px 3px;font-size:11px}
 .collection-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));flex:1 1 auto;min-height:0;max-height:none;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;gap:8px 7px;padding:3px 2px 8px;scrollbar-width:thin;scrollbar-color:#6caa9a transparent}
 .collection-grid .collection-card{padding:6px;border-radius:20px}.collection-grid .collection-picture{width:min(100%,142px);margin:0 auto;border-radius:15px}
 .collection-grid::-webkit-scrollbar{width:5px}.collection-grid::-webkit-scrollbar-thumb{background:#6caa9a;border-radius:8px}.collection-showcase::-webkit-scrollbar{display:none}
}

@media(max-width:760px) and (orientation:portrait) and (max-height:700px){
 .collection-shell{padding:6px}.collection-shell>header{gap:2px 7px;padding:5px 4px 6px}.collection-shell h1{font-size:19px}
 .collection-scroll{margin-top:5px}.collection-layout{gap:6px}.collection-showcase{grid-template-columns:minmax(68px,.6fr) minmax(0,1.4fr);gap:4px 6px;padding:7px}
 .collection-showcase canvas{height:clamp(64px,10dvh,82px)}.collection-showcase h2{font-size:17px}.collection-showcase .collection-actions{gap:3px;margin:3px 0}.collection-showcase>small{font-size:9px}
 .collection-list nav{gap:4px;margin-bottom:4px}.collection-list nav button{padding:5px 2px;font-size:10px}.collection-grid{gap:6px;padding:2px}
}

/* One centered home composition, with matching left and right feature rails. */
#dragon-home{--home-shell:960px;--home-nav-size:84px;--home-rail-gap:30px;--home-rail-top:20px}
.home-header,.home-stage{width:min(var(--home-shell),100%)}
.home-brand{padding:0 176px;text-align:center}
.home-brand h1,.home-brand p{max-width:none;margin-left:auto;margin-right:auto}
.home-logo{margin-left:auto;margin-right:auto}
.home-account{position:absolute;inset:0;display:block;margin:0;pointer-events:none}
.home-account>[data-action="sound"]{position:absolute;top:0;left:calc((var(--home-nav-size) - 54px)/2);right:auto;margin:0;pointer-events:auto}
.home-account>.home-wallet{position:absolute;top:6px;right:0;pointer-events:auto}
.home-stage{grid-template-columns:var(--home-nav-size) minmax(0,1fr) var(--home-nav-size);column-gap:24px;height:auto;min-height:260px;flex:1 1 360px}
.home-navigation{grid-column:1;grid-row:1;align-self:start;align-items:center;gap:var(--home-rail-gap);padding-top:var(--home-rail-top)}
.home-hero{grid-column:2;grid-row:1}
.home-side-actions{grid-column:3;grid-row:1;align-self:start;justify-self:center;padding-top:var(--home-rail-top)}
#dragon-home .home-nav-art{width:var(--home-nav-size);height:var(--home-nav-size)}
.home-navigation .home-daily-entry{width:var(--home-nav-size);height:var(--home-nav-size)}
.home-hero-bottom,#dragon-home.home-time-mode .home-hero-bottom{padding-bottom:8px}
#dragon-home.home-time-mode .home-launch{margin-top:0}
.home-bottom{min-height:280px}
.home-bottom>div:not([hidden]),.home-tip-grid,.home-upgrade-grid{min-height:inherit}
.home-tip-grid article{justify-content:space-between}
@media(max-width:760px) and (orientation:portrait){
 #dragon-home{--home-shell:600px;--home-nav-size:64px;--home-rail-gap:28px;--home-rail-top:16px}
 .home-header{min-height:0;flex:0 0 auto}
 .home-brand{padding:52px 0 0;text-align:center}.home-brand h1{max-width:none;line-height:0}.home-brand p{font-size:11px;margin:0;max-width:none}
 .home-logo{width:100%;max-width:260px;height:72px;margin:0 auto}
 .home-account{position:absolute;inset:0;margin:0}
 .home-account>[data-action="sound"]{position:absolute;top:0;left:calc((var(--home-nav-size) - 40px)/2);right:auto;width:40px;height:40px;margin:0}
 .home-account>.home-wallet{top:4px;right:0}
 .home-wallet{height:32px;min-width:112px;gap:10px;padding-left:14px}.home-wallet b{font-size:18px}.home-wallet svg{width:42px;height:42px}
 .home-stage{column-gap:12px;height:auto;min-height:234px;max-height:360px;flex:1 0 234px}
 .home-orbit{min-height:160px}
 .home-bottom{min-height:258px}
}
@media(max-width:760px) and (orientation:portrait) and (max-height:720px){
 #dragon-home{--home-nav-size:56px;--home-rail-gap:22px;--home-rail-top:12px;gap:8px}
 .home-logo{height:58px}.home-brand{padding-top:48px}.home-brand p{font-size:10px}
 .home-stage{min-height:192px;flex-basis:192px}.home-orbit{min-height:140px}
 .home-bottom{min-height:238px}
 .home-tip-grid article,.home-upgrade-grid article{padding:6px 5px 9px}.home-tip-art,.home-upgrade-art{width:52px;height:52px;margin:5px 0}
 .home-tip-grid p,.home-upgrade-grid p{font-size:10px;min-height:26px}.home-tip-grid h3,.home-upgrade-grid h3{min-height:30px;font-size:11px}
}
@media(orientation:landscape) and (max-height:760px){
 #dragon-home{--home-nav-size:56px;--home-rail-gap:20px;--home-rail-top:8px}
 .home-brand{padding-left:176px;padding-right:176px}
 .home-account>[data-action="sound"]{width:40px;height:40px;left:calc((var(--home-nav-size) - 40px)/2);margin:0}
 .home-account>.home-wallet{top:4px}
 .home-wallet{min-width:112px;height:32px}.home-wallet b{font-size:18px}.home-wallet svg{width:40px;height:40px}
 .home-stage{width:min(var(--home-shell),100%);min-height:0;flex:1 1 0}
 .home-bottom{min-height:180px}
}
@media(orientation:landscape) and (max-height:480px){
 #dragon-home{--home-nav-size:46px;--home-rail-gap:14px;--home-rail-top:4px}
 .home-brand{padding-left:160px;padding-right:160px}
 .home-bottom{min-height:150px}
}

/* Portrait home uses the visible viewport, with space reserved for every action.
   Only the hero and card artwork flex; the home itself is not a scroll container. */
@media(max-width:760px) and (orientation:portrait){
 #dragon-home{
  --home-vh:calc(var(--home-viewport-height,100vh) / 100);
  --home-nav-size:clamp(48px,calc(var(--home-vh) * 8),68px);
  --home-rail-gap:clamp(14px,calc(var(--home-vh) * 2.8),26px);
  --home-rail-top:4px;
  --home-card-height:clamp(204px,calc(var(--home-vh) * 28),248px);
  --home-card-icon:clamp(44px,calc(var(--home-vh) * 7),64px);
  inset:var(--home-viewport-top,0px) 0 auto;
  height:100vh;height:var(--home-viewport-height,100dvh);max-height:none;
  display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto var(--home-card-height);
  align-items:stretch;justify-items:center;gap:6px;overflow:hidden;overscroll-behavior:none;
  padding:max(8px,var(--safe-top)) max(10px,env(safe-area-inset-right)) max(16px,var(--safe-bottom)) max(10px,env(safe-area-inset-left));
 }
 #dragon-home .home-header{grid-row:1;min-height:0;height:auto}
 #dragon-home .home-brand{padding:44px 0 0;text-align:center}
 #dragon-home .home-logo{height:clamp(44px,calc(var(--home-vh) * 7.8),68px);max-width:260px;margin:0 auto}
 #dragon-home .home-brand p{font-size:10px;line-height:12px;margin:0}
 #dragon-home .home-account>[data-action="sound"]{width:44px;height:44px;left:calc((var(--home-nav-size) - 44px)/2)}
 #dragon-home .home-stage{grid-row:2;height:100%;min-height:0;max-height:none;grid-template-rows:minmax(0,1fr);column-gap:8px}
 #dragon-home .home-navigation{height:min(100%,calc(var(--home-nav-size) * 2 + var(--home-rail-gap) + var(--home-rail-top) + 9px));min-height:0;gap:0;justify-content:space-between;padding-bottom:9px}
 #dragon-home .home-hero{height:100%;min-height:0}
 #dragon-home .home-orbit{min-height:0;flex:1 1 0}
 #dragon-home .home-hero-bottom,#dragon-home.home-time-mode .home-hero-bottom{padding-bottom:4px}
 #dragon-home .home-hero-bottom h2{font-size:14px;line-height:18px;padding:4px 12px}
 #dragon-home .home-hero-bottom p{font-size:10px;line-height:12px;margin:4px 0 0}
 #dragon-home .home-launch{grid-row:3;width:100%;max-width:440px;margin:0}
 #dragon-home .home-mode-switch button{min-height:44px;height:44px;padding:5px 3px;font-size:13px;line-height:1.2}
 #dragon-home .home-mode-description{font-size:10px;line-height:12px;margin:5px 0}
 #dragon-home .home-play{min-height:50px;height:50px;padding:5px 10px;font-size:21px!important}
 #dragon-home .home-input-help{margin:6px 0 0;line-height:1.3}
 #dragon-home .home-input-help::before{font-size:10px;line-height:13px}
 #dragon-home .home-bottom{grid-row:4;height:100%;min-height:0}
 #dragon-home .home-bottom>div:not([hidden]),#dragon-home .home-tip-grid,#dragon-home .home-upgrade-grid{height:100%;min-height:0}
 #dragon-home .home-tip-grid,#dragon-home .home-upgrade-grid{gap:7px}
 #dragon-home .home-tip-grid article,#dragon-home .home-upgrade-grid article{display:grid;justify-items:center;align-items:center;min-height:0;height:100%;padding:6px 5px 10px;border-width:3px;border-radius:26px;gap:3px}
 #dragon-home .home-tip-grid article{grid-template-columns:minmax(0,1fr);grid-template-rows:32px minmax(0,1fr) 42px}
 #dragon-home .home-upgrade-grid article{grid-template-columns:minmax(0,1fr);grid-template-rows:28px minmax(0,1fr) 24px 28px 44px}
 #dragon-home .home-tip-grid h3,#dragon-home .home-upgrade-grid h3{display:grid;place-items:center;min-height:0;height:100%;margin:0;padding:3px 2px;font-size:11px;line-height:1.15}
 #dragon-home .home-tip-art,#dragon-home .home-upgrade-art{width:var(--home-card-icon);height:var(--home-card-icon);max-width:100%;max-height:100%;margin:0;align-self:center}
 #dragon-home .home-upgrade-level{width:100%;height:24px;padding:1px 2px;font-size:14px;line-height:18px;align-items:center}
 #dragon-home .home-tip-grid p,#dragon-home .home-upgrade-grid p{display:grid;place-items:center;min-height:0;width:100%;height:100%;margin:0;font-size:10px;line-height:1.25}
 #dragon-home .home-upgrade-grid button{min-height:44px;height:44px;padding:3px 2px;font-size:11px;line-height:12px;gap:2px}
 #dragon-home .home-upgrade-grid button svg{width:18px;height:16px}
 #dragon-home[data-home-fit="compact"],#dragon-home[data-home-fit="short"]{--home-nav-size:48px;--home-rail-gap:14px;--home-rail-top:0px;--home-card-height:190px;--home-card-icon:42px;gap:4px;padding-top:max(6px,var(--safe-top));padding-bottom:max(14px,var(--safe-bottom))}
 #dragon-home[data-home-fit="compact"] .home-logo{height:44px}
 #dragon-home[data-home-fit="compact"] .home-play,#dragon-home[data-home-fit="short"] .home-play{min-height:48px;height:48px}
 #dragon-home[data-home-fit="compact"] .home-mode-description,#dragon-home[data-home-fit="short"] .home-mode-description{margin:3px 0}
 #dragon-home[data-home-fit="compact"] .home-input-help,#dragon-home[data-home-fit="short"] .home-input-help{margin-top:4px}
 #dragon-home[data-home-fit="compact"] .home-upgrade-grid article{padding:4px 4px 8px;gap:2px;grid-template-rows:26px minmax(0,1fr) 22px 26px 44px}
 #dragon-home[data-home-fit="compact"] .home-upgrade-level{height:22px;font-size:13px}
 /* Small phones with both browser toolbars visible keep the price targets full size. */
 #dragon-home[data-home-fit="short"]{--home-nav-size:44px;--home-rail-gap:8px;--home-card-height:166px;--home-card-icon:36px;gap:3px}
 #dragon-home[data-home-fit="short"] .home-header{min-height:48px}
 #dragon-home[data-home-fit="short"] .home-brand{padding:0}
 #dragon-home[data-home-fit="short"] .home-logo{height:44px;max-width:min(180px,calc(100% - 210px))}
 #dragon-home[data-home-fit="short"] .home-brand p{display:none}
 #dragon-home[data-home-fit="short"] .home-wallet{min-width:96px;height:30px;padding-left:10px;gap:6px}
 #dragon-home[data-home-fit="short"] .home-wallet b{font-size:16px}
 #dragon-home[data-home-fit="short"] .home-wallet svg{width:36px;height:36px}
 #dragon-home[data-home-fit="short"] .home-upgrade-grid article{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:26px minmax(0,1fr) 26px 44px;gap:2px;padding:4px 4px 8px}
 #dragon-home[data-home-fit="short"] .home-upgrade-grid h3{grid-column:1/-1;grid-row:1}
 #dragon-home[data-home-fit="short"] .home-upgrade-art{grid-column:1;grid-row:2}
 #dragon-home[data-home-fit="short"] .home-upgrade-level{grid-column:2;grid-row:2;flex-direction:column;justify-content:center;height:32px;font-size:11px;line-height:13px}
 #dragon-home[data-home-fit="short"] .home-upgrade-grid p{grid-column:1/-1;grid-row:3;font-size:9px}
 #dragon-home[data-home-fit="short"] .home-upgrade-grid button{grid-column:1/-1;grid-row:4;font-size:10px}
 #dragon-home[data-home-fit="short"] .home-tip-grid article{grid-template-rows:28px minmax(0,1fr) 40px}
}

/* Keep the game surface fixed; scrolling belongs to popup content only. */
html,body{overscroll-behavior:none}
#dragon-home{overflow:hidden;overscroll-behavior:none}
@media(min-width:761px),(orientation:landscape){
 #dragon-home{top:var(--home-viewport-top,0px);bottom:auto;height:var(--home-viewport-height,100dvh);display:grid;grid-template-rows:auto minmax(0,1fr) auto clamp(150px,25dvh,270px);justify-items:center;align-items:stretch;gap:8px}
 #dragon-home .home-header{min-height:0}
 #dragon-home .home-stage{height:100%;min-height:0;max-height:none}
 #dragon-home .home-hero{min-height:0}
 #dragon-home .home-orbit{min-height:0}
 #dragon-home .home-bottom,#dragon-home .home-bottom>div:not([hidden]),#dragon-home .home-tip-grid,#dragon-home .home-upgrade-grid{height:100%;min-height:0}
 #dragon-home .home-tip-grid article,#dragon-home .home-upgrade-grid article{min-height:0;padding:7px 9px 10px}
 #dragon-home .home-tip-art,#dragon-home .home-upgrade-art{flex:1 1 0;min-height:0;max-height:90px;margin:4px 0}
 #dragon-home .home-tip-grid h3,#dragon-home .home-upgrade-grid h3{flex:none;font-size:14px}
 #dragon-home .home-upgrade-grid button{flex:none}
}
@media(orientation:landscape) and (max-height:560px){
 #dragon-home{grid-template-columns:minmax(0,1fr) minmax(230px,.85fr);grid-template-rows:auto minmax(0,1fr) auto;padding:10px 16px 16px;column-gap:20px;--home-nav-size:44px;--home-rail-gap:14px;--home-rail-top:0px}
 #dragon-home .home-header{grid-column:1/-1;grid-row:1}
 #dragon-home .home-stage{grid-column:1;grid-row:2}
 #dragon-home .home-launch{grid-column:1;grid-row:3;width:100%;margin:0}
 #dragon-home .home-bottom{grid-column:2;grid-row:2/4;align-self:stretch;max-height:300px}
 #dragon-home .home-brand{padding:0 160px}
 #dragon-home .home-logo{height:42px}
 #dragon-home .home-brand p{font-size:10px}
 #dragon-home .home-tip-grid,#dragon-home .home-upgrade-grid{gap:6px}
 #dragon-home .home-tip-grid article,#dragon-home .home-upgrade-grid article{padding:6px 4px;border-width:3px;border-radius:22px}
 #dragon-home .home-tip-grid h3,#dragon-home .home-upgrade-grid h3{font-size:11px}
 #dragon-home .home-tip-grid p,#dragon-home .home-upgrade-grid p{font-size:10px}
 #dragon-home .home-hero-bottom h2{font-size:12px;padding:2px 12px}
 #dragon-home .home-hero-bottom p{font-size:9px;margin-top:2px}
 #dragon-home .home-mode-switch button{min-height:36px;padding:4px;font-size:12px}
 #dragon-home .home-mode-description{margin:4px 0;font-size:9px}
 #dragon-home .home-play{min-height:40px;padding:5px;font-size:19px!important}
 #dragon-home .home-input-help{margin:5px 0 0;font-size:0}
 #dragon-home .home-input-help::before{font-size:9px}
}

/* A bounded art row keeps time-mode upgrades aligned at desktop heights. */
.home-upgrade-art{display:flex;align-items:center;justify-content:center;overflow:hidden}
.home-upgrade-art>svg,.home-upgrade-art>img{display:block;max-width:100%;max-height:100%;object-fit:contain}
@media(min-width:761px) and (min-height:561px){
 #dragon-home.home-time-mode{grid-template-rows:auto minmax(0,1fr) auto clamp(224px,28dvh,280px)}
 #dragon-home .home-upgrade-grid article{display:grid;grid-template-rows:32px minmax(40px,1fr) 28px 26px 44px;justify-items:center;align-items:center;gap:3px;padding:7px 9px 10px}
 #dragon-home .home-upgrade-grid h3{display:grid;place-items:center;height:32px;padding:4px 3px;margin:0}
 #dragon-home .home-upgrade-art{width:72px;height:100%;max-height:76px;margin:0;align-self:center}
 #dragon-home .home-upgrade-level{height:28px;align-items:center;padding:1px 4px;font-size:16px}
 #dragon-home .home-upgrade-grid p{min-height:0;margin:0;font-size:10px;line-height:13px}
 #dragon-home .home-upgrade-grid button{height:44px;min-height:44px}
}

/* Short landscape containers reserve usable artwork and action rows. */
.home-tip-art{overflow:hidden}
@media(orientation:landscape) and (max-height:560px){
 #dragon-home .home-stage{grid-template-columns:var(--home-nav-size) minmax(0,1fr) var(--home-nav-size);column-gap:8px}
 #dragon-home .home-tip-grid article,#dragon-home .home-upgrade-grid article{display:grid;justify-items:center;align-items:center;gap:3px;padding:6px 4px 8px}
 #dragon-home .home-tip-grid article{grid-template-rows:30px minmax(44px,1fr) 46px}
 #dragon-home .home-upgrade-grid article{grid-template-rows:30px minmax(44px,1fr) 24px 28px 44px}
 #dragon-home .home-tip-grid h3,#dragon-home .home-upgrade-grid h3{display:grid;place-items:center;height:30px;padding:3px 2px;margin:0}
 #dragon-home .home-tip-art,#dragon-home .home-upgrade-art{width:70px;max-width:100%;height:100%;max-height:86px;min-height:0;margin:0;align-self:center}
 #dragon-home .home-tip-grid p,#dragon-home .home-upgrade-grid p{min-height:0;margin:0;font-size:10px;line-height:13px}
 #dragon-home .home-upgrade-level{height:24px;align-items:center;padding:1px 2px;font-size:13px}
 #dragon-home .home-upgrade-grid button{height:44px;min-height:44px;padding:3px;font-size:10px;line-height:12px;gap:3px}
 #dragon-home .home-upgrade-grid button svg{width:18px;height:16px;flex:none}
}
