/* Root Variables */
:root {
    --primary-bg: #0a0e27;
    --secondary-bg: #1a1f3a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #b4b7c4;
    --text-muted: #7d8091;
    
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-color: #42c767;
    --warning-color: #ffa726;
    --danger-color: #ff4458;
    
    --carrying-gradient: linear-gradient(135deg, #42c767 0%, #26a653 100%);
    --balanced-gradient: linear-gradient(135deg, #ffa726 0%, #fb8c00 100%);
    --carried-gradient: linear-gradient(135deg, #ff4458 0%, #e91e63 100%);
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.25);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    /* Force dark color scheme for form controls */
    color-scheme: dark;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--primary-bg) 0%, var(--secondary-bg) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(102, 126, 234, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

/* Animated Background */
.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.3;
    pointer-events: none;
    overflow: hidden;
    transition: opacity 0.5s ease;
}

.animated-background.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Static gradient background for results view */
.static-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(135deg, 
        rgba(17, 24, 39, 0.92) 0%, 
        rgba(30, 27, 75, 0.88) 25%,
        rgba(30, 58, 138, 0.85) 50%,
        rgba(67, 20, 100, 0.87) 75%,
        rgba(17, 24, 39, 0.92) 100%);
    opacity: 1;
    transition: opacity 0.5s ease;
}

.static-background.hidden {
    opacity: 0;
    pointer-events: none;
}

.animated-background > div {
    width: 100% !important;
    height: 100% !important;
    transform: scale(1.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

/* Update Banner */
.update-banner {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
    animation: slideDown 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

.update-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.update-banner-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.update-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.update-text {
    color: white;
    font-size: 0.95rem;
    flex: 1;
    line-height: 1.4;
}

.update-text strong {
    font-weight: 600;
    text-decoration: underline;
    text-decoration-style: wavy;
    text-underline-offset: 2px;
}

.update-banner-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.update-banner-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.update-banner.hidden {
    display: none;
}

/* App Header - Collapsible Container */
.app-header {
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top;
    overflow: hidden;
}

.app-header.collapsed {
    background: transparent;
    margin-bottom: 2rem;
}

.app-header.collapsed .hero {
    padding: 0.75rem 0;
}

.app-header.collapsed .hero-title {
    font-size: 1.5rem;
    margin-bottom: 0;
}

.app-header.collapsed .hero-subtitle {
    display: none;
}

.app-header.collapsed .input-section {
    display: none;
}

/* Collapsed state - create a flex container */
.app-header.collapsed .hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    padding: 0;
}

.app-header.collapsed .hero {
    text-align: left;
}

/* Hide collapsed info by default */
.collapsed-info {
    display: none;
}

/* Show collapsed info when header is collapsed */
.app-header.collapsed .collapsed-info {
    display: flex;
    align-items: center;
    gap: 2rem;
    animation: fadeIn 0.5s ease 0.3s both;
}

.app-header.collapsed .collapsed-info.hidden {
    display: none;
}

/* Current URL display */
.current-url {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color var(--transition-fast);
    opacity: 0.8;
}

.current-url:hover {
    color: #667eea;
    opacity: 1;
}

#current-url-text {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Paste hint in collapsed state */
.paste-hint-collapsed {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.7;
}

@media (max-width: 768px) {
    .app-header.collapsed .hero-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .app-header.collapsed .collapsed-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    #current-url-text {
        max-width: 200px;
    }
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 2rem 0;
    animation: fadeInUp 0.8s ease;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-content {
    max-width: 600px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.logo-link {
    text-decoration: none;
    display: inline-block;
    transition: transform 0.2s ease;
}

.logo-link:hover {
    transform: scale(1.05);
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 0;
}

/* Form Section */
.input-section {
    max-width: 500px;
    margin: 0 auto 2rem;
    animation: fadeInUp 0.8s ease 0.2s both;
}

/* Paste Section - Primary */
.paste-section {
    margin-bottom: 1.5rem;
}

.paste-primary {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-normal);
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(102, 126, 234, 0.4);
    }
}

.paste-primary:hover {
    transform: translateY(-2px);
    border-color: rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
}

.paste-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 12px;
}

.paste-icon-large {
    color: #667eea;
}

.paste-content {
    flex: 1;
}

.paste-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.paste-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

kbd {
    padding: 0.2rem 0.4rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85em;
}

/* Divider */
.divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--card-border);
}

.divider span {
    position: relative;
    padding: 0 1rem;
    background: var(--primary-bg);
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Manual Form - Always Visible */
.manual-form-wrapper {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    max-width: 600px;
    width: 100%;
    box-sizing: border-box;
}

.manual-form-header {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    text-align: center;
}

.character-form {
    animation: fadeIn 0.5s ease;
}

.form-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 2fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.form-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: all var(--transition-fast);
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.form-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: all var(--transition-fast);
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    cursor: pointer;
    /* Force dark mode for select elements */
    color-scheme: dark;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

/* Style select dropdown */
.form-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: rgba(255, 255, 255, 0.05);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

/* Style the dropdown options - Note: Browser support varies */
.form-select option {
    background-color: #0a0e27 !important;
    color: #ffffff !important;
    padding: 0.5rem;
}

.form-select option:hover,
.form-select option:focus {
    background-color: #1a1f3a !important;
    color: #ffffff !important;
}

.form-select option:checked {
    background-color: #667eea !important;
    color: #ffffff !important;
}

/* Firefox specific */
@-moz-document url-prefix() {
    .form-select option {
        background-color: #0a0e27 !important;
    }
}

/* Webkit browsers (Chrome, Safari, Edge) */
@media screen and (-webkit-min-device-pixel-ratio:0) {
    .form-select option {
        background-color: #0a0e27 !important;
        color: #ffffff !important;
    }
}

.submit-btn {
    background: var(--accent-gradient);
    border: none;
    border-radius: 6px;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    width: 100%;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.submit-btn:hover::before {
    transform: translateX(0);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.submit-btn:active {
    transform: translateY(0);
}

.btn-icon {
    transition: transform var(--transition-fast);
}

.submit-btn:hover .btn-icon {
    transform: translateX(4px);
}

/* URL Feedback */
.url-feedback {
    max-width: 500px;
    margin: 1rem auto;
    animation: slideDown 0.3s ease;
}

.url-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(66, 199, 103, 0.15), rgba(38, 166, 83, 0.15));
    border: 1px solid rgba(66, 199, 103, 0.4);
    border-radius: 10px;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(66, 199, 103, 0.1);
    animation: successPulse 0.5s ease;
}

@keyframes successPulse {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.url-icon {
    color: #42c767;
    flex-shrink: 0;
    filter: drop-shadow(0 0 4px rgba(66, 199, 103, 0.3));
}

.url-text {
    color: #42c767;
    font-family: monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

/* Character and Carry Row */
.character-carry-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: stretch;
}

@media (max-width: 768px) {
    .character-carry-row {
        flex-direction: column;
    }
}

/* Character Card */
.character-card {
    /* Remove all box styling - display directly on background */
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
    animation: fadeInUp 0.5s ease;
    flex: 1;
    min-width: 0;
}

.character-header {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
}

.character-thumbnail {
    width: 84px;
    height: 84px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    object-fit: cover;
}

.character-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.character-name-link {
    text-decoration: none;
    display: inline-block;
    transition: transform var(--transition-fast);
}

.character-name-link:hover {
    transform: translateY(-1px);
}

.character-name {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
    cursor: pointer;
    display: inline-block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.character-guild {
    font-size: 1.2rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    margin-left: 0.75rem;
    display: inline-block;
    font-style: normal;
}

.character-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 0.2rem;
    line-height: 1.4;
}

.separator {
    opacity: 0.5;
}

/* Character main info with inline scores */
.character-main-info {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.character-scores {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-left: auto;
    margin-right: 20px;
}

.score-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    transition: all var(--transition-fast);
    min-width: 100px;
    height: 80px;
}

.score-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: rgba(102, 126, 234, 0.4);
}

.score-badge.current-score {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
    border-color: rgba(102, 126, 234, 0.3);
}

.score-badge.previous-score {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.score-badge .score-value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
    /* Color is now applied dynamically based on score tier */
}

.score-badge .score-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 600;
    opacity: 0.8;
}

/* Best key section */
.best-key-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(66, 199, 103, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(66, 199, 103, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    min-width: 140px;
}

.best-key-label {
    font-size: 0.7rem;
    color: rgba(66, 199, 103, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.best-key-value {
    color: var(--success-color);
    font-weight: 700;
}

/* Best key content styles */
.best-key-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.best-key-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
}

.best-key-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    align-items: center;
    text-align: center;
}

.best-key-level {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--success-color);
}

.best-key-dungeon {
    font-size: 0.7rem;
    color: rgba(66, 199, 103, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    margin-top: 0.125rem;
}

/* Removed profile link button - name is now the link */

/* Loading State */
.loading-container {
    text-align: center;
    padding: 4rem 0;
    animation: fadeIn 0.3s ease;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    border: 3px solid rgba(102, 126, 234, 0.1);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

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

/* Error State */
.error-container {
    max-width: 500px;
    margin: 2rem auto;
    animation: fadeInUp 0.3s ease;
}

.error-content {
    background: rgba(255, 68, 88, 0.1);
    border: 1px solid rgba(255, 68, 88, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.error-icon {
    color: var(--danger-color);
    flex-shrink: 0;
}

.error-message {
    color: var(--text-secondary);
}

/* Results Section */
.results-section {
    animation: fadeInUp 0.5s ease;
}

/* Status Card */
.status-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.status-title {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Carry Status Card */
.carry-status-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    animation: fadeInUp 0.5s ease 0.3s both;
    min-width: 180px;
    width: 180px;
    box-shadow: var(--shadow-lg);
}

.carry-metric-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: white;
}

.carry-metric-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
    color: white;
}

.carry-status-card.carrying {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.carry-status-card.carried {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.carry-status-card.balanced {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

/* Season Toggle */
.season-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.3);
    transition: 0.3s;
    border-radius: 20px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: rgba(255, 255, 255, 0.5);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(16px);
}

.toggle-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
}

/* Toggle Tooltip */
.toggle-tooltip {
    position: absolute;
    top: calc(100% + 15px);
    right: 50px;
    z-index: 1000;
    animation: bounceIn 0.6s ease-out;
}

.toggle-tooltip-arrow {
    position: absolute;
    top: -8px;
    right: 60px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #10b981;
}

.toggle-tooltip-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.toggle-tooltip-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

.toggle-tooltip-badge {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.toggle-tooltip-text {
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.toggle-tooltip-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.25rem;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    margin-left: 0.5rem;
    position: relative;
    z-index: 1;
}

.toggle-tooltip-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.8);
    }
    60% {
        opacity: 1;
        transform: translateY(-5px) scale(1.05);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

.toggle-tooltip.hidden {
    display: none;
}

.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    animation: slideInRight 0.5s ease 0.3s both;
}

.status-badge.carrying {
    background: var(--carrying-gradient);
}

.status-badge.balanced {
    background: var(--balanced-gradient);
}

.status-badge.carried {
    background: var(--carried-gradient);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.analysis-summary {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1.5rem;
    border-left: 3px solid #667eea;
}

.summary-text {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Runs Container */
.runs-container {
    margin-bottom: 1.5rem;
}

.runs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.runs-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.calculation-help-link {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.calculation-help-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Table Styles */
.table-wrapper {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
}

.runs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.runs-table thead {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--card-border);
}

.runs-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.runs-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background var(--transition-fast);
    animation: fadeIn 0.3s ease both;
}

.runs-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.runs-table td {
    padding: 0.75rem;
    color: var(--text-secondary);
}

.run-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all var(--transition-normal);
    animation: fadeInUp 0.5s ease both;
    position: relative;
    overflow: hidden;
}

.run-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.run-card.carrying::before {
    background: var(--carrying-gradient);
}

.run-card.balanced::before {
    background: var(--balanced-gradient);
}

.run-card.carried::before {
    background: var(--carried-gradient);
}

.run-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(255, 255, 255, 0.2);
}

.run-dungeon {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.run-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.run-detail {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

.run-detail-label {
    color: var(--text-muted);
}

.run-detail-value {
    color: var(--text-secondary);
    font-weight: 500;
}

.run-detail.full-width {
    grid-column: 1 / -1;
}

.status-carrying {
    color: var(--success-color);
}

.status-balanced {
    color: var(--warning-color);
}

.status-carried {
    color: var(--danger-color);
}

/* Group Info Styles */
.group-info {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--card-border);
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.group-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.group-score {
    font-size: 1.125rem;
    font-weight: 600;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.group-members {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.member-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}

.member-name {
    color: var(--text-secondary);
    font-weight: 500;
}

.member-score {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Table Cell Styles */
.dungeon-cell {
    font-weight: 600;
}

.dungeon-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dungeon-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dungeon-details {
    flex: 1;
}

.dungeon-name {
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.affixes {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.level-cell {
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

/* Right align level header to match the data cells */
.runs-table th:nth-child(2) {
    text-align: right;
    padding-right: 1.2rem;
}

/* Add padding to level cells for spacing */
.runs-table td.level-cell {
    padding-right: 1.2rem;
}

.score-cell {
    font-weight: 600;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.time-cell {
    white-space: nowrap;
}

.time-status {
    font-size: 0.7rem;
    margin-top: 0.25rem;
}

.time-status.in-time {
    color: var(--success-color);
}

.time-status.overtime {
    color: var(--danger-color);
}

.group-cell {
    max-width: 300px;
}

.group-composition {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.9rem;
}

.role-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.role-label {
    font-weight: 600;
    color: var(--text-muted);
    min-width: 50px;
    font-size: 0.85rem;
}

.role-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    opacity: 0.8;
}

.player-link {
    text-decoration: none;
    font-weight: 500;
    transition: opacity var(--transition-fast);
    cursor: pointer;
}

.player-link.main-player {
    font-weight: 700;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.player-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.group-avg-score {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.no-group-data {
    color: var(--text-muted);
    font-style: italic;
}

.analysis-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.carry-percentage {
    font-size: 0.95rem;
    font-weight: 600;
    cursor: help;
    transition: opacity var(--transition-fast);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.carry-percentage:hover {
    opacity: 0.85;
}

.carry-percentage.carrying {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.carry-percentage.carried {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.carry-percentage.balanced {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
}

/* Carry Calculation Tooltip */
.carry-calc-tooltip {
    position: fixed;
    z-index: 10000;
    background: rgba(26, 27, 38, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    min-width: 250px;
    display: none;
}

.calc-header {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    text-align: center;
}

.calc-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.calc-label {
    color: var(--text-muted);
}

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

.calc-value.positive {
    color: #10b981;
}

.calc-value.negative {
    color: #ef4444;
}

.calc-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.75rem 0;
}

.calc-note {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.4;
}

.calc-row.result {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
}

.calc-row.result .calc-label {
    color: var(--text-primary);
    font-weight: 600;
}

.calc-row.result .calc-value {
    font-size: 1rem;
}

.analysis-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.analysis-badge.carrying {
    background: rgba(66, 199, 103, 0.2);
    color: var(--success-color);
}

.analysis-badge.balanced {
    background: rgba(255, 167, 38, 0.2);
    color: var(--warning-color);
}

.analysis-badge.carried {
    background: rgba(255, 68, 88, 0.2);
    color: var(--danger-color);
}

/* Character Tooltip */
.character-tooltip {
    position: absolute;
    z-index: 1000;
    pointer-events: none;
}

.tooltip-content {
    background: var(--secondary-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow: var(--shadow-xl);
    display: flex;
    gap: 0.75rem;
    min-width: 200px;
    backdrop-filter: blur(10px);
}

.tooltip-avatar {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
}

.tooltip-info {
    flex: 1;
}

.tooltip-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.tooltip-details {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.tooltip-scores {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tooltip-score-current,
.tooltip-score-previous,
.tooltip-score-best {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    min-width: 120px;
}

.tooltip-label {
    color: var(--text-muted);
    flex: 0 0 auto;
    margin-right: 0.5rem;
}

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

/* Breakdown Card */
.breakdown-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.breakdown-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.breakdown-content {
    display: grid;
    gap: 2rem;
}

.breakdown-chart {
    height: 60px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 30px;
    overflow: hidden;
    display: flex;
    position: relative;
}

.chart-segment {
    height: 100%;
    transition: all var(--transition-normal);
    position: relative;
}

.chart-segment.carrying {
    background: var(--carrying-gradient);
}

.chart-segment.balanced {
    background: var(--balanced-gradient);
}

.chart-segment.carried {
    background: var(--carried-gradient);
}

.breakdown-legend {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.legend-color.carrying {
    background: var(--carrying-gradient);
}

.legend-color.balanced {
    background: var(--balanced-gradient);
}

.legend-color.carried {
    background: var(--carried-gradient);
}

.legend-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

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

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 1.5rem;
}

.modal-section {
    margin-bottom: 2rem;
}

.modal-section:last-child {
    margin-bottom: 0;
}

.modal-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.modal-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.formula-box {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
}

.formula-box p {
    margin: 0;
    color: var(--text-primary);
}

.example {
    font-family: 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    margin: 0.5rem 0;
}

.modal-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.modal-table th,
.modal-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.modal-table th {
    background: rgba(102, 126, 234, 0.1);
    font-weight: 600;
    color: var(--text-primary);
}

.modal-table td {
    color: var(--text-secondary);
}

.modal-section .note {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 1rem;
}

/* Season Rankings */
.season-rankings-container {
    margin-top: 15px;
    margin-bottom: 30px;
    animation: fadeInUp 0.5s ease;
}

.rankings-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.rankings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.rank-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
}

.rank-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(102, 126, 234, 0.3);
}

.rank-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--card-border);
}

.rank-icon {
    font-size: 1.5rem;
}

/* Spec icon from sprite sheet */
.spec-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    background-image: url('https://cdn.raiderio.net/assets/img/specs_sprite-f45eb039ab6ac1479939d030fa56cce2.png');
    background-size: 576px 96px; /* 24 specs x 24px, 4 rows x 24px */
    background-repeat: no-repeat;
}

.rank-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.rank-values {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rank-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}

.rank-value-group {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.rank-medal {
    font-size: 1.1rem;
    line-height: 1;
}

.rank-scope {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rank-number {
    font-size: 1.1rem;
    font-weight: 600;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rank-medal {
    font-size: 1.2rem;
    margin-right: 4px;
    /* No gradient or text fill - let emoji show naturally */
}

/* Leaderboard Section */
.leaderboard-section {
    margin: 3rem 0;
    animation: fadeIn 0.5s ease;
}

.leaderboard-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.25rem;
    backdrop-filter: blur(20px);
}

.leaderboard-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.leaderboard-table-wrapper {
    overflow-x: auto;
    margin-bottom: 1rem;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.leaderboard-table thead {
    border-bottom: 2px solid var(--card-border);
}

.leaderboard-table th {
    padding: 0.4rem 0.5rem;
    text-align: left;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.leaderboard-table th:nth-child(1) { width: 35px; }  /* # */
.leaderboard-table th:nth-child(2) { width: 60px; }  /* Score */
.leaderboard-table th:nth-child(3) { width: auto; }  /* Party Composition - takes remaining space */
.leaderboard-table th:nth-child(4) { width: 180px; } /* Dungeon */
.leaderboard-table th:nth-child(5) { width: 60px; }  /* Level */
.leaderboard-table th:nth-child(6) { width: 60px; }  /* Time */

.leaderboard-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.leaderboard-table td {
    padding: 0.35rem 0.5rem;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.rank-cell {
    font-weight: 600;
    color: var(--accent-color);
}

.score-cell {
    font-weight: 600;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.character-cell {
    /* Width controlled by table-layout: fixed */
}

.party-composition-columns {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.role-column {
    display: table-cell;
    padding-right: 20px;
    vertical-align: middle;
    width: 33.33%;
}

.role-column:last-child {
    padding-right: 0;
}

/* Party Header Columns */
.party-header {
    text-align: left !important;
}

.party-header-columns {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.role-header {
    display: table-cell;
    width: 33.33%;
    padding-right: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.5);
}

.role-header:last-child {
    padding-right: 0;
}

.tank-column {
    width: 33.33%;
}

.healer-column {
    width: 33.33%;
}

.dps-column {
    width: 33.33%;
}

.dps-column .party-member-compact {
    margin-right: 10px;
}

.party-member-empty {
    color: var(--text-muted);
    font-size: 0.8rem;
    display: inline-block;
}

.party-member-compact {
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
    padding: 1px 3px;
    border-radius: 3px;
    display: inline-block;
    white-space: nowrap;
}

.party-member-compact:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

/* Leaderboard character tooltip */
.leaderboard-char-tooltip {
    position: fixed;
    background: var(--secondary-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 8px 12px;
    z-index: 10000;
    pointer-events: none;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.leaderboard-char-tooltip .tooltip-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.leaderboard-char-tooltip .tooltip-name {
    font-weight: 600;
    color: var(--text-primary);
}

.leaderboard-char-tooltip .tooltip-spec {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.character-link {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.character-link:hover {
    color: var(--accent-color);
}

.character-details {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.dungeon-cell {
    color: var(--text-secondary);
}

.dungeon-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Leaderboard/Top 10 specific dungeon icon - kept for future use */
.dungeon-icon-top10 {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    object-fit: cover;
}

.dungeon-name {
    font-size: 0.8rem;
}

.level-cell {
    font-weight: 600;
    color: var(--success-color);
}

/* Leaderboard time cell - commented out to use default font
.time-cell {
    font-family: 'Courier New', monospace;
    color: var(--text-secondary);
}
*/

/* Disclaimer Modal */
.disclaimer-content {
    max-width: 400px;
    text-align: center;
    padding: 2rem;
}

.disclaimer-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.disclaimer-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

.disclaimer-legal {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
    opacity: 0.7;
}

.leaderboard-note {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 3rem 0 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-link {
    color: #667eea;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.heart-icon {
    color: #e74c3c;
    font-size: 0.9em;
}

.footer-note {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .character-header {
        flex-direction: column;
        text-align: center;
    }
    
    .character-thumbnail {
        margin: 0 auto;
    }
    
    .character-meta {
        justify-content: center;
    }
    
    .character-stats {
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .runs-grid {
        grid-template-columns: 1fr;
    }
    
    .status-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .breakdown-legend {
        flex-direction: column;
    }
}

/* Enhanced Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Center header content on mobile */
    .app-header {
        text-align: center;
    }
    
    .character-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .character-info {
        align-items: center;
        text-align: center;
        width: 100%;
    }
    
    .character-main-info {
        text-align: center !important;
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
    
    .character-name {
        text-align: center !important;
        width: 100% !important;
        margin: 0 auto !important;
        display: block !important;
    }
    
    .character-name h1 {
        text-align: center !important;
        width: 100% !important;
        margin: 0 auto !important;
    }
    
    /* Also center the parent info container */
    .character-info h1 {
        text-align: center !important;
        width: 100% !important;
    }
    
    .character-scores {
        justify-content: center;
        width: 100%;
        margin: 0 auto;
    }
    
    .score-box {
        margin: 0 auto;
    }
    
    .character-card {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    
    .character-details {
        text-align: center;
        width: 100%;
    }
    
    .url-feedback {
        text-align: center;
    }
    
    .url-text {
        word-break: break-all;
    }
    
    /* Hide table and its container on mobile */
    .runs-section .runs-table-container,
    .runs-table-container,
    .runs-table {
        display: none !important;
    }
    
    /* Show mobile cards instead */
    .runs-mobile {
        display: block !important;
        padding: 0 0.5rem;
    }
    
    .run-mobile-card {
        background: var(--card-bg);
        border: 1px solid var(--card-border);
        border-radius: 12px;
        padding: 1rem;
        margin-bottom: 1rem;
        animation: fadeInUp 0.3s ease both;
    }
    
    .run-mobile-card.carrying {
        background: linear-gradient(135deg, 
            rgba(76, 175, 80, 0.05) 0%, 
            transparent 100%);
    }
    
    .run-mobile-card.carried {
        background: linear-gradient(135deg, 
            rgba(244, 67, 54, 0.05) 0%, 
            transparent 100%);
    }
    
    .run-mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .run-mobile-dungeon-info {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        flex: 1;
    }
    
    .run-mobile-dungeon-info .dungeon-icon {
        width: 48px;
        height: 48px;
    }
    
    .run-mobile-dungeon-details {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .run-mobile-dungeon-name {
        font-weight: 600;
        font-size: 1rem;
        color: var(--text-primary);
    }
    
    .run-mobile-level {
        font-size: 1.2rem;
        font-weight: 700;
        color: var(--accent-color);
    }
    
    .run-mobile-stats {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .run-mobile-stat {
        text-align: center;
    }
    
    .run-mobile-stat-label {
        font-size: 0.7rem;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        display: block;
        margin-bottom: 0.25rem;
    }
    
    .run-mobile-stat-value {
        font-weight: 600;
        font-size: 1rem;
        color: var(--text-primary);
    }
    
    .run-mobile-group {
        margin-bottom: 1rem;
    }
    
    .run-mobile-group .role-group {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
        flex-wrap: wrap;
    }
    
    .run-mobile-analysis {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .run-mobile-carry-status {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 0.25rem;
    }
    
    .run-mobile-carry-label {
        font-size: 0.75rem;
        color: var(--text-muted);
    }
    
    .run-mobile-carry-value {
        font-size: 1.1rem;
        font-weight: 700;
    }
    
    .run-mobile-carry-value.carrying {
        color: var(--success-color);
    }
    
    .run-mobile-carry-value.carried {
        color: var(--danger-color);
    }
    
    /* Character summary responsive */
    .character-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .character-info {
        align-items: center;
    }
    
    #character-thumbnail {
        width: 80px;
        height: 80px;
    }
    
    /* Summary cards - 2 column grid on mobile */
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    /* Overall percentage card - full width on mobile */
    .overall-percentage {
        grid-column: 1 / -1;
    }
    
    .summary-card {
        padding: 0.75rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    /* Rankings - single column */
    .rankings-grid {
        grid-template-columns: 1fr;
    }
    
    /* Input form responsive */
    .manual-form {
        flex-direction: column;
    }
    
    .form-group {
        width: 100%;
    }
    
    /* Hide desktop-only elements */
    .paste-hint-collapsed {
        display: none;
    }
    
    /* Modal responsive */
    .modal-content {
        margin: 1rem;
        max-width: calc(100% - 2rem);
        max-height: 85vh;
        overflow-y: auto;
    }
    
    .modal-table {
        font-size: 0.75rem;
    }
    
    .modal-table td,
    .modal-table th {
        padding: 0.5rem 0.25rem;
    }
}

/* Desktop-only styles */
@media (min-width: 769px) {
    .runs-mobile {
        display: none !important;
    }
}

/* Cookie Notice */
.cookie-notice {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(30, 25, 55, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(138, 113, 236, 0.2);
    padding: 0.75rem 1rem;
    z-index: 10000;
    animation: slideUp 0.3s ease;
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.cookie-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: opacity 0.2s;
}

.cookie-link:hover {
    opacity: 0.8;
}

.cookie-accept {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.4rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.cookie-accept:hover {
    background: #7b5fc7;
    transform: translateY(-1px);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Privacy Policy Modal Styles */
#privacy-policy-modal .modal-content {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

#privacy-policy-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

#privacy-policy-modal .modal-header h2 {
    margin: 0;
    color: var(--primary-color);
}

#privacy-policy-modal .modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

#privacy-policy-modal .modal-close:hover {
    color: white;
}

#privacy-policy-modal .modal-body h3 {
    color: white;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

#privacy-policy-modal .modal-body p {
    color: var(--text-muted);
    line-height: 1.6;
}

#privacy-policy-modal .modal-body ul {
    color: var(--text-muted);
    line-height: 1.8;
    padding-left: 1.5rem;
}

#privacy-policy-modal .modal-body a {
    color: var(--primary-color);
    text-decoration: none;
}

#privacy-policy-modal .modal-body a:hover {
    text-decoration: underline;
}

/* Mobile responsive cookie notice */
@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .cookie-accept {
        width: 100%;
        max-width: 200px;
    }
}