/* 06.11.2026 (owner): the level window: the level on a medallion above the title, each gain in its own colour, nothing scrolls visibly */
#level-root{padding:16px;overflow:hidden;background:#0d2c2be6;scrollbar-width:none}
#level-root::-webkit-scrollbar,.level-card.celebration::-webkit-scrollbar{display:none;width:0;height:0}
.level-card.celebration{width:100%;max-width:340px;max-height:100%;overflow-x:hidden;overflow-y:auto;scrollbar-width:none;padding:20px 16px 16px;text-align:center;background:linear-gradient(180deg,#fff9ec,#f5e6ca);border:1px solid #b99a5e;border-radius:16px;box-shadow:0 0 0 3px #173f3d,0 0 0 4px #b99a5e,0 18px 46px #0009}
.level-card.celebration::before{display:none}
.level-card .level-heading{display:flex;flex-direction:column;align-items:center;gap:8px;margin:0 0 14px;padding:0;border:0;text-align:center}
.level-card .level-number{display:grid;place-items:center;width:auto;min-width:76px;height:76px;padding:0 10px;margin:0;box-sizing:border-box;font:700 34px/1 Interface,sans-serif;color:#fff1c9;text-shadow:0 2px 0 #0007;background:radial-gradient(circle at 50% 35%,#35766c,#143a38);border:3px solid #d2b06a;border-radius:38px;box-shadow:0 0 0 2px #173f3d,0 0 22px #e7c67a99,inset 0 0 0 1px #ffffff2e}
.level-card .level-heading h2{margin:0;font:700 23px/1.15 Interface,sans-serif;color:#1c3f3c;letter-spacing:0;white-space:normal}
.level-points{display:flex;gap:6px;margin:0 0 8px}
.level-point{flex:1;display:flex;align-items:center;justify-content:center;gap:6px;min-height:40px;padding:6px 8px;color:#5a3f10;background:linear-gradient(180deg,#f7dc94,#e3b95c);border:1px solid #b98d36;border-radius:10px;box-shadow:inset 0 1px 0 #fff7}
.level-point .icon{font-size:15px;color:#8a5f14}.level-point b{font-size:18px;font-weight:700;color:#5a3f10}.level-point small{font-size:12px;color:#6d5018}
.level-gains{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 4px}
.level-gain{--gain:#1c3f3c;--gain-bg:#fbf2df;--gain-line:#dcc69a;flex:1 1 calc(50% - 3px);min-width:0;box-sizing:border-box;display:grid;grid-template-columns:30px minmax(0,1fr);grid-template-rows:auto auto;column-gap:8px;align-items:center;text-align:left;padding:8px 10px;background:var(--gain-bg);border:1px solid var(--gain-line);border-radius:10px}
.level-gain>img,.level-gain>.resource-icon{grid-row:1/3;width:30px;height:30px;max-width:30px;margin:0;object-fit:contain}
.level-gain b{font-size:18px;line-height:1.1;font-weight:700;color:var(--gain)}.level-gain small{font-size:11px;line-height:1.2;color:var(--gain);opacity:.8}
.gain-health{--gain:#a33a30;--gain-bg:#fae4dc;--gain-line:#e6b4a6}
.gain-resource{--gain:#2d6c95;--gain-bg:#e1eff6;--gain-line:#aecfe0}
.gain-power{--gain:#67479c;--gain-bg:#ece4f6;--gain-line:#c9b6e2}
.gain-damage{--gain:#a85a1c;--gain-bg:#f9e8d3;--gain-line:#e4c091}
.gain-armor{--gain:#4b5e6c;--gain-bg:#e6ebee;--gain-line:#bcc8cf}
.gain-ward{--gain:#2f7b78;--gain-bg:#dff1ef;--gain-line:#a8d3cf}
.level-card .level-fold{margin:6px 0 0;text-align:left;background:#fbf2df;border:1px solid #dcc69a;border-radius:10px}
#level-root :is(.level-point,.level-slot-unlock){display:grid;grid-template-columns:28px minmax(0,1fr);align-items:center;justify-content:start;gap:8px;min-height:42px;padding:6px 10px;text-align:left;box-sizing:border-box}
.level-feature-icon{display:block;width:24px;height:24px;object-fit:contain;justify-self:center}
.level-slot-unlock{margin:8px 0;border:1px solid #aebd9a;border-radius:9px;background:#e6ebd8;color:#334f40;font-size:13px;font-weight:700;line-height:1.3}
.level-card .level-actions{margin-top:12px;grid-template-columns:1fr 1fr}
.level-card .level-actions button{min-height:42px;font-size:12px;border-radius:10px}
.level-card .level-actions button.secondary{background:#fbf2df;border:1px solid #b99a5e;color:#1c3f3c}
@media(max-height:560px){.level-card.celebration{padding:12px}.level-card .level-number{min-width:56px;height:56px;font-size:26px}}

/* calmer: same quiet look as the defeat window, the number stands on the ornament line without a badge */
.level-card.celebration{background:linear-gradient(180deg,#f8f0df,#f1e4cb);border-color:#a98f5d;box-shadow:0 0 0 3px #173f3d,0 0 0 4px #a98f5d,0 18px 46px #0009}
.level-card .level-heading{gap:4px;margin:0 0 12px}
.level-card .level-heading>img{width:38px;height:40px;margin:0 0 2px;object-fit:contain}
.level-card .level-heading h2{font-size:22px;color:#28413d}
.level-line{align-self:stretch;display:flex;align-items:center;gap:10px;margin-top:2px}
.level-line>i{flex:1;height:1px;background:#c8b184}
.level-card .level-number{display:block;width:auto;min-width:0;height:auto;padding:0;margin:0;font:700 30px/1.1 Interface,sans-serif;color:#8a6c35;text-shadow:none;background:none;border:0;border-radius:0;box-shadow:none}
.level-point{min-height:36px;color:#4f452f;background:#f4e8cf;border-color:#c8b184;box-shadow:none}
.level-point .icon{color:#9b7a3a}.level-point b{font-size:17px;color:#4f452f}.level-point small{color:#6f6348}
.level-gain{--gain-bg:#f6ecd8;--gain-line:#d8c7a2}
.gain-health{--gain:#8a4b42;--gain-bg:#f4e6d8;--gain-line:#dcc4ad}
.gain-resource{--gain:#44697d;--gain-bg:#e9ebdf;--gain-line:#c8d0c4}
.gain-power{--gain:#62527f;--gain-bg:#eee7dd;--gain-line:#d3c7c9}
.gain-damage{--gain:#86603a;--gain-bg:#f3e7d3;--gain-line:#d9c5a3}
.gain-armor{--gain:#515f66;--gain-bg:#ebe8dc;--gain-line:#cdcbbd}
.gain-ward{--gain:#3f6c68;--gain-bg:#e6eadc;--gain-line:#c4d0c0}
.level-card .level-actions button.secondary{background:#f6ecd8;border-color:#a98f5d}
@media(max-height:560px){.level-card .level-heading>img{display:none}.level-card .level-number{font-size:24px}}
/* нечётный последний блок по центру и той же ширины; меч как в характеристиках героя; рамка у нового умения */
.level-gains{justify-content:center}
.level-gain{flex:0 1 calc(50% - 3px)}
.level-gain>.icon{grid-row:1/3;display:grid;place-items:center;width:30px;height:30px;margin:0;font-size:24px;line-height:1;color:#587f63}
.level-card .unlocked-skill summary>.skill-asset{box-sizing:border-box;width:46px;height:46px;flex:none;object-fit:cover;border:1px solid #bfa672;border-radius:9px;box-shadow:none}
.level-gain>.icon[data-glyph="heart"]{color:#df7e65;transform:none}
.necro-facts .icon[data-glyph="heart"]{display:inline-grid;place-items:center;width:18px;height:18px;font-size:15px;line-height:1;color:#df7e65;transform:none}
.party-card-heart{display:inline-grid;place-items:center;font-size:11px;line-height:1;color:#df7e65}
.party-card-heart>.icon{color:inherit;font-size:inherit;transform:none}
/* выпуклые кнопки, как «Экипировать» */
#hero .hero-technique-detail footer button.secondary,.level-card .level-actions button.secondary{border:1px solid #c7b188;background:linear-gradient(#faf2e0,#f0e3c9);box-shadow:inset 0 1px 0 #fffc,0 3px 0 #bba67c;color:#4a5a4a}
#hero .hero-technique-detail footer button.secondary:active,.level-card .level-actions button.secondary:active{transform:translateY(2px);box-shadow:inset 0 1px 0 #fffc,0 1px 0 #bba67c}

#level-root .level-card .level-point{display:flex;align-items:center;justify-content:center;gap:.45rem;height:auto;min-height:36px;max-height:44px;padding:5px 10px}
#level-root .level-card .level-point img{width:22px;height:22px;object-fit:contain;flex:none;margin:0}
#level-root .level-card .level-points{align-items:center;flex:0 0 auto}

#hero .attribute-description .resistance-open{display:inline-flex;align-items:center;gap:6px;margin:6px 0 0;padding:3px 9px 3px 5px;min-height:30px;width:auto;border:1px solid #b7c39b;border-radius:8px;background:linear-gradient(#fafbed,#e4ebd3);color:#395748;font:600 12px/1.2 Interface,sans-serif;box-shadow:inset 0 1px #fff9;touch-action:manipulation}
.resistance-open img{width:17px;height:17px;object-fit:contain}.resistance-open i{margin-left:4px;font:18px/1 Interface;color:#71805d}
#modal-root .modal-shade:has(.resist-editor){align-items:center;justify-content:center}
#modal-root .resist-editor{box-sizing:border-box;width:min(338px,calc(100% - 26px));max-height:min(85dvh,520px);overflow:auto;padding:14px 15px;border:1px solid #c6b58e;border-radius:16px;background:linear-gradient(155deg,#fffcf3,#f8f2e3);color:#365347;box-shadow:inset 0 0 0 3px #fffcf1,0 10px 32px #243d3540;animation:resist-appear .16s ease-out}
.resist-editor .modal-header{display:flex;align-items:center;justify-content:space-between;margin:0;padding:0;border:0}.resist-editor .modal-header h2{display:flex;align-items:center;gap:8px;margin:0;color:#345448;font:700 19px/1.2 Interface,sans-serif}.resist-sigil{display:block;width:24px;height:24px;object-fit:contain}.resist-editor .modal-header .icon-button{width:30px;height:30px;min-width:30px;padding:5px}
.resist-editor .resist-help{font:normal 12px/1.45 Interface,sans-serif;color:#665f4b;margin:9px 1px}
.resist-budget{display:flex;align-items:center;justify-content:space-between;padding:6px 9px;margin:8px 0;border:1px solid #c6d0ae;border-radius:8px;background:#edf2df;color:#455d42;font:600 12px/1.25 Interface,sans-serif}.resist-budget strong{font-size:15px;font-variant-numeric:tabular-nums}
.resist-list{border:1px solid #dbd0b4;border-radius:10px;background:#fffaf0;padding:0 8px}.resist-choice,.resist-name{display:flex;align-items:center}.resist-choice{justify-content:space-between;gap:6px;padding:4px 0;min-height:36px}.resist-choice+.resist-choice{border-top:1px solid #e8dfc9}.resist-name{gap:7px;font:600 12px/1.25 Interface,sans-serif}.resist-name img{width:24px;height:24px;object-fit:contain}
.resist-step{display:inline-grid;align-items:center;grid-template-columns:30px 30px 30px;gap:1px;padding:2px;border:1px solid #d8cfb1;border-radius:20px;background:#f5efdc}.resist-step output{text-align:center;color:#365748;font:700 14px/1 Interface,sans-serif;font-variant-numeric:tabular-nums}
#modal-root .resist-step button{display:grid;place-items:center;width:30px;height:30px;min-height:0;padding:0;border:1px solid #b4c3a0;border-radius:50%;background:linear-gradient(#f9fbef,#e1ead1);color:#41624c;font:600 16px/1 Interface,sans-serif;touch-action:manipulation}.resist-step button:active:enabled{transform:scale(.94)}#modal-root .resist-step button:disabled{background:#f8f4e8;color:#a5a08e;border-color:#dfd7c2;opacity:1}
.resist-editor .resist-base{display:block;color:#706a58;font:normal 11px/1.4 Interface,sans-serif;margin:7px 1px 10px}.resist-editor [role=status]:empty{display:none}
#modal-root .resist-editor>[data-save-resist]{display:block;width:100%;height:36px;margin:0;border:1px solid #345f52;border-radius:9px;background:linear-gradient(#4b8070,#396658);color:#fffaf0;font:700 13px/1 Interface,sans-serif}#modal-root .resist-editor>[data-save-resist]:disabled{border-color:#c3c7b2;background:#e6e9da;color:#6b7563;opacity:1}
@keyframes resist-appear{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}@media(prefers-reduced-motion:reduce){#modal-root .resist-editor{animation:none}}

#hero .resistance-open:focus-visible{outline:2px solid #69907f;outline-offset:2px}

#modal-root .resist-editor .resist-heading{display:inline-flex;align-items:center;gap:7px;vertical-align:middle}

#hero .attribute-description .resistance-open{display:inline-flex;width:auto;max-width:100%;min-height:33px;padding:3px 10px 3px 6px;margin:7px 0 0;gap:6px;justify-content:center;font-size:12px;border-radius:9px}.resistance-open i{margin-left:2px}.resistance-open img{width:22px;height:22px}.resist-editor .resist-list{margin-bottom:12px}

#hero .attribute-description{overflow:hidden;box-sizing:border-box}
#hero .attribute-description[hidden]{display:none!important}
#hero .attribute-description .resistance-open{display:flex;width:100%;min-height:27px;justify-content:flex-start;gap:5px;margin:5px 0 0;padding:3px 1px;border:0;border-top:1px solid #cbd4b966;border-radius:0;background:transparent;box-shadow:none;font:500 11px/1.3 Interface,sans-serif}
#hero .resistance-open img{width:15px;height:15px}#hero .resistance-open i{margin-left:auto;padding-right:3px}#hero .resistance-open:active{color:#203c2f}

#hero .attribute-description .resistance-open{display:grid;grid-template-columns:22px minmax(0,1fr) 10px;align-items:center;text-align:left;gap:7px;width:100%;box-sizing:border-box;min-height:32px;padding:3px 8px 3px 4px;margin:5px 0 0;border:1px solid #b5c29d;border-radius:7px;background:linear-gradient(#f6f7e8,#e6ecd6);color:#3b5d4b;font:600 12px/1.2 Interface,sans-serif}
#hero .resistance-open .resistance-icon{width:22px;height:22px;display:grid;place-items:center;border:1px solid #d4d8bd;border-radius:5px;background:#f9f7e6}
#hero .resistance-open img{width:16px;height:16px}#hero .resistance-open i{margin:0;padding:0;font:16px/1 Interface,sans-serif}
