:root{
  --bg:#f6efe4;
  --bg2:#fffaf2;
  --panel:#fffdf8;
  --panel-2:#fff7ee;
  --line:#eadfce;
  --line-strong:#ddcfb8;
  --text:#2b2a2d;
  --muted:#706a63;
  --accent:#c78d3b;
  --accent-2:#f1c780;
  --accent-soft:#fff1d7;
  --danger:#cc6666;
  --radius:22px;
  --shadow:0 18px 50px rgba(109,78,31,.12);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  min-height:100vh;
  color:var(--text);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255,223,168,.45), transparent 28%),
    radial-gradient(circle at top right, rgba(196,226,255,.45), transparent 26%),
    linear-gradient(180deg,var(--bg2),var(--bg));
}
button,input,select{font:inherit}
button{cursor:pointer}
button:disabled{opacity:.5;cursor:not-allowed}
.site-header{height:78px;display:flex;align-items:center;justify-content:space-between;max-width:1460px;margin:auto;padding:0 24px}
.brand{display:flex;align-items:center;gap:12px;color:inherit;text-decoration:none}
.brand-mark{
  width:46px;height:46px;display:grid;place-items:center;
  clip-path:polygon(50% 0,90% 20%,100% 65%,70% 100%,30% 100%,0 65%,10% 20%);
  background:linear-gradient(145deg,#f4d8a7,#e7b76a);
  color:#5a3c18;font-weight:900;font-size:12px;border:1px solid #e0b56f;
  box-shadow:0 8px 18px rgba(181,127,39,.18)
}
.brand strong,.brand small{display:block}
.brand small{color:#8d8377;font-size:11px;margin-top:2px}
.top-actions{display:flex;gap:10px}
.ghost-btn,.mini-btn,.secondary-btn,.primary-btn,.tab,.preset,.frame-chip,.segmented button{transition:background .18s,border-color .18s,color .18s,box-shadow .18s,transform .18s}
.ghost-btn,.mini-btn,.secondary-btn{
  border:1px solid var(--line);
  background:#fff;
  color:#554f48;
  border-radius:12px;
  padding:9px 12px;
  box-shadow:0 4px 10px rgba(119,88,34,.04)
}
.ghost-btn:hover,.mini-btn:hover,.secondary-btn:hover{border-color:var(--line-strong);background:#fff9f0}
.mini-btn{padding:6px 9px;font-size:12px}
.mini-btn.active{background:var(--accent-soft);border-color:#e3be7a;color:#6b4a16}
.hero{max-width:1460px;margin:14px auto 26px;padding:34px 24px 12px;display:flex;justify-content:space-between;gap:30px;align-items:flex-end}
.hero-copy{max-width:860px}
.eyebrow{text-transform:uppercase;letter-spacing:.12em;font-weight:800;font-size:11px;color:#b47a2d;margin:0 0 10px}
.hero h1{font-family:Georgia,serif;font-size:clamp(38px,5vw,68px);line-height:1;margin:0 0 16px;letter-spacing:-.04em;color:#35261b}
.hero-text{font-size:18px;color:#625a51;max-width:780px;line-height:1.58;margin:0}
.trust-row{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;max-width:560px}
.trust-row span{background:#fff;border:1px solid var(--line);padding:8px 11px;border-radius:999px;color:#72695d;font-size:12px;box-shadow:0 6px 16px rgba(125,96,47,.05)}
.workspace{max-width:1460px;margin:auto;padding:0 24px;display:grid;grid-template-columns:300px minmax(400px,1fr) 360px;gap:14px;align-items:stretch}
.panel{
  background:linear-gradient(180deg,rgba(255,255,255,.9),rgba(255,250,243,.96));
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow)
}
.source-panel,.settings-panel{min-height:800px;overflow:hidden}
.editor-stage{display:flex;flex-direction:column;min-height:800px}
.panel-head{height:66px;padding:14px 16px;border-bottom:1px solid #eee2d2;display:flex;justify-content:space-between;align-items:center}
.panel-head>div:first-child{display:flex;align-items:center;gap:9px}.panel-head h2{font-size:15px;margin:0}
.step{width:24px;height:24px;border-radius:8px;display:inline-grid;place-items:center;background:#fff0d1;color:#8f611f;border:1px solid #e8c789;font-size:11px;font-weight:900}
.count-badge{font-size:11px;padding:4px 7px;border-radius:999px;background:#f9f0dd;color:#8f6c35}
.dropzone{margin:14px;padding:26px 14px;border:1px dashed #d8c3a6;border-radius:18px;display:flex;align-items:center;flex-direction:column;text-align:center;background:linear-gradient(180deg,#fffaf2,#fff5e8);transition:.2s}
.dropzone:hover,.dropzone.dragover{border-color:#d39a47;background:#fff4df}
.dropzone strong{font-size:14px;margin-bottom:4px;color:#3e3226}
.dropzone span{color:#766c61;font-size:12px}
.dropzone small{color:#9a8f83;margin-top:10px;font-size:11px}.upload-icon{font-size:28px!important;color:#cb8a33!important;margin-bottom:7px}
.source-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:0 14px 14px}.secondary-btn{font-size:12px}
.token-list{padding:0 10px 14px;max-height:550px;overflow:auto}.empty-list{text-align:center;color:#9a8f83;font-size:12px;padding:22px 8px}
.token-item{display:grid;grid-template-columns:48px 1fr auto;gap:9px;align-items:center;padding:8px;border:1px solid transparent;border-radius:14px;margin-bottom:6px;transition:.15s}
.token-item:hover{background:#fff6eb}.token-item.active{border-color:#ebd3aa;background:#fff4df}
.token-thumb{width:48px;height:48px;border-radius:50%;object-fit:cover;background:#eadfce}.token-meta{min-width:0}.token-meta strong,.token-meta small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.token-meta strong{font-size:12px}.token-meta small{font-size:10px;color:#8b8278;margin-top:3px}.delete-token{width:28px;height:28px;border:0;background:transparent;color:#a08d81;border-radius:8px}.delete-token:hover{background:#ffe7e5;color:#c76565}
.editor-head{flex:0 0 auto}.mode-switch{margin-left:auto}
.canvas-wrap{position:relative;display:grid;place-items:center;flex:1;min-height:500px;padding:34px;overflow:hidden;background:radial-gradient(circle,#fffdfb 0,#f7efe5 58%,#f1e6d9 100%)}
#tokenCanvas{width:min(58vh,500px);height:min(58vh,500px);max-width:100%;max-height:100%;border-radius:22px;filter:drop-shadow(0 26px 32px rgba(121,86,34,.17));touch-action:none}.canvas-wrap.large #tokenCanvas{width:min(72vh,620px);height:min(72vh,620px)}
.canvas-placeholder{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:center;align-items:center;pointer-events:none;color:#a29486}.canvas-placeholder.hidden{display:none}
.placeholder-d20{width:88px;height:88px;display:grid;place-items:center;clip-path:polygon(50% 0,90% 20%,100% 65%,70% 100%,30% 100%,0 65%,10% 20%);background:#fff3dc;border:1px solid #ecd3a3;color:#b77b2e;font-family:Georgia,serif;font-size:26px;margin-bottom:13px}.canvas-placeholder strong{color:#76695d;font-size:13px}.canvas-placeholder span:last-child{font-size:11px;margin-top:4px}
.transform-controls{border-top:1px solid #eee2d2;padding:14px 18px 16px;display:grid;grid-template-columns:1fr 1fr;gap:12px 18px}.transform-controls label{display:grid;grid-template-columns:72px 1fr;align-items:center;color:#7f7367;font-size:11px;gap:8px}.transform-controls input[type=range],.control-group input[type=range]{accent-color:#c78d3b;width:100%}
.insert-mode-group{grid-column:1/-1}
.control-mini-label{font-size:11px;color:#7d7266;margin-bottom:8px;font-weight:700}
.insert-mode{grid-template-columns:1fr 1fr;border:1px solid #ede0d0;background:#fff7ea}
.mode-note{margin:8px 0 0;color:#938676;font-size:10px;line-height:1.45}
.inline-actions{grid-column:1/-1;display:flex;gap:7px;flex-wrap:wrap}.drag-hint{grid-column:1/-1;margin:0;color:#938676;font-size:10px}
.settings-tabs{display:grid;grid-template-columns:1fr 1fr;padding:10px 12px 0;gap:4px}
.tab{border:1px solid transparent;background:transparent;color:#7d7368;padding:9px;border-radius:11px;font-size:11px}.tab.active{background:#fff7ea;border-color:#ecd8b6;color:#5d4930}
.settings-scroll{padding:5px 16px 18px}.control-group{padding:14px 0;border-bottom:1px solid #efe3d4}.control-label,.range-label{font-size:11px;color:#7d7266;margin-bottom:10px;display:flex;justify-content:space-between;align-items:center}.control-label small{color:#ab9986}
.preset-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.preset{border:1px solid #eadfcc;background:#fff;color:#665d54;border-radius:12px;padding:8px;display:flex;gap:7px;align-items:center;font-size:11px;text-align:left}.preset.active{border-color:#e0bf7f;background:#fff6e4;color:#7c561a;box-shadow:0 7px 16px rgba(210,160,77,.14)}
.swatch{width:16px;height:16px;border-radius:50%;border:3px solid #b89548;background:#171b23}.swatch.npc{border-color:#95a5b8;background:#eceff4}.swatch.monster{border-color:#bb5555;background:#ffe2df}.swatch.boss{border-color:#d3a638;background:#46222c}
.frame-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.frame-chip{display:flex;align-items:center;gap:8px;padding:9px 10px;border-radius:12px;border:1px solid #eadfcc;background:#fff;color:#655c53;text-align:left}
.frame-chip:hover{background:#fff8ee}.frame-chip.active{border-color:#dfbf85;background:#fff5e1;color:#734f19;box-shadow:0 8px 16px rgba(214,166,84,.16)}
.frame-chip span:last-child{font-size:11px;line-height:1.2}
.frame-preview{position:relative;width:22px;height:22px;border-radius:50%;display:inline-block;flex:0 0 22px;background:#fffaf1;border:4px solid currentColor;box-shadow:inset 0 0 0 2px rgba(255,255,255,.75)}
.frame-preview::after,.frame-preview::before{content:"";position:absolute;inset:-4px;border-radius:50%;pointer-events:none}
.frame-preview.classic{color:#cf9f46}.frame-preview.royal{color:#c2903d}.frame-preview.silver{color:#92a0b0}.frame-preview.arcane{color:#7f78d7}.frame-preview.forest{color:#5c9a61}.frame-preview.ember{color:#c95a44}.frame-preview.frost{color:#87b4d8}.frame-preview.shadow{color:#54586f}.frame-preview.bone{color:#baac90}.frame-preview.radiant{color:#e0b34a}.frame-preview.thorn{color:#8b6147}.frame-preview.dragon{color:#b24a3c}.frame-preview.relic{color:#b69a67}.frame-preview.celestial{color:#d7c278}.frame-preview.abyss{color:#5a6386}.frame-preview.ivy{color:#70975d}
.frame-preview.royal::after{box-shadow:0 -12px 0 -9px currentColor,12px 0 0 -9px currentColor,0 12px 0 -9px currentColor,-12px 0 0 -9px currentColor}
.frame-preview.silver::after{border:1px dashed currentColor;inset:-2px}.frame-preview.arcane::after{border:1px dashed currentColor;inset:-6px}
.frame-preview.forest::after{box-shadow:8px -5px 0 -8px currentColor,-8px -5px 0 -8px currentColor,0 10px 0 -8px currentColor}
.frame-preview.ember::after{border-top:3px solid currentColor;border-left:3px solid transparent;border-right:3px solid transparent;inset:auto;left:6px;right:6px;top:-7px;height:0}
.frame-preview.frost::after{box-shadow:0 0 0 2px rgba(255,255,255,.9),0 0 0 5px rgba(135,180,216,.25)}.frame-preview.shadow::after{border:2px solid rgba(72,79,102,.55);inset:-6px}
.frame-preview.bone::after{box-shadow:0 -11px 0 -8px currentColor,0 11px 0 -8px currentColor}
.frame-preview.radiant::after{box-shadow:0 -13px 0 -10px currentColor,13px 0 0 -10px currentColor,0 13px 0 -10px currentColor,-13px 0 0 -10px currentColor}
.frame-preview.thorn::after{border:2px dotted currentColor;inset:-5px}.frame-preview.dragon::after{box-shadow:0 -11px 0 -9px currentColor,9px -7px 0 -9px currentColor,-9px -7px 0 -9px currentColor}.frame-preview.relic::after{border:1px solid currentColor;inset:-6px;opacity:.65}
.frame-preview.celestial::after{box-shadow:0 -12px 0 -10px currentColor,12px 0 0 -10px currentColor,0 12px 0 -10px currentColor,-12px 0 0 -10px currentColor,8px 8px 0 -10px currentColor,-8px -8px 0 -10px currentColor}.frame-preview.abyss::after{border:2px dashed currentColor;inset:-5px}.frame-preview.ivy::after{box-shadow:8px -3px 0 -8px currentColor,-8px -3px 0 -8px currentColor,8px 6px 0 -8px currentColor,-8px 6px 0 -8px currentColor}
.segmented{display:grid;grid-template-columns:repeat(3,1fr);background:#fff7ea;padding:3px;border-radius:12px;border:1px solid #ede0d0}.segmented button{border:0;background:transparent;color:#7f7468;border-radius:9px;padding:8px 4px;font-size:11px}.segmented button.active{background:#fff;color:#4d3b24;box-shadow:0 6px 10px rgba(108,78,31,.08)}
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:10px}.two-col label,.field-label{display:flex;flex-direction:column;gap:7px;font-size:10px;color:#7d7266}.two-col input[type=color]{width:100%;height:36px;border:1px solid #eadfcc;background:#fff;border-radius:10px;padding:4px}
.switches{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}.switches label{font-size:10px;background:#fff;border:1px solid #eadfcc;border-radius:10px;padding:8px 6px;display:flex;align-items:center;gap:5px;color:#7a6f63}.switches input{accent-color:#c78d3b}
.divider-top{margin-top:4px}.field-label input,.field-label select,.export-controls select{background:#fff;color:#3c3935;border:1px solid #eadfcc;border-radius:10px;padding:10px 10px;min-width:0}.compact{margin-top:10px}
.export-panel{max-width:1412px;margin:14px auto 0;min-height:114px;padding:20px;display:flex;align-items:center;justify-content:space-between;gap:20px}.export-copy{display:flex;gap:12px;align-items:flex-start}.export-copy h2{font-size:16px;margin:0 0 5px}.export-copy p{font-size:11px;color:#85786b;margin:0}.export-controls{display:flex;align-items:flex-end;gap:9px;flex-wrap:wrap;justify-content:flex-end}.export-controls label{display:flex;flex-direction:column;gap:5px;color:#7d7266;font-size:10px}.export-controls select{height:40px}
.primary-btn{border:1px solid #e1d3be;background:#fff;color:#564737;border-radius:12px;height:40px;padding:0 15px;font-weight:800;font-size:11px;box-shadow:0 7px 16px rgba(108,78,31,.06)}.primary-btn:hover{background:#fff7ec;border-color:#d8c1a0}.primary-btn.accent{background:linear-gradient(#f2c989,#deab56);color:#4f3512;border-color:#e7bc72}
.feature-strip{max-width:1412px;margin:18px auto;padding:0;display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.feature-strip article{border:1px solid var(--line);background:rgba(255,255,255,.8);border-radius:16px;padding:16px}.feature-strip strong,.feature-strip span{display:block}.feature-strip strong{font-size:12px}.feature-strip span{font-size:10px;color:#7e7468;margin-top:5px;line-height:1.5}
.seo-content,.faq{max-width:1050px;margin:90px auto;padding:0 24px}.seo-content{display:grid;grid-template-columns:.8fr 1.2fr;gap:60px}.seo-content h2,.faq h2{font-family:Georgia,serif;font-size:36px;line-height:1.08;margin:0;color:#35261b}.seo-content ol{margin:0;padding-left:20px}.seo-content li{margin-bottom:18px;color:#6f675e;line-height:1.6;font-size:14px}.seo-content li strong{color:#2f2d2b}
.faq{margin-top:70px}.faq h2{margin-bottom:24px}.faq details{border-top:1px solid #eadfce;padding:16px 0}.faq details:last-child{border-bottom:1px solid #eadfce}.faq summary{cursor:pointer;font-weight:700;font-size:14px}.faq p{color:#6e675e;line-height:1.6;font-size:13px;max-width:820px}
footer{max-width:1412px;margin:80px auto 0;border-top:1px solid #eadfce;padding:30px 24px 50px;display:flex;justify-content:space-between;color:#877b6d;font-size:11px}footer strong{color:#4d4133}
.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%) translateY(20px);background:#5a3d17;color:#fff7e8;padding:11px 14px;border-radius:12px;font-weight:800;font-size:11px;opacity:0;pointer-events:none;transition:.2s;z-index:20;box-shadow:0 16px 30px rgba(90,61,23,.2)}.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

@media(max-width:1180px){
  .workspace{grid-template-columns:270px 1fr}
  .settings-panel{grid-column:1/-1;min-height:auto}
  .settings-scroll{display:grid;grid-template-columns:repeat(3,1fr);gap:0 18px}
  .control-group{padding:12px 0}
  .hero{align-items:flex-start;flex-direction:column}
  .trust-row{justify-content:flex-start}
  .export-panel{margin-left:24px;margin-right:24px}
  .feature-strip{margin-left:24px;margin-right:24px}
}
@media(max-width:760px){
  .site-header{padding:0 14px}
  .brand small{display:none}
  .hero{padding:22px 16px 8px}
  .hero h1{font-size:42px}
  .hero-text{font-size:15px}
  .workspace{display:flex;flex-direction:column;padding:0 10px}
  .source-panel,.settings-panel,.editor-stage{min-height:auto}
  .token-list{max-height:290px}
  .editor-stage{order:-1}
  .canvas-wrap{min-height:390px;padding:20px}
  .transform-controls{grid-template-columns:1fr}
  .transform-controls label,.insert-mode-group,.inline-actions,.drag-hint{grid-column:1}
  .settings-scroll{display:block}
  .export-panel{margin:10px;display:block}
  .export-controls{margin-top:18px;justify-content:stretch}
  .export-controls label{flex:1}
  .primary-btn{flex:1;min-width:140px}
  .feature-strip{margin:14px 10px;grid-template-columns:1fr 1fr}
  .seo-content{grid-template-columns:1fr;gap:24px;margin-top:65px}
  .faq{margin-top:55px}
  .switches{grid-template-columns:1fr 1fr 1fr}
  footer{margin-top:60px;display:block}
}

.section-lead{color:#71685f;font-size:13px;line-height:1.65;margin:18px 0 0;max-width:470px}
.result-guide{max-width:1050px;margin:56px auto 0;padding:0 24px}
.result-guide-head{max-width:760px}
.result-guide h2{font-family:Georgia,serif;font-size:32px;line-height:1.1;margin:0;color:#35261b}
.result-guide-head>p:last-child{color:#6f675e;line-height:1.65;font-size:13px;margin:14px 0 0}
.result-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:20px}
.result-cards article{background:rgba(255,255,255,.78);border:1px solid var(--line);border-radius:16px;padding:16px}
.result-cards strong,.result-cards span{display:block}.result-cards strong{font-size:14px;color:#4e3b26}.result-cards span{font-size:11px;line-height:1.55;color:#786f64;margin-top:5px}
.noscript-note{max-width:900px;margin:20px auto;padding:12px 16px;border:1px solid #e4c99c;background:#fff4df;color:#65481e;border-radius:12px;font:13px/1.5 system-ui,sans-serif}
@media(max-width:760px){.result-cards{grid-template-columns:1fr}.result-guide{margin-top:45px}.result-guide h2{font-size:28px}}

/* HTML-first demo and canvas text equivalent */
.static-demo{max-width:1412px;margin:0 auto 18px;padding:18px 20px;display:grid;grid-template-columns:minmax(260px,.8fr) minmax(440px,1.2fr);gap:24px;align-items:center;background:rgba(255,255,255,.74);border:1px solid var(--line);border-radius:18px;box-shadow:0 10px 32px rgba(109,78,31,.07)}
.static-demo-copy h2{font-family:Georgia,serif;font-size:25px;line-height:1.1;margin:0;color:#35261b}.static-demo-copy>p:last-child{margin:10px 0 0;color:#70675d;font-size:12px;line-height:1.55;max-width:530px}
.static-token-row{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.static-token-card{margin:0;padding:10px;background:#fffaf3;border:1px solid #eee0cc;border-radius:15px;display:grid;grid-template-columns:62px 1fr;gap:10px;align-items:center}.static-token-card figcaption strong,.static-token-card figcaption span{display:block}.static-token-card figcaption strong{font-size:12px;color:#4f4030}.static-token-card figcaption span{font-size:10px;line-height:1.4;color:#85786b;margin-top:3px}
.static-token{width:58px;height:58px;border-radius:50%;display:grid;place-items:center;position:relative;background:radial-gradient(circle at 48% 35%,#8595ad 0 18%,#37495f 19% 42%,#1d2937 43% 100%);font-size:9px;font-weight:900;color:#fff;letter-spacing:.04em}.static-token::before,.static-token::after{content:"";position:absolute;border-radius:inherit;pointer-events:none}.static-token::before{inset:-4px;border:6px solid #d1a04b;box-shadow:0 4px 10px rgba(82,55,20,.18)}.static-token::after{inset:3px;border:2px solid #513b1c}.static-token-monster{background:radial-gradient(circle at 50% 35%,#9b6761 0 19%,#58302b 20% 45%,#281b1a 46% 100%)}.static-token-monster::before{border-color:#b85b4b}.static-token-monster::after{border-color:#4d1d16}.static-token-boss{background:radial-gradient(circle at 50% 35%,#73607f 0 19%,#46364f 20% 45%,#221b28 46% 100%)}.static-token-boss::before{border-color:#d2a84d;box-shadow:0 0 0 2px #7b561c,0 5px 12px rgba(82,55,20,.18)}.static-token-boss::after{border-color:#4b2815}
.canvas-status{margin:0;padding:8px 18px 9px;border-top:1px solid #eee2d2;color:#81766a;font-size:10px;line-height:1.45;background:rgba(255,251,245,.82)}
@media(max-width:900px){.static-demo{margin-left:24px;margin-right:24px;grid-template-columns:1fr}.static-token-row{grid-template-columns:repeat(3,1fr)}}
@media(max-width:760px){.static-demo{margin:0 10px 12px;padding:15px}.static-token-row{grid-template-columns:1fr}.static-token-card{grid-template-columns:58px 1fr}.canvas-status{padding-left:14px;padding-right:14px}}
