:root {
    --player-hue: 52;
    --bg-0: #080d18;
    --bg-1: #111c31;
    --text: #edf4ff;
    --muted: #9bb0d1;
    --panel: rgba(13, 21, 36, 0.84);
    --border: rgba(132, 178, 255, 0.2);
    --glow: hsla(var(--player-hue), 95%, 64%, 0.42);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at top, rgba(255, 222, 89, 0.15), transparent 28%),
        radial-gradient(circle at bottom, rgba(95, 156, 255, 0.18), transparent 30%),
        linear-gradient(180deg, var(--bg-1), var(--bg-0));
    color: var(--text);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

body {
    display: flex;
    justify-content: center;
    min-height: 100dvh;
}

.shell {
    width: min(460px, 100vw);
    min-height: 100dvh;
    height: 100dvh;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

.topline,
.player-card,
.stat-card,
.pulse-banner,
.touch-pad {
    border: 1px solid var(--border);
    background: var(--panel);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
}

.topline,
.player-card,
.touch-pad {
    border-radius: 24px;
}

.topline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
}

.eyebrow,
.meta-label {
    color: #7fdfff;
    font-size: 0.75rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.topline h1 {
    margin: 8px 0 0;
    font-size: 2rem;
    line-height: 0.92;
}

#resetBtn {
    border: none;
    border-radius: 999px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font: inherit;
}

.player-card {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 16px 18px;
}

.player-badge {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.player-glow {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: hsl(var(--player-hue), 95%, 62%);
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.03), 0 0 26px var(--glow);
}

.player-name {
    font-size: 1.14rem;
    font-weight: 700;
}

.status-text,
.meta-value {
    color: var(--muted);
    font-size: 0.92rem;
}

.meta-box {
    text-align: right;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.stat-card {
    border-radius: 18px;
    padding: 14px 16px;
}

.stat-card strong {
    display: block;
    margin-top: 7px;
    font-size: 1.12rem;
}

.touch-pad {
    position: relative;
    flex: 1 1 auto;
    min-height: 240px;
    width: min(calc(100vw - 24px), calc(100dvh - 350px));
    max-width: 420px;
    aspect-ratio: 1 / 1;
    align-self: center;
    overflow: hidden;
    touch-action: none;
    background:
        radial-gradient(circle at center, hsla(var(--player-hue), 86%, 60%, 0.2), rgba(14, 20, 36, 0.2) 40%, rgba(3, 7, 14, 0.94) 100%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
}

.pad-aura,
.pad-grid,
.pad-ring {
    position: absolute;
    inset: 0;
}

.pad-aura {
    background: radial-gradient(circle at center, hsla(var(--player-hue), 100%, 70%, 0.24), transparent 50%);
}

.pad-grid {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 20% 20%;
    mask-image: radial-gradient(circle at center, black 32%, transparent 76%);
}

.pad-ring {
    inset: 10%;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.touch-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(120px, 28%);
    aspect-ratio: 1;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.14) 35%, hsl(var(--player-hue), 92%, 58%) 100%);
    box-shadow:
        inset 0 3px 14px rgba(255, 255, 255, 0.34),
        0 18px 34px rgba(0, 0, 0, 0.36),
        0 0 32px hsla(var(--player-hue), 96%, 62%, 0.45);
    transition: transform 70ms linear;
}

.pad-copy {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.05em;
    text-align: center;
    width: calc(100% - 28px);
}

.pulse-banner {
    border-radius: 18px;
    padding: 14px 16px;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
}

.pulse-banner.flash {
    animation: pulseFlash 220ms ease;
}

@keyframes pulseFlash {
    0% {
        transform: scale(0.98);
        box-shadow: 0 0 0 0 var(--glow);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 16px rgba(255, 255, 255, 0);
    }
}

@media (max-width: 420px) {
    .shell {
        padding: 10px;
        gap: 8px;
    }

    .player-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .meta-box {
        text-align: left;
    }

    .touch-pad {
        width: min(calc(100vw - 20px), calc(100dvh - 320px));
        min-height: 220px;
    }
}

@media (max-height: 760px) {
    .touch-pad {
        width: min(calc(100vw - 24px), calc(100dvh - 330px));
    }
}
