:root {
    --background-overlay: rgba(255, 255, 255, 0.1);
    --background-overlay-strong: rgba(255, 255, 255, 0.33);
    --background-pagination: rgba(0, 0, 0, 0.6);
    --background-overlay-hover: rgba(255, 255, 255, 0.4);
    --background-overlay-select: rgba(0, 0, 0, 0.75);
    /* Text */
    --text-main: #fff;
    --text-shadow: 0 0 1px black;
    /* Box Shadows */
    --box-shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
    --box-shadow-select: 0 0 5px rgba(0, 0, 0, 0.5);
    /* Accent */
    --accent: #ffffff80;
    /* Smoke */
    --smoke-bg: rgba(0, 0, 0, 0.5);
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 3rem;
    --space-xl: 4rem;
    --ease-spring-4: cubic-bezier(0.22, 1, 0.36, 1);
    --pos: #2ed336;
    --neg: #f44040;
    --neu: #2469d7;
}

body {
    /*background-image: url("imgs/cs2_background_guarded.jpg");
    background-image: url("imgs/cs2_background_simple_light.png");*/
    background-image: url("imgs/cs2_bg_dark2.png");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    background-attachment: fixed;
    font-family: "Roboto", Arial, Helvetica, sans-serif;
}

* {
    font-family: inherit;
}

.mt-small {
    position: relative;
    top: 3px;
}

.container {
    display: flex;
    margin-bottom: 8rem;
}

#left-side,
#right-side {
    flex: 1 1 0;
    width: 50vw;
    /* Each side takes half the viewport width */
    min-width: 0;
    /* Prevents overflow issues */
    box-sizing: border-box;
    /* ...keep your existing styles... */
}

#left-side>div,
#right-side>div {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center all children horizontally */
    width: 100%;
}

.weapon-stats div {
    background-color: transparent;
    padding: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Shared smoke positioning logic for both sides */
#left-bg-smoke,
#right-bg-smoke {
    height: 0;
    width: 100%;
}

#left-bg-smoke canvas,
#right-bg-smoke canvas {
    position: relative;
    top: 0;
    right: 0;
    z-index: -1;
    pointer-events: none;
    width: 500px;
    height: 500px;
}

/* Weapon image styling for both sides */
#left-weapon-img,
#right-weapon-img {
    z-index: 5;
    margin-top: 3rem;
    margin-bottom: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    /* Ensure consistent container height */
}

#left-weapon-img img,
#right-weapon-img img {
    max-width: 100%;
    max-height: 150px;
    /* Reduced from 300px to 150px (half size) */
    width: auto;
    height: auto;
    -o-object-fit: contain;
    object-fit: contain;
    /* Preserves aspect ratio */
}

.weapon-tabs {
    display: flex;
    width: 35vw;
    margin-bottom: 1.5rem;
}

.tab-button {
    flex: 1;
    display: block;
    text-align: center;
    background: var(--background-overlay);
    border: 1px solid var(--background-overlay);
    color: #fff;
    font-size: 1.25rem;
    padding: 6px 14px;
    cursor: pointer;
    font-weight: bold;
    border-radius: 0%;
    display: inline-block;
    -webkit-backdrop-filter: blur(0.75rem);
    backdrop-filter: blur(0.75rem);
    transition: all 0.2s ease-in-out;
}

.tab-button:hover {
    background-color: var(--background-overlay-strong);
    outline: none;
    border-color: var(--background-overlay-hover);
}

.tab-button.active {
    background-color: var(--background-overlay-strong);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.weapon-tab-content.hidden,
.hidden {
    display: none;
}

.weapon-tab-content {
    width: 35vw;
    height: 25rem;
    font-family: "Segoe UI", sans-serif;
    font-size: 12px;
    text-align: start;
    color: white;
    background: var(--background-overlay);
    border: 1px solid var(--background-overlay);
    -webkit-backdrop-filter: blur(0.75rem);
    backdrop-filter: blur(0.75rem);
    overflow: visible; /* Allow tooltips to extend beyond container */
}

/* Grid list for sound items */
.sound-list {
    display: grid;
    grid-template-columns: 1fr;
    /* one item per row */
    gap: var(--space-xs);
}

/* Sound row: one line, ~2rem height */
.sound-item {
    display: grid;
    grid-template-columns: auto auto 1fr;
    /* label | play | progress */
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    min-height: 2rem;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

/* Inline progress bar (track) */
.sound-progress {
    position: relative;
    height: 0.5rem;
    width: 100%;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
    overflow: hidden;
    cursor: pointer;
}

/* Buffered portion */
.sound-progress-buffer {
    position: absolute;
    inset: 0;
    transform: scaleX(0);
    transform-origin: left center;
    background: rgba(255, 255, 255, 0.18);
    pointer-events: none;
}

/* Played portion */
.sound-progress-fill {
    position: absolute;
    inset: 0;
    width: 100%;
    transform: scaleX(0);
    transform-origin: left center;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.65), var(--accent));
    will-change: transform;
    transition: none;
    pointer-events: none;
}

/* Draggable thumb */
.sound-progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 2px;
    height: 0.85rem;
    transform: translate(-50%, -50%) scale(0.95);
    background: #fff;
    border: 2px solid var(--accent);
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, opacity 0.12s ease;
    pointer-events: none;
    opacity: 0;
    /* hidden by default */
}

/* Show thumb only once playback/seek starts */
.sound-progress.show-thumb .sound-progress-thumb {
    opacity: 1;
    pointer-events: auto;
}

/* Hover/active states */
.sound-item:hover .sound-progress-thumb {
    transform: translate(-50%, -50%) scale(1);
}

.sound-progress:active .sound-progress-thumb {
    transform: translate(-50%, -50%) scale(0.92);
}

.sound-item:hover .sound-progress {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
}

/* hide native controls */
.sound-audio {
    display: none;
}

.sound-btn {
    position: relative;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    background: transparent;
    color: var(--text-main);
    font-size: 0;
    text-align: center;
    cursor: pointer;
    border: none;
}

.sound-btn:active {
    transform: scale(0.96);
}

.sound-btn::before {
    content: "";
    display: block;
    width: 1.5rem;
    height: 1.5rem;
    margin: 0 auto;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;
}

/* Icon drawing via masks (inherits currentColor) */
/* Play (default) */
.sound-btn-play::before {
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="black" d="M8 5v14l11-7z"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="black" d="M8 5v14l11-7z"/></svg>');
}

.sound-btn-play.is-playing::before {
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="black" d="M6 5h4v14H6zM14 5h4v14h-4z"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="black" d="M6 5h4v14H6zM14 5h4v14h-4z"/></svg>');
}

/* Pause (when playing) */
/* Label styling */
.sound-label {
    color: var(--text-main);
    opacity: 0.9;
    font-weight: 500;
    letter-spacing: 0.2px;
    font-size: 0.9rem;
    overflow: visible;
    /* allow tooltip to overflow */
    width: 10rem;
    height: 1.25rem;
    position: relative;
}

.sound-label .sound-text {
    display: inline-block;
    max-width: 10rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.sound-label .sound-tooltip {
    margin-left: 1rem;
}

/* ellipsis only on the text span, not the whole label */
/* Empty-state message for weapons without sounds */
.sound-empty {
    padding: 1rem;
    text-align: center;
    color: var(--text-main);
}

/* Sound tab groups */
.sound-groups {
    display: grid;
    gap: var(--space-md);
    padding: 1rem;
}

/* Header: title + line (mirrors comparison category header visuals) */
.sound-group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.sound-group-line {
    flex: 1;
    height: 2px;
    background: var(--accent);
}

/* Title */
.sound-group-title {
    color: var(--text-main);
    opacity: 0.85;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-bottom: 0;
    /* override previous margin-bottom */
    font-size: 1rem;
}

/* Minimal styles for inline sound tooltips and hover behavior */
.sound-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
}

.sound-group-header .tooltip-icon {
    width: 16px;
    height: 16px;
    font-size: 9px;
    z-index: 0;
    cursor: help;
}

.sound-tooltip:hover .tooltip-content {
    opacity: 1;
    visibility: visible;
}

.sound-tooltip .tooltip-content {
    white-space: normal;
    /* override global nowrap for lists */
    text-align: center;
}

.sound-tooltip .tooltip-content .tooltip-list {
    margin: 0;
    padding-left: 1rem;
    display: grid;
    gap: 0.15rem;
}

/* Make sound tooltips readable with multi-line content */
.chart-header .tooltip-content,
.sound-tooltip .tooltip-content,
.recoil-title .tooltip-content,
.compensation-title .tooltip-content {
    width: auto;
    min-width: 16rem;
    max-width: 20rem;
    white-space: normal; /* Allow text wrapping */
}

/* Mobile overlay for small screens */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: calc(100vh - 15vh);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(20, 20, 20, 0.98));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    padding: 2rem;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
}

.mobile-message {
    text-align: center;
    color: var(--text-main);
    max-width: 400px;
    padding: 2rem;
    background: var(--background-overlay);
    border: 1px solid var(--background-overlay-strong);
    border-radius: 12px;
    backdrop-filter: blur(0.75rem);
    -webkit-backdrop-filter: blur(0.75rem);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.mobile-message h2 {
    color: var(--accent);
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    font-weight: bold;
}

.mobile-message p {
    margin: 0 0 1rem 0;
    line-height: 1.5;
    opacity: 0.9;
}

.mobile-features {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.mobile-features span {
    background: var(--background-overlay-strong);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Show mobile overlay only on phone screens and hide main content */
@media (max-width: 768px) {
    .mobile-overlay {
        display: flex;
        height: calc(100vh - 15vh) !important; /* Leave space for footer */
    }
    
    .container,
    .comparison-section {
        display: none;
    }
    
    /* Phone-specific footer styles - force visibility */
    .site-footer {
        display: flex !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: 15vh !important;
        width: 100% !important;
        z-index: 10001 !important; /* Higher than mobile overlay */
        background: var(--background-overlay) !important;
        border-top: 2px solid var(--background-overlay-strong) !important;
        backdrop-filter: blur(0.75rem) !important;
        -webkit-backdrop-filter: blur(0.75rem) !important;
        margin: 0 !important;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.4) !important;
    }
    
    .site-footer .footer-inner {
        position: static !important;
        transform: none !important;
        text-align: center !important;
        width: 100% !important;
        padding: 1rem !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .site-footer .footer-inner p,
    .site-footer .footer-inner span {
        margin: 0.25rem 0 !important;
        font-size: 0.9rem !important;
    }
}

/* Responsive: stack cards on small screens */
@media (max-width: 900px) {
    .sound-list {
        grid-template-columns: 1fr;
    }
}

.weapon-table {
    width: 100%;
    border-collapse: collapse;
    color: #fff;
    font-family: "Segoe UI", sans-serif;
    font-size: 1rem;
    table-layout: fixed;
    line-height: 1.5rem;
}

.weapon-table td:nth-child(even) {
    text-align: left;
}

.weapon-table thead {
    background-color: var(--background-overlay);
    font-weight: bold;
    text-align: left;
}

.weapon-table th,
.weapon-table td {
    padding: 0.25rem 1rem;
    border-bottom: 1px solid var(--background-overlay); /* row separator */
    word-break: break-word;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.weapon-table th {
    font-weight: 700;
    text-align: left;
}

/* Vertical separators for middle columns */
.weapon-table th:nth-child(2),
.weapon-table td:nth-child(2) {
    border-left: 1px solid var(--background-overlay);
    border-right: 1px solid var(--background-overlay);
}

.weapon-table th:nth-child(3),
.weapon-table td:nth-child(3) {
    border-right: 1px solid var(--background-overlay);
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.25rem;
}

.pagination button {
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
    border-radius: 0;
    border: 1.5px solid var(--background-overlay);
    background: var(--background-overlay);
    color: var(--text-main);
    font-size: 1.25rem;
    font-family: "Roboto", Arial, Helvetica, sans-serif;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.1s;
    outline: none;
    -webkit-backdrop-filter: blur(0.75rem);
    backdrop-filter: blur(0.75rem);
}

.pagination button:active {
    transform: scale(0.93);
    background: var(--accent);
    color: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    border-color: var(--accent);
}

.pagination button:hover,
.pagination button:focus {
    background: var(--background-overlay-strong);
    color: var(--accent);
    border-color: var(--accent);
}

.pagination button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--background-overlay);
    color: #aaa;
    border-color: var(--background-overlay);
    box-shadow: none;
    transform: none;
}

/* Custom Select Wrapper */
.custom-select-wrapper {
    position: relative;
    display: inline-block;
    min-width: 220px;
    margin-top: var(--space-lg);
    font-family: "Segoe UI", sans-serif;
}

/* Custom Select Main Box */
.custom-select {
    background: var(--background-overlay);
    border: 1px solid var(--background-overlay);
    padding: 10px 14px;
    cursor: pointer;
    color: var(--text-main);
    font-size: 1.1rem;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    position: relative;
    min-width: 220px;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
    box-shadow: var(--box-shadow-select);
    z-index: 10;
    -webkit-backdrop-filter: blur(0.75rem);
    backdrop-filter: blur(0.75rem);
}

.custom-select:hover {
    background: var(--background-overlay-strong);
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

.custom-select:active {
    transform: scale(0.98);
    background: var(--background-overlay-hover);
    border-color: var(--accent);
}

.custom-select.open {
    background: var(--background-overlay-strong);
    border-color: var(--accent);
}

/* Arrow: collapsed points right (▶), open rotates 90deg down to match comparison accordions */
.custom-select:after {
    content: "▶"; /* collapsed state points right */
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%) rotate(0deg); /* right-pointing */
    transform-origin: center;
    color: var(--text-main);
    font-size: 1rem;
    pointer-events: none;
    transition: transform 0.3s ease, color 0.2s ease;
    will-change: transform;
}

.custom-select:hover:after {
    color: var(--accent);
}

/* Open state rotates arrow downward */
.custom-select.open:after {
    transform: translateY(-50%) rotate(90deg);
    color: var(--accent);
}

/* Selected Value */
.custom-select-selected {
    display: inline-block;
    transition: transform 0.6s var(--ease-spring-4), opacity 0.6s;
    opacity: 1;
    transform: translateY(0);
}

.custom-select-selected span {
    display: inline-block;
    transition: transform 0.6s var(--ease-spring-4), opacity 0.6s;
    opacity: 1;
    transform: translateY(0);
}

.custom-select-selected.animate-in {
    opacity: 0;
    transform: translateY(10px);
}

.custom-select-selected.animate-in span {
    opacity: 0;
    transform: translateY(10px);
}

/* Dropdown Options */
.custom-select-options {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 20;
    background: var(--background-overlay-select);
    border: 1px solid var(--background-overlay-strong);
    max-height: 20rem;
    overflow-y: auto;
    padding: 0;
    margin: 0;
    margin-top: 2rem;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.custom-select-options.hidden {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    display: block;
    /* Keep in flow for transition */
}

/* Category Header */
.custom-select-group {
    font-weight: bold;
    padding: 8px 14px 6px 14px;
    background: var(--background-overlay-strong);
    color: var(--text-main);
    border-bottom: 1px solid var(--background-overlay);
    font-size: 1rem;
    letter-spacing: 0.5px;
}

/* Option Item */
.custom-select-option {
    padding: 10px 14px;
    cursor: pointer;
    color: var(--text-main);
    background: transparent;
    transition: background 0.15s, color 0.15s;
    font-size: 1rem;
}

.custom-select-option:hover,
.custom-select-option.active {
    background: var(--background-overlay-strong);
    color: var(--accent);
}

/* Scrollbar styling for dropdown */
.custom-select-options {
    scrollbar-width: thin;
    scrollbar-color: var(--background-overlay-strong) var(--background-overlay);
}

.custom-select-options::-webkit-scrollbar {
    width: 8px;
    background: var(--background-overlay);
}

.custom-select-options::-webkit-scrollbar-thumb {
    background: var(--background-overlay-strong);
    border-radius: 4px;
}

/* Responsive adjustments */
@media (max-width: 600px) {

    .custom-select-wrapper,
    .custom-select {
        min-width: 140px;
        font-size: 1rem;
    }

    .custom-select-options {
        font-size: 0.95rem;
    }
}

.svg-container {
    width: 100%;
    height: 80%;
    position: absolute;
    top: 1rem;
}

.ttk-controls {
    position: absolute;
    bottom: 1rem;
    width: 90%;
    left: 5%;
    height: 20%;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-sizing: border-box;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.control-group:first-child {
    justify-content: flex-start;
    align-items: center;
}

.control-group:last-child {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    margin-bottom: 0;
}

/* Checkbox styles */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--text-main);
    font-size: 0.9rem;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

.checkbox-label input[type=checkbox] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 20px;
    width: 20px;
    background-color: var(--background-overlay);
    border: 1px solid var(--background-overlay);
    border-radius: 3px;
    margin-right: 0.5rem;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-label:hover .checkmark {
    background-color: var(--background-overlay);
    border-color: var(--accent);
}

.checkbox-label input:checked~.checkmark {
    background-color: var(--accent);
    border-color: var(--accent);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-label input:checked~.checkmark:after {
    display: block;
}

.checkbox-label .checkmark:after {
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Slider styles */
.slider-label {
    color: var(--text-main);
    font-size: 1rem;
    font-weight: normal;
    margin-left: auto;
    margin-right: 1rem;
    white-space: nowrap;
}

.slider-container {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.distance-slider {
    width: 100%;
    height: 4px;
    background: var(--background-overlay);
    border-radius: 2px;
    outline: none;
    -moz-appearance: none;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--background-overlay);
    -webkit-backdrop-filter: blur(0.75rem);
    backdrop-filter: blur(0.75rem);
    position: relative;
    z-index: 10;
}

.distance-slider::-webkit-slider-track,
.distance-slider::-moz-range-track {
    height: 4px;
    background: var(--background-overlay);
    border-radius: 2px;
    border: 1px solid var(--background-overlay);
}

.distance-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 1px solid var(--background-overlay);
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
    box-shadow: var(--box-shadow-light);
    position: relative;
    z-index: 15;
}

.distance-slider::-webkit-slider-thumb:hover {
    background: var(--background-overlay-hover);
    transform: scale(1.1);
    border-color: var(--accent);
}

.distance-slider::-moz-range-thumb {
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 1px solid var(--background-overlay);
    -moz-transition: all 0.2s ease;
    transition: all 0.2s ease;
    box-shadow: var(--box-shadow-light);
    position: relative;
    z-index: 15;
}

.distance-slider::-moz-range-thumb:hover {
    background: var(--background-overlay-hover);
    transform: scale(1.1);
    border-color: var(--accent);
}

/* Slider container and tooltips */
.slider-container input {
    width: 100%;
}

.slider-tooltips {
    position: relative;
    width: 100%;
    height: 20px;
    width: calc(100% - 1.25rem);
    margin-top: -0.75rem;
    z-index: 20;
    pointer-events: none;
}

.tooltip-marker {
    position: absolute;
    transform: translateX(-50%);
    cursor: help;
    z-index: 20;
    pointer-events: auto;
}

.tooltip-icon {
    width: 16px;
    height: 16px;
    background: var(--background-overlay);
    color: var(--text-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    border: 2px solid var(--accent);
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease, color 0.3s ease;
    -webkit-backdrop-filter: blur(0.75rem);
    backdrop-filter: blur(0.75rem);
    z-index: 20;
    pointer-events: auto;
    cursor: help;
}

.tooltip-marker:hover .tooltip-icon {
    background: var(--accent);
    border-color: var(--background-overlay-hover);
    transform: scale(1.2);
    color: #000;
    pointer-events: auto;
    cursor: help !important;
}

.tooltip-content {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--background-overlay-select);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
    -webkit-backdrop-filter: blur(0.75rem);
    backdrop-filter: blur(0.75rem);
    border: 1px solid var(--background-overlay);
    box-shadow: var(--box-shadow-select);
}

.tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--background-overlay-select);
}

.tooltip-marker:hover .tooltip-content {
    opacity: 1;
    visibility: visible;
    text-align: center;
}

/* Map image styling within tooltips */
.tooltip-map-image {
    display: flex;
    justify-content: center;
    margin-bottom: 5px;
}

.tooltip-map-image img {
    width: 400px;
    height: 400px;
}

/* Update tooltip content to allow for wider content with images */
.tooltip-content {
    white-space: normal;
    text-align: center;
}

.sound-group-header .tooltip-content {
    text-align: left;
}

/* Update control group styling for slider with tooltips */
.control-group:last-child {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
}

.control-group:last-child>div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.svg-container svg {
    width: 100%;
    height: 100%;
}

.svg-container svg path,
.svg-container svg text {
    opacity: 0.6;
    /* Default opacity */
    transition: opacity 0.3s ease;
    /* Smooth transition for opacity */
}

/* Default styles for paths and text */
.one-shot-kill {
    fill: #ff0000 !important;
    /* Dark red for one-shot kills */
}

/* Hover effects using :has() for bidirectional targeting */
#T-Head:hover,
#t-head-txt:hover {
    opacity: 1;
    cursor: pointer;
}

svg:has(#T-Head:hover) #t-head-txt,
svg:has(#t-head-txt:hover) #T-Head {
    opacity: 1;
    cursor: pointer;
}

#T-Chest\ \&\ Arms:hover,
#t-chest-txt:hover {
    opacity: 1;
    cursor: pointer;
}

svg:has(#T-Chest\ \&\ Arms:hover) #t-chest-txt,
svg:has(#t-chest-txt:hover) #T-Chest\ \&\ Arms {
    opacity: 1;
    cursor: pointer;
}

#T-Pelvis:hover,
#t-pelvis-txt:hover {
    opacity: 1;
    cursor: pointer;
}

svg:has(#T-Pelvis:hover) #t-pelvis-txt,
svg:has(#t-pelvis-txt:hover) #T-Pelvis {
    opacity: 1;
    cursor: pointer;
}

#T-Legs:hover,
#t-legs-txt:hover {
    opacity: 1;
    cursor: pointer;
}

svg:has(#T-Legs:hover) #t-legs-txt,
svg:has(#t-legs-txt:hover) #T-Legs {
    opacity: 1;
    cursor: pointer;
}

#CT-Head:hover,
#ct-head-txt:hover {
    opacity: 1;
    cursor: pointer;
}

svg:has(#CT-Head:hover) #ct-head-txt,
svg:has(#ct-head-txt:hover) #CT-Head {
    opacity: 1;
    cursor: pointer;
}

#CT-Chest\ \&\ Arms:hover,
#ct-chest-txt:hover {
    opacity: 1;
    cursor: pointer;
}

svg:has(#CT-Chest\ \&\ Arms:hover) #ct-chest-txt,
svg:has(#ct-chest-txt:hover) #CT-Chest\ \&\ Arms {
    opacity: 1;
    cursor: pointer;
}

#CT-Pelvis:hover,
#ct-pelvis-txt:hover {
    opacity: 1;
    cursor: pointer;
}

svg:has(#CT-Pelvis:hover) #ct-pelvis-txt,
svg:has(#ct-pelvis-txt:hover) #CT-Pelvis {
    opacity: 1;
    cursor: pointer;
}

#CT-Legs:hover,
#ct-legs-txt:hover {
    opacity: 1;
    cursor: pointer;
}

svg:has(#CT-Legs:hover) #ct-legs-txt,
svg:has(#ct-legs-txt:hover) #CT-Legs {
    opacity: 1;
    cursor: pointer;
}

/* Comparison Section Styles */
.comparison-section {
    width: 80%;
    margin: 0 auto;
}

.comparison-category {
    margin-bottom: 4rem;
    background: var(--background-overlay);
    border: 1px solid var(--background-overlay);
    -webkit-backdrop-filter: blur(0.75rem);
    backdrop-filter: blur(0.75rem);
    overflow: hidden;
    margin-left: auto;
    margin-right: auto;
}

.category-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: background 0.2s ease;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

.category-header:hover {
    background: var(--background-overlay-strong);
    border-color: var(--background-overlay-hover);
}

.category-header h3 {
    color: var(--text-main);
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
    white-space: nowrap;
}

.category-line {
    flex: 1;
    height: 2px;
    background: var(--accent);
    margin: 0 1.5rem;
}

.collapse-icon {
    color: var(--text-main);
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    font-weight: bold;
}

.comparison-category.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.category-content {
    padding: 0 1.5rem 1.5rem 1.5rem;
    transition: all 0.3s ease;
    opacity: 1;
}

.extra-mb {
    margin-bottom: 2.5rem;
}

.comparison-category.collapsed .category-content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    overflow: hidden;
}

.category-description {
    color: var(--text-main);
    font-size: 1rem;
    margin: 0 0 1.5rem 0;
    opacity: 0.8;
}

.stats-comparison,
.accuracy-comparison,
.inaccuracy-comparison {
    color: var(--text-main);
    font-size: 1rem;
    padding: 1rem;
    /* The flex properties and min-height were forcing the chart to be tall.
     By removing them, the chart's container can define its own height. */
}

/* Show legends under BOTH radar charts in the Accuracy section */
.accuracy-comparison .chart-legend {
    display: flex;
}

/* Universal style for chart containers */
.chart-container {
    position: relative;
    height: 8rem;
    overflow: hidden;
    margin-bottom: 3rem;
}

/* Ensure the last chart in each category can show its legend */
.comparison-category .chart-container:last-child {
    overflow: visible;
}

/* Reduce the big inline header gap the JS adds */
.chart-container .chart-header {
    margin: 0 !important;
}

/* Ensure the radar canvases fill the taller box (but not more) */
.comparison-category .chart-container:has(#accuracy-radar-chart) canvas,
.comparison-category .chart-container:has(#movement-radar-chart) canvas {
    height: calc(100% - 0.75rem) !important;
}

/* External chart legend (HTML) */
.chart-legend {
    display: none;
    /* hidden by default */
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    margin-top: 0.35rem;
    flex-wrap: wrap;
}

.chart-legend .legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-main);
    opacity: 0.9;
    font-size: 1rem;
}

.chart-legend .legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    display: inline-block;
}

/* Show legend only for the last chart container in each category */
.comparison-category .chart-container:last-child .chart-legend {
    display: flex;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* Footer Styles */
.site-footer {
    position: relative;
    height: 15vh;
    bottom: 0;
    width: 100%;
    margin: 0;
    /* full width bar */
    color: var(--text-main);
    text-align: center;
    background: var(--background-overlay);
    border-top: 1px solid var(--background-overlay);
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    -webkit-backdrop-filter: blur(0.75rem);
    backdrop-filter: blur(0.75rem);
    z-index: 1000;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.2);
}

.site-footer .footer-inner {
    display: flex;
    /* was inline-flex */
    flex-direction: column;
    /* stack link above the rest */
    align-items: center;
    gap: 0.25rem;
    opacity: 0.9;
    flex-wrap: wrap;
    position: relative;
    top: 50%;
    transform: translate(0%, -50%);
}

.site-footer .footer-inner p {
    padding: 0;
    margin-bottom: 0.25rem;
    margin-top: 0;
}

.site-footer .sep {
    opacity: 0.65;
}

.site-footer a,
.site-footer .footer-link {
    color: var(--text-main);
    text-decoration: none;
    opacity: 0.9;
    font-weight: bold;
}

.site-footer a:hover,
.site-footer .footer-link:hover {
    color: var(--accent);
    opacity: 1;
}

#left-weapon-recoil,
#right-weapon-recoil {
    margin: 0 auto;
    box-sizing: border-box;
    overflow: visible; /* Allow tooltips to extend beyond container */
    position: relative;
    flex-direction: column;
    align-items: stretch;
}

#left-weapon-recoil .recoil-flex-container,
#right-weapon-recoil .recoil-flex-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

#left-weapon-recoil .recoil-side,
#right-weapon-recoil .recoil-side {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: visible; /* Allow tooltips to extend beyond */
    position: relative; /* Ensure proper positioning for tooltips */
}

#left-weapon-recoil .recoil-svg-container,
#right-weapon-recoil .recoil-svg-container {
    width: 100%;
    max-width: 100%;
    height: 320px;
    min-height: 180px;
    box-sizing: border-box;
    overflow: hidden; /* Keep hidden to clip SVG content */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#left-weapon-recoil .recoil-svg-container svg,
#right-weapon-recoil .recoil-svg-container svg {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.recoil-title,
.compensation-title {
    color: var(--text-main);
    opacity: 0.85;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin: 1rem 0;
    /* override previous margin-bottom */
    font-size: 1rem;
    text-align: center;
    position: relative; /* Ensure proper positioning for tooltips */
    overflow: visible; /* Allow tooltips to extend beyond */
    z-index: 100; /* Ensure headers and tooltips appear above other content */
}