/* Shared fantasy lobby and game HUD. Math cards keep a light reading surface. */
:root{--purple:#7660e2;--purple-dark:#5140a8;--shadow:0 12px 35px #080d2630}
body{background:radial-gradient(ellipse at 10% 0%,#354574 0,transparent 45%),radial-gradient(ellipse at 95% 55%,#393063 0,transparent 45%),#121b35;color:#eef2ff;background-attachment:fixed}
.topbar{background:#111a32ed;border-bottom:1px solid #6575b94d;box-shadow:0 4px 20px #080f2926;color:#eef2ff}
.brand,.brand small{color:#e8edff}.brand small{opacity:.65}.brand-icon{filter:drop-shadow(0 0 9px #ffce5760)}
.local-tag,.local-tag.online{background:#243e48;color:#a7f3d0;border:1px solid #4f947b}.room-name{color:#e1e9ff}
.eyebrow{color:#e7bd78;letter-spacing:.12em}.layout h1,.join-screen h1,.lobby h1{color:#f2f3ff}
.game-home{max-width:1480px;margin:auto;padding:34px 40px 24px}.adventure-heading{text-align:center;margin-bottom:26px}.adventure-heading h1{font-size:clamp(38px,4.7vw,68px);line-height:1.16;letter-spacing:-.06em;margin:9px 0 12px;color:#fff2c5;text-shadow:0 4px 0 #6e4d35,0 10px 35px #c997402b}.adventure-heading h1 em{font-style:normal;color:#ffe7a0}.adventure-heading p{color:#bdc9e3;margin:0;font-size:16px}
.adventure-lobby{display:grid;grid-template-columns:minmax(0,1.75fr) minmax(300px,1fr);gap:26px;align-items:stretch}.kingdom-stage{align-self:center;overflow:hidden;border:1px solid #d7bc82;border-radius:24px;background:#f9efd9;box-shadow:0 20px 70px #0005,0 0 0 6px #c5a4660b;margin:0}.stage-heading{display:flex;align-items:center;gap:16px;padding:17px 22px;color:#ead4a6;background:linear-gradient(100deg,#293859,#182740);font-size:12px;letter-spacing:.08em}.stage-heading b{font-size:16px;letter-spacing:0;color:#fff1cf}.stage-star{margin-left:auto;font-size:21px}.kingdom-stage img{display:block;width:100%;height:auto;max-height:none;object-fit:contain}.stage-caption{display:flex;justify-content:center;gap:18px;padding:16px 12px;color:#eee1bc;background:#1b2b45;font-size:13px;font-weight:700}.stage-caption i{font-style:normal;color:#7286ab}
.adventure-menu{align-self:center;background:linear-gradient(145deg,#2b3859ed,#202a46f5);border:1px solid #7484b84f;border-radius:24px;padding:28px;box-shadow:0 18px 40px #0003}.adventure-menu h2{font-size:25px;color:#f5f4ff;margin:12px 0 8px}.adventure-menu>p{font-size:14px;color:#bdc9e3}.adventure-menu .role-options{display:grid;grid-template-columns:1fr;gap:14px;margin:25px 0 18px}.adventure-menu .role-card{min-height:112px;padding:18px;text-align:left;border-radius:16px;border:1px solid #b2a0ff;background:linear-gradient(120deg,#7560cf,#4f4695);color:white;box-shadow:0 5px 0 #302857,0 8px 25px #9476fa20;display:flex;gap:16px;transform:none}.adventure-menu .role-card.student{background:linear-gradient(120deg,#287f8f,#225469);border-color:#6ac0c5;box-shadow:0 5px 0 #123546,0 8px 25px #50e0ed13}.adventure-menu .role-card strong{color:white;font-size:21px;display:block;margin:4px 0}.adventure-menu .role-card small{color:#f0eaff;font-size:12px;display:block}.adventure-menu .role-card b{margin-left:auto;color:white}.adventure-menu .role-symbol{flex:0 0 40px;width:40px;height:46px;background:transparent;border:0;box-shadow:none}.role-symbol svg{width:100%;height:100%}.adventure-menu .role-card:hover{filter:brightness(1.12);transform:translateY(-2px)}.adventure-menu .home-links{display:flex;flex-wrap:wrap;justify-content:center;gap:3px 12px}.adventure-menu .text-button{color:#d4ddf6;font-size:12px}.adventure-menu .home-links .text-button:first-child{width:100%;color:#f4cf8b;font-size:14px;margin:4px 0 8px}.adventure-menu .local-note{font-size:12px;line-height:1.8;color:#aebcd8;border-top:1px solid #7287ac33;padding-top:16px;margin:15px 0 0}.adventure-features{display:flex;justify-content:center;gap:60px;color:#b9c8e2;margin-top:30px;font-size:13px}.adventure-features span{display:flex;gap:9px;align-items:center}.adventure-features b{font-weight:500}footer{color:#91a0bf;border-color:#68779630;background:transparent}
.setup-story{background:none;border-radius:0}.setup-story h1{color:#fff0c2}.setup-story p{color:#c0cce4}.setup-story img{display:block;mix-blend-mode:normal;width:100%;height:auto;max-height:none;object-fit:contain;border:1px solid #c4ae7d;border-radius:20px;box-shadow:0 16px 45px #0004}.setup{gap:4%;padding-top:36px;padding-bottom:40px}.paper{border:1px solid #acb6d1;border-radius:20px;box-shadow:0 12px 32px #080d2638;color:#37435c;background:#f5f6fc}.form-panel{background:#f5f6fc;border-top:4px solid #bda05e}.form-panel:before{display:none}.form-panel h2{color:#2a3650}.form-panel input,.form-panel select{background:#fff;border:1px solid #bcc5d8;color:#24354e;border-radius:10px}.form-panel label,.form-panel legend{color:#3e4a63}.form-panel small,.form-panel .muted{color:#64718a}.primary{background:linear-gradient(135deg,#8065e2,#5946ad);border:1px solid #a48bea;box-shadow:0 4px 0 #3c3077;color:white;border-radius:12px}.secondary{background:#e5eaf6;color:#344667;border:1px solid #b1bfd8;border-radius:10px}.dark{background:linear-gradient(135deg,#286d80,#24465e);color:white;border:1px solid #5197a5}.text-button{color:#d1dbef}.paper .text-button,dialog .text-button{color:#60539a}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #e1ae49;outline-offset:4px}button{transition:filter .18s,transform .18s}button:disabled{filter:saturate(.4)}
.toolbar{background:#23314d;border:1px solid #61769c;color:#e2ebff;border-radius:14px;box-shadow:0 7px 22px #0003}.toolbar .muted{color:#bfcae0}.room-question-type{color:#c2d2f4}.entry-code{transform:none;border-radius:16px;border-color:#c8af70;box-shadow:0 8px 26px #0003}.territory{border-radius:18px;box-shadow:0 10px 25px #0003}.territory h2,.territory h3{color:#354560}.player-card{border-radius:10px}.challenge-card{background:linear-gradient(135deg,#fffdf7,#eef2ff);border-color:#b9acd9;border-radius:20px;box-shadow:0 12px 28px #0003}.challenge-card .equation{color:#4b3b90}.answer{background:#fff;border-color:#b0bdd9;border-radius:13px;color:#3b4563;box-shadow:0 4px 0 #bbc5de}.answer:hover:not(:disabled){border-color:#8770d2;background:#eee8ff}.action-bar{background:#223451;border:1px solid #6c81a4;border-radius:16px;color:#edf2ff}.action-bar small{color:#c4d1e7}.game-layout .muted{color:#b9c8e3}.game-layout .paper .muted{color:#6c7790}.board-side{border-radius:18px}.game-status,.student-top{color:#eef2ff}.timer{border-radius:10px}.join-screen>.eyebrow{display:inline-block;margin-top:16px}dialog{border-radius:20px;border-color:#afa3cf;box-shadow:0 30px 90px #0008}dialog::backdrop{background:#080d26bf;backdrop-filter:blur(5px)}
@media(min-width:1500px){.game-home{padding-top:45px}.adventure-heading{margin-bottom:35px}}
@media(max-width:1050px){.game-home{padding:26px 24px}.adventure-lobby{gap:18px;grid-template-columns:minmax(0,1.4fr) minmax(280px,1fr)}.adventure-menu{padding:22px}.adventure-menu h2{font-size:22px}.adventure-features{gap:26px}.stage-caption{gap:9px;font-size:11px}}
@media(max-width:760px){.game-home{padding:25px 16px 20px}.adventure-heading{margin-bottom:22px}.adventure-heading p{font-size:13px}.adventure-lobby{grid-template-columns:1fr;gap:22px}.kingdom-stage{max-width:600px;width:100%;margin:auto}.adventure-menu{width:100%;padding:23px}.adventure-menu .role-options{grid-template-columns:1fr 1fr;gap:12px}.adventure-menu .role-card{padding:14px;min-height:115px;gap:10px}.adventure-menu .role-symbol{display:none}.adventure-menu .role-card strong{font-size:17px}.adventure-menu .role-card b{display:none}.adventure-menu .role-card small{font-size:10px}.adventure-features{gap:14px;flex-wrap:wrap;font-size:11px;margin-top:25px}.stage-heading{padding:13px 17px}.stage-heading b{font-size:14px}.stage-caption{padding:12px}.setup-story img{max-width:560px;margin:22px auto}.setup-story{padding:0;background:none}.topbar{padding-left:16px;padding-right:16px}.brand small{font-size:10px}.room-name{max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}
.adventure-menu .text-button{background:transparent;border:0;box-shadow:none;padding:7px 4px;min-height:30px}.adventure-menu .text-button:hover{background:#ffffff0c}.action-bar .energy,.action-bar .energy small{color:#69502d}.team-strip.mini-arena{background:#283a59;border-color:#6981a4;box-shadow:0 5px 18px #0003}.team-status{background:#e4eaf7;border-radius:12px}.team-status.mine{background:#fff2c9}.board-side{background:linear-gradient(135deg,#d9e5d9,#b5cbbf);border-color:#9ab5b1}.question-hint,.question-meta,.question-caption{color:#64687f}
@media(min-width:960px) and (max-height:800px){.game-home{padding-top:20px}.adventure-heading{margin-bottom:20px}.adventure-heading h1{font-size:46px;margin:6px 0 8px}.adventure-heading p{font-size:14px}.kingdom-stage img{max-height:calc(100dvh - 320px);min-height:260px;object-fit:contain}.adventure-menu{padding:20px}.adventure-menu h2{font-size:22px;margin:8px 0}.adventure-menu .role-options{margin:15px 0 10px;gap:12px}.adventure-menu .role-card{min-height:92px;padding:12px 16px}.adventure-menu .local-note{margin-top:10px;padding-top:10px}.adventure-features{margin-top:20px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

.class-roster{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:15px;margin:24px 0}.roster-person{display:flex;flex-direction:column;align-items:center;gap:10px;padding:20px;cursor:pointer}.class-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;width:90px;height:90px;border-radius:25px;font-size:52px;flex-shrink:0;border:2px solid #fff9;box-shadow:0 5px 15px #0002}.avatar-hat{position:absolute;top:-8px;left:27px;font-size:30px}.classroom-entry{max-width:1000px;padding-bottom:40px}.classroom-entry h1{color:#fff1cf}.classroom-entry .form-panel{max-width:500px;margin:25px auto}.profile-preview{display:flex;align-items:center;flex-wrap:wrap;gap:18px;margin:25px 0;color:#4b4261}.cosmetic-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.cosmetic-grid article{padding:12px;display:flex;flex-direction:column;align-items:center;gap:10px;text-align:center}.cosmetic-glyph{font-size:36px}.cosmetic-grid button{font-size:12px;padding:9px}.profile-admin{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:12px}.profile-admin .class-avatar{width:50px;height:50px;font-size:30px}.profile-admin .avatar-hat{left:12px;font-size:20px;top:-6px}.profile-admin button{font-size:12px}.roster-person small{font-size:11px}.header-right{flex-wrap:wrap}@media(max-width:500px){.cosmetic-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.header-right .compact{font-size:11px;padding:8px}.class-avatar{width:76px;height:76px;font-size:46px}.avatar-hat{left:22px}}
.classroom-entry>p{color:#c8d5ed}.cosmetic-grid button:disabled{opacity:.7}.header-right .compact{white-space:nowrap}

.human-avatar{display:inline-block;position:relative;width:200px;height:200px;isolation:isolate;vertical-align:middle;flex-shrink:0}.human-body{position:absolute;inset:0;background:url('assets/human-bodies.png?v=3d2d45ef325f');background-size:400% 200%;background-position:var(--bx) var(--by);filter:hue-rotate(var(--hue,0deg));z-index:2}.equipment-sprite{display:block;background-image:url('assets/human-equipment.png?v=ffb1857d840a');background-size:400% 400%;background-position:var(--sx) var(--sy);filter:hue-rotate(var(--hue,0deg));width:100%;height:100%}.human-avatar>.equipment-sprite{position:absolute}.layer-hair{width:45%!important;height:45%!important;left:27.5%;top:-4%;z-index:3}.hair-2{width:51%!important;height:57%!important;left:24.5%;top:-5%}.hair-3{width:53%!important;height:50%!important;left:25%;top:-7%}.layer-hat{width:46%!important;height:38%!important;left:27%;top:-15%;z-index:4}.hat-5{width:61%!important;height:54%!important;left:19.5%;top:-26%}.hat-6,.hat-7{top:-13%;width:42%!important;height:32%!important;left:29%}.layer-wings{width:100%!important;height:85%!important;left:0;top:4%;z-index:1}.layer-jewel{width:16%!important;height:19%!important;left:42%;top:39%;z-index:5}.layer-weapon{width:39%!important;height:73%!important;left:65%;top:28%;z-index:5}.roster-person .human-avatar{width:120px;height:120px;margin-top:18px}.profile-admin .human-avatar{width:66px;height:66px}.human-wardrobe{width:min(1080px,96vw);max-width:1080px;background:#17233e;color:#ecedff;padding:24px;border:1px solid #aa94ce}.human-wardrobe h2{color:#ffedbc}.wardrobe-shell{display:grid;grid-template-columns:260px 1fr;gap:25px}.wardrobe-hero{padding:28px 15px;text-align:center;background:radial-gradient(ellipse at center,#57427a,#21304d 75%);border:1px solid #a991c24d;border-radius:18px;align-self:start;position:sticky;top:0}.wardrobe-hero>.human-avatar{width:230px;height:230px;max-width:100%;margin:52px 0 20px}.point-balance{display:block;font-size:25px;color:#ffe19c}.human-wardrobe p{color:#c4cbe2;font-size:13px}.wardrobe-tabs{display:flex;gap:7px;flex-wrap:wrap;margin:20px 0}.wardrobe-tabs button{padding:9px 13px;font-size:13px}.human-items{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.human-item{position:relative;border:1px solid #6e86a4;border-radius:14px;background:#283b55;padding:12px;display:flex;flex-direction:column;align-items:center;gap:10px;overflow:hidden}.human-item.tier-희귀{border-color:#83aaf2;background:linear-gradient(135deg,#253958,#453d70)}.human-item.tier-전설{border-color:#e7c075;background:linear-gradient(135deg,#493767,#564327);box-shadow:inset 0 0 24px #edbd3820}.item-tier{align-self:flex-start;font-size:10px;color:#e8cb93}.item-art{width:100%;height:140px;display:flex;align-items:center;justify-content:center}.item-art>.equipment-sprite{width:115px;height:115px}.item-art .human-avatar{width:126px;height:126px;margin-top:18px}.human-item strong{font-size:12px;text-align:center;color:#fff1d5}.human-item button{width:100%;font-size:11px;padding:8px}.empty-item{font-size:36px;color:#bcb3dd}.my-adventurer{display:flex;align-items:center;gap:12px;padding:16px;margin:12px 0;background:linear-gradient(125deg,#2c3b63,#423053);border:1px solid #b29bd2;border-radius:16px;color:#f5e8c5}.my-adventurer>.human-avatar{width:95px;height:95px;margin-top:15px}.my-adventurer>div{display:flex;flex-direction:column;gap:5px}.my-adventurer span:not(.human-avatar):not(.human-body):not(.equipment-sprite){font-size:12px}.board-side .my-adventurer{margin:0 0 8px;padding:8px;min-height:92px}.board-side .my-adventurer>.human-avatar{width:76px;height:76px;margin-top:10px}.board-side .my-adventurer strong{font-size:12px}.board-side .my-adventurer button{padding:5px 10px;font-size:11px}.board-side{overflow:auto}.board-side .kingdom-board{min-height:120px}.reward-explainer{line-height:1.9}@media(max-width:760px){.wardrobe-shell{grid-template-columns:1fr}.wardrobe-hero{position:static}.wardrobe-hero>.human-avatar{width:190px;height:190px}.human-items{grid-template-columns:repeat(2,minmax(0,1fr))}.human-wardrobe{padding:18px}.header-right .room-name{display:none}}@media(min-width:960px) and (min-height:600px){body[data-screen="student"] .board-side .kingdom-board{max-height:calc(100% - 155px)}body[data-screen="student"] .board-side .board-tip{font-size:10px}}
.human-body{filter:none}.human-body:after{content:"";position:absolute;inset:0;background:inherit;background-size:400% 200%;background-position:var(--bx) var(--by);filter:hue-rotate(var(--hue,0deg));clip-path:inset(38% 0 0)}.layer-hat{clip-path:inset(1% 5% 1% 5%)}

/* Fit each hairstyle to the shared skull; clip adjacent atlas pixels. */
.human-avatar{--hair-offset:0%}.human-avatar[data-character="girl"]{--hair-offset:1.5%}
.layer-hair{clip-path:inset(1.5% 2%);transform:translateY(var(--hair-offset))}
.hair-0{width:46%!important;height:44%!important;left:26.5%;top:-4.5%}
.hair-1{width:46%!important;height:44%!important;left:26.5%;top:-4.5%}
.hair-2{width:52%!important;height:56%!important;left:23.5%;top:-5.5%}
.hair-3{width:56%!important;height:54%!important;left:24%;top:-11%}

/* Heads include faces and hair in one sprite: no separately positioned wigs. */
.cute-avatar{image-rendering:pixelated}
.cute-head{position:absolute;z-index:3;width:64%;height:64%;left:18%;top:0;background-image:url('assets/cute-heads-base.png?v=93c7e24b09f7');background-size:400% 200%;background-position:var(--hx) var(--hy)}
.cute-head.palette-1{background-image:url('assets/cute-heads-ocean.png?v=bd195447ff5a')}.cute-head.palette-2{background-image:url('assets/cute-heads-pastel.png?v=15d7cb480107')}
.cute-body{position:absolute;z-index:2;width:50%;height:45%;left:25%;top:53%;background-image:url('assets/cute-bodies.png?v=c0ebc216fa46');background-size:400% 200%;background-position:var(--bx) var(--by)}
.cute-body:after{content:"";position:absolute;inset:0;background:inherit;background-size:400% 200%;background-position:var(--bx) var(--by);filter:hue-rotate(var(--hue,0deg));clip-path:polygon(0 25%,25% 25%,25% 15%,75% 15%,75% 25%,100% 25%,100% 100%,0 100%)}
.cute-equipment{background-image:url('assets/cute-equipment.png?v=dd818bd9d380');background-size:400% 300%;image-rendering:pixelated;clip-path:none}
.cute-avatar>.layer-hat{width:64%!important;height:43%!important;left:18%;top:-10%;z-index:4}
.cute-avatar>.hat-5{width:72%!important;height:60%!important;left:14%;top:-23%}
.cute-avatar>.hat-6,.cute-avatar>.hat-7{width:49%!important;height:36%!important;left:25.5%;top:-12%}
.cute-avatar>.layer-wings{width:95%!important;height:65%!important;left:2.5%;top:35%;z-index:1}
.cute-avatar>.layer-jewel{width:15%!important;height:15%!important;left:42.5%;top:60%;z-index:5}
.cute-avatar>.layer-weapon{width:32%!important;height:52%!important;left:61%;top:45%;z-index:5}
.human-item .item-art>.cute-equipment{height:115px;width:115px}

.cute-head{clip-path:inset(1% 2.5%)}.cute-body{top:46%}.cute-avatar[data-character='girl']>.cute-body{top:47%}.cute-body:after{clip-path:polygon(25% 20%,75% 20%,75% 65%,90% 65%,90% 100%,10% 100%,10% 65%,25% 65%)}

.cute-equipment.equipment-5{clip-path:inset(0 0 0 10%)}.cute-equipment.equipment-6{clip-path:inset(0 0 0 8%)}

.cute-equipment.equipment-5{background-size:371.282% 293.514%;background-position:34.5% 0;clip-path:inset(0 0 0 7.5%)}

/* Seven skills remain readable and keyboard accessible. */
.game-layout .action-buttons{grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}.game-layout .action-button{min-height:64px}.reflect-ready{color:#7450ae;font-weight:bold}.action-button.reflect{background:#e8dcff}.action-button.combo{background:#ffe3c8}.action-button.charge{background:#fff0ad}
@media(min-width:960px) and (min-height:600px) and (orientation:landscape){.game-layout{grid-template-rows:40px auto minmax(0,1fr) 140px 17px}.game-layout .action-button{padding:4px;gap:5px;min-height:0}.game-layout .action-button strong{font-size:13px}.game-layout .action-icon .game-icon{width:25px;height:25px}.game-layout .action-button .action-reason{font-size:10px}}
@media(max-width:760px){.game-layout .action-buttons{grid-template-columns:repeat(2,minmax(0,1fr))}.game-layout .action-button{min-height:90px}}

/* Painted castles retain team identity through colored standards. */
.illustrated-castle{position:relative;display:block;width:100%;aspect-ratio:1.175;height:auto;overflow:visible;isolation:isolate}.castle-paint{position:absolute;inset:0;background:url('assets/illustrated-castles.png?v=05ade5c47835') var(--castle-x) center/300% 100% no-repeat;filter:drop-shadow(0 3px 5px #14213955)}.castle-emblem{position:absolute;right:5%;bottom:12%;min-width:19%;padding:2% 3%;border:1px solid #fff0bb;border-radius:40% 40% 45% 45%;background:var(--castle-color);color:white;text-shadow:0 1px 2px #000a;box-shadow:0 2px 5px #0006;font-size:clamp(9px,1.2vw,20px);line-height:1;text-align:center}.illustrated-artifact{background-image:url('assets/illustrated-artifacts.png?v=5ef658d62dd4');background-size:400% 100%;background-position:var(--artifact-x) center;background-repeat:no-repeat;filter:drop-shadow(0 0 3px #fbc65e70)}.travel-token.spell-flight{width:76px;height:76px;z-index:1000;pointer-events:none;filter:drop-shadow(0 0 10px #cc9cff)}.spell-flight>.game-icon{width:100%;height:100%}.spell-flight:before{content:'';position:absolute;inset:12%;border:2px solid #ffe8a866;border-radius:50%;box-shadow:0 0 16px #b299fa66}.spell-impact{position:absolute;left:50%;top:42%;width:95px;height:95px;border:3px solid #ffe7a9;border-radius:50%;background:radial-gradient(circle,#fff9,#cf9eff55,transparent 70%);box-shadow:0 0 20px #c6a1ff;z-index:10;pointer-events:none}.spell-impact>.game-icon{width:100%;height:100%}.target-card .illustrated-castle{max-height:190px}.shielded .castle-paint{filter:drop-shadow(0 0 7px #69e6ff)}

/* Castle collection and readable classroom names — October update. */
.player-card .player-name,.roster-person>strong{color:#111;text-shadow:none}.player-card .player-name small{color:#41414d}
.castle-extra .castle-paint{background-image:url('assets/illustrated-castles-extra.png?v=29976b3aa5ee');background-size:300% 300%;background-position:var(--castle-x) var(--castle-y)}
.castle-showcase{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:20px 18px 12px;background:radial-gradient(ellipse at 50% 40%,#4e427d,#1b2946 75%)}
.castle-showcase figure{margin:0;min-width:0}.castle-showcase figcaption{text-align:center;color:#fff0c8;font-size:12px;font-weight:700;margin-top:5px}.castle-showcase .illustrated-castle{aspect-ratio:1}
.castle-release{text-align:center;background:#1b2946;color:#e9cf94;font-size:12px;margin:0;padding:10px 6px 18px}
.castle-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.castle-option{display:flex!important;flex-direction:column;align-items:center;gap:3px;position:relative;padding:8px;border:2px solid #ccd0df;border-radius:12px;background:#e9edf7;cursor:pointer;color:#202433;font-size:12px!important;text-align:center}.castle-option:has(input:checked){border-color:#7854c6;background:#e8ddff;box-shadow:0 0 0 2px #7854c633}.castle-option input{position:absolute;left:7px;top:7px;z-index:2;accent-color:#7051b4;width:17px;height:17px}.castle-option .castle-art{width:100%;max-width:145px;aspect-ratio:1}.castle-option:focus-within{outline:3px solid #b88b32;outline-offset:2px}
.board.painted-board{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;height:auto!important;min-height:0!important;padding:12px;margin:0;align-content:start;background:radial-gradient(ellipse at center,#d7dbec,#eef0f7);border-radius:18px;overflow:auto;isolation:isolate}
.board.painted-board .fort{position:relative!important;inset:auto!important;transform:none!important;width:100%!important;min-width:0;text-align:center;padding:8px 4px;background:#ffffffa8;border:1px solid #c7cde0;border-radius:13px;display:flex;flex-direction:column;align-items:center}
.board.painted-board .fort-illustration{width:100%;max-width:210px;height:auto;aspect-ratio:1;position:relative}.board.painted-board .castle-art{width:100%;height:100%;aspect-ratio:1}.board.painted-board .fort strong{max-width:100%;font-size:13px;line-height:1.4;overflow-wrap:anywhere;color:#22293f}.board.painted-board .fort-stats{font-size:12px;flex-wrap:wrap;justify-content:center;color:#343b50}.board.painted-board .magic-dome{inset:5%;width:90%;height:90%}
.teacher-layout .board.painted-board{grid-template-columns:repeat(auto-fit,minmax(160px,1fr));min-height:0!important;height:auto!important;max-height:none}.board.painted-board .arena-message{position:sticky;bottom:5px;grid-column:1/-1;left:auto;transform:none;margin:0 auto}.board.painted-board .arena-message:not(.visible){display:none}
.game-layout .board-side{overflow:auto}.game-layout .board-side .painted-board{flex:1;min-height:0;margin:5px 0}.game-layout .action-icon .game-icon{width:38px;height:38px}
@media(min-width:960px) and (min-height:700px){.game-layout .mini-castle{width:70px!important}.game-layout .mini-arena:has(>.team-status:nth-child(5)) .mini-castle{width:54px!important}}
@media(max-width:760px){.castle-showcase{gap:7px;padding:14px 8px}.castle-showcase figcaption{font-size:10px}.castle-options{grid-template-columns:repeat(2,minmax(0,1fr))}.game-layout .mini-castle{width:68px!important}.mini-details .hp-row{flex-wrap:wrap}.teacher-layout .board.painted-board{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Luminous sky realm, shared by the lobby and castle arenas. */
body[data-screen="lobby"],body[data-screen="teacher"],body[data-screen="student"]{background:linear-gradient(#15376335,#31478b40),url('assets/sky-kingdom.png?v=1a9911ddeb31') center top/cover fixed;background-color:#9bd4ef}
.lobby-layout .page-heading{padding:20px 24px;background:linear-gradient(110deg,#183766e8,#31447bc9);border:1px solid #fff2c0;border-radius:22px;box-shadow:0 9px 28px #31538130}
.lobby-layout .page-heading p{color:#e1ecff}.lobby-layout .notice{background:#fff9ecf2;color:#253b62;border:1px solid #d4b97d;box-shadow:0 4px 16px #365d8630}
.team-grid{padding:26px;gap:22px;grid-template-columns:repeat(3,minmax(0,1fr));border:1px solid #fff5d3;border-radius:28px;background:linear-gradient(#e7f8ff25,#a9c7fa40),url('assets/sky-kingdom.png?v=1a9911ddeb31') center/cover;box-shadow:0 16px 40px #244d7133,inset 0 0 0 5px #fff5}
.team-grid .territory{background:linear-gradient(160deg,#f8fcffac,#dff4ff55 45%,#cbd7ff96);border:1px solid #fff4d0;border-bottom:3px solid #d7bd87;border-radius:23px;padding:14px;box-shadow:0 8px 22px #315fa32e;overflow:hidden}
.team-grid .territory:before{inset:5px;border:1px solid #fff9;border-radius:18px}.territory .team-title{background:#fff9edf5;border-color:#e0c893;border-radius:12px;box-shadow:0 3px 10px #6a8dbb20}.territory .team-title h2{color:#243b64}.territory .team-title small{color:#526483}
.territory-land{height:205px;margin:5px 0;isolation:isolate}.territory-castle{width:min(235px,95%);top:0}.territory-path{width:85%;height:42px;bottom:0;border:0;background:radial-gradient(ellipse,#fffdf7dd,#dff8ff77 45%,transparent 72%);box-shadow:none;z-index:0}
.territory .members{background:#ffffffa6;border:1px solid #fff;border-radius:14px;padding:12px 8px;min-height:83px}.territory .empty-team{color:#38516e;margin:15px 0;text-shadow:none}.territory .player-name{background:#fffdf5;color:#111;border-color:#d1c4a4;box-shadow:0 2px 0 #ccc3ad}.territory .pawn-token{filter:drop-shadow(0 2px 3px #417dc333)}.territory>.text-button{color:#354c73}
.territory>.secondary{background:linear-gradient(#fff8db,#efe2b6);border-color:#c4a35f;color:#3b4263}.territory>.secondary:disabled{background:#e2edff;color:#334974;opacity:1}
.board.painted-board{background:linear-gradient(#d7f3ff25,#c9d3ff45),url('assets/sky-kingdom.png?v=1a9911ddeb31') center/cover;border:1px solid #f8ecc5;padding:18px;gap:16px;box-shadow:inset 0 0 0 4px #fff5}
.board.painted-board .fort{background:linear-gradient(#ffffff38,#e9f2ff44);border:1px solid #fff9;box-shadow:0 4px 14px #5587c322;border-radius:18px;padding:10px 6px}
.board.painted-board .fort strong{background:#fff8e9f5;border:1px solid #d3b978;border-radius:7px;padding:4px 12px;color:#23334c;text-shadow:none;box-shadow:0 2px 6px #6586b033}
.board.painted-board .fort-stats{background:#f9fcfff2;border:1px solid #aecadf;border-radius:8px;padding:5px 10px;color:#233b55;box-shadow:0 2px 6px #6586b022}
.teacher-layout .board-panel{background:#edf8ffc9;border-color:#fff0bc}.game-layout .board-side{background:linear-gradient(#e3f5ffdc,#d9e2ffd9);border-color:#fff4c7;box-shadow:0 8px 22px #2b577d33}.board-heading,.board-tip{color:#284969}
.mini-arena{background:linear-gradient(#e7f8ff55,#c0d4f955),url('assets/sky-kingdom.png?v=1a9911ddeb31') center 45%/cover;border-color:#fff0c7;box-shadow:0 5px 18px #294a7a33}.mini-arena:before{display:none}.mini-arena .team-status{background:#f4faffd9;border:1px solid #ffffffdd;border-radius:12px}.mini-arena .team-status.mine{background:#fff6ddec;border:2px solid #d4b260}.mini-details>strong{color:#263859!important;text-shadow:none}.mini-details .hp-row{color:#364661}.mini-arena .my-badge{background:#6250a9;border-color:#dfcef4}
.castle-showcase{background:linear-gradient(#325d8a22,#544e9166),url('assets/sky-kingdom.png?v=1a9911ddeb31') center/cover}.castle-showcase figcaption{display:table;margin:5px auto 0;padding:4px 9px;background:#fff7e7ee;color:#29395b;border:1px solid #d5bb83;border-radius:7px;text-shadow:none}.castle-release{background:#e2efff;color:#304363}
body[data-screen="student"] .game-heading,body[data-screen="teacher"] .game-heading{background:#213c68df;padding:7px 12px;border:1px solid #d5def599;border-radius:13px}.game-layout .balance-note{color:#233652;background:#f2f8ffe8;border-radius:7px;text-align:center}
@media(min-width:1500px){.team-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:1000px){.team-grid{grid-template-columns:repeat(2,minmax(0,1fr));padding:18px;gap:16px}}
@media(max-width:600px){.team-grid{grid-template-columns:1fr;padding:14px;gap:18px}.territory-land{height:210px}.lobby-layout .page-heading{padding:14px;flex-wrap:wrap;gap:14px}.board.painted-board{padding:10px;gap:9px}.castle-showcase figcaption{padding:3px 5px;font-size:10px}}
/* Equipped classmates in the waiting room, including unassigned students. */
.player-card .player-avatar{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:92px;height:112px;padding-top:20px;overflow:visible}
.player-card .player-avatar .human-avatar{width:88px;height:88px;margin:0}
.territory .player-card{min-width:0;max-width:100%;gap:5px}
.territory .player-name{max-width:100%;overflow-wrap:anywhere}
.territory .player-card select{min-width:0;max-width:100%}

/* Ponytail atlas faces sit left of the tile center; align the neck, not the hair silhouette. */
.cute-head.ponytail-head{left:24%}
