/* Fonts hosted here (no Google Fonts): pixel font for titles, Rubik for the text people read */
@font-face { font-family: 'Press Start 2P'; src: url('/web/fonts/press-start-2p-latin-400-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Rubik'; src: url('/web/fonts/rubik-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Rubik'; src: url('/web/fonts/rubik-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }

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

:root {
    --blue-dark: #003369;
    --blue-mid: #0260c3;
    --blue-light: #4a9eff;
    --cyan: #89fffc;
    --white: #ffffff;
    --text-muted: #b5d2ee;
    --font: 'Press Start 2P', monospace;
    --font-text: 'Rubik', system-ui, sans-serif;

    /* Minecraft-like bevel: light top-left, dark bottom-right */
    --bevel-out: inset 4px 4px 0 rgba(255, 255, 255, 0.18), inset -4px -4px 0 rgba(0, 0, 0, 0.35);
    --bevel-in: inset 4px 4px 0 rgba(0, 0, 0, 0.45), inset -4px -4px 0 rgba(255, 255, 255, 0.10);
    --text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.7);
}

body {
    font-family: var(--font);
    background: #000c1a;
    color: var(--white);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    -webkit-font-smoothing: none;
}

#bg {
    position: fixed;
    inset: 0;
    background-image: url('/web/img/bg.png');
    background-size: cover;
    background-position: center;
    filter: blur(6px) brightness(0.55);
    transform: scale(1.05);
    z-index: 0;
}

#app {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 24px 16px;
}

/* ─── The single blue panel ─────────────────────────────── */
.panel {
    width: 100%;
    max-width: 560px;
    padding: 28px 28px 32px;
    background: rgba(2, 60, 130, 0.55);
    border: 4px solid #000;
    box-shadow: var(--bevel-out);
    text-align: center;
}

.logo {
    display: block;
    width: 100%;
    max-width: 440px;
    height: auto;
    margin: 0 auto 28px;
}

/* ─── Start screen ──────────────────────────────────────── */
#start-title:empty {
    display: none;
}

#start-title {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 16px;
    text-shadow: var(--text-shadow);
}

#start-subtitle {
    font-family: var(--font-text);
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 28px;
    text-shadow: var(--text-shadow);
}

/* Minecraft-style button */
.mc-button {
    font-family: var(--font);
    font-size: 16px;
    color: var(--white);
    text-shadow: var(--text-shadow);
    background: var(--blue-mid);
    border: 4px solid #000;
    box-shadow: var(--bevel-out);
    padding: 16px 40px;
    cursor: pointer;
}

.mc-button:hover {
    background: var(--blue-light);
}

.mc-button:active {
    box-shadow: var(--bevel-in);
    padding: 18px 40px 14px;
}

/* ─── Player: head + name + status ──────────────────────── */
.player {
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
    margin-bottom: 20px;
}

#player-avatar {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    image-rendering: pixelated;
    border: 4px solid #000;
    background: rgba(0, 0, 0, 0.3);
}

.player-info {
    min-width: 0;
}

/* rank tag of the resource pack (rank/tag/<rank>.png), above the name: same as stats.craftdisney.com */
.rank-tag {
    display: block;
    height: 27px;
    width: auto;
    margin-bottom: 8px;
    image-rendering: pixelated;
}

#player-name {
    font-size: 16px;
    color: var(--cyan);
    text-shadow: var(--text-shadow);
    margin-bottom: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status {
    display: flex;
    align-items: center;
    gap: 10px;
}

#status-dot {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    background: #888;
    border: 2px solid #000;
    box-sizing: content-box;
}

#status-dot.connected {
    background: #55ff55;
}

#status-dot.error {
    background: #ff5555;
}

#status-text {
    font-family: var(--font-text);
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
    color: var(--text-muted);
    text-shadow: var(--text-shadow);
}

/* ─── VU meter ──────────────────────────────────────────── */
.meter {
    padding: 12px;
    margin-bottom: 20px;
    background: rgba(0, 10, 30, 0.55);
    border: 4px solid #000;
    box-shadow: var(--bevel-in);
}

#waveform {
    display: block;
    width: 100%;
    height: auto;
    image-rendering: pixelated;
}

/* ─── Minecraft-style volume slider (label on the track) ── */
.mc-slider {
    position: relative;
    height: 48px;
    --fill: 60%;
    background: linear-gradient(to right,
        rgba(2, 96, 195, 0.6) var(--fill),
        rgba(0, 10, 30, 0.7) var(--fill));
    border: 4px solid #000;
}

#volume-slider {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    background: transparent;
    cursor: pointer;
    outline: none;
}

#volume-slider::-webkit-slider-runnable-track {
    height: 100%;
    background: transparent;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 40px;
    background: var(--blue-light);
    border: 2px solid #000;
    box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.35), inset -2px -2px 0 rgba(0, 0, 0, 0.35);
    cursor: pointer;
}

#volume-slider::-moz-range-track {
    height: 100%;
    background: transparent;
}

#volume-slider::-moz-range-thumb {
    width: 12px;
    height: 36px;
    border-radius: 0;
    background: var(--blue-light);
    border: 2px solid #000;
    box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.35), inset -2px -2px 0 rgba(0, 0, 0, 0.35);
    cursor: pointer;
}

#volume-slider:focus-visible {
    outline: 2px solid var(--white);
    outline-offset: 2px;
}

#volume-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--white);
    text-shadow: var(--text-shadow);
    pointer-events: none;
}

.hidden {
    display: none !important;
}

/* ─── Invalid / expired link (same block as stats.craftdisney.com) ── */
.box {
    padding: 20px 16px;
    background: rgba(0, 10, 30, 0.55);
    border: 4px solid #000;
    box-shadow: var(--bevel-in);
}
.message .big {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
    text-shadow: var(--text-shadow);
}
.message .sub {
    font-family: var(--font-text);
    -webkit-font-smoothing: antialiased;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-muted);
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.7);
}

/* ─── Small screens ─────────────────────────────────────── */
@media (max-width: 480px) {
    .panel {
        padding: 20px 16px 24px;
    }

    #player-name {
        font-size: 12px;
    }

    #volume-value {
        font-size: 10px;
    }

    #start-subtitle {
        font-size: 14px;
    }

    .rank-tag {
        height: 18px;
    }

    .message .big {
        font-size: 12px;
    }

    .mc-button {
        font-size: 12px;
    }
}
