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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0f0f0f;
    color: #e0e0e0;
    line-height: 1.6;
    min-height: 100vh;
}

/* --- Login Page --- */

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-card {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 3rem 2.5rem;
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.login-logo {
    font-size: 3rem;
    color: #60a5fa;
    margin-bottom: 1rem;
}

.login-card h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: #888;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.login-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-oauth {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.85rem 1.75rem;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: box-shadow 0.2s, transform 0.1s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.btn-oauth:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    transform: translateY(-1px);
}

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

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

/* --- Portal Layout --- */

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #333;
    flex-wrap: wrap;
    gap: 1rem;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #aaa;
}

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: none;
}

.header-nav {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: #60a5fa;
    text-decoration: none;
    font-size: 0.9rem;
}

.nav-link:hover {
    text-decoration: underline;
}

.nav-link-logout {
    color: #f87171;
}

/* --- Tiles Grid --- */

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

.tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem 1rem;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 10px;
    text-decoration: none;
    color: #e0e0e0;
    transition: border-color 0.2s, transform 0.1s, background 0.2s;
}

.tile:hover {
    border-color: #60a5fa;
    background: #1f2937;
    transform: translateY(-2px);
}

.tile i {
    font-size: 2.5rem;
    color: #60a5fa;
}

.tile-label {
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
}

.no-tiles, .error {
    color: #888;
    text-align: center;
    padding: 2rem;
    grid-column: 1 / -1;
}

.loading {
    color: #888;
    text-align: center;
    padding: 2rem;
    grid-column: 1 / -1;
}

/* --- Profile / Who Am I --- */

.profile-card {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 2rem;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #333;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
}

.profile-name h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.profile-email {
    color: #888;
    font-size: 0.9rem;
}

.profile-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-row {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #222;
}

.detail-label {
    min-width: 120px;
    color: #888;
    font-size: 0.9rem;
    font-weight: 500;
}

.detail-value {
    color: #e0e0e0;
    font-size: 0.9rem;
    word-break: break-all;
}

.roles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.role-badge {
    background: #1e3a5f;
    color: #60a5fa;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* --- Responsive --- */

@media (max-width: 600px) {
    .tiles-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    header {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .detail-row {
        flex-direction: column;
        gap: 0.25rem;
    }

    .detail-label {
        min-width: unset;
    }
}
