:root {
    --ink: #f4f1ea;
    --muted: #a9abb3;
    --violet: #907cff;
    --cyan: #78e0dc;
    --panel: rgba(29, 30, 43, .88);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0 24px;
    color: var(--ink);
    font-family: 'Space Grotesk', sans-serif;
    background: linear-gradient(135deg, #11121b 0%, #1b1830 52%, #103336 100%);
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .24;
    background-image: radial-gradient(rgba(255, 255, 255, .32) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(to bottom, black, transparent 72%);
}

.site-header,
.game-main,
.welcome-main,
.site-footer {
    position: relative;
    z-index: 1;
}

.site-header {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 38px 0 26px;
    display: flex;
    align-items: center;
    gap: 15px;
    animation: rise-in .7s ease both;
}

.brand-mark {
    width: 82px;
    height: 82px;
    border: 1px solid rgba(120, 224, 220, .7);
    color: var(--cyan);
    display: grid;
    place-items: center;
    font: 500 12px 'DM Mono', monospace;
    background-image: url("../../img/logo.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100%;
}

.eyebrow {
    margin: 0 0 5px;
    color: var(--cyan);
    font: 500 10px 'DM Mono', monospace;
    letter-spacing: 1px;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: clamp(2.8rem, 8vw, 5rem);
    line-height: .85;
}

.game-main,
.welcome-main {
    width: min(100%, 760px);
    margin: 0 auto;
    flex: 1;
}

.game-intro {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.game-intro h2 {
    max-width: 78%;
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.3;
    font-weight: 500;
}

.status-dot {
    color: var(--cyan);
    font: 500 10px 'DM Mono', monospace;
}

.status-dot::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 7px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 12px var(--cyan);
}

#wrapper {
    width: min(100%, 600px);
    margin: 0 auto;
    padding: 8px;
    background: rgba(10, 10, 17, .5);
    border: 1px solid rgba(255, 255, 255, .16);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .3);
}

#mon_canvas {
    display: block;
    width: 100%;
    height: auto;
    border: 0;
}

.welcome-main {
    display: grid;
    place-items: center;
}

.welcome-panel {
    width: min(100%, 520px);
    padding: clamp(30px, 7vw, 58px);
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
    animation: rise-in .8s .1s ease both;
}

.welcome-panel h2 {
    max-width: 360px;
    margin-bottom: 14px;
    font-size: clamp(2rem, 7vw, 3.4rem);
    line-height: .98;
}

.welcome-copy {
    max-width: 370px;
    color: var(--muted);
    line-height: 1.55;
}

form {
    margin-top: 34px;
}

label {
    display: block;
    margin-bottom: 9px;
    color: var(--muted);
    font-size: .9rem;
}

.name-input {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #555666;
    transition: border-color .2s;
}

.name-input:focus-within {
    border-color: var(--cyan);
}

input[type=text] {
    width: 100%;
    padding: 12px 0;
    color: var(--ink);
    font: 500 1.1rem 'Space Grotesk', sans-serif;
    background: transparent;
    border: 0;
    outline: 0;
}

input::placeholder {
    color: #686a78;
}

.name-input span {
    color: #686a78;
    font: 10px 'DM Mono', monospace;
}

button {
    width: 100%;
    margin-top: 25px;
    padding: 15px 18px;
    color: #151522;
    font: 600 .95rem 'Space Grotesk', sans-serif;
    border: 0;
    background: linear-gradient(100deg, var(--cyan), var(--violet));
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
}

button:hover,
button:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(120, 224, 220, .2);
}

button span {
    margin-left: 8px;
    font-size: 1.2rem;
}

.site-footer {
    padding: 28px 0 24px;
    color: #777987;
    text-align: center;
    font: 10px 'DM Mono', monospace;
}

#debug {
    display: none;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 640px) {
    body {
        padding: 0 15px;
    }

    .site-header {
        padding-top: 26px;
    }

    .game-intro {
        margin-bottom: 10px;
        gap: 12px;
    }

    .game-intro h2 {
        max-width: 70%;
        font-size: .82rem;
    }

    .status-dot {
        white-space: nowrap;
        font-size: 9px;
    }

    #wrapper {
        padding: 4px;
    }

    .welcome-panel {
        padding: 32px 24px;
    }

    .site-footer {
        padding-bottom: 18px;
    }
}