:root {
    --bg-color: #0f172a;
    --panel-bg: rgba(30, 41, 59, 0.7);
    --accent-color: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at top left, #1e1b4b, #0f172a 40%, #020617);
}
html {
    overscroll-behavior: none;
}

.app-container {
    display: flex;
    width: 90vw;
    max-width: 1200px;
    height: 85vh;
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.sidebar {
    width: 250px;
    background: rgba(15, 23, 42, 0.6);
    border-right: 1px solid var(--border-color);
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 3rem;
    letter-spacing: -0.05em;
}

.logo span {
    color: var(--accent-color);
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nav-links li {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-links li:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-links li.active {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 0 15px var(--accent-glow);
}

.theme-picker {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.theme-picker label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 600;
}

.theme-picker input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    overflow: hidden;
    padding: 0;
    background: transparent;
}

.theme-picker input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.theme-picker input[type="color"]::-webkit-color-swatch {
    border: 2px solid var(--border-color);
    border-radius: 50%;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.settings-bar {
    padding: 1.5rem 2.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 2rem;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    min-height: 80px;
    flex-wrap: wrap;
}

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

.settings-group.hidden {
    display: none;
}

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

.checkbox-label {
    display: flex;
    align-items: center;
    flex-direction: row !important;
    gap: 0.5rem;
    cursor: pointer;
    text-transform: none !important;
}

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

.settings-group input[type="number"], .settings-group select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 8px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s ease;
}

.settings-group input[type="number"]:focus, .settings-group select:focus {
    border-color: var(--accent-color);
}

.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.custom-slider {
    position: relative;
    width: 100%;
    height: 24px;
    display: flex;
    align-items: center;
    cursor: pointer;
    touch-action: none;
    user-select: none;
}

.slider-track {
    position: relative;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.slider-fill {
    position: absolute;
    height: 100%;
    background: var(--accent-color);
    border-radius: 3px;
    left: 0;
    box-shadow: 0 0 10px var(--accent-glow);
}

.slider-thumb {
    position: absolute;
    top: 50%;
    width: 16px;
    height: 16px;
    background: var(--accent-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px var(--accent-glow);
    transition: transform 0.1s ease;
}

.custom-slider:active .slider-thumb {
    transform: translate(-50%, -50%) scale(1.2);
}

.custom-select {
    position: relative;
    width: 100%;
    min-width: 150px;
    font-family: inherit;
    user-select: none;
}

.custom-select .select-selected {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.custom-select .select-selected:hover, .custom-select .select-selected.select-arrow-active {
    border-color: var(--accent-color);
}

.custom-select .select-items {
    position: absolute;
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    border-radius: 8px;
    top: 115%;
    left: 0;
    right: 0;
    z-index: 99;
    overflow: hidden;
}

.custom-select .select-items div {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--text-secondary);
}

.custom-select .select-items div:last-child {
    border-bottom: none;
}

.custom-select .select-items div:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.select-hide {
    display: none;
}

.result-area {
    padding: 2.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
}

.generate-btn {
    background: linear-gradient(135deg, var(--accent-color), #2563eb);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 3rem;
    flex-shrink: 0;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.4);
}

.generate-btn:active {
    transform: translateY(1px);
}

.odds-counter-container {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
    width: 100%;
    max-width: 600px;
    animation: fadeInSlideUp 0.4s ease forwards;
}

.odds-counter-container.hidden {
    display: none;
}

.odds-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.odds-percentage {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-color);
    text-shadow: 0 0 15px var(--accent-glow);
    margin-bottom: 0.5rem;
}

.odds-comparison {
    font-size: 1rem;
    color: var(--text-primary);
    font-style: italic;
}

.odds-comparison.hidden {
    display: none;
}

.results-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    width: 100%;
}

.result-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.25rem;
    font-weight: 600;
    animation: fadeInSlideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    opacity: 0;
    transform: translateY(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-width: 120px;
}

.result-item.color-swatch {
    border-radius: 16px;
    justify-content: center;
    align-items: end;
    padding-bottom: 1rem;
    font-family: monospace;
    font-size: 1.35rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    border: 4px solid var(--border-color);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    width: 140px;
    height: 140px;
}

.result-item.coin {
    border-radius: 50%;
    width: 140px;
    height: 140px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    font-weight: 800;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(255, 255, 255, 0.1);
    border: 6px solid var(--border-color);
    margin: 1rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.result-item.coin-heads {
    background: radial-gradient(circle at 30% 30%, #3b82f6, #1e3a8a);
    border-color: #60a5fa;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3), inset 0 0 20px rgba(255, 255, 255, 0.2);
}

.result-item.coin-tails {
    background: radial-gradient(circle at 30% 30%, #ef4444, #7f1d1d);
    border-color: #f87171;
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.3), inset 0 0 20px rgba(255, 255, 255, 0.2);
}

.result-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }

@media (max-width: 768px) {
    .app-container {
        flex-direction: column; height: 100vh; width: 100vw; border-radius: 0; border: none;
    }
    .sidebar {
        width: 100%; padding: 1rem; flex-direction: row; align-items: center; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border-color); flex-shrink: 0;
    }
    .theme-picker { margin-top: 0; margin-left: auto; flex-direction: row; align-items: center; }
    .logo { margin-bottom: 0; margin-right: 2rem; }
    .nav-links { flex-direction: row; }
    .nav-links li { white-space: nowrap; }
    
    .main-content {
        overflow-y: auto;
    }
    .settings-bar {
        padding: 1rem;
        gap: 1.5rem;
    }
    .result-area {
        overflow-y: visible;
        padding: 1.5rem;
    }
}
