:root {
    --player-hue: 32;
    --panel: rgba(11, 17, 21, 0.82);
    --panel-border: rgba(255, 255, 255, 0.1);
    --text: #f4f7f8;
    --muted: rgba(223, 231, 231, 0.74);
    --font-title: Georgia, "Palatino Linotype", "Book Antiqua", serif;
    --font-body: "Trebuchet MS", Verdana, sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    color: var(--text);
    font-family: var(--font-body);
    user-select: none;
    -webkit-user-select: none;
    background:
        radial-gradient(circle at top left, rgba(255, 179, 71, 0.18), transparent 28%),
        radial-gradient(circle at bottom, hsla(var(--player-hue), 100%, 64%, 0.16), transparent 38%),
        linear-gradient(180deg, #19252d, #10181d 54%, #070a0c);
}

body {
    min-height: 100dvh;
}

.shell {
    min-height: 100dvh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    overflow: hidden;
}

.topline,
.player-card,
.stat-card,
.touch-pad,
.action-button,
.meta-card,
.pulse-banner {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(18px);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.38);
}

.topline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 24px;
}

.eyebrow,
.meta-label {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 11px;
    color: hsla(var(--player-hue), 100%, 76%, 0.94);
}

.topline h1 {
    margin: 4px 0 0;
    font-family: var(--font-title);
    font-size: clamp(28px, 7vw, 46px);
    line-height: 0.95;
}

#resetBtn {
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    font: inherit;
    font-weight: 700;
    color: #10161a;
    background: linear-gradient(135deg, #ffcf80, #ffb347);
    box-shadow: 0 14px 28px rgba(255, 179, 71, 0.28);
}

.player-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 20px;
}

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

.player-glow {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: hsl(var(--player-hue), 100%, 64%);
    box-shadow: 0 0 28px hsla(var(--player-hue), 100%, 64%, 0.58);
}

.player-name {
    font-size: clamp(18px, 5vw, 24px);
    font-weight: 700;
    line-height: 1.1;
}

.status-text {
    color: var(--muted);
    font-size: 13px;
}

.mode-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    text-align: right;
}

.mode-value,
.stat-card strong,
.action-copy {
    font-family: var(--font-title);
    font-weight: 800;
}

.mode-value {
    font-size: clamp(22px, 7vw, 34px);
    color: hsl(var(--player-hue), 100%, 74%);
}

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

.stat-card,
.meta-card {
    padding: 12px 14px;
    border-radius: 18px;
}

.stat-card strong {
    display: block;
    margin-top: 5px;
    font-size: clamp(18px, 5vw, 28px);
    color: #fff2d6;
}

.controls-shell {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, 0.42fr);
    gap: 12px;
    min-height: 0;
}

.touch-pad {
    position: relative;
    min-height: 0;
    border-radius: 28px;
    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(110px, 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);
}

.action-button {
    display: grid;
    place-items: center;
    border-radius: 30px;
    border-width: 1px;
    color: inherit;
    font: inherit;
    overflow: hidden;
    touch-action: none;
    background:
        radial-gradient(circle at center, hsla(var(--player-hue), 100%, 74%, 0.24), rgba(255, 255, 255, 0.04) 34%, rgba(4, 8, 15, 0.96) 100%);
}

.action-copy {
    font-size: clamp(34px, 8vw, 56px);
    letter-spacing: 0.04em;
    color: hsl(var(--player-hue), 100%, 78%);
}

.action-button.active {
    transform: scale(0.985);
    box-shadow:
        0 18px 44px rgba(0, 0, 0, 0.42),
        0 0 38px hsla(var(--player-hue), 100%, 74%, 0.26);
}

.footer-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.meta-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.pulse-banner {
    padding: 10px 16px;
    border-radius: 999px;
    text-align: center;
    color: hsl(var(--player-hue), 100%, 78%);
    transition: transform 180ms ease;
}

.pulse-banner.flash {
    transform: scale(1.03);
}

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

    .topline,
    .player-card {
        padding: 10px 12px;
        border-radius: 18px;
    }

    .topline h1 {
        font-size: clamp(24px, 6vw, 34px);
    }

    #resetBtn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .player-glow {
        width: 32px;
        height: 32px;
    }

    .player-name {
        font-size: 17px;
    }

    .status-text {
        font-size: 12px;
    }

    .mode-value {
        font-size: clamp(18px, 6vw, 28px);
    }

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

    .stat-card,
    .meta-card {
        padding: 9px 10px;
        border-radius: 15px;
    }

    .stat-card strong {
        margin-top: 4px;
        font-size: clamp(15px, 4.8vw, 22px);
    }

    .controls-shell {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(150px, 1fr) clamp(96px, 16dvh, 132px);
        gap: 8px;
    }

    .touch-pad,
    .action-button {
        border-radius: 24px;
    }

    .action-copy {
        font-size: clamp(24px, 7vw, 40px);
    }

    .pulse-banner {
        padding: 8px 12px;
        font-size: 13px;
    }

    .pad-copy {
        bottom: 10px;
        font-size: 11px;
        width: calc(100% - 20px);
    }
}

@media (max-width: 760px) and (max-height: 760px) {
    .shell {
        padding: 8px;
        gap: 6px;
    }

    .topline,
    .player-card {
        padding: 9px 10px;
    }

    .eyebrow,
    .meta-label {
        font-size: 9px;
        letter-spacing: 0.14em;
    }

    .topline h1 {
        font-size: 22px;
    }

    .player-name {
        font-size: 16px;
    }

    .status-text {
        font-size: 11px;
    }

    .stats-grid {
        gap: 6px;
    }

    .stat-card,
    .meta-card {
        padding: 7px 8px;
    }

    .stat-card strong {
        font-size: 14px;
    }

    .controls-shell {
        grid-template-rows: minmax(136px, 1fr) 92px;
        gap: 6px;
    }

    .pad-copy {
        display: none;
    }

    .action-copy {
        font-size: 22px;
    }

    .footer-stack {
        gap: 6px;
    }

    .pulse-banner {
        padding: 7px 10px;
        font-size: 12px;
    }
}
