/* Copyright (c) damun-craft.com All Rights Reserved. */
#protection-math{--bg:#f7f7f7;--surface:#ffffff;--surface-2:#f0f0f0;--border:#e0e0e0;--text:#212121;--text-muted:#757575;--accent:#729c0b;--accent-strong:#567a08;--accent-soft:rgba(114,156,11,0.1);--fire:#c9702f;--blast:#b8503f;--projectile:#2b8fa3;--amber:#a8721a;--amber-soft:#f5e6c8;--shadow:0 1px 2px rgba(0,0,0,0.05),0 8px 24px rgba(0,0,0,0.05);max-width:880px;margin:0 auto;padding:2.75rem 1.5rem 4rem;display:flex;flex-direction:column;gap:2.25rem;background:var(--bg);color:var(--text);font-family:"Merriweather","Hiragino Mincho ProN",serif;line-height:1.6}#protection-math *{box-sizing:border-box}#protection-math>header{order:0}#protection-math>.edition-panel{order:1}#protection-math .sticky-scope{order:2}#protection-math>details.formula{order:3}#protection-math>.explanation{order:4}#protection-math>p.disclaimer{order:5}#protection-math>footer.credit{order:6}#protection-math .sticky-scope{display:flex;flex-direction:column;gap:2.25rem}#protection-math .sticky-scope>#pieces{order:0}#protection-math .sticky-scope>#panel{order:1}#protection-math .sticky-scope>.damage-input{order:2}#protection-math .sticky-scope>#panel-effective{order:3}#protection-math .edition-panel{position:sticky;top:0;z-index:10;background:var(--bg);padding:0.7rem 0;display:flex;align-items:center;justify-content:space-between;gap:0.6rem}#protection-math .reset-btn{font-family:"Ubuntu",sans-serif;font-size:0.8rem;font-weight:600;background:none;color:var(--text-muted);border:1px solid var(--border);border-radius:20px;padding:0.4rem 0.9rem;cursor:pointer}#protection-math .reset-btn:hover{background:var(--surface-2);color:var(--text)}#protection-math .scroll-top-btn{position:fixed;right:1.2rem;bottom:1.2rem;z-index:20;min-width:3.2rem;height:2.7rem;padding:0 1rem;border-radius:999px;border:1px solid #729c0b;background:#729c0b;color:#fff;font-family:"Ubuntu",sans-serif;font-size:0.8rem;font-weight:700;letter-spacing:0.06em;line-height:1;box-shadow:var(--shadow);cursor:pointer;opacity:0;pointer-events:none;transform:translateY(0.5rem);transition:opacity 0.2s ease,transform 0.2s ease,background 0.2s ease}#protection-math .scroll-top-btn.visible{opacity:1;pointer-events:auto;transform:translateY(0)}#protection-math .scroll-top-btn:hover{background:#5f8309;border-color:#5f8309}#protection-math header>h2{font-family:"Ubuntu",sans-serif;font-weight:700;font-size:clamp(1.8rem,5vw,2.6rem);line-height:1.1;margin:0.35rem 0 0;letter-spacing:-0.01em}#protection-math .subtitle{color:var(--text);font-size:1rem;line-height:1.6;margin:0.9rem 0 0}#protection-math .pieces{display:grid;grid-template-columns:repeat(4,1fr);gap:0.9rem}#protection-math .piece-card{background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:1rem 0.9rem 1.1rem;display:flex;flex-direction:column;gap:0.65rem;box-shadow:var(--shadow);scroll-margin-top:4rem}#protection-math .piece-head{display:contents}#protection-math .piece-fields{display:contents}#protection-math .piece-icon{width:32px;height:32px;color:var(--accent);image-rendering:pixelated;flex:none}#protection-math .piece-name{font-family:"Ubuntu",sans-serif;font-weight:600;font-size:0.92rem}#protection-math label.field-label{font-family:"Ubuntu",sans-serif;font-size:0.64rem;letter-spacing:0.09em;text-transform:uppercase;color:var(--text-muted);display:block;margin-bottom:0.3rem}#protection-math select{width:100%;appearance:none;background:var(--surface-2) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none" stroke="%23757575" stroke-width="1.6"><path d="M5 8l5 5 5-5"/></svg>') no-repeat right 0.6rem center / 14px;border:1px solid var(--border);color:var(--text);border-radius:6px;padding:0.5rem 1.8rem 0.5rem 0.6rem;font-family:"Ubuntu",sans-serif;font-size:0.85rem}#protection-math select:focus-visible{outline:2px solid var(--accent);outline-offset:1px}#protection-math select:disabled{opacity:0.5;cursor:not-allowed}#protection-math .epf-readout{font-family:"Ubuntu",sans-serif;font-variant-numeric:tabular-nums;font-size:0.82rem;color:var(--accent-strong)}#protection-math .readout-panel{background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:1.3rem 1.4rem 1.5rem;box-shadow:var(--shadow);display:grid;grid-template-columns:118px 1fr 148px;row-gap:0.85rem;column-gap:0.9rem;align-items:center}#protection-math .panel-title{grid-column:1 / -1;font-family:"Ubuntu",sans-serif;font-size:0.7rem;letter-spacing:0.12em;text-transform:uppercase;color:var(--text-muted);border-bottom:1px solid var(--border);padding-bottom:0.7rem;margin-bottom:0.2rem}#protection-math .panel-target{grid-column:1 / -1;font-size:0.8rem;color:var(--text-muted);margin-top:-0.6rem}#protection-math .row{display:contents}#protection-math .row-label{display:flex;align-items:center;gap:0.5rem;font-size:0.86rem;font-weight:500}#protection-math .dot{width:9px;height:9px;border-radius:50%;flex:none}#protection-math .row-track{position:relative;height:12px;background:var(--surface-2);border-radius:4px;overflow:hidden}#protection-math .row-fill{position:absolute;inset:0 auto 0 0;width:0%;border-radius:4px;transition:width 0.35s ease}#protection-math .unreachable{position:absolute;top:0;bottom:0;right:0;width:20%;background-image:repeating-linear-gradient(45deg,var(--border) 0 3px,transparent 3px 7px);opacity:0.7}#protection-math .cap-tick{position:absolute;top:-2px;bottom:-2px;left:80%;width:1px;background:var(--text-muted);opacity:0.5}#protection-math .row-value{font-family:"Ubuntu",sans-serif;font-variant-numeric:tabular-nums;font-size:0.82rem;text-align:right;display:flex;align-items:baseline;justify-content:flex-end;gap:0.4rem;white-space:nowrap}#protection-math .pct{font-weight:600;font-size:0.92rem;color:var(--text)}#protection-math .capped-badge{font-family:"Ubuntu",sans-serif;font-size:0.6rem;letter-spacing:0.06em;background:var(--amber-soft);color:var(--amber);border-radius:3px;padding:0.1rem 0.35rem}#protection-math .axis-row{display:contents}#protection-math .axis-track{position:relative;height:1.9rem;font-family:"Ubuntu",sans-serif;font-size:0.62rem;color:var(--text-muted)}#protection-math .axis-track span{position:absolute;top:0;transform:translateX(-50%);white-space:nowrap}#protection-math .axis-track span:first-child{left:0;transform:translateX(0)}#protection-math .axis-track span:last-child{left:100%;transform:translateX(-100%)}#protection-math .axis-track span.cap-label{top:1.1rem;left:80%;transform:translateX(-50%);color:var(--amber)}#protection-math details.formula{background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:1rem 1.2rem}#protection-math details.formula summary{cursor:pointer;font-family:"Ubuntu",sans-serif;font-weight:600;font-size:0.9rem}#protection-math details.formula summary::marker{color:var(--accent)}#protection-math .formula-body{margin-top:0.9rem;color:var(--text-muted);font-size:0.88rem;line-height:1.65}#protection-math .formula-body code{font-family:"Ubuntu",sans-serif;background:var(--accent-soft);color:var(--accent-strong);padding:0.1rem 0.35rem;border-radius:4px;font-size:0.85em}#protection-math .fall-calc-inputs{display:flex;gap:1rem;flex-wrap:wrap;margin-top:0.9rem}#protection-math .fall-calc-inputs>div{flex:1 1 140px}#protection-math .fall-calc-inputs input,#protection-math .fall-calc-inputs select{width:100%;background:var(--surface-2);border:1px solid var(--border);color:var(--text);border-radius:6px;padding:0.5rem 0.6rem;font-family:"Ubuntu",sans-serif;font-size:0.85rem}#protection-math .fall-calc-result{margin-top:1rem;background:var(--surface-2);border-radius:8px;padding:0.9rem 1rem;font-family:"Ubuntu",sans-serif;font-size:0.86rem}#protection-math .fall-calc-result .step{display:flex;justify-content:space-between;gap:0.6rem;padding:0.35rem 0}#protection-math .fall-calc-result .step + .step{border-top:1px dashed var(--border)}#protection-math .fall-calc-result .step.final{font-weight:700;color:var(--accent-strong);font-size:1rem}#protection-math .fall-calc-result .step.final span:last-child{display:flex;align-items:center;gap:0.5rem}#protection-math .fall-jump-link{color:var(--accent-strong);text-decoration:underline;font-size:0.78rem}#protection-math .fall-safe,#protection-math .fall-danger{font-family:"Ubuntu",sans-serif;font-size:0.62rem;font-weight:600;letter-spacing:0.04em;border-radius:3px;padding:0.1rem 0.4rem}#protection-math .fall-safe{background:var(--accent-soft);color:var(--accent-strong)}#protection-math .fall-danger{background:var(--amber-soft);color:var(--amber)}#protection-math table.epf-table{width:100%;border-collapse:collapse;margin-top:0.8rem;font-family:"Ubuntu",sans-serif;font-size:0.78rem}#protection-math table.epf-table th,#protection-math table.epf-table td{text-align:left;padding:0.35rem 0.5rem;border-bottom:1px solid var(--border)}#protection-math table.epf-table th{color:var(--text-muted);font-weight:500}#protection-math .damage-input{background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:1.1rem 1.3rem;display:flex;align-items:flex-end;gap:1.1rem;flex-wrap:wrap;box-shadow:var(--shadow)}#protection-math .damage-input .panel-title{flex:1 1 100%;margin-bottom:0.2rem}#protection-math .damage-input .field-pair{display:flex;flex-direction:column;gap:0.3rem}#protection-math .preset-note{display:none;flex:1 1 100%;background:var(--surface-2);border:1px solid var(--border);border-radius:8px;padding:0.6rem 0.8rem;color:var(--text-muted);font-size:0.8rem;line-height:1.5}#protection-math .preset-note.visible{display:block}#protection-math .damage-input label{font-family:"Ubuntu",sans-serif;font-size:0.7rem;letter-spacing:0.09em;text-transform:uppercase;color:var(--text-muted)}#protection-math .damage-input input[type="number"]{width:6rem;background:var(--surface-2);border:1px solid var(--border);color:var(--text);border-radius:6px;padding:0.45rem 0.6rem;font-family:"Ubuntu",sans-serif;font-size:0.9rem}#protection-math .damage-input input[type="number"]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}#protection-math .damage-input .hint{color:var(--text-muted);font-size:0.8rem}#protection-math .edition-toggle{display:flex;gap:0.4rem}#protection-math .edition-btn{font-family:"Ubuntu",sans-serif;font-size:0.8rem;font-weight:600;background:var(--surface-2);color:var(--text-muted);border:1px solid var(--border);border-radius:20px;padding:0.4rem 0.9rem;cursor:pointer}#protection-math .edition-btn:hover:not(.active){background:var(--border)}#protection-math .edition-btn.active{background:var(--accent);color:#ffffff;border-color:var(--accent)}#protection-math .row-value-effective{font-family:"Ubuntu",sans-serif;font-variant-numeric:tabular-nums;text-align:right;display:flex;flex-direction:column;align-items:flex-end;gap:0.15rem}#protection-math .row-value-effective .pct{font-size:0.92rem}#protection-math .row-value-effective .breakdown{font-size:0.66rem;color:var(--text-muted);white-space:nowrap}#protection-math #panel-effective .row.dim>*{opacity:0.35}#protection-math .dmg-short{display:none}#protection-math .explanation-intro{margin-top:1rem}#protection-math p.disclaimer{color:var(--text-muted);font-size:0.76rem;line-height:1.7;text-align:center;max-width:42em;margin:0 auto}#protection-math footer.credit{color:var(--text-muted);font-size:0.78rem;text-align:center}@media (max-width:720px){#protection-math .separator img{width:100%;height:auto}#protection-math #panel-effective{position:sticky;top:3.4rem;z-index:5;padding:0.6rem 0.8rem;row-gap:0.3rem}#protection-math #panel-effective .panel-title{padding-bottom:0.4rem;margin-bottom:0.1rem}#protection-math #panel-effective .panel-target{margin-top:-0.1rem;margin-bottom:0.2rem;font-size:0.72rem}#protection-math #panel-effective .row{display:flex;align-items:center;gap:0.5rem;padding:0.1rem 0;border-bottom:none}#protection-math #panel-effective .row-label{flex:0 0 5.8em;margin-bottom:0;overflow:hidden;white-space:nowrap}#protection-math #panel-effective .row-track{flex:1 1 auto;margin-bottom:0;height:8px}#protection-math #panel-effective .row-value-effective{flex:0 0 auto;align-items:flex-end}#protection-math #panel-effective .row-value-effective .breakdown{display:none}#protection-math #panel-effective .row-value-effective .pct{font-size:0.76rem;white-space:nowrap}#protection-math .dmg-full{display:none}#protection-math .dmg-short{display:inline}#protection-math .pieces{grid-template-columns:1fr;gap:0.6rem}#protection-math .piece-card{flex-direction:row;flex-wrap:wrap;align-items:center;gap:0.4rem 0.6rem;padding:0.6rem 0.8rem}#protection-math .piece-head{display:flex;align-items:center;gap:0.5rem;flex:1 1 auto;min-width:0;order:1}#protection-math .piece-icon{width:32px;height:32px;flex:none}#protection-math .piece-name{font-size:0.88rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}#protection-math .epf-readout{order:2;flex:0 0 auto}#protection-math .piece-fields{display:flex;flex-wrap:nowrap;gap:0.5rem;flex:1 1 100%;min-width:0;order:3}#protection-math .piece-fields .field-group{flex:1 1 0;min-width:0}#protection-math .readout-panel{grid-template-columns:1fr;row-gap:0}#protection-math .row{display:block;padding:0.75rem 0;border-bottom:1px solid var(--border)}#protection-math .row:last-of-type{border-bottom:none}#protection-math .row-label{margin-bottom:0.5rem}#protection-math .row-track{margin-bottom:0.5rem}#protection-math .row-value{justify-content:flex-start;white-space:normal}#protection-math .row-value-effective{align-items:flex-start}#protection-math .axis-row{display:none}}