:root {
    --hawkins-red: #E50914;
    --upside-down: #05010a;
    --portal-green: #39ff14;
    --void-blue: #1e193c;
}

body {
    background-color: var(--upside-down);
    color: #fff;
    font-family: 'Courier New', Courier, monospace;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* Film Grain & Darkness */
.vignette {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, transparent 20%, black 100%);
    pointer-events: none; z-index: 10;
}

.neon-title {
    font-size: 4rem;
    color: var(--hawkins-red);
    text-shadow: 0 0 10px var(--hawkins-red), 0 0 20px var(--hawkins-red);
    letter-spacing: 5px;
    margin-top: 50px;
}

.flicker { animation: flicker 3s infinite; }

@keyframes flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% { opacity: 1; }
    20%, 24%, 55% { opacity: 0.3; }
}

.quest-board { width: 90%; max-width: 500px; z-index: 20; padding-bottom: 50px; }

.step-card {
    background: rgba(30, 25, 60, 0.4);
    border: 2px solid #222;
    padding: 30px;
    margin-top: 25px;
    border-radius: 5px;
    transition: 0.5s;
}

.step-card.active { border-color: var(--hawkins-red); box-shadow: 0 0 15px rgba(229, 9, 20, 0.3); }

.step-card.locked { opacity: 0.4; filter: grayscale(1); pointer-events: none; }

.step-number { font-size: 0.8rem; color: var(--hawkins-red); font-weight: bold; }

.quest-btn {
    display: block; width: 100%; padding: 15px;
    background: var(--hawkins-red); color: white;
    text-decoration: none; text-align: center;
    font-weight: bold; border: none; cursor: pointer;
    box-shadow: 0 0 10px var(--hawkins-red);
}

.quest-btn:hover { background: #b0070f; }

.btn-locked { background: #333; box-shadow: none; cursor: not-allowed; }

input {
    width: 100%; padding: 12px; margin-bottom: 15px;
    background: #000; border: 1px solid var(--void-blue);
    color: var(--portal-green); font-weight: bold;
}

/* Rules Footer Styling */
.rules-footer {
    width: 100%;
    background: rgba(10, 1, 24, 0.9);
    border-top: 2px solid var(--hawkins-red);
    padding: 60px 20px;
    margin-top: 100px;
    z-index: 20;
}

.rules-container {
    max-width: 800px;
    margin: 0 auto;
}

.rules-title {
    color: var(--hawkins-red);
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 3px;
    margin-bottom: 40px;
    text-shadow: 0 0 10px var(--hawkins-red);
}

.rules-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Responsive grid for mobile */
@media (max-width: 600px) {
    .rules-grid { grid-template-columns: 1fr; }
}

.rule-box {
    background: rgba(30, 25, 60, 0.3);
    border: 1px solid #333;
    padding: 20px;
    border-radius: 5px;
}

.rule-box h4 {
    color: var(--portal-green);
    margin-top: 0;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.rule-box p, .rule-box li {
    font-size: 0.85rem;
    line-height: 1.6;
    color: #ccc;
}

.ledger-status {
    text-align: center;
    margin-top: 40px;
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: #555;
}

.status-active {
    color: var(--portal-green);
    font-weight: bold;
}

/* Safety Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #0d0216;
    border: 3px solid var(--hawkins-red);
    padding: 40px;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 0 30px var(--hawkins-red);
}

.neon-red {
    color: var(--hawkins-red);
    text-shadow: 0 0 10px var(--hawkins-red);
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.safety-list {
    text-align: left;
    color: #ccc;
    font-size: 0.9rem;
    line-height: 1.8;
    margin: 20px 0;
}

.safety-list li { margin-bottom: 10px; }

.portal-green { color: var(--portal-green); text-shadow: 0 0 10px var(--portal-green); }

.neon-text {
    color: var(--portal-green);
    font-weight: bold;
    background: #000;
    padding: 2px 8px;
    border: 1px solid var(--void-blue);
}

.code-display {
    text-align: left;
    background: rgba(0,0,0,0.5);
    padding: 15px;
    border-left: 3px solid var(--portal-green);
    margin-bottom: 20px;
}

.link-box { margin-top: 20px; }

.neon-title-small {
    color: var(--hawkins-red);
    text-shadow: 0 0 5px var(--hawkins-red);
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.small-text { font-size: 0.75rem; color: #888; margin-bottom: 15px; }

#leaderboard-list {
    text-align: left;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--void-blue);
    padding: 10px;
    margin-bottom: 15px;
    font-size: 0.85rem;
}

.leader-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 5px;
    border-bottom: 1px solid #222;
}

.leader-row span:last-child { color: var(--portal-green); font-weight: bold; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--hawkins-red);
    box-shadow: none;
    font-size: 0.8rem;
}

.dashboard-container {
    background: #05010a;
    border: 2px solid var(--void-blue);
    position: relative;
    padding: 20px;
    overflow: hidden;
}

/* The CRT Scanline Effect */
.crt-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

.tingle-value {
    font-size: 3rem;
    color: var(--portal-green);
    text-shadow: 0 0 20px var(--portal-green);
    font-weight: bold;
}

.lock-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex; align-items: center; justify-content: center;
    color: var(--hawkins-red);
    font-weight: bold;
    backdrop-filter: blur(4px);
}
