@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Rajdhani:wght@300;400;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #16213e 100%);
    color: #e0e0e0;
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #00d9ff, #00ff88, #00d9ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0, 217, 255, 0.3);
}

.version-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.version-label {
    font-family: 'Orbitron', sans-serif;
    color: #00d9ff;
    font-size: 1rem;
}

#version-select {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 217, 255, 0.5);
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    cursor: pointer;
    min-width: 250px;
}

#version-select option {
    background: #1a1a2e;
    color: #e0e0e0;
}

#version-select:hover {
    border-color: #00d9ff;
    background: rgba(0, 217, 255, 0.1);
}

.subtitle {
    text-align: center;
    color: #888;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #00d9ff;
    font-size: 1.2rem;
}

.category-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    min-width: 0;
}

.category-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(0, 217, 255, 0.3);
    color: #00d9ff;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 500px), 1fr));
    gap: 20px;
}

.chart-container {
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 15px;
    min-width: 0;
    overflow: visible;
}

.chart-container:hover,
.chart-container:focus-within {
    z-index: 10;
}

.chart-container canvas {
    max-width: 100%;
    display: block;
}

.chart-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.chart-heading-area {
    min-width: 0;
    flex: 1;
}

.chart-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    color: #fff;
    text-align: left;
    line-height: 1.5;
}

.chart-title-badges {
    display: inline;
}

.chart-expand-button {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(0, 217, 255, 0.25);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.45);
    color: #00d9ff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.chart-expand-button:hover,
.chart-expand-button:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(0, 217, 255, 0.55);
    background: rgba(0, 217, 255, 0.12);
    box-shadow: 0 8px 20px rgba(0, 217, 255, 0.15);
    outline: none;
}

.chart-expand-button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: rgba(0, 217, 255, 0.05);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 8px;
    padding: 15px;
}

.stat-label {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 5px;
}

.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    color: #00d9ff;
}

.tooltip-icon {
    cursor: help;
    color: #ffc107;
    display: inline-block;
    width: 16px;
    height: 16px;
    background: rgba(255, 193, 7, 0.1);
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-size: 12px;
    font-weight: bold;
    user-select: none;
}

.tooltip-indicator {
    display: inline-block;
    width: 18px;
    height: 18px;
    background: rgba(0, 217, 255, 0.15);
    border: 1px solid rgba(0, 217, 255, 0.4);
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-size: 11px;
    font-weight: bold;
    color: #00d9ff;
    margin-left: 8px;
    cursor: help;
    transition: all 0.3s ease;
}

.category-title-tooltip:hover .tooltip-indicator {
    background: rgba(0, 217, 255, 0.3);
    border-color: rgba(0, 217, 255, 0.8);
    transform: scale(1.1);
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 8px;
}

.badge-default {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.badge-pyro {
    background: rgba(255, 100, 50, 0.2);
    color: #ff6432;
    border: 1px solid rgba(255, 100, 50, 0.5);
}

.legend {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 30px;
    height: 4px;
    border-radius: 2px;
}

.legend-label {
    font-size: 0.9rem;
    color: #aaa;
}

.info-box {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #ffc107;
}

.composition-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    min-width: 0;
}

.quantization-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.quantization-table-wrapper {
    overflow-x: auto;
    border: 1px solid rgba(0, 217, 255, 0.16);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.24);
}

.quantization-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.quantization-table th,
.quantization-table td {
    padding: 9px 8px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.quantization-table th {
    background: rgba(0, 217, 255, 0.1);
    color: #00d9ff;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    white-space: nowrap;
}

.quantization-table th:first-child,
.quantization-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    text-align: left;
}

.quantization-table th:first-child {
    background: rgba(0, 34, 51, 0.96);
    z-index: 2;
}

.quantization-table td:first-child {
    background: rgba(6, 12, 22, 0.96);
}

.quantization-table tr:hover td {
    background: rgba(0, 217, 255, 0.08);
}

.quantization-table tr:hover td:first-child {
    background: rgba(0, 34, 51, 0.96);
}

.quantization-material-name {
    color: #fff;
    font-weight: 600;
    min-width: 130px;
}

.quantization-band-cell {
    min-width: 72px;
}

.quantization-mapped-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 3px 6px;
    border-radius: 4px;
    background: rgba(0, 217, 255, 0.12);
    border: 1px solid rgba(0, 217, 255, 0.26);
    color: #e8fbff;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
}

.quantization-empty {
    color: #666;
}

.rarity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
    gap: 20px;
}

.rarity-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.3s ease;
    min-width: 0;
}

.rarity-card:hover {
    box-shadow: 0 10px 30px rgba(0, 217, 255, 0.2);
}

.rarity-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rarity-common {
    color: #ffffff;
    border-color: #ffffff;
}

.rarity-uncommon {
    color: #00ff88;
    border-color: #00ff88;
}

.rarity-rare {
    color: #0099ff;
    border-color: #0099ff;
}

.rarity-epic {
    color: #9900ff;
    border-color: #9900ff;
}

.rarity-legendary {
    color: #ff9900;
    border-color: #ff9900;
}

.rarity-rcd {
    color: #3296ff;
    border-color: #3296ff;
}

.rock-list {
    list-style: none;
}

.rock-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.rock-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.rock-name {
    font-weight: 600;
    font-size: 1rem;
    color: #fff;
    margin-bottom: 8px;
}

.rock-details {
    display: none;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.rock-item.expanded .rock-details {
    display: block;
}

.composition-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9rem;
    gap: 8px;
}

.composition-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin: 0;
    overflow: hidden;
    position: relative;
}

.composition-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.composition-label {
    min-width: 100px;
    color: #ccc;
}

.composition-range {
    min-width: 90px;
    text-align: right;
    color: #00d9ff;
    font-family: 'Orbitron', sans-serif;
    flex-shrink: 0;
}

.quality-scale {
    min-width: 65px;
    text-align: center;
    color: #888;
    font-size: 0.85rem;
    font-family: 'Rajdhani', sans-serif;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 4px;
    border-radius: 3px;
    flex-shrink: 0;
}

.expand-hint {
    color: #666;
    font-size: 0.75rem;
    margin-left: auto;
}

.toggle-button {
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid rgba(0, 217, 255, 0.3);
    color: #00d9ff;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.toggle-button:hover {
    background: rgba(0, 217, 255, 0.2);
}

.toggle-button.active {
    background: rgba(0, 217, 255, 0.2);
    border-color: #00d9ff;
}

.mode-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: center;
}

.mode-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 8px 16px;
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    transition: all 0.3s ease;
    border-radius: 6px;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mode-btn.active {
    background: rgba(0, 217, 255, 0.2);
    border-color: #00d9ff;
    color: #00d9ff;
}

.clamp-toggle-fixed {
    position: fixed;
    bottom: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(0, 217, 255, 0.3);
    border-radius: 10px;
    padding: 8px 10px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 1300;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    max-width: calc(100vw - 28px);
    flex-wrap: wrap;
}

.clamp-toggle-fixed:hover {
    border-color: rgba(0, 217, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 217, 255, 0.2);
    transform: translateY(-2px);
}

.settings-divider {
    width: 1px;
    align-self: stretch;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 217, 255, 0.45), rgba(255, 255, 255, 0.05));
}

.clamp-toggle-label {
    font-family: 'Rajdhani', sans-serif;
    color: #00d9ff;
    font-size: 0.78rem;
    font-weight: 500;
    user-select: none;
    white-space: nowrap;
}

.clamp-toggle {
    position: relative;
    width: 40px;
    height: 22px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clamp-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.clamp-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    border-radius: 26px;
}

.clamp-toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 2px;
    background: #fff;
    transition: all 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.clamp-toggle input:checked + .clamp-toggle-slider {
    background: rgba(0, 217, 255, 0.4);
    border-color: #00d9ff;
}

.clamp-toggle input:checked + .clamp-toggle-slider:before {
    transform: translateX(18px);
    background: #00d9ff;
    box-shadow: 0 2px 8px rgba(0, 217, 255, 0.5);
}

.clamp-toggle:hover .clamp-toggle-slider {
    border-color: rgba(0, 217, 255, 0.5);
}

.clamp-toggle input:checked:hover + .clamp-toggle-slider {
    background: rgba(0, 217, 255, 0.5);
}

.probability-decimals-select {
    min-width: 58px;
    height: 30px;
    padding: 0 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(0, 217, 255, 0.35);
    border-radius: 7px;
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    color-scheme: dark;
}

.probability-decimals-select:hover,
.probability-decimals-select:focus-visible {
    border-color: rgba(0, 217, 255, 0.6);
    background: rgba(0, 217, 255, 0.12);
    outline: none;
}

.probability-decimals-select option {
    background: #0b1220;
    color: #f5fbff;
}

.compare-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.version-arrow {
    color: #888;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.5rem;
    font-weight: bold;
}

#version-select-a,
#version-select-b {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 217, 255, 0.5);
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    cursor: pointer;
    min-width: 250px;
}

.comparison-summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
}

.comparison-summary-table th,
.comparison-summary-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.comparison-summary-table th {
    background: rgba(0, 217, 255, 0.1);
    color: #00d9ff;
    font-family: 'Orbitron', sans-serif;
}

.comparison-summary-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.delta-positive {
    color: #00ff88;
}

.delta-negative {
    color: #ff4444;
}

.delta-neutral {
    color: #888;
}

.verdict-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.verdict-improved {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
    border: 1px solid rgba(0, 255, 136, 0.5);
}

.verdict-worsened {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
    border: 1px solid rgba(255, 68, 68, 0.5);
}

.verdict-mixed {
    background: rgba(255, 170, 0, 0.2);
    color: #ffaa00;
    border: 1px solid rgba(255, 170, 0, 0.5);
}

.verdict-unchanged {
    background: rgba(136, 136, 136, 0.2);
    color: #888;
    border: 1px solid rgba(136, 136, 136, 0.5);
}

.version-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 5px;
}

.version-badge-a {
    background: rgba(100, 150, 255, 0.2);
    color: #6496ff;
    border: 1px solid rgba(100, 150, 255, 0.5);
}

.version-badge-b {
    background: rgba(255, 100, 100, 0.2);
    color: #ff6464;
    border: 1px solid rgba(255, 100, 100, 0.5);
}

.category-title-tooltip {
    position: relative;
    display: block;
    cursor: help;
    text-align: left;
}

.category-title-tooltip .tooltip-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(0, 217, 255, 0.5);
    border-radius: 8px;
    padding: 15px;
    min-width: 200px;
    max-width: 300px;
    z-index: 1400;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.category-title-tooltip:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

.tooltip-content h4 {
    font-family: 'Orbitron', sans-serif;
    color: #00d9ff;
    font-size: 0.9rem;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 217, 255, 0.3);
}

.tooltip-content ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tooltip-content li {
    color: #e0e0e0;
    font-size: 0.85rem;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tooltip-content li:last-child {
    border-bottom: none;
}

.tooltip-content li::before {
    content: "•";
    color: #00d9ff;
    margin-right: 8px;
}

.rock-comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.rock-comparison-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 15px;
}

body.chart-modal-open {
    overflow: hidden;
}

.chart-expand-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(3, 8, 18, 0.82);
    backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.chart-expand-modal[hidden] {
    display: none;
}

.chart-expand-surface {
    width: min(1200px, 100%);
    max-height: min(90vh, 900px);
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: linear-gradient(180deg, rgba(6, 16, 30, 0.96), rgba(8, 12, 24, 0.98));
    border: 1px solid rgba(0, 217, 255, 0.22);
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.55);
    padding: 24px;
}

.chart-expand-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 217, 255, 0.14);
}

.chart-expand-close {
    min-width: 90px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.chart-expand-close:hover,
.chart-expand-close:focus-visible {
    background: rgba(0, 217, 255, 0.12);
    border-color: rgba(0, 217, 255, 0.45);
    transform: translateY(-1px);
    outline: none;
}

.chart-expand-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.chart-expand-kicker {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #00d9ff;
}

.chart-expand-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.4rem, 2vw, 2rem);
    color: #fff;
    line-height: 1.2;
}

.chart-expand-subtitle {
    color: #9bb3cf;
    font-size: 1rem;
    line-height: 1.4;
}

.chart-expand-canvas-wrap {
    position: relative;
    min-height: min(65vh, 680px);
}

.chart-expand-canvas-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

@media (max-width: 768px) {
    body {
        padding: 14px;
    }

    .container {
        width: 100%;
    }

    .header {
        margin-bottom: 20px;
    }

    .charts-grid,
    .rarity-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    h1 {
        font-size: 1.75rem;
        line-height: 1.1;
        margin-bottom: 12px;
    }

    .subtitle {
        max-width: 28rem;
        margin: 0 auto 22px;
        font-size: 1rem;
        line-height: 1.35;
    }

    .category-section,
    .composition-section,
    .quantization-section {
        padding: 14px;
        margin-bottom: 18px;
        border-radius: 10px;
    }

    .category-title {
        font-size: 1.2rem;
        line-height: 1.25;
        margin-bottom: 14px;
    }

    .chart-container,
    .rarity-card,
    .rock-comparison-card {
        padding: 12px;
    }

    .chart-header {
        align-items: center;
        gap: 8px;
    }

    .chart-title {
        font-size: 0.9rem;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    .chart-title-badges {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
        margin-top: 6px;
    }

    .badge,
    .version-badge {
        margin-left: 0;
        padding: 3px 7px;
        font-size: 0.68rem;
    }

    .chart-expand-button {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }

    .chart-container canvas {
        min-height: 190px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 14px;
    }

    .stat-card {
        padding: 10px;
        min-width: 0;
    }

    .stat-label {
        font-size: 0.78rem;
        line-height: 1.15;
    }

    .stat-value {
        font-size: 1rem;
        line-height: 1.1;
        overflow-wrap: anywhere;
    }

    .legend {
        justify-content: flex-start;
        gap: 10px 14px;
        padding: 12px;
        margin: 16px 0;
        overflow: hidden;
    }

    .legend-item {
        flex: 1 1 130px;
        min-width: 0;
    }

    .legend-color {
        width: 22px;
        flex: 0 0 22px;
    }

    .legend-label {
        font-size: 0.82rem;
        line-height: 1.15;
    }

    .info-box {
        padding: 12px;
        font-size: 0.86rem;
        line-height: 1.45;
    }

    .composition-row {
        flex-wrap: wrap;
    }

    .composition-bar {
        order: -1;
        width: 100%;
        margin: 5px 0;
    }

    .version-selector,
    .compare-selector {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    #version-select,
    #version-select-a,
    #version-select-b {
        width: 100%;
        min-width: 0;
        min-height: 46px;
        padding: 9px 12px;
        font-size: 1rem;
    }

    .version-label {
        text-align: center;
    }

    .mode-toggle {
        flex-direction: column;
        gap: 8px;
    }

    .mode-btn {
        min-height: 42px;
    }

    .rock-comparison-grid {
        grid-template-columns: 1fr;
    }

    .vs-label {
        display: none;
    }

    .clamp-toggle-fixed {
        position: static;
        justify-content: center;
        margin-top: 14px;
        padding: 8px;
        gap: 7px;
        max-width: none;
        border-radius: 12px;
    }

    .clamp-toggle-label {
        font-size: 0.74rem;
    }

    .settings-divider {
        display: none;
    }

    .probability-decimals-select {
        min-width: 54px;
    }

    .comparison-summary-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .quantization-table-wrapper {
        margin-left: -2px;
        margin-right: -2px;
    }

    .quantization-table {
        min-width: 680px;
    }

    .rarity-title {
        font-size: 1rem;
    }

    .rock-item {
        padding: 10px;
    }

    .rock-name {
        font-size: 0.95rem;
        overflow-wrap: anywhere;
    }

    .composition-label {
        min-width: 0;
        flex: 1 1 auto;
    }

    .composition-range {
        min-width: auto;
    }

    .quality-scale {
        min-width: auto;
    }

    .category-title-tooltip .tooltip-content {
        left: 0;
        right: 0;
        min-width: 0;
        max-width: none;
        transform: translateY(10px);
    }

    .category-title-tooltip:hover .tooltip-content {
        transform: translateY(-5px);
    }

    .chart-expand-modal {
        padding: 12px;
    }

    .chart-expand-surface {
        max-height: calc(100vh - 24px);
        padding: 16px;
        gap: 14px;
    }

    .chart-expand-header {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .chart-expand-close {
        align-self: flex-end;
    }

    .chart-expand-canvas-wrap {
        min-height: 50vh;
    }

    .ai-disclaimer {
        text-align: center;
        padding: 30px 20px;
        margin-top: 40px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(0, 0, 0, 0.3);
    }

    .ai-disclaimer-content {
        max-width: 800px;
        margin: 0 auto;
        font-size: 0.85rem;
        color: #888;
        line-height: 1.6;
        background: rgba(0, 217, 255, 0.05);
        border: 1px solid rgba(0, 217, 255, 0.2);
        border-radius: 8px;
        padding: 15px 20px;
    }

    .ai-disclaimer-content strong {
        color: #00d9ff;
        font-weight: 600;
    }
}

@media (max-width: 430px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 1.55rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .category-section,
    .composition-section,
    .quantization-section {
        padding: 12px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chart-container canvas {
        min-height: 205px;
    }

    .clamp-toggle-label {
        font-size: 0.68rem;
    }
}
