/* Keep the game layout measurable, but reveal its HUD only after map entry succeeds. */
body:not(.game-ready) :is(.topbar,#game-shell){visibility:hidden}
body #loading{visibility:visible}

/* Shared by initial loading, map travel and retry states; game.js replaces the children. */
body #loading{
 position:absolute;inset:0;isolation:isolate;overflow:auto;
 display:flex;flex-direction:column;align-items:center;justify-content:flex-end;
 gap:12px;padding:32px 24px clamp(32px,9vh,96px);text-align:center;
 background:#101414 url('../../assets/front/portal-dragon.png') center 42%/cover no-repeat;
 color:#f5e8cb;text-shadow:0 2px 12px #000;
}
body #loading::before{
 content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;
 background:linear-gradient(180deg,#080c1026 15%,#080c1040 40%,#080c10e6 78%,#080c10 100%);
}
body #loading::after{
 content:'Raja Online';order:-2;flex-shrink:0;
 padding:76px 0 16px;margin-bottom:4px;min-width:240px;
 background:url('../../assets/front/raja-dragon-crest-ui.png') center top/58px auto no-repeat;
 font:400 clamp(22px,3vw,30px)/1.2 Georgia,'Times New Roman',serif;
 letter-spacing:7px;color:#ebcc8d;
 border-bottom:1px solid #d7b47355;
}
body #loading>strong{
 order:0;max-width:min(100%,600px);font-size:clamp(18px,2.4vw,24px);
 font-weight:400;line-height:1.7;overflow-wrap:anywhere;
}
body #loading>small{
 order:1;max-width:min(100%,560px);color:#bdb7aa;
 font-size:12px;line-height:1.8;overflow-wrap:anywhere;
}
body #loading:has(>.loader)>strong{display:none}
body #loading>.loader{
 order:2;position:relative;flex-shrink:0;overflow:hidden;
 width:min(260px,76%);height:3px;margin-top:16px;
 border:0;border-radius:0;background:#dbc28b26;animation:none;
}
body #loading>.loader::after{
 content:'';position:absolute;inset:0;transform:scaleX(var(--loading-progress,0));transform-origin:left;
 background:linear-gradient(90deg,#d7ac62,#ffe6a8);
}
/* Beginner tip between the title rule and the progress bar (loading-hints.js). */
body #loading>.loading-hint{
 order:1;max-width:min(100%,520px);min-height:3.6em;margin:4px 0 0;
 color:#e0d3b4;font-size:14px;line-height:1.8;overflow-wrap:anywhere;
 transition:opacity .3s ease;
}
body #loading>.loading-hint.fading{opacity:0}
body #loading:not(:has(>.loader))>.loading-hint{display:none}
body #loading>button,body #loading>a{
 order:3;min-height:44px;max-width:100%;padding:10px 24px;
 border:1px solid #b7975a;background:#201d16;color:#f5dfb0;
 font:inherit;font-size:14px;text-decoration:none;text-shadow:none;
}
body #loading>button:hover,body #loading>a:hover{background:#393021;border-color:#f0d299}
@media(max-width:600px){
 body #loading{background-position:62% center;padding-inline:20px;padding-bottom:40px}
 body #loading::after{letter-spacing:5px;min-width:210px}
}
@media(max-height:500px){
 body #loading{gap:5px;padding-block:16px;justify-content:center}
 body #loading::after{padding-top:48px;padding-bottom:8px;background-size:34px auto;font-size:20px;margin:0}
 body #loading>.loader{margin-top:8px}
 body #loading>.loading-hint{min-height:0;font-size:12px;line-height:1.5}
}
@media(prefers-reduced-motion:reduce){
 body #loading>.loading-hint{transition:none}
}

/* Original 800×600 menu art; controls reflow for touch instead of scaling text to illegibility. */
#connecting{position:fixed;inset:0;z-index:45;background:#080e12;display:grid;place-items:center;overflow:auto}
#connecting[hidden],body #select[hidden],#login #login-google[hidden]{display:none}
body #select button,body #create button,#account-link button{border-radius:0;border:2px ridge #a29370;background:linear-gradient(#3d3b30,#151b1c);color:#f8e9bc;min-height:44px;padding:7px 12px}
body #select{padding:16px;border:0;background:#121414;align-items:center}
body #select .select-inner{width:min(960px,100%);padding:16px 28px;border:0;background:url('../../assets/front/select-textless.png') center/100% 100% no-repeat;box-shadow:none}
body #select h2{margin:0 0 8px;font:22px Tahoma,sans-serif;letter-spacing:0;text-shadow:1px 1px #000}
.select-stage{position:relative;min-height:410px}
body #select-preview{position:absolute;width:240px;height:240px;left:50%;top:50%;transform:translate(-50%,-50%);background:radial-gradient(ellipse,#c0b08b30,transparent 68%);pointer-events:none}
body #select #slot-list{position:relative;grid-template-columns:1fr 1fr;column-gap:46%;row-gap:15px;margin:0;padding:0}
body #select .slot{padding:0;min-height:194px;border:0;background:#241d15e8;box-shadow:none}
body #select .slot button{width:100%;height:100%;min-height:194px;display:flex;flex-direction:column;align-items:center;gap:5px;padding:8px;background:#241f17e8;font:12px Tahoma,sans-serif}
body #select .slot.last button{outline:2px solid #f6d990;outline-offset:2px;background:#574329ed}
body #select .slot img{width:43px;height:53px;object-fit:contain}
body #select .slot b{font-size:16px}
body #select .slot small{font-size:10px}
.select-controls{display:flex;justify-content:center;gap:5px;margin-top:20px}
.select-controls button{flex:1;max-width:240px}
.slot-appearance{display:flex;align-items:center;justify-content:center;gap:4px;max-width:100%}
.slot-appearance canvas{width:96px;height:96px;image-rendering:pixelated}
.preview-controls{display:flex;justify-content:center;gap:4px}
body .preview-controls button{min-width:44px;min-height:44px;padding:5px}
.preview-controls [aria-pressed=true]{outline:2px solid #ffe39c}
#select-preview-controls{position:absolute;left:50%;top:calc(50% + 120px);transform:translateX(-50%);z-index:1}
body #create .creation-visual{height:250px;display:grid;grid-template-columns:85px 200px;grid-template-rows:200px 44px;gap:4px 8px;align-items:center;justify-content:center}
body #create #creation-preview{max-width:100%}
#creation-preview-controls{grid-column:2}
.select-footnote{text-align:center;font-size:11px;margin:10px 0 0;background:#161610ba;color:#eee2bd}
body #select-notice{background:#161610ed;padding:6px;font-size:12px;color:#ffdf91;text-align:center}
body #create{width:min(800px,calc(100% - 24px));max-width:800px;min-height:0;max-height:calc(100dvh - 24px);padding:18px;border:6px ridge #b2a38a;background:linear-gradient(#3f3b2cf0,#26271df0),url('../../assets/ui/stone.png');color:#f0e2bb}
body #create h2{margin:12px 0;color:#ffe2a1}
body #create-steps{font:11px Tahoma,sans-serif;text-align:center;line-height:1.8;margin:8px 0 12px;color:#e0cca1}
.creation-layout{display:grid;grid-template-columns:1fr 235px;gap:20px}
.creation-visual{height:200px;display:flex;align-items:center;justify-content:center;background:radial-gradient(ellipse,#a48c6050,transparent 70%)}
#creation-face{width:85px;height:105px;object-fit:contain;border:2px ridge #c8b884}
#creation-preview{width:200px;height:200px;max-width:60%}
#creation-options{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;align-content:flex-start;min-height:125px;font:13px Tahoma,sans-serif}
#creation-options img{width:59px;height:73px;object-fit:contain}
#creation-options [aria-pressed=true]{outline:2px solid #ffe39c;background:#736342}
#creation-options p{width:100%;margin:5px 0;text-align:center;line-height:1.7}
#creation-options label{width:100%}
#creation-record{padding:10px 15px;background:#191b16dc;border:3px ridge #a89873}
#creation-record h3{font:22px Georgia,serif;letter-spacing:4px;text-align:center;color:#f2da9e;margin:3px 0 10px}
#creation-record p{font:12px/1.8 Tahoma,sans-serif;margin:5px 0 10px;text-align:center}
#creation-record dl{margin:0;display:grid;grid-template-columns:1fr 1fr;gap:4px 14px;font:12px Georgia,serif}
#creation-record dl>div{display:flex;justify-content:space-between;border-bottom:1px solid #8a7b4d55;padding:3px 0}
#creation-record dd{margin:0;color:#ffe1a1}
body #create .create-actions{position:sticky;bottom:-18px;background:#2d2c20;padding:10px 0 0;display:flex;gap:8px;justify-content:flex-end}
#connecting .connecting-art{position:relative;width:min(100vw,133.333333dvh);aspect-ratio:4/3;overflow:hidden}
#connecting .connecting-background{display:block;width:100%;height:100%}
/* 800×600 source: center (400,300) minus sprite origin (218,216). */
#connecting .connecting-ring{
 position:absolute;left:22.75%;top:14%;width:54.5%;height:72.166667%;overflow:hidden;
 /* Blend the sprite's baked-in background into the still artwork at every scale.
    Mask the viewport so the feather stays fixed while the frames move. */
 -webkit-mask-image:linear-gradient(to right,transparent,#000 3%,#000 97%,transparent),linear-gradient(to bottom,transparent,#000 3%,#000 97%,transparent);
 -webkit-mask-composite:source-in;
 mask-image:linear-gradient(to right,transparent,#000 3%,#000 97%,transparent),linear-gradient(to bottom,transparent,#000 3%,#000 97%,transparent);
 mask-composite:intersect;
}
#connecting .connecting-frames{width:1600%;height:100%;background:url('../../assets/front/connecting-frames-textless.png') 0 0/100% 100% no-repeat;transform:translateX(var(--connecting-offset,0%))}
/* 11.5 MiB decoded strip: drop it while the connecting screen is hidden so the game does not keep it. */
#connecting[hidden] .connecting-frames{background-image:none}
#connecting .connecting-status{position:absolute;bottom:max(24px,env(safe-area-inset-bottom));left:5%;width:90%;text-align:center;color:#f5e8cb;text-shadow:0 2px 6px #000;background:#080e12df;padding:12px;border-radius:4px}
#connecting p{display:block;font:13px/1.7 Tahoma,sans-serif;margin:0 0 8px;overflow-wrap:anywhere}
#connecting progress{display:block;width:min(360px,100%);height:8px;margin:auto;accent-color:#dfbc78}
body #select button:disabled,body #create button:disabled{opacity:.4;cursor:default}
@media(max-width:600px){
 body #select{padding:12px 10px;align-items:flex-start}
 body #select .select-inner{padding:12px 6px;background-size:auto 100%;background-position:center}
 body #select h2{font-size:20px;margin:8px 0}
 .select-stage{min-height:0;padding-top:214px}
 body #select-preview{top:0;left:50%;transform:translateX(-50%);width:165px;height:165px}
 body #select #slot-list{column-gap:10px;row-gap:10px;grid-template-columns:1fr 1fr}
 body #select .slot,body #select .slot button{min-height:184px}
 body #select .slot button{padding:8px 4px}
 body #select .slot b{font-size:14px;overflow-wrap:anywhere}
 .select-controls{margin-top:12px}
 .select-controls button{padding:6px;font:13px Tahoma,sans-serif}
 body #create{width:calc(100% - 12px);max-height:calc(100dvh - 12px);padding:12px;margin:auto;border-width:4px}
 .creation-layout{grid-template-columns:1fr;gap:12px}
 #select-preview-controls{top:165px}
 body #create .creation-visual{height:190px;grid-template-columns:69px 140px;grid-template-rows:140px 44px}
 #creation-preview{height:140px;width:140px}
 #creation-face{height:85px;width:69px}
 #creation-options{min-height:90px}
 #creation-record dl{grid-template-columns:repeat(3,1fr);gap:4px 12px}
 #creation-record{padding:8px 10px}
 #creation-record h3{font-size:18px;margin:0}
 #creation-record p{margin:4px 0}
 body #create .create-actions{bottom:-12px;justify-content:space-between}
 body #create .create-actions button{padding:7px 9px;font-size:13px}
}
/* Character studio: five classes, one page. */
body #create{width:min(1180px,calc(100% - 40px));max-width:1180px;min-height:0;max-height:calc(100dvh - 32px);margin:auto;padding:30px 36px 20px;border:1px solid #887047;border-radius:12px;background:radial-gradient(ellipse at 50% 0,#3c34274a,transparent 65%),linear-gradient(145deg,#1e2425,#101618);box-shadow:0 24px 100px #000b;color:#e9dfc7}
body #create::backdrop{background:#080d10ed;backdrop-filter:blur(10px)}
body #create .creation-stage-header>.eyebrow{display:block;color:#b59b66;font:11px Tahoma,sans-serif;letter-spacing:3px}
body #create h2{font:30px Tahoma,sans-serif;color:#f4e8ca;margin:12px 0 8px}
body #create #create-steps{text-align:left;color:#9aaba9;font:13px/1.7 Tahoma,sans-serif;margin:0 0 24px}
body #create .creation-layout{display:block}
body #create .creation-main{display:flex;flex-direction:column}
body #create .creation-visual,body #create #creation-record{display:none}
body #create #creation-options{display:block;min-height:0}
.creation-toolbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px;gap:12px}
.field-caption{display:block;color:#c6b68e;font:12px Tahoma,sans-serif;letter-spacing:.5px;margin-bottom:10px}
.creation-toolbar .field-caption{margin:0}
.class-lineup{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}
body #create .class-card{position:relative;display:flex;flex-direction:column;align-items:center;min-width:0;padding:16px 6px 12px;border:1px solid #46504c;border-radius:8px;background:linear-gradient(#26303270,#151d20);color:#d9dece;transition:border-color .15s,background .15s}
body #create .class-card:hover{border-color:#b8a06b;background:#2c3534}
body #create .class-card[aria-pressed=true]{outline:none;border-color:#ddbd79;background:radial-gradient(ellipse at 50% 55%,#ab81443b,transparent 75%),linear-gradient(#383b30,#242b26);box-shadow:inset 0 0 0 1px #ddbd7938}
.class-number{position:absolute;top:12px;left:12px;font:11px Georgia,serif;color:#8d9c94}
.class-card canvas{width:100%;max-width:180px;height:auto;aspect-ratio:200/220;image-rendering:pixelated}
.class-card strong{font:18px Tahoma,sans-serif;color:#eee3c8;margin:4px 0 8px}
.class-card small{font:11px Tahoma,sans-serif;color:#a6b2aa}
.class-selected{margin-top:16px;font:10px Tahoma,sans-serif;color:#92a49b}
[aria-pressed=true]>.class-selected{color:#efd194}
.creation-fields{display:grid;grid-template-columns:1fr 1fr;gap:32px;border-top:1px solid #46504c;margin-top:24px;padding-top:22px}
body #create #create-name,body #create #create-job{display:block;width:100%;max-width:none;min-height:44px;background:#10191c;border:1px solid #505c56;border-radius:5px;color:#f1e6ca;padding:10px 12px;font:14px Tahoma,sans-serif}
.creation-identity>small{display:block;color:#7f948c;font:11px Tahoma,sans-serif;margin:8px 0 20px}
.creation-profession>.field-caption:not(:first-child){margin-top:20px}
.face-options,.spell-options{display:flex;gap:8px}
body #create .face-options button,body #create .spell-options button{border:1px solid #4c5a51;border-radius:5px;background:#192326;padding:5px;min-width:50px;outline:none;color:#b9c6b9}
body #create .spell-options button{padding:10px 18px}
body #create .face-options [aria-pressed=true],body #create .spell-options [aria-pressed=true]{border-color:#dbbb78;background:#3e4030;box-shadow:0 0 0 1px #dbbb782e}
body #create .face-options img{display:block;width:43px;height:53px;image-rendering:pixelated}
body #create #creation-options .creation-hint{text-align:left;color:#91a298;font:11px/1.9 Tahoma,sans-serif;margin-top:20px}
body #create .create-actions{position:static;display:flex;justify-content:space-between;align-items:center;border-top:1px solid #46504c;background:none;margin-top:24px;padding-top:18px}
body #create .create-actions button{width:auto;border-radius:5px;border:1px solid #596258;background:transparent;color:#bec8bb;padding:11px 25px;font:13px Tahoma,sans-serif}
body #create #create-confirm{margin:0;min-width:220px;border-color:#d0b476;background:#d0b476;color:#17201d;font-weight:bold}
body #create button:focus-visible,body #create input:focus-visible,body #create select:focus-visible{outline:2px solid #f1d79f;outline-offset:3px}
@media(max-width:700px){body #create{width:calc(100% - 16px);max-height:calc(100dvh - 16px);padding:22px 16px;border-width:1px}body #create h2{font-size:25px}.class-lineup{gap:5px}body #create .class-card{padding:20px 2px 10px}.class-card strong{font-size:12px}.class-card small{display:none}.class-selected{font-size:9px;margin-top:8px}.class-number{left:7px;top:8px}.creation-fields{grid-template-columns:1fr;gap:22px}.creation-toolbar{align-items:center}.field-caption{font-size:11px}body #create #create-confirm{min-width:0}body #create .create-actions button{padding:11px 16px}}
@media(prefers-reduced-motion:reduce){body #create .class-card{transition:none}}
@media(min-width:701px) and (max-height:820px){body #create{padding:20px 30px 16px}body #create h2{font-size:26px;margin:8px 0}body #create #create-steps{margin-bottom:14px}.class-card canvas{max-width:130px}.class-card strong{font-size:16px;margin:0 0 5px}.class-selected{margin-top:8px}.creation-fields{margin-top:16px;padding-top:16px}.creation-identity>small{margin:6px 0 12px}.creation-profession>.field-caption:not(:first-child){margin-top:12px}body #create #creation-options .creation-hint{margin-top:12px}body #create .create-actions{margin-top:16px;padding-top:12px}}
/* Five-step character creation. */
body #create #create-steps{display:flex;flex-wrap:wrap;gap:10px 20px;margin:18px 0 26px;padding-bottom:20px;border-bottom:1px solid #46504c}
.creation-step{display:flex;align-items:center;gap:7px;color:#7e9087;font:11px Tahoma,sans-serif}
.creation-step b{display:grid;place-items:center;width:23px;height:23px;border:1px solid #526056;border-radius:50%;font-weight:normal}
.creation-step.current{color:#eed39a}.creation-step.current b{background:#d0b476;border-color:#d0b476;color:#17201d}.creation-step.complete{color:#b3c4b3}
.creation-step-panel{max-width:600px;min-height:280px;margin:30px auto;padding:25px;background:#162022;border:1px solid #46504c;border-radius:8px}
body #create .creation-step-panel>p{text-align:left;color:#aebfb1;margin:12px 0 20px}
body #create .creation-step-panel>small{display:block;color:#91a298;margin-top:8px}
body #create .creation-step-panel .face-options{justify-content:center;flex-wrap:wrap;align-content:flex-start;gap:12px;margin:20px 0;padding:4px;max-height:min(46dvh,440px);overflow-y:auto}
body #create .creation-step-panel .face-options img{width:68px;height:84px;object-fit:contain}
body #create .face-options button{flex-shrink:0}
body #create .creation-step-panel .spell-options{justify-content:center;margin:40px 0}
body #create .create-actions #create-back{margin-left:auto;margin-right:12px}
body #create .create-actions #create-back[hidden]{display:none}
@media(max-width:700px){body #create #create-steps{gap:10px;font-size:10px}.creation-step{font-size:10px;gap:5px}.creation-step-panel{min-height:250px;padding:16px;margin:20px 0}body #create .creation-step-panel .face-options{gap:8px}body #create .creation-step-panel .face-options img{width:48px;height:60px}body #create .create-actions button{padding:10px}body #create .create-actions #create-back{margin-right:8px}}
/* Full-screen character hall: the heroes are the interface. */
body #create.class-stage{width:100vw;max-width:none;height:100dvh;max-height:none;min-height:0;margin:0;padding:clamp(20px,4vh,48px) 4vw 24px;border:0;border-radius:0;background:linear-gradient(#050b10aa,#07101922 45%,#03080ed9),url('../../assets/theme/character-hall.png') center/cover no-repeat;display:flex;flex-direction:column;overflow:auto}
body #create.class-stage .creation-stage-header>.eyebrow{display:none}
body #create.class-stage h2{font:clamp(23px,3vw,36px) Georgia,Tahoma,serif;color:#e8d5aa;text-align:center;letter-spacing:3px;margin:0;text-shadow:0 3px 10px #000}
body #create #create-steps{display:none}
body #create.class-stage .creation-layout{flex:1;display:flex;flex-direction:column;justify-content:center;min-height:0}
body #create.class-stage .creation-main{display:block}
body #create.class-stage .creation-toolbar{position:absolute;right:4vw;top:30px;margin:0}
body #create.class-stage .class-lineup{gap:0;align-items:end;width:min(1500px,100%);margin:0 auto}
body #create.class-stage .class-card{position:relative;border:0;border-radius:0;padding:12px 0 25px;background:none;box-shadow:none;isolation:isolate;outline:none}
body #create.class-stage .class-card:hover{background:none;border:0;box-shadow:none}
body #create.class-stage .class-card[aria-pressed=true]{background:none;border:0;box-shadow:none}
body #create.class-stage .class-card::before{content:'';position:absolute;bottom:35px;left:5%;width:90%;height:34px;background:radial-gradient(ellipse,#c99b5060,transparent 70%);border-bottom:1px solid #b79b6155;border-radius:50%;opacity:0;z-index:-1}
body #create.class-stage .class-card[aria-pressed=true]::before{opacity:1}
body #create.class-stage .class-card canvas{display:block;width:100%;max-width:none;height:clamp(270px,61vh,650px);aspect-ratio:auto;object-fit:contain;filter:drop-shadow(0 10px 5px #000a);image-rendering:pixelated}
body #create.class-stage .class-card[aria-pressed=true] canvas{filter:drop-shadow(0 0 12px #dab06945) drop-shadow(0 10px 5px #000a)}
body #create.class-stage .class-card strong{font:clamp(12px,1.5vw,20px) Georgia,Tahoma,serif;font-weight:normal;color:#aaa899;margin:12px 0 0;text-shadow:0 2px 5px #000}
body #create.class-stage .class-card[aria-pressed=true] strong{color:#ffe4a5}
body #create.class-stage .class-card:focus-visible{outline:1px solid #c5a46a;outline-offset:-5px}
body #create.class-stage .create-actions{border:0;background:none;margin:0;padding:0;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:20px}
body #create.class-stage #create-cancel{justify-self:start;grid-column:1;padding:10px 18px;border:0;color:#aaa899;background:none;min-width:0}
body #create.class-stage #create-confirm{grid-column:2;min-width:170px;width:170px;border:1px solid #c3a16a;border-radius:0;background:linear-gradient(#54462a,#272618);color:#ecd5a1;box-shadow:inset 0 0 0 3px #17190e,0 3px 15px #0009;letter-spacing:2px}
@media(max-width:700px){body #create.class-stage{padding:24px 10px 18px}body #create.class-stage .creation-toolbar{position:static;justify-content:center;margin:16px 0 0}body #create.class-stage .class-card canvas{height:clamp(220px,51vh,500px)}body #create.class-stage .class-card strong{font-size:11px;white-space:nowrap}body #create.class-stage .class-card{padding-bottom:20px}body #create.class-stage #create-confirm{min-width:130px;width:130px}body #create.class-stage .create-actions{gap:8px}}
body #create.class-stage .class-card::before{bottom:calc(17.08vh + 50px)}
@media(max-width:700px){body #create.class-stage .class-card::before{bottom:calc(14.28vh + 45px)}}
/* Painted class cutouts: soles, contact shadows and selection ring share one floor. */
body #create.class-stage .class-card{padding:0;overflow:visible}
body #create.class-stage .class-card canvas{height:clamp(280px,65vh,700px);object-fit:fill;image-rendering:auto;filter:none}
body #create.class-stage .class-card[aria-pressed=true] canvas{filter:drop-shadow(0 0 9px #e3b66528)}
body #create.class-stage .class-card strong{display:block;width:100%;height:44px;box-sizing:border-box;padding-top:16px;margin:0;line-height:24px}
body #create.class-stage .class-card::after{content:'';position:absolute;bottom:44px;left:18%;width:64%;height:12px;border-radius:50%;background:radial-gradient(ellipse,#000c,#0005 45%,transparent 75%);z-index:-1}
body #create.class-stage .class-card::before{bottom:40px;left:12%;width:76%;height:20px;background:radial-gradient(ellipse,#e6b75e24,transparent 70%);border:1px solid #c8a45c88;box-shadow:0 0 16px #c79b4930;z-index:-1}
@media(max-width:700px){body #create.class-stage .class-card{padding:0}body #create.class-stage .class-card canvas{height:clamp(180px,55vh,500px)}body #create.class-stage .class-card::before{bottom:40px}}
body #create.class-stage .class-card canvas{width:124%;margin-left:-12%;pointer-events:none}

/* Four glass corners surrounding the selected hero. */
body #select{padding:28px 4vw;align-items:stretch;background:linear-gradient(90deg,#080e14ed,#0b141bb5 48%,#080e14a8),url('../../assets/theme/character-hall.png') center/cover no-repeat;color:#eee4ce;image-rendering:auto}
body #select .select-inner{position:relative;display:flex;flex-direction:column;width:min(1600px,100%);min-height:650px;margin:0 auto;padding:0;background:none;border:0;box-shadow:none}
.select-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 0 18px;border-bottom:1px solid #c8aa6a35}
.select-wordmark{font:25px Georgia,serif;letter-spacing:5px;color:#e7c995;text-shadow:0 2px 20px #d5ae5133}
.select-wordmark>span{display:block;margin-top:8px;font:8px Tahoma,sans-serif;letter-spacing:5px;color:#b3a180}
.select-save-status{display:flex;align-items:center;gap:8px;color:#abb5ae;font:10px Tahoma,sans-serif}
.select-save-status i{width:5px;height:5px;border-radius:50%;background:#a0b89b;box-shadow:0 0 10px #a0b89b66}
.select-heading{display:flex;align-items:center;justify-content:space-between;margin:20px 0 18px}
body #select h2{margin:0;font:400 21px Tahoma,sans-serif;letter-spacing:1px;color:#e1d3b7;text-align:left;text-shadow:0 2px 8px #000}
#select-slot-count{border:0;padding:0;font:11px Tahoma,sans-serif;color:#a99c82}
body #select .select-stage{position:relative;flex:1;display:grid;grid-template-columns:1fr;min-height:430px;padding:0;isolation:isolate}
.select-roster{position:absolute;inset:0;z-index:2;pointer-events:none}
body #select #slot-list{height:100%;display:grid;grid-template-columns:clamp(210px,22vw,310px) clamp(210px,22vw,310px);grid-template-rows:1fr 1fr;align-content:space-between;justify-content:space-between;gap:28px;margin:0;padding:0;pointer-events:none}
body #select .slot,body #select .slot.last{align-self:start;min-height:0;padding:0;border:0;border-radius:3px;background:none;box-shadow:none}
body #select .slot:nth-child(n+3){align-self:end}
body #select .slot button{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;width:100%;height:clamp(170px,24vh,235px);min-height:0;padding:16px 18px;border:1px solid #c3ad7847;border-radius:3px;background:linear-gradient(135deg,#99c1cf0c,#0b182338);box-shadow:inset 0 0 35px #b0c5ca06,0 12px 35px #0002;color:#bac3c4;text-align:center;pointer-events:auto;transition:border-color .2s,background .2s,box-shadow .2s}
body #select .slot button::before,body #select .slot button::after{content:'';position:absolute;width:17px;height:17px;border-color:#b99b61;border-style:solid;pointer-events:none;opacity:.6}
body #select .slot button::before{left:-1px;top:-1px;border-width:1px 0 0 1px}
body #select .slot button::after{right:-1px;bottom:-1px;border-width:0 1px 1px 0}
body #select .slot button:hover{border-color:#dbc18b9c;background:linear-gradient(135deg,#d7c18a18,#15232b55)}
body #select .slot.last button{outline:0;border:1px solid #e4c58cc2;background:radial-gradient(ellipse at 50% 65%,#b58a3326,transparent 85%),linear-gradient(135deg,#ead3a01c,#101d2744);box-shadow:inset 0 0 28px #dfbd7310,0 0 25px #c99b4e15}
.slot-number{position:absolute;left:16px;top:13px;font:12px Georgia,serif;letter-spacing:2px;color:#ad9b77}
body #select .slot .slot-miniature{position:relative;display:block;flex-shrink:0;width:clamp(82px,calc(24vh - 84px),120px);height:clamp(82px,calc(24vh - 84px),120px);overflow:visible;z-index:1;pointer-events:none}
body #select .slot .slot-miniature canvas{position:absolute;top:0;left:-50%;width:200%;height:200%;image-rendering:pixelated;filter:drop-shadow(0 5px 9px #0008);pointer-events:none}
.slot-copy{display:flex;flex:0;min-width:0;flex-direction:column;gap:6px}
body #select .slot b{font:400 18px Tahoma,sans-serif;color:#e7decc;overflow-wrap:anywhere}
.slot-copy>span{font:11px Tahoma,sans-serif;color:#97a8ad}
.slot-copy em{font-style:normal;margin:0 6px;color:#a28652}
.slot-indicator{position:absolute;right:16px;top:12px;font-size:13px;color:#a99a78}
.slot.last .slot-indicator{color:#f3cf89;text-shadow:0 0 12px #ffd684}
body #select .slot.empty button{border:1px solid #9dadad30;background:linear-gradient(135deg,#b4cbd207,#09172225)}
.slot-add{display:grid;place-items:center;flex:none;width:46px;height:46px;margin-bottom:14px;border:1px solid #bca5754d;border-radius:50%;font:28px Georgia,serif;color:#b9a57e;background:#15212a25}
body #select .slot.empty b{font:12px Tahoma,sans-serif;color:#a19e92}
.select-showcase{position:relative;align-self:center;justify-self:center;display:flex;flex-direction:column;align-items:center;width:clamp(280px,40vw,600px);min-height:0;overflow:visible;border:0;border-radius:0;background:none;pointer-events:none}
body #select #select-preview{position:absolute;top:-50%;left:-50%;transform:none;width:200%;height:200%;max-width:none;margin:0;background:none;z-index:1;image-rendering:pixelated;filter:drop-shadow(0 9px 8px #0009) drop-shadow(0 0 22px #e9c58225)}
.select-aura{position:absolute;inset:0 0 22%;background:radial-gradient(ellipse at 50% 60%,#dcb05e18,transparent 64%);pointer-events:none}
.select-preview-stage{position:relative;width:100%;aspect-ratio:10/9}
.select-preview-stage>canvas{display:block}
.select-pedestal{position:absolute;top:78%;left:50%;transform:translate(-50%,-50%) rotateX(64deg);width:78%;height:37%;border:1px solid #e7c48070;border-radius:50%;background:radial-gradient(ellipse,#e7b95812,transparent 65%);box-shadow:0 0 0 10px #c4a25e08,0 0 0 11px #d9b76c28,0 0 55px #d2a14818,inset 0 0 40px #e2bf6720}
body #select #select-preview-controls{position:relative;left:auto;top:auto;transform:none;margin:-5px 0 12px;gap:8px;z-index:3;pointer-events:auto}
body #select .preview-controls button{min-width:34px;min-height:30px;padding:4px 9px;border:1px solid #ae956340;border-radius:2px;background:#0b172161;color:#b7aa8d;font:11px Tahoma,sans-serif}
body #select .preview-controls button[aria-pressed=true]{outline:0;border-color:#d2b478;background:#8e71352e}
#select-character-detail{align-self:stretch;text-align:center;padding:0;z-index:1}
#select-character-detail h3{margin:0 0 8px;font:400 clamp(24px,2.5vw,38px)/1.3 Georgia,Tahoma,serif;letter-spacing:2px;color:#f4dfb1;text-shadow:0 3px 15px #000,0 0 28px #efc16f26;overflow-wrap:anywhere}
#select-character-detail>p{margin:0;font:12px Tahoma,sans-serif;color:#b8beb9}
#select-character-detail>p>span{margin:0 10px;color:#b4955d}
.select-footer{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:10px;padding:24px 0 0;margin:0;border:0;z-index:3}
body #select #select-ok{width:260px;min-width:0;min-height:54px;border:1px solid #e4c68a;border-radius:2px;background:linear-gradient(110deg,#b78d49,#edcf91 50%,#b38b4c);box-shadow:inset 0 0 0 3px #c9a365,0 0 30px #d3a55222,0 8px 25px #0006;color:#24251f;font:700 15px Tahoma,sans-serif;letter-spacing:1px}
body #select #select-delete{min-height:30px;padding:4px 12px;background:none;border:0;color:#a89785;font:10px Tahoma,sans-serif}
body #select button:focus-visible{outline:2px solid #f3d79b;outline-offset:4px}
body #select-notice{position:absolute;top:74px;left:50%;transform:translateX(-50%);max-width:90%;z-index:5;margin:0;padding:10px 16px;border:1px solid #c6aa6a55;background:#14202bef;font:12px Tahoma,sans-serif;color:#eed5a5;text-align:center}
@media(min-width:701px) and (max-height:780px){body #select{padding:20px 4vw}body #select .select-inner{min-height:570px}.select-header{padding-bottom:12px}.select-heading{margin:14px 0}.select-showcase{width:min(34vw,430px)}body #select .select-stage{min-height:360px}body #select .slot button{height:170px}body #select .slot .slot-miniature{width:82px;height:82px}.select-footer{padding-top:16px}}
@media(max-width:700px){body #select{padding:20px 16px;background-attachment:fixed}body #select .select-inner{min-height:740px}.select-wordmark{font-size:18px;letter-spacing:3px}.select-wordmark>span{font-size:6px;letter-spacing:3px}.select-save-status{font-size:8px}.select-heading{margin:20px 0}body #select h2{font-size:18px}body #select .select-stage{min-height:580px}body #select #slot-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:230px 20px}body #select .slot button{height:142px;padding:12px 8px}.slot-number{top:9px;left:10px;font-size:10px}.slot-indicator{top:8px;right:10px}body #select .slot .slot-miniature{width:82px;height:82px}body #select .slot b{font-size:14px}.slot-copy{gap:4px}.slot-copy>span{font-size:10px}.slot-add{width:36px;height:36px;font-size:23px;margin-bottom:10px}.select-showcase{width:230px;align-self:start;margin:120px 0;z-index:1}#select-character-detail h3{font-size:25px}.select-footer{padding-top:22px}body #select #select-ok{width:min(260px,100%)}}
@media(prefers-reduced-motion:reduce){body #select .slot button{transition:none}}

/* Creation controls: engraved gold, clear choices, and readable Thai type. */
body #create{--creation-type:'Leelawadee UI','Leelawadee',Tahoma,sans-serif;font-family:var(--creation-type)}
body #create button,body #create input,body #create select,body #create #creation-options{font-family:var(--creation-type)}
body #create #create-steps{display:none}
body #create h2{font-family:'Angsana New','Noto Serif Thai',serif;font-size:48px;font-weight:700;line-height:1.25;letter-spacing:.4px}
body #create.class-stage h2{align-self:center;position:relative;font:700 clamp(46px,4vw,68px)/1.3 'Angsana New','Noto Serif Thai',serif;letter-spacing:.5px;color:#f6e5bd;text-shadow:0 2px 1px #59401f,0 4px 20px #000,0 0 32px #c69a4d40}
body #create.class-stage h2{width:auto;max-width:92vw;height:auto;flex:none;padding:0 28px 10px;background:none;font:400 clamp(48px,4.5vw,76px)/1.2 'Angsana New','Noto Serif Thai',serif;letter-spacing:1px;color:#efddb5;text-shadow:0 2px 12px #000,0 0 24px #b7904d24;filter:none}
body #create.class-stage h2::after{content:'';position:absolute;bottom:0;left:calc(50% - 48px);width:96px;height:1px;background:linear-gradient(90deg,transparent,#c3a16a,transparent)}
body #create.class-stage .creation-toolbar{top:36px;right:4vw}
.sex-selector{display:flex;gap:3px;padding:4px;border:1px solid #ac8b525c;background:linear-gradient(145deg,#15212be6,#080e16ed);box-shadow:inset 0 1px #ffe5ad0a,0 6px 24px #0005}
body #create .sex-option{display:flex;align-items:center;justify-content:center;gap:9px;min-width:84px;min-height:44px;padding:8px 15px;border:1px solid transparent;border-radius:0;background:transparent;box-shadow:none;outline:0;color:#a9aaa6;font-size:14px;font-weight:500;line-height:1.3;transition:color .16s,background .16s,border-color .16s}
.sex-symbol{font:21px/1 Georgia,serif;opacity:.8}
body #create .sex-option[aria-pressed=true]{border:1px solid #d4b27599;outline:0;background:linear-gradient(135deg,#c5a36435,#8d693c1c);box-shadow:inset 0 1px #ffe6ac25;color:#ffe7b2;text-shadow:0 0 15px #e4bd6b40}
body #create .sex-option:hover{border-color:#c8ac6f66;color:#f7e6c5;background-color:#e7c88912}
body #create .sex-option:focus-visible{outline:2px solid #fff0c7;outline-offset:2px}
body #create.class-stage .class-card strong{height:52px;padding-top:15px;font:600 clamp(14px,1.35vw,20px)/1.5 var(--creation-type);letter-spacing:.3px;color:#c1b7a1;text-shadow:0 2px 5px #000}
body #create.class-stage .class-card[aria-pressed=true] strong{color:#ffe3a2;text-shadow:0 0 18px #e1b75d50,0 2px 5px #000}
body #create.class-stage .class-card::after{bottom:52px}
body #create.class-stage .class-card::before{bottom:48px}
body #create .create-actions{overflow:visible}
body #create #create-confirm,body #create.class-stage #create-confirm{position:relative;isolation:isolate;display:grid;place-items:center;min-width:224px;width:224px;min-height:60px;padding:14px 32px;border:0;border-radius:0;clip-path:polygon(12px 0,calc(100% - 12px) 0,100% 12px,100% calc(100% - 12px),calc(100% - 12px) 100%,12px 100%,0 calc(100% - 12px),0 12px);background:linear-gradient(120deg,#806138,#fae3a4 36%,#c59a53 65%,#ead29b);box-shadow:none;color:#ffecc4;font:600 17px/1.5 var(--creation-type);letter-spacing:.5px;text-shadow:0 2px 3px #000;filter:drop-shadow(0 5px 12px #0008);transition:filter .18s,transform .18s}
body #create #create-confirm::before{content:'';position:absolute;inset:2px;z-index:-1;clip-path:inherit;background:radial-gradient(ellipse at 50% 0,#ae824b48,transparent 80%),linear-gradient(#293037,#10171e);box-shadow:inset 0 0 0 3px #0d141bc9}
body #create #create-confirm::after{content:'';position:absolute;top:5px;left:calc(50% - 28px);width:56px;height:1px;background:linear-gradient(90deg,transparent,#ffe7b0,transparent)}
body #create #create-confirm:hover{filter:drop-shadow(0 0 14px #c7a46250) brightness(1.18);transform:translateY(-2px)}
body #create #create-confirm:active{transform:translateY(1px)}
body #create #create-confirm:focus-visible{outline:0;filter:drop-shadow(0 0 5px #fff1c1) brightness(1.2)}
body #create.class-stage #create-cancel,body #create #create-back{font:500 13px/1.6 var(--creation-type);letter-spacing:.2px;color:#bbae96}
body #create.class-stage .create-actions{padding-bottom:4px}
@media(max-width:700px){body #create.class-stage{padding-top:20px}body #create.class-stage .creation-toolbar{margin:12px 0 0}body #create .sex-option{min-width:82px;min-height:42px;padding:7px 14px;font-size:13px}body #create.class-stage .class-card strong{font-size:13px}body #create #create-confirm,body #create.class-stage #create-confirm{width:190px;min-width:190px;min-height:56px;font-size:16px}body #create.class-stage .create-actions{grid-template-columns:1fr auto 1fr;gap:4px}body #create.class-stage #create-cancel{padding:10px 4px;font-size:12px}}
@media(prefers-reduced-motion:reduce){body #create .sex-option,body #create #create-confirm{transition:none}}

/* Reserve separate rows for the title, complete class labels, and the footer. */
body #create.class-stage{box-sizing:border-box;display:grid;grid-template-rows:auto minmax(0,1fr) auto;row-gap:16px;padding-top:26px;padding-bottom:18px;overflow:hidden}
body #create.class-stage .creation-layout{min-height:0;height:100%;justify-content:stretch}
body #create.class-stage .creation-main{display:flex;flex-direction:column;flex:1;min-height:0}
body #create.class-stage #creation-options{display:flex;flex-direction:column;flex-wrap:nowrap;align-items:center;flex:1;min-height:0;width:100%}
body #create.class-stage .class-lineup{flex:1;min-height:0;height:100%;align-items:stretch}
body #create.class-stage .class-card{display:flex;flex-direction:column;min-height:0;height:100%}
body #create.class-stage .class-card canvas{flex:1;min-height:0;height:0}
body #create.class-stage .class-card strong{flex:none}
body #create.class-stage .create-actions{position:static;flex:none;min-height:44px;padding:0;margin:0}
body #create.class-stage #create-confirm{width:164px;min-width:164px;min-height:44px;padding:8px 22px;font-size:14px}
@media(max-width:700px){body #create.class-stage{row-gap:12px;padding:18px 10px 16px}body #create.class-stage h2{font-size:48px}body #create.class-stage .creation-toolbar{flex:none;margin:4px 0 12px}body #create.class-stage .class-lineup{height:auto}body #create.class-stage #create-confirm{width:150px;min-width:150px;min-height:44px}}

/* AD: real sign-in (dialog chrome comes from theme.css like #delete-confirm). */
body #login,body #import-local,body #bind-account{width:min(440px,calc(100% - 32px));border:1px solid var(--brass,#a29370);padding:25px 28px}
#login:focus{outline:none}
#login h2,#import-local h2,#bind-account h2{color:#f0d8a4;font-size:24px}#login .eyebrow,#import-local .eyebrow{color:#c2a265}
#login p,#import-local p,#bind-account p{color:#b1c0c1}
#login-form,#bind-form{display:grid;gap:6px;margin-top:14px}#login-form label,#bind-form label{color:#c6bda6;font-size:12px;margin-top:6px}
#login-form input,#bind-form input{border:1px solid #9b7e4b;background:#09141c;color:#f1dfb7;padding:12px;font-size:15px;min-height:44px;min-width:0;box-shadow:inset 0 2px 5px #0006}
#login-form .create-actions,#bind-form .create-actions{display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px}
#login .login-note,#login-google-status{font-size:12px;margin:16px 0 12px}#login-google{display:flex;justify-content:center;margin-top:20px}#login a,#account-link a{color:#e0bd7e}
#email-account-button{position:fixed;top:96px;right:20px;z-index:20;box-sizing:border-box;border:1px solid #9b7e4b88;border-radius:6px;background:#101923d9;color:#f0d8a4;padding:5px 10px;font:11px/18px Tahoma,sans-serif;cursor:pointer;touch-action:manipulation}
#email-account-button:hover{border-color:#d4b67b;background:#263039}
#email-account-button:focus-visible{outline:2px solid #d4b67b;outline-offset:3px}
body #email-account-dialog{box-sizing:border-box;width:min(420px,calc(100% - 32px));max-height:calc(100dvh - 32px);overflow:auto;padding:24px;border:1px solid #9b7e4b;background:#101d23;color:#f0d8a4}
#email-account-dialog p{overflow-wrap:anywhere}#email-account-dialog form{display:grid;gap:12px;margin:16px 0}#email-account-dialog input{display:block;box-sizing:border-box;width:100%;min-height:44px;background:#09141c;border:1px solid #9b7e4b;color:#f0d8a4;padding:10px}#email-account-dialog button{min-height:44px;padding:8px 12px}
body #email-account-button{display:none}
body.game-ready #email-account-button{display:block;max-width:calc(100vw - 24px);white-space:normal}
#select-logout{border:1px solid #9b7e4b88;background:transparent;color:#e0bd7e;font-size:11px;padding:5px 10px;margin-left:10px;cursor:pointer}

/* Smoothly downsample the high-resolution brand artwork instead of the global pixel-art rendering. */
.dragon-crest,.select-dragon-crest,.creation-face-brand img{image-rendering:auto}
.select-wordmark{position:relative;padding-left:62px;min-height:52px}.select-dragon-crest{position:absolute;left:0;top:50%;transform:translateY(-50%);width:48px;height:52px;object-fit:contain}
@media(max-width:700px){.select-wordmark{padding-left:46px;min-height:40px}.select-dragon-crest{width:36px;height:40px}}

/* Face-selection hall, shipped in the existing front stylesheet. */
.creation-stage-header{display:contents}
body #create.creation-hall .creation-choice-card::before{content:'';position:absolute;inset:0;z-index:2;pointer-events:none;border:var(--choice-frame-width,12px) solid transparent;border-image:url('../../assets/front/selection-frame.svg') 20 stretch;opacity:.8}
body #create.creation-hall .creation-stage-header{display:grid;grid-template-rows:auto auto auto;min-width:0}
body #create.creation-hall #creation-subtitle{margin:1cqw 0 2cqw;min-height:1.5em;text-align:center;color:#eee7d8;font:1.4cqw/1.5 'Leelawadee UI',Tahoma,sans-serif}
.creation-face-brand{display:none}
body #create.creation-hall{box-sizing:border-box;container-type:inline-size;position:fixed;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:0;width:min(74vw,148dvh);max-width:none;height:80dvh;min-height:0;max-height:none;margin:14dvh auto 0;padding:2.4vw 2.9vw 1.8vw;overflow:visible;border:0;border-radius:0;background:linear-gradient(110deg,#091219ed,#080f14ed);box-shadow:0 16px 65px #000b;color:#f1e6ce}
body #create.creation-hall::backdrop{background:linear-gradient(#03080c35,#03080c35),url('../../assets/theme/character-hall.png') center/cover no-repeat;backdrop-filter:none}
body #create.creation-hall::before{content:'';position:absolute;inset:0;pointer-events:none;border:18px solid transparent;border-image:url('../../assets/front/selection-frame.svg') 20 stretch}
body #create.creation-hall::after{content:'◇';position:absolute;top:-1.3vw;left:calc(50% - .8vw);color:#ffe1a0;font:2vw Georgia,serif;text-shadow:0 0 12px #e5ba62}
body #create.creation-hall .creation-stage-header>.eyebrow{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:3.5cqw;padding-bottom:1cqw;border-bottom:1px solid #b28e4e70;color:#d7b477;font:.95cqw Tahoma,sans-serif;letter-spacing:.25cqw;text-align:left}
body #create.creation-hall .language-picker{letter-spacing:0;color:#e5d4b4;font:12px Tahoma,sans-serif}
body #create.creation-hall h2{position:relative;justify-self:center;margin:1.5cqw 0 0;padding:0 3cqw;color:#ffe6ae;font:400 5.2cqw/1.15 'Angsana New','Noto Serif Thai',serif;letter-spacing:.05cqw;text-shadow:0 2px 10px #000}
body #create.creation-hall h2::before,body #create.creation-hall h2::after{content:'';position:absolute;top:60%;width:7cqw;height:1px;background:linear-gradient(90deg,transparent,#e8c685)}
body #create.creation-hall h2::before{right:100%}body #create.creation-hall h2::after{left:100%;transform:rotate(180deg)}
body #create.creation-hall .creation-layout,body #create.creation-hall .creation-main,body #create.creation-hall #creation-options{display:flex;flex-direction:column;min-height:0;width:100%;height:100%}
body #create.creation-hall .creation-step-panel{display:flex;flex-direction:column;align-items:center;flex:1;width:100%;max-width:none;min-height:0;margin:0;padding:0;border:0;border-radius:0;background:none}
body #create.creation-hall .creation-step-panel .face-options{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));justify-content:center;align-content:center;gap:1.8cqw;flex:1;min-height:0;width:92%;max-height:none;overflow:visible;margin:0;padding:8px}
body #create.creation-hall .face-options button{--choice-frame-width:10px;position:relative;display:block;min-width:0;width:100%;max-height:100%;aspect-ratio:200/250;padding:.9cqw;border:0;border-radius:0;background:#0c1519;box-shadow:none;outline:0}
body #create.creation-hall .face-options button::after{content:'◇';position:absolute;top:-.85cqw;left:calc(50% - .5cqw);color:#d7b274;font:1.2cqw Georgia,serif;text-shadow:0 2px 4px #000}
body #create.creation-hall .creation-step-panel .face-options img{display:block;width:100%;height:100%;object-fit:cover;image-rendering:auto;border:1px solid #a98b55}
body #create.creation-hall .face-options button[aria-pressed=true]{background:#634b26;box-shadow:0 0 12px #f2b84190,0 0 26px #e8ac3c38}
body #create.creation-hall .face-options button[aria-pressed=true]::before{opacity:1;filter:brightness(1.65) drop-shadow(0 0 3px #ffc95e)}
body #create.creation-hall .face-options button[aria-pressed=true]::after{color:#ffe6a4;text-shadow:0 0 8px #ffbb3a}
body #create.creation-hall .face-options button:hover{filter:brightness(1.12)}
body #create.creation-hall .face-options button:focus-visible{outline:0;filter:brightness(1.15) drop-shadow(0 0 4px #ffe3a1)}
body #create.creation-hall .face-pagination{display:flex;align-items:center;justify-content:center;gap:1.2cqw;flex:none;height:3.8cqw;margin:.6cqw 0;color:#bba57e;font:12px Tahoma,sans-serif}
body #create.creation-hall .face-pagination button{display:grid;place-items:center;min-width:32px;min-height:32px;padding:0;border:0;border-radius:0;background:none;color:#e4c58a;font:26px Georgia,serif}
body #create.creation-hall .face-pagination button:disabled{opacity:.25;cursor:default}
body #create.creation-hall .create-actions{display:grid;grid-template-columns:1fr 1fr 1.55fr;gap:1.7cqw;flex:none;margin:0;padding:1.8cqw 0 0;border-top:1px solid #c6a3648a}
body #create.creation-hall .create-actions button{width:100%;min-width:0;min-height:4.8cqw;margin:0;padding:.8cqw 1.5cqw;border:0;border-radius:0;box-shadow:none;color:#ead9b6;font:1.2cqw 'Leelawadee UI',Tahoma,sans-serif;clip-path:none;filter:none}
body #create.creation-hall #create-confirm{width:100%;min-width:0;color:#271e12;font-size:2cqw;font-weight:600;text-shadow:0 1px #fff5}
body #create.creation-hall .create-actions #create-back{margin:0;font:1.2cqw 'Leelawadee UI',Tahoma,sans-serif}
body #create.creation-hall #create-confirm::before,body #create.creation-hall #create-confirm::after{display:none}
@media(max-width:700px) and (orientation:portrait){
 body #create.creation-hall #creation-subtitle{margin:4px 0 12px;min-height:3em;font-size:12px}
 body #create.creation-hall{width:calc(100% - 24px);height:80dvh;min-height:630px;margin:14dvh auto 24px;padding:20px 16px;max-height:none;overflow:visible}
 body #create.creation-hall::after{font-size:24px;top:-16px;left:calc(50% - 10px)}
 body #create.creation-hall .creation-stage-header>.eyebrow{flex-wrap:wrap;gap:12px;padding-bottom:12px;font-size:9px;letter-spacing:1px}
 body #create.creation-hall .language-picker{margin-left:auto;font-size:11px}
 body #create.creation-hall h2{font-size:48px;margin-top:12px}
 body #create.creation-hall .creation-step-panel .face-options{width:100%;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));gap:10px;align-content:center;padding:6px;flex:1}
 body #create.creation-hall .face-options button{padding:5px;width:auto;height:100%;max-width:100%;max-height:130px;justify-self:center;aspect-ratio:200/250}
 body #create.creation-hall .face-options button::after{font-size:16px;top:-10px;left:calc(50% - 6px)}
 body #create.creation-hall .face-pagination{height:36px;gap:16px;margin:8px 0}
 body #create.creation-hall .create-actions{grid-template-columns:1fr 1fr;gap:10px;padding-top:14px}
 body #create.creation-hall .create-actions button{min-height:42px;font-size:13px}
 body #create.creation-hall .create-actions #create-back{font-size:13px}
 body #create.creation-hall #create-confirm{grid-column:1/-1;grid-row:1;min-height:54px;font-size:20px}
}

/* Profession choices use actual gathering rules and inventory atlas sprites. */
body #create.job-stage #creation-options{flex-wrap:nowrap;align-items:stretch;align-content:normal}
body #create.job-stage .job-step-panel{display:flex;flex-direction:column;flex:1;min-height:0;min-width:0;width:100%}
body #create.job-stage .job-layout{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1.7cqw;flex:1;min-height:0;min-width:0;width:100%;padding:0 .4cqw 1cqw}
body #create.job-stage .job-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));gap:1.2cqw;min-height:0}
body #create.job-stage .job-card{position:relative;isolation:isolate;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-end;gap:.5cqw;width:100%;min-width:0;min-height:0;padding:1.2cqw 1.7cqw;border:0;border-radius:0;background:#142027 url('../../assets/front/profession-scenes.png') var(--job-art-x) var(--job-art-y)/200% 300% no-repeat;color:#f5e9cc;box-shadow:none;outline:0;text-align:left}
body #create.job-stage .job-detail::before{content:'';position:absolute;inset:0;z-index:2;pointer-events:none;border:12px solid transparent;border-image:url('../../assets/front/selection-frame.svg') 20 stretch}
body #create.job-stage .job-card::after{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(90deg,#050d16a3,transparent),linear-gradient(0deg,#02080ee6,transparent 90%)}
body #create.job-stage .job-card strong{font:600 1.5cqw/1.4 'Leelawadee UI',Tahoma,sans-serif;text-shadow:0 2px 5px #000}
body #create.job-stage .job-tool{display:flex;align-items:center;height:32px;filter:drop-shadow(0 2px 4px #000)}
body #create.job-stage .job-card[aria-pressed=true]{box-shadow:0 0 8px #ffc359b0,0 0 23px #e6ac4938;color:#ffe2a2}
body #create.job-stage .job-card[aria-pressed=true]::before{filter:brightness(1.6) drop-shadow(0 0 3px #ffcf70)}
body #create.job-stage .job-card:hover{filter:brightness(1.15)}
body #create.job-stage .job-card:focus-visible{outline:0;filter:brightness(1.2) drop-shadow(0 0 4px #ffe3a1)}
body #create.job-stage .job-detail{position:relative;isolation:isolate;min-width:0;min-height:0;display:flex;align-items:flex-end;padding:2cqw;background:#080f14;border:0;color:#e6e2d6}
body #create.job-stage .job-illustration{position:absolute;inset:.7cqw .7cqw auto;height:60%;z-index:-1;background:#142027 url('../../assets/front/profession-scenes.png') var(--job-art-x) var(--job-art-y)/200% 300% no-repeat}
body #create.job-stage .job-illustration::after{content:'';position:absolute;inset:0;background:linear-gradient(0deg,#080f14 0%,#080f1433 90%),linear-gradient(90deg,#080f14a0,transparent)}
body #create.job-stage .job-description{position:relative;width:100%}
body #create.job-stage .job-description p{height:3lh;min-height:3lh;overflow:auto;margin:0 0 1cqw;font:1.4cqw/1.8 'Leelawadee UI',Tahoma,sans-serif;color:#deddd4}
body #create.job-stage .job-description h4{margin:0 0 1cqw;padding-top:1cqw;border-top:1px solid #b99b5b4d;color:#e6c584;font:600 1.4cqw 'Leelawadee UI',Tahoma,sans-serif}
body #create.job-stage .job-products{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:1cqw;list-style:none;margin:0;padding:0;align-items:start}
body #create.job-stage .job-products li{flex:0 1 calc((100% - 4cqw)/5);min-width:0;text-align:center}
body #create.job-stage .job-product-icon{display:grid;place-items:center;aspect-ratio:1;min-height:44px;border:1px solid #9e9477;border-radius:3px;background:linear-gradient(135deg,#1c242c,#060b10);box-shadow:inset 0 0 0 3px #090f16}
.creation-item-icon{display:inline-block;flex:none;background-repeat:no-repeat;image-rendering:pixelated}
body #create.job-stage .job-description h4 small{margin-left:.6em;color:#b1a184;font:10px Tahoma,sans-serif;white-space:nowrap}
body #create.job-stage .job-product-rank{display:block;margin-top:3px;color:#c8ae78;font:9px/1.4 Tahoma,sans-serif;white-space:nowrap}
body #create.job-stage .job-product-name{display:block;min-height:2lh;margin-top:5px;color:#bdc5bf;font:10px/1.3 Tahoma,sans-serif;overflow-wrap:anywhere}
@media(max-width:700px) and (orientation:portrait){
 body #create.job-stage .job-layout{grid-template-columns:1fr;grid-template-rows:1fr auto;gap:14px;padding:0 2px 12px;overflow-y:auto}
 body #create.job-stage .job-options{gap:10px;min-height:245px}
 body #create.job-stage .job-card{padding:10px 12px;gap:4px}
 body #create.job-stage .job-card strong{font-size:14px}
 body #create.job-stage .job-tool{height:24px;transform:scale(.8);transform-origin:left center}
 body #create.job-stage .job-detail{padding:16px;min-height:230px}
 body #create.job-stage .job-description p{font-size:12px;min-height:3lh;margin-bottom:10px}
 body #create.job-stage .job-description h4{font-size:13px;padding-top:10px;margin-bottom:10px}
 body #create.job-stage .job-products{gap:8px}
 body #create.job-stage .job-products li{flex-basis:calc((100% - 32px)/5)}
 body #create.job-stage .job-product-icon{min-height:36px}
 body #create.job-stage .job-product-icon .creation-item-icon{transform:scale(.75)}
 body #create.job-stage .job-product-name{font-size:8px}
}
@media(max-height:500px) and (orientation:landscape){
 body #create.creation-hall #creation-subtitle{margin:0 0 6px;min-height:1.5em;font-size:10px}
 body #create.job-stage .job-layout{gap:12px;padding-bottom:6px}
 body #create.job-stage .job-options{gap:7px}
 body #create.job-stage .job-card{padding:6px 10px;gap:0}
 body #create.job-stage .job-tool{position:absolute;right:10px;top:10px;transform:scale(.7);transform-origin:top right}
 body #create.job-stage .job-card strong{font-size:11px}
 body #create.job-stage .job-detail{padding:12px}
 body #create.job-stage .job-description p{font-size:9px;line-height:1.5;min-height:3lh;margin-bottom:4px}
 body #create.job-stage .job-description h4{font-size:10px;padding-top:5px;margin-bottom:5px}
 body #create.job-stage .job-products{gap:6px}
 body #create.job-stage .job-product-icon{min-height:25px}
 body #create.job-stage .job-product-icon .creation-item-icon{transform:scale(.6)}
 body #create.job-stage .job-product-name{font-size:7px;margin-top:2px}
}
@media(max-height:500px) and (orientation:landscape){
 body #create.creation-hall{width:80vw;height:82dvh;margin:14dvh auto 0;padding:1vw 2vw}
 body #create.creation-hall .creation-stage-header>.eyebrow{min-height:30px;padding-bottom:4px;font-size:8px;letter-spacing:1px}
 body #create.creation-hall .language-picker{font-size:10px}
 body #create.creation-hall .language-picker select{min-height:26px;padding:3px 6px}
 body #create.creation-hall h2{font-size:36px;margin:4px 0 0}
 body #create.creation-hall .creation-step-panel .face-options{width:100%;grid-template-columns:repeat(6,minmax(0,12cqw));gap:14px;padding:4px}
 body #create.creation-hall .face-options button{padding:5px}
 body #create.creation-hall .face-pagination{height:24px;margin:2px 0;font-size:10px}
 body #create.creation-hall .face-pagination button{min-height:24px;font-size:20px}
 body #create.creation-hall .create-actions{padding-top:6px;gap:12px}
 body #create.creation-hall .create-actions button{min-height:36px;font-size:11px}
 body #create.creation-hall .create-actions #create-back{font-size:11px}
 body #create.creation-hall #create-confirm{min-height:36px;font-size:18px;padding:4px 12px}
}

/* Spell selection uses the existing hall, choice-card frame and action components. */
body #create.spell-stage #creation-options{flex-wrap:nowrap;align-items:stretch;align-content:normal}
body #create.spell-stage .spell-step-panel{display:flex;flex-direction:column;flex:1;min-height:0;width:100%}
body #create.spell-stage .spell-school-options{display:flex;align-items:stretch;justify-content:center;gap:3cqw;flex:1;min-height:0;padding:.6cqw 0 1cqw}
body #create.spell-stage .spell-school-card{--school-light:#9b89ec;position:relative;isolation:isolate;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.7cqw;width:32cqw;min-width:0;min-height:0;padding:1.6cqw 2cqw;border:0;border-radius:0;outline:0;background:radial-gradient(ellipse at 50% 25%,#64558b33,transparent 65%),linear-gradient(135deg,#18212d,#090f17);color:#e6dfd2;box-shadow:none;text-align:center}
body #create.spell-stage .spell-school-card[data-value=priest]{--school-light:#8ed9d5;background:radial-gradient(ellipse at 50% 25%,#528b8738,transparent 65%),linear-gradient(135deg,#172a2c,#090f17)}
body #create.spell-stage .spell-school-caption{font:.8cqw Georgia,serif;letter-spacing:.35cqw;color:#c2ad7e}
body #create.spell-stage .spell-school-sigil{display:grid;place-items:center;flex:none;min-height:40px;height:9cqw;max-height:9cqw;width:9cqw;aspect-ratio:1;border:1px solid #c7ac6d77;border-radius:50%;font:6cqw Georgia,serif;color:var(--school-light);text-shadow:0 0 22px var(--school-light);box-shadow:0 0 0 5px #c7ac6d09,0 0 0 6px #c7ac6d33,inset 0 0 28px #ffffff08;margin:.4cqw 0}
body #create.spell-stage .spell-school-card strong{font:600 2.1cqw/1.4 'Leelawadee UI',Tahoma,sans-serif;color:#ffe2a7}
body #create.spell-stage .spell-school-description{min-height:3em;font:1.2cqw/1.5 'Leelawadee UI',Tahoma,sans-serif;color:#d4d5d0}
body #create.spell-stage .spell-school-examples-label{font:.9cqw 'Leelawadee UI',Tahoma,sans-serif;color:#baa77f}
body #create.spell-stage .spell-school-examples{display:flex;justify-content:center;gap:.7cqw}
body #create.spell-stage .spell-school-examples>span{display:grid;place-items:center;width:3.5cqw;height:3.5cqw;border:1px solid #a68c5c80;background:#070d13}
body #create.spell-stage .spell-school-examples img{display:block;width:85%;height:85%;object-fit:contain;image-rendering:pixelated}
body #create.spell-stage .spell-school-selection{font:1cqw/1.5 'Leelawadee UI',Tahoma,sans-serif;color:#adab9f}
body #create.spell-stage .spell-school-card[aria-pressed=true]{box-shadow:0 0 10px #e9bc6b70,inset 0 0 35px #e4ba5e12}
body #create.spell-stage .spell-school-card[aria-pressed=true]::before{opacity:1;filter:brightness(1.6) drop-shadow(0 0 3px #ffcf70)}
body #create.spell-stage .spell-school-card[aria-pressed=true] .spell-school-selection{color:#ffe2a7}
body #create.spell-stage .spell-school-card:hover{filter:brightness(1.12)}
body #create.spell-stage .spell-school-card:focus-visible{outline:0;filter:brightness(1.15) drop-shadow(0 0 4px #ffe3a1)}
body #create.spell-stage .spell-school-hint{flex:none;min-height:1.5em;margin:.3cqw 0 1cqw;color:#bcbaa9;font:1cqw/1.5 'Leelawadee UI',Tahoma,sans-serif;text-align:center}
@media(max-width:700px) and (orientation:portrait){
 body #create.spell-stage .spell-school-options{gap:14px;padding:4px 0 12px}
 body #create.spell-stage .spell-school-card{width:calc((100% - 14px)/2);padding:18px 10px;gap:10px}
 body #create.spell-stage .spell-school-card:only-child{width:min(280px,100%)}
 body #create.spell-stage .spell-school-caption{font-size:10px;letter-spacing:2px}
 body #create.spell-stage .spell-school-sigil{width:70px;height:70px;max-height:70px;font-size:48px;margin:6px 0}
 body #create.spell-stage .spell-school-card strong{font-size:20px}
 body #create.spell-stage .spell-school-description{font-size:11px;min-height:4.5em}
 body #create.spell-stage .spell-school-examples-label{font-size:10px}
 body #create.spell-stage .spell-school-examples{gap:5px}
 body #create.spell-stage .spell-school-examples>span{width:28px;height:28px}
 body #create.spell-stage .spell-school-selection,body #create.spell-stage .spell-school-hint{font-size:11px}
}
@media(max-height:500px) and (orientation:landscape){
 body #create.spell-stage .spell-school-options{gap:20px;padding:2px 0 4px}
 body #create.spell-stage .spell-school-card{padding:8px 18px;gap:3px}
 body #create.spell-stage .spell-school-caption{font-size:8px;letter-spacing:2px}
 body #create.spell-stage .spell-school-sigil{position:absolute;right:14px;top:10px;width:45px;height:45px;max-height:45px;min-height:0;font-size:30px;opacity:.35;z-index:-1}
 body #create.spell-stage .spell-school-card strong{font-size:18px}
 body #create.spell-stage .spell-school-description{font-size:10px;min-height:3em}
 body #create.spell-stage .spell-school-examples-label{display:none}
 body #create.spell-stage .spell-school-examples>span{width:26px;height:26px}
 body #create.spell-stage .spell-school-selection,body #create.spell-stage .spell-school-hint{font-size:10px}
}

/* Final step shares the hall shell, header, frame and action components. */
body #create.name-stage #creation-options{flex-wrap:nowrap;align-items:stretch;align-content:normal}
body #create.name-stage .creation-main{position:relative;padding-bottom:24px}
body #create.name-stage #create-error{position:absolute;left:0;right:0;bottom:0;margin:0;text-align:center;font:12px/1.5 'Leelawadee UI',Tahoma,sans-serif;color:#ffb7a0}
body #create.name-stage .name-step-panel{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.4fr);align-items:center;gap:5cqw;flex:1;min-height:0;width:84%;margin:0 auto}
body #create.name-stage .name-character-card{display:flex;flex-direction:column;align-items:center;min-height:0;gap:1cqw;padding:1cqw 0}
body #create.name-stage .name-portrait-frame{position:relative;width:12cqw;aspect-ratio:200/250;padding:.8cqw;background:#111b22;filter:drop-shadow(0 0 12px #b9984e30)}
body #create.name-stage .name-portrait-frame img{display:block;width:100%;height:100%;object-fit:cover;border:1px solid #aa8b52;image-rendering:auto}
body #create.name-stage #name-summary-title{max-width:100%;margin:0;color:#ffe3a7;font:600 1.8cqw/1.4 'Leelawadee UI',Tahoma,sans-serif;overflow-wrap:anywhere}
body #create.name-stage .name-character-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8cqw 1.4cqw;width:100%;margin:0;padding:1cqw 0;border-block:1px solid #c6a36455}
body #create.name-stage .name-character-summary>div{min-width:0;text-align:center}
body #create.name-stage .name-character-summary dt{margin:0;color:#a99a7c;font:.9cqw/1.4 'Leelawadee UI',Tahoma,sans-serif}
body #create.name-stage .name-character-summary dd{margin:.3cqw 0 0;color:#e6ddca;font:1.2cqw/1.4 'Leelawadee UI',Tahoma,sans-serif}
body #create.name-stage .name-entry-panel{min-width:0;padding:2cqw 0}
body #create.name-stage .name-entry-caption{display:block;margin-bottom:1.4cqw;color:#bb9c60;font:.8cqw Georgia,serif;letter-spacing:.25cqw}
body #create.name-stage .name-entry-panel .field-caption{margin:0 0 1cqw;color:#f1d59d;font:600 1.5cqw/1.5 'Leelawadee UI',Tahoma,sans-serif}
body #create.name-stage #create-name{display:block;width:100%;min-height:4.7cqw;max-width:none;margin:0;padding:1cqw 1.3cqw;border:1px solid #a68953;border-radius:0;background:linear-gradient(135deg,#15212c,#080f17);box-shadow:inset 0 0 0 3px #090e15;color:#ffe7b4;font:1.5cqw/1.5 'Leelawadee UI',Tahoma,sans-serif;letter-spacing:.05cqw}
body #create.name-stage #create-name::placeholder{color:#7d8b8e}
body #create.name-stage #create-name:focus-visible{outline:0;border-color:#f5d18b;box-shadow:inset 0 0 0 3px #090e15,0 0 16px #ddb96933}
body #create.name-stage .name-input-help{display:flex;justify-content:space-between;gap:12px;margin:.7cqw 0 0;color:#b9b4a3;font:.9cqw/1.5 'Leelawadee UI',Tahoma,sans-serif}
body #create.name-stage .name-input-help small{font:inherit}
body #create.name-stage .name-entry-description{margin:2cqw 0 0;color:#d0d0c6;font:1.15cqw/1.9 'Leelawadee UI',Tahoma,sans-serif}
body #create.name-stage .name-save-note{margin:1.4cqw 0 0;padding-top:1cqw;border-top:1px solid #b4995b40;color:#a99a7b;font:.9cqw/1.5 'Leelawadee UI',Tahoma,sans-serif}
@media(max-width:700px) and (orientation:portrait){
 body #create.name-stage .name-step-panel{width:100%;grid-template-columns:1fr;grid-template-rows:auto auto;align-content:start;gap:16px;padding:4px 0 10px;overflow-y:auto}
 body #create.name-stage .name-character-card{display:grid;grid-template-columns:74px minmax(0,1fr);grid-template-rows:auto auto;min-height:124px;gap:8px 14px;padding:0}
 body #create.name-stage .name-portrait-frame{grid-row:1/3;width:74px;padding:5px}
 body #create.name-stage #name-summary-title{font-size:17px;text-align:left}
 body #create.name-stage .name-character-summary{gap:8px;padding:8px 0}
 body #create.name-stage .name-character-summary>div{text-align:left}
 body #create.name-stage .name-character-summary dt{font-size:10px}
 body #create.name-stage .name-character-summary dd{font-size:12px}
 body #create.name-stage .name-entry-panel{padding:0}
 body #create.name-stage .name-entry-caption{font-size:9px;letter-spacing:2px;margin-bottom:10px}
 body #create.name-stage .name-entry-panel .field-caption{font-size:15px;margin-bottom:8px}
 body #create.name-stage #create-name{font-size:17px;min-height:50px;padding:10px 12px}
 body #create.name-stage .name-input-help{font-size:11px;margin-top:6px}
 body #create.name-stage .name-entry-description{font-size:12px;margin-top:12px}
 body #create.name-stage .name-save-note{font-size:10px;margin-top:10px;padding-top:8px}
}
@media(max-height:500px) and (orientation:landscape){
 body #create.name-stage .name-step-panel{width:94%;gap:24px}
 body #create.name-stage .name-character-card{display:grid;grid-template-columns:74px minmax(0,1fr);grid-template-rows:auto auto;gap:6px 12px;padding:0}
 body #create.name-stage .name-portrait-frame{grid-row:1/3;width:74px;padding:5px}
 body #create.name-stage #name-summary-title{font-size:15px;text-align:left}
 body #create.name-stage .name-character-summary{gap:6px;padding:6px 0}
 body #create.name-stage .name-character-summary>div{text-align:left}
 body #create.name-stage .name-character-summary dt{font-size:9px}
 body #create.name-stage .name-character-summary dd{font-size:10px}
 body #create.name-stage .name-entry-panel{padding:0}
 body #create.name-stage .name-entry-caption{font-size:8px;margin-bottom:4px}
 body #create.name-stage .name-entry-panel .field-caption{font-size:12px;margin-bottom:5px}
 body #create.name-stage #create-name{font-size:14px;min-height:36px;padding:6px 10px}
 body #create.name-stage .name-input-help{font-size:9px;margin-top:4px}
 body #create.name-stage .name-entry-description{font-size:9px;line-height:1.5;margin-top:6px}
 body #create.name-stage .name-save-note{font-size:9px;margin-top:5px;padding-top:4px}
 body #create.name-stage .creation-main{padding-bottom:18px}
 body #create.name-stage #create-error{font-size:10px}
}
