@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Space+Mono:wght@400;700&family=Space+Grotesk:wght@400;500;700&display=swap');

:root {
    --background: #101b2b;
    --panel: #1b2b40;
    --blue: #4e91ce;
    --yellow: #f9d66b;
    --green: #79d58b;
    --white: #f2f3e9;
    --muted: #a3b3c5;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    background: var(--background);
    color: var(--white);
    font-family: 'Space Grotesk', sans-serif;
}

button {
    cursor: pointer;
    font-family: inherit;
}

/* LANDING */

.landing {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    background:
        radial-gradient(circle at 50% 30%, #28496b 0%, transparent 45%),
        linear-gradient(145deg, #101b2b, #142b37);
}

.landing-content {
    width: min(650px, 100%);
    text-align: center;
}

.eyebrow,
.section-label {
    font: 10px 'Space Mono', monospace;
    color: var(--yellow);
    letter-spacing: 2px;
}

.pixel-logo {
    width: 100px;
    height: 100px;
    margin: 35px auto;
    display: grid;
    place-items: center;
    background: var(--blue);
    color: white;
    border: 6px solid #8fc1eb;
    outline: 4px solid #172f47;
    font: 27px 'Press Start 2P', monospace;
    image-rendering: pixelated;
}

.landing h1 {
    font-size: clamp(30px, 6vw, 53px);
    line-height: 1.3;
    letter-spacing: -2px;
}

.landing h1 span {
    color: var(--yellow);
}

.description {
    max-width: 510px;
    margin: 25px auto;
    line-height: 1.8;
    color: var(--muted);
}

.landing-stats {
    display: flex;
    justify-content: center;
    gap: 45px;
    margin: 35px 0;
}

.landing-stats div {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.landing-stats strong {
    font-size: 25px;
    color: var(--green);
}

.landing-stats span {
    font: 9px 'Space Mono', monospace;
    color: var(--muted);
}

#enter-world,
.primary-button {
    background: var(--yellow);
    border: 3px solid #fff0a7;
    padding: 16px 28px;
    color: #263247;
    font-weight: 700;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    box-shadow: 0 5px 0 #a78a35;
    transition: .2s;
}

#enter-world:hover,
.primary-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 0 #a78a35;
}

.landing-content>a {
    display: block;
    margin-top: 30px;
    font: 11px 'Space Mono', monospace;
    color: var(--green);
    text-decoration: none;
}

.landing-footer {
    display: block;
    margin-top: 70px;
    color: #64788e;
    font: 9px 'Space Mono', monospace;
}

/* GAME */

.game-screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
    max-width: 1500px;
    margin: auto;
}

.game-screen.active {
    display: block;
}

.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 15px 20px;
    margin-bottom: 20px;
    background: var(--panel);
    border: 2px solid #344b64;
}

.game-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    background: var(--blue);
    font-weight: bold;
    border: 3px solid #8fc1eb;
}

.game-brand strong,
.game-brand small {
    display: block;
}

.game-brand strong {
    font-size: 13px;
}

.game-brand small {
    color: var(--yellow);
    font: 9px 'Space Mono', monospace;
    margin-top: 4px;
}

.player-location {
    color: var(--green);
    font: 10px 'Space Mono', monospace;
}

.online-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--green);
    border-radius: 50%;
    margin-right: 8px;
}

#back-home {
    background: transparent;
    border: 1px solid #526b84;
    color: var(--white);
    padding: 10px;
    font-size: 10px;
}

.game-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 20px;
    align-items: start;
}

.game-wrapper {
    min-width: 0;
    background: #182b34;
    border: 3px solid #344b64;
    padding: 8px;
}

#game-container {
    width: 100%;
    aspect-ratio: 4 / 3;
    max-height: 700px;
    overflow: hidden;
    background: #77b76b;
}

#game-container canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}

.game-help {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 5px 4px;
    font: 9px 'Space Mono', monospace;
    color: var(--yellow);
}

.game-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-section {
    padding: 17px;
    background: var(--panel);
    border: 2px solid #344b64;
}

.sidebar-section .section-label {
    display: block;
    margin-bottom: 14px;
}

.trainer-avatar {
    width: 48px;
    height: 48px;
    background: var(--blue);
    border: 3px solid #8fc1eb;
    display: grid;
    place-items: center;
    font-weight: bold;
    margin-bottom: 12px;
}

.sidebar-section h2 {
    font-size: 17px;
}

.sidebar-section>p {
    color: var(--muted);
    font-size: 12px;
    margin-top: 5px;
}

.role-tag {
    display: inline-block;
    margin-top: 12px;
    color: var(--yellow);
    font: 9px 'Space Mono', monospace;
}

.quest-description {
    line-height: 1.6;
}

#quest-progress {
    margin-top: 14px;
    font: 9px 'Space Mono', monospace;
    color: var(--green);
}

.progress-track {
    height: 7px;
    background: #0e1928;
    margin-top: 8px;
}

#progress-bar {
    width: 0;
    height: 100%;
    background: var(--green);
    transition: width .3s;
}

.key-row {
    display: flex;
    justify-content: space-between;
    margin: 12px 0;
    font: 10px 'Space Mono', monospace;
}

.key-row small {
    color: var(--muted);
}

#discoveries {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.discovery {
    color: var(--muted);
    font-size: 11px;
}

.discovery.found {
    color: var(--green);
}

/* MODAL */

.modal {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(5, 12, 23, .85);
}

.modal.active {
    display: flex;
}

.modal-window {
    position: relative;
    width: min(600px, 100%);
    max-height: 85vh;
    overflow-y: auto;
    background: #1b2b40;
    border: 4px solid #719dc0;
    outline: 3px solid #0a1522;
    padding: 30px;
    box-shadow: 0 15px 50px #0008;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
}

.modal-window h2 {
    margin: 20px 0;
    color: var(--yellow);
    font-size: 24px;
}

.modal-window p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 12px;
}

.info-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
}

.info-tag {
    padding: 8px;
    border: 1px solid #5c7893;
    color: var(--green);
    font: 10px 'Space Mono', monospace;
}

.modal-project {
    padding: 15px;
    margin: 15px 0;
    border: 1px solid #526b84;
}

.modal-project h3 {
    color: var(--yellow);
    margin-bottom: 10px;
}

.modal-project a {
    display: inline-block;
    margin-top: 8px;
    color: var(--green);
    font-size: 12px;
}

.primary-button {
    width: 100%;
    margin-top: 20px;
    font-size: 9px;
}

@media(max-width: 900px) {
    .game-layout {
        grid-template-columns: 1fr;
    }

    .game-sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media(max-width: 550px) {
    .game-screen {
        padding: 8px;
    }

    .game-header {
        padding: 10px;
        flex-wrap: wrap;
    }

    .player-location {
        order: 3;
        width: 100%;
    }

    .game-sidebar {
        grid-template-columns: 1fr;
    }

    .landing-stats {
        gap: 25px;
    }

    .landing-stats strong {
        font-size: 20px;
    }

    .modal-window {
        padding: 25px 18px;
    }

    .game-help {
        font-size: 8px;
    }
}