:root {
    --bg-dark: #0f1115;
    --bg-card: #1a1d24;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --terminal-bg: #000000;
    --terminal-text: #4ade80;

    --font-sans: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

html {
    scroll-behavior: smooth;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

.mono-text {
    font-family: var(--font-mono);
}

.highlight {
    color: var(--accent);
}

h1 { font-size: 3.5rem; line-height: 1.2; margin-bottom: 1rem; }
h2 { font-size: 2.5rem; margin-bottom: 2rem; text-align: center; }
p { font-size: 1.1rem; color: var(--text-muted); }

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background-color: rgba(15, 17, 21, 0.9);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #2d3748;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    font-weight: 600;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent);
}

.btn-login {
    background: transparent;
    border: 1px solid var(--accent);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    color: var(--accent) !important;
}

.btn-login:hover {
    background: var(--accent);
    color: #fff !important;
}

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 80vh;
    padding: 0.5%;
    gap: 4rem;
}

.hero-content {
    flex: 1;
}

.hero-content p {
    margin-bottom: 2.5rem;
    max-width: 600px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-secondary:hover {
    background-color: #2d3748;
}

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
}

.mock-window {
    background: var(--terminal-bg);
    border-radius: 8px;
    border: 1px solid #2d3748;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.window-header {
    background: var(--bg-card);
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #2d3748;
}

.dots span {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 6px;
}
.red { background: #ef4444; }
.yellow { background: #eab308; }
.green { background: #22c55e; }

.window-header .title {
    margin-left: auto;
    margin-right: auto;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.window-body {
    padding: 1.5rem;
    color: var(--terminal-text);
    font-size: 0.9rem;
}

.window-body p {
    color: var(--terminal-text);
    margin-bottom: 0.5rem;
}

.window-body .success {
    color: #60a5fa;
}

.cursor {
    animation: blink 1s step-start infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.features-section {
    padding: 5rem 5%;
    background-color: #121419;
}

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

.card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #2d3748;
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-5px);
}

.card h3 {
    margin-bottom: 1rem;
    color: #fff;
}

footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid #2d3748;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 4rem;
    }
    .hero-actions {
        justify-content: center;
    }
    .nav-links {
        display: none;
    }
}

.page-container {
    padding: 4rem 5%;
    min-height: 80vh;
}

.page-header {
    text-align: center;
    margin-bottom: 4rem;
}

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

.vm-card {
    background: var(--bg-card);
    border: 1px solid #2d3748;
    border-radius: 8px;
    padding: 2rem;
    transition: transform 0.2s, border-color 0.2s;
}

.vm-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.vm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.vm-era {
    background: #2d3748;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
}

.vm-title {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 1rem;
}

.quest-preview {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #2d3748;
}

.quest-preview h4 {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.loading-text {
    text-align: center;
    color: var(--accent);
    grid-column: 1 / -1;
}

.subtitle {
    text-align: center;
    margin-top: -1.5rem;
    margin-bottom: 2rem;
    color: var(--text-muted);
}

.challenge-section {
    margin-bottom: 5rem;
}

.challenge-card {
    display: flex;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--accent);
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.1);
}

.challenge-details {
    padding: 2rem 2.5rem;
    flex-grow: 1;
}

.challenge-date {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.challenge-details h3 {
    font-size: 2rem;
    color: #fff;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.challenge-rewards {
    margin-top: 1.5rem;
    text-align: center;
    gap: 1.5rem;
    font-weight: 600;
}

.xp-reward { color: #facc15; }

.challenge-vm-link {
    background-color: #121419;
    padding: 2rem;
    min-width: 200px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 1px solid #2d3748;
}

.vm-link-button {
    display: block;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid #2d3748;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.vm-link-button:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.leaderboard-section {
    margin-bottom: 5rem;
}

.leaderboard-table {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
}

.leaderboard-table th, .leaderboard-table td {
    padding: 1rem 1.5rem;
    text-align: left;
}

.leaderboard-table thead {
    background: #121419;
}

.leaderboard-table th {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.leaderboard-table tbody tr:not(:last-child) {
    border-bottom: 1px solid #2d3748;
}

.leaderboard-table td.username {
    font-weight: 600;
    color: #fff;
}
.leaderboard-table td.xp {
    font-family: var(--font-mono);
    color: var(--accent);
    font-weight: 700;
}

.discord-cta {
    background: linear-gradient(45deg, #1e3a8a, #3b82f6);
    text-align: center;
    padding: 3rem;
    border-radius: 8px;
}

.discord-cta h3 {
    font-size: 2rem;
    color: #fff;
    margin-bottom: 1rem;
}

.discord-cta p {
    color: #dbeafe;
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

.discord-button {
    background-color: #fff !important;
    color: #3b82f6 !important;
    font-size: 1.1rem;
    padding: 0.75rem 2rem;
}

.discord-button:hover {
    background-color: #f0f0f0 !important;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .challenge-card {
        flex-direction: column;
    }
    .challenge-vm-link {
        border-left: none;
        border-top: 1px solid #2d3748;
    }
}

.form-container {
    max-width: 450px;
    margin: 4rem auto;
    padding: 2.5rem;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid #2d3748;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-dark);
    border: 1px solid #2d3748;
    border-radius: 6px;
    color: var(--text-main);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.form-text {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
}
.form-text a {
    color: var(--accent);
    font-weight: 600;
}
.form-text a:hover {
    text-decoration: underline;
}

.error-message {
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
    padding: 0.75rem;
    border-radius: 6px;
    text-align: center;
    margin-bottom: 1rem;
    display: none;
}

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; }

.profile-card {
    display: flex;
    gap: 2rem;
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 8px;
    border: 1px solid #2d3748;
    margin-bottom: 3rem;
    align-items: flex-start;
}

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

.profile-info h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.profile-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.profile-bio {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-main);
}

.badges-section h2 {
    text-align: left;
    margin-bottom: 1.5rem;
}

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

.badge-item {
    background: var(--bg-card);
    border: 1px solid #2d3748;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, border-color 0.2s;
}

.badge-item:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.badge-icon {
    width: 48px;
    height: 48px;
}

.badge-info h3 {
    color: #fff;
    margin-bottom: 0.25rem;
}

.badge-info p {
    font-size: 0.9rem;
}

.error-box {
    text-align: center;
    padding: 3rem;
    background: var(--bg-card);
    border: 1px solid #ef4444;
    border-radius: 8px;
}

.search-section {
    margin-bottom: 5rem;
}

.search-bar {
    display: flex;
    max-width: 600px;
    margin: 0 auto 1.5rem auto;
    gap: 1rem;
}

#search-input {
    flex-grow: 1;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid #2d3748;
    border-radius: 6px;
    color: var(--text-main);
    font-size: 1rem;
}
#search-input:focus {
    outline: none;
    border-color: var(--accent);
}

.search-results {
    max-width: 600px;
    margin: 0 auto;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.result-item:hover {
    background-color: var(--bg-card);
}

.result-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.result-username {
    font-weight: 600;
    font-size: 1.1rem;
    color: #fff;
}

.download-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}

.qemu-disclaimer {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

#download-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#os-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    display: block;
}