﻿:root {
            --bg-color: #0d0f12;
            --panel-bg: #161920;
            --accent-color: #ff3e3e;
            --accent-glow: rgba(255, 62, 62, 0.4);
            --text-main: #f0f3f8;
            --text-muted: #8a96a3;
            --safe-color: #00ffcc;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
            background-color: var(--bg-color);
            color: var(--text-main);
            margin: 0;
            padding: 20px;
            display: flex;
            justify-content: center;
        }

        .visually-hidden {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
            clip-path: inset(50%);
        }

        .container {
            width: 100%;
            max-width: 1160px;
            background: var(--panel-bg);
            border-radius: 12px;
            padding: 24px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
            border: 1px solid #232936;
        }

        h1 {
            margin: 0;
            font-size: clamp(1.2rem, 2.4vw, 1.8rem);
            color: #fff;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .page-header {
            position: relative;
            z-index: 20;
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
            align-items: center;
            gap: 8px 20px;
            padding-bottom: 15px;
            border-bottom: 2px solid #232936;
        }

        .page-header h1 {
            grid-column: 2;
            position: relative;
            width: max-content;
            max-width: calc(100% - 30px);
            margin-inline: auto;
            text-align: center;
        }

        .build-version {
            grid-column: 3;
            margin: 0;
            color: var(--text-muted);
            font-size: 0.78rem;
            font-weight: 600;
            letter-spacing: 0.04em;
            text-align: right;
        }

        .build-version span {
            color: #d9c8f4;
            white-space: nowrap;
        }

        @media (min-width: 761px) {
            .page-header h1 {
                max-width: none;
                white-space: nowrap;
            }
        }

        @media (min-width: 761px) and (max-width: 1100px) {
            .page-header {
                grid-template-columns: minmax(0, 1fr);
            }

            .page-header h1,
            .build-version {
                grid-column: 1;
            }

            .page-header h1 {
                grid-row: 1;
            }

            .build-version {
                grid-row: 2;
                text-align: center;
            }

        }

        .tooltip-wrap {
            position: relative;
            display: inline-flex;
            align-items: center;
        }

        .tooltip-trigger {
            cursor: help;
        }

        .info-trigger:focus-visible {
            outline: 2px solid var(--safe-color);
            outline-offset: 4px;
        }

        .tooltip-panel {
            position: absolute;
            z-index: 20;
            top: calc(100% + 10px);
            left: 50%;
            display: grid;
            box-sizing: border-box;
            width: min(290px, calc(100vw - 48px));
            max-height: min(60vh, 420px);
            gap: 8px;
            overflow-y: auto;
            padding: 12px 14px;
            border: 1px solid #596277;
            border-radius: 8px;
            background: #10131a;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
            color: var(--text-main);
            font-size: 0.78rem;
            font-weight: 400;
            line-height: 1.45;
            letter-spacing: normal;
            text-align: left;
            text-transform: none;
            opacity: 0;
            pointer-events: none;
            transform: translate(-50%, -4px);
        }

        .tooltip-panel::before {
            position: absolute;
            top: -10px;
            right: 0;
            left: 0;
            height: 10px;
            content: "";
        }

        .tooltip-wrap:hover > .tooltip-panel,
        .tooltip-wrap:focus-within > .tooltip-panel {
            opacity: 1;
            pointer-events: auto;
            transform: translate(-50%, 0);
        }

        .title-tooltip {
            position: absolute;
            top: 50%;
            left: calc(100% + 8px);
            display: inline-flex;
            transform: translateY(-50%);
        }

        .ability-info-tooltip {
            right: auto;
            left: 50%;
            grid-template-columns: minmax(0, 1fr);
            width: min(460px, calc(100vw - 56px));
            max-height: none;
            overflow: visible;
            white-space: normal;
            transform: translate(-50%, -4px);
        }

        .ability-info-tooltip > span {
            min-width: 0;
            overflow-wrap: anywhere;
        }

        .title-tooltip:hover > .ability-info-tooltip,
        .title-tooltip:focus-within > .ability-info-tooltip {
            transform: translate(-50%, 0);
        }

        @media (min-width: 761px) and (max-width: 1100px) {
            .ability-info-tooltip {
                right: -16px;
                left: auto;
                transform: translateY(-4px);
            }

            .title-tooltip:hover > .ability-info-tooltip,
            .title-tooltip:focus-within > .ability-info-tooltip {
                transform: translateY(0);
            }
        }

        .tooltip-title {
            font-size: 0.95rem;
            font-weight: 700;
        }

        .tooltip-panel a {
            color: #c49af2;
            text-underline-offset: 2px;
        }

        .tooltip-panel a:hover {
            color: #e2c9ff;
        }

        .tooltip-description {
            padding-bottom: 6px;
            border-bottom: 1px solid #343c4b;
        }

        .info-trigger {
            display: inline-grid;
            width: 22px;
            height: 22px;
            place-items: center;
            padding: 0;
            border: 1px solid #69758a;
            border-radius: 50%;
            background: #1c2029;
            color: var(--text-main);
            font: inherit;
            font-size: 0.78rem;
            font-weight: 700;
            line-height: 1;
        }

        .charge-tooltip {
            position: absolute;
            z-index: 4;
            top: 3px;
            left: calc(100% + 8px);
        }

        .orb-composite:has(.charge-tooltip:hover),
        .orb-composite:has(.charge-tooltip:focus-within) {
            z-index: 10;
        }

        .charge-tooltip > .tooltip-panel {
            top: 0;
            left: calc(100% + 8px);
            z-index: 1000;
            width: min(290px, 24vw);
            transform: translateY(-4px);
        }

        .charge-tooltip:hover > .tooltip-panel,
        .charge-tooltip:focus-within > .tooltip-panel {
            transform: translateY(0);
        }

        .calculator-hud {
            display: grid;
            justify-items: center;
            gap: 12px;
            margin-top: 16px;
            padding: 16px 24px 18px;
            border: 1px solid #2a313f;
            border-radius: 12px;
            background:
                radial-gradient(ellipse at 50% 20%, rgba(126, 67, 196, 0.16), transparent 46%),
                linear-gradient(135deg, #171b24, #12151c 70%);
        }

        .hud-orb-column {
            display: flex;
            min-width: 0;
            flex-direction: column;
            align-items: center;
            width: 100%;
        }

        .hud-result {
            display: flex;
            flex-direction: column;
            align-items: center;
            margin-bottom: -12px;
            z-index: 3;
        }

        .orb-composite {
            position: relative;
            width: min(100%, 230px);
            aspect-ratio: 1;
            display: grid;
            place-items: center;
            isolation: isolate;
        }

        .orb-charge-row {
            position: relative;
            align-items: center;
            display: flex;
            justify-content: center;
            width: min(100%, 560px);
        }

        .orb-charge-label {
            position: absolute;
            width: 1px;
            height: 1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            clip-path: inset(50%);
        }

        .hud-orb-column .charge-steppers {
            position: absolute;
            top: 50%;
            right: 0;
            margin: 0;
            transform: translateY(-50%);
        }

        .hud-controls {
            display: grid;
            justify-items: center;
            width: min(100%, 760px);
            gap: 12px;
            min-width: 0;
            align-content: start;
        }

        .hud-controls .control-group {
            min-width: 0;
            margin: 0;
            width: 100%;
        }

        .control-heading {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 7px;
            margin-bottom: 3px;
        }

        .control-heading label {
            margin: 0;
            text-align: center;
        }

        .energy-group > .control-heading .control-label {
            display: block;
        }

        .energy-adjust-row {
            position: relative;
            display: flex;
            justify-content: center;
            align-items: center;
            width: min(100%, 700px);
            margin: 0 auto;
        }

        .energy-visual {
            position: relative;
            width: min(100%, 210px);
            margin: 0 auto;
        }

        .energy-steppers {
            position: absolute;
            top: 50%;
            right: 0;
            margin: 0;
            transform: translateY(-50%);
        }

        .energy-presets {
            width: min(100%, 210px);
            margin: 2px auto 0;
        }

        .distance-control .input-row {
            display: grid;
            grid-template-columns: 60px minmax(0, 1fr) 60px;
            width: min(100%, 600px);
            margin: 0 auto;
            gap: 0;
        }

        .distance-control .input-row input[type="range"] {
            grid-column: 2;
            width: 100%;
            min-width: 0;
            margin: 0;
        }

        .distance-slider-wrap {
            position: relative;
            grid-column: 2;
            min-width: 0;
        }

        .distance-control .distance-slider-wrap input[type="range"] {
            display: block;
            width: 100%;
            height: 18px;
            margin: 0;
            accent-color: var(--accent-color);
        }

        .distance-control .distance-slider-wrap input[type="range"]::-webkit-slider-thumb {
            width: 16px;
            height: 16px;
        }

        .distance-control .distance-slider-wrap input[type="range"]::-moz-range-thumb {
            width: 16px;
            height: 16px;
        }

        .distance-radius-marker {
            position: absolute;
            z-index: 1;
            top: 50%;
            left: calc(8px + var(--radius-percent, 62.5%) - var(--radius-thumb-offset, 10px));
            width: 2px;
            height: 14px;
            border-radius: 2px;
            background: #fff;
            box-shadow: 0 0 0 1px #161920, 0 0 5px rgba(255, 255, 255, 0.85);
            pointer-events: none;
            transform: translate(-50%, -50%);
        }

        .distance-control .value-display {
            grid-column: 3;
            width: auto;
        }

        .distance-readout {
            margin-top: 6px;
            color: var(--text-muted);
            font-size: 0.78rem;
            text-align: center;
        }

        #radiusInfo {
            margin: 0;
            color: #d9c8f4;
            font-size: inherit;
        }

        @media (max-width: 760px) {
            .page-header {
                grid-template-columns: minmax(0, 1fr);
            }

            .page-header h1,
            .build-version {
                grid-column: 1;
            }

            .page-header h1 {
                grid-row: 1;
            }

            .page-header h1 {
                max-width: calc(100% - 30px);
            }

            .build-version {
                grid-row: 2;
                text-align: center;
            }

            .ability-info-tooltip {
                right: -16px;
                left: auto;
                transform: translateY(-4px);
            }

            .title-tooltip:hover > .ability-info-tooltip,
            .title-tooltip:focus-within > .ability-info-tooltip {
                transform: translateY(0);
            }

            .calculator-hud {
                gap: 12px;
                padding: 16px 14px 18px;
            }

            .orb-composite {
                width: min(100%, 190px);
            }

            .orb-charge-row {
                width: min(100%, 360px);
            }

            .energy-adjust-row {
                width: min(100%, 600px);
            }
        }

        .control-group {
            margin-bottom: 20px;
        }

        label {
            display: block;
            font-weight: 600;
            margin-bottom: 8px;
            color: var(--text-muted);
            font-size: 0.9rem;
            text-transform: uppercase;
        }

        .control-label {
            font-weight: 600;
            color: var(--text-muted);
            font-size: 0.9rem;
            text-transform: uppercase;
        }

        .input-row {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .shape-input-row {
            align-items: center;
        }

        input[type="range"] {
            flex: 1;
            accent-color: var(--accent-color);
        }

        .shape-slider {
            position: relative;
            flex: 0 0 auto;
            touch-action: none;
            user-select: none;
            cursor: pointer;
            outline: none;
        }

        .shape-slider:focus-visible {
            outline: 2px solid var(--safe-color);
            outline-offset: 5px;
        }

        button:focus-visible,
        input:focus-visible {
            outline: 2px solid var(--safe-color);
            outline-offset: 3px;
        }

        .circle-control {
            position: absolute;
            inset: 0;
            z-index: 1;
            width: 100%;
            height: 100%;
        }

        .circle-control svg,
        .energy-control svg {
            display: block;
            width: 100%;
            height: 100%;
            overflow: visible;
        }

        .charge-track,
        .charge-progress {
            fill: none;
            stroke-width: 8;
        }

        .charge-track {
            stroke: #2a313f;
        }

        .charge-progress {
            stroke: var(--accent-color);
            stroke-linecap: round;
            filter: drop-shadow(0 0 5px var(--accent-glow));
        }

        .charge-thumb {
            fill: #fff;
            stroke: var(--accent-color);
            stroke-width: 4;
        }

        .charge-value {
            position: absolute;
            top: 7px;
            left: 50%;
            transform: translateX(-50%);
            padding: 3px 7px;
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 999px;
            background: rgba(15, 17, 24, 0.88);
            color: #fff;
            font-family: monospace;
            font-size: 0.78rem;
            font-weight: bold;
            pointer-events: none;
            white-space: nowrap;
        }

        .energy-control {
            display: block;
            width: 100%;
            min-width: 0;
            aspect-ratio: 200 / 105;
        }

        .energy-outline {
            fill: #2a313f;
            stroke: #566071;
            stroke-width: 2;
            stroke-linejoin: round;
        }

        .energy-fill {
            fill: var(--accent-color);
            filter: drop-shadow(0 0 5px var(--accent-glow));
        }

        .energy-center-mark {
            stroke: #f0f3f8;
            stroke-width: 1.5;
            stroke-dasharray: 3 3;
            opacity: 0.75;
        }

        .energy-zero {
            fill: var(--text-muted);
            font-family: monospace;
            font-size: 10px;
            text-anchor: middle;
        }

        .shape-value {
            position: absolute;
            right: 7%;
            bottom: 10%;
            z-index: 1;
            width: auto;
            min-width: 0;
            color: #fff;
            font-size: 0.95rem;
            text-shadow: 0 1px 5px #111;
            pointer-events: none;
        }

        .step-controls {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 12px;
        }

        .stepper-controls {
            align-items: center;
            gap: 16px;
        }

        .stepper-group {
            display: flex;
            align-items: center;
            gap: 7px;
        }

        .stepper-buttons {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .step-controls .stepper-buttons button {
            width: 30px;
            min-width: 30px;
            height: 22px;
            padding: 0;
            line-height: 1;
            font-size: 0.9rem;
        }

        .stepper-size {
            min-width: 32px;
            color: var(--text-main);
            font-family: monospace;
            font-size: 0.9rem;
            text-align: left;
        }

        .energy-steppers .stepper-group {
            gap: 4px;
        }

        .energy-steppers .stepper-size {
            min-width: 20px;
        }

        .energy-steppers .stepper-buttons button {
            width: 26px;
            min-width: 26px;
        }

        .step-controls button {
            min-width: 56px;
            padding: 7px 10px;
            border: 1px solid #343c4b;
            border-radius: 5px;
            background: #1c2029;
            color: var(--text-main);
            font: inherit;
            font-size: 0.85rem;
            cursor: pointer;
        }

        .step-controls button:hover {
            border-color: var(--accent-color);
            background: #252a35;
        }

        .step-controls button:focus-visible {
            outline: 2px solid var(--safe-color);
            outline-offset: 2px;
        }

        .step-controls .preset-button {
            min-width: 0;
            flex: 1;
        }

        .control-value-input {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        .value-display {
            width: 60px;
            text-align: right;
            font-family: monospace;
            font-size: 1.1rem;
            font-weight: bold;
            color: #fff;
        }

        .damage-range {
            margin: -4px 0 8px;
            color: var(--text-muted);
            font-size: 0.9rem;
            font-weight: 600;
            text-align: center;
        }

        .damage-sphere {
            display: block;
            position: relative;
            z-index: 2;
            width: 68%;
            margin: 0;
            overflow: visible;
            pointer-events: none;
        }

        .sphere-outline {
            stroke: rgba(215, 187, 255, 0.65);
            stroke-width: 1.5;
        }

        .sphere-glow {
            fill: url(#sphereGlow);
            opacity: 0.55;
        }

        .sphere-shading {
            fill: url(#sphereShade);
        }

        .sphere-falloff {
            fill: url(#sphereFalloffGradient);
        }

        .sphere-crater {
            fill: rgba(39, 18, 75, 0.35);
            stroke: rgba(220, 192, 255, 0.16);
            stroke-width: 1;
        }

        .sphere-range {
            fill: none;
            stroke: rgba(255, 255, 255, 0.72);
            stroke-width: 1.5;
            stroke-dasharray: 4 5;
        }

        .sphere-distance-axis {
            stroke: rgba(255, 255, 255, 0.42);
            stroke-width: 1;
            stroke-dasharray: 3 4;
        }

        .sphere-distance-glow {
            fill: rgba(234, 205, 255, 0.28);
            filter: drop-shadow(0 0 7px rgba(226, 181, 255, 0.85));
            transition: cx 120ms ease, opacity 120ms ease;
        }

        .sphere-distance-dot {
            fill: #f7ecff;
            stroke: #8d4ed1;
            stroke-width: 1.5;
            transition: cx 120ms ease, opacity 120ms ease;
        }

        .sphere-center {
            fill: #fff;
            stroke: rgba(236, 208, 255, 0.75);
            stroke-width: 4;
            filter: drop-shadow(0 0 6px rgba(230, 187, 255, 0.95));
        }

        .sphere-distance-label {
            fill: var(--text-main);
            font-family: monospace;
            font-size: 11px;
            font-weight: bold;
            text-anchor: middle;
            paint-order: stroke;
            stroke: #160f20;
            stroke-width: 3px;
            stroke-linejoin: round;
        }

        .damage-value {
            font-size: 2.8rem;
            font-weight: 900;
            color: var(--accent-color);
            text-shadow: 0 0 20px var(--accent-glow);
            margin: 0;
            font-family: monospace;
        }

        .status-badge {
            padding: 6px 12px;
            border-radius: 4px;
            font-weight: bold;
            font-size: 0.85rem;
            text-transform: uppercase;
        }

        .roster-section {
            margin-top: 30px;
        }

        .roster-header {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
        }

        .roster-title {
            margin: 0;
            font-size: 1.17em;
        }

        .roster-name-toggle {
            display: none;
        }

        .roster-display-toggles {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: flex-end;
            gap: 8px 12px;
            margin-left: auto;
        }

        .roster-display-toggle {
            position: relative;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            margin: 0;
            color: var(--text-main);
            font-size: 0.78rem;
            font-weight: 600;
            text-transform: none;
            letter-spacing: 0;
            cursor: pointer;
        }

        .roster-display-toggle input {
            position: absolute;
            z-index: 1;
            width: 42px;
            height: 24px;
            margin: 0;
            opacity: 0;
            cursor: pointer;
        }

        .roster-toggle-switch {
            position: relative;
            display: inline-flex;
            flex: 0 0 auto;
            width: 42px;
            height: 24px;
            align-items: center;
            padding: 3px;
            box-sizing: border-box;
            border: 1px solid #596277;
            border-radius: 999px;
            background: #252a35;
            box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
            transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
        }

        .roster-toggle-switch::after {
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: #c5ccd8;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
            content: "";
            transition: background-color 140ms ease, transform 140ms ease;
        }

        .roster-display-toggle input:checked + .roster-toggle-switch {
            border-color: #9d68df;
            background: #7133bd;
        }

        .roster-display-toggle input:checked + .roster-toggle-switch::after {
            background: #fff;
            transform: translateX(18px);
        }

        .roster-display-toggle input:focus-visible + .roster-toggle-switch {
            outline: 2px solid var(--safe-color);
            outline-offset: 3px;
        }

        .roster-display-toggle:hover .roster-toggle-switch {
            border-color: #b7c8e8;
        }

        .roster-display-toggle input:checked:hover + .roster-toggle-switch {
            border-color: #c49af2;
        }

        .roster-section.hide-hero-hp .hero-avatar .hero-hp,
        .roster-section.hide-hero-hp .hero-avatar .hero-health-meter {
            display: none;
        }

        .roster-groups {
            display: grid;
            gap: 18px;
            margin-top: 12px;
        }

        .roster-note {
            margin: 8px 0 0;
            color: var(--text-muted);
            font-size: 0.72rem;
            line-height: 1.35;
        }

        .site-disclaimer {
            margin-top: 24px;
            padding-top: 12px;
            border-top: 1px solid #2a313f;
            color: var(--text-muted);
            font-size: 0.7rem;
            line-height: 1.5;
            text-align: center;
        }

        .site-disclaimer p {
            max-width: 900px;
            margin: 0 auto;
        }

        .site-footer-links {
            display: flex;
            justify-content: flex-end;
            margin-top: 8px;
        }

        .github-link {
            display: inline-flex;
            width: 28px;
            height: 28px;
            align-items: center;
            justify-content: center;
            color: var(--text-muted);
        }

        .github-link svg {
            display: block;
            width: 20px;
            height: 20px;
            fill: white;
        }

        .github-link:hover {
            color: var(--text-main);
        }

        .site-disclaimer a {
            color: #c49af2;
            text-underline-offset: 2px;
        }

        .site-disclaimer a:hover {
            color: #e2c9ff;
        }

        .site-disclaimer a:focus-visible {
            outline: 2px solid var(--safe-color);
            outline-offset: 3px;
        }

        .role-section {
            min-width: 0;
        }

        .role-heading {
            margin: 0 0 8px;
            color: var(--text-main);
            font-size: 0.9rem;
            text-transform: uppercase;
            letter-spacing: 0.06em;
        }

        .roster-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
            gap: 12px 8px;
            margin: 0;
            padding: 0;
            list-style: none;
        }

        .hero-card {
            min-width: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 3px;
            text-align: center;
        }

        .hero-avatar-wrap {
            position: relative;
            width: 68px;
            height: 68px;
        }

        .hero-avatar {
            position: relative;
            width: 100%;
            height: 100%;
            display: grid;
            place-items: center;
            overflow: hidden;
            border: 2px solid #596277;
            border-radius: 16px;
            background: radial-gradient(circle at 35% 30%, #49366c, #1c2029 75%);
            color: var(--text-main);
            font-family: monospace;
            font-size: 0.85rem;
            font-weight: bold;
            transition: filter 0.2s ease, opacity 0.2s ease, border-color 0.2s ease;
        }

        .hero-avatar .hero-hp {
            position: absolute;
            z-index: 3;
            right: -2px;
            bottom: 8px;
            left: -2px;
            margin: 0;
            color: #fff;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            font-size: 0.72rem;
            font-weight: 800;
            letter-spacing: -0.08em;
            line-height: 1.1;
            text-align: center;
            text-shadow:
                -1px -1px 2px #000,
                1px -1px 2px #000,
                -1px 1px 2px #000,
                1px 1px 2px #000,
                0 0 4px #000;
            white-space: nowrap;
        }

        .hero-icon {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .hero-health-meter {
            position: absolute;
            z-index: 2;
            right: 4px;
            bottom: 1px;
            left: 4px;
            height: 6px;
            overflow: hidden;
            pointer-events: none;
        }

        .hero-health-remaining {
            position: absolute;
            inset: 0 auto 0 0;
            width: 100%;
            background: #fff;
            transition: width 220ms ease;
        }

        .hero-card.eliminated .hero-avatar {
            border-color: rgba(255, 62, 62, 0.75);
        }

        .hero-card .status-badge {
            position: absolute;
            z-index: 4;
            right: -5px;
            top: -4px;
            bottom: auto;
            display: none;
            padding: 2px 5px;
            border: 1px solid #171920;
            border-radius: 5px;
            background: var(--accent-color);
            color: #fff;
            font-size: 0.58rem;
            font-weight: 800;
            line-height: 1.2;
            letter-spacing: 0.04em;
        }

        .hero-card.eliminated .status-badge {
            display: block;
        }

        .hero-details {
            width: 100%;
            min-width: 0;
            line-height: 1.15;
        }

        .hero-name {
            display: -webkit-box;
            overflow: hidden;
            min-height: 0;
            font-size: 0.72rem;
            font-weight: 500;
            line-clamp: 2;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
        }

        .roster-section:not(.show-hero-names) .hero-name {
            display: none;
        }

        .hero-hp {
            display: block;
            margin-top: 2px;
            font-family: monospace;
            color: #b7c8e8;
            font-size: 0.72rem;
            font-weight: 600;
            line-height: 1;
            white-space: nowrap;
        }

        @media (max-width: 520px) {
            .charge-tooltip > .tooltip-panel,
            .hud-controls .tooltip-panel {
                position: fixed;
                top: 50%;
                left: 50%;
                width: min(290px, calc(100vw - 48px));
                transform: translate(-50%, -50%);
            }

            .charge-tooltip:hover > .tooltip-panel,
            .charge-tooltip:focus-within > .tooltip-panel,
            .hud-controls .tooltip-wrap:hover > .tooltip-panel,
            .hud-controls .tooltip-wrap:focus-within > .tooltip-panel {
                transform: translate(-50%, -50%);
            }

            .container {
                padding: 18px;
            }

            .hud-orb-column .charge-steppers {
                flex-direction: column;
                align-items: flex-start;
                gap: 5px;
            }

            .orb-charge-row {
                width: 100%;
            }

            .charge-steppers .stepper-buttons button {
                width: 23px;
                min-width: 23px;
            }

            .charge-steppers .stepper-group {
                gap: 2px;
            }

            .charge-steppers .stepper-size {
                min-width: 25px;
                font-size: 0.65rem;
            }

            .energy-adjust-row {
                display: block;
                width: 100%;
            }

            .energy-visual {
                width: min(100%, 190px);
            }

            .energy-steppers {
                position: static;
                justify-content: center;
                gap: 12px;
                margin-top: 8px;
                transform: none;
            }

            .energy-steppers .stepper-group {
                gap: 2px;
            }

            .energy-steppers .stepper-size {
                min-width: 20px;
            }

            .roster-grid {
                grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
                gap: 10px 6px;
            }

            .hero-avatar-wrap {
                width: 60px;
                height: 60px;
            }

            .hero-name {
                font-size: 0.68rem;
            }
        }

        @media (min-width: 1200px) {
            .container {
                max-width: 1600px;
                padding: 13px 20px;
            }

            .page-header {
                margin-bottom: 8px;
                padding-bottom: 8px;
            }

            h1 {
                font-size: 1.5rem;
            }

            .build-version {
                font-size: 0.72rem;
            }

            .calculator-hud {
                grid-template-columns: repeat(3, minmax(0, 340px));
                grid-template-rows: auto minmax(180px, auto);
                align-items: center;
                justify-content: center;
                gap: 8px 16px;
                margin-top: 12px;
                padding: 10px 16px;
            }

            .hud-orb-column {
                display: contents;
            }

            .hud-result {
                grid-column: 1 / -1;
                grid-row: 1;
                justify-self: center;
                margin: 0;
            }

            .damage-value {
                font-size: 2.4rem;
            }

            .damage-range {
                max-width: none;
                margin: 0;
                font-size: 0.8rem;
            }

            .orb-charge-row {
                grid-column: 1;
                grid-row: 2;
                justify-self: center;
                width: 300px;
            }

            .orb-composite {
                width: 160px;
            }

            .hud-orb-column .charge-steppers {
                right: 0;
                flex-direction: column;
                gap: 5px;
            }

            .charge-steppers .stepper-buttons button {
                width: 25px;
                min-width: 25px;
            }

            .charge-steppers .stepper-size {
                min-width: 28px;
                font-size: 0.72rem;
            }

            .hud-controls {
                display: contents;
            }

            .hud-controls .control-group {
                width: min(100%, 340px);
            }

            .energy-group {
                grid-column: 2;
                grid-row: 2;
                align-self: center;
            }

            .distance-control {
                grid-column: 3;
                grid-row: 2;
                align-self: center;
            }

            .control-heading {
                margin-bottom: 4px;
            }

            .control-heading label,
            .control-heading .control-label {
                font-size: 0.78rem;
            }

            .energy-adjust-row {
                width: 100%;
            }

            .energy-visual {
                width: min(100%, 150px);
                flex: 0 1 150px;
                margin: 0;
            }

            .energy-steppers {
                position: static;
                flex: 0 0 auto;
                justify-content: center;
                gap: 7px;
                margin-left: 8px;
                transform: none;
            }

            .energy-steppers .stepper-group {
                gap: 2px;
            }

            .energy-steppers .stepper-buttons button {
                width: 23px;
                min-width: 23px;
            }

            .energy-steppers .stepper-size {
                min-width: 18px;
                font-size: 0.72rem;
            }

            .energy-presets {
                width: min(100%, 230px);
                margin-top: 0;
            }

            .distance-control .input-row {
                grid-template-columns: 24px minmax(0, 1fr) 48px;
                width: 100%;
            }

            .distance-control .value-display {
                font-size: 0.95rem;
            }

            .distance-readout {
                margin-top: 3px;
                font-size: 0.7rem;
            }

            .roster-section {
                margin-top: 8px;
            }

            .roster-title {
                margin-bottom: 4px;
                font-size: 0.82rem;
            }

            .roster-name-toggle {
                display: inline-flex;
            }

            .roster-groups {
                grid-template-columns: repeat(3, minmax(0, 1fr));
                align-items: start;
                gap: 12px;
                margin-top: 6px;
            }

            .roster-note {
                margin-top: 5px;
                font-size: 0.68rem;
            }

            .role-section {
                padding: 6px;
                border: 1px solid #2a313f;
                border-radius: 8px;
                background: rgba(15, 18, 24, 0.56);
            }

            .role-heading {
                margin-bottom: 6px;
                text-align: center;
                font-size: 0.78rem;
            }

            .roster-grid {
                grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
                gap: 4px 5px;
            }

            .hero-card {
                position: relative;
                min-height: 58px;
                justify-content: center;
            }

            .hero-card::after {
                position: absolute;
                z-index: 4;
                bottom: calc(100% - 2px);
                left: 50%;
                padding: 4px 7px;
                border: 1px solid #414a5c;
                border-radius: 4px;
                background: #10131a;
                color: var(--text-main);
                content: attr(data-hero-name);
                font-size: 0.72rem;
                line-height: 1.2;
                opacity: 0;
                pointer-events: none;
                transform: translate(-50%, 3px);
                transition: opacity 120ms ease, transform 120ms ease;
                white-space: nowrap;
            }

            .hero-card:hover::after {
                opacity: 1;
                transform: translate(-50%, 0);
            }

            .hero-avatar-wrap {
                width: 56px;
                height: 56px;
            }

            .hero-details {
                display: contents;
            }

            .hero-name {
                display: none;
                width: 100%;
                height: 2.3em;
                margin-top: 2px;
                box-sizing: border-box;
                font-size: 0.68rem;
                line-height: 1.15;
                text-align: center;
            }

            .roster-section.show-hero-names .hero-card {
                justify-content: flex-start;
            }

            .roster-section.show-hero-names .hero-name {
                display: -webkit-box;
            }

            .hero-avatar .hero-hp {
                font-size: 0.68rem;
            }

            .hero-card .status-badge {
                top: -3px;
                right: -3px;
                bottom: auto;
                font-size: 0.5rem;
            }
        }

        @media (min-width: 1440px) and (min-height: 850px) {
            .roster-grid {
                grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
                gap: 4px 5px;
            }

            .hero-card {
                min-height: 66px;
            }

            .hero-avatar-wrap {
                width: 64px;
                height: 64px;
            }

            .hero-avatar .hero-hp {
                font-size: 0.72rem;
            }
        }

        @media (min-width: 1600px) and (min-height: 850px) {
            .roster-grid {
                grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
                gap: 4px 5px;
            }

            .hero-card {
                min-height: 74px;
            }

            .hero-avatar-wrap {
                width: 72px;
                height: 72px;
            }

            .hero-avatar .hero-hp {
                font-size: 0.76rem;
            }
        }

        @media (prefers-reduced-motion: reduce) {
            *,
            *::before,
            *::after {
                scroll-behavior: auto !important;
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
                transition-property: none !important;
            }
        }
