:root{font-family:system-ui,-apple-system,'Segoe UI',sans-serif;color:#252046;background:#f5f2ff;font-size:16px}*{box-sizing:border-box}body{margin:0}button,input,textarea{font:inherit}button{cursor:pointer}button:disabled{opacity:.5;cursor:not-allowed}a{color:#4e2e9c;text-decoration:none}a:hover{text-decoration:underline}.top{background:#fff;box-shadow:0 3px 16px #2e185318;padding:14px max(20px,calc((100vw - 1120px)/2));display:flex;justify-content:space-between;align-items:center;gap:12px}.brand{font-size:1.35rem;font-weight:900;color:#5528a8}.top nav{display:flex;align-items:center;gap:18px}.top nav a{font-weight:700}.quiet{border:0;background:#eee8ff;border-radius:12px;padding:10px 14px;color:#44218d;font-weight:700}.hero{max-width:860px;margin:34px auto 70px;padding:28px;border-radius:32px;background:linear-gradient(150deg,#f7e5ff,#e6f5ff 60%,#fff0d8);border:4px solid #fff;box-shadow:0 18px 65px #3b21731d;text-align:center}.hero-head{display:flex;justify-content:center;align-items:center;gap:22px}.mascot{font-size:6rem;filter:drop-shadow(3px 6px 1px #8b6ed3)}.eyebrow{font-size:.78rem;font-weight:900;letter-spacing:.18em;color:#7a54bd;margin-bottom:0}h1{font-size:clamp(2rem,6vw,3.5rem);margin:0;color:#4d218e;line-height:1.12}.hero-head p:last-child{font-size:1.15rem;font-weight:700}.intro{background:#fff;border-radius:18px;padding:14px;font-weight:700;max-width:480px;margin:18px auto}.age-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;max-width:570px;margin:24px auto}.age{border:4px solid #fff;background:white;border-radius:22px;padding:20px 8px;display:flex;flex-direction:column;align-items:center;gap:6px;box-shadow:0 5px 0 #ddd2fa}.age.active{border-color:#45b876;box-shadow:0 5px 0 #21874c}.age span{font-size:2.4rem}.age strong{font-size:1.45rem}.age small{color:#6b6380}.home-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.action{padding:24px 14px;border:0;border-radius:20px;color:#fff;font-size:1.3rem;font-weight:900;box-shadow:0 5px 0 #2c185545;transition:transform .1s}.action:hover{transform:translateY(-2px)}.green{background:#2caa56}.blue{background:#2584d6}.orange{background:#ee8d18}.purple{background:#854bc5}.progress-pill{display:inline-block;background:#fff;border-radius:50px;padding:10px 20px;margin-top:24px;font-weight:800}.home-tip{color:#6b6380;font-size:.85rem}#game{max-width:1130px;margin:25px auto;padding:0 18px}.game-top{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:20px}.game-top h2{margin:0;color:#482186}.game-top p{margin:4px 0;color:#716989}.stars{background:#fff;border-radius:25px;padding:12px;font-weight:800}.game-layout{display:grid;grid-template-columns:minmax(0,620px) minmax(260px,1fr);gap:24px}.board{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));aspect-ratio:1;overflow:hidden;border:8px solid #684b37;border-radius:12px;box-shadow:0 10px 28px #32223c33}.sq{position:relative;border:0;border-radius:0;min-width:0;min-height:0;display:grid;place-items:center;padding:0}.sq.light{background:#f3ddb4}.sq.dark{background:#b88962}.sq.selected{background:#f8d45e}.sq.target{box-shadow:inset 0 0 0 4px #1ca34e}.chess-piece{font-size:clamp(24px,5.3vw,62px);line-height:1;z-index:1;font-family:'DejaVu Sans','Segoe UI Symbol',serif}.white-piece{color:#fffdf4;text-shadow:-1px -1px #302b28,1px 1px #302b28,2px 2px #302b28}.black-piece{color:#18171c;text-shadow:1px 1px #fff5e4}.dot{position:absolute;background:#16a34a88;border-radius:50%;width:25%;aspect-ratio:1}.capture{position:absolute;border:5px solid #16a34a99;border-radius:50%;inset:5%}.rank-label,.file-label{position:absolute;font-size:10px;font-weight:800;color:#2c261d;z-index:2}.rank-label{top:2px;left:3px}.file-label{right:3px;bottom:1px}.board-controls{display:flex;gap:8px;margin:12px 0;flex-wrap:wrap}.board-controls button,.piece-option,.lesson-option{border:1px solid #d4c8ed;border-radius:12px;background:white;padding:10px 12px;font-weight:700;color:#4d2c85}.card{background:#fff;border-radius:20px;padding:20px;box-shadow:0 6px 25px #38275a10;margin-bottom:16px}.card h3{margin-top:0;color:#4d218e}.guide{text-align:center;background:linear-gradient(135deg,#fff,#f5e9ff)}.guide-icon{font-size:3rem}.primary{border:0;background:#6036b5;color:white;font-weight:800;border-radius:12px;padding:12px 18px}.muted{font-size:.88rem;color:#786f8c}.piece-buttons,.lesson-buttons{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.piece-option.active,.lesson-option.active{background:#e6f9ec;border-color:#31aa61}.lesson-buttons{grid-template-columns:1fr}.promotion{background:white;padding:14px;border-radius:12px;display:flex;gap:10px;margin-top:10px}.promotion[hidden],[hidden]{display:none!important}.promotion button{padding:10px;border:1px solid #ccc;border-radius:8px;background:#eee}.login{max-width:430px;margin:10vh auto;padding:30px}.login h1{font-size:2rem}.login form,.password-card form{display:grid;gap:16px}.admin-wrap{max-width:900px;margin:30px auto;padding:0 18px}.admin-wrap h1{font-size:2.3rem}.admin-filters{display:flex;gap:16px;align-items:center;justify-content:space-between;margin:20px 0}.admin-filters input{flex:1}.category{border-bottom:2px solid #ddd0f4;padding-bottom:10px;margin-top:32px;color:#4d218e}.admin-line form{display:grid;gap:14px}.admin-line h3{margin:0}.admin-line label,.login label,.password-card label{display:grid;gap:7px;font-weight:700}.admin-line textarea,input[type=password],input[type=text],.admin-filters input{width:100%;padding:12px;border:1px solid #c9c1d8;border-radius:10px;background:#fff;color:#252046}.admin-line textarea{resize:vertical}.admin-line input[type=file]{max-width:100%}.audio-preview{display:grid;gap:10px}.audio-preview audio{width:100%}.audio-preview .check{display:flex;align-items:center;gap:10px;font-size:.9rem}.admin-line button{justify-self:start}.notice,.success{padding:12px;background:#e2f9e9;border-radius:12px}.error{padding:12px;background:#ffe2e2;color:#991b1b;border-radius:12px}.password-card{margin-top:36px}footer{text-align:center;color:#827a96;padding:30px}@media(max-width:750px){.hero{margin:15px 10px;padding:20px 14px}.hero-head{gap:6px}.mascot{font-size:3.7rem}.home-actions{gap:10px}.action{font-size:1rem;padding:18px 6px}.game-layout{grid-template-columns:1fr}.game-top{flex-wrap:wrap}.chess-piece{font-size:clamp(25px,10vw,64px)}.admin-filters{flex-wrap:wrap}}@media(max-width:380px){.top{padding:12px}.top nav{gap:8px}.hero-head{flex-direction:column}.age-grid{gap:8px}.age{padding:12px 4px}}

/* Stabilt, kvadratisk skakbræt: hver af de 64 celler er præcis 1/8. */
.game-layout > div:first-child{min-width:0;width:100%}
.board{width:100%;height:auto;aspect-ratio:1 / 1;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:repeat(8,minmax(0,1fr));align-items:stretch;justify-items:stretch;min-width:0;min-height:0}
.board .sq{width:100%;height:100%;aspect-ratio:1 / 1;min-width:0;min-height:0;overflow:hidden;display:flex;align-items:center;justify-content:center;line-height:1}
.board .chess-piece{display:block;font-size:clamp(16px,4.8vw,58px);line-height:1;white-space:nowrap;flex-shrink:0}
@media(max-width:750px){.board .chess-piece{font-size:clamp(18px,9vw,60px)}}
/* Nyt grafisk intro med LærLeg i flerfarvede bogstaver integreret i motivet. */
.hero{max-width:1080px;background:linear-gradient(145deg,#e8e0ff,#f5edff);padding:14px 20px 30px}
.intro-art{width:100%;aspect-ratio:16/9;background-image:url('images/laerleg-intro.png');background-position:center;background-size:contain;background-repeat:no-repeat;border-radius:20px;box-shadow:0 10px 30px #25104430}
.hero-head{margin-top:16px}.hero-head .mascot{font-size:3rem}
.hero .age-grid{margin:16px auto}.hero .intro{margin:12px auto}
@media(max-width:750px){.hero{padding:10px}.intro-art{border-radius:12px}.hero-head{margin-top:12px}}

/* Admin manuscript editor */
.script-edit{display:block;margin:14px 0 18px}
.script-edit strong{display:block;margin-bottom:6px}
.script-edit textarea{display:block;width:100%;box-sizing:border-box;min-height:80px;resize:vertical}
#all-texts{margin-bottom:28px}

/* Startmenu: gennemsigtige, responsivt placerede klikområder på selve billedet. */
.hero.hero-map{max-width:1500px;width:calc(100% - 20px);padding:0;margin:14px auto 30px;background:transparent;border:0;border-radius:0;box-shadow:none}
.intro-map{position:relative;width:100%;aspect-ratio:1648 / 928;overflow:hidden}
.intro-image{display:block;width:100%;height:100%;object-fit:fill;pointer-events:none}
.hotspot{position:absolute;display:block;border:0;background:transparent;border-radius:24px;padding:0;cursor:pointer;touch-action:manipulation;transition:box-shadow .15s ease,background-color .15s ease}
.hotspot:hover{background:rgba(255,255,255,.12);box-shadow:inset 0 0 0 2px rgba(255,255,255,.7)}
.hotspot:focus-visible{outline:4px solid #fff600;outline-offset:2px;box-shadow:0 0 0 7px #30146c}
.hotspot.age.active{background:rgba(255,255,255,.07);box-shadow:inset 0 0 0 4px #4eff80,0 0 20px 4px #31ed7b99}
.hotspot-start{left:38%;top:46%;width:25%;height:23%}
.hotspot-pieces{left:7%;top:63%;width:30%;height:12%}
.hotspot-lessons{left:65%;top:63%;width:31%;height:12%}
.hotspot-computer{left:37%;top:82%;width:26%;height:16%}
.hotspot-friend{left:89%;top:81%;width:11%;height:18%}
.hotspot-settings{left:0%;top:81%;width:12%;height:18%}
.hotspot-age-young{left:16%;top:75%;width:21%;height:24%}
.hotspot-age-older{left:64%;top:75%;width:21%;height:24%}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:650px){.hero.hero-map{width:100%;margin:0 auto}.hotspot.age.active{box-shadow:inset 0 0 0 2px #4eff80,0 0 8px #31ed7b}}

/* v2: fuldt klikbar billedmenu på desktop og iPad. Ingen overlejrede menukasser. */
.hero.hero-map{width:min(100%,1672px);max-width:1672px;margin:0 auto;padding:0!important;border:0!important;box-shadow:none!important;background:transparent!important}
.intro-map{position:relative;width:100%;height:auto;aspect-ratio:1672 / 941;overflow:visible;isolation:isolate}
.intro-image{display:block;width:100%;height:100%;object-fit:contain;user-select:none;-webkit-user-drag:none}
.intro-map .hotspot{appearance:none;-webkit-appearance:none;position:absolute;display:block;box-sizing:border-box;z-index:2;margin:0;padding:0;min-width:0;min-height:0;height:auto;border:0;border-radius:12px;background:transparent;box-shadow:none;opacity:1;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition:background-color .15s,outline-color .15s}
.intro-map .hotspot:hover{background:rgba(255,255,255,.12);outline:2px solid rgba(255,255,255,.65);outline-offset:0;box-shadow:none}
.intro-map .hotspot:focus-visible{outline:4px solid #fff000;outline-offset:0;box-shadow:0 0 0 6px #44218d}
.intro-map .hotspot.age{display:block;flex-direction:initial;gap:0;padding:0;border:0;border-radius:15%;background:transparent;box-shadow:none}
.intro-map .hotspot.age.active{background:rgba(69,255,130,.07);outline:clamp(2px,.35vw,5px) solid #51ff77;outline-offset:-3px;box-shadow:0 0 14px #23e66b}
/* Alle koordinater svarer til de synlige knapper i billedet. */
.intro-map .hotspot-start{left:38.7%;top:45.2%;width:22.8%;height:23.6%}
.intro-map .hotspot-pieces{left:7.2%;top:61.2%;width:27.6%;height:12.4%}
.intro-map .hotspot-lessons{left:65.3%;top:61.2%;width:27.1%;height:12.4%}
.intro-map .hotspot-computer{left:37.4%;top:82.4%;width:25.5%;height:13.4%}
.intro-map .hotspot-friend{left:89.1%;top:81.5%;width:10.5%;height:16.9%}
.intro-map .hotspot-settings{left:0.6%;top:81.5%;width:11.2%;height:16.9%}
.intro-map .hotspot-age-young{left:14.5%;top:73.4%;width:19.4%;height:23.5%}
.intro-map .hotspot-age-older{left:65.9%;top:73.4%;width:19.6%;height:23.5%}
@media (min-width:900px){.top{padding-block:9px}footer{padding:12px}}
@media (max-width:1100px){.hero.hero-map{width:100%;margin:0 auto}.top{padding:10px 16px}.intro-map .hotspot{border-radius:8px}}
@media (orientation:portrait) and (max-width:1100px){.hero.hero-map{width:100%}.intro-map{width:100%;aspect-ratio:1672/941}.intro-map .hotspot.age.active{outline-width:3px}}
@media (prefers-reduced-motion:reduce){.intro-map .hotspot{transition:none}}

/* Stable square chessboard on desktop and iPad (landscape or portrait). */
#game{width:100%;max-width:1180px;margin-inline:auto;padding-inline:clamp(10px,2vw,24px)}
.game-layout{grid-template-columns:minmax(0, min(620px, 58%)) minmax(0,1fr);align-items:start}
.game-layout>div:first-child{min-width:0;max-width:100%}
.board{box-sizing:border-box;display:grid;width:100%;max-width:620px;aspect-ratio:1/1;height:auto;grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:repeat(8,minmax(0,1fr));container-type:inline-size;touch-action:manipulation}
.board .sq{box-sizing:border-box;aspect-ratio:1/1;width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.board .chess-piece{font-size:9.3cqw;line-height:1;pointer-events:none;user-select:none}
.board .sq .dot,.board .sq .capture,.board .sq small{pointer-events:none}
@media(max-width:900px){.game-layout{grid-template-columns:minmax(0,1fr)}.board{margin-inline:auto;width:min(100%,min(75vh,680px));max-width:100%}.game-sidebar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.game-sidebar .card{margin-bottom:0}.game-top{gap:10px}}
@media(max-width:600px){.board{width:100%}.game-sidebar{grid-template-columns:1fr}.game-top h2{font-size:1.3rem}.board-controls button{flex:1}.card{padding:14px}}

/* Board-only fullscreen: native Fullscreen API and iPad Safari fallback. */
.board-fullscreen{position:relative;width:100%;max-width:620px;margin-inline:auto}
.board-fullscreen .board{max-width:none;width:100%;margin:0}
.exit-fullscreen{display:none;position:absolute;right:clamp(6px,1.5vmin,16px);top:clamp(6px,1.5vmin,16px);z-index:20;border:2px solid #fff;border-radius:50%;background:#24212bd9;color:white;font-size:20px;width:44px;height:44px;align-items:center;justify-content:center;touch-action:manipulation}
.board-fullscreen:fullscreen,.board-fullscreen:-webkit-full-screen,.board-fullscreen.fullscreen-fallback{background:#17141d;display:flex;align-items:center;justify-content:center;width:100vw;height:100dvh;max-width:none;margin:0;padding:0;overflow:hidden}
.board-fullscreen:fullscreen .board,.board-fullscreen:-webkit-full-screen .board,.board-fullscreen.fullscreen-fallback .board{width:min(100vw,100dvh);height:min(100vw,100dvh);max-width:none;max-height:none;aspect-ratio:1/1;flex:none;border-width:clamp(2px,.8vmin,8px);box-shadow:none}
.board-fullscreen:fullscreen .exit-fullscreen,.board-fullscreen:-webkit-full-screen .exit-fullscreen,.board-fullscreen.fullscreen-fallback .exit-fullscreen{display:flex}
.board-fullscreen.fullscreen-fallback{position:fixed;inset:0;z-index:99999;height:100dvh}
body.board-only-mode{overflow:hidden}
@supports not (height:100dvh){.board-fullscreen.fullscreen-fallback{height:100vh}.board-fullscreen.fullscreen-fallback .board{width:min(100vw,100vh);height:min(100vw,100vh)}}

.admin-user-form{display:grid;gap:12px;margin:16px 0}.admin-user-form input{width:100%;max-width:460px}.password-card hr{border:0;border-top:1px solid #ccc;margin:20px 0}

/* Lydknap direkte på introillustrationens højttaler, med tydelig mute-markering. */
.intro-map .hotspot-sound{left:93.5%;top:0.7%;width:5.8%;height:10%;z-index:5;border-radius:50%;}
.intro-map .hotspot-sound.muted{background:rgba(30,22,75,.45);box-shadow:inset 0 0 0 3px #ffdf56;}
.intro-map .hotspot-sound .sound-off-mark{display:none;position:absolute;left:12%;top:47%;width:78%;height:7%;background:#ff4646;border:1px solid white;border-radius:8px;transform:rotate(-43deg);box-shadow:0 1px 4px #171020;}
.intro-map .hotspot-sound.muted .sound-off-mark{display:block;}
@media(hover:none){.intro-map .hotspot-sound:active{outline:3px solid #ffec73;}}

/* Personlige profiler, belønninger og venlig animeret skaklærer */
.profile-panel{max-width:1100px;margin:12px auto 20px;padding:18px;border-radius:20px;background:#fff9e9;border:3px solid #f5d479;box-shadow:0 5px 20px #22134d22;color:#27194b}
.profile-heading{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-bottom:12px}.profile-heading strong{font-size:1.3rem}.profile-heading span{font-size:.9rem}
.profile-list{display:flex;flex-wrap:wrap;gap:9px;align-items:center;margin-bottom:12px}.profile-item{display:flex;gap:2px;border-radius:14px;overflow:hidden;background:#efe6ff}.profile-item.chosen{outline:3px solid #5da936}
.profile-choice,.profile-delete{padding:9px 12px;min-height:44px;border-radius:10px;background:#eee5ff;color:#291551;border:1px solid #d0b9fa;cursor:pointer}.profile-choice.chosen{background:#d5f5b7;border:2px solid #5da936}.profile-delete{background:#ffe5e5;color:#831b1b}
.profile-form{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.profile-form input{flex:1 1 160px;min-width:120px;max-width:270px}.profile-form select{min-height:44px}.profile-form button{min-height:44px}
.trainer-avatar{position:relative;display:flex;align-items:center;justify-content:center;width:84px;height:84px;border-radius:50%;background:linear-gradient(145deg,#ffe36a,#ff9b58);font-size:44px;box-shadow:0 5px 0 #ce812e,0 10px 20px #0002;transform-origin:center bottom;animation:trainer-idle 3s ease-in-out infinite}
.trainer-face{position:absolute;font-size:25px;bottom:6px;right:7px}.trainer-avatar.trainer-talking{animation:trainer-speak .4s ease-in-out 5}
@keyframes trainer-idle{0%,100%{transform:rotate(-4deg) translateY(0)}50%{transform:rotate(4deg) translateY(-4px)}}
@keyframes trainer-speak{0%,100%{transform:scale(1) rotate(-5deg)}50%{transform:scale(1.13) rotate(6deg)}}
.reward-shelf{display:flex;flex-wrap:wrap;gap:8px}.reward-badge{padding:8px 10px;border-radius:12px;font-weight:700}.reward-badge.unlocked{background:#fff0ac;color:#603d00;border:2px solid #f3bd39}.reward-badge.locked{background:#e5e5e5;color:#777;filter:grayscale(1);opacity:.65}
@media(max-width:700px){.profile-panel{margin:8px;padding:12px}.profile-heading{display:block}.profile-form input{width:100%}.trainer-avatar{width:70px;height:70px}}
@media(prefers-reduced-motion:reduce){.trainer-avatar,.trainer-avatar.trainer-talking{animation:none}}

/* Valg af bræt og brikker samt pile og flytteanimationer. */
.appearance-card{display:grid;gap:9px}.appearance-card label{font-weight:800;color:#422379}.appearance-card select{width:100%;min-height:44px;padding:10px;border:1px solid #b9a7d6;border-radius:10px;background:#fff;color:#291b47}
.board-fullscreen{isolation:isolate}.move-arrow{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:6;opacity:0;transition:opacity .15s;overflow:visible}.move-arrow.visible{opacity:.85}
.board{position:relative}.board .moving-piece{position:absolute;display:grid;place-items:center;z-index:9;pointer-events:none;line-height:1;font-size:9.3cqw;font-family:'DejaVu Sans','Segoe UI Symbol',serif;text-shadow:1px 1px #292329}.board .moving-piece[data-theme="colorful"]{filter:drop-shadow(0 2px 2px #281358)}
.board[data-theme="forest"] .sq.light{background:#d8ecaa}.board[data-theme="forest"] .sq.dark{background:#6b985a}.board[data-theme="forest"]{border-color:#355a37}
.board[data-theme="fantasy"] .sq.light{background:#f6d5f6}.board[data-theme="fantasy"] .sq.dark{background:#9566c3}.board[data-theme="fantasy"]{border-color:#64318d}
.board[data-theme="ocean"] .sq.light{background:#d7f6ff}.board[data-theme="ocean"] .sq.dark{background:#529bb6}.board[data-theme="ocean"]{border-color:#256480}
.board[data-pieces="colorful"] .white-piece{color:#fff5a4;text-shadow:-2px -2px #8741a6,2px 2px #8741a6,0 2px 5px #2d154c}.board[data-pieces="colorful"] .black-piece{color:#5c2ab7;text-shadow:-1px -1px #e4c7ff,1px 1px #e4c7ff}
.board[data-pieces="royal"] .white-piece{color:#fff8de;text-shadow:-2px -2px #ba8535,2px 2px #ba8535,0 3px 3px #50320e}.board[data-pieces="royal"] .black-piece{color:#222c49;text-shadow:-1px -1px #c8d3ef,1px 1px #c8d3ef,0 3px 3px #172036}
.board .sq.invalid-move{animation:invalid-flash .25s ease-in-out 2}@keyframes invalid-flash{50%{box-shadow:inset 0 0 0 6px #ff3232;background:#f8a1a1}}
@media(prefers-reduced-motion:reduce){.move-arrow{transition:none}.board .sq.invalid-move{animation:none;outline:4px solid #ff3232}}

/* Original fantasy character art stored in assets/images/pieces. */
.board .chess-piece:has(.character-piece),.board .moving-piece:has(.character-piece){width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:0;text-shadow:none!important;filter:none!important;overflow:visible}
.board .character-piece{display:block;width:96%;height:99%;object-fit:fill;pointer-events:none;user-select:none;-webkit-user-drag:none;filter:drop-shadow(0 2px 2px rgba(22,13,30,.45))}
.board .moving-piece .character-piece{width:96%;height:99%}
.piece-option .character-piece{display:inline-block;vertical-align:middle;width:38px;height:52px;object-fit:fill;margin-right:5px}
.piece-option:has(.character-piece){display:inline-flex;align-items:center;justify-content:flex-start;min-height:62px}
@media(max-width:650px){.piece-option .character-piece{width:30px;height:42px}}

/* Eventyrkort med 30 baner */
.adventure-screen{max-width:1240px;margin:0 auto;padding:clamp(12px,3vw,32px)}
.adventure-head{display:flex;align-items:center;gap:18px;flex-wrap:wrap;margin-bottom:20px;color:#fff}.adventure-head h2{font-size:clamp(24px,4vw,38px);margin:0}.adventure-head p{margin:6px 0}.adventure-progress{margin-left:auto;border:2px solid #f8d77b;border-radius:30px;background:#45216d;padding:10px 20px;font-weight:800}
.adventure-worlds{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,350px),1fr));gap:20px}.adventure-world{border:3px solid #f8d77b;border-radius:22px;padding:22px;color:#fff;box-shadow:0 12px 28px #12082e66;background:linear-gradient(145deg,#216943,#103c32)}.adventure-world h3{font-size:24px;margin:0 0 6px;color:#fff3b2}.adventure-world p{margin:0 0 18px;color:#fff}.world-castle{background:linear-gradient(145deg,#566da1,#303d6e)}.world-mountain{background:linear-gradient(145deg,#64748b,#334155)}.world-magic{background:linear-gradient(145deg,#824bb1,#3c216b)}.world-garden{background:linear-gradient(145deg,#b74687,#652a70)}.world-royal{background:linear-gradient(145deg,#ad7525,#664018)}.adventure-levels{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px}.adventure-level{min-width:0;min-height:88px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:5px 2px;border-radius:12px;border:2px solid #fff9;background:#fff9f2;color:#34264d;cursor:pointer;touch-action:manipulation}.adventure-level .level-number{font-size:24px}.adventure-level strong{font-size:clamp(10px,1.5vw,13px)}.adventure-level small{font-size:10px;line-height:1.15;text-align:center}.adventure-level.completed{background:#fff1b8;border-color:#facc15}.adventure-level.locked{opacity:.52;filter:grayscale(.7);cursor:not-allowed}.adventure-level.unlocked{box-shadow:0 0 0 3px #a3e63566}.adventure-level:not(:disabled):hover,.adventure-level:not(:disabled):focus-visible{transform:translateY(-3px);outline:3px solid #facc15}@media(max-width:600px){.adventure-world{padding:14px}.adventure-levels{gap:4px}.adventure-level{min-height:78px}.adventure-level small{font-size:9px}}

/* Selvstændigt, responsivt indstillingsvindue til intro-menuen. */
.settings-overlay[hidden]{display:none!important}
.settings-overlay{position:fixed;inset:0;z-index:10000;background:rgba(14,9,37,.76);display:flex;align-items:center;justify-content:center;padding:16px;overflow-y:auto;overscroll-behavior:contain}
.settings-dialog{width:min(100%,560px);max-height:calc(100dvh - 32px);overflow:auto;background:linear-gradient(155deg,#fffaf0,#f0e8ff);border:4px solid #f7cf60;border-radius:24px;box-shadow:0 20px 70px #090520aa;padding:clamp(16px,3vw,28px);color:#27154a}
.settings-heading{display:flex;justify-content:space-between;align-items:center;gap:10px}.settings-heading h2{margin:0;font-size:clamp(23px,4vw,31px)}.settings-heading button{background:#4c2882;color:white;min-height:44px;padding:10px 14px;border-radius:12px;cursor:pointer}
.settings-dialog p{line-height:1.45;margin:10px 0 18px}.settings-fields{display:grid;gap:9px}.settings-fields>label:not(.settings-switch){font-weight:800;margin-top:7px}.settings-fields select{width:100%;min-height:48px;border-radius:12px;border:2px solid #bda3e4;background:white;color:#2b1a4c;padding:8px 12px;font-size:16px}
.settings-switch{display:flex;justify-content:space-between;align-items:center;gap:15px;padding:10px 12px;border:2px solid #e2d4fa;background:#fff;border-radius:12px;font-weight:800;min-height:52px}.settings-switch input{width:26px;height:26px;accent-color:#6135a4;flex-shrink:0}
.settings-actions{margin-top:20px;display:flex;justify-content:flex-end}.settings-actions button{background:#4e9b38;color:white;font-weight:800;border:0;border-radius:12px;min-height:48px;padding:10px 24px;cursor:pointer}
.settings-dialog :focus-visible{outline:3px solid #ef9e19;outline-offset:3px}
@media(max-width:650px){.settings-overlay{padding:8px}.settings-dialog{max-height:calc(100dvh - 16px);border-radius:16px;padding:14px}.settings-heading h2{font-size:23px}}

/* Kong Klog: illustrated, animated helper for desktop and iPad */
.trainer-stage{position:relative;isolation:isolate;width:min(100%,290px);height:220px;margin:0 auto 12px;display:grid;place-items:center;overflow:hidden;border-radius:22px;background:radial-gradient(ellipse at 50% 55%,#e5d4ff,#e4f5ff 65%,#fff3d9);box-shadow:inset 0 0 0 2px #fff,0 7px 24px #55338b20}
.trainer-king{height:100%;width:100%;object-fit:contain;filter:drop-shadow(0 7px 7px #46317435);animation:kongFloat 3.8s ease-in-out infinite;transform-origin:50% 90%}
.trainer-stage.is-speaking .trainer-king{animation:kongTalk .48s ease-in-out infinite alternate}
.trainer-stage.is-wrong .trainer-king{animation:kongNod .55s ease-in-out 2}
.trainer-sparkle{position:absolute;z-index:2;left:9%;top:15%;font-size:32px;color:#f7b500;text-shadow:0 0 8px white;animation:kongSparkle 2.6s ease-in-out infinite;pointer-events:none}
.trainer-sparkle-two{left:auto;right:9%;top:40%;animation-delay:1s}
.guide{overflow:hidden}.guide #guideText{font-size:1rem;line-height:1.55;min-height:3em}.guide #guideTitle{font-weight:900}
@keyframes kongFloat{0%,100%{transform:translateY(3px) rotate(-1deg)}50%{transform:translateY(-6px) rotate(1deg)}}
@keyframes kongTalk{from{transform:translateY(1px) rotate(-2deg) scale(1)}to{transform:translateY(-4px) rotate(2deg) scale(1.035)}}
@keyframes kongNod{0%,100%{transform:rotate(0)}50%{transform:rotate(-6deg)}}
@keyframes kongSparkle{0%,100%{opacity:.3;transform:scale(.7) rotate(0)}50%{opacity:1;transform:scale(1.2) rotate(35deg)}}
@media(max-width:760px){.trainer-stage{width:min(100%,240px);height:180px}}
@media(prefers-reduced-motion:reduce){.trainer-king,.trainer-sparkle{animation:none!important}}

/* Kong Klog: transparent cutout; editable guidance remains separate HTML text. */
.trainer-stage{background:transparent;box-shadow:none;overflow:visible}
.trainer-king{object-fit:contain;object-position:center bottom}

/* 2026-11-02: Fit the ENTIRE 8x8 board inside the visible fullscreen viewport.
   Override earlier mobile rules and grid intrinsic minimums. */
.board-fullscreen:fullscreen,
.board-fullscreen:-webkit-full-screen,
.board-fullscreen.fullscreen-fallback{
  position:fixed!important;inset:0!important;
  box-sizing:border-box!important;
  width:100%!important;height:100%!important;
  max-width:none!important;max-height:none!important;
  padding:0!important;margin:0!important;
  display:flex!important;align-items:center!important;justify-content:center!important;
  overflow:hidden!important;
}
.board-fullscreen:fullscreen .board,
.board-fullscreen:-webkit-full-screen .board,
.board-fullscreen.fullscreen-fallback .board{
  box-sizing:border-box!important;
  width:min(100vw, 100vh)!important;
  height:min(100vw, 100vh)!important;
  width:min(100vw, 100dvh)!important;
  height:min(100vw, 100dvh)!important;
  max-width:100vw!important;max-height:100dvh!important;
  min-width:0!important;min-height:0!important;
  aspect-ratio:1 / 1!important;
  flex:0 0 auto!important;
  margin:0!important;
  padding:0!important;
  display:grid!important;
  grid-template-columns:repeat(8,minmax(0,1fr))!important;
  grid-template-rows:repeat(8,minmax(0,1fr))!important;
  overflow:hidden!important;
  border-width:clamp(2px,.6vmin,6px)!important;
}
.board-fullscreen:fullscreen .board .sq,
.board-fullscreen:-webkit-full-screen .board .sq,
.board-fullscreen.fullscreen-fallback .board .sq{
  min-width:0!important;min-height:0!important;
  width:100%!important;height:100%!important;
  aspect-ratio:auto!important;
  overflow:hidden!important;
}
.board-fullscreen:fullscreen .board .chess-piece,
.board-fullscreen:-webkit-full-screen .board .chess-piece,
.board-fullscreen.fullscreen-fallback .board .chess-piece{
  font-size:clamp(12px,9cqw,80px)!important;
  max-width:100%;max-height:100%;
}
.board-fullscreen:fullscreen .move-arrow,
.board-fullscreen:-webkit-full-screen .move-arrow,
.board-fullscreen.fullscreen-fallback .move-arrow{
  inset:auto!important;
  left:50%!important;top:50%!important;
  transform:translate(-50%,-50%)!important;
  width:min(100vw,100dvh)!important;height:min(100vw,100dvh)!important;
  max-width:100%!important;max-height:100%!important;
}
@media (orientation:landscape) and (max-height:600px){
  .board-fullscreen:fullscreen .exit-fullscreen,
  .board-fullscreen:-webkit-full-screen .exit-fullscreen,
  .board-fullscreen.fullscreen-fallback .exit-fullscreen{width:36px;height:36px;font-size:17px}
}

/* Fix: Kong Klog must never cover mission instructions on PC or iPad. */
.game-sidebar .guide{display:flex;flex-direction:column;align-items:stretch;isolation:isolate;overflow:hidden!important;min-width:0}
.game-sidebar .guide .trainer-stage{flex:0 0 auto;align-self:center;position:relative;width:min(100%,200px);height:155px;margin:0 auto 10px;overflow:hidden!important;z-index:0;pointer-events:none}
.game-sidebar .guide .trainer-king{width:100%;height:100%;object-fit:contain;object-position:center bottom;max-height:100%;display:block}
.game-sidebar .guide #guideTitle,.game-sidebar .guide #guideText,.game-sidebar .guide #playAudio,.game-sidebar .guide #audioStatus{position:relative;z-index:1;max-width:100%;overflow-wrap:anywhere}
.game-sidebar .guide #guideText{margin:8px 0 12px;min-height:0;line-height:1.55;white-space:normal}
@media(max-width:760px){.game-sidebar .guide .trainer-stage{width:min(100%,150px);height:120px}}
@media(max-width:440px){.game-sidebar .guide .trainer-stage{width:115px;height:100px}}

/* Touch targets: decorative chess elements never intercept square taps. */
.board .sq .chess-piece,.board .sq .character-piece,.board .sq .rank-label,.board .sq .file-label{pointer-events:none}

/* Admin-styret oplæsning: skjul helt, også hvis eksisterende CSS angiver display. */
[hidden]{display:none!important}

/* Bondeforvandling: popup vises over hele brættet, også i fuld skærm på iPad. */
.promotion-dialog{position:fixed;inset:0;z-index:100000;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(20,13,36,.78);overscroll-behavior:contain}
.promotion-panel{background:#fffdf7;border:5px solid #bd965c;border-radius:24px;padding:clamp(16px,3vw,28px);width:min(95vw,520px);max-height:94dvh;overflow:auto;text-align:center;box-shadow:0 22px 70px #0007}
.promotion-panel h2{margin:0 0 10px;color:#4d218e}.promotion-panel p{line-height:1.45}
.promotion-choices{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:18px 0}
.promotion-choices button{min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;border:2px solid #a9814b;border-radius:14px;background:#f4e3c8;color:#252046;padding:12px 4px;font-weight:800;touch-action:manipulation}
.promotion-choices button:focus-visible,.promotion-choices button:hover{outline:3px solid #34a853;outline-offset:1px;background:#fef2d5}
.promotion-choices .promotion-glyph{font-family:'DejaVu Sans','Segoe UI Symbol',serif;font-size:clamp(35px,7vw,58px);line-height:1.1}
@media(max-width:380px){.promotion-choices{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Popup for bondeforvandling: respekter altid hidden, også i fuld skærm. */
#promotion[hidden]{display:none!important;pointer-events:none!important}
#promotion:not([hidden]){display:flex!important;pointer-events:auto!important}
#promotion .promotion-panel{position:relative;z-index:1}

/* Valgfri oplæsning på forsiden, uden at dække menubilledets hotspots. */
.home-intro-audio{display:flex;flex-direction:column;align-items:center;gap:6px;margin:12px auto 20px;padding:0 12px;text-align:center}
.home-intro-audio[hidden]{display:none!important}
.home-intro-audio button{font-size:1.08rem;padding:12px 22px;min-height:48px;cursor:pointer}
.home-intro-audio .muted{margin:0;min-height:1em}

/* Forside: billedet starter øverst uden den ekstra SkakEventyr-titellinje. */
body:has(#home:not([hidden])) > header.top { display:none!important; }

/* Skakhelte: én samlet, vandret linje lige under introbilledet. */
#home .profile-panel {
  width:100%;max-width:1672px;margin:0 auto 10px;
  padding:9px 14px;display:flex;align-items:center;gap:12px;
  flex-wrap:nowrap;min-width:0;overflow-x:auto;overflow-y:hidden;
  border-radius:0 0 14px 14px;scrollbar-width:thin;text-align:left;
}
#home .profile-heading {display:flex;flex:0 0 auto;align-items:center;gap:8px;margin:0;white-space:nowrap;flex-wrap:nowrap;}
#home .profile-heading strong {font-size:1rem;white-space:nowrap;}
#home .profile-heading span {display:none;}
#home .profile-list {display:flex;flex:0 0 auto;align-items:center;gap:7px;margin:0;flex-wrap:nowrap;white-space:nowrap;}
#home .profile-form {display:flex;flex:0 0 auto;align-items:center;gap:7px;flex-wrap:nowrap;margin:0;}
#home .profile-form input {width:145px;min-width:110px;max-width:145px;flex:0 0 145px;}
#home .profile-form select,#home .profile-form button {flex:0 0 auto;}
#home .profile-panel #profileNotice {flex:0 0 auto;margin:0;white-space:nowrap;}
@media(max-width:700px){
  #home .profile-panel{margin:0;padding:8px 10px;gap:9px;}
  #home .profile-heading{display:flex;}
  #home .profile-form input{width:130px;flex-basis:130px;}
}
