/**
 * ZZZ Tools - Unified Stylesheet
 * All pages share this single CSS file for consistency
 */

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

/* ============================================================================
   CSS VARIABLES - Design Tokens
   ============================================================================ */

:root {
    /* Core palette */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a26;
    
    /* Accent colors */
    --accent-primary: #ff6b35;
    --accent-secondary: #00d4aa;
    --accent-glow: #ff6b3540;
    
    /* Text colors */
    --text-primary: #e8e8e8;
    --text-secondary: #a0a0a0;
    --text-muted: #606070;
    
    /* Utility colors */
    --border-color: #2a2a3a;
    --success: #00d4aa;
    --warning: #ffaa00;
    --error: #ff4444;
    
    /* Element colors - Primary */
    --element-fire: #c44125;
    --element-ice: #5ec4e8;
    --element-electric: #3b82f6;
    --element-physical: #e0b040;
    --element-ether: #d946ef;
    
    /* Element colors - Light variants (for text/initials) */
    --element-fire-light: #ef6a5a;
    --element-ice-light: #7dd3f0;
    --element-electric-light: #60a5fa;
    --element-physical-light: #f0c860;
    --element-ether-light: #e879f9;
}

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */

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

body {
    font-family: 'Rajdhani', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    background-image: 
        radial-gradient(ellipse at top left, rgba(255, 107, 53, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(0, 212, 170, 0.06) 0%, transparent 50%);
    overflow-x: hidden;
}

/* ============================================================================
   LAYOUT
   ============================================================================ */

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

.container.wide {
    max-width: 1200px;
}

.container.extra-wide {
    max-width: 1400px;
}

main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ============================================================================
   HEADER & NAVIGATION
   ============================================================================ */

.site-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.site-header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.4rem;
}

.site-header .page-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-top: 0.5rem;
}

/* Navigation - Subtle inline style */
.site-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
}

.nav-sep {
    color: var(--text-muted);
    font-size: 0.7rem;
    user-select: none;
}

.nav-link {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-decoration: none;
    color: var(--text-muted);
    padding: 0.15rem 0.3rem;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--text-secondary);
}

.nav-link.active {
    color: var(--text-secondary);
}

.nav-divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color) 20%, var(--border-color) 80%, transparent);
    margin: 0.6rem auto 0;
    width: 60%;
    max-width: 400px;
}

/* Legacy header support */
header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.3rem;
}

header h2 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

/* ============================================================================
   FOOTER
   ============================================================================ */

.site-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.site-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.site-footer a:hover {
    color: var(--accent-secondary);
}

/* Legacy footer support */
footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ============================================================================
   SECTIONS
   ============================================================================ */

section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
}

section h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--accent-primary);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

section h3:not(:first-child) {
    margin-top: 1.5rem;
}

.section-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.section-description .highlight-universal {
    color: var(--accent-secondary);
    font-weight: 600;
}

/* ============================================================================
   COLLAPSIBLE SECTIONS
   ============================================================================ */

.collapsible-section {
    margin-top: 1.5rem;
}

.collapsible-section summary {
    cursor: pointer;
    list-style: none;
}

.collapsible-section summary::-webkit-details-marker {
    display: none;
}

.collapsible-section summary h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0;
}

.collapsible-section summary h3::before {
    content: '▶';
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.collapsible-section[open] summary h3::before {
    transform: rotate(90deg);
}

.collapsible-section .input-row {
    margin-top: 1rem;
}

/* ============================================================================
   FORM ELEMENTS - Inputs & Selects
   ============================================================================ */

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.input-group input[type="number"],
.input-group select {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a0a0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.input-group select option {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font: inherit;
    padding: 0.5rem;
}

/* ============================================================================
   CUSTOM DROPDOWN COMPONENT
   ============================================================================ */

.custom-dropdown-wrapper {
    width: 100%;
}

.custom-dropdown-wrapper:has(.custom-dropdown.inline) {
    width: auto;
    display: inline-block;
}

.custom-dropdown {
    position: relative;
    width: 100%;
    cursor: pointer;
    user-select: none;
}

.custom-dropdown-display {
    width: 100%;
    padding: 0.7rem 2.5rem 0.7rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    transition: border-color 0.2s, box-shadow 0.2s;
    position: relative;
    box-sizing: border-box;
}

.custom-dropdown:hover .custom-dropdown-display,
.custom-dropdown:focus .custom-dropdown-display {
    border-color: var(--accent-primary);
}

.custom-dropdown:focus {
    outline: none;
}

.custom-dropdown:focus .custom-dropdown-display {
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.custom-dropdown-arrow {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.8rem;
    transition: transform 0.2s;
    pointer-events: none;
}

.custom-dropdown.open .custom-dropdown-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.custom-dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.custom-dropdown.open .custom-dropdown-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-dropdown-option {
    padding: 0.6rem 1rem;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: background-color 0.1s, color 0.1s;
}

.custom-dropdown-option:hover,
.custom-dropdown-option.focused {
    background: var(--bg-secondary);
    color: var(--accent-primary);
}

.custom-dropdown-option.selected {
    color: var(--accent-secondary);
    font-weight: 600;
}

.custom-dropdown-option.selected::before {
    content: '✓ ';
    color: var(--accent-secondary);
}

/* Inline variant for options row (like tactic select) */
.custom-dropdown.inline {
    width: auto;
    display: inline-block;
}

.custom-dropdown.inline .custom-dropdown-display {
    font-size: 0.9rem;
    padding: 0.5rem 2rem 0.5rem 0.8rem;
    color: var(--text-secondary);
}

.custom-dropdown.inline:hover .custom-dropdown-display,
.custom-dropdown.inline:focus .custom-dropdown-display {
    color: var(--text-primary);
}

.custom-dropdown.inline .custom-dropdown-options {
    min-width: 200px;
}

.custom-dropdown.inline .custom-dropdown-option {
    font-size: 0.9rem;
}

.input-group input[type="number"]:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.input-group input[type="number"].invalid {
    border-color: var(--error);
    box-shadow: 0 0 0 2px rgba(255, 68, 68, 0.25);
}

.pity-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    letter-spacing: 0.02em;
}

.input-group.calculated {
    background: var(--bg-tertiary);
    padding: 0.8rem 1rem;
    border-radius: 4px;
    border: 1px dashed var(--border-color);
}

.input-group.calculated label {
    margin-bottom: 0.2rem;
}

.input-group.calculated span {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-secondary);
}

/* Input rows and grids */
.input-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.pity-row {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
    .input-row {
        grid-template-columns: 1fr;
    }
    .pity-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Checkbox styling */
.checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 0.5rem 0.8rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s, color 0.2s;
}

.checkbox-label:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-primary);
}

.tactic-select {
    font-size: 0.9rem;
    font-weight: inherit;
    font-family: inherit;
    color: var(--text-secondary);
    padding: 0.5rem 0.8rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    height: auto;
}

.tactic-select:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.tactic-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.tactic-select option {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
}

/* ============================================================================
   VALIDATION ERRORS
   ============================================================================ */

.validation-errors {
    background: rgba(255, 68, 68, 0.15);
    border: 1px solid var(--error);
    border-radius: 4px;
    padding: 0.8rem 1rem;
    margin-top: 1.5rem;
    animation: shake 0.3s ease-out;
}

.validation-errors ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.validation-errors li {
    color: #ff6b6b;
    font-size: 0.95rem;
    padding: 0.2rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.validation-errors li::before {
    content: '⚠';
    font-size: 0.9rem;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

/* Primary action button */
.btn-primary,
button#simulate-btn,
.run-btn {
    width: 100%;
    margin-top: 1.5rem;
    padding: 1rem 2rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--bg-primary);
    background: linear-gradient(135deg, var(--accent-primary), #ff8855);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover:not(:disabled),
button#simulate-btn:hover:not(:disabled),
.run-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:active,
button#simulate-btn:active,
.run-btn:active {
    transform: translateY(0);
}

.btn-primary:disabled,
button#simulate-btn:disabled,
.run-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Secondary button */
.btn-secondary,
.secondary-btn {
    flex: 0 0 auto;
    padding: 1rem 1.5rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover,
.secondary-btn:hover {
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
}

/* Action button row */
.action-buttons {
    display: flex;
    gap: 1rem;
}

.action-buttons .run-btn {
    flex: 2;
    margin-top: 0;
}

.action-buttons .secondary-btn {
    flex: 1;
    margin-top: 0;
    text-align: center;
}

.action-section {
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
    }
    
    .secondary-btn {
        order: 2;
    }
}

/* Filter/Toggle button */
.filter-btn {
    padding: 0.4rem 0.7rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.filter-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
    font-weight: 600;
}

.button-group {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

/* Subtle button */
.subtle-btn {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.15rem 0.4rem;
    border: none;
    border-radius: 3px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0.6;
}

.subtle-btn:hover {
    opacity: 1;
    color: var(--text-primary);
}

.subtle-btn.select-all:hover {
    color: var(--accent-secondary);
}

.subtle-btn.deselect-all:hover {
    color: #ff6b6b;
}

/* ============================================================================
   RESULTS SECTION
   ============================================================================ */

.results-section {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 900px) {
    .results-content {
        grid-template-columns: 1fr;
    }
}

.results-text {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-block {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 4px;
    border-left: 3px solid var(--accent-primary);
}

.result-block h4 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--accent-secondary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.result-block pre {
    font-family: 'Rajdhani', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.result-block .highlight {
    color: var(--accent-secondary);
    font-weight: 600;
}

.result-block .stat-line {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--border-color);
}

.result-block .stat-line:last-child {
    border-bottom: none;
}

.result-block .stat-label {
    color: var(--text-secondary);
}

.result-block .stat-value {
    color: var(--text-primary);
    font-weight: 600;
}

.result-block .stat-value.success {
    color: var(--success);
}

.result-block .stat-note {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 400;
}

/* Distribution table */
.distribution-table {
    width: 100%;
}

.distribution-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--border-color);
}

.distribution-row:last-child {
    border-bottom: none;
}

.distribution-row.target {
    background: rgba(0, 212, 170, 0.2);
    margin: 0 -0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    border-left: 3px solid var(--accent-secondary);
    box-shadow: 0 0 8px rgba(0, 212, 170, 0.3);
}

.distribution-row.target .distribution-label {
    color: var(--accent-secondary);
}

.distribution-label {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 140px;
}

.distribution-count {
    color: var(--text-secondary);
    min-width: 70px;
    text-align: right;
}

.distribution-percent {
    color: var(--accent-secondary);
    font-weight: 600;
    min-width: 60px;
    text-align: right;
}

/* Results header with count */
.results-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.results-header h3 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.results-count {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.results-count .highlight {
    color: var(--accent-secondary);
    font-weight: 600;
}

/* No results state */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.no-results p {
    margin: 0.5rem 0;
}

.no-results .hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ============================================================================
   CHARTS
   ============================================================================ */

.charts-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.chart-container {
    background: var(--bg-tertiary);
    border-radius: 4px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 300px;
}

.chart-container h4 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--accent-secondary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

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

/* ============================================================================
   ROSTER SECTION - Collapsible Container
   ============================================================================ */

.roster-section {
    margin-top: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
}

.roster-header {
    cursor: pointer;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    list-style: none;
    user-select: none;
}

.roster-header::-webkit-details-marker {
    display: none;
}

.roster-header::before {
    content: '▶';
    font-size: 0.8rem;
    color: var(--accent-primary);
    transition: transform 0.2s;
}

.roster-section[open] .roster-header::before {
    transform: rotate(90deg);
}

.roster-header h3 {
    margin: 0;
    font-size: 1.1rem;
    padding: 0;
    border: none;
}

.roster-toggle-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-left: auto;
    display: none;
}

.roster-section[open] .roster-toggle-hint {
    display: inline;
}

.roster-toggle-hint .highlight-universal {
    color: var(--accent-secondary);
    font-weight: 600;
}

.roster-content {
    padding: 0 1rem 1rem;
}

/* Roster subsections */
.roster-subsection {
    padding-top: 0.75rem;
}

.roster-subsection:not(:first-child) {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 0.5rem;
}

.subsection-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 0.25rem 0.5rem;
}

.subsection-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.subsection-count {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.75rem;
    color: var(--accent-secondary);
    font-weight: 600;
    opacity: 0.8;
}

.subsection-actions {
    margin-left: auto;
    display: flex;
    gap: 0.25rem;
}

/* ============================================================================
   UNIT GRID & CARDS
   ============================================================================ */

.unit-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.unit-card {
    background: var(--bg-tertiary);
    border: 3px solid var(--border-color);
    border-radius: 8px;
    padding: 0;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    font-family: inherit;
    font-size: inherit;
    text-align: center;
    overflow: hidden;
    width: 80px;
}

.unit-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Element border colors */
.unit-card.element-fire { border-color: var(--element-fire); }
.unit-card.element-ice { border-color: var(--element-ice); }
.unit-card.element-electric { border-color: var(--element-electric); }
.unit-card.element-physical { border-color: var(--element-physical); }
.unit-card.element-ether { border-color: var(--element-ether); }

/* Not owned state */
.unit-card.not-owned {
    opacity: 0.45;
    border-color: var(--border-color);
}

.unit-card.not-owned:hover {
    opacity: 0.7;
}

/* Universal/Flex state */
.unit-card.universal {
    box-shadow: 0 0 12px rgba(0, 212, 170, 0.5);
}

/* Unit avatar */
.unit-avatar {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

/* Unit initials fallback */
.unit-initials {
    font-weight: 700;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-primary);
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
}

/* Element tint on initials */
.unit-card.element-fire .unit-initials { color: var(--element-fire-light); }
.unit-card.element-ice .unit-initials { color: var(--element-ice-light); }
.unit-card.element-electric .unit-initials { color: var(--element-electric-light); }
.unit-card.element-physical .unit-initials { color: var(--element-physical-light); }
.unit-card.element-ether .unit-initials { color: var(--element-ether-light); }

.unit-card.not-owned .unit-initials {
    color: var(--text-secondary);
}

/* Unit name overlay */
.unit-name {
    font-size: 0.6rem;
    font-weight: 600;
    color: white;
    line-height: 1.1;
    padding: 0.2rem 0.15rem;
    background: rgba(0, 0, 0, 0.7);
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Flex badge - overlay bubble at bottom of portrait */
.flex-badge {
    position: absolute;
    bottom: 18px; /* Sits above the unit name */
    left: 50%;
    transform: translateX(-50%);
    padding: 0.15rem 0.4rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-primary);
    border-radius: 3px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    z-index: 10;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .unit-card {
        width: 70px;
    }
    
    .subsection-actions {
        display: none;
    }
}

@media (max-width: 480px) {
    .unit-card {
        width: 60px;
    }
}

/* ============================================================================
   BOSS SELECTION
   ============================================================================ */

.boss-selection-section {
    margin-top: 1rem;
}

.boss-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}

.boss-card {
    border: 3px solid var(--border-color);
    border-radius: 10px;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-size: inherit;
    text-align: center;
    overflow: hidden;
    position: relative;
    background: var(--bg-secondary);
}

.boss-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.boss-card.selected {
    border-color: var(--accent-secondary);
    box-shadow: 0 0 15px rgba(0, 212, 170, 0.3);
}

.boss-avatar {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 0;
    border: none;
}

.boss-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.boss-initials {
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.boss-card .boss-name {
    font-weight: 700;
    font-size: 0.7rem;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    line-height: 1.2;
    padding: 0.4rem 0.3rem;
    background: rgba(0, 0, 0, 0.7);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Selected boss - weakness colors */
.boss-card.selected.weakness-fire { background: var(--element-fire); }
.boss-card.selected.weakness-ice { background: var(--element-ice); }
.boss-card.selected.weakness-electric { background: var(--element-electric); }
.boss-card.selected.weakness-physical { background: var(--element-physical); }
.boss-card.selected.weakness-ether { background: var(--element-ether); }

/* Dual weakness gradients */
.boss-card.selected.weakness-electric-ether { background: linear-gradient(135deg, var(--element-electric) 35%, var(--element-ether) 65%); }
.boss-card.selected.weakness-ether-ice { background: linear-gradient(135deg, var(--element-ether) 35%, var(--element-ice) 65%); }
.boss-card.selected.weakness-ice-ether { background: linear-gradient(135deg, var(--element-ice) 35%, var(--element-ether) 65%); }
.boss-card.selected.weakness-ether-physical { background: linear-gradient(135deg, var(--element-ether) 35%, var(--element-physical) 65%); }
.boss-card.selected.weakness-electric-physical { background: linear-gradient(135deg, var(--element-electric) 35%, var(--element-physical) 65%); }
.boss-card.selected.weakness-fire-ice { background: linear-gradient(135deg, var(--element-fire) 35%, var(--element-ice) 65%); }
.boss-card.selected.weakness-ice-physical { background: linear-gradient(135deg, var(--element-ice) 35%, var(--element-physical) 65%); }
.boss-card.selected.weakness-fire-electric { background: linear-gradient(135deg, var(--element-fire) 35%, var(--element-electric) 65%); }
.boss-card.selected.weakness-fire-physical { background: linear-gradient(135deg, var(--element-fire) 35%, var(--element-physical) 65%); }
.boss-card.selected.weakness-fire-ether { background: linear-gradient(135deg, var(--element-fire) 35%, var(--element-ether) 65%); }
.boss-card.selected.weakness-physical-ether { background: linear-gradient(135deg, var(--element-physical) 35%, var(--element-ether) 65%); }

@media (max-width: 768px) {
    .boss-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* ============================================================================
   FILTER SECTION
   ============================================================================ */

.collapsible-filter {
    margin-top: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
}

.filter-header {
    cursor: pointer;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    list-style: none;
    user-select: none;
}

.filter-header::-webkit-details-marker {
    display: none;
}

.filter-header::before {
    content: '▶';
    font-size: 0.8rem;
    color: var(--accent-primary);
    transition: transform 0.2s;
}

.collapsible-filter[open] .filter-header::before {
    transform: rotate(90deg);
}

.filter-header h3 {
    margin: 0;
    font-size: 1.1rem;
    padding: 0;
    border: none;
}

.filter-toggle-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-left: auto;
    display: none;
}

.collapsible-filter[open] .filter-toggle-hint {
    display: inline;
}

.collapsible-filter .filters-grid {
    padding: 0 1.25rem 1.25rem;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.filter-group-wide {
    grid-column: span 2;
}

@media (max-width: 600px) {
    .filter-group-wide {
        grid-column: span 1;
    }
}

.filter-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* ============================================================================
   MULTI-SELECT DROPDOWN
   ============================================================================ */

.multi-dropdown {
    position: relative;
}

.multi-dropdown-wide .dropdown-menu {
    min-width: 100%;
}

.dropdown-toggle {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dropdown-toggle:hover {
    border-color: var(--accent-primary);
}

.dropdown-toggle:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.dropdown-arrow {
    font-size: 0.65rem;
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.multi-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100% - 20px);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 160px;
    max-height: 250px;
    overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 100;
    display: none;
}

.multi-dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-menu-units {
    min-width: 200px;
    max-height: 300px;
}

/* Dropdown search row */
.dropdown-search-row {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 1;
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.dropdown-search-input {
    width: 80px;
    min-width: 80px;
    padding: 0.35rem 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.2s;
}

.dropdown-search-input:focus {
    border-color: var(--accent-primary);
}

.dropdown-search-input::placeholder {
    color: var(--text-muted);
}

/* Quick filter buttons */
.dropdown-quick-filters {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.quick-filter-btn {
    padding: 0.25rem 0.45rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    color: var(--text-secondary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.quick-filter-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.quick-filter-btn.active {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    color: var(--bg-primary);
}

/* Select all/none actions */
.dropdown-select-actions {
    display: flex;
    gap: 0.15rem;
    margin-left: auto;
    flex-shrink: 0;
}

.select-action-btn {
    padding: 0.2rem 0.4rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.select-action-btn:hover {
    color: var(--text-primary);
}

.select-action-btn.select-all-visible:hover {
    color: var(--accent-secondary);
}

.select-action-btn.select-none-visible:hover {
    color: #ff6b6b;
}

.dropdown-items {
    max-height: 230px;
    overflow-y: auto;
}

.dropdown-item.hidden {
    display: none;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 0.85rem;
}

.dropdown-item:hover {
    background: var(--bg-tertiary);
}

.dropdown-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--accent-primary);
    flex-shrink: 0;
}

/* Element tags in dropdown */
.element-tag {
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.8rem;
}

.element-tag.fire { background: var(--element-fire); color: white; }
.element-tag.ice { background: var(--element-ice); color: #1a1a26; }
.element-tag.electric { background: var(--element-electric); color: white; }
.element-tag.physical { background: var(--element-physical); color: #1a1a26; }
.element-tag.ether { background: var(--element-ether); color: white; }

/* ============================================================================
   TEAMS GRID
   ============================================================================ */

.teams-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width: 1000px) {
    .teams-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 750px) {
    .teams-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .teams-grid {
        grid-template-columns: 1fr;
    }
}

/* Team card */
.team-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.2s;
}

.team-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.team-card-units {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
}

/* Team unit mini-card */
.team-unit {
    width: 70px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.team-unit.element-fire { border-color: var(--element-fire); }
.team-unit.element-ice { border-color: var(--element-ice); }
.team-unit.element-electric { border-color: var(--element-electric); }
.team-unit.element-physical { border-color: var(--element-physical); }
.team-unit.element-ether { border-color: var(--element-ether); }

.team-unit .unit-avatar {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.team-unit .unit-initials {
    font-weight: 700;
    font-size: 1.2rem;
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
}

.team-unit.element-fire .unit-initials { color: var(--element-fire-light); }
.team-unit.element-ice .unit-initials { color: var(--element-ice-light); }
.team-unit.element-electric .unit-initials { color: var(--element-electric-light); }
.team-unit.element-physical .unit-initials { color: var(--element-physical-light); }
.team-unit.element-ether .unit-initials { color: var(--element-ether-light); }

.team-unit .unit-name {
    font-size: 0.5rem;
    color: white;
    font-weight: 600;
    padding: 0.1rem 0.15rem;
    background: rgba(0, 0, 0, 0.7);
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    text-align: center;
}

/* Team info badges */
.team-card-info {
    display: flex;
    gap: 0.3rem;
    justify-content: center;
    flex-wrap: wrap;
}

.team-badge {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.team-badge.element-badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.team-badge.element-badge.fire { background: var(--element-fire); color: white; }
.team-badge.element-badge.ice { background: var(--element-ice); color: #1a1a26; }
.team-badge.element-badge.electric { background: var(--element-electric); color: white; }
.team-badge.element-badge.physical { background: var(--element-physical); color: #1a1a26; }
.team-badge.element-badge.ether { background: var(--element-ether); color: white; }

.team-badge.role-badge {
    background: rgba(0, 212, 170, 0.2);
    color: var(--accent-secondary);
}

/* ============================================================================
   TEAM GRID LAYOUT (Element rows x DPS type columns)
   ============================================================================ */

.team-grid-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow-x: auto;
    grid-column: 1 / -1; /* Span all columns when inside CSS grid */
    width: 100%;
}

.team-grid-header {
    display: flex;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.grid-corner {
    width: 80px;
    min-width: 80px;
    padding: 0.5rem;
    border-right: 1px solid var(--border-color);
}

.grid-header-cell {
    flex: 1;
    min-width: 180px;
    padding: 0.6rem 0.5rem;
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-right: 1px solid var(--border-color);
}

.grid-header-cell:last-child {
    border-right: none;
}

/* DPS type headers - use consistent teal/cyan color */
.grid-header-cell.dps-attack,
.grid-header-cell.dps-anomaly,
.grid-header-cell.dps-rupture {
    color: var(--text-primary);
}

.team-grid-row {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.team-grid-row:last-child {
    border-bottom: none;
}

.grid-row-label {
    width: 80px;
    min-width: 80px;
    padding: 0.75rem 0.5rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 1rem;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-right: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.grid-row-label.element-fire { color: var(--element-fire-light); }
.grid-row-label.element-ice { color: var(--element-ice-light); }
.grid-row-label.element-electric { color: var(--element-electric-light); }
.grid-row-label.element-physical { color: var(--element-physical-light); }
.grid-row-label.element-ether { color: var(--element-ether-light); }

.grid-cell {
    flex: 1;
    min-width: 180px;
    padding: 0.5rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    border-right: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.grid-cell:last-child {
    border-right: none;
}

.grid-cell-empty {
    color: var(--text-muted);
    font-size: 1.2rem;
}

.grid-cell-teams {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

/* Compact team card for grid */
.team-card-compact {
    padding: 0.4rem;
    margin: 0;
}

.team-card-compact .team-card-units {
    gap: 0.25rem;
}

.team-card-compact .team-unit {
    width: 55px;
}

.team-card-compact .team-unit .unit-name {
    font-size: 0.45rem;
}

/* Additional teams section */
.additional-teams {
    margin-top: 1.5rem;
    grid-column: 1 / -1; /* Span all columns when inside CSS grid */
}

.additional-teams-header {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.additional-teams-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Responsive grid adjustments */
@media (max-width: 900px) {
    .grid-corner,
    .grid-row-label {
        width: 60px;
        min-width: 60px;
        font-size: 0.7rem;
    }
    
    .team-card-compact .team-unit {
        width: 45px;
    }
    
    .team-card-compact .team-unit .unit-name {
        font-size: 0.4rem;
    }
}

@media (max-width: 600px) {
    .team-grid-container {
        overflow-x: auto;
    }
    
    .team-grid-header {
        min-width: 500px;
    }
}

@media (max-width: 768px) {
    .team-unit {
        width: 60px;
    }
}

@media (max-width: 480px) {
    .team-unit {
        width: 55px;
    }
    
    .team-unit .unit-initials {
        font-size: 1rem;
    }
}

/* ============================================================================
   PAGINATION
   ============================================================================ */

.results-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.pagination-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============================================================================
   CAROUSEL
   ============================================================================ */

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

.carousel-viewport {
    flex: 1;
    overflow: hidden;
    border-radius: 12px;
}

.carousel-track {
    display: flex;
    transition: transform 0.4s ease-out;
}

.carousel-slide {
    flex: 0 0 100%;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-sizing: border-box;
}

.carousel-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.carousel-btn:hover:not(:disabled) {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
    transform: scale(1.05);
}

.carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-btn span {
    line-height: 1;
    margin-top: -4px;
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.carousel-dot:hover {
    background: var(--text-secondary);
}

.carousel-dot.active {
    background: var(--accent-secondary);
    transform: scale(1.2);
}

.carousel-counter {
    text-align: center;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 700;
}

/* Result slide content */
.result-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-secondary);
    margin-bottom: 1.5rem;
    text-align: center;
    letter-spacing: 0.05em;
}

.result-columns {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.result-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

/* Result boss tile */
.result-boss-tile {
    width: 170px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow: hidden;
    background: var(--bg-secondary);
}

.result-boss-tile .result-boss-avatar {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.result-boss-tile .boss-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-boss-tile .boss-initials {
    font-weight: 700;
    font-size: 1.3rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.result-boss-tile .boss-name {
    font-weight: 600;
    font-size: 0.75rem;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
    text-align: center;
    padding: 0.4rem 0.3rem;
    background: rgba(0, 0, 0, 0.7);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Result boss tile weakness colors */
.result-boss-tile.weakness-fire { background: var(--element-fire); }
.result-boss-tile.weakness-ice { background: var(--element-ice); }
.result-boss-tile.weakness-electric { background: var(--element-electric); }
.result-boss-tile.weakness-physical { background: var(--element-physical); }
.result-boss-tile.weakness-ether { background: var(--element-ether); }

.result-boss-tile.weakness-electric-ether { background: linear-gradient(135deg, var(--element-electric) 35%, var(--element-ether) 65%); }
.result-boss-tile.weakness-ether-ice { background: linear-gradient(135deg, var(--element-ether) 35%, var(--element-ice) 65%); }
.result-boss-tile.weakness-ice-ether { background: linear-gradient(135deg, var(--element-ice) 35%, var(--element-ether) 65%); }
.result-boss-tile.weakness-ether-physical { background: linear-gradient(135deg, var(--element-ether) 35%, var(--element-physical) 65%); }
.result-boss-tile.weakness-electric-physical { background: linear-gradient(135deg, var(--element-electric) 35%, var(--element-physical) 65%); }
.result-boss-tile.weakness-fire-ice { background: linear-gradient(135deg, var(--element-fire) 35%, var(--element-ice) 65%); }
.result-boss-tile.weakness-ice-physical { background: linear-gradient(135deg, var(--element-ice) 35%, var(--element-physical) 65%); }
.result-boss-tile.weakness-fire-electric { background: linear-gradient(135deg, var(--element-fire) 35%, var(--element-electric) 65%); }
.result-boss-tile.weakness-fire-physical { background: linear-gradient(135deg, var(--element-fire) 35%, var(--element-physical) 65%); }
.result-boss-tile.weakness-fire-ether { background: linear-gradient(135deg, var(--element-fire) 35%, var(--element-ether) 65%); }
.result-boss-tile.weakness-physical-ether { background: linear-gradient(135deg, var(--element-physical) 35%, var(--element-ether) 65%); }

/* Result team stack */
.result-team-stack {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 0.5rem;
}

/* Result unit cards */
.result-unit-card {
    width: 80px;
    background: var(--bg-secondary);
    border: 3px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.result-unit-card.element-fire { border-color: var(--element-fire); }
.result-unit-card.element-ice { border-color: var(--element-ice); }
.result-unit-card.element-electric { border-color: var(--element-electric); }
.result-unit-card.element-physical { border-color: var(--element-physical); }
.result-unit-card.element-ether { border-color: var(--element-ether); }

.result-unit-card .unit-avatar {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.result-unit-card .unit-initials {
    font-weight: 700;
    font-size: 1.5rem;
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
}

.result-unit-card.element-fire .unit-initials { color: var(--element-fire-light); }
.result-unit-card.element-ice .unit-initials { color: var(--element-ice-light); }
.result-unit-card.element-electric .unit-initials { color: var(--element-electric-light); }
.result-unit-card.element-physical .unit-initials { color: var(--element-physical-light); }
.result-unit-card.element-ether .unit-initials { color: var(--element-ether-light); }

.result-unit-card .unit-name {
    font-size: 0.55rem;
    color: white;
    font-weight: 600;
    padding: 0.15rem;
    background: rgba(0, 0, 0, 0.7);
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    text-align: center;
}

@media (max-width: 768px) {
    .carousel-btn {
        width: 36px;
        height: 36px;
        font-size: 1.4rem;
    }
    
    .carousel-slide {
        padding: 1rem;
    }
    
    .result-columns {
        gap: 1rem;
    }
    
    .result-boss-tile {
        width: 135px;
    }
    
    .result-boss-tile .boss-initials {
        font-size: 1.1rem;
    }
    
    .result-unit-card {
        width: 70px;
    }
}

@media (max-width: 480px) {
    .carousel-btn {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }
    
    .result-columns {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .result-column {
        flex-direction: row;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .result-team-stack {
        flex-direction: column;
    }
    
    .result-boss-tile {
        width: 110px;
    }
    
    .result-unit-card {
        width: 60px;
    }
}

/* ============================================================================
   SHARE BUTTON & SHARED ROSTER BANNER
   ============================================================================ */

/* Share button in roster header */
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 0.75rem;
}

.share-btn:hover {
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
    background: rgba(0, 212, 170, 0.1);
}

.share-btn:active {
    transform: scale(0.97);
}

.share-btn .share-icon {
    flex-shrink: 0;
}

.share-btn .share-text {
    white-space: nowrap;
}

/* Share button success state (after copy) */
.share-btn.copied {
    border-color: var(--success);
    color: var(--success);
    background: rgba(0, 212, 170, 0.15);
}

.share-btn.copied .share-icon {
    display: none;
}

.share-btn.copied .share-text::before {
    content: '✓ ';
}

/* Shared roster banner */
.shared-roster-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.15), rgba(0, 212, 170, 0.1));
    border: 1px solid var(--accent-primary);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.shared-roster-banner .shared-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.shared-roster-banner .shared-text {
    flex: 1;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.shared-roster-banner .shared-reset-link {
    padding: 0.35rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--accent-secondary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.shared-roster-banner .shared-reset-link:hover {
    border-color: var(--accent-secondary);
    background: rgba(0, 212, 170, 0.1);
}

/* Toast notification */
.share-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 0.75rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--accent-secondary);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

.share-toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.share-toast.error {
    border-color: var(--error);
}

@media (max-width: 768px) {
    .share-btn .share-text {
        display: none;
    }
    
    .share-btn {
        padding: 0.35rem 0.5rem;
    }
    
    .shared-roster-banner {
        flex-wrap: wrap;
    }
    
    .shared-roster-banner .shared-text {
        order: 2;
        flex-basis: 100%;
        margin-top: 0.25rem;
    }
    
    .shared-roster-banner .shared-reset-link {
        margin-left: auto;
    }
}

/* ============================================================================
   DISC CALCULATOR
   ============================================================================ */

/* Stat Pills - Multi-select buttons */
.stat-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.9rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.stat-pill:hover:not(.disabled) {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    background: rgba(255, 107, 53, 0.1);
}

.stat-pill.active {
    background: linear-gradient(135deg, var(--accent-primary), #ff8855);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
    font-weight: 600;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.stat-pill.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    border-style: dashed;
}

.stat-pill.any-pill.active {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    box-shadow: 0 2px 8px rgba(0, 212, 170, 0.3);
}

/* Main stat pills container */
.mainstat-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Fixed stat display (for slots 1-3) */
.fixed-stat-display {
    padding: 0.7rem 1rem;
    background: var(--bg-tertiary);
    border: 1px dashed var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 500;
}

/* Substat section */
.substat-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.substat-section .filter-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.3rem;
}

.substat-count {
    font-weight: 400;
    color: var(--accent-secondary);
    font-size: 0.85rem;
}

.substat-section .filter-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Calibrator row */
.calibrator-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.8rem;
    padding-left: 0.2rem;
}

.simple-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
}

.simple-checkbox:hover {
    color: var(--text-primary);
}

.inline-input {
    width: 45px;
    padding: 0.3rem 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    transition: all 0.2s;
}

.inline-input:focus {
    border-color: var(--accent-primary);
    outline: none;
}

.inline-input:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: var(--bg-secondary);
    border-color: transparent;
}

.calibrator-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.number-input {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    width: 80px;
    font-family: 'Rajdhani', sans-serif;
}

.full-width {
    width: 100%;
}

/* Substat dropdowns */
.substat-dropdowns {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.substat-dropdown-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    align-items: center;
    gap: 1rem;
}

.substat-dropdown-row label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.substat-inputs {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    flex-grow: 1;
}

.substat-select-container {
    flex-grow: 1;
}

.substat-upgrade-container {
    width: 60px;
    flex-shrink: 0;
}

/* Custom Upgrade Widget */
.upgrade-widget {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-tertiary);
    height: 100%;
    min-height: 40px;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
    cursor: pointer;
    transition: border-color 0.2s;
}

.upgrade-widget:hover {
    border-color: var(--accent-primary);
}

.upgrade-display {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    user-select: none;
    line-height: 1;
}

.upgrade-display.placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

.upgrade-controls {
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color);
    width: 24px;
    flex-shrink: 0;
}

.upgrade-btn {
    flex-grow: 1;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s, color 0.2s;
    height: 50%;
}

.upgrade-btn:first-child {
    border-bottom: 1px solid var(--border-color);
}

.upgrade-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.upgrade-widget.disabled {
    opacity: 0.5;
    pointer-events: none;
    background: var(--bg-secondary);
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 15, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    z-index: 10000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Target details in results */
.target-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.target-item {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.target-label {
    color: var(--text-secondary);
    min-width: 90px;
}

.target-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* Interpretation colors */
.interpretation-block p {
    line-height: 1.6;
    color: var(--text-secondary);
}

.interp-good {
    color: var(--success);
    font-weight: 600;
}

.interp-medium {
    color: var(--warning);
    font-weight: 600;
}

.interp-hard {
    color: #ff7744;
    font-weight: 600;
}

.interp-extreme {
    color: var(--error);
    font-weight: 600;
}

.interpretation-block .note {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Calculator section tweaks */
.calculator-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .stat-pill {
        padding: 0.4rem 0.7rem;
        font-size: 0.85rem;
    }
    
    .substat-pill {
        min-width: 80px;
    }
    
    .mainstat-pills {
        gap: 0.4rem;
    }
}

/* ============================================================================
   MOBILE COMPATIBILITY FIXES
   ============================================================================ */

@media (max-width: 768px) {
    /* Container adjustments */
    .container {
        padding: 1rem;
    }

    /* Header Navigation */
    .site-nav {
        flex-wrap: wrap;
        gap: 0.5rem 1rem;
    }

    .nav-sep {
        display: none;
    }

    .nav-link {
        padding: 0.5rem;
        font-size: 0.9rem;
        border: 1px solid var(--border-color);
        border-radius: 4px;
        background: var(--bg-secondary);
    }

    /* Touch Targets */
    .btn-primary, .btn-secondary, .filter-btn, .dropdown-toggle, .unit-card {
        min-height: 44px;
    }

    .unit-card {
        min-height: auto; /* Allow unit cards to be sized by width */
    }

    /* Team Builder Grid Sticky Header */
    .grid-row-label {
        position: sticky;
        left: 0;
        z-index: 10;
        box-shadow: 2px 0 5px rgba(0,0,0,0.5);
    }

    /* Full width dropdowns on mobile */
    .dropdown-menu {
        position: fixed;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 90%;
        max-width: 350px;
        max-height: 80vh;
        z-index: 1000;
        box-shadow: 0 0 0 100vmax rgba(0,0,0,0.8);
    }

    /* Mode Toggle for Mobile */
    .mode-toggle-container {
        display: flex;
        justify-content: center;
        margin-bottom: 1rem;
        gap: 0.5rem;
    }

    .mode-toggle-btn {
        padding: 0.5rem 1rem;
        border: 1px solid var(--border-color);
        background: var(--bg-tertiary);
        color: var(--text-secondary);
        border-radius: 4px;
        font-family: 'Rajdhani', sans-serif;
        font-weight: 600;
        font-size: 0.9rem;
    }

    .mode-toggle-btn.active {
        background: var(--accent-secondary);
        color: var(--bg-primary);
        border-color: var(--accent-secondary);
    }

    /* Disc Calculator Input Stacking */
    .substat-dropdown-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    /* --- New Mobile Fixes --- */

    /* 1. Hide Right-Click Message (since Toggle exists) */
    .roster-toggle-hint {
        display: none !important;
    }

    /* 2. Team Builder Grid - Stacked Layout */
    .team-grid-header {
        display: none;
    }

    .team-grid-row {
        flex-direction: column;
        min-width: 0 !important; /* Override potential min-width from other queries */
    }

    .grid-row-label {
        width: 100%;
        text-align: left;
        padding: 0.5rem 1rem;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        /* Switch from sticky-left to sticky-top for vertical scrolling context */
        position: sticky;
        left: auto;
        top: 0; 
        z-index: 10;
        box-shadow: 0 2px 5px rgba(0,0,0,0.3);
        min-width: 0;
    }

    .grid-cell {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        min-width: 0 !important; /* Ensure content can shrink */
        padding-top: 1.8rem; /* Space for label */
        position: relative;
        justify-content: flex-start; /* Align content to start */
    }

    /* Pseudo-labels for stacked cells */
    .grid-cell:nth-child(2)::before {
        content: "ATTACK";
        position: absolute;
        top: 0.4rem;
        left: 0.5rem;
        font-family: 'Orbitron', sans-serif;
        font-size: 0.65rem;
        color: var(--text-secondary);
        font-weight: 700;
        opacity: 0.7;
        letter-spacing: 0.05em;
    }

    .grid-cell:nth-child(3)::before {
        content: "ANOMALY";
        position: absolute;
        top: 0.4rem;
        left: 0.5rem;
        font-family: 'Orbitron', sans-serif;
        font-size: 0.65rem;
        color: var(--text-secondary);
        font-weight: 700;
        opacity: 0.7;
        letter-spacing: 0.05em;
    }

    .grid-cell:nth-child(4)::before {
        content: "RUPTURE";
        position: absolute;
        top: 0.4rem;
        left: 0.5rem;
        font-family: 'Orbitron', sans-serif;
        font-size: 0.65rem;
        color: var(--text-secondary);
        font-weight: 700;
        opacity: 0.7;
        letter-spacing: 0.05em;
    }

    /* 3. Deadly Assault Boss Tiles - Smaller Grid */
    .boss-grid {
        grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
        gap: 0.5rem;
    }

    .boss-card {
        border-width: 2px;
        border-radius: 6px;
    }

    .boss-avatar {
        font-size: 1rem;
    }

    .boss-card .boss-name {
        font-size: 0.6rem;
        padding: 0.2rem;
        white-space: nowrap; 
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.1;
    }
}

@media (min-width: 769px) {
    .mode-toggle-container {
        display: none;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.5rem;
    }

    .results-content {
        gap: 1rem;
    }

    .input-row, .pity-row {
        grid-template-columns: 1fr;
    }
}
