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

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #0a0a0a;
    color: #e5e5e5;
    min-height: 100vh;
}

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

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(10, 10, 10, 0.95) 0%, rgba(10, 10, 10, 0.85) 100%);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

/* Buttons */
.desktop-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background-color: #1a1a1a;
    color: #e5e5e5;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.desktop-button:hover {
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    border-color: #3a3a3a;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.desktop-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.desktop-button svg {
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

.mobile-button {
    position: fixed;
    top: 1rem;
    z-index: 1001;
    background-color: rgba(26, 26, 26, 0.8);
    border: 1px solid #2a2a2a;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    cursor: pointer;
}

.mobile-button:hover {
    background-color: rgba(42, 42, 42, 0.9);
    transform: scale(1.05);
}

.mobile-button svg {
    width: 24px;
    height: 24px;
    color: #e5e5e5;
}

.mobile-clear-btn {
    left: 1rem;
}

.mobile-download-btn {
    right: 1rem;
}

/* Nav */
.nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.palette-wrapper {
    display: flex;
    align-items: center;
}

/* Header Palette */
.header-palette {
    display: flex;
    gap: 8px;
    align-items: center;
}

.palette-button {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.palette-button:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

.palette-button.selected {
    border: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow: 
        0 0 0 2px rgba(255, 255, 255, 0.3),
        0 4px 16px rgba(0, 0, 0, 0.5);
    transform: scale(1.1);
}

/* Main */
.main {
    max-width: 2400px;
    margin: 0 auto;
    padding: 4rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100vh;
    gap: 2rem;
}

/* Title */
.title {
    width: 100%;
}

.title h1 {
    font-size: 3rem;
    font-weight: 700;
    color: #ffffff;
    padding: 0;
    margin: 0;
    text-align: center;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Year Selector */
.year-selector {
    display: flex;
    align-items: left;
    gap: 10px;
    margin-top: 0;
    width: 100%;
    max-width: 600px;
}

.custom-select {
    display: flex;
    align-items: center;
    background-color: #0a0a0a;
    border: 1px solid #1a1a1a;
    position: relative;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    width: 100%;
    border-radius: 8px;
}

.separator {
    width: 1px;
    height: 60%;
    background-color: #2a2a2a;
}

.text-field {
    cursor: text;
    padding: 12px 15px;
    border: none;
    text-align: center;
    color: #ffffff;
    background-color: transparent;
    outline: none;
    width: 100%;
    font-size: 0.875rem;
}

.text-field::placeholder {
    color: #666;
}

.custom-select select {
    cursor: pointer;
    background-color: #0a0a0a !important;
    border: none;
    color: #e5e5e5 !important;
    text-align: center;
    padding: 12px 30px 12px 15px;
    appearance: none;
    outline: none;
    font-size: 0.875rem;
    flex: 1;
}

.custom-select select option {
    background-color: #0a0a0a !important;
    color: #e5e5e5 !important;
    padding: 8px;
}

.custom-select select option:checked {
    background-color: #1a1a1a !important;
    color: #e5e5e5 !important;
}

.custom-select select option:hover {
    background-color: #1a1a1a !important;
    color: #e5e5e5 !important;
}

.custom-select::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    height: 0;
    border-style: solid;
    border-width: 6px 6px 0 6px;
    border-color: #e5e5e5 transparent transparent transparent;
    pointer-events: none;
}

/* Graph */
.graph {
    padding: 20px;
    background-color: #0f0f0f;
    border: 2px solid #2a2a2a;
    border-radius: 16px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    width: calc(100% - 4rem);
    max-width: 1400px;
    margin: 0;
    cursor: crosshair;
    transition: all 0.3s ease;
}

.graph:hover {
    border-color: #3a3a3a;
    box-shadow: 
        0 15px 50px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.row-container {
    display: flex;
    flex-wrap: no-wrap;
    justify-content: center;
    gap: 3px;
}

.column-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 1;
    gap: 3px;
}

.square {
    flex: 1;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    background-color: #1e1e1e;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 2px;
    position: relative;
    border: none;
}

.square:hover {
    z-index: 10;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.2);
}

.empty-spot {
    flex: 1;
    width: 100%;
    height: 100%;
    box-shadow: none;
    background: transparent;
}

/* Mobile Nav */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #1a1a1a;
    border-top: 1px solid #2a2a2a;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    padding: 1rem;
}

.mobile-nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.mobile-palette {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.nav-arrow-button {
    background-color: rgba(26, 26, 26, 0.8);
    border: 1px solid #2a2a2a;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.nav-arrow-button:hover:not(:disabled) {
    background-color: rgba(42, 42, 42, 0.9);
    transform: scale(1.05);
}

.nav-arrow-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.nav-arrow-button svg {
    width: 24px;
    height: 24px;
    color: #e5e5e5;
}

/* Responsive */
@media (min-width: 769px) {
    .mobile-button {
        display: none !important;
    }
    
    .mobile-nav {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .header {
        display: none;
    }
    
    .mobile-button {
        display: flex;
    }
    
    .mobile-nav {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .main {
        margin-top: 0;
        padding: 1rem;
        min-height: calc(100vh - 100px);
    }
    
    .title h1 {
        font-size: 2rem;
        padding: 0;
    }
    
    .graph {
        padding: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 2rem 1rem 0 !important;
    }
    
    .row-container {
        gap: 1px;
    }
    
    .column-container {
        gap: 1px;
    }
    
    .square {
        border-radius: 2px;
    }
    
    .square:hover {
        border-color: rgba(255, 255, 255, 0.3);
    }
}

