/* Shared site palette frames a responsive overhead survival arena and accessible HUD. */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.survivor-page {
    max-width: 1500px;
    margin: auto;
    padding: 30px;
}
.game-heading, .heading-actions, .hud, .arena-footer, .weapon-row, .character, .panel-label, .game-tip {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.game-heading {
    margin-bottom: 24px;
    gap: 20px;
}
.section-label, .panel-label {
    font-size: 10px;
    letter-spacing: 2px;
    font-weight: 600;
}
.section-label {
    margin: 0 0 9px;
}
h1 {
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -1px;
    margin: 0 0 7px;
}
.subtitle, .character-description, .controls p, .game-tip p {
    color: var(--site-muted);
    font-size: 12px;
    line-height: 1.8;
    margin: 0;
}
button {
    padding: 11px 16px;
    background: var(--site-raised);
    color: var(--site-text);
    border: 1px solid var(--site-border);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}
button:hover {
    background: var(--site-hover);
    border-color: var(--site-accent);
    color: var(--site-accent);
}
button:disabled {
    opacity: 0.4;
    cursor: default;
}
.heading-actions {
    gap: 10px;
}
kbd {
    background: var(--site-raised);
    color: var(--site-muted);
    border: 1px solid var(--site-border);
    border-bottom-width: 3px;
    border-radius: 4px;
    font-size: 10px;
    padding: 3px 6px;
}
.game-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 282px;
    gap: 20px;
    align-items: stretch;
}
.arena-panel, .run-panel {
    background: var(--site-surface);
    border: 1px solid var(--site-border);
    border-radius: 10px;
    overflow: hidden;
}
.hud {
    padding: 17px 22px;
    gap: 20px;
    border-bottom: 1px solid var(--site-border);
}
.hud span, .arena-footer, .best-section>span {
    font-size: 9px;
    color: var(--site-muted);
    letter-spacing: 1px;
}
.hud strong {
    font-size: 19px;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}
.health-stat {
    display: grid;
    grid-template-columns: minmax(100px, 170px) auto;
    gap: 6px 12px;
}
.health-stat>span {
    grid-column: 1 / -1;
}
.health-track {
    height: 8px;
    background: var(--site-raised);
    border-radius: 3px;
    align-self: center;
    overflow: hidden;
}
#healthFill {
    width: 100%;
    height: 100%;
    background: var(--site-accent);
    transition: width 0.15s;
}
#healthText {
    font-size: 10px;
}
.time-stat, .kill-stat {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.canvas-wrap {
    height: min(65vh, 680px);
    min-height: 400px;
    position: relative;
    overflow: hidden;
    background: var(--site-bg);
}
canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    outline-offset: -3px;
}
.arena-label, .wave-label {
    position: absolute;
    top: 20px;
    color: var(--site-muted);
    font-size: 8px;
    letter-spacing: 1.8px;
    pointer-events: none;
}
.arena-label {
    left: 20px;
}
.arena-label>span {
    margin-right: 7px;
}
.wave-label {
    right: 20px;
    color: var(--site-accent);
}
.live-light {
    display: inline-block;
    height: 5px;
    width: 5px;
    background: var(--site-accent);
    border-radius: 50%;
}
.xp-strip {
    height: 4px;
    background: var(--site-raised);
}
#xpFill {
    background: var(--site-accent);
    height: 100%;
    width: 0;
    transition: width 0.15s;
}
.arena-footer {
    padding: 14px 20px;
}
.arena-footer>span {
    display: flex;
    gap: 14px;
    align-items: center;
}
.arena-footer b {
    color: var(--site-accent);
    font-size: 10px;
}
#xpText, #enemyCount {
    letter-spacing: 0;
}
.run-panel {
    padding: 22px;
}
.side-section {
    border-bottom: 1px solid var(--site-border);
    padding-bottom: 20px;
    margin-bottom: 20px;
}
.panel-label {
    color: var(--site-muted);
    margin-bottom: 18px;
    font-size: 9px;
    letter-spacing: 1.5px;
}
.panel-label>span {
    opacity: 0.5;
}
.character {
    gap: 12px;
    margin-bottom: 12px;
}
.character-icon, .weapon-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    background: var(--site-raised);
    border: 1px solid var(--site-border);
    color: var(--site-accent);
    border-radius: 6px;
    font-size: 23px;
    flex-shrink: 0;
}
.character h2 {
    font-size: 14px;
    margin: 0 0 4px;
}
.character p {
    font-size: 10px;
    color: var(--site-muted);
    margin: 0;
}
.class-tag {
    color: var(--site-accent);
    font-size: 7px;
    letter-spacing: 1px;
    margin-left: auto;
}
.character-description {
    font-size: 11px;
}
.weapon-row {
    gap: 10px;
    margin-top: 13px;
}
.weapon-icon {
    width: 30px;
    height: 30px;
    font-size: 18px;
}
.weapon-row strong, .weapon-row small {
    display: block;
}
.weapon-row strong {
    font-size: 11px;
    font-weight: 500;
}
.weapon-row small {
    color: var(--site-muted);
    font-size: 9px;
    margin-top: 3px;
}
.weapon-row>span:last-child {
    font-size: 10px;
    color: var(--site-accent);
    margin-left: auto;
}
.attributes {
    margin: 0;
}
.attributes>div {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 11px;
}
.attributes dt {
    color: var(--site-muted);
    font-weight: 400;
}
.attributes dd {
    margin: 0;
    font-variant-numeric: tabular-nums;
}
.key-groups {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 13px;
    margin-bottom: 12px;
    text-align: center;
}
.key-groups>span {
    font-size: 9px;
    color: var(--site-muted);
}
.key-groups>div>div {
    display: flex;
    gap: 4px;
    margin-top: 7px;
}
.controls p {
    text-align: center;
    font-size: 10px;
    margin-top: 8px;
}
.best-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
.best-section strong {
    color: var(--site-accent);
    font-size: 16px;
    font-weight: 400;
}
.best-section small {
    flex-basis: 100%;
    margin-top: 5px;
    color: var(--site-muted);
    font-size: 9px;
}
.screen-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--site-bg) 70%, transparent);
    backdrop-filter: blur(3px);
    padding: 22px;
    overflow: auto;
}
.screen-overlay[hidden], [hidden] {
    display: none !important;
}
.overlay-card {
    max-width: 440px;
    width: 100%;
    padding: 30px;
    background: var(--site-surface);
    border: 1px solid var(--site-border);
    border-radius: 10px;
    box-shadow: 0 20px 60px #0005;
}
.overlay-card h2 {
    font-size: 32px;
    line-height: 1.15;
    letter-spacing: -1px;
    margin: 14px 0;
}
#overlayDescription {
    color: var(--site-muted);
    font-size: 12px;
    line-height: 1.9;
}
.primary-action {
    width: 100%;
    background: var(--site-accent);
    color: var(--site-bg);
    border-color: var(--site-accent);
    margin-top: 10px;
    font-weight: 600;
}
.primary-action span {
    float: right;
}
.secondary-action {
    width: 100%;
    margin-top: 10px;
}
.overlay-foot {
    color: var(--site-muted);
    letter-spacing: 1.5px;
    font-size: 8px;
    text-align: center;
    margin: 20px 0 0;
}
#choices {
    display: grid;
    gap: 10px;
}
.upgrade-choice {
    text-align: left;
    padding: 14px;
    display: block;
    width: 100%;
}
.upgrade-choice strong {
    display: block;
    color: var(--site-accent);
    font-size: 13px;
    margin-bottom: 4px;
}
.upgrade-choice small {
    color: var(--site-muted);
    font-size: 11px;
}
.game-tip {
    gap: 15px;
    margin-top: 20px;
    padding: 18px 22px;
    border: 1px solid var(--site-border);
    background: var(--site-surface);
    border-radius: 8px;
}
.game-tip>span:first-child {
    color: var(--site-accent);
    font-size: 25px;
}
.game-tip strong {
    color: var(--site-text);
    font-weight: 500;
    margin-right: 5px;
}
#runHint {
    color: var(--site-muted);
    font-size: 8px;
    letter-spacing: 1px;
    white-space: nowrap;
}
dialog {
    background: var(--site-surface);
    color: var(--site-text);
    border: 1px solid var(--site-border);
    border-radius: 10px;
    width: calc(100% - 32px);
    max-width: 530px;
    margin: auto;
    padding: 30px;
}
dialog::backdrop {
    background: #0009;
}
dialog p {
    font-size: 13px;
    line-height: 1.8;
    color: var(--site-muted);
}
.close-help {
    float: right;
    padding: 0 6px;
    border: 0;
    font-size: 23px;
}
.touch-pad {
    display: none;
    position: absolute;
    bottom: 26px;
    left: 26px;
    width: 100px;
    height: 100px;
    border: 1px solid var(--site-accent);
    background: color-mix(in srgb, var(--site-raised) 70%, transparent);
    border-radius: 50%;
    touch-action: none;
}
#touchKnob {
    position: absolute;
    width: 36px;
    height: 36px;
    left: 31px;
    top: 31px;
    background: var(--site-accent);
    border-radius: 50%;
    opacity: 0.6;
    pointer-events: none;
}
@media (pointer: coarse) {
    .touch-pad {
        display: block;
    }
}
@media (max-width: 1000px) {
    .survivor-page {
        padding: 20px;
    }
    .game-layout {
        grid-template-columns: minmax(0, 1fr) 240px;
        gap: 15px;
    }
    .run-panel {
        padding: 16px;
    }
    .class-tag, #runHint {
        display: none;
    }
}
@media (max-width: 720px) {
    .survivor-page {
        padding: 15px;
    }
    h1 {
        font-size: 24px;
    }
    .heading-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .heading-actions button {
        font-size: 10px;
        padding: 8px;
    }
    .game-layout {
        grid-template-columns: 1fr;
    }
    .canvas-wrap {
        height: 65vh;
        min-height: 440px;
    }
    .hud {
        padding: 12px;
        gap: 10px;
    }
    .health-stat {
        grid-template-columns: 80px auto;
    }
    .run-panel {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    .side-section {
        margin-bottom: 0;
    }
    .overlay-card {
        padding: 22px;
    }
    .overlay-card h2 {
        font-size: 27px;
    }
    .arena-label {
        font-size: 7px;
        left: 12px;
    }
    .wave-label {
        font-size: 7px;
        right: 12px;
    }
}
:fullscreen .canvas-wrap {
    height: calc(100dvh - 125px);
}
/* Keep touch movement beneath menus while labels remain visible over the canvas. */
.arena-label, .wave-label {
    z-index: 1;
}
.touch-pad {
    z-index: 2;
}
.screen-overlay {
    z-index: 3;
}
