:root {
    --geo-paper: #f2ead7;
    --geo-paper-deep: #e6dcc4;
    --geo-park: #d7e7be;
    --geo-water: #c6dff1;
    --geo-street: #544f47;
    --geo-building: #f7f2e9;
    --geo-alert: #c62a2a;
    --geo-signal: #0000ff;
}

.geo-page {
    max-width: 1320px;
}

.geo-app-shell {
    margin: -25px -50px 22px;
}

.geo-app-shell .geo-phone-column {
    width: min(100%, 420px);
    margin: 0 auto;
}

.geo-app-shell .geo-phone {
    position: relative;
    top: auto;
}

.geo-page h2 {
    max-width: none;
    margin-top: 0;
    margin-bottom: 12px;
}

.geo-intro {
    max-width: 920px;
    margin-bottom: 10px;
}

.geo-intro-secondary {
    margin-bottom: 26px;
    color: #333333;
}

.geo-blueprint {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 30px;
}

.geo-card,
.geo-panel-section {
    border: 1px solid var(--text-color);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 243, 232, 0.98)),
        var(--bg-color);
    padding: 14px 16px;
}

.geo-card p,
.geo-panel-section p {
    margin: 0;
}

.geo-workbench {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 22px;
}

.geo-phone-column {
    flex: 0 1 420px;
}

.geo-phone {
    position: relative;
    top: auto;
    width: min(390px, 100%);
    margin: 0 auto;
    padding: 14px;
    border: 1px solid #000000;
    border-radius: 34px;
    background: #111111;
    box-shadow: 12px 14px 0 rgba(0, 0, 0, 0.12);
}

.geo-phone-notch {
    width: 128px;
    height: 22px;
    margin: 0 auto 10px;
    border-radius: 999px;
    background: #222222;
}

.geo-screen {
    position: relative;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    border-radius: 26px;
    background: var(--geo-paper);
}

.geo-stage {
    position: absolute;
    inset: 0;
    display: none;
}

.geo-stage.is-active {
    display: block;
}

#geo-map-canvas,
#geo-encounter-canvas,
.geo-camera-feed,
#geo-encounter-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

#geo-map-canvas,
#geo-encounter-canvas,
#geo-encounter-overlay {
    touch-action: none;
    border: 0;
    background: transparent;
}

#geo-encounter-canvas {
    z-index: 2;
}

#geo-encounter-overlay {
    z-index: 3;
    pointer-events: none;
}

.geo-stage-encounter,
#geo-encounter-canvas,
.geo-camera-feed,
#geo-encounter-overlay,
.geo-camera-fallback,
.geo-encounter-top,
.geo-encounter-bottom,
.geo-encounter-copy {
    user-select: none;
    -webkit-user-select: none;
}

.geo-map-hud,
.geo-map-bottom,
.geo-encounter-top,
.geo-encounter-bottom {
    position: absolute;
    left: 10px;
    right: 10px;
    z-index: 3;
}

.geo-map-hud,
.geo-encounter-top {
    top: 10px;
}

.geo-map-bottom,
.geo-encounter-bottom {
    bottom: 10px;
}

.geo-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.geo-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border: 1px solid rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 0.84);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

.geo-stat-grid > div,
.geo-selected-panel,
.geo-encounter-copy {
    border: 1px solid rgba(0, 0, 0, 0.34);
    background: rgba(255, 255, 255, 0.84);
    padding: 9px 10px;
}

.geo-stat-grid span,
.geo-selected-eyebrow,
.geo-mini-grid dt,
.geo-field span,
.geo-slider-field span {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.geo-stat-grid strong,
.geo-selected-title {
    display: block;
    font-size: 0.92rem;
}

.geo-map-bottom {
    display: grid;
    gap: 10px;
}

.geo-selected-meta {
    font-size: 0.8rem;
    line-height: 1.35;
}

.geo-map-action,
.geo-mini-button,
.geo-button {
    border: 1px solid var(--text-color);
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-color);
    cursor: pointer;
    font-family: var(--font-mono);
}

.geo-map-action,
.geo-button {
    padding: 8px 10px;
    font-size: 0.76rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.geo-map-action:hover,
.geo-mini-button:hover,
.geo-button:hover,
.geo-button.is-active {
    background: var(--text-color);
    color: var(--bg-color);
}

.geo-map-action:disabled {
    cursor: default;
    opacity: 0.55;
    background: rgba(255, 255, 255, 0.92);
    color: #555555;
}

.geo-mini-button {
    padding: 6px 10px;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.geo-panel {
    flex: 1 1 360px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 300px;
}

.geo-button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.geo-button {
    padding: 6px 10px;
}

.geo-note {
    margin-top: 10px;
    font-size: 0.84rem;
    color: #444444;
}

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

.geo-field input,
.geo-field select {
    width: 100%;
    border: 1px solid var(--text-color);
    background: #ffffff;
    color: var(--text-color);
    padding: 7px 8px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    box-sizing: border-box;
}

.geo-field select {
    appearance: none;
}

.geo-slider-field {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.geo-slider {
    width: 100%;
    margin-top: 10px;
}

.geo-status-block {
    margin-top: 12px;
    padding: 10px 12px;
    border-left: 3px solid var(--geo-signal);
    background: #f7f4eb;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    line-height: 1.5;
}

.geo-selected-block {
    border-left-color: var(--geo-alert);
}

.geo-debug-grid {
    margin-top: 12px;
}

.geo-scene-tree {
    margin: 12px 0 0;
    max-height: 260px;
    overflow: auto;
    border: 1px solid rgba(0, 0, 0, 0.24);
    background: rgba(255, 255, 255, 0.82);
    padding: 10px 12px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

#geo-debug-readout {
    white-space: pre-line;
}

.geo-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
    margin: 0;
}

.geo-mini-grid dd {
    margin: 0;
    font-size: 0.96rem;
}

.geo-inventory {
    margin: 0;
    padding-left: 18px;
}

.geo-inventory li {
    margin-bottom: 6px;
}

.geo-phone-caption {
    max-width: 390px;
    margin: 12px auto 0;
    font-size: 0.84rem;
    line-height: 1.5;
}

.geo-stage-encounter {
    background:
        radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.8), transparent 42%),
        linear-gradient(180deg, #a8d8ff 0%, #dff3ff 48%, #f5ead0 100%);
}

.geo-camera-feed {
    object-fit: cover;
    z-index: 0;
    background: #c7ddf6;
    pointer-events: none;
}

.geo-camera-fallback {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background:
        radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.75), transparent 34%),
        linear-gradient(180deg, rgba(166, 216, 255, 0.8), rgba(248, 236, 198, 0.42));
    color: rgba(0, 0, 0, 0.64);
    pointer-events: none;
}

.geo-camera-fallback strong {
    font-size: 0.86rem;
}

.geo-encounter-top,
.geo-encounter-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    pointer-events: none;
}

.geo-encounter-bottom {
    align-items: flex-end;
}

.geo-encounter-copy {
    flex: 1 1 auto;
    font-size: 0.76rem;
    line-height: 1.45;
    pointer-events: none;
}

.geo-encounter-top .geo-mini-button,
.geo-encounter-bottom .geo-mini-button {
    pointer-events: auto;
}

@media (max-width: 960px) {
    .geo-phone {
        position: relative;
        top: auto;
    }

    .geo-panel {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 560px) {
    .geo-app-shell {
        margin: -25px -50px 18px;
    }

    .geo-app-shell .geo-phone-column {
        width: 100%;
        max-width: none;
    }

    .geo-app-shell .geo-phone {
        width: 100%;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .geo-app-shell .geo-phone-notch,
    .geo-app-shell .geo-phone-caption {
        display: none;
    }

    .geo-app-shell .geo-screen {
        border-radius: 0;
    }

    .geo-blueprint,
    .geo-form-grid {
        grid-template-columns: 1fr;
    }

    .geo-stat-grid,
    .geo-mini-grid {
        grid-template-columns: 1fr;
    }
}
