/* ===============================================
   ENHANCED MODERN DARK THEME STYLES
   Features: Glassmorphism, Advanced Animations, 
   Gradient Effects, Micro-interactions
   =============================================== */

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

/* Custom Properties - Enhanced Color System */
:root {
    /* Primary Dark Theme Palette */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: rgba(25, 27, 40, 0.85);
    --bg-card-hover: rgba(35, 38, 55, 0.95);
    --bg-input: rgba(30, 32, 48, 0.9);
    --bg-hover: rgba(45, 50, 75, 0.8);

    /* Glass Effect Backgrounds */
    --glass-primary: rgba(15, 15, 30, 0.7);
    --glass-secondary: rgba(25, 25, 45, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);

    /* Enhanced Text Colors */
    --text-primary: #f0f0f3;
    --text-secondary: #b8b8c0;
    --text-muted: #7a7a85;
    --text-highlight: #ffffff;

    /* Vibrant Accent Colors */
    --accent-primary: #7c3aed;
    --accent-secondary: #a78bfa;
    --accent-tertiary: #c084fc;
    --accent-glow: #8b5cf6;
    --accent-success: #34d399;
    --accent-warning: #fbbf24;
    --accent-danger: #f87171;
    --accent-info: #60a5fa;

    /* Gradient Definitions */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-accent: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
    --gradient-dark: linear-gradient(180deg, rgba(10, 10, 15, 0.95) 0%, rgba(20, 20, 30, 0.98) 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);

    /* Enhanced Trait Colors with Glow */
    --trait-monarch: #fde047;
    --trait-monarch-glow: rgba(253, 224, 71, 0.3);
    --trait-blessed: #4ade80;
    --trait-blessed-glow: rgba(74, 222, 128, 0.3);
    --trait-overlord: #fb7185;
    --trait-overlord-glow: rgba(251, 113, 133, 0.3);
    --trait-oaa: #38bdf8;
    --trait-oaa-glow: rgba(56, 189, 248, 0.3);

    /* Advanced Shadows */
    --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 20px 40px -5px rgba(0, 0, 0, 0.7);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    --shadow-glow: 0 0 40px rgba(124, 58, 237, 0.3);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.3);

    /* Animation Timing */
    --transition-fast: 150ms;
    --transition-base: 300ms;
    --transition-slow: 500ms;
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Animated Background */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* Animated gradient background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at top left, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at center, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
    z-index: -1;
    animation: backgroundShift 20s ease infinite;
}

@keyframes backgroundShift {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(-20px, -20px) scale(1.02);
    }

    66% {
        transform: translate(20px, -10px) scale(0.98);
    }
}

/* Floating particles effect */
body::after {
    content: '';
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-image:
        radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(1px 1px at 90% 10%, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(1px 1px at 15% 80%, rgba(255, 255, 255, 0.2), transparent);
    background-size: 500px 500px;
    animation: floatParticles 100s linear infinite;
    z-index: -1;
    pointer-events: none;
}

@keyframes floatParticles {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-100vh);
    }
}

/* Container */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0;
    position: relative;
}

/* Enhanced Header with Glassmorphism */
.header {
    background: var(--glass-primary);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2.5rem 2rem;
    text-align: center;
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-accent);
    animation: slideGradient 3s ease infinite;
}

@keyframes slideGradient {

    0%,
    100% {
        transform: translateX(-100%);
    }

    50% {
        transform: translateX(100%);
    }
}

.header h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #7c3aed 0%, #ec4899 50%, #7c3aed 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientFlow 4s ease infinite;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
}

@keyframes gradientFlow {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.header h1::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    z-index: -1;
    background: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: blur(10px);
    opacity: 0.5;
}

.header p {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 1px;
    animation: fadeInUp 1s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main Content */
.main-content {
    padding: 3rem 2rem;
    position: relative;
}

/* Enhanced Input Section with Glass Effect */
.input-section {
    background: var(--glass-primary);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 1.5rem;
    padding: 2.5rem;
    margin-bottom: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
    animation: slideIn 0.8s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-section::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient-accent);
    border-radius: 1.5rem;
    opacity: 0;
    z-index: -1;
    transition: opacity var(--transition-base) var(--ease-smooth);
}

.input-section:hover::before {
    opacity: 0.3;
    animation: pulse 2s ease infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.01);
        opacity: 0.5;
    }
}

.input-header {
    margin-bottom: 2rem;
}

.input-header h2 {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 700;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-block;
}

.input-header h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-accent);
    transition: width var(--transition-base) var(--ease-smooth);
}

.input-section:hover .input-header h2::after {
    width: 100%;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
}

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

/* Enhanced Input Groups */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
}

.input-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    display: inline-block;
    transition: all var(--transition-fast) var(--ease-smooth);
}

.input-group:hover label {
    color: var(--accent-primary);
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(30, 32, 48, 0.5);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-base) var(--ease-smooth);
    position: relative;
}

.input-group input:hover,
.input-group select:hover {
    background: rgba(40, 42, 58, 0.6);
    border-color: rgba(124, 58, 237, 0.3);
    transform: translateY(-2px);
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1),
        0 0 20px rgba(124, 58, 237, 0.2);
    background: rgba(40, 42, 58, 0.8);
    transform: translateY(-2px);
}

.input-group input::placeholder {
    color: var(--text-muted);
    transition: opacity var(--transition-fast) var(--ease-smooth);
}

.input-group input:focus::placeholder {
    opacity: 0.5;
}

/* Animated Calculated Values */
.calculated-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.calc-box {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1) 0%, rgba(236, 72, 153, 0.05) 100%);
    backdrop-filter: blur(10px);
    padding: 1.75rem;
    border-radius: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all var(--transition-base) var(--ease-smooth);
    position: relative;
    overflow: hidden;
}

.calc-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.calc-box:hover::before {
    left: 100%;
}

.calc-box:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 30px rgba(124, 58, 237, 0.2);
    border-color: var(--accent-primary);
}

.calc-box.highlight {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2) 0%, rgba(236, 72, 153, 0.1) 100%);
    border-color: var(--accent-primary);
    animation: glowPulse 2s ease infinite;
}

@keyframes glowPulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(124, 58, 237, 0.5);
    }
}

.calc-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.75rem;
    font-weight: 700;
    opacity: 0.9;
}

.calc-value {
    font-size: 1.75rem;
    font-weight: 800;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-variant-numeric: tabular-nums;
    animation: valueUpdate 0.3s ease;
}

@keyframes valueUpdate {
    0% {
        transform: scale(1.2);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.calc-value-large {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 30px rgba(124, 58, 237, 0.5);
}

/* Enhanced Reference Section */
.reference-section {
    margin-bottom: 3rem;
    animation: fadeIn 1s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.reference-card {
    background: var(--glass-primary);
    backdrop-filter: blur(15px);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all var(--transition-base) var(--ease-smooth);
    position: relative;
    overflow: hidden;
}

.reference-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-base) var(--ease-smooth);
    pointer-events: none;
}

.reference-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(124, 58, 237, 0.3);
    border-color: rgba(124, 58, 237, 0.3);
}

.reference-card:hover::after {
    opacity: 1;
}

.reference-card h3 {
    font-size: 1.25rem;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.reference-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.925rem;
    overflow: hidden;
    border-radius: 0.5rem;
}

.reference-table thead {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2) 0%, rgba(236, 72, 153, 0.1) 100%);
}

.reference-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    color: var(--accent-secondary);
    border-bottom: 2px solid rgba(124, 58, 237, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
}

.reference-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transition: all var(--transition-fast) var(--ease-smooth);
}

.reference-table tbody tr {
    transition: all var(--transition-fast) var(--ease-smooth);
}

.reference-table tbody tr:hover {
    background: rgba(124, 58, 237, 0.05);
}

.reference-table tbody tr:hover td {
    color: var(--text-highlight);
    transform: translateX(5px);
}

/* Enhanced Stats Section */
.stats-section {
    background: var(--glass-primary);
    backdrop-filter: blur(20px);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.stats-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.stats-header {
    margin-bottom: 2rem;
    position: relative;
}

.stats-header h2 {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 700;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    position: relative;
}

.table-container {
    overflow-x: auto;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-inner);
    position: relative;
}

/* Enhanced scrollbar */
.table-container::-webkit-scrollbar {
    height: 14px;
}

.table-container::-webkit-scrollbar-track {
    background: rgba(20, 20, 30, 0.8);
    border-radius: 0.5rem;
}

.table-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border-radius: 0.5rem;
    border: 2px solid rgba(20, 20, 30, 0.8);
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-tertiary) 100%);
}

/* Enhanced Stats Table */
.stats-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.925rem;
}

.stats-table thead {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2) 0%, rgba(236, 72, 153, 0.1) 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

.stats-table th {
    padding: 1.25rem 1rem;
    font-weight: 700;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--accent-secondary);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
    position: relative;
}

.stats-table th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-accent);
    transform: scaleX(0);
    transition: transform var(--transition-base) var(--ease-smooth);
}

.stats-table th:hover::after {
    transform: scaleX(1);
}

.stats-table th .bonus {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
    display: block;
    margin-top: 0.25rem;
}

.stats-table td {
    padding: 1rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-variant-numeric: tabular-nums;
    transition: all var(--transition-fast) var(--ease-smooth);
    position: relative;
}

.stats-table tbody tr {
    transition: all var(--transition-fast) var(--ease-smooth);
    position: relative;
}

.stats-table tbody tr td:first-child::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--gradient-accent);
    transform: scaleY(0);
    transition: transform var(--transition-base) var(--ease-smooth);
}

.stats-table tbody tr:hover::before {
    transform: scaleY(1);
}

.stats-table tbody tr:nth-child(even) {
    background: rgba(124, 58, 237, 0.03);
}

.stats-table tbody tr:hover {
    background: rgba(124, 58, 237, 0.08);
    transform: translateX(5px);
}

.stats-table tbody tr:hover td {
    color: var(--text-highlight);
}

.stats-table td:first-child {
    padding-left: 10px !important;
}

/* Enhanced Cell Styles */
.level-cell {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2) 0%, rgba(99, 102, 241, 0.15) 100%) !important;
    font-weight: 800;
    color: var(--accent-primary);
    text-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
}

.dmg-cell {
    font-weight: 800;
    color: var(--accent-warning);
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.hp-cell {
    font-weight: 800;
    color: var(--accent-success);
    text-shadow: 0 0 10px rgba(52, 211, 153, 0.5);
}

/* Enhanced Trait Cells with Separated DMG/HP Values */
.trait-stats {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-variant-numeric: tabular-nums;
}

.trait-separator {
    color: var(--text-muted);
    opacity: 0.5;
    font-weight: 400;
}

/* Base trait cell backgrounds */
.trait-monarch {
    background: linear-gradient(135deg, var(--trait-monarch-glow) 0%, rgba(253, 224, 71, 0.1) 100%) !important;
    animation: monarchGlow 3s ease infinite;
}

.trait-blessed {
    background: linear-gradient(135deg, var(--trait-blessed-glow) 0%, rgba(74, 222, 128, 0.1) 100%) !important;
    animation: blessedGlow 3s ease infinite;
}

.trait-overlord {
    background: linear-gradient(135deg, var(--trait-overlord-glow) 0%, rgba(251, 113, 133, 0.1) 100%) !important;
    animation: overlordGlow 3s ease infinite;
}

.trait-oaa {
    background: linear-gradient(135deg, var(--trait-oaa-glow) 0%, rgba(56, 189, 248, 0.1) 100%) !important;
    animation: oaaGlow 3s ease infinite;
}

/* Monarch trait value colors */
.trait-dmg-monarch {
    color: var(--accent-warning);
    font-weight: 800;
    text-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
}

.trait-hp-monarch {
    color: var(--trait-monarch);
    font-weight: 700;
    text-shadow: 0 0 10px var(--trait-monarch-glow);
}

/* Blessed trait value colors */
.trait-dmg-blessed {
    color: var(--accent-warning);
    font-weight: 800;
    text-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
}

.trait-hp-blessed {
    color: var(--trait-blessed);
    font-weight: 700;
    text-shadow: 0 0 10px var(--trait-blessed-glow);
}

/* Overlord trait value colors */
.trait-dmg-overlord {
    color: var(--accent-warning);
    font-weight: 800;
    text-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
}

.trait-hp-overlord {
    color: var(--trait-overlord);
    font-weight: 700;
    text-shadow: 0 0 10px var(--trait-overlord-glow);
}

/* OAA trait value colors */
.trait-dmg-oaa {
    color: var(--accent-warning);
    font-weight: 800;
    text-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
}

.trait-hp-oaa {
    color: var(--trait-oaa);
    font-weight: 700;
    text-shadow: 0 0 10px var(--trait-oaa-glow);
}

/* Animations */
@keyframes monarchGlow {

    0%,
    100% {
        box-shadow: inset 0 0 10px var(--trait-monarch-glow);
    }

    50% {
        box-shadow: inset 0 0 20px var(--trait-monarch-glow);
    }
}

@keyframes blessedGlow {

    0%,
    100% {
        box-shadow: inset 0 0 10px var(--trait-blessed-glow);
    }

    50% {
        box-shadow: inset 0 0 20px var(--trait-blessed-glow);
    }
}

@keyframes overlordGlow {

    0%,
    100% {
        box-shadow: inset 0 0 10px var(--trait-overlord-glow);
    }

    50% {
        box-shadow: inset 0 0 20px var(--trait-overlord-glow);
    }
}

@keyframes oaaGlow {

    0%,
    100% {
        box-shadow: inset 0 0 10px var(--trait-oaa-glow);
    }

    50% {
        box-shadow: inset 0 0 20px var(--trait-oaa-glow);
    }
}

.empty-row {
    display: none;
}

/* Current level highlighting */
.current-level-row {
    position: relative;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15) 0%, rgba(236, 72, 153, 0.08) 100%) !important;
    animation: currentLevelPulse 2s ease infinite;
}

/* .current-level-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gradient-accent);
} */

.level-cell.current-level {
    position: relative;
}

.level-cell.current-level::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: purple;
    border-radius: 2px;
}

@keyframes currentLevelPulse {

    0%,
    100% {
        box-shadow: 0 0 15px rgba(124, 58, 237, 0.3);
    }

    50% {
        box-shadow: 0 0 25px rgba(124, 58, 237, 0.5);
    }
}

.level-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--gradient-accent);
    border-radius: 0.5rem;
    color: white;
    font-weight: 800;
    animation: badgePulse 1.5s ease infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Empty state styling */
.empty-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
}

.empty-icon {
    font-size: 3rem;
    opacity: 0.5;
    animation: bounce 2s ease infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.empty-text {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.empty-subtext {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Stat value base styling */
.stat-value {
    display: inline-block;
    transition: transform 0.2s ease;
}

.dmg-cell:hover .dmg-value,
.hp-cell:hover .hp-value {
    transform: scale(1.05);
}

/* Body loaded state */
body.loaded {
    animation: fadeIn 0.5s ease;
}

/* Enhanced Footer */
.footer {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
    font-size: 0.925rem;
    border-top: 1px solid var(--glass-border);
    margin-top: 4rem;
    position: relative;
    background: var(--glass-primary);
    backdrop-filter: blur(10px);
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: var(--gradient-accent);
    opacity: 0.5;
}

/* Loading Animation */
@keyframes loadingPulse {

    0%,
    100% {
        opacity: 0.4;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

.loading {
    animation: loadingPulse 1.5s ease infinite;
}

/* Hover Effects for Interactive Elements */
button,
.button,
[role="button"] {
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base) var(--ease-smooth);
}

button::before,
.button::before,
[role="button"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:hover::before,
.button:hover::before,
[role="button"]:hover::before {
    width: 300px;
    height: 300px;
}

/* Focus Visible Improvements */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 4px;
}

/* Responsive Design - Enhanced */

/* Large Screens */
@media (min-width: 1920px) {
    .container {
        max-width: 1800px;
    }

    .header h1 {
        font-size: 4rem;
    }
}

/* Tablet */
@media (max-width: 1024px) {
    .input-grid {
        grid-template-columns: 1fr;
    }

    .reference-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 2rem 1.5rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .header {
        padding: 2rem 1.5rem;
    }

    .header h1 {
        letter-spacing: 1px;
    }

    .main-content {
        padding: 1.5rem 1rem;
    }

    .input-section,
    .stats-section {
        padding: 2rem 1.5rem;
        border-radius: 1rem;
    }

    .input-grid {
        gap: 1.5rem;
    }

    .reference-card {
        padding: 1.5rem;
    }

    .stats-table {
        font-size: 0.85rem;
    }

    .stats-table th,
    .stats-table td {
        padding: 0.75rem 0.5rem;
    }

    .calc-value {
        font-size: 1.5rem;
    }

    .calc-value-large {
        font-size: 2rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .header h1 {
        font-size: 1.75rem;
        letter-spacing: 0.5px;
    }

    .input-section,
    .stats-section {
        padding: 1.5rem 1rem;
    }

    .stats-table {
        font-size: 0.75rem;
    }

    .stats-table th,
    .stats-table td {
        padding: 0.5rem 0.375rem;
    }

    .stats-table th .bonus {
        display: none;
    }

    body::after {
        display: none;
        /* Disable particles on small screens for performance */
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    body::before,
    body::after {
        animation: none;
    }
}

/* Dark Mode Enhancement */
@media (prefers-color-scheme: dark) {
    :root {
        --shadow-glow: 0 0 50px rgba(124, 58, 237, 0.4);
    }
}

/* Print Styles - Enhanced */
@media print {
    body {
        background: white;
        color: black;
    }

    .header {
        background: none;
        border-bottom: 2px solid black;
        backdrop-filter: none;
    }

    .header h1 {
        -webkit-text-fill-color: black;
        background: none;
    }

    .input-section,
    .stats-section,
    .reference-card {
        background: white;
        border: 1px solid black;
        box-shadow: none;
        backdrop-filter: none;
    }

    .input-section,
    .reference-section {
        page-break-inside: avoid;
    }

    body::before,
    body::after,
    .header::before,
    .input-section::before {
        display: none;
    }
}

/* Accessibility Improvements */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip to Content Link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-primary);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 0 0 0.5rem 0;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}

/* Custom Selection Colors */
::selection {
    background: var(--accent-primary);
    color: white;
}

::-moz-selection {
    background: var(--accent-primary);
    color: white;
}

/* Performance Optimizations */
.hardware-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(124, 58, 237, 0.1);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===============================================
   Table Controls - Glassmorphic Dark Theme
   =============================================== */
.table-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem 1.5rem;
    background: rgba(25, 27, 40, 0.85);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.table-controls label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.table-controls select {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(30, 32, 48, 0.8);
    color: var(--text-primary);
    font-weight: 600;
    transition: all var(--transition-base) var(--ease-smooth);
}

.table-controls select:hover {
    background: rgba(40, 42, 58, 0.9);
    border-color: var(--accent-primary);
}

.table-controls select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1),
        0 0 20px rgba(124, 58, 237, 0.2);
    background: rgba(40, 42, 58, 0.9);
}

.multiplier-container {
    max-width: 500px;
    margin: 1.5rem auto;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(25, 27, 40, 0.85);
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
}

.multiplier-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: center;
}

.multiplier-table th {
    padding: 0.75rem;
    background: rgba(124, 58, 237, 0.15);
    color: var(--accent-secondary);
    font-weight: 600;
    text-transform: uppercase;
}

.multiplier-table td {
    padding: 0.5rem;
    color: var(--text-primary);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.multiplier-cell {
    font-weight: 700;
    color: var(--accent-primary);
    transition: transform 0.2s ease;
}

.multiplier-cell:hover {
    transform: scale(1.1);
    color: var(--accent-secondary);
}

.tooltip-wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.tooltip-label {
    color: var(--accent-secondary);
    font-weight: 600;
    border-bottom: 1px dotted var(--accent-secondary);
}

.tooltip-content {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-10%);
    background: rgb(35, 38, 55);
    /* much less transparent */
    color: var(--text-primary);
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.tooltip-wrapper:hover .tooltip-content {
    opacity: 1;
    pointer-events: auto;
}


.tooltip-content::after {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-10%);
    border-width: 4px;
    border-style: solid;
    border-color: transparent transparent rgba(25, 27, 40, 0.95) transparent;
}

/* Table inside tooltip */
.tooltip-content .multiplier-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.tooltip-content th {
    padding: 0.5rem;
    font-weight: 600;
    color: var(--accent-secondary);
    text-transform: uppercase;
    background: rgba(124, 58, 237, 0.1);
}

.tooltip-content td {
    padding: 0.35rem 0.5rem;
    color: var(--text-primary);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tooltip-content .multiplier-cell {
    font-weight: 700;
    color: var(--accent-primary);
}