@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&display=swap');
.stage{min-height:650px}.stage-top{align-items:flex-start;gap:24px}.stage-title{padding:12px 8px;max-width:calc(100% - 520px);text-shadow:0 3px 18px #000,0 1px 4px #000}.stage-title .eyebrow{font-size:13px;letter-spacing:3px;color:#e6d4ab;margin-bottom:12px}.stage-title h1{font-family:'Cinzel',Georgia,serif;font-size:clamp(36px,4.5vw,74px);font-weight:600;line-height:1.15;letter-spacing:.015em;color:#fff2d5;overflow-wrap:anywhere}.stage-tools{flex-shrink:0}.enemy-field{position:absolute;z-index:2;left:46%;right:5%;top:24%;bottom:255px;display:flex;justify-content:center;align-items:center;gap:22px;overflow:auto;padding:15px}.combatant{display:flex;flex-direction:column;align-items:center;gap:0;background:transparent;border:0;border-radius:0;min-width:0;padding:8px 10px;text-align:center;text-shadow:0 2px 8px #000;flex-shrink:0}.combatant .portrait-wrap{position:relative}.combatant .avatar{display:grid;place-items:center;width:86px;height:86px;font-size:38px;box-shadow:0 5px 25px #0007;background:radial-gradient(ellipse at 35% 25%,#536c50,#172b26 75%);border:2px solid #dbbe88bd;position:relative;overflow:hidden}.combatant img.avatar{display:block;object-fit:cover}.combatant-name{display:block;font-family:'Cinzel',Georgia,serif;font-size:15px;max-width:170px;overflow-wrap:anywhere;color:#fff0d5;margin-top:9px;line-height:1.3}.combatant .hp{justify-content:center;margin-top:7px;gap:9px}.combatant .hp button{width:27px;height:27px;line-height:1;background:#10231ce0;border:1px solid #eddfb640;border-radius:50%;font-size:18px}.hp-value{font-size:19px;font-weight:700;color:#e8f0d8;font-variant-numeric:tabular-nums;min-width:46px}.hp-value small{font-size:9px;color:#c4d3b8}.combatant .healthbar{width:95px;height:5px;margin-top:8px;background:#0007;box-shadow:0 1px 3px #000a}.combatant .healthbar span{background:#b6cd9f;transition:width .2s}.combatant.dead{opacity:.6;filter:grayscale(.8)}.enemy{padding:20px 24px}.enemy .avatar{width:clamp(190px,20vw,300px);height:clamp(190px,20vw,300px);font-size:110px;border:3px solid #c3ad82;box-shadow:0 15px 65px #0009,0 0 35px #dbc09012;background:radial-gradient(ellipse at 40% 25%,#52584b,#1c2620 80%)}.enemy .combatant-name{font-size:clamp(22px,2.4vw,35px);max-width:340px;margin-top:16px}.enemy .hp{gap:17px;margin-top:12px}.enemy .hp-value{font-size:30px;min-width:68px}.enemy .hp-value small{font-size:11px}.enemy .hp button{width:34px;height:34px;font-size:23px}.enemy .healthbar{width:75%;min-width:155px;height:7px;background:#160e0da1}.enemy .healthbar span{background:linear-gradient(90deg,#a96b55,#e4b091)}.combatant .remove,.combatant .edit-player{position:absolute;top:0;right:-5px;width:27px;height:27px;border-radius:50%;background:#14251ddc;border:1px solid #ffffff35;color:#d9ddc5;padding:0;font-size:17px;display:grid;place-items:center;text-shadow:none}.combatant .edit-player{font-size:13px;width:24px;height:24px}.enemy .remove{width:30px;height:30px;top:8px;right:8px}.enemy-field.multiple{justify-content:flex-start;align-items:center}.enemy-field.multiple .enemy .avatar{width:clamp(160px,16vw,235px);height:clamp(160px,16vw,235px);font-size:85px}.enemy-field.multiple .enemy{padding:12px}.enemy-field.multiple .combatant-name{font-size:24px;max-width:240px}.party{align-items:center;gap:18px;min-height:182px;padding:0 2px 17px;max-width:100%;scrollbar-color:#a7b49844 transparent}.add-player{border:0;background:transparent;display:flex;align-items:center;flex-direction:column;gap:12px;padding:0 12px;flex-shrink:0;align-self:center;color:#dfd5b9}.add-player>span{display:grid;place-items:center;border-radius:50%;width:72px;height:72px;border:1px dashed #e5d7b689;background:#13251c80;font-size:36px}.add-player small{font-size:11px;color:#e0d6bd}.add-player:hover{background:transparent;border:0;color:white}.add-player:hover>span{background:#364937aa}.stage-bottom{bottom:20px}.stage-actions{gap:9px}.gender-mark{position:absolute;bottom:1px;right:6px;font-size:15px;color:#f6e5bd}.role-healer{color:#d1e6b7}.role-tank{color:#e1c89c}.role-controller{color:#c7c9f0}.avatar{position:relative}.avatar .gender-mark{font-size:13px}.character-options{border:0;padding:0;margin:23px 0}.character-options legend{font-size:12px;color:#c7d2c8;margin-bottom:10px}.class-choices{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.class-choice{display:flex;flex-direction:column;align-items:center;gap:9px;border:1px solid #ffffff20;border-radius:10px;padding:14px 7px;cursor:pointer;position:relative;background:#0f1e184d}.class-choice input,.gender-choice input{width:16px;height:16px;accent-color:#dfb879;margin:0;position:absolute;top:8px;left:8px}.class-icon{font-size:36px;color:var(--accent)}.class-choice strong{font-size:12px}.class-choice:has(input:checked),.gender-choice:has(input:checked){border-color:var(--accent);background:#dfb87912}.class-choice:focus-within,.gender-choice:focus-within{outline:2px solid var(--accent);outline-offset:3px}.gender-choices{display:flex;gap:10px}.gender-choice{flex:1;border:1px solid #ffffff20;border-radius:8px;padding:13px;text-align:center;position:relative;cursor:pointer}.gender-choice span{display:block;font-size:14px}.gender-choice input{top:15px;left:14px}.problem-tools{margin:5px 0 15px;gap:8px}.problem-tools button{font-size:12px}.math-help{margin:0 0 20px;max-width:900px}.math-help code{color:var(--accent);background:#ffffff09;padding:2px 5px;border-radius:4px}.problem-table-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:10px;background:#15231d}.problem-table{width:100%;border-collapse:collapse;min-width:800px;table-layout:fixed}.problem-table th{padding:14px 12px;font-size:11px;letter-spacing:.6px;color:#c7d5c5;background:#1c2c24;text-align:left;font-weight:600}.problem-table th:first-child{width:42px}.problem-table th:nth-child(2){width:16%}.problem-table th:nth-child(3){width:34%}.problem-table th:nth-child(4){width:20%}.problem-table th:last-child{width:58px}.problem-table td{padding:7px;vertical-align:top;border-top:1px solid var(--line)}.problem-table .row-number{color:#94a995;font-size:12px;padding-top:22px;text-align:center}.problem-table textarea{margin:0;border:1px solid transparent;background:#0f1e1866;min-height:93px;height:100%;font-size:13px;line-height:1.5;padding:9px;resize:vertical}.problem-table textarea:hover{border-color:#ffffff17}.table-row-actions button{display:block;margin:3px auto 6px}.math-dialog{width:min(920px,94vw)}.math-card .question{font-family:'DM Sans',system-ui,sans-serif;font-size:clamp(24px,3vw,40px);line-height:1.9;white-space:normal;overflow-x:auto;padding:15px 0}.math-card .katex{font-size:1.15em}.math-dialog .answer{white-space:normal;line-height:2}.katex-display{margin:.6em 0;overflow-x:auto;overflow-y:hidden;padding:8px 0}.math-error{color:#ffb09e;border-bottom:1px dashed #ffb09e;font:16px monospace;white-space:pre-wrap}.json-dialog{width:min(760px,94vw)}.json-dialog textarea[name=json]{min-height:240px;font:13px/1.6 Consolas,monospace;tab-size:2}.json-dialog #generation-prompt{min-height:300px;font:13px/1.7 'DM Sans',sans-serif}.json-preview{margin-top:20px}.import-preview-row{border-top:1px solid var(--line);padding:15px 0}.import-preview-row>div{margin-top:9px;line-height:2}.hidden-ui .enemy-field{opacity:0;pointer-events:none}#hint-slot{font-size:18px;line-height:2;margin:12px 0;color:#d6ddc1}
@media(max-width:1100px){.stage-title{max-width:48%}.stage-title h1{font-size:42px}.stage-tools{max-width:47%}.enemy-field{left:35%;right:3%;top:25%;bottom:250px}.enemy .avatar{width:210px;height:210px}.party{gap:8px}.enemy .combatant-name{font-size:25px}.combatant .avatar{width:75px;height:75px}.combatant-name{max-width:130px;font-size:13px}}
@media(max-width:700px){.stage{min-height:700px}.stage-top{gap:12px}.stage-title{max-width:100%;padding:6px}.stage-title h1{font-size:34px}.stage-title .eyebrow{font-size:10px;margin-bottom:6px}.stage-tools{max-width:none;flex-shrink:1;width:100%;padding:8px}.enemy-field{top:210px;bottom:260px;left:20%;right:3%;padding:0}.enemy .avatar{width:170px;height:170px;font-size:80px}.enemy .combatant-name{font-size:21px;margin-top:10px}.enemy .hp-value{font-size:24px}.enemy{padding:5px 12px}.enemy .hp{margin-top:8px}.enemy .hp button{width:28px;height:28px}.enemy-field.multiple .enemy .avatar{width:155px;height:155px}.enemy-field.multiple .combatant-name{font-size:19px}.party{min-height:165px;gap:10px;padding-bottom:12px}.combatant.player{padding:5px}.combatant .avatar{width:65px;height:65px;font-size:28px}.combatant-name{max-width:105px;font-size:12px}.combatant .hp{gap:5px}.combatant .hp button{width:23px;height:23px}.combatant .hp-value{font-size:17px;min-width:40px}.add-player{padding:0 8px}.add-player>span{width:57px;height:57px;font-size:28px}.stage-actions{gap:5px}.problem-tools{align-items:stretch}.problem-tools #table-save-status{width:100%;margin:5px 0}.class-choice strong{font-size:11px}.class-choices{gap:6px}.gender-mark{font-size:12px}}
@media(max-height:760px) and (min-width:701px){.stage{min-height:560px}.enemy-field{top:23%;bottom:210px}.enemy .avatar{width:180px;height:180px;font-size:80px}.enemy .combatant-name{font-size:24px;margin-top:10px}.enemy .hp-value{font-size:24px}.enemy .hp{margin-top:7px}.party{min-height:150px}.combatant.player .avatar{width:65px;height:65px}.stage-bottom{bottom:14px}}
