.elo-gain-description-dialog .mud-dialog-content {
    position: relative;
}

.elo-gain-description-dialog__notice {
    display: block;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: var(--mud-palette-surface);
    padding: 4px 0 8px;
    margin-bottom: 8px;
}

.elo-gain-description-dialog__chart-card {
    position: relative;
    z-index: 12;
    overflow: visible;
    isolation: isolate;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015)),
        linear-gradient(90deg, rgba(244, 67, 54, 0.03), rgba(76, 175, 80, 0.03));
}

.elo-gain-description-dialog__chart-header {
    gap: 8px;
}

.elo-gain-description-dialog__chart-subtitle {
    opacity: 0.78;
}

.elo-gain-description-dialog__dot-chart-main {
    min-width: 0;
    position: relative;
    z-index: 2;
}

.elo-gain-description-dialog__dot-chart-shell {
    position: relative;
    width: 100%;
    min-width: 0;
    overflow: visible;
    border-radius: 14px;
    isolation: isolate;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
}

.elo-gain-description-dialog__dot-chart-svg {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

.elo-gain-description-dialog__dot-chart-grid {
    stroke: rgba(255, 255, 255, 0.12);
    stroke-dasharray: 3 5;
    stroke-width: 1;
}

.elo-gain-description-dialog__dot-chart-axis {
    stroke: rgba(255, 226, 148, 0.96);
    stroke-width: 2.2;
    stroke-dasharray: 6 4;
    filter: drop-shadow(0 0 4px rgba(255, 208, 82, 0.34));
}

.elo-gain-description-dialog__dot-chart-vertical-axis {
    stroke: rgba(255, 255, 255, 0.18);
    stroke-width: 1;
}

.elo-gain-description-dialog__dot-chart-current-player-line {
    stroke: rgba(64, 224, 255, 0.96);
    stroke-width: 1.8;
    stroke-dasharray: 4 4;
    filter: drop-shadow(0 0 6px rgba(64, 224, 255, 0.38));
}

.elo-gain-description-dialog__dot-chart-area {
    stroke: none;
}

.elo-gain-description-dialog__dot-chart-area-positive {
    fill: rgba(46, 190, 96, 0.24);
}

.elo-gain-description-dialog__dot-chart-area-negative {
    fill: rgba(255, 84, 84, 0.24);
}

.elo-gain-description-dialog__dot-chart-path {
    fill: none;
    stroke: rgba(176, 205, 255, 0.92);
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.elo-gain-description-dialog__dot-chart-path-old {
    fill: none;
    stroke: rgba(255, 183, 77, 0.82);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 6 4;
}

.elo-gain-description-dialog__old-elo-toggle {
    margin: 0 !important;
}

.elo-gain-description-dialog__old-elo-toggle .mud-checkbox-label {    
    font-size: 11px;
    white-space: nowrap;
}

.elo-gain-description-dialog__dot-chart-popover-old-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 14px;
    background: linear-gradient(90deg, rgba(255, 183, 77, 0.14), rgba(255, 152, 0, 0.08));
    border-bottom: 1px solid rgba(255, 183, 77, 0.18);
}

.elo-gain-description-dialog__dot-chart-popover-old-label {
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffb74d;
    font-weight: 700;
}

.elo-gain-description-dialog__dot-chart-popover-current-section {
    border-top: 1px solid rgba(151, 184, 255, 0.18);
    background: rgba(176, 205, 255, 0.04);
}

.elo-gain-description-dialog__dot-chart-popover-current-section-header {
    padding: 8px 12px 4px;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #b0cdff;
    font-weight: 700;
}

.elo-gain-description-dialog__dot-chart-popover-old-section {
    border-top: 1px solid rgba(255, 183, 77, 0.22);
    background: rgba(255, 183, 77, 0.04);
}

.elo-gain-description-dialog__dot-chart-popover-old-section-header {
    padding: 8px 12px 4px;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffb74d;
    font-weight: 700;
}

.elo-gain-description-dialog__dot-chart-overlay {
    position: absolute;
    inset: 0;
    z-index: 6;
    pointer-events: none;
}

.elo-gain-description-dialog__dot-chart-y-label {
    position: absolute;
    z-index: 7;
    color: rgba(255, 255, 255, 0.72);
    font-size: 8px;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
}

.elo-gain-description-dialog__dot-chart-y-label-left {
    transform: translate(-100%, -50%);
    text-align: right;
    padding-right: 6px;
}

.elo-gain-description-dialog__dot-chart-axis-label {
    fill: rgba(173, 216, 255, 0.82);
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.elo-gain-description-dialog__dot-chart-axis-label-end {
    text-anchor: end;
}

.elo-gain-description-dialog__dot-chart-current-player-badge {
    position: absolute;
    z-index: 3;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(8, 21, 36, 0.9);
    border: 1px solid rgba(64, 224, 255, 0.62);
    box-shadow: 0 0 0 1px rgba(7, 14, 24, 0.45), 0 8px 18px rgba(0, 0, 0, 0.32);
    color: #8ff5ff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
}

.elo-gain-description-dialog__dot-chart-anchor-left {
    transform: translate(0, -50%);
}

.elo-gain-description-dialog__dot-chart-anchor-center {
    transform: translate(-50%, -50%);
}

.elo-gain-description-dialog__dot-chart-anchor-right {
    transform: translate(-100%, -50%);
}

.elo-gain-description-dialog__dot-chart-hotspot {
    position: absolute;
    z-index: 10;
    pointer-events: auto;
}

.elo-gain-description-dialog__dot-chart-hover-line {
    position: absolute;
    left: var(--chart-point-left);
    top: 0;
    height: 100%;
    border-left: 1px dashed rgba(205, 225, 255, 0.62);
    opacity: 0;
    transform: translateX(-50%);
    transition: opacity 0.14s ease;
    pointer-events: none;
}

.elo-gain-description-dialog__dot-chart-point-anchor {
    position: absolute;
    left: var(--chart-point-left);
    top: var(--chart-point-top);
    width: 0;
    height: 0;
}

.elo-gain-description-dialog__dot-chart-hotspot-button {
    position: absolute;
    left: 0;
    top: 0;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
}

.elo-gain-description-dialog__dot-chart-hotspot-button:focus-visible {
    outline: 2px solid rgba(120, 166, 255, 0.85);
    outline-offset: 2px;
}

.elo-gain-description-dialog__dot-chart-popover {
    position: absolute;
    z-index: 80;
    display: flex;
    flex-direction: column;
    min-width: 272px;
    max-width: 316px;
    padding: 0;
    border-radius: 18px;
    background: linear-gradient(180deg, rgb(24, 35, 58), rgb(16, 23, 38));
    border: 1px solid rgba(151, 184, 255, 0.18);
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.48);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
}

.elo-gain-description-dialog__dot-chart-popover-top {
    bottom: calc(100% + 10px);
}

.elo-gain-description-dialog__dot-chart-popover-bottom {
    top: calc(100% + 10px);
}

.elo-gain-description-dialog__dot-chart-hotspot:hover .elo-gain-description-dialog__dot-chart-popover,
.elo-gain-description-dialog__dot-chart-hotspot:focus-within .elo-gain-description-dialog__dot-chart-popover {
    opacity: 1;
    visibility: visible;
}

.elo-gain-description-dialog__dot-chart-hotspot:hover .elo-gain-description-dialog__dot-chart-hover-line,
.elo-gain-description-dialog__dot-chart-hotspot:focus-within .elo-gain-description-dialog__dot-chart-hover-line {
    opacity: 1;
}

.elo-gain-description-dialog__dot-chart-popover-top.elo-gain-description-dialog__dot-chart-anchor-left,
.elo-gain-description-dialog__dot-chart-popover-bottom.elo-gain-description-dialog__dot-chart-anchor-left {
    left: 0;
    transform: translateY(4px);
}

.elo-gain-description-dialog__dot-chart-popover-top.elo-gain-description-dialog__dot-chart-anchor-center,
.elo-gain-description-dialog__dot-chart-popover-bottom.elo-gain-description-dialog__dot-chart-anchor-center {
    left: 50%;
    transform: translate(-50%, 4px);
}

.elo-gain-description-dialog__dot-chart-popover-top.elo-gain-description-dialog__dot-chart-anchor-right,
.elo-gain-description-dialog__dot-chart-popover-bottom.elo-gain-description-dialog__dot-chart-anchor-right {
    right: 0;
    transform: translateY(4px);
}

.elo-gain-description-dialog__dot-chart-hotspot:hover .elo-gain-description-dialog__dot-chart-popover-top.elo-gain-description-dialog__dot-chart-anchor-left,
.elo-gain-description-dialog__dot-chart-hotspot:focus-within .elo-gain-description-dialog__dot-chart-popover-top.elo-gain-description-dialog__dot-chart-anchor-left,
.elo-gain-description-dialog__dot-chart-hotspot:hover .elo-gain-description-dialog__dot-chart-popover-bottom.elo-gain-description-dialog__dot-chart-anchor-left,
.elo-gain-description-dialog__dot-chart-hotspot:focus-within .elo-gain-description-dialog__dot-chart-popover-bottom.elo-gain-description-dialog__dot-chart-anchor-left,
.elo-gain-description-dialog__dot-chart-hotspot:hover .elo-gain-description-dialog__dot-chart-popover-top.elo-gain-description-dialog__dot-chart-anchor-right,
.elo-gain-description-dialog__dot-chart-hotspot:focus-within .elo-gain-description-dialog__dot-chart-popover-top.elo-gain-description-dialog__dot-chart-anchor-right,
.elo-gain-description-dialog__dot-chart-hotspot:hover .elo-gain-description-dialog__dot-chart-popover-bottom.elo-gain-description-dialog__dot-chart-anchor-right,
.elo-gain-description-dialog__dot-chart-hotspot:focus-within .elo-gain-description-dialog__dot-chart-popover-bottom.elo-gain-description-dialog__dot-chart-anchor-right {
    transform: translateY(0);
}

.elo-gain-description-dialog__dot-chart-hotspot:hover .elo-gain-description-dialog__dot-chart-popover-top.elo-gain-description-dialog__dot-chart-anchor-center,
.elo-gain-description-dialog__dot-chart-hotspot:focus-within .elo-gain-description-dialog__dot-chart-popover-top.elo-gain-description-dialog__dot-chart-anchor-center,
.elo-gain-description-dialog__dot-chart-hotspot:hover .elo-gain-description-dialog__dot-chart-popover-bottom.elo-gain-description-dialog__dot-chart-anchor-center,
.elo-gain-description-dialog__dot-chart-hotspot:focus-within .elo-gain-description-dialog__dot-chart-popover-bottom.elo-gain-description-dialog__dot-chart-anchor-center {
    transform: translate(-50%, 0);
}

.elo-gain-description-dialog__dot-chart-popover-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px 10px;
    background: linear-gradient(90deg, rgba(76, 107, 255, 0.22), rgba(62, 217, 150, 0.12));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.elo-gain-description-dialog__dot-chart-popover-eyebrow {
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8fd3ff;
    margin-bottom: 3px;
}

.elo-gain-description-dialog__dot-chart-popover-current-elo {
    font-size: 18px;
    font-weight: 800;
    color: #eef4ff;
}

.elo-gain-description-dialog__dot-chart-popover-total {
    flex-shrink: 0;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.elo-gain-description-dialog__dot-chart-delta-positive {
    background: rgba(57, 217, 138, 0.14);
    color: #39d98a;
}

.elo-gain-description-dialog__dot-chart-delta-negative {
    background: rgba(255, 107, 107, 0.14);
    color: #ff7b70;
}

.elo-gain-description-dialog__dot-chart-popover-list {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 10px;
    min-height: 0;
    padding: 12px 14px 14px;
    max-height: 260px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.elo-gain-description-dialog__dot-chart-popover-ticket {
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.elo-gain-description-dialog__dot-chart-popover-opponent {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 12px 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.elo-gain-description-dialog__dot-chart-popover-place {
    align-self: start;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 213, 106, 0.14);
    color: #ffd56a;
    font-weight: 700;
    font-size: 10px;
    line-height: 1.2;
}

.elo-gain-description-dialog__dot-chart-popover-meta {
    margin-top: 4px;
    font-size: 12px;
    color: #92a2bf;
    line-height: 1.35;
}

.elo-gain-description-dialog__dot-chart-popover-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.elo-gain-description-dialog__dot-chart-popover-stat {
    padding: 10px 12px 12px;
}

.elo-gain-description-dialog__dot-chart-popover-stat-empty {
    background: transparent;
}

.elo-gain-description-dialog__dot-chart-popover-stat + .elo-gain-description-dialog__dot-chart-popover-stat {
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.elo-gain-description-dialog__dot-chart-popover-stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #92a2bf;
}

.elo-gain-description-dialog__dot-chart-popover-stat-value {
    margin-top: 4px;
    font-size: 16px;
    font-weight: 700;
    color: #eef4ff;
}

.elo-gain-description-dialog__dot-chart-popover-stat-delta.elo-gain-description-dialog__dot-chart-delta-positive .elo-gain-description-dialog__dot-chart-popover-stat-value {
    color: #39d98a;
}

.elo-gain-description-dialog__dot-chart-popover-stat-delta.elo-gain-description-dialog__dot-chart-delta-negative .elo-gain-description-dialog__dot-chart-popover-stat-value {
    color: #ff7b70;
}

.elo-gain-description-dialog__dot-chart-popover-formula-block {
    padding: 12px 5px 14px;
}

.elo-gain-description-dialog__dot-chart-popover-name {
    font-size: 16px;
    font-weight: 700;
    color: #eef4ff;
}

.elo-gain-description-dialog__dot-chart-popover-formula {
    margin-top: 6px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: #dfe9ff;
    font-size: 11px;
    line-height: 1.2;
    font-family: Consolas, "Courier New", monospace;
    white-space: nowrap;
    overflow-x: visible;
    overflow-y: hidden;
    scrollbar-width: thin;
}

@media (min-width: 600px) {
    .elo-gain-description-dialog__dot-chart-popover {
        position: fixed;
        left: 50% !important;
        top: 50% !important;
        right: auto !important;
        bottom: auto !important;
        width: min(316px, calc(100vw - 24px));
        max-height: min(560px, calc(100vh - 48px));
        z-index: 1200;
        transform: translate(-50%, -50%) !important;
    }

    .elo-gain-description-dialog__dot-chart-popover-list {
        max-height: none;
    }

    .elo-gain-description-dialog__dot-chart-hotspot:hover .elo-gain-description-dialog__dot-chart-popover,
    .elo-gain-description-dialog__dot-chart-hotspot:focus-within .elo-gain-description-dialog__dot-chart-popover {
        transform: translate(-50%, -50%) !important;
    }
}

.elo-gain-description-dialog__dot-chart-x-axis {
    display: grid;
    margin-top: -18px;
}

.elo-gain-description-dialog__dot-chart-x-axis-item {
    text-align: center;
    color: var(--mud-palette-text-secondary);
    font-size: 9px;
    line-height: 1.2;
    min-width: 0;
}

.elo-gain-description-dialog__dot-chart-x-axis-item-current {
    color: #ffd54f;
    font-weight: 700;
}

.elo-gain-description-dialog__dot-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
    margin-top: 6px;
}

.elo-gain-description-dialog__dot-chart-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--mud-palette-text-secondary);
    font-size: 12px;
    line-height: 1.4;
}

.elo-gain-description-dialog__dot-chart-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex-shrink: 0;
}

.elo-gain-description-dialog__dot-chart-legend-dot-positive {
    background: #4caf50;
}

.elo-gain-description-dialog__dot-chart-legend-dot-negative {
    background: #f44336;
}

@media (max-width: 599.95px) {
    .elo-gain-description-dialog__chart-card {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .elo-gain-description-dialog__dot-chart-y-label,
    .elo-gain-description-dialog__dot-chart-x-axis-item {
        font-size: 8px;
    }

    .elo-gain-description-dialog__dot-chart-hotspot-button {
        width: 100%;
        height: 100%;
    }

    .elo-gain-description-dialog__dot-chart-popover {
        position: fixed;
        left: 50% !important;
        top: 50% !important;
        right: auto !important;
        bottom: auto !important;
        width: min(284px, calc(100vw - 24px));
        min-width: min(244px, calc(100vw - 24px));
        max-width: calc(100vw - 24px);
        max-height: min(520px, calc(100vh - 24px));
        z-index: 1200;
        transform: translate(-50%, -50%) !important;
    }

    .elo-gain-description-dialog__dot-chart-hotspot:hover .elo-gain-description-dialog__dot-chart-popover,
    .elo-gain-description-dialog__dot-chart-hotspot:focus-within .elo-gain-description-dialog__dot-chart-popover {
        transform: translate(-50%, -50%) !important;
    }

    .elo-gain-description-dialog__dot-chart-popover-list {
        max-height: none;
    }

    .elo-gain-description-dialog__dot-chart-current-player-badge {
        font-size: 9px;
        padding: 2px 6px;
    }

    .elo-gain-description-dialog__dot-chart-legend {
        gap: 8px 10px;
    }

    .elo-gain-description-dialog__dot-chart-legend-item {
        font-size: 11px;
    }
}