:root {
    --hwc-green: #42ff88;
    --hwc-green-dark: #0ca653;
    --hwc-green-soft: rgba(66, 255, 136, 0.15);
    --hwc-black: #050807;
    --hwc-panel: rgba(7, 13, 10, 0.88);
    --hwc-panel-light: rgba(15, 25, 20, 0.9);
    --hwc-border: rgba(128, 255, 178, 0.25);
    --hwc-text: #f4fff8;
    --hwc-muted: #a7b9ad;
    --hwc-warning: #ffcc55;
    --hwc-danger: #ff625d;
}

.hwc-game-page {
    width: 100%;
    margin: 0;
    padding: 0;
    background: #030504;
}

.hwc-game-shell {
    width: 100%;
    margin: 0;
    padding: 0;
}

.hwc-game-container {
    position: relative;
    width: 100%;
    height: min(82vh, 920px);
    min-height: 620px;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(circle at 50% 20%, #173226 0%, #07100c 46%, #020403 100%);
    color: var(--hwc-text);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

.hwc-game-container *,
.hwc-game-container *::before,
.hwc-game-container *::after {
    box-sizing: border-box;
}

#hwc-game-canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    outline: none;
}

.hwc-loading-screen,
.hwc-start-screen,
.hwc-pause-screen {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 24px;
}

.hwc-loading-screen {
    background:
        linear-gradient(rgba(2, 5, 3, 0.78), rgba(2, 5, 3, 0.94)),
        radial-gradient(circle at center, #193c2a, #020403 70%);
    text-align: center;
    transition:
        opacity 500ms ease,
        visibility 500ms ease;
}

.hwc-loading-screen.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.hwc-loading-logo {
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    margin: 0 auto 20px;
    border: 2px solid var(--hwc-green);
    border-radius: 24px;
    background: rgba(66, 255, 136, 0.08);
    box-shadow:
        0 0 0 8px rgba(66, 255, 136, 0.04),
        0 0 45px rgba(66, 255, 136, 0.18);
    color: var(--hwc-green);
    font-size: 25px;
    font-weight: 900;
    letter-spacing: 0.09em;
}

.hwc-loading-screen h1 {
    margin: 0;
    font-size: clamp(30px, 5vw, 58px);
    line-height: 1;
    letter-spacing: -0.04em;
}

.hwc-loading-screen p {
    margin: 14px 0 0;
    color: var(--hwc-muted);
}

.hwc-loading-track {
    width: min(420px, 80vw);
    height: 8px;
    margin: 26px auto 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

.hwc-loading-progress {
    width: 4%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--hwc-green-dark), var(--hwc-green));
    box-shadow: 0 0 20px rgba(66, 255, 136, 0.5);
    transition: width 250ms ease;
}

.hwc-loading-note {
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hwc-start-screen,
.hwc-pause-screen {
    background:
        linear-gradient(rgba(2, 6, 4, 0.5), rgba(2, 6, 4, 0.86)),
        radial-gradient(circle at 50% 25%, rgba(45, 126, 81, 0.22), transparent 54%);
    backdrop-filter: blur(8px);
}

.hwc-start-card,
.hwc-pause-card {
    width: min(560px, 100%);
    padding: clamp(26px, 5vw, 46px);
    border: 1px solid var(--hwc-border);
    border-radius: 24px;
    background:
        linear-gradient(145deg, rgba(18, 31, 24, 0.96), rgba(5, 10, 7, 0.96));
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    text-align: center;
}

.hwc-start-card h1,
.hwc-pause-card h2 {
    margin: 8px 0 14px;
    font-size: clamp(32px, 6vw, 55px);
    line-height: 1;
    letter-spacing: -0.045em;
}

.hwc-start-card > p {
    max-width: 470px;
    margin: 0 auto;
    color: var(--hwc-muted);
    line-height: 1.65;
}

.hwc-kicker,
.hwc-hud-label {
    color: var(--hwc-green);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.hwc-start-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 26px 0;
}

.hwc-start-grid > div {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 12px 8px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
}

.hwc-start-grid strong {
    color: var(--hwc-text);
    font-size: 14px;
}

.hwc-start-grid span {
    color: var(--hwc-muted);
    font-size: 11px;
}

.hwc-quality-label {
    display: block;
    margin: 0 0 8px;
    color: var(--hwc-muted);
    font-size: 13px;
    text-align: left;
}

.hwc-quality-select {
    width: 100%;
    margin: 0 0 14px;
    padding: 13px 14px;
    border: 1px solid var(--hwc-border);
    border-radius: 12px;
    outline: none;
    background: #0b1510;
    color: var(--hwc-text);
    font: inherit;
}

.hwc-quality-select:focus {
    border-color: var(--hwc-green);
    box-shadow: 0 0 0 3px rgba(66, 255, 136, 0.13);
}

.hwc-primary-button,
.hwc-secondary-button {
    width: 100%;
    min-height: 50px;
    border-radius: 13px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition:
        transform 150ms ease,
        filter 150ms ease,
        border-color 150ms ease;
}

.hwc-primary-button {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(135deg, var(--hwc-green-dark), var(--hwc-green));
    color: #031007;
    box-shadow: 0 12px 30px rgba(35, 224, 111, 0.17);
}

.hwc-secondary-button {
    margin-top: 10px;
    border: 1px solid var(--hwc-border);
    background: rgba(255, 255, 255, 0.035);
    color: var(--hwc-text);
}

.hwc-primary-button:hover,
.hwc-secondary-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

.hwc-primary-button:focus-visible,
.hwc-secondary-button:focus-visible {
    outline: 3px solid rgba(66, 255, 136, 0.4);
    outline-offset: 2px;
}

.hwc-browser-note {
    margin-top: 14px !important;
    font-size: 11px;
}

.hwc-hud {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
}

.hwc-hud-top {
    position: absolute;
    top: 18px;
    right: 18px;
    left: 18px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.hwc-player-card,
.hwc-money-card,
.hwc-job-panel,
.hwc-status-bars {
    border: 1px solid var(--hwc-border);
    background: var(--hwc-panel);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(11px);
}

.hwc-player-card {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 210px;
    padding: 10px 13px;
    border-radius: 15px;
}

.hwc-player-avatar {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(66, 255, 136, 0.35);
    border-radius: 11px;
    background: var(--hwc-green-soft);
    color: var(--hwc-green);
    font-weight: 900;
}

.hwc-player-card strong,
.hwc-player-card small {
    display: block;
}

.hwc-player-card strong {
    margin-top: 1px;
    font-size: 14px;
}

.hwc-player-card small {
    margin-top: 2px;
    color: var(--hwc-muted);
    font-size: 11px;
}

.hwc-money-card {
    min-width: 150px;
    padding: 11px 15px;
    border-radius: 15px;
    text-align: right;
}

.hwc-money-card strong {
    display: block;
    margin-top: 4px;
    font-size: 21px;
}

.hwc-status-bars {
    position: absolute;
    top: 91px;
    left: 18px;
    width: min(330px, calc(100% - 36px));
    padding: 12px 14px;
    border-radius: 15px;
}

.hwc-status-row {
    display: grid;
    grid-template-columns: 66px 1fr 58px;
    align-items: center;
    gap: 9px;
    font-size: 11px;
}

.hwc-status-row + .hwc-status-row {
    margin-top: 8px;
}

.hwc-status-row > strong {
    text-align: right;
}

.hwc-status-track,
.hwc-job-progress-track,
.hwc-dig-track {
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
}

.hwc-status-track {
    height: 7px;
}

.hwc-status-value,
.hwc-job-progress-value,
.hwc-dig-progress {
    width: 0;
    height: 100%;
    border-radius: inherit;
    transition: width 180ms ease;
}

.hwc-energy-value {
    width: 100%;
    background: linear-gradient(90deg, #0dbf65, var(--hwc-green));
}

.hwc-xp-value {
    background: linear-gradient(90deg, #3f79ff, #76a0ff);
}

.hwc-job-panel {
    position: absolute;
    right: 18px;
    bottom: 52px;
    width: min(350px, calc(100% - 36px));
    padding: 16px;
    border-radius: 17px;
}

.hwc-job-panel h2 {
    margin: 5px 0 6px;
    font-size: 17px;
}

.hwc-job-panel p {
    margin: 0 0 12px;
    color: var(--hwc-muted);
    font-size: 12px;
    line-height: 1.5;
}

.hwc-job-progress-track {
    height: 8px;
}

.hwc-job-progress-value {
    background: linear-gradient(90deg, var(--hwc-green-dark), var(--hwc-green));
    box-shadow: 0 0 13px rgba(66, 255, 136, 0.32);
}

.hwc-job-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 9px;
    color: var(--hwc-muted);
    font-size: 11px;
}

.hwc-job-meta strong {
    color: var(--hwc-text);
}

.hwc-crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 22px;
    height: 22px;
    transform: translate(-50%, -50%);
}

.hwc-crosshair span {
    position: absolute;
    top: 50%;
    left: 50%;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
    transform: translate(-50%, -50%);
}

.hwc-crosshair span:first-child {
    width: 15px;
    height: 1px;
}

.hwc-crosshair span:last-child {
    width: 1px;
    height: 15px;
}

.hwc-interaction {
    position: absolute;
    bottom: 112px;
    left: 50%;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 14px;
    border: 1px solid var(--hwc-border);
    border-radius: 13px;
    background: rgba(4, 9, 6, 0.92);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.35);
    transform: translateX(-50%);
}

.hwc-interaction kbd {
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--hwc-green);
    font-family: inherit;
    font-weight: 900;
}

.hwc-interaction span {
    font-size: 13px;
    font-weight: 700;
}

.hwc-dig-meter {
    position: absolute;
    bottom: 172px;
    left: 50%;
    width: min(260px, calc(100% - 40px));
    padding: 12px 14px;
    border: 1px solid var(--hwc-border);
    border-radius: 13px;
    background: rgba(4, 9, 6, 0.94);
    text-align: center;
    transform: translateX(-50%);
}

.hwc-dig-track {
    height: 9px;
    margin: 9px 0 6px;
}

.hwc-dig-progress {
    background: linear-gradient(90deg, #d38f35, #ffd070);
}

.hwc-dig-meter small {
    color: var(--hwc-muted);
}

.hwc-controls-hint {
    position: absolute;
    bottom: 14px;
    left: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.hwc-controls-hint span {
    padding: 6px 9px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(5, 10, 7, 0.72);
    color: rgba(255, 255, 255, 0.68);
    font-size: 10px;
    backdrop-filter: blur(7px);
}

.hwc-notification {
    position: absolute;
    top: 110px;
    left: 50%;
    z-index: 25;
    max-width: min(460px, calc(100% - 36px));
    padding: 13px 17px;
    border: 1px solid var(--hwc-border);
    border-radius: 13px;
    background: rgba(5, 13, 8, 0.94);
    color: var(--hwc-text);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    transform: translateX(-50%);
    animation: hwc-notification-in 220ms ease;
}

.hwc-notification.is-success {
    border-color: rgba(66, 255, 136, 0.55);
}

.hwc-notification.is-warning {
    border-color: rgba(255, 204, 85, 0.55);
}

.hwc-damage-overlay {
    position: absolute;
    inset: 0;
    z-index: 8;
    pointer-events: none;
    background: radial-gradient(circle, transparent 52%, rgba(255, 56, 51, 0.35));
    opacity: 0;
    transition: opacity 200ms ease;
}

.hwc-damage-overlay.is-visible {
    opacity: 1;
}

.hwc-noscript {
    padding: 30px;
    background: #150a0a;
    color: #ffd2d2;
    text-align: center;
}

@keyframes hwc-notification-in {
    from {
        opacity: 0;
        transform: translate(-50%, -8px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@media (max-width: 760px) {
    .hwc-game-container {
        height: 78vh;
        min-height: 580px;
    }

    .hwc-start-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hwc-hud-top {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .hwc-player-card {
        min-width: 0;
    }

    .hwc-player-card .hwc-hud-label {
        display: none;
    }

    .hwc-money-card {
        min-width: 120px;
    }

    .hwc-status-bars {
        top: 78px;
        left: 10px;
        width: min(300px, calc(100% - 20px));
    }

    .hwc-job-panel {
        right: 10px;
        bottom: 50px;
        width: min(330px, calc(100% - 20px));
    }

    .hwc-controls-hint {
        display: none;
    }
}

@media (max-width: 480px) {
    .hwc-game-container {
        min-height: 540px;
    }

    .hwc-start-card,
    .hwc-pause-card {
        padding: 24px 18px;
        border-radius: 18px;
    }

    .hwc-player-card {
        padding: 8px;
    }

    .hwc-player-avatar {
        width: 35px;
        height: 35px;
    }

    .hwc-player-card small {
        max-width: 95px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .hwc-money-card {
        padding: 9px 10px;
    }

    .hwc-money-card strong {
        font-size: 17px;
    }

    .hwc-job-panel {
        bottom: 12px;
    }

    .hwc-interaction {
        bottom: 155px;
    }

    .hwc-dig-meter {
        bottom: 210px;
    }
}

/* HWC_HIDDEN_DISPLAY_FIX */
/*
 * Das HTML-Attribut hidden muss immer Vorrang vor den
 * normalen Layoutregeln der Spieloberfläche besitzen.
 *
 * Ohne diese Regel können Startbildschirm, Pausenfenster,
 * HUD, Meldungen und Ladeelemente sichtbar bleiben,
 * obwohl JavaScript element.hidden = true setzt.
 */
.hwc-game-container [hidden] {
    display: none !important;
}

/*
 * Die drei großen Bildschirmebenen erhalten display:grid
 * nur dann, wenn sie nicht mit hidden ausgeblendet sind.
 */
.hwc-loading-screen:not([hidden]),
.hwc-start-screen:not([hidden]),
.hwc-pause-screen:not([hidden]) {
    display: grid;
}

