
/* Imports futuristic and readable fonts */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;700;800;900&family=Rajdhani:wght@400;500;600;700&display=swap');

/* Stores the main colors of the game */
:root {
    --background: #08050f;
    --panel: #160e25;
    --cyan: #c084fc;
    --purple: #9333ea;
    --white: #f8f2ff;
    --muted: #c4b5d9;
    --border: rgba(192, 132, 252, 0.35);
}

/* Makes element sizes easier to manage */
* {
    box-sizing: border-box;
}

/* Sets the dark purple theme and readable font */
body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--white);
    font-family: 'Rajdhani', Arial, sans-serif;
    font-size: 18px;
    overflow-x: hidden;
}

/* Adds a purple cyber grid behind the game */
.background-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(168, 85, 247, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168, 85, 247, 0.07) 1px, transparent 1px);
    background-size: 55px 55px;
    mask-image: linear-gradient(to bottom, black, transparent);
    pointer-events: none;
    z-index: -2;
}

/* Adds glowing purple and magenta background lights */
.background-glow {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 25%, rgba(109, 40, 217, 0.23), transparent 38%),
        radial-gradient(circle at 80% 75%, rgba(192, 38, 211, 0.14), transparent 40%);
    pointer-events: none;
    z-index: -1;
}

/* Places the logo, creator name, and status at the top */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 24px 6%;
    border-bottom: 1px solid var(--border);
}

/* Styles the small CYBERHUNT logo */
.logo {
    font-family: 'Orbitron', Arial, sans-serif;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 2px;
}

/* Highlights parts of headings in purple */
.logo span,
h1 span,
h2 span {
    color: var(--cyan);
}

/* Displays the creator name in the top bar */
.creator-name {
    color: #e9d5ff;
    font-family: 'Rajdhani', Arial, sans-serif;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-align: center;
}

/* Styles the online system indicator */
.system-status {
    color: #d8b4fe;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    white-space: nowrap;
}

/* Centers the active game screen */
.game-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: calc(100vh - 145px);
    padding: 50px 20px;
}

/* Hides all game screens until they are activated */
.screen {
    display: none;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    animation: appear 0.5s ease;
}

/* Shows only the active screen */
.screen.active {
    display: block;
}

/* Adds a smooth entrance animation */
@keyframes appear {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Styles the classified access labels */
.tag {
    display: inline-block;
    color: #d8b4fe;
    border: 1px solid var(--border);
    background: rgba(147, 51, 234, 0.08);
    padding: 9px 18px;
    margin-bottom: 25px;
    font-size: 12px;
    letter-spacing: 3px;
}

/* Styles and centers the main game title */
h1 {
    font-family: 'Orbitron', Arial, sans-serif;
    font-size: clamp(38px, 8vw, 88px);
    font-weight: 900;
    letter-spacing: 3px;
    line-height: 1.25;
    margin: 10px 0;
    text-align: center;
    overflow-wrap: anywhere;
    text-shadow: 0 0 35px rgba(168, 85, 247, 0.35);
}

/* Styles headings on the other screens */
h2 {
    font-family: 'Orbitron', Arial, sans-serif;
    font-size: clamp(24px, 5vw, 40px);
    font-weight: 800;
    line-height: 1.4;
    letter-spacing: 1px;
    overflow-wrap: anywhere;
}

/* Styles the game slogan */
.subtitle {
    color: #d8b4fe;
    font-size: 21px;
    font-weight: 600;
    line-height: 1.6;
    letter-spacing: 1px;
}

/* Centers the game description */
.description {
    max-width: 550px;
    margin: 25px auto 35px;
    color: var(--muted);
    font-size: 20px;
    line-height: 1.7;
    text-align: center;
}

/* Centers the nickname input and start button */
.nickname-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
    max-width: 390px;
    margin: 0 auto;
}

/* Styles the nickname label */
.nickname-box label {
    align-self: flex-start;
    color: #d8b4fe;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
}

/* Styles the nickname input field */
input {
    width: 100%;
    padding: 17px;
    background: #1b102d;
    color: #ffffff;
    border: 1px solid #8b5cf6;
    border-radius: 7px;
    font-family: 'Rajdhani', Arial, sans-serif;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    outline: none;
}

/* Adds a purple glow when the input is selected */
input:focus {
    border-color: #d8b4fe;
    box-shadow: 0 0 22px rgba(168, 85, 247, 0.3);
}

/* Styles all main game buttons */
button {
    font-family: 'Orbitron', Arial, sans-serif;
    cursor: pointer;
    border: 0;
    border-radius: 6px;
    background: linear-gradient(110deg, #7e22ce, #b76cf4);
    color: #ffffff;
    padding: 17px 25px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1.5;
    transition: transform 0.2s, box-shadow 0.2s;
}

/* Adds a glowing effect when hovering over buttons */
button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 0 28px rgba(168, 85, 247, 0.4);
}

/* Makes the start button match the nickname field */
#startButton {
    width: 100%;
}

/* Styles outlined secondary buttons */
.secondary-button {
    background: #170e29;
    color: #e9d5ff;
    border: 1px solid #a855f7;
}

/* Styles the small welcome message */
.small-note {
    margin-top: 35px;
    color: var(--muted);
    font-size: 13px;
    letter-spacing: 2px;
}

/* Arranges the three difficulty cards in a row */
.level-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    width: 100%;
    margin: 40px auto 0;
}

/* Styles the difficulty selection cards */
.level-card {
    display: flex;
    flex-direction: column;
    gap: 17px;
    min-width: 0;
    min-height: 230px;
    padding: 25px;
    background: #170f28;
    border: 1px solid var(--border);
    color: var(--white);
    text-align: left;
}

/* Highlights a mission card when hovered */
.level-card:hover {
    background: #27143f;
    border-color: #c084fc;
}

/* Makes mission names stand out */
.level-card strong {
    color: #d8b4fe;
    font-size: 17px;
    overflow-wrap: anywhere;
}

/* Styles the mission number and description */
.level-number,
.level-card small {
    color: var(--muted);
    font-family: 'Rajdhani', Arial, sans-serif;
    font-size: 15px;
    font-weight: 600;
}

/* Places the mission name and timer on opposite sides */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    color: #d8b4fe;
    font-family: 'Orbitron', Arial, sans-serif;
    font-size: 14px;
    margin-bottom: 20px;
}

/* Creates the question progress track */
.progress-track {
    height: 5px;
    background: #261735;
    border-radius: 5px;
    margin-bottom: 25px;
    overflow: hidden;
}

/* Shows how far the player has progressed */
#progressBar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #7e22ce, #e879f9);
    transition: width 0.3s;
}

/* Styles the digital evidence terminal */
.case-panel {
    background: #100a1c;
    border: 1px solid #7133a0;
    border-radius: 10px;
    text-align: left;
    overflow: hidden;
}

/* Styles the evidence terminal heading */
.panel-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 20px;
    background: #26143d;
    color: #e9d5ff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Displays the investigation logs clearly */
#evidence {
    padding: 20px;
    margin: 0;
    color: #f1e5ff;
    font-family: Consolas, monospace;
    font-size: 15px;
    line-height: 1.9;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* Styles the investigation question */
.question-title {
    font-family: 'Rajdhani', Arial, sans-serif;
    font-size: 29px;
    font-weight: 700;
    color: #ffffff;
    margin: 30px 0;
}

/* Arranges answer choices in two columns */
.answer-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

/* Styles the multiple-choice answer buttons */
.answer-options button {
    background: #1a102b;
    border: 1px solid #6d28d9;
    color: #ffffff;
    font-family: 'Rajdhani', Arial, sans-serif;
    font-size: 20px;
    font-weight: 600;
    text-align: left;
    letter-spacing: 0;
}

/* Highlights correct answers in green */
.answer-options button.correct {
    border-color: #36f5a2;
    background: rgba(54, 245, 162, 0.12);
}

/* Highlights incorrect answers in red */
.answer-options button.wrong {
    border-color: #ff637f;
    background: rgba(255, 99, 127, 0.12);
}

/* Prevents answered choices from being selected again */
.answer-options button:disabled {
    cursor: default;
    opacity: 0.85;
}

/* Displays feedback after selecting an answer */
.feedback {
    min-height: 25px;
    margin: 20px 0;
    color: #e9d5ff;
    font-size: 19px;
}

/* Keeps hidden buttons invisible */
[hidden] {
    display: none !important;
}

/* Styles the final result panel */
.result-panel {
    max-width: 550px;
    margin: 30px auto;
    padding: 35px;
    background: #170f28;
    border: 1px solid var(--border);
    border-radius: 12px;
}

/* Displays the final score in large purple text */
.score-number {
    color: #d8b4fe;
    font-family: 'Orbitron', Arial, sans-serif;
    font-size: 65px;
    font-weight: 800;
    text-shadow: 0 0 25px rgba(168, 85, 247, 0.4);
}

/* Centers the result action buttons */
.result-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Styles the certificate panel */
.certificate {
    background: linear-gradient(135deg, #201035, #0d0717);
    border: 2px solid #a855f7;
    padding: 50px 25px;
    margin-bottom: 25px;
    box-shadow: 0 0 35px rgba(168, 85, 247, 0.2);
}

/* Highlights the player's name on the certificate */
.certificate h3 {
    color: #e9d5ff;
    font-family: 'Orbitron', Arial, sans-serif;
    font-size: clamp(22px, 5vw, 36px);
    overflow-wrap: anywhere;
}

/* Styles the creator signature on the certificate */
.certificate-signature {
    margin-top: 45px;
    color: var(--muted);
    font-size: 14px;
    letter-spacing: 2px;
}

/* Centers the copyright at the bottom */
footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 22px 6%;
    color: var(--muted);
    border-top: 1px solid var(--border);
    font-size: 13px;
}

/* Adjusts the design for mobile phones */
@media (max-width: 700px) {
    .topbar {
        flex-wrap: wrap;
        justify-content: center;
        padding: 20px;
        gap: 12px;
    }

    .creator-name {
        width: 100%;
        order: 3;
        font-size: 14px;
    }

    .system-status {
        font-size: 10px;
    }

    .game-container {
        padding: 40px 16px;
    }

    .level-grid,
    .answer-options {
        grid-template-columns: 1fr;
    }

    .level-card {
        min-height: 150px;
    }

    .description {
        font-size: 18px;
    }

    #evidence {
        font-size: 13px;
    }

    .question-title {
        font-size: 24px;
    }

    footer {
        text-align: center;
    }
}

/* Reduces animations when the device requests less motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* Centers the creator credit in the footer */
.footer-content {
    width: 100%;
    text-align: center;
}

/* Styles the creator signature */
.footer-content .creator-name {
    margin: 0 0 7px;
    color: #d8b4fe;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

/* Styles the copyright notice */
.copyright {
    margin: 0;
    color: #a997c1;
    font-size: 12px;
    letter-spacing: 1px;
}

/* Keeps the creator credit centered on mobile */
@media (max-width: 700px) {
    .footer-content .creator-name {
        width: auto;
        font-size: 14px;
    }
}

