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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d1f1f 50%, #1f1a1a 100%);
    color: #f5f5f5;
    min-height: 100vh;
    line-height: 1.6;
}

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

/* Header */
header {
    text-align: center;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #ff9a56 0%, #ffcc00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.1rem;
    color: #a0a0a0;
    margin-bottom: 20px;
}

.formula-display {
    background: rgba(255, 154, 86, 0.1);
    border-radius: 10px;
    padding: 15px;
    display: inline-block;
}

.formula-rules {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rule {
    color: #ff9a56;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
}

/* Main Content */
main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* View Selector */
.view-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.view-btn {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 8px;
    color: #eaeaea;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.view-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 154, 86, 0.3);
}

.view-btn.active {
    background: rgba(255, 154, 86, 0.2);
    border-color: #ff9a56;
}

/* Canvas Section */
.canvas-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.canvas-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

canvas {
    border: 2px solid rgba(255, 154, 86, 0.3);
    border-radius: 8px;
    background: #0f0f0f;
    box-shadow: 0 8px 32px rgba(255, 154, 86, 0.2);
    cursor: crosshair;
}

.canvas-info {
    color: #a0a0a0;
    font-size: 0.9rem;
    text-align: center;
}

/* Compare Section */
.compare-section {
    margin-top: 20px;
}

.compare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.compare-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.compare-item h4 {
    color: #ff9a56;
    font-size: 1.1rem;
}

/* Controls Section */
.controls-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    backdrop-filter: blur(10px);
}

.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    color: #ff9a56;
    font-weight: 500;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #ff9a56 0%, #ffcc00 100%);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(255, 154, 86, 0.5);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #ff9a56 0%, #ffcc00 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-group select {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 154, 86, 0.3);
    border-radius: 8px;
    color: #eaeaea;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-group select:hover {
    border-color: #ff9a56;
}

.control-group select:focus {
    outline: none;
    border-color: #ff9a56;
    box-shadow: 0 0 0 3px rgba(255, 154, 86, 0.2);
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin-bottom: 0;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #ff9a56;
    cursor: pointer;
}

.custom-rule-group,
.compare-rules-group {
    background: rgba(255, 154, 86, 0.1);
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.custom-rule-inputs,
.compare-rule-selects {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

.custom-rule-inputs div,
.compare-rule-selects div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-rule-inputs input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 154, 86, 0.3);
    border-radius: 6px;
    color: #eaeaea;
    font-size: 1rem;
}

.custom-rule-inputs input[type="text"]:focus {
    outline: none;
    border-color: #ff9a56;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 25px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 100px;
}

.btn-primary {
    background: linear-gradient(135deg, #ff9a56 0%, #ffcc00 100%);
    color: #1a1a1a;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 154, 86, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #eaeaea;
    border: 1px solid rgba(255, 154, 86, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 154, 86, 0.2);
    border-color: #ff9a56;
}

/* Stats Section */
.stats-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    backdrop-filter: blur(10px);
}

.stats-section h3 {
    color: #ff9a56;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

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

.stat-item {
    background: rgba(255, 154, 86, 0.1);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.stat-label {
    color: #a0a0a0;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.stat-value {
    color: #ff9a56;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Rules Section */
.rules-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    backdrop-filter: blur(10px);
}

.rules-section h3 {
    color: #ff9a56;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

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

.rule-card {
    background: rgba(255, 154, 86, 0.1);
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
}

.rule-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(255, 154, 86, 0.3);
}

.rule-card h4 {
    color: #ff9a56;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.rule-card p {
    color: #a0a0a0;
    font-size: 0.9rem;
    margin-bottom: 10px;
    line-height: 1.5;
}

.rule-detail {
    color: #ffcc00;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
}

/* Explanation Section */
.explanation {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 30px;
    backdrop-filter: blur(10px);
    margin-top: 30px;
}

.explanation h2 {
    color: #ff9a56;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.explanation h3 {
    color: #ff9a56;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.explanation p {
    color: #a0a0a0;
    line-height: 1.8;
    margin-bottom: 15px;
}

.explanation ul {
    list-style: none;
    padding-left: 0;
}

.explanation li {
    color: #a0a0a0;
    padding: 10px 0;
    padding-left: 25px;
    position: relative;
    line-height: 1.6;
}

.explanation li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #ff9a56;
    font-weight: bold;
}

.variants-detail {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.variant-item {
    background: rgba(255, 154, 86, 0.1);
    border-radius: 10px;
    padding: 15px;
    border-left: 4px solid #ff9a56;
}

.variant-name {
    color: #ff9a56;
    font-weight: 600;
    margin-bottom: 5px;
}

.variant-desc {
    color: #a0a0a0;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .life-variants-container {
        padding: 15px;
    }

    header h1 {
        font-size: 1.8rem;
    }

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

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

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

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

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

    .view-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

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

.btn-primary:active {
    transform: scale(0.98);
}

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

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 154, 86, 0.3);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 154, 86, 0.5);
}
