:root{color-scheme:light;--cream:#fffaf0;--paper:#fffdf7;--ink:#091d48;--gold:#dba64e;--muted:#64708b;font-family:Georgia,'Palatino Linotype',serif;color:var(--ink);background:var(--cream)}*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0;min-height:100dvh;padding:24px 14px;background:radial-gradient(ellipse at 50% 32%,#fffefb 5%,#fffaf0 72%,#faf0dd)}#portal{width:100%;max-width:490px;margin:0 auto;padding:28px 24px 20px;text-align:center;background:linear-gradient(145deg,#fffefa,#fff7e8);border:1px solid var(--gold);border-radius:28px;box-shadow:inset 0 0 0 4px #fffcf5,0 12px 36px #8d622c14}.brand{color:#9b6a25;font:700 .8rem/1.3 Georgia,serif;letter-spacing:.2em}.test-label{display:inline-block;margin:20px 0 0;padding:5px 12px;border:1px solid #d3b16f88;border-radius:99px;font:500 .72rem/1.4 system-ui;color:#78571f}h1{font:700 clamp(1.7rem,7vw,2.25rem)/1.13 Georgia,serif;margin:18px 0;color:var(--ink)}h2{font:700 1.65rem/1.15 Georgia,serif;color:var(--ink)}.intro{line-height:1.5;color:#394968}form{display:grid;gap:17px;margin:24px 0}label{display:grid;gap:9px;text-align:left;font:600 .9rem/1.4 system-ui}input,button,a.guide-download{font:inherit;min-height:48px;border-radius:999px;padding:12px 18px}input{width:100%;border:1px solid #d5ba84;background:#fffefa;color:var(--ink);font:1rem/1.4 system-ui;border-radius:14px}button,.guide-download{display:inline-flex;align-items:center;justify-content:center;gap:10px;border:1px solid #173e76;background:linear-gradient(120deg,#183e75,#05234e);color:#fffaf0;font-weight:700;cursor:pointer;width:100%;text-decoration:none;box-shadow:inset 0 1px 0 #ffffff18,0 3px 9px #0824490c;line-height:1.15;transition:background .15s,box-shadow .15s,transform .15s}button:hover:not(:disabled){filter:brightness(1.06)}button:active:not(:disabled),.guide-download:active{transform:translateY(1px)}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #5485bf;outline-offset:4px}.secondary{background:linear-gradient(125deg,#fffef9,#fff7e9);color:var(--ink);border:1.5px solid #e6aa49;box-shadow:none}.text-button{display:inline-block;background:none;border:none;box-shadow:none;color:#173e75;font:500 .85rem/1.4 system-ui;text-decoration:underline;text-underline-offset:4px;min-height:44px;padding:12px;cursor:pointer}.hint,.footer{font:.79rem/1.5 system-ui;color:#59677f}.hint{margin:0;text-align:left}.footer{margin:22px 0 0;font-size:.72rem}#status{font:500 .9rem/1.5 system-ui;color:#854819;margin:14px 0 0}#status:empty{display:none}button:disabled{opacity:.55;cursor:wait}#account-email{font:.8rem/1.4 system-ui;overflow-wrap:anywhere;color:#59677f}#account h2{margin:18px 0}#account #games{display:grid;gap:4px;margin-bottom:12px}.guide-public-link{color:#173e75}#play{position:fixed;inset:0;background:#07182f}.play-bar{height:52px;display:flex;align-items:center;gap:12px;padding:4px 10px;background:#fff9ec;border-bottom:1px solid #d5ae68}.play-bar button{width:auto;min-height:40px;font-size:.8rem;padding:8px 12px}.play-bar span{font:.72rem/1.3 system-ui;flex:1;color:#17345c}#game-host,iframe{width:100%;height:calc(100dvh - 52px);border:0;display:block}iframe{height:100%}
/* One live layout for all five approved illustrated steps. */
#portal.preparing{max-width:490px;padding:0 0 18px;background:none;border:0;border-radius:0;box-shadow:none}#portal.preparing>.brand,#portal.preparing>h1,#portal.preparing>.intro,#portal.preparing>.test-label,#portal.preparing>.footer{display:none}.wizard-count{display:flex;justify-content:center;align-items:center;gap:14px;margin:0 0 12px;color:var(--ink);font:700 clamp(.76rem,3.2vw,1rem)/1.4 Georgia,serif;letter-spacing:.1em;text-transform:uppercase}.wizard-count::before,.wizard-count::after{content:'✶';font-size:1.9em;color:#e5a023;line-height:1;letter-spacing:0}#preparation-title{position:relative;font:700 clamp(1.95rem,8.1vw,2.85rem)/1.03 Georgia,'Palatino Linotype',serif;letter-spacing:-.025em;max-width:98%;margin:0 auto 20px;text-wrap:balance}#preparation-title:focus{outline:none}.wizard-art{width:100%;margin:0 0 19px}.guide-illustration{position:relative;width:100%;overflow:hidden;border-radius:17px;background:#fff7e6;isolation:isolate}.guide-illustration img{position:absolute;max-width:none;height:auto;display:block;pointer-events:none}.guide-illustration.image-error{display:grid;place-items:center;padding:20px;font:1rem/1.5 Georgia;border:1px solid #e8d5ae}.guide-download{margin:0 0 16px;font-size:clamp(.95rem,3.9vw,1.27rem);min-height:54px;padding:12px 10px}.guide-download svg{width:27px;height:27px;flex:none;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}.preparation-copy{text-align:center;font:400 clamp(1rem,4.05vw,1.3rem)/1.32 Georgia,serif;color:var(--ink)}.preparation-copy p{margin:0 0 15px}.preparation-copy #wizard-lead{font-weight:700}#preparation:has(#wizard-art img[src*="krok-3"]) #wizard-lead,#preparation:has(#wizard-art img[src*="krok-4"]) #wizard-lead,#preparation:has(#wizard-art img[src*="krok-5"]) #wizard-lead{font-weight:400}.wizard-dots{display:flex;justify-content:center;gap:10px;margin:23px 0 20px}.wizard-dots span{width:9px;height:9px;border-radius:50%;background:#f2d9a7}.wizard-dots .current{background:#0c2e5d}.wizard-actions{display:grid;grid-template-columns:1fr 1.6fr;gap:13px;align-items:stretch}.wizard-actions:has(#preparation-back[hidden]){grid-template-columns:1fr}.wizard-actions button{min-height:54px;font:700 clamp(1.15rem,5.2vw,1.7rem)/1.1 Georgia,serif;padding:11px 15px}.wizard-actions #preparation-start{font-size:clamp(1.05rem,4.5vw,1.45rem);text-wrap:balance}.wizard-actions:has(#preparation-back[hidden]) #wizard-next{width:65%;justify-self:center}@media(min-width:650px){body{padding-top:30px}}@media(max-width:350px){body{padding:16px 10px}#portal{padding:22px 16px}.wizard-count{margin-bottom:11px}#preparation-title{margin-bottom:16px}.wizard-actions{gap:10px}.preparation-copy{font-size:.98rem}}@media(prefers-reduced-motion:reduce){button,.guide-download{transition:none}}

/* Keep the complete guide, including navigation, inside the mobile visual viewport. */
@media(max-width:600px){
 body:has(#portal.preparing){padding:max(10px,env(safe-area-inset-top)) 14px max(10px,env(safe-area-inset-bottom))}
 #portal.preparing{padding:0;max-width:460px}
 #preparation{height:calc(100dvh - max(10px,env(safe-area-inset-top)) - max(10px,env(safe-area-inset-bottom)));display:flex;flex-direction:column;gap:clamp(7px,1.35dvh,12px)}
 #preparation>*{flex-shrink:0}
 .wizard-count{margin:0;font-size:clamp(.72rem,3vw,.88rem);line-height:1.2;gap:10px}
 #preparation-title{font-size:clamp(1.65rem,7.1vw,2.15rem);line-height:1.04;margin:0 auto}
 .wizard-art{flex:1 1 0;min-height:0;margin:0;container-type:size;display:flex;justify-content:center;align-items:center}
 .guide-illustration{width:min(100cqw,calc(100cqh * var(--art-ratio)));flex:none;border-radius:14px}
 .preparation-copy{font-size:clamp(.91rem,3.85vw,1.07rem);line-height:1.23}
 .preparation-copy p{margin:0}
 .preparation-copy p+p{margin-top:clamp(6px,1.2dvh,10px)}
 .guide-download{margin:0;min-height:44px;padding:8px 10px;font-size:clamp(.9rem,3.8vw,1.05rem)}
 .guide-download svg{width:22px;height:22px}
 .wizard-dots{margin:0;gap:9px;height:8px}
 .wizard-dots span{width:8px;height:8px}
 .wizard-actions{gap:10px}
 .wizard-actions button{min-height:48px;padding:9px 12px;font-size:clamp(1.05rem,4.6vw,1.35rem)}
 .wizard-actions #preparation-start{font-size:clamp(.95rem,4vw,1.2rem)}
 #portal.preparing #status:not(:empty){position:fixed;bottom:72px;left:16px;right:16px;z-index:2;margin:0;padding:12px;border:1px solid #dba64e;border-radius:14px;background:#fffaf0;box-shadow:0 3px 20px #091d4820}
}
@media(max-width:600px) and (max-height:620px){
 #preparation{gap:6px}
 #preparation-title{font-size:1.55rem}
 .preparation-copy{font-size:.88rem;line-height:1.18}
 .preparation-copy p+p{margin-top:5px}
 .wizard-actions button{min-height:44px}
}

/* Approved storybook frame: one card around the illustration and its copy. */
.wizard-card{position:relative;padding:15px 14px 3px;border:1px solid #cc932e;border-radius:23px;background:linear-gradient(145deg,#fffdf8,#fff9ed);box-shadow:0 5px 16px #78521d15,inset 0 0 0 3px #fffaf0,inset 0 0 0 4px #e4b252}
.wizard-card-star{position:absolute;z-index:1;top:-16px;left:50%;transform:translateX(-50%);padding:0 5px;background:#fffbf2;color:#e5a023;font-size:27px;line-height:1;pointer-events:none}
.wizard-card .guide-illustration{border-radius:15px}
@media(max-width:600px){
 #preparation>.wizard-card{flex:1 1 0;min-height:0;display:flex;flex-direction:column;gap:clamp(7px,1.3dvh,11px);padding:12px 11px 10px;border-radius:20px;margin-top:5px}
 .wizard-card>*{flex-shrink:0}
 .wizard-card>.wizard-art{flex:1 1 0;min-height:0}
 .wizard-card-star{top:-12px;font-size:22px}
 .wizard-card .preparation-copy{font-size:clamp(.9rem,3.75vw,1.04rem)}
 .wizard-card .guide-illustration{border-radius:12px}
}
@media(max-width:600px) and (max-height:620px){
 #preparation>.wizard-card{gap:6px;padding:9px 9px 8px}
 .wizard-card .preparation-copy{font-size:.86rem;line-height:1.18}
}

#welcome{position:fixed;inset:0;z-index:10;isolation:isolate;display:flex;flex-direction:column;align-items:center;justify-content:space-between;padding:max(22px,env(safe-area-inset-top)) 18px max(24px,env(safe-area-inset-bottom));background:#10264c url('assets/magicky-obraz-mestecko-bez-okien-mobile.webp') center 52%/cover no-repeat;color:#fff8e8;text-align:center;overflow:auto}
.welcome-shade{position:absolute;inset:0;z-index:-1;background:linear-gradient(#061a40b0 0%,#061a4015 40%,#061a4020 60%,#03122bd9 100%)}
.welcome-heading{width:min(100%,470px);padding:0 25px;text-shadow:0 3px 15px #00102c}
.welcome-brand{font:700 .88rem/1.2 Georgia,serif;letter-spacing:.18em;margin:0 0 14px;color:#ffe9b0}
#welcome-title{font:700 clamp(3.5rem,13vw,6rem)/.88 Georgia,serif;color:#fff4d6;text-shadow:0 1px 0 #d69a33,0 3px 2px #9e5a21,0 4px 20px #051b43;margin:0 0 18px;letter-spacing:-.045em}
.welcome-subtitle{font:700 clamp(.95rem,4vw,1.3rem)/1.2 Georgia,serif;margin:0}
.welcome-sound{position:absolute;top:max(15px,env(safe-area-inset-top));right:14px;width:44px;min-height:44px;padding:0;border:1px solid #dba64e;background:#fffaec;color:#0b2855;font-size:1.4rem;box-shadow:0 2px 12px #03122b40}
.welcome-bottom{width:min(100%,470px);margin-top:30px}#welcome h2{font:700 clamp(1.5rem,6vw,2.1rem)/1.1 Georgia,serif;color:inherit;margin:0 0 18px;text-wrap:balance}.welcome-bottom>button{min-height:54px;font:700 1.45rem/1.15 Georgia,serif;border:2px solid #e5b35d;box-shadow:0 0 0 3px #fff4d625,0 5px 22px #00143055}
#welcome-story{color:#091d48;padding:24px 18px 18px}.welcome-story p{font:400 clamp(.98rem,3.9vw,1.22rem)/1.3 Georgia,serif;margin:0 0 16px}.welcome-story .welcome-note{font-size:clamp(.9rem,3.6vw,1.07rem);padding-top:12px;border-top:1px solid #e3c58c}
@media(min-width:600px){#welcome{background-size:auto 100%;background-color:#0a203e}.welcome-shade{background:linear-gradient(#03152b60,#03152b00 45%,#03152b90)}}
@media(max-height:650px){#welcome{padding-top:15px;padding-bottom:15px}#welcome-title{font-size:clamp(2.9rem,11vw,4.3rem)}.welcome-brand{margin-bottom:8px}.welcome-subtitle{font-size:.9rem}.welcome-bottom{margin-top:20px}#welcome-story{padding:18px 14px 14px}.welcome-story p{font-size:.92rem;margin-bottom:10px}#welcome h2{font-size:1.4rem;margin-bottom:12px}.welcome-bottom>button{min-height:48px;font-size:1.2rem}}

#player-setup{max-width:460px;margin:0 auto}#player-title{font:700 clamp(1.8rem,7vw,2.5rem)/1.08 Georgia,serif;margin:12px 0 25px;text-wrap:balance}#player-title:focus{outline:none}#player-form{gap:12px;margin:0;padding:22px 18px 10px}#player-form .player-intro{font:1.05rem/1.35 Georgia,serif;margin:0}.player-portrait{width:128px;height:146px;justify-self:center;overflow:hidden;display:grid;place-items:center;border:2px solid #d6a34c;border-radius:55px 55px 17px 17px;background:linear-gradient(#fff8e7,#f4dfb4);box-shadow:inset 0 0 0 4px #fffaf0;color:#b88630;font-size:3rem}.player-portrait img{width:100%;height:100%;object-fit:cover}.player-photo-button{display:flex;align-items:center;justify-content:center;min-height:44px;padding:10px;border-radius:99px;cursor:pointer;font:600 .92rem/1.2 system-ui}.player-file{position:absolute!important;width:1px!important;height:1px!important;min-height:0!important;padding:0!important;opacity:0;overflow:hidden}#player-form:has(.player-file:focus-visible) .player-photo-button{outline:3px solid #5485bf;outline-offset:3px}.player-privacy{font:.78rem/1.35 system-ui;color:#59677f;margin:0}#player-error{font:.85rem/1.3 system-ui;color:#963d24;margin:0}#player-form button.text-button{min-height:36px;padding:5px;font-size:.8rem}#player-form label[for=player-name]{font-size:.88rem}#player-save{font:700 1.14rem/1.2 Georgia,serif}
@media(max-width:600px) and (max-height:740px){#player-title{font-size:1.75rem;margin:9px 0 19px}#player-form{gap:8px;padding:17px 13px 8px}#player-form .player-intro{font-size:.95rem}.player-portrait{width:96px;height:108px}#player-form input{min-height:44px;padding:10px 14px}}

.player-game-preview{position:relative;isolation:isolate;width:100%;height:clamp(200px,31dvh,275px);border-radius:15px;overflow:hidden;background:#163b59 url('assets/magicky-obraz-mestecko-bez-okien-mobile.webp') center 58%/cover;border:1px solid #dab568;display:flex;align-items:center;justify-content:center;padding:10px 82px 10px 10px}.player-preview-board{width:180px;max-width:100%;padding:10px;border:2px solid #d5aa58;border-radius:24px 24px 10px 10px;background:linear-gradient(120deg,#fffdf3,#f9e7bc);box-shadow:0 3px 14px #10233d55;color:#102749}.player-preview-board>small{display:block;font:700 .52rem/1.2 Georgia;letter-spacing:.08em;text-transform:uppercase}.player-preview-board>strong{display:block;font:700 .85rem/1.05 Georgia;margin:4px 0 8px;text-wrap:balance}.player-preview-windows{display:grid;grid-template-columns:repeat(4,1fr);gap:4px}.player-preview-windows span{display:grid;place-items:center;aspect-ratio:3/4;border:1px solid #d8af5c;border-radius:12px 12px 3px 3px;background:linear-gradient(120deg,#9e5724,#57321f);box-shadow:inset 0 0 0 2px #e1ba682b;color:#fff0c9;font:700 .8rem Georgia}.player-preview-windows span:first-child{background:linear-gradient(120deg,#ffcd62,#b96112);box-shadow:0 0 7px #eeb13e}.player-preview-badge{position:absolute;right:8px;bottom:9px;width:76px;padding:6px 4px;border:1px solid #dba64e;border-radius:28px 28px 8px 8px;background:linear-gradient(#fffdf4,#f8e6c1);color:#102749;box-shadow:0 3px 10px #001c3a44}.player-preview-badge>small{display:block;font:700 .48rem/1.2 Georgia;margin-bottom:5px}.player-preview-badge .player-portrait{width:52px;height:59px;font-size:1.5rem;border-radius:22px 22px 6px 6px;margin:auto;border-width:1px;box-shadow:none}.player-preview-badge>strong{display:block;font:700 .62rem/1.15 Georgia;margin-top:5px;overflow-wrap:anywhere}.player-photo-button{gap:5px;flex-wrap:wrap}.player-photo-button small{font-weight:400;font-size:.75rem}
@media(max-width:600px) and (max-height:740px){.player-game-preview{height:190px}.player-preview-board{width:155px;padding:7px}.player-preview-windows span{aspect-ratio:1/1.1}}

/* Actual game markup and shared calendar.css, scaled rather than redrawn. */
.player-game-preview{padding:0;display:block;height:clamp(235px,36dvh,320px);background:#fff7e7}
#player-game-frame{position:absolute;left:50%;top:50%;width:440px;height:820px;border:0;transform-origin:center;pointer-events:none;max-width:none}
@media(max-width:600px) and (max-height:740px){.player-game-preview{height:220px}#player-form .player-intro{font-size:.9rem;line-height:1.25}}

/* Fill the preview with the real lower game scene, keeping the badge legible. */
.player-game-preview{height:auto;aspect-ratio:440/260;background:#fff7e7}
#player-game-frame{top:auto;bottom:0;left:50%;transform-origin:center bottom}
@media(max-width:600px) and (max-height:740px){.player-game-preview{height:auto;aspect-ratio:440/260}}

/* Preparation uses the same bottom navigation as the illustrated guide. */
#player-setup{padding-top:0}
#player-form .player-actions{display:grid;grid-template-columns:1fr 1.6fr;gap:13px}
#player-form .player-actions button{position:static;width:100%;min-height:48px;padding:9px 12px;font:700 clamp(1rem,4.5vw,1.3rem)/1.15 Georgia,serif;text-decoration:none}

/* Give the portrait preview the available height, with navigation at the bottom. */
@media(max-width:600px){
 #player-setup{height:calc(100dvh - max(10px,env(safe-area-inset-top)) - max(10px,env(safe-area-inset-bottom)));display:flex;flex-direction:column;gap:clamp(8px,1.3dvh,13px)}
 #player-setup>.wizard-count{flex:none;margin:0}
 #player-title{flex:none;margin:0 0 10px;font-size:clamp(1.75rem,6.8vw,2.2rem);line-height:1.06}
 #player-form{display:flex;flex-direction:column;flex:1;min-height:0;gap:clamp(7px,1.1dvh,10px);padding:18px 14px 12px}
 #player-form>*{flex-shrink:0}
 #player-form .player-game-preview{flex:1 1 0;min-height:145px;height:auto;aspect-ratio:auto}
 #player-form .player-intro{font-size:clamp(.95rem,3.9vw,1.08rem);line-height:1.25}
 #player-form .player-photo-button{min-height:44px}
 #player-form #player-remove{min-height:28px;padding:3px}
 #player-form label[for=player-name]{line-height:1.2}
 #player-form input:not(.player-file){min-height:46px;padding:10px 14px}
 #player-form .player-actions{margin-top:2px}
}
@media(max-width:600px) and (max-height:650px){#player-setup{height:auto;min-height:calc(100dvh - 20px)}#player-title{font-size:1.65rem}#player-form .player-game-preview{flex:none;height:165px}#player-form{gap:7px}}

/* Camera practice shares the guide's card and bottom navigation. */
#ar-title{font:700 clamp(1.8rem,6.8vw,2.6rem)/1.08 Georgia,serif;color:#091d48;margin:8px 0 20px;text-align:center}
.ar-card{display:flex;flex-direction:column;gap:12px;padding:22px 18px 14px}
.ar-card p{margin:0;line-height:1.35}
#ar-stage{position:relative;isolation:isolate;overflow:hidden;border:2px solid #dba64e;border-radius:16px;min-height:190px;height:30dvh;background:#091d48}
#ar-poster{width:100%;height:100%;object-fit:cover;object-position:center 42%;display:block}
#ar-camera{position:absolute;inset:0;overflow:hidden;touch-action:manipulation}
#ar-camera canvas{position:absolute;inset:0;z-index:2}
#ar-feedback{font-weight:700;color:#091d48}
.ar-card .wizard-actions{margin-top:auto;grid-template-columns:1fr 1.6fr}
.ar-card .wizard-actions button{min-height:48px;padding:9px 10px;font:700 clamp(1rem,4.4vw,1.3rem)/1.15 Georgia,serif}
#ar-skip{margin:0;min-height:36px;padding:6px;font-size:.9rem}
@media(max-width:600px){#ar-practice{min-height:calc(100dvh - 20px);display:flex;flex-direction:column}#ar-title{margin:8px 0 14px}.ar-card{flex:1;gap:10px;padding:20px 14px 12px}.ar-card p{font-size:clamp(.9rem,3.8vw,1.05rem)}#ar-stage{flex:1;min-height:150px;height:24dvh}}

/* Let the illustration take only the space left by text and navigation. */
@media(max-width:600px){
 #portal.preparing:has(#ar-practice:not([hidden])){padding-bottom:0}
 #ar-practice{height:calc(100dvh - max(10px,env(safe-area-inset-top)) - max(10px,env(safe-area-inset-bottom)));min-height:0;gap:8px}
 #ar-practice>.wizard-count{flex:none;margin:0;font-size:clamp(.68rem,2.9vw,.9rem)}
 #ar-title{flex:none;margin:0 0 4px;font-size:clamp(1.65rem,6.5vw,2.15rem);line-height:1.06}
 #ar-practice>.ar-card{flex:1 1 0;min-height:0;gap:clamp(7px,1.15dvh,11px);padding:18px 14px 10px}
 .ar-card>*{flex-shrink:0}
 #ar-stage{flex:1 1 0;min-height:72px;height:0}
 #ar-poster{position:absolute;inset:0}
 .ar-card .wizard-actions{margin-top:0}
 #ar-skip{min-height:34px;padding:5px}
}
@media(max-width:600px) and (max-height:680px){
 #ar-practice{gap:6px}
 #ar-title{font-size:1.65rem}
 #ar-practice>.ar-card{gap:6px;padding:15px 12px 9px}
 .ar-card p{font-size:.88rem;line-height:1.24}
 .ar-card .wizard-actions button{min-height:44px;font-size:1rem}
 #ar-skip{min-height:30px;font-size:.82rem}
}
/* Keep text accessible on very short screens and with enlarged system text. */
@media(max-width:600px) and (max-height:560px){
 #ar-practice{height:auto;min-height:calc(100dvh - 20px)}
 #ar-practice>.ar-card{flex:auto}
 #ar-stage{flex:none;height:95px;min-height:95px}
}

/* MindAR's fullscreen scanning UI is disabled; camera stays inside the frame. */
#ar-stage{contain:layout paint;isolation:isolate}
#ar-camera{isolation:isolate;contain:layout paint}
#ar-camera video{position:absolute!important;z-index:0!important;max-width:none}
#ar-camera canvas{z-index:2}

#ar-success{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:18px;background:radial-gradient(ellipse at top,#fffef8,#fff2d5);text-align:center;color:#091d48}
#ar-success>span{color:#d4a049;font-size:clamp(2rem,7dvh,3.5rem);line-height:1}
#ar-success h3{margin:0;font:700 clamp(1.7rem,7vw,2.2rem)/1.1 Georgia,serif}
#ar-success p{max-width:28ch;margin:0;font-size:clamp(1rem,4vw,1.15rem);line-height:1.3}
#ar-stage:has(#ar-success:not([hidden])){min-height:215px}

/* Reuse the approved guide artwork, cropping out its printed UI and text. */
#ar-poster{position:absolute;inset:0;width:auto;height:auto;overflow:hidden;container-type:size;background:#fff7e6}
#ar-poster .ar-illustration{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100cqw,103.7603cqh);aspect-ratio:883/851;overflow:hidden}
#ar-poster .ar-illustration img{position:absolute;display:block;max-width:none;width:106.5685%;height:auto;left:-3.2843%;top:-33.1375%;pointer-events:none}

#spatial-practice{position:fixed;inset:0;z-index:20;background:#fffaf0}
#spatial-practice>iframe{width:100%;height:100%;border:0;display:block}

.ar-card .ar-permission-note,.spatial-card .ar-permission-note{font:400 .78rem/1.25 system-ui,sans-serif;color:#52627d}
#ar-fallback,#spatial-fallback{margin:0;padding:5px;min-height:34px}

/* Keep the complete phone visible even in the shallow mobile illustration frame. */
#ar-poster .ar-illustration{position:absolute;inset:0;transform:none;width:100%;height:100%;aspect-ratio:auto}
#ar-poster .ar-illustration img{position:static;width:100%;height:100%;max-width:100%;object-fit:contain;object-position:center;pointer-events:none}

/* The town remains behind the success message after the camera is stopped. */
#ar-success{background:linear-gradient(#061a3c99,#061a3cb8),url('assets/magicky-obraz-mestecko-bez-okien-mobile.webp') center 62%/cover;color:#fffaf0;text-shadow:0 2px 8px #06142a}
#ar-success>span{color:#ffda81}

/* Camera permission guidance is no longer needed after a successful trial. */
.ar-card:has(#ar-success:not([hidden])) .ar-permission-note{display:none}

/* Extend the artwork into any letterbox space without cropping the phone. */
#ar-poster::before{content:'';position:absolute;inset:-14px;background:url('assets/wizard/kamera-hviezda-v1.webp') center/cover;filter:blur(10px);pointer-events:none}
#ar-poster .ar-illustration{z-index:1}

/* The game fills the display without a portal toolbar. Save failures remain visible. */
#play{background:#eaf4fc}
#play .play-bar{display:contents}
#exit-game{display:none}
#play #game-host{height:100dvh}
#play #game-host>iframe{width:100%;height:100%;border:0}
#sync-status{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
#sync-status.sync-error{position:fixed;z-index:50;left:12px;right:12px;bottom:calc(env(safe-area-inset-bottom) + 12px);width:auto;height:auto;margin:0;padding:12px 16px;overflow:visible;clip-path:none;white-space:normal;border:1px solid #dba64e;border-radius:16px;background:#fffaf0;color:#854819;box-shadow:0 5px 20px #091d4833;font:600 .85rem/1.35 system-ui}

#device-limit{padding:20px 0}#device-limit button{display:block;width:100%;margin:10px 0}#device-limit p{line-height:1.6}

/* Customer access panels use the same town, cream card and gold frame as the game. */
body:has(#portal:not([hidden]):not(.preparing)){background:#0b203e url('assets/magicky-obraz-mestecko-bez-okien-mobile.webp') center/cover fixed no-repeat;padding:max(28px,env(safe-area-inset-top)) 16px max(28px,env(safe-area-inset-bottom));display:grid;align-items:center;min-height:100dvh}
body:has(#portal:not([hidden]):not(.preparing))::before{content:'';position:fixed;inset:0;background:linear-gradient(#06162bb8,#06162b65 48%,#06162bc9);pointer-events:none}
#portal:not(.preparing){position:relative;isolation:isolate;max-width:460px;padding:32px 28px 24px;border:1px solid #d7ae61;border-radius:26px;background:linear-gradient(145deg,#fffdf8,#fff7e8);box-shadow:inset 0 0 0 4px #fffaf0,inset 0 0 0 5px #e4bf7080,0 18px 55px #020b2466}
#portal:not(.preparing)>.brand{font-size:12px;color:#a4782d;letter-spacing:.24em}#portal:not(.preparing)>.activation-eyebrow{margin:20px 0 10px;color:#9b722c;font:600 12px/1.5 Georgia,serif;letter-spacing:.07em}#portal-title{font-size:clamp(32px,8vw,44px);margin:8px 0 16px;line-height:1.1}#portal:not(.preparing)>.intro{font:400 17px/1.5 Georgia,serif;max-width:30ch;margin:0 auto 22px}#portal:not(.preparing) .hint{font:400 14px/1.5 Georgia,serif;color:#53617a}#portal:not(.preparing) label{font-family:Georgia,serif;font-size:16px}#portal:not(.preparing) button{font-family:Georgia,serif;font-size:17px;min-height:48px;border-color:#d3ac61}#portal:not(.preparing) .text-button{font-size:14px;color:#173e75}#portal:not(.preparing) input{font-family:Georgia,serif;font-size:17px;background:#fffdf7;border-color:#cfb77e}#code-form input[name=code]{text-align:center;font:600 22px/1.4 system-ui;letter-spacing:.16em}#portal:not(.preparing) .footer{font-family:Georgia,serif;font-size:12px;color:#8f743d;padding-top:17px;border-top:1px solid #e6d4ad;margin-top:22px}#portal:not(.preparing) #status:not(:empty){padding:12px;background:#fff1cf;border:1px solid #dfc18b;border-radius:12px;font:400 14px/1.5 Georgia,serif}#portal.preparing>.activation-eyebrow{display:none}
@media(max-width:420px){#portal:not(.preparing){padding:27px 20px 22px}#portal:not(.preparing)>.intro{font-size:16px}}

#portal:not(.preparing) .gift-prefilled{margin:24px 0 0;color:#8c692a;font-size:14px}#portal:not(.preparing) #gift-code-preview{font:500 clamp(10px,2.7vw,13px)/1.5 ui-monospace,monospace;letter-spacing:0;padding:11px 10px;text-align:center;background:#fff4d9;border-color:#d9bd80;color:#17365e;min-height:43px}#login-panel:has(#gift-prefilled:not([hidden])) form{margin-top:18px}

/* Navigation stays inside the reserved header row, alongside the sound icon. */
.guide-exit{position:absolute;z-index:6;top:0;left:0;display:grid;place-items:center;width:42px;height:42px;min-height:42px;margin:0;padding:0;border:1px solid #d8b572;border-radius:999px;background:linear-gradient(125deg,#fffdf6,#fff4d8);color:#142d53;font:400 28px/1 Georgia,serif;box-shadow:0 3px 12px #071e3526}
#portal :is(#preparation,#ar-practice)>.wizard-count{box-sizing:border-box;min-height:44px;padding-inline:52px}
:is(#preparation,#ar-practice)>[data-onboarding-voice-toggle]{top:0}

/* Crisp rounded back arrow, matching the cream and gold sound control. */
.guide-exit{border-color:#d3b16d;background:linear-gradient(145deg,#fffefa 12%,#fff6e3 100%);color:#193653;box-shadow:inset 0 1px 0 #fff,0 2px 7px #8c6a2420;transition:background .16s ease,box-shadow .16s ease;transform:none}
.guide-exit svg{display:block;width:24px;height:24px;pointer-events:none}
.guide-exit:active{background:#f8ecd1;box-shadow:inset 0 1px 3px #8c6a2426;transform:none}
.guide-exit:focus-visible{outline:2px solid #193653;outline-offset:3px}
@media(hover:hover){.guide-exit:hover{background:#fff0d0;box-shadow:inset 0 1px 0 #fff,0 3px 9px #8c6a242a;transform:none}}

/* Compact print row: reclaim empty margins instead of resizing the illustration. */
.guide-download-group{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;width:100%;margin:0;flex:none}
.guide-download-group .guide-download{margin:0;font-size:.8rem;min-height:44px;padding:6px 8px;gap:4px;min-width:0}
.guide-download-group .guide-download svg{width:18px;height:18px;flex:0 0 18px}
#wizard-download-note{grid-column:1 / -1;min-height:28px;margin:0;font:400 .72rem/14px Georgia,serif;color:#59677f;text-align:center}
@media(max-width:600px){
 #preparation:has(#wizard-download:not([hidden]))>.wizard-card{gap:max(3px,calc(clamp(7px,1.3dvh,11px) - 4px))}
}
@media(max-width:600px) and (max-height:620px){
 #preparation:has(#wizard-download:not([hidden]))>.wizard-card{gap:2px}
}

/* Step 2: keep instructions readable and controls within the mobile viewport. */
@media(max-width:600px){#preparation:has(#wizard-download:not([hidden])) #wizard-download-note{font-size:12px;line-height:15px;min-height:30px}#preparation:has(#wizard-download:not([hidden]))>.wizard-card{gap:5px}#preparation:has(#wizard-download:not([hidden])) .preparation-copy{font-size:clamp(14px,3.8vw,16px);line-height:1.22}}
