:root{--dnd-primary:#3B68FC;--dnd-primary-hover:#294CC2;--dnd-primary-light:#7E9CFF;--dnd-primary-bg:rgba(59, 104, 252, 0.04);--dnd-background:#F7F9FF;--dnd-card-bg:#FFFFFF;--dnd-section-bg:#F8F9FB;--dnd-highlight-bg:#EBEFFF;--dnd-text:#212427;--dnd-text-secondary:#4B5259;--dnd-text-light:#748091;--dnd-border:#E2E8F0;--dnd-border-light:#F1F5F9;--dnd-border-hover:#CBD5E1;--dnd-border-focus:#7E9CFF;--dnd-border-accent:#E0E7FF;--dnd-error:#FF4059;--dnd-success:#28A745;--dnd-shadow:0 1px 3px rgba(0, 0, 0, 0.1);--dnd-shadow-hover:0 0 0 2px rgba(59, 104, 252, 0.15);--dnd-transition:0.2s ease;--dnd-radius:8px;--dnd-radius-sm:6px;--dnd-spacing:16px}.dnd-hp-calculator{max-width:600px;margin:0 auto;padding:var(--dnd-spacing);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:15px;line-height:1.41;color:var(--dnd-text)}.calculator-card{background:var(--dnd-card-bg);border:1px solid var(--dnd-border);border-radius:var(--dnd-radius);margin-bottom:4px;position:relative;box-shadow:var(--dnd-shadow)}.calculator-header{background:var(--dnd-card-bg);padding:var(--dnd-spacing) 24px;border-bottom:1px solid var(--dnd-border-light)}.calculator-title{margin:0;font-size:20px;font-weight:600;color:var(--dnd-text);line-height:24px}.calculator-body{padding:24px;background:var(--dnd-card-bg);position:relative}.form-section{margin-bottom:24px}.form-section:last-child{margin-bottom:0}.section-title{margin:0 0 12px 0;font-size:14px;font-weight:600;color:var(--dnd-text);line-height:20px}.form-row{display:grid;grid-template-columns:1fr 120px;gap:var(--dnd-spacing);position:relative}.form-group{position:relative}.form-group.class-group{grid-column:1}.form-group.level-group{grid-column:2}.form-label{display:block;margin-bottom:8px;font-weight:500;color:var(--dnd-text);font-size:13.4px;line-height:20px}.form-control{width:100%;padding:1px 16px;border:1px solid var(--dnd-border-accent);border-radius:var(--dnd-radius-sm);font-size:14px;font-weight:400;transition:all var(--dnd-transition);background-color:var(--dnd-card-bg);color:var(--dnd-text)}.form-control:hover{border-color:var(--dnd-border-hover)}.form-control:focus{outline:none;border-color:var(--dnd-primary);box-shadow:var(--dnd-shadow-hover)}select.form-control{appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath fill='%23748091' fill-rule='evenodd' clip-rule='evenodd' d='M3.27418 7.27465C2.9086 7.6396 2.9086 8.22798 3.27418 8.59293L9.47402 14.7821C9.76499 15.0726 10.235 15.0726 10.526 14.7821L16.7258 8.59293C17.0914 8.22798 17.0914 7.6396 16.7258 7.27465C16.3602 6.9097 15.7708 6.9097 15.4053 7.27465L9.99627 12.6669L4.58726 7.2672C4.22915 6.9097 3.63229 6.9097 3.27418 7.27465Z'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:calc(100% - 12px) center;background-size:20px;padding-right:44px;cursor:pointer}input[type="number"].form-control{-moz-appearance:textfield;text-align:center}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.bonus-options{display:flex;flex-direction:column;gap:12px}.checkbox-group{margin:0}.checkbox-label{display:flex;align-items:center;cursor:pointer;user-select:none;gap:12px;padding:8px 0}.checkbox-label:hover .checkbox-text{color:var(--dnd-primary)}.bonus-checkbox{width:20px;height:20px;cursor:pointer;accent-color:var(--dnd-primary)}.checkbox-text{font-size:13.4px;color:var(--dnd-text);transition:color var(--dnd-transition)}.multiclass-toggle-btn{width:100%;padding:14px 16px;background:var(--dnd-card-bg);border:1px solid var(--dnd-border);border-radius:var(--dnd-radius-sm);color:var(--dnd-primary);font-size:14px;font-weight:500;cursor:pointer;transition:all var(--dnd-transition);margin-top:16px;display:flex;align-items:center;justify-content:center;gap:8px}.multiclass-toggle-btn:hover{background:var(--dnd-primary-bg);border-color:var(--dnd-primary)}.multiclass-toggle-btn.active{background:var(--dnd-primary);color:#fff;border-color:var(--dnd-primary)}.multiclass-toggle-btn:before{content:'+';font-size:18px;font-weight:300}.multiclass-toggle-btn.active:before{content:'−'}.multiclass-section{margin-top:var(--dnd-spacing);padding-top:var(--dnd-spacing);border-top:1px solid var(--dnd-border-light)}.multiclass-group{margin-bottom:var(--dnd-spacing);padding:var(--dnd-spacing);background:var(--dnd-section-bg);border-radius:var(--dnd-radius-sm);border:1px solid var(--dnd-border-accent)}.multiclass-title{margin:0 0 12px 0;font-size:13.4px;font-weight:600;color:var(--dnd-text)}.calculator-results{border-top:1px solid var(--dnd-border-light);padding:24px;background:var(--dnd-card-bg)}.results-card{text-align:center}.hp-display{background:linear-gradient(135deg,var(--dnd-highlight-bg) 0%,var(--dnd-primary-bg) 100%);border-radius:var(--dnd-radius);padding:32px 20px;margin-bottom:24px;text-align:center;border:1px solid var(--dnd-border-accent)}.hp-number{display:flex;align-items:baseline;justify-content:center;gap:8px;margin-bottom:8px}.hp-value{font-size:56px;font-weight:700;color:var(--dnd-primary);line-height:1;letter-spacing:-.02em}.hp-label{font-size:20px;font-weight:600;color:var(--dnd-text)}.character-level{font-size:14px;color:var(--dnd-text-secondary);font-weight:500}.calculation-details{display:flex;justify-content:center;gap:32px;margin-bottom:24px;flex-wrap:wrap}.detail-item{display:flex;flex-direction:column;align-items:center}.detail-label{font-size:11px;color:var(--dnd-text-secondary);margin-bottom:4px;font-weight:400}.detail-value{font-size:16px;font-weight:600;color:var(--dnd-text)}.action-buttons{margin-bottom:20px}.roll-hp-btn{padding:12px 24px;background:var(--dnd-primary);color:#fff;border:none;border-radius:var(--dnd-radius-sm);font-size:14px;font-weight:600;cursor:pointer;transition:all var(--dnd-transition);min-width:140px;box-shadow:0 2px 4px rgb(59 104 252 / .2)}.roll-hp-btn:hover:not(:disabled){background:var(--dnd-primary-hover);transform:translateY(-1px);box-shadow:0 4px 8px rgb(59 104 252 / .3)}.roll-hp-btn:active{transform:translateY(0)}.roll-hp-btn:disabled{opacity:.5;cursor:not-allowed;box-shadow:none}.dice-results{background:var(--dnd-section-bg);padding:16px;border-radius:var(--dnd-radius-sm);text-align:left;margin-top:16px}.dice-title{margin:0 0 12px 0;font-size:13.4px;font-weight:600;color:var(--dnd-text)}.dice-breakdown{font-size:13.4px;line-height:1.6}.dice-roll-item{margin-bottom:8px;padding:4px 0}.dice-roll-class{font-weight:600;color:var(--dnd-primary)}.dice-roll-value{color:var(--dnd-text);margin-left:8px}.calculator-errors{margin-top:var(--dnd-spacing);padding:12px 16px;background:#FEF3F2;border:1px solid #FCA5A5;border-radius:var(--dnd-radius-sm);color:var(--dnd-error)}.error-message{font-size:13.4px;font-weight:500;margin:0}.calculator-loading{opacity:.6;pointer-events:none}@keyframes fadeIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.multiclass-group{animation:fadeIn 0.3s ease}@media (max-width:640px){.dnd-hp-calculator{padding:8px}.calculator-header{padding:16px}.calculator-title{font-size:18px}.calculator-body,.calculator-results{padding:16px}.form-row{grid-template-columns:1fr;gap:12px}.form-group.class-group,.form-group.level-group{grid-column:1}.form-group{margin-bottom:0}.form-control{width:100%;min-height:48px;font-size:16px}.multiclass-toggle-btn{min-height:48px;font-size:16px}.checkbox-label{padding:12px 0;min-height:48px}.bonus-checkbox{width:24px;height:24px}.hp-display{padding:24px 16px}.hp-value{font-size:42px}.hp-label{font-size:18px}.calculation-details{gap:16px;flex-wrap:wrap}.detail-item{min-width:80px}.detail-value{font-size:15px}.roll-hp-btn{min-height:48px;width:100%;font-size:16px}.multiclass-group{padding:12px}}@media (max-width:375px){.calculator-header{padding:12px}.calculator-body,.calculator-results{padding:12px}.calculator-title{font-size:16px}.section-title{font-size:12px}.form-label{font-size:12px}.hp-value{font-size:32px}}@media (min-width:641px) and (max-width:768px){.calculator-card{margin:0 auto;max-width:600px}.form-row{grid-template-columns:2fr 1fr}}.dnd-hp-calculator *:focus-visible{outline:2px solid var(--dnd-primary);outline-offset:2px}@media (prefers-contrast:high){.calculator-card{border:2px solid var(--dnd-text)}.form-control{border-width:2px}.roll-hp-btn{border:2px solid var(--dnd-text)}}@media (prefers-color-scheme:dark){.theme-dark .dnd-hp-calculator{--dnd-background:#0F1117;--dnd-card-bg:#1A1D29;--dnd-section-bg:#232635;--dnd-highlight-bg:#2A2E42;--dnd-text:#E0E0E0;--dnd-text-secondary:#B0B0B0;--dnd-text-light:#808080;--dnd-border:#2D3142;--dnd-border-light:#363A4F;--dnd-border-accent:#3A3F5C}.theme-dark .form-control{background-color:var(--dnd-section-bg);color:var(--dnd-text)}.theme-dark select.form-control{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath fill='%237E9CFF' fill-rule='evenodd' clip-rule='evenodd' d='M3.27418 7.27465C2.9086 7.6396 2.9086 8.22798 3.27418 8.59293L9.47402 14.7821C9.76499 15.0726 10.235 15.0726 10.526 14.7821L16.7258 8.59293C17.0914 8.22798 17.0914 7.6396 16.7258 7.27465C16.3602 6.9097 15.7708 6.9097 15.4053 7.27465L9.99627 12.6669L4.58726 7.2672C4.22915 6.9097 3.63229 6.9097 3.27418 7.27465Z'/%3E%3C/svg%3E")}}@media print{.dnd-hp-calculator{max-width:100%}.calculator-card{box-shadow:none;border:1px solid #000}.multiclass-toggle-btn,.roll-hp-btn{display:none}}