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

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #131829;
    --bg-card: #1a1f35;
    --bg-card-hover: #242b45;
    --accent-primary: #8b5cf6;
    --accent-secondary: #6366f1;
    --accent-positive: #10b981;
    --accent-negative: #ef4444;
    --accent-warning: #f59e0b;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #2d3548;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #0f1421 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header */
.header {
    text-align: center;
    padding: 60px 20px;
    margin-bottom: 40px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    text-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Mode Selection */
.mode-selection {
    margin-bottom: 40px;
}

.mode-selection h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--text-primary);
}

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

.mode-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-lg);
    background: var(--bg-card-hover);
}

.mode-card.selected {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

.mode-card h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--accent-primary);
}

.mode-card .points {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-secondary);
    margin-bottom: 10px;
}

.mode-card .description {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Points Display */
.points-display {
    position: sticky;
    top: 20px;
    z-index: 100;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: var(--shadow-lg);
}

.points-info {
    text-align: center;
}

.points-info .label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.points-info .value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-primary);
}

.points-info .value.negative {
    color: var(--accent-negative);
}

.points-info .value.positive {
    color: var(--accent-positive);
}

/* Categories */
.category {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

.category-title {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--accent-primary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.category-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 1.05rem;
}

.category-description.warning {
    color: var(--accent-negative);
    font-weight: 600;
}

.subcategory {
    margin-bottom: 30px;
}

.subcategory-title {
    font-size: 1.4rem;
    color: var(--accent-secondary);
    margin-bottom: 15px;
}

.info-text {
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 15px;
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* Option Cards */
.option-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.option-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}

.option-card.selected {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(99, 102, 241, 0.15) 100%);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

.option-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.option-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.option-card .cost {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.option-card .cost:has(+) {
    color: var(--accent-positive);
}

.option-card[data-cost^="-"] .cost {
    color: var(--accent-negative);
}

.option-card[data-cost^="0"] .cost,
.option-card[data-cost="0"] .cost {
    color: var(--text-muted);
}

.option-card[data-cost]:not([data-cost^="-"]):not([data-cost="0"]) .cost {
    color: var(--accent-positive);
}

.option-card .description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.option-card.repeatable::after {
    content: "∞";
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    color: var(--accent-secondary);
    opacity: 0.6;
}

.option-card.positive {
    border-left: 4px solid var(--accent-positive);
}

.option-card.negative {
    border-left: 4px solid var(--accent-negative);
}

.option-card.mission {
    border-left: 4px solid var(--accent-warning);
}

.option-card.drawback {
    border-left: 4px solid var(--accent-negative);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, rgba(220, 38, 38, 0.05) 100%);
}

/* Attainment Builder */
.attainment-builder {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 25px;
    margin-top: 20px;
}

.attainment-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
}

.attainment-controls label {
    color: var(--text-secondary);
    font-weight: 600;
}

.attainment-controls select {
    padding: 10px 15px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    flex: 1;
    min-width: 200px;
}

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

.attain-btn {
    padding: 10px 20px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.attain-btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.attain-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.attainment-list {
    min-height: 50px;
    margin-bottom: 20px;
}

.attainment-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.attainment-item-info {
    flex: 1;
}

.attainment-item-path {
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: capitalize;
}

.attainment-item-level {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.attainment-item-remove {
    background: var(--accent-negative);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 15px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.attainment-item-remove:hover {
    background: #dc2626;
}

.attainment-info {
    background: rgba(139, 92, 246, 0.1);
    border-left: 3px solid var(--accent-primary);
    padding: 15px;
    border-radius: 6px;
}

.attainment-info p {
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.attainment-info p:last-child {
    margin-bottom: 0;
}

.attainment-info strong {
    color: var(--accent-primary);
}

/* Grab Bag */
.grab-bag-bundles {
    margin-bottom: 20px;
}

.grab-bag-selection {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 25px;
    margin-top: 20px;
}

.grab-bag-selection h3 {
    margin-bottom: 20px;
    color: var(--accent-secondary);
}

.grab-bag-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.grab-item {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.grab-item:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.grab-item.selected {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(99, 102, 241, 0.15) 100%);
}

.grab-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.grab-item h4 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--accent-primary);
}

.grab-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Summary Section */
.summary-section {
    background: var(--bg-secondary);
    border: 2px solid var(--accent-primary);
    border-radius: 12px;
    padding: 30px;
    margin-top: 40px;
}

.summary-section h2 {
    font-size: 2rem;
    color: var(--accent-primary);
    margin-bottom: 20px;
    text-align: center;
}

.export-btn,
.import-btn,
.reset-btn {
    padding: 12px 30px;
    margin: 10px 5px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.export-btn {
    background: var(--accent-positive);
    color: white;
}

.export-btn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.import-btn {
    background: var(--accent-secondary);
    color: white;
}

.import-btn:hover {
    background: #4f46e5;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.reset-btn {
    background: var(--accent-negative);
    color: white;
}

.reset-btn:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.summary-content {
    margin-top: 30px;
    color: var(--text-secondary);
}

.summary-category {
    margin-bottom: 25px;
    background: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
}

.summary-category h3 {
    color: var(--accent-primary);
    margin-bottom: 15px;
    font-size: 1.4rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.summary-category ul {
    list-style: none;
}

.summary-category li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(45, 53, 72, 0.5);
    display: flex;
    justify-content: space-between;
}

.summary-category li:last-child {
    border-bottom: none;
}

.summary-item-name {
    color: var(--text-primary);
    font-weight: 500;
}

.summary-item-cost {
    color: var(--accent-secondary);
    font-weight: 600;
}

.summary-item-cost.positive {
    color: var(--accent-positive);
}

.summary-item-cost.negative {
    color: var(--accent-negative);
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2.5rem;
    }

    .mode-grid,
    .options-grid,
    .grab-bag-grid {
        grid-template-columns: 1fr;
    }

    .points-display {
        flex-direction: column;
        gap: 15px;
    }

    .attainment-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .attainment-controls select {
        min-width: 100%;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category,
.option-card {
    animation: fadeIn 0.5s ease-out;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}