* {
    box-sizing: border-box;
}

#starfield-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

#orange-sphere-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

body {
    margin: 0;
    padding-top: 75px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: #1a1a1a;
    color: #eee;
}

@media (prefers-color-scheme: light) {
    body {
        background: #f5f5f5;
        color: #333;
    }
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* Dropdown Menu */
.dropdown-menu-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

@media (prefers-color-scheme: dark) {
    .dropdown-menu-container {
        background: #1a1a1a;
    }
}

.dropdown-btn {
    width: 100%;
    padding: 1.25rem;
    background: white;
    border: none;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
    transition: background 0.2s;
}

@media (prefers-color-scheme: dark) {
    .dropdown-btn {
        background: #1a1a1a;
        border-bottom-color: #444;
        color: #fff;
    }
}

.dropdown-btn:hover {
    background: #f8f9fa;
}

@media (prefers-color-scheme: dark) {
    .dropdown-btn:hover {
        background: #2a2a2a;
    }
}

.dropdown-btn.open {
    background: #ff8c00;
    color: white;
    border-bottom-color: #ff7700;
}

@media (prefers-color-scheme: dark) {
    .dropdown-btn.open {
        border-bottom-color: #ff7700;
    }
}

.dropdown-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.dropdown-label {
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
}


.dropdown-content {
    position: fixed;
    top: 75px;
    left: 0;
    right: 0;
    background: white;
    max-height: calc(100vh - 75px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

@media (prefers-color-scheme: dark) {
    .dropdown-content {
        background: #2a2a2a;
    }
}

.dropdown-content.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    gap: 1rem;
    min-height: 60px;
    font-weight: 600;
}

@media (prefers-color-scheme: dark) {
    .dropdown-header {
        color: #fff;
        border-bottom-color: #444;
    }
}

.dropdown-header:hover {
    background: #f8f9fa;
}

@media (prefers-color-scheme: dark) {
    .dropdown-header:hover {
        background: #333;
    }
}

.dropdown-header::before {
    content: '🏅';
    font-size: 1.75rem;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-items {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 5rem;
}


.menu-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    gap: 1rem;
    min-height: 60px;
}

@media (prefers-color-scheme: dark) {
    .menu-item {
        color: #fff;
        border-bottom-color: #444;
    }
}

.menu-item:hover {
    background: #f8f9fa;
}

@media (prefers-color-scheme: dark) {
    .menu-item:hover {
        background: #333;
    }
}

.menu-item-name {
    font-weight: 600;
    flex: 1;
}

.menu-tier-badge {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    flex-shrink: 0;
    position: relative;
    order: -1;
}

.menu-tier-badge::before {
    content: '🍃';
    position: absolute;
    top: -6px;
    right: -5px;
    font-size: 1rem;
}

.menu-tier-badge.tier-S {
    background: linear-gradient(270deg, red, orange, yellow, green, blue, indigo, violet);
    background-size: 400% 400%;
    animation: rainbowPulse 6s linear infinite;
}
.menu-tier-badge.tier-A { background: #ff7f00; }
.menu-tier-badge.tier-B { background: #ffd700; }
.menu-tier-badge.tier-C { background: #32cd32; }
.menu-tier-badge.tier-D { background: #5a381e; }
.menu-tier-badge.tier-F { background: #111111; }

.menu-tier-placeholder {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px dashed #ccc;
    flex-shrink: 0;
    order: -1;
}

@media (prefers-color-scheme: dark) {
    .menu-tier-placeholder {
        border-color: #666;
    }
}

@keyframes rainbowPulse {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.menu-item-store {
    font-size: 0.85rem;
    color: #ff8c00;
    font-weight: 500;
}

.menu-loading,
.menu-empty {
    text-align: center;
    padding: 2rem;
    color: #999;
}

@media (prefers-color-scheme: dark) {
    .menu-loading,
    .menu-empty {
        color: #666;
    }
}

.logout-item {
    background: #dc3545;
    border: none;
    cursor: pointer;
    color: white;
    width: 100%;
    text-align: left;
    font-size: inherit;
    font-family: inherit;
}

.logout-item:hover {
    background: #c82333;
}

.logout-item .menu-item-name {
    color: white;
}

.dropdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.dropdown-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* Ensure main content containers sit above the sphere canvas (z-index: 1) */
.vote-container,
.admin-container,
.container {
    position: relative;
    z-index: 2;
}
