/* PolySnake XR styles — circa-2015 CSS 3 with WebKit prefixes, responsive viewports & lean-paint overrides. */
*,
*:before,
*:after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #13251d;
    color: #f3faf6;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
}

#webgl-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.hidden,
[hidden] {
    display: none !important;
}

#error-banner {
    position: fixed;
    top: 42%;
    left: 8%;
    right: 8%;
    z-index: 50;
    max-width: 520px;
    margin: 0 auto;
    padding: 18px 20px;
    border-radius: 10px;
    background: #2f1419;
    border: 2px solid #dc2626;
    color: #fee2e2;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

/* Top-Left Brand & Stats Column */
.hud-left {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 20;
    max-width: 340px;
    pointer-events: none;
}

.brand-bar {
    pointer-events: auto;
    display: -webkit-inline-box;
    display: -webkit-inline-flex;
    display: inline-flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(12, 26, 20, 0.88);
    border: 1px solid rgba(74, 222, 128, 0.48);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.30);
}

.brand-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    margin-right: 8px;
}

.brand-title {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: #ecfdf5;
    margin-right: 8px;
    white-space: nowrap;
}

.brand-badge {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 2px 6px;
    border-radius: 5px;
    background: rgba(34, 197, 94, 0.24);
    border: 1px solid rgba(74, 222, 128, 0.55);
    color: #86efac;
    margin-right: 8px;
    white-space: nowrap;
}

.icon-mini {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.10);
    color: #e2f7ec;
    font-family: Georgia, serif;
    font-style: italic;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}

.icon-mini:hover {
    background: rgba(74, 222, 128, 0.28);
}

.stats-card {
    pointer-events: auto;
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(12, 26, 20, 0.88);
    border: 1px solid rgba(74, 222, 128, 0.40);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.30);
}

.stats-head {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    margin-bottom: 6px;
}

.tier-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #4ade80;
    margin-right: 7px;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

.tier-label {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #ecfdf5;
    margin-right: auto;
}

.combo-pill {
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    background: #f59e0b;
    color: #1c1002;
}

.stats-row {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    font-size: 12px;
    margin-bottom: 8px;
}

.stat-item {
    color: #d1fae5;
    white-space: nowrap;
}

.stat-k {
    font-size: 10px;
    font-weight: 700;
    color: #86b39d;
    margin-right: 3px;
}

.stat-sep {
    width: 1px;
    height: 12px;
    background: rgba(255, 255, 255, 0.20);
    margin: 0 8px;
}

.progress-label {
    font-size: 11px;
    font-weight: 700;
    color: #a7f3d0;
    margin-bottom: 4px;
}

.size-track {
    position: relative;
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.14);
    overflow: hidden;
}

.size-fill {
    height: 100%;
    width: 4%;
    border-radius: 5px;
    background: #4ade80;
    -webkit-transition: width 0.18s ease-out;
    transition: width 0.18s ease-out;
}

.size-mark {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.42);
}

/* Top-Right Action Bar */
.hud-right {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 20;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-pack: end;
    -webkit-justify-content: flex-end;
    justify-content: flex-end;
    max-width: 62%;
}

.hud-btn {
    margin: 0 0 6px 6px;
    padding: 7px 11px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(12, 26, 20, 0.86);
    color: #e6f6ee;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    -webkit-transition: background-color 0.15s ease, border-color 0.15s ease;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.hud-btn:hover:not(:disabled) {
    background: rgba(28, 56, 43, 0.96);
    border-color: rgba(134, 239, 172, 0.65);
}

.hud-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

.hud-btn.is-on {
    border-color: rgba(74, 222, 128, 0.55);
    color: #bbf7d0;
}

.hud-btn-primary {
    background: #16a34a;
    border-color: #4ade80;
    color: #ffffff;
}

.hud-btn-primary:hover:not(:disabled) {
    background: #22c55e;
}

.hud-btn-xr {
    background: #0284c7;
    border-color: #38bdf8;
    color: #ffffff;
}

.hud-btn-xr:hover:not(:disabled) {
    background: #0ea5e9;
}

.hud-btn-xr.is-active {
    background: #b91c1c;
    border-color: #f87171;
}

/* Centered Notices */
.notice-stack {
    position: fixed;
    top: 66px;
    left: 12px;
    right: 12px;
    z-index: 18;
    text-align: center;
    pointer-events: none;
}

.xr-status-pill,
.center-notice,
.army-bar {
    display: inline-block;
    max-width: 92%;
    margin: 4px auto;
    padding: 8px 16px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
}

.xr-status-pill {
    background: rgba(14, 34, 48, 0.92);
    border: 1px solid rgba(56, 189, 248, 0.55);
    color: #e0f2fe;
}

.center-notice {
    background: rgba(15, 31, 22, 0.92);
    border: 2px solid #facc15;
    color: #fef08a;
    font-size: 15px;
    letter-spacing: 0.04em;
}

.army-bar {
    display: block;
    width: 360px;
    max-width: 92%;
    background: rgba(153, 27, 27, 0.92);
    border: 2px solid #f87171;
    color: #fff5f5;
}

.army-title {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.army-sub {
    font-size: 12px;
    font-weight: 500;
    color: #fecaca;
    margin-top: 2px;
}

/* Start Hero Overlay */
.hero-card {
    position: fixed;
    left: 50%;
    bottom: 24px;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    z-index: 25;
    width: 560px;
    max-width: 92%;
    padding: 18px 20px;
    border-radius: 14px;
    background: rgba(11, 24, 19, 0.92);
    border: 2px solid rgba(74, 222, 128, 0.58);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.48);
}

.hero-head {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    margin-bottom: 10px;
}

.hero-icon {
    width: 58px;
    height: 58px;
    border-radius: 12px;
    margin-right: 14px;
    background: #ffffff;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

.hero-eyebrow {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.10em;
    color: #4ade80;
    margin-bottom: 2px;
}

.hero-title {
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.1;
}

.hero-copy {
    font-size: 13px;
    line-height: 1.48;
    color: #d1fae5;
    margin-bottom: 14px;
}

.hero-actions {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.btn-big {
    -webkit-box-flex: 1;
    -webkit-flex: 1 1 150px;
    flex: 1 1 150px;
    margin: 4px;
    padding: 12px 16px;
    border-radius: 10px;
    border: 2px solid transparent;
    font-family: inherit;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    color: #ffffff;
    -webkit-transition: background-color 0.15s ease, -webkit-transform 0.12s ease;
    transition: background-color 0.15s ease, transform 0.12s ease;
}

.btn-big:disabled {
    opacity: 0.52;
    cursor: default;
}

.btn-xr {
    background: #0284c7;
    border-color: #7dd3fc;
}

.btn-xr:hover:not(:disabled) {
    background: #0ea5e9;
}

.btn-vr {
    background: #4f46e5;
    border-color: #a5b4fc;
}

.btn-vr:hover:not(:disabled) {
    background: #6366f1;
}

.btn-play {
    background: #16a34a;
    border-color: #86efac;
}

.btn-play:hover:not(:disabled) {
    background: #22c55e;
}

.hero-hints {
    font-size: 11px;
    line-height: 1.5;
    color: #9dc5b0;
}

.hero-hints span {
    display: block;
}

/* Touch Steering Guide */
.touch-guide {
    position: fixed;
    z-index: 22;
    width: 96px;
    height: 96px;
    margin-left: -48px;
    margin-top: -48px;
    border-radius: 50%;
    border: 2px solid rgba(74, 222, 128, 0.72);
    background: rgba(15, 36, 26, 0.35);
    pointer-events: none;
}

.touch-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 34px;
    height: 34px;
    margin-left: -17px;
    margin-top: -17px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #ffffff;
}

/* Info Modal */
.info-modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    background: rgba(6, 14, 11, 0.78);
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    padding: 16px;
}

.info-dialog {
    width: 560px;
    max-width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    border-radius: 12px;
    background: #0f2018;
    border: 2px solid rgba(74, 222, 128, 0.55);
    padding: 18px 20px;
    color: #e6f6ee;
}

.info-header {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    margin-bottom: 14px;
}

.info-brand {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
}

.info-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #ffffff;
    margin-right: 10px;
}

.info-sub {
    font-size: 12px;
    color: #86efac;
}

.info-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
}

.info-body h3 {
    font-size: 14px;
    color: #fde047;
    margin: 12px 0 6px 0;
}

.info-body p {
    font-size: 13px;
    line-height: 1.5;
    color: #d1fae5;
}

.info-list {
    margin: 0 0 8px 18px;
    font-size: 13px;
    line-height: 1.55;
    color: #d1fae5;
}

.diag-box {
    position: fixed;
    left: 12px;
    bottom: 12px;
    z-index: 30;
    padding: 8px 10px;
    border-radius: 6px;
    background: rgba(8, 16, 12, 0.88);
    border: 1px solid rgba(74, 222, 128, 0.4);
    color: #86efac;
    font-family: monospace;
    font-size: 11px;
    line-height: 1.45;
    pointer-events: none;
}

.no-script {
    position: fixed;
    top: 40%;
    left: 10%;
    right: 10%;
    padding: 16px;
    background: #1a2e22;
    border: 1px solid #4ade80;
    color: #ffffff;
    text-align: center;
}

/* Lean-paint path for low-power signage/headset browsers (flat colours, no shadows/transitions) */
body.lean-paint .brand-bar,
body.lean-paint .stats-card,
body.lean-paint .hero-card {
    box-shadow: none;
    background: #0d1d16;
}

body.lean-paint .hud-btn,
body.lean-paint .btn-big,
body.lean-paint .size-fill {
    -webkit-transition: none;
    transition: none;
}

/* Narrow / Portrait Viewports (e.g. 450x960, 1080x1920) */
@media (max-width: 780px) {
    .hud-left {
        top: 8px;
        left: 8px;
        max-width: 60%;
    }
    .hud-right {
        top: 8px;
        right: 8px;
        max-width: 56%;
    }
    .hud-btn {
        padding: 6px 8px;
        font-size: 11px;
        margin: 0 0 4px 4px;
    }
    .brand-badge {
        display: none;
    }
    .hero-card {
        bottom: 12px;
        padding: 14px 14px;
    }
    .hero-title {
        font-size: 20px;
    }
    .hero-icon {
        width: 46px;
        height: 46px;
    }
}

@media (max-width: 520px) {
    .hud-left {
        max-width: 96%;
    }
    .hud-right {
        top: 52px;
        left: 8px;
        right: 8px;
        max-width: none;
        -webkit-box-pack: start;
        -webkit-justify-content: flex-start;
        justify-content: flex-start;
    }
    .stats-card {
        margin-top: 44px;
    }
    .notice-stack {
        top: 102px;
    }
    .hero-copy {
        font-size: 12px;
    }
    .btn-big {
        padding: 10px 12px;
        font-size: 14px;
    }
}
