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

body {
    font-family: 'Press Start 2P', 'Courier New', monospace;
    background: #1a1a2e;
    color: #eee;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(180deg, #16213e 0%, #1a1a2e 100%);
    border-bottom: 4px solid #e94560;
    position: relative;
}

.back-home {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: #00ffff;
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.3s;
}

.back-home:hover {
    color: #e94560;
}

header h1 {
    font-size: 2rem;
    color: #e94560;
    text-shadow: 4px 4px 0 #0f3460;
    margin-bottom: 0.3rem;
    letter-spacing: 4px;
}

header p {
    color: #888;
    font-size: 0.6rem;
}

.arcade-layout {
    flex: 1;
    display: flex;
    padding: 1.5rem;
    gap: 2rem;
    width: 100%;
}

/* Games Section - Left Side */
.games-section {
    flex: 2;
    min-width: 0;
}

.games-section h2 {
    font-size: 0.9rem;
    color: #00ffff;
    margin-bottom: 1rem;
    text-align: center;
    letter-spacing: 2px;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.2rem;
}

.game-card {
    background: #16213e;
    border: 3px solid #0f3460;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(233, 69, 96, 0.3);
    border-color: #e94560;
}

.game-card .thumbnail {
    width: 100%;
    height: 120px;
    background: #0f3460;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.game-card .info {
    padding: 0.8rem;
}

.game-card .info h3 {
    font-size: 0.7rem;
    margin-bottom: 0.4rem;
    color: #e94560;
}

.game-card .info p {
    font-size: 0.5rem;
    color: #888;
    line-height: 1.6;
}

.no-games {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 0.7rem;
}

/* Scoreboard Section - Right Side */
.scoreboard-section {
    flex: 1;
    min-width: 0;
}

.scoreboard {
    background: linear-gradient(180deg, #2a1a1a 0%, #1a0a0a 100%);
    border: 6px solid #4a3030;
    border-radius: 12px;
    padding: 0;
    box-shadow:
        inset 0 0 20px rgba(0,0,0,0.5),
        0 0 30px rgba(233, 69, 96, 0.2);
    overflow: hidden;
}

.scoreboard-header {
    background: linear-gradient(180deg, #3a2020 0%, #2a1515 100%);
    padding: 1rem;
    text-align: center;
    border-bottom: 3px solid #4a3030;
}

.scoreboard-title {
    font-size: 1.8rem;
    color: #ffcc00;
    text-shadow: 0 0 10px #ffcc00, 0 0 20px #ff6600;
    letter-spacing: 3px;
}

.scoreboard-lights {
    margin-top: 0.5rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff0000;
    box-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000;
    animation: blink 1s infinite alternate;
}

.light:nth-child(2) {
    background: #ffff00;
    box-shadow: 0 0 10px #ffff00, 0 0 20px #ffff00;
    animation-delay: 0.3s;
}

.light:nth-child(3) {
    background: #00ff00;
    box-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00;
    animation-delay: 0.6s;
}

@keyframes blink {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

.scoreboard-display {
    padding: 1.5rem;
    background: #0a0505;
    margin: 4px;
    border-radius: 4px;
    border: 2px solid #3a2020;
}

.score-header {
    display: flex;
    padding: 0.5rem 0;
    border-bottom: 2px solid #3a2020;
    margin-bottom: 0.5rem;
    color: #888;
    font-size: 1.2rem;
    gap: 0.5rem;
}

.rank-col {
    width: 35px;
    text-align: center;
    flex-shrink: 0;
}

.name-col {
    flex: 1;
    text-align: left;
}

.points-col {
    width: auto;
    text-align: right;
    flex-shrink: 0;
}

.score-list {
    max-height: 350px;
    overflow-y: auto;
}

.score-list::-webkit-scrollbar {
    width: 6px;
}

.score-list::-webkit-scrollbar-track {
    background: #1a0a0a;
}

.score-list::-webkit-scrollbar-thumb {
    background: #4a3030;
    border-radius: 3px;
}

.score-row {
    display: flex;
    padding: 0.8rem 0;
    border-bottom: 1px solid #2a1515;
    font-size: 1.3rem;
    transition: background 0.2s;
    gap: 0.5rem;
}

.score-row:hover {
    background: rgba(233, 69, 96, 0.1);
}

.score-row .rank-col {
    color: #ffcc00;
}

.score-row .name-col {
    color: #00ffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.score-row .points-col {
    color: #00ff00;
    font-family: 'Courier New', monospace;
}

.score-row.top-3 .rank-col {
    color: #ff6600;
    text-shadow: 0 0 5px #ff6600;
}

.score-row.top-3 .points-col {
    color: #ffff00;
    text-shadow: 0 0 5px #ffff00;
}

.no-scores {
    text-align: center;
    color: #666;
    padding: 2rem 1rem;
    font-size: 0.5rem;
}

.your-score {
    background: linear-gradient(180deg, #002200 0%, #001500 100%);
    padding: 1rem;
    text-align: center;
    border-top: 3px solid #004400;
}

.your-score-label {
    font-size: 1.2rem;
    color: #00ff00;
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}

.your-score-value {
    font-size: 2.5rem;
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00;
    font-family: 'Courier New', monospace;
}

footer {
    text-align: center;
    padding: 1rem;
    background: #16213e;
    border-top: 2px solid #0f3460;
    font-size: 0.6rem;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .arcade-layout {
        flex-direction: column;
    }

    .scoreboard-section {
        width: 100%;
    }
}

@media (max-width: 500px) {
    header h1 {
        font-size: 1.2rem;
    }

    .back-home {
        position: static;
        display: block;
        margin-bottom: 0.5rem;
    }
}

/* Auth Section */
.auth-section {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
}

.auth-btn {
    background: #e94560;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    font-family: inherit;
    font-size: 0.6rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.3s;
}

.auth-btn:hover {
    background: #ff6b8a;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.user-name {
    color: #00ffff;
    font-size: 0.6rem;
}

.logout-btn {
    background: transparent;
    color: #888;
    border: 1px solid #888;
    padding: 0.3rem 0.6rem;
    font-family: inherit;
    font-size: 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
}

.logout-btn:hover {
    color: #e94560;
    border-color: #e94560;
}

/* Auth Modal */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.auth-modal.active {
    display: flex;
}

.auth-modal-content {
    background: #16213e;
    border: 4px solid #e94560;
    border-radius: 12px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    position: relative;
}

.auth-modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.8rem;
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.auth-modal-close:hover {
    color: #e94560;
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.auth-tab {
    flex: 1;
    background: transparent;
    border: 2px solid #0f3460;
    color: #888;
    padding: 0.6rem;
    font-family: inherit;
    font-size: 0.6rem;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 4px;
}

.auth-tab:hover {
    border-color: #e94560;
    color: #e94560;
}

.auth-tab.active {
    background: #e94560;
    border-color: #e94560;
    color: #fff;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.form-group label {
    font-size: 0.5rem;
    color: #888;
}

.form-group input {
    background: #0f3460;
    border: 2px solid #1a1a2e;
    color: #fff;
    padding: 0.6rem;
    font-family: inherit;
    font-size: 0.6rem;
    border-radius: 4px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #00ffff;
}

.form-error {
    color: #ff4444;
    font-size: 0.5rem;
    min-height: 1rem;
}

.auth-submit {
    background: #e94560;
    color: #fff;
    border: none;
    padding: 0.8rem;
    font-family: inherit;
    font-size: 0.6rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.3s;
    margin-top: 0.5rem;
}

.auth-submit:hover {
    background: #ff6b8a;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    gap: 1rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #0f3460;
}

.auth-divider span {
    color: #666;
    font-size: 0.5rem;
}

.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.7rem;
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.6rem;
    cursor: pointer;
    transition: opacity 0.3s;
}

.oauth-btn:hover {
    opacity: 0.9;
}

.oauth-btn.google {
    background: #4285f4;
    color: #fff;
}

.oauth-btn.github {
    background: #333;
    color: #fff;
}

.oauth-btn.discord {
    background: #5865f2;
    color: #fff;
}

.oauth-icon {
    font-size: 0.8rem;
    font-weight: bold;
}

/* Responsive auth */
@media (max-width: 768px) {
    .auth-section {
        position: static;
        transform: none;
        margin-top: 0.5rem;
    }
}

@media (max-width: 500px) {
    .auth-modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }

    .oauth-btn {
        padding: 0.6rem;
        font-size: 0.5rem;
    }
}
