:root {
    --bg-color: #050a15;
    --navy-blue: #0b1a40;
    --navy-light: #162a5c;
    --crimson-red: #d91c29;
    --crimson-glow: rgba(217, 28, 41, 0.4);
    --white: #ffffff;
    --text-muted: #94a3b8;
    --glass-bg: rgba(11, 26, 64, 0.45);
    --glass-border: rgba(255, 255, 255, 0.08);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--navy-blue);
    color: var(--white);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

body::-webkit-scrollbar {
    display: none;
}

/* Dynamic Backgrounds Removed */

/* Header & Hero */
.hero {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50vh;
    text-align: center;
    padding: 4rem 2rem;
    position: relative;
    border-bottom: 1px solid var(--glass-border);
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-avatar-container {
    position: relative;
    margin-bottom: 1.5rem;
}

.profile-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 3px solid var(--white);
    object-fit: cover;
}

.verified-badge-hero {
    position: absolute;
    bottom: 5px; right: 8px;
    width: 34px; height: 34px;
    background: var(--bg-color);
    border-radius: 6px;
    padding: 2px;
    z-index: 10;
}

.roblox-badge {
    height: 16px;
    width: 16px;
    margin-left: 5px;
    vertical-align: text-bottom;
}

.hero-name {
    font-family: var(--font-heading);
    font-size: 4.2rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, var(--white), #e2e8f0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 2rem;
    font-weight: 300;
}

/* Grand Total Visits */
.grand-total-container {
    background: var(--glass-bg);
    border: 1px solid var(--crimson-red);
    box-shadow: 0 0 20px var(--crimson-glow);
    border-radius: 50px;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-ruby {
    color: var(--crimson-red);
    font-size: 2rem;
}

.icon-sapphire {
    color: #1d9bf0;
    text-shadow: 0 0 10px #1d9bf0;
    font-size: 2rem;
}

.hero-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.grand-total-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.grand-total-text .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
}

.grand-total-text .value {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1;
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.section {
    margin-bottom: 5rem;
    content-visibility: auto;
    contain-intrinsic-size: 1000px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-desc {
    color: var(--text-muted);
    margin-bottom: 3rem;
    font-size: 1.1rem;
    max-width: 800px;
}

.filter-hint {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--crimson-red);
}

/* Games Grid */
.games-grid {
    display: grid;
    /* min(100%, 320px) prevents horizontal overflow on narrow phones */
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 2rem;
}

/* Game Card */
.game-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    opacity: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

a.game-card:hover,
a.game-card:focus-visible {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2);
}

a.game-card:focus-visible {
    outline: 2px solid var(--crimson-red);
    outline-offset: 2px;
}

.grid-error {
    color: var(--crimson-red);
    text-align: center;
    grid-column: 1 / -1;
}

.game-icon-wrapper {
    width: 100%;
    height: 180px;
    overflow: hidden;
    position: relative;
    border-bottom: 2px solid var(--navy-light);
}

.game-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qa-role-badge {
    position: absolute;
    bottom: 15px; left: 15px;
    background: var(--navy-blue);
    border: 1px solid var(--crimson-red);
    color: var(--white);
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    z-index: 2;
    font-family: var(--font-heading);
}

.game-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.game-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: auto;
}

.metric {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
    display: flex; align-items: center; gap: 5px;
}

.metric-value {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--white);
}

/* Metric icon accent colors (referenced from the shared card renderer) */
.mi-visits { color: var(--crimson-red); }
.mi-playing { color: #1d9bf0; }
.mi-likes { color: #00b894; }
.mi-favorites { color: #fdcb6e; }

.creator-tag {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
    min-height: 4.5rem;
    align-content: center;
}

.creator-sub {
    width: 100%;
    font-size: 0.75rem;
    margin-top: 2px;
    padding-left: 20px;
    opacity: 0.8;
}

.verified-icon {
    color: #1d9bf0;
    font-size: 0.8rem;
    margin-left: 2px;
}

.contribution-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.2rem;
    padding: 0.8rem;
    background: rgba(217, 28, 41, 0.05);
    border-left: 3px solid var(--crimson-red);
    border-radius: 0 6px 6px 0;
    line-height: 1.5;
    flex-grow: 1;
}

/* NDA Card Styling */
.game-card.nda {
    cursor: default !important;
    filter: saturate(0.8) contrast(1.1);
    border-color: rgba(255, 215, 0, 0.2); /* Gold-ish tint for classified */
    background: linear-gradient(145deg, rgba(11, 26, 64, 0.6), rgba(5, 10, 21, 0.8));
}

.game-card.nda:hover {
    transform: none;
    border-color: rgba(255, 215, 0, 0.4);
}

.game-card.nda .game-title {
    color: #e2e8f0;
    font-style: italic;
    opacity: 0.9;
}

.game-card.nda .qa-role-badge {
    border-color: #ffd700;
    color: #ffd700;
    background: rgba(0, 0, 0, 0.6);
}

.game-card.nda .metric-value {
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.game-card.nda .creator-tag {
    opacity: 0.6;
}

/* Roles Section */
.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.role-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    color: var(--white);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.role-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.role-card.clickable-role {
    cursor: pointer;
}

.role-card.active-filter {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.05);
}

.role-card:focus-visible {
    outline: 2px solid var(--crimson-red);
    outline-offset: 2px;
}

.role-icon {
    width: 60px; height: 60px;
    border-radius: 12px;
    background: rgba(217, 28, 41, 0.1);
    border: 1px solid rgba(217, 28, 41, 0.3);
    display: flex; justify-content: center; align-items: center;
    font-size: 1.8rem;
    color: var(--crimson-red);
    flex-shrink: 0;
}

.role-card:nth-child(2) .role-icon {
    background: rgba(29, 155, 240, 0.1);
    border-color: rgba(29, 155, 240, 0.3);
    color: #1d9bf0;
}

.role-info h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.role-info p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Contact Section */
.contact-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.contact-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    text-decoration: none;
    color: var(--white);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.contact-card.roblox:hover {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.contact-card.discord:hover {
    border-color: #5865F2;
    background: rgba(88, 101, 242, 0.1);
}

.contact-card.email:hover {
    border-color: #ea4335;
    background: rgba(234, 67, 53, 0.1);
}

.card-icon {
    width: 60px; height: 60px;
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
    display: flex; justify-content: center; align-items: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.card-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.roblox .card-icon img {
    filter: invert(1);
}

.discord .card-icon { color: #5865F2; }
.email .card-icon { color: #ea4335; }

.card-info h3 { font-family: var(--font-heading); font-size: 1.1rem; color: var(--text-muted); margin-bottom: 0.1rem; }
.card-info p { font-size: 1.1rem; font-weight: 700; }
.sub-handle { font-size: 0.78rem; color: var(--text-muted); display: block; line-height: 1.4; }

.external-icon, .copy-btn {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 1.2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}

.contact-card:hover .external-icon, .copy-btn:hover { color: var(--white); }

.copy-btn.copied { color: #00b894; }

.email-address { word-break: break-all; }

/* Footer */
footer {
    text-align: center;
    padding: 3rem;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
}
.footer-sub { font-size: 0.8rem; margin-top: 0.5rem; opacity: 0.6; }

@media (max-width: 768px) {
    .hero-name { font-size: 2.5rem; }
    .grand-total-container { flex-direction: column; text-align: center; padding: 1rem; }
    .grand-total-text { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* ============================
   Maintenance Mode Overlay
   ============================ */
#maintenanceOverlay {
    display: none; /* shown by JS when MAINTENANCE_MODE = 1 */
    position: fixed;
    inset: 0;
    z-index: 9999;
    background-image: url('maintenance-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.maintenance-card {
    text-align: center;
    padding: 3.5rem 4rem;
    max-width: 520px;
    width: 90%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    backdrop-filter: blur(20px);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
}

.maintenance-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.maintenance-desc {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.maintenance-contact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 1rem 1.5rem;
}

.maintenance-contact a {
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.2s;
}

.maintenance-contact a:hover {
    color: var(--crimson-red);
}

.maintenance-contact strong {
    color: var(--white);
    font-weight: 700;
}
