/* ---------- FONTS (files in fonts/) ---------- */

@font-face {
    font-family: 'Barlow';
    src: url('fonts/barlow-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Barlow';
    src: url('fonts/barlow-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Barlow';
    src: url('fonts/barlow-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Big Shoulders Display';
    src: url('fonts/big-shoulders-display.woff2') format('woff2');
    font-weight: 700 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Share Tech Mono';
    src: url('fonts/share-tech-mono.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ---------- BASICS ---------- */

:root {
    --bg0: #050b09;
    --bg2: #0d1f16;
    --amber: #e8b53a;
    --hot: #f08a24;
    --gold: #f6dc8f;
    --ink: #f3efe2;
}

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

html,
body {
    height: 100%;
    overflow: hidden;
    background: var(--bg0);
    color: var(--ink);
    font-family: Barlow,system-ui,sans-serif;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

canvas {
    display: block;
}

.display {
    font-family: 'Big Shoulders Display',Impact,sans-serif;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ---------- START SCREEN ---------- */

#intro {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow: auto;
    background: linear-gradient(180deg,rgba(5,11,9,.55),rgba(5,11,9,.94)),url('textures/intro.jpg') center/cover;
    transition: opacity 1.2s;
}

#intro.gone {
    opacity: 0;
    pointer-events: none;
}

.panel {
    width: min(720px,100%);
    text-align: center;
    margin: auto;
}

.kicker {
    font-family: 'Share Tech Mono',monospace;
    letter-spacing: .35em;
    font-size: 12px;
    color: var(--amber);
    text-transform: uppercase;
}

h1 {
    font-size: clamp(44px,10vw,92px);
    line-height: .92;
    margin: 10px 0 6px;
    color: var(--gold);
    text-shadow: 0 4px 30px rgba(0,0,0,.8);
}

.lead {
    max-width: 52ch;
    margin: 0 auto 22px;
    line-height: 1.55;
    opacity: .9;
}

.bar {
    height: 6px;
    background: rgba(255,255,255,.14);
    border-radius: 9px;
    overflow: hidden;
    margin: 0 auto 8px;
    max-width: 420px;
}

.bar i {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg,var(--hot),var(--gold));
    transition: width .25s;
}

#status {
    font-family: 'Share Tech Mono',monospace;
    font-size: 12px;
    opacity: .75;
    min-height: 18px;
    margin-bottom: 16px;
}

/* ---------- BUTTONS ---------- */

.btn {
    font-family: 'Big Shoulders Display',Impact,sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 22px;
    border: 0;
    border-radius: 999px;
    padding: 14px 34px;
    cursor: pointer;
    background: linear-gradient(180deg,var(--gold),var(--amber) 55%,var(--hot));
    color: #1a0e02;
    box-shadow: 0 8px 30px rgba(240,138,36,.35);
    margin: 5px;
}

a.btn {
    display: inline-block;
    text-decoration: none;
}

.btn[disabled] {
    opacity: .4;
    cursor: default;
    box-shadow: none;
}

.btn.ghost {
    background: transparent;
    color: var(--gold);
    border: 2px solid var(--amber);
    box-shadow: none;
    font-size: 18px;
}

/* ---------- CONTROLS HELP ---------- */

.keys {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(190px,1fr));
    gap: 10px;
    margin: 22px 0 14px;
    text-align: left;
}

.keys div {
    border: 1px solid rgba(232,181,58,.28);
    border-radius: 10px;
    padding: 10px 12px;
    background: rgba(13,31,22,.65);
    font-size: 13px;
    line-height: 1.5;
}

.keys b {
    display: block;
    color: var(--amber);
    font-size: 14px;
    letter-spacing: .06em;
}

.fine {
    font-size: 11px;
    opacity: .6;
    margin-top: 12px;
    line-height: 1.5;
}

/* ---------- ON-SCREEN DISPLAY ---------- */

#hud {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    display: none;
}

#hud.on {
    display: block;
}

#cross {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    margin: -4px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,.75);
    transition: transform .15s,border-color .15s;
}

#cross.hot {
    transform: scale(2.4);
    border-color: var(--amber);
}

#prompt {
    position: absolute;
    left: 50%;
    top: calc(50% + 34px);
    transform: translateX(-50%);
    background: rgba(5,11,9,.78);
    border: 1px solid var(--amber);
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 14px;
    white-space: nowrap;
    max-width: 92vw;
    overflow: hidden;
    text-overflow: ellipsis;
    display: none;
}

#caption {
    position: absolute;
    left: 50%;
    bottom: 9%;
    transform: translateX(-50%);
    width: min(640px,92vw);
    text-align: center;
    font-size: 18px;
    text-shadow: 0 2px 12px #000;
    opacity: 0;
    transition: opacity .6s;
}

#caption.on {
    opacity: 1;
}

#zone {
    position: absolute;
    left: 18px;
    top: 14px;
    font-size: 22px;
    color: var(--gold);
    text-shadow: 0 2px 10px #000;
}

#zone small {
    display: block;
    font-family: 'Share Tech Mono',monospace;
    font-size: 11px;
    letter-spacing: .2em;
    color: var(--ink);
    opacity: .7;
    text-transform: none;
}

#tools {
    position: absolute;
    right: 14px;
    top: 14px;
    display: flex;
    gap: 8px;
    pointer-events: auto;
}

#tools button {
    background: rgba(5,11,9,.7);
    color: var(--gold);
    border: 1px solid var(--amber);
    border-radius: 999px;
    padding: 7px 14px;
    font: 600 13px Barlow,sans-serif;
    cursor: pointer;
}

/* ---------- PLACES MENU ---------- */

#places {
    position: absolute;
    right: 14px;
    top: 58px;
    width: 240px;
    max-height: calc(100% - 76px);
    overflow: auto;
    pointer-events: auto;
    display: grid;
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--amber);
    border-radius: 14px;
    background: rgba(5,11,9,.92);
}

#places[hidden] {
    display: none;
}

#places button {
    display: flex;
    gap: 10px;
    align-items: center;
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: 8px;
    padding: 8px 10px;
    color: var(--ink);
    font: 600 14px Barlow,sans-serif;
    cursor: pointer;
}

#places button:hover,
#places button:focus-visible {
    background: var(--bg2);
    color: var(--gold);
}

#places b {
    font-family: 'Share Tech Mono',monospace;
    color: var(--amber);
    width: 1ch;
}

/* ---------- PHONE JOYSTICK ---------- */

#stick {
    position: absolute;
    width: 110px;
    height: 110px;
    margin: -55px;
    border-radius: 50%;
    border: 2px solid rgba(246,220,143,.5);
    display: none;
}

#stick i {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 46px;
    height: 46px;
    margin: -23px;
    border-radius: 50%;
    background: rgba(246,220,143,.45);
}

/* ---------- SMALL SCREENS ---------- */

@media (max-width:640px) {
    #tools button {
        padding: 6px 10px;
        font-size: 12px;
    }

    #zone {
        font-size: 17px;
    }

    #prompt {
        top: calc(50% + 28px);
        font-size: 13px;
    }
}
