@font-face{font-family:Grimorio;src:local("Georgia")}
:root{color-scheme:dark;--bg:#14121a;--surface:#201c29;--card:#292332;--line:#3a3245;--gold:#ebc889;--text:#f4eff9;--muted:#b7aabe;--accent:#8367a9;--bad:#ffacac}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-family:"Segoe UI",Arial,sans-serif;font-size:16px;line-height:1.55}button,input,select{font:inherit}button,a,input,select{ -webkit-tap-highlight-color:transparent}a{color:var(--gold)}button{cursor:pointer;border:1px solid transparent;background:var(--gold);color:#261d13;border-radius:10px;padding:10px 17px;min-height:44px;font-weight:600;transition:background .15s,border-color .15s}button:hover{filter:brightness(1.08)}button:disabled{opacity:.4;cursor:default}button.secondary{background:transparent;border-color:var(--line);color:var(--text)}button.ghost{background:transparent;color:var(--muted);padding:8px 12px}button.danger{color:var(--bad);background:transparent;border-color:#683c48}button.small{padding:5px 10px;font-size:.875rem;min-height:40px}input,select{width:100%;min-height:46px;border:1px solid #51445e;border-radius:9px;background:#17131e;color:var(--text);padding:10px 12px}input:focus,select:focus{outline:2px solid var(--gold);outline-offset:2px}select{appearance:none;padding-right:30px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23ebc889' stroke-width='2'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;background-size:16px}input[type=checkbox]{width:24px;height:24px;min-height:24px;accent-color:var(--gold);cursor:pointer}label{display:grid;gap:6px;color:var(--muted);font-size:.9rem}h1,h2,h3,p{margin:0}h1{font-family:Grimorio,Georgia,serif;font-size:clamp(1.9rem,3.4vw,2.8rem);font-weight:500;line-height:1.2}h2{font-size:1.3rem;line-height:1.35}h3{font-size:1.05rem}p+p{margin-top:12px}.muted{color:var(--muted)}.eyebrow{font-size:.8rem;letter-spacing:.14em;text-transform:uppercase;color:var(--gold);margin-bottom:9px}.shell{display:grid;grid-template-columns:242px 1fr;min-height:100dvh}.sidebar{position:sticky;top:0;height:100dvh;background:#1c1724;border-right:1px solid var(--line);padding:32px 20px;display:flex;flex-direction:column;gap:28px}.brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:var(--text)}.brand img{width:48px;height:48px;border-radius:12px}.brand span{font:1.15rem/1.3 Georgia,serif}.brand b{display:block;font-weight:400;color:var(--gold)}nav{display:grid;gap:7px}nav button{text-align:left;background:transparent;color:var(--muted);font-weight:500}nav button.active{background:#352b43;color:var(--gold);border-color:#554164}.side-bottom{margin-top:auto;display:grid;gap:12px}.account{border-top:1px solid var(--line);padding-top:18px;font-size:.9rem;word-break:break-word}.main{padding:26px clamp(20px,4vw,68px) 60px;max-width:1350px;width:100%;margin:auto}.topbar{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:34px}.status{font-size:.85rem;color:var(--muted)}.pagehead{display:flex;justify-content:space-between;align-items:flex-end;gap:20px;margin-bottom:28px}.pagehead p{margin-top:10px;color:var(--muted)}.actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.mode{display:inline-flex;background:#1c1724;padding:4px;border:1px solid var(--line);border-radius:11px;margin-bottom:25px}.mode button{background:transparent;color:var(--muted);padding:8px 24px}.mode button.active{background:#473650;color:#fff}.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:18px}.card{background:var(--surface);border:1px solid var(--line);border-radius:15px;padding:22px}.character-card .card-open{display:flex;align-items:center;justify-content:space-between;gap:15px;width:100%;background:transparent;color:var(--text);padding:0;text-align:left}.character-card h2{font-family:Georgia,serif;font-weight:400;font-size:1.5rem;margin:9px 0 6px}.kind{color:var(--gold);font-size:.8rem}.character-card footer{display:flex;gap:6px;border-top:1px solid var(--line);margin-top:22px;padding-top:12px}.character-card footer .danger{margin-left:auto}.portrait{width:72px;height:72px;object-fit:cover;border-radius:14px;flex-shrink:0;background:#342a40}.portrait.large{width:110px;height:110px}.empty{padding:50px 25px;text-align:center;border:1px dashed #5b4968;border-radius:16px;color:var(--muted)}.empty h2{color:var(--text);margin-bottom:12px}.searchbar{display:grid;grid-template-columns:minmax(180px,1fr) repeat(3,minmax(125px,.5fr));gap:12px;margin-bottom:24px}.spell-group{margin-bottom:25px}.spell-group h2{font:1.4rem Georgia,serif;color:var(--gold);padding-bottom:10px}.spell-row{display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%;background:var(--surface);color:var(--text);border:1px solid var(--line);margin-bottom:7px;padding:15px 18px;text-align:left;font-weight:400}.spell-row:hover{border-color:#9579aa}.spell-row .metadata{font-size:.85rem;color:var(--muted);display:block;margin-top:4px}.spell-row.chosen{border-color:var(--gold);background:#3b2f3d}.level{font-size:.85rem;color:var(--gold);white-space:nowrap}.spell-text{white-space:pre-wrap;font:1.05rem/1.8 "Segoe UI",sans-serif;max-width:800px}.detail-meta{display:flex;gap:12px;flex-wrap:wrap;margin:15px 0 25px;color:var(--gold)}.detail-card{padding:30px}.sheet-head{display:flex;justify-content:space-between;gap:22px;align-items:center;margin-bottom:26px}.sheet-head .muted{margin-top:12px}.sheet-grid{display:grid;grid-template-columns:minmax(250px,1fr) 310px;gap:24px;align-items:start}.slots{position:sticky;top:20px}.slots h2{font:1.5rem Georgia,serif;margin-bottom:6px}.slot-row{display:flex;align-items:center;justify-content:space-between;padding:14px 0;border-bottom:1px solid var(--line);gap:10px}.checks{display:flex;gap:8px;align-items:center}.slot-label{display:flex;align-items:center;padding:4px}.summary{color:var(--gold);font-size:1.05rem}.editor{display:grid;grid-template-columns:300px 1fr;gap:24px;align-items:start}.editor-fields{display:grid;gap:17px;position:sticky;top:20px}.editor .searchbar{grid-template-columns:1fr 1fr}.editor .searchbar label:first-child{grid-column:1/-1}.editor-bar{position:sticky;top:0;z-index:2;padding:16px;background:#201c29f5;border:1px solid var(--line);border-radius:12px;margin-bottom:20px;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.counter{font-size:.9rem;color:var(--gold)}.auth-shell{min-height:100dvh;display:grid;grid-template-columns:1fr 1fr}.auth-art{background:radial-gradient(ellipse at 40% 40%,#3e2e51,transparent 65%),#1b1622;padding:clamp(30px,7vw,100px);display:flex;flex-direction:column;justify-content:space-between;border-right:1px solid var(--line)}.auth-art h1{max-width:500px;font-size:clamp(2.8rem,4.2vw,4.8rem);margin-top:50px}.auth-art p{color:#c9b6d3;max-width:400px;margin-top:25px}.auth-art .logo{width:150px;height:150px;object-fit:contain;border-radius:26px;margin-top:30px}.auth-area{padding:35px clamp(25px,5vw,80px);display:flex;flex-direction:column;justify-content:center}.auth-area>.back{align-self:flex-start;margin-bottom:25px}.auth-form{display:grid;gap:17px;max-width:480px;width:100%;margin:auto}.auth-form h1{font-size:2.1rem}.auth-form .muted{margin-bottom:8px}.pair{display:grid;grid-template-columns:1fr 1fr;gap:12px}.helper{font-size:.85rem;color:var(--muted)}.error{color:var(--bad);font-size:.9rem;min-height:1.2em}.notice{padding:14px 18px;border:1px solid #745d39;border-radius:10px;background:#342b20;color:#f1d39b;margin:15px 0}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin-bottom:25px}.stat strong{display:block;font-size:2.2rem;font-weight:500;color:var(--gold);margin-top:12px}.tablewrap{overflow:auto;border:1px solid var(--line);border-radius:14px}table{width:100%;border-collapse:collapse;background:var(--surface);white-space:nowrap}th,td{text-align:left;padding:16px 20px;border-bottom:1px solid var(--line)}th{color:var(--muted);font-size:.85rem;background:#261f30}dl{display:grid;grid-template-columns:150px 1fr;gap:15px}dt{color:var(--muted)}dd{margin:0;word-break:break-word}#notice{position:fixed;bottom:25px;left:50%;transform:translateX(-50%);max-width:90vw;z-index:100;border-radius:12px;background:#f1d6a2;color:#211923;padding:0;box-shadow:0 10px 50px #0008}#notice:not(:empty){padding:14px 24px}dialog{max-width:480px;width:calc(100% - 40px);color:var(--text);background:var(--surface);border:1px solid var(--line);border-radius:15px;padding:28px}dialog::backdrop{background:#09060bc9}dialog p{margin:14px 0 25px}dialog .actions{justify-content:flex-end}.loading{padding:50px;text-align:center}.hidden{display:none!important}.file-button{position:relative;overflow:hidden;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:10px;padding:10px 16px;color:var(--text);min-height:44px;font-size:1rem}.file-button input{position:absolute;inset:0;opacity:0;cursor:pointer}button:focus-visible,a:focus-visible,.file-button:focus-within{outline:2px solid var(--gold);outline-offset:4px}hr{border:0;border-top:1px solid var(--line);margin:24px 0}
@media(max-width:1000px){.shell{grid-template-columns:205px 1fr}.sidebar{padding:25px 14px}.main{padding:22px 24px 45px}.searchbar{grid-template-columns:1fr 1fr}.editor{grid-template-columns:250px 1fr}.sheet-grid{grid-template-columns:1fr}.slots{position:static}.stats{grid-template-columns:1fr 1fr}}
@media(max-width:700px){.shell{display:block}.sidebar{height:auto;position:static;padding:14px 18px;border-right:0;border-bottom:1px solid var(--line);gap:14px}.sidebar .brand img{width:40px;height:40px}.sidebar .brand span{font-size:1rem}.sidebar nav{display:flex;gap:4px;overflow:auto}.sidebar nav button{white-space:nowrap;padding:8px 12px;min-height:40px}.side-bottom{display:flex;justify-content:space-between;align-items:center;gap:6px}.side-bottom .account{border:0;padding:0}.side-bottom .account small{display:none}.side-bottom button{padding:6px 10px;min-height:36px;font-size:.8rem}.main{padding:18px 16px max(35px,env(safe-area-inset-bottom))}.topbar{margin-bottom:22px}.pagehead{align-items:flex-start;flex-direction:column;margin-bottom:20px}.pagehead .actions{width:100%}.pagehead .actions button{flex:1}.cards{grid-template-columns:1fr}.auth-shell{display:block}.auth-art{padding:22px;border-right:0;border-bottom:1px solid var(--line)}.auth-art>div:not(:first-child),.auth-art>.helper{display:none}.auth-area{padding:20px 22px 40px}.auth-form{max-width:500px}.auth-area>.back{margin-bottom:20px}.editor{display:block}.editor-fields{position:static;margin-bottom:20px}.pair{grid-template-columns:1fr 1fr}.sheet-head{gap:15px;align-items:flex-start}.portrait.large{width:85px;height:85px}.stats{grid-template-columns:1fr}.searchbar{gap:8px}.searchbar label:first-child{grid-column:1/-1}.detail-card{padding:20px}dl{grid-template-columns:1fr;gap:4px}dd{margin-bottom:12px}.editor-bar{top:0}.sidebar .side-bottom #install{max-width:160px}.sheet-head h1{font-size:1.9rem}.slots{padding:20px}.slot-row{flex-wrap:wrap}}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}
.brand-group{display:flex;gap:8px;align-items:center}.version{font-size:.75rem;padding:4px 6px;min-height:32px;background:transparent;border-color:var(--line);color:var(--gold);white-space:nowrap;font-weight:500}.brand-group .brand{gap:9px}.account-actions{display:grid;gap:8px}.portrait-frame{display:inline-block;width:72px;height:72px;border-radius:14px;flex-shrink:0;overflow:hidden;background:var(--card)}.portrait-frame.large{width:110px;height:110px}.portrait-frame img{display:block;width:100%;height:100%;object-fit:cover}.portrait-controls{display:grid;gap:10px}input[type=range]{padding:0;min-height:30px;accent-color:var(--gold)}#portrait-preview .portrait-frame{width:180px;height:180px;touch-action:none;cursor:grab}#portrait-preview .portrait-frame:active{cursor:grabbing}.spell-choice{border:1px solid var(--line);background:var(--surface);border-radius:10px;margin-bottom:8px;overflow:hidden}.spell-choice.chosen{border-color:var(--gold)}.spell-choice-row{display:flex;gap:12px;justify-content:space-between;align-items:center;padding:14px 16px}.spell-choice-row>.actions{flex-shrink:0}.spell-inline{padding:18px;border-top:1px solid var(--line)}.spell-inline .level{margin-bottom:15px}.section-title{margin:0 0 16px}.campaigns{margin-bottom:30px}.campaign-card{text-align:left;color:var(--text)}.campaign-card:hover{border-color:var(--gold)}.import-config{max-width:600px;display:grid;gap:22px}.assign-form{margin-top:22px}.assign-form label{flex:1;max-width:500px}.dm-result{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:20px 0;border-top:1px solid var(--line)}#dm-results{margin-top:24px}.dice-value{display:block;text-align:center;font:5rem Georgia,serif;color:var(--gold);padding:22px}.release-notes{padding-left:22px;line-height:1.65}.release-notes li{margin-bottom:9px}fieldset{border:1px solid var(--line);border-radius:10px;display:flex;gap:24px;padding:15px}legend{color:var(--muted);padding:0 8px}.radio{display:flex;align-items:center;gap:10px}.radio input{width:22px;height:22px;min-height:22px;accent-color:var(--gold)}
:root[data-theme=day]{color-scheme:light;--bg:#f3e6d3;--surface:#f9eddc;--card:#e9d5b9;--line:#cbb394;--gold:#805020;--text:#38291f;--muted:#6e5845;--accent:#96734d;--bad:#a02d32}
[data-theme=day] button:not(.secondary):not(.ghost):not(.danger):not(.version):not(.card-open):not(.spell-row):not(.campaign-card){background:#e6c28e;color:#38291f}
[data-theme=day] .sidebar,[data-theme=day] .mode{background:#ebd9be}[data-theme=day] input,[data-theme=day] select{background-color:#fcf1e0;border-color:#b99b77}[data-theme=day] input[type=range]{background:transparent}[data-theme=day] nav button{background:transparent!important;color:var(--muted)!important}[data-theme=day] nav button.active,[data-theme=day] .mode button.active{background:#ddc3a0!important;color:#563817!important}[data-theme=day] .spell-row.chosen{background:#e9d6bb}[data-theme=day] .editor-bar{background:#f9eddcf5}[data-theme=day] th{background:#e9d6bb}[data-theme=day] .auth-art{background:radial-gradient(ellipse at 40% 40%,#e4c799,transparent 65%),#ead6b7}[data-theme=day] .auth-art p{color:var(--muted)}[data-theme=day] .notice{background:#ecd3a9;color:#563817;border-color:#b38d55}[data-theme=day] dialog::backdrop{background:#46352499}[data-theme=day] button.danger{border-color:#c29081}[data-theme=day] .empty{border-color:#b99b77}
@media(max-width:1000px){.sidebar .brand-group{flex-wrap:wrap}.sidebar .version{margin-left:55px}}
@media(max-width:700px){.sidebar .brand-group{flex-wrap:nowrap}.sidebar .version{margin-left:0}.side-bottom{flex-wrap:wrap}.account-actions{display:grid;gap:2px}.portrait-frame.large{width:85px;height:85px}.spell-choice-row{flex-wrap:wrap}.spell-choice-row>.actions{width:100%;justify-content:flex-end}.spell-text{overflow-wrap:anywhere}.import-config{padding:18px}.dm-result{flex-wrap:wrap}.dm-result p{overflow-wrap:anywhere}.assign-form label{width:100%;flex:auto}}
