:root {
    color-scheme: light;
    --stage-width: min(100vw, calc(100vh * 750 / 1334));
    --stage-height: min(100vh, calc(100vw * 1334 / 750));
    --panel-width: 268px;
    --panel-bg: rgba(22, 18, 15, 0.84);
    --panel-border: rgba(255, 255, 255, 0.14);
    --panel-text: #f6f0e8;
    --panel-text-muted: rgba(246, 240, 232, 0.72);
    --panel-active: #f69f5a;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    min-height: 100%;
    overflow: hidden;
    background: #4a5c41;
    /* 适配地图页的绿色底色，减少留白突兀感 */
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
    color: #fff;
}

.app-shell {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
}

.phone-shell {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.h5-stage {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
    background: #000;
    touch-action: manipulation;
}

.h5-stage.stage--map {
    width: 100vw;
    height: 100vh;
}

.screen-image {
    width: 100%;
    height: 100%;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    object-fit: fill;
}

.hotspots {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.hotspot {
    position: absolute;
    display: block;
    border: 0;
    padding: 0;
    margin: 0;
    border-radius: 999px;
    background: transparent;
    color: transparent;
    cursor: pointer;
    pointer-events: auto;
}

.hotspot.is-completed {
    background: rgba(116, 116, 116, 0.24);
    box-shadow: inset 0 0 0 1px rgba(208, 208, 208, 0.6);
}

.hotspot:focus-visible {
    outline: 2px solid rgba(255, 184, 112, 0.95);
    outline-offset: 2px;
}

.ui-layer {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.ui-layer>* {
    pointer-events: auto;
}

.overlay-card {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: min(86%, 560px);
    border-radius: 24px;
    background: rgba(16, 12, 9, 0.88);
    border: 1px solid rgba(255, 214, 171, 0.24);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(16px);
    color: #fff7ef;
    padding: 22px 20px;
}

.overlay-card--login {
    top: 11%;
}

.login-scene {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 28px 24px;
    background:
        radial-gradient(circle at top center, rgba(255, 199, 120, 0.18), transparent 34%),
        linear-gradient(180deg, rgba(74, 42, 15, 0.08) 0%, rgba(40, 24, 11, 0.18) 100%);
}

.login-panel {
    position: relative;
    width: min(88%, 556px);
    aspect-ratio: 556 / 780;
    height: auto;
    min-height: 430px;
    max-height: min(88vh, 780px);
    filter: drop-shadow(0 28px 36px rgba(71, 31, 10, 0.24));
}

.login-panel__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    user-select: none;
    -webkit-user-drag: none;
    object-fit: contain;
    object-position: center;
}

.login-panel__content {
    position: absolute;
    inset: 11% 11% 14%;
    display: flex;
    flex-direction: column;
    color: #5f3010;
    gap: 12px;
}

.login-panel .overlay-card__eyebrow {
    color: rgba(159, 79, 20, 0.82);
}

.login-panel .overlay-card__title {
    color: #7a3610;
    font-size: 18px;
    margin-top: 4px;
    line-height: 1.4;
}

.login-panel .wechat-badge,
.login-panel .wechat-badge--empty,
.login-panel .button-row {
    margin-top: 12px;
}

.input--light {
    color: #632c0c;
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(192, 115, 50, 0.18);
    padding: 12px 14px;
    font-size: 15px;
}

.input--light::placeholder {
    color: rgba(99, 44, 12, 0.44);
}

.primary-button--login {
    box-shadow: 0 10px 16px rgba(193, 106, 40, 0.22);
    margin-bottom: 10px;
}

.secondary-button--login {
    color: #7f3a12;
    background: rgba(255, 246, 235, 0.88);
    border-color: rgba(198, 112, 46, 0.16);
}

.login-panel .primary-button,
.login-panel .secondary-button {
    padding: 11px 16px;
    font-size: 14px;
}

.login-hints {
    display: grid;
    gap: 8px;
}

.login-hints--compact {
    margin-top: 50px;
}

.login-hints__item {
    padding: 0px 0px;
    border-radius: 14px;
    background: rgba(255, 247, 238, 0.72);
    color: rgba(110, 53, 19, 0.82);
    font-size: 13px;
    line-height: 1;
}

.guest-passcode-banner {
    padding: 12px 8px;
    border-radius: 18px;
    background: rgba(123, 52, 18, 0.08);
    border: 1px solid rgba(191, 106, 47, 0.16);
    display: grid;
    gap: 6px;
}

.guest-passcode-banner--hero {
    background: rgba(255, 250, 243, 0.92);
    border-color: rgba(191, 106, 47, 0.18);
}

.guest-passcode-banner__label {
    font-size: 12px;
    color: rgba(113, 51, 18, 0.72);
}

.guest-passcode-banner__value {
    font-size: 18px;
    line-height: 1.35;
    color: #8f3f18;
    word-break: break-all;
}

.guest-backup-shade {
    position: absolute;
    inset: 0;
    background: rgba(22, 12, 4, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 120;
    padding: 24px;
}

.guest-backup-card {
    width: min(92%, 560px);
    border-radius: 28px;
    background: linear-gradient(180deg, #fffaf3 0%, #fff1df 100%);
    color: #653113;
    padding: 24px 20px;
    box-shadow: 0 22px 40px rgba(40, 18, 3, 0.25);
}

.guest-backup-card__eyebrow {
    font-size: 12px;
    font-weight: 700;
    color: #b8682f;
    letter-spacing: 1px;
}

.guest-backup-card__title {
    margin: 10px 0 8px;
    font-size: 24px;
    line-height: 1.25;
    color: #7f3412;
}

.guest-backup-card__warning {
    margin: 0 0 18px;
    font-size: 14px;
    line-height: 1.7;
    color: rgba(101, 49, 19, 0.82);
}

.guest-backup-card__code-wrap {
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(199, 111, 52, 0.14);
    padding: 14px 16px;
    margin-bottom: 12px;
}

.guest-backup-card__label {
    font-size: 12px;
    color: rgba(101, 49, 19, 0.68);
    margin-bottom: 8px;
}

.guest-backup-card__value {
    font-size: 24px;
    line-height: 1.2;
    font-weight: 800;
    color: #a23d12;
    word-break: break-all;
}

.guest-backup-card__actions {
    margin-top: 18px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.guest-restore-card .guest-backup-card__actions {
    margin-top: 20px;
}

.guest-restore-card .input--light {
    color: #6b2f10;
    caret-color: #6b2f10;
    background: rgba(255, 255, 255, 0.82);
}

.guest-restore-card .input--light::placeholder {
    color: rgba(107, 47, 16, 0.5);
}

.guest-restore-card .secondary-button--login {
    color: #7f3a12;
    background: rgba(255, 246, 235, 0.92);
    border-color: rgba(198, 112, 46, 0.22);
}

.guest-restore-field {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 700;
    color: #7f3412;
}

.scroll-story {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.scroll-story__frame {
    position: absolute;
    inset: 0;
}

.scroll-story__shade {
    position: absolute;
    inset: 0;
    background: rgba(242, 232, 202, 0.58);
    opacity: 1;
    transition: opacity 0.55s ease 2.2s;
}

.scroll-story__paper-shell {
    position: absolute;
    left: 6%;
    right: 6%;
    top: 14%;
    height: 60%;
    overflow: hidden;
    transform: scaleX(0.02);
    transform-origin: center;
    transition: transform 2.2s cubic-bezier(0.65, 0, 0.18, 1);
    z-index: 1;
}

.scroll-story__paper {
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
}

.scroll-story__rod {
    position: absolute;
    top: 12.5%;
    width: 6.5%;
    height: 63%;
    object-fit: fill;
    filter: drop-shadow(0 10px 16px rgba(66, 38, 14, 0.28));
    z-index: 2;
}

.scroll-story__rod--left {
    left: 50%;
    transform: translateX(-50%);
    transition: left 2.2s cubic-bezier(0.65, 0, 0.18, 1);
}

.scroll-story__rod--right {
    left: 50%;
    transform: translateX(-50%) scaleX(-1);
    transition: left 2.2s cubic-bezier(0.65, 0, 0.18, 1);
}

.scroll-story__content {
    position: absolute;
    left: 16%;
    right: 16%;
    top: 18%;
    height: 52%;
    color: #221d17;
    overflow: hidden;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-story__columns {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    line-height: 1.8;
    font-size: 21px;
    letter-spacing: 0.08em;
    column-gap: 0;
}

.scroll-story__columns p {
    margin: 0;
}

.scroll-story.is-open .scroll-story__paper-shell {
    transform: scaleX(1);
}

.scroll-story.is-open .scroll-story__rod--left {
    left: 3.2%;
}

.scroll-story.is-open .scroll-story__rod--right {
    left: 96.8%;
}

.scroll-story.is-open .scroll-story__shade {
    opacity: 0;
}

.scroll-story__char {
    display: inline-block;
    opacity: 0;
    transform: translateY(-8px);
}

.scroll-story.is-open .scroll-story__char {
    animation: story-column-fade 0.55s ease forwards;
    animation-delay: calc(1.15s + var(--column-index) * 0.18s);
}

.scroll-story__button {
    position: absolute;
    left: 28%;
    top: 75%;
    width: 44%;
    height: 7%;
    border: 0;
    padding: 0;
    background: transparent;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 4;
    cursor: pointer;
}

.scroll-story__button img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.scroll-story__button:disabled {
    cursor: default;
}

.scroll-story.is-ready .scroll-story__button {
    opacity: 1;
}

.scroll-story__footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 10%;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    background: rgba(43, 33, 24, 0.45);
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    line-height: 1.6;
    letter-spacing: 0.02em;
    z-index: 1;
    backdrop-filter: blur(4px);
}

.scroll-story__footer p {
    margin: 0;
}

@keyframes story-column-fade {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.overlay-card--building,
.overlay-card--question,
.overlay-card--result,
.overlay-card--thanks,
.overlay-card--lottery,
.overlay-card--prize,
.overlay-card--wallet {
    bottom: 7%;
}

.overlay-card--thanks,
.overlay-card--lottery,
.overlay-card--prize,
.overlay-card--wallet {
    background: linear-gradient(135deg, rgba(29, 23, 18, 0.92), rgba(56, 44, 20, 0.88));
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.34);
}

.overlay-card--thanks {
    bottom: 4%;
}

.overlay-card--lottery .overlay-card__title,
.overlay-card--prize .overlay-card__title,
.overlay-card--wallet .overlay-card__title {
    color: #fff8ee;
}

.overlay-card--thanks .overlay-card__title {
    font-size: 28px;
    line-height: 1.4;
}

.overlay-card--thanks .overlay-card__text {
    font-size: 16px;
}

.overlay-card__eyebrow {
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 206, 154, 0.82);
}

.overlay-card__title {
    margin: 8px 0 0;
    font-size: 24px;
    line-height: 1.3;
}

.overlay-card__text,
.overlay-card__meta {
    margin: 12px 0 0;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 244, 232, 0.88);
}

.inline-note {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
}

.inline-note--success {
    background: rgba(106, 164, 118, 0.16);
    color: #e7ffe7;
    border: 1px solid rgba(145, 216, 158, 0.2);
}

.question-title {
    font-size: 20px;
}

.form-stack {
    margin-top: 16px;
    display: grid;
    gap: 12px;
}

.input {
    width: 100%;
    border: 1px solid rgba(255, 214, 171, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 16px;
    outline: none;
}

.input::placeholder {
    color: rgba(255, 255, 255, 0.44);
}

.primary-button,
.secondary-button {
    border: 0;
    border-radius: 999px;
    padding: 13px 18px;
    font-size: 15px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

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

.primary-button:disabled,
.secondary-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.primary-button {
    background: linear-gradient(180deg, #f8bf7c 0%, #e18a3a 100%);
    color: #311707;
    font-weight: 700;
}

.secondary-button {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.secondary-button:disabled {
    border-color: rgba(255, 255, 255, 0.08);
}

.secondary-button--full {
    width: 100%;
}

.button-row {
    margin-top: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.button-row--stack {
    grid-template-columns: 1fr;
}

.option-list {
    margin-top: 16px;
    display: grid;
    gap: 10px;
}

.option-card {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 10px;
    align-items: start;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.option-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-card__key {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 196, 137, 0.18);
    color: #ffd6ad;
    font-weight: 700;
}

.option-card input:checked+.option-card__key {
    background: linear-gradient(180deg, #f8bf7c 0%, #e18a3a 100%);
    color: #3c1d0b;
}

.option-card__label {
    line-height: 1.6;
    color: #fff5e7;
}

.status-pill {
    position: absolute;
    left: 16px;
    top: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px;
    border-radius: 16px;
    background: rgba(17, 12, 9, 0.76);
    color: #fff8ef;
    font-size: 13px;
}

.floating-actions {
    position: absolute;
    right: 14px;
    bottom: 14px;
    display: grid;
    gap: 8px;
    width: min(42%, 170px);
}

.wechat-badge {
    margin-top: 16px;
    padding: 12px 14px;
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 12px;
    align-items: center;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
}

.login-panel .wechat-badge {
    background: rgba(255, 245, 231, 0.86);
}

.login-panel .wechat-badge strong {
    color: #793611;
}

.wechat-badge--empty {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 241, 225, 0.82);
    font-size: 14px;
}

.login-panel .wechat-badge--empty {
    background: rgba(255, 245, 231, 0.86);
    color: rgba(121, 54, 17, 0.74);
}

.wechat-badge__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
}

.wechat-badge strong,
.wechat-badge span {
    display: block;
}

.wechat-badge span {
    margin-top: 4px;
    font-size: 12px;
    color: rgba(255, 236, 210, 0.72);
    word-break: break-all;
}

.login-panel .wechat-badge span {
    color: rgba(121, 54, 17, 0.68);
}

.swipe-guide-shade {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.swipe-guide-img {
    width: 60%;
    height: auto;
    pointer-events: none;
}

.swipe-guide-close {
    position: absolute;
    top: 5%;
    right: 5%;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #fff;
    background: transparent;
    color: #fff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.map-shell {
    position: absolute;
    inset: 0;
    padding: 0;
}

.map-overlay {
    position: absolute;
    left: 12px;
    right: 12px;
    z-index: 2;
    pointer-events: none;
}

.map-overlay>* {
    pointer-events: auto;
}

.map-overlay--top {
    top: 12px;
}

.map-overlay--bottom {
    left: 14px;
    right: 14px;
    bottom: 14px;
}

.map-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.map-header__title {
    width: min(56%, 300px);
    height: auto;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.18));
}

.map-header__meta {
    margin-left: auto;
    min-width: 132px;
    padding: 10px 12px;
    border-radius: 18px;
    background: rgba(17, 12, 9, 0.78);
    backdrop-filter: blur(10px);
    text-align: right;
}

.map-header__meta strong,
.map-header__meta span {
    display: block;
}

.map-header__meta span {
    margin-top: 4px;
    font-size: 12px;
    color: rgba(255, 238, 216, 0.78);
}

.map-status-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.map-status-card {
    padding: 10px 12px;
    border-radius: 18px;
    background: rgba(17, 12, 9, 0.7);
    box-shadow: inset 0 0 0 1px rgba(255, 231, 208, 0.1);
}

.map-status-card span,
.map-status-card strong {
    display: block;
}

.map-status-card span {
    font-size: 12px;
    color: rgba(255, 236, 210, 0.68);
}

.map-status-card strong {
    margin-top: 6px;
    font-size: 17px;
    color: #fff2e1;
}

.map-scroll-wrap {
    position: absolute;
    inset: 0;
    border-radius: 0;
    overflow: hidden;
    background: #a6d985;
    box-shadow: none;
}

.map-scroll-hud {
    position: absolute;
    left: 12px;
    top: 124px;
    z-index: 1;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(17, 12, 9, 0.78);
    color: rgba(255, 244, 232, 0.9);
    font-size: 12px;
    backdrop-filter: blur(10px);
}

.map-scroll {
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
}

.map-scroll.is-grabbing {
    cursor: grabbing;
}

.map-canvas {
    position: relative;
    width: calc(var(--stage-height) * 2000 / 1334);
    min-width: 150%;
    height: 100%;
}

.map-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.map-markers {
    position: absolute;
    inset: 0;
}

.map-marker {
    position: absolute;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    overflow: visible;
}

.map-marker img {
    width: 100%;
    height: auto;
    display: block;
    filter: grayscale(1) brightness(0.88) drop-shadow(0 8px 12px rgba(0, 0, 0, 0.24));
    opacity: 0.78;
}

.map-marker.is-pending img {
    animation: map-marker-bob 1.7s ease-in-out infinite;
}

.map-marker em {
    display: none;
}

.map-marker__status {
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translate(-50%, 4px);
    z-index: 2;
    white-space: nowrap;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(58, 45, 35, 0.72);
    color: #fff4dd;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.22);
    pointer-events: none;
}

.map-marker em {
    background: rgba(255, 255, 255, 0.78);
    color: #3a2617;
}

.map-marker.is-completed img {
    filter: grayscale(0) brightness(1) drop-shadow(0 8px 12px rgba(0, 0, 0, 0.24));
    opacity: 1;
}

.map-marker.is-just-completed img {
    animation: marker-complete-flash 1.2s ease forwards;
}

.map-marker.is-completed em {
    background: rgba(160, 160, 160, 0.9);
    color: #fff;
}

@keyframes map-marker-bob {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes marker-complete-flash {
    0% {
        filter: grayscale(1) brightness(0.82);
        opacity: 0.45;
        transform: scale(0.92);
    }

    45% {
        filter: grayscale(0.2) brightness(1.12);
        opacity: 1;
        transform: scale(1.08);
    }

    100% {
        filter: grayscale(0) brightness(1);
        opacity: 1;
        transform: scale(1);
    }
}

/* --- Building Detail Popup --- */
.building-popup-shade {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 10;
}

.building-popup {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(88%, 420px);
    transform: translate(-50%, -50%);
    z-index: 11;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.building-popup-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    z-index: -1;
    pointer-events: none;
}

.building-popup-content {
    position: relative;
    width: 100%;
    padding: 16% 12% 16%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: #4a2810;
}

.building-popup-title {
    margin: 0 0 12px;
    font-size: 26px;
    color: #d13028;
    font-weight: bold;
    letter-spacing: 2px;
}

.building-popup-photo-wrap {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.building-popup-photo {
    width: 100%;
    display: block;
    height: auto;
}

.building-popup-desc {
    margin: 0 0 16px;
    font-size: 15px;
    line-height: 1.8;
    text-align: justify;
    color: #4e290f;
}

.building-popup-btn {
    position: relative;
    border: none;
    background: transparent;
    padding: 0;
    width: 55%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.building-popup-btn span {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -54%);
    color: #fff;
    font-size: 17px;
    font-weight: bold;
    letter-spacing: 2px;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(160, 30, 20, 0.8);
}

.building-popup-btn:active {
    transform: scale(0.95);
}

.building-popup-btn img {
    width: 100%;
    display: block;
    height: auto;
}

.map-mini-actions {
    position: absolute;
    right: 10px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
    z-index: 3;
    display: flex;
    gap: 6px;
    pointer-events: auto;
}

.map-tip-bar {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 52px);
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(41, 34, 25, 0.68);
    color: rgba(255, 248, 236, 0.94);
    font-size: 12px;
    line-height: 1.3;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(8px);
    pointer-events: none;
}

.map-tip-bar__progress {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 246, 222, 0.18);
    font-weight: 700;
}

.map-tip-bar__text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-mini-button,
.corner-button {
    border: 0;
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(55, 34, 18, 0.72);
    color: #fff7ec;
    font-size: 12px;
    line-height: 1;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(8px);
    cursor: pointer;
}

.map-mini-button--primary {
    color: #7f271f;
    background: linear-gradient(180deg, rgba(255, 244, 203, 0.96), rgba(255, 196, 92, 0.92));
    font-weight: 700;
    box-shadow: 0 7px 18px rgba(154, 74, 25, 0.26);
}

.corner-button {
    position: absolute;
    left: 14px;
    top: calc(env(safe-area-inset-top, 0px) + 14px);
    z-index: 5;
}

.corner-button--dark {
    color: #fdf3e6;
    background: rgba(44, 32, 23, 0.72);
}

.corner-button--light {
    position: static;
    color: #9c2e2c;
    background: rgba(255, 255, 255, 0.88);
}

.corner-button:disabled,
.map-mini-button:disabled {
    opacity: 0.45;
    cursor: default;
}

.art-hit {
    position: absolute;
    border: 0;
    padding: 0;
    background: transparent;
    color: transparent;
    cursor: pointer;
    pointer-events: auto;
}

.art-hit:disabled {
    cursor: default;
    pointer-events: none;
}

.art-hit:focus-visible,
.corner-button:focus-visible,
.map-mini-button:focus-visible {
    outline: 2px solid rgba(255, 224, 143, 0.96);
    outline-offset: 2px;
}

.building-actions {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 100;
}

.building-actions>* {
    pointer-events: auto;
}

.art-hit--building-start {
    left: 23%;
    top: 68%;
    width: 54%;
    height: 11%;
}

.question-sheet {
    position: absolute;
    inset: 0;
    color: #3d2719;
    display: flex;
    flex-direction: column;
}

.question-sheet-scroll {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-top: 25vh;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
}

.question-sheet-card {
    margin: 0 auto 0;
    position: relative;
    width: 86%;
    background: #fffdf5;
    border-radius: 12px;
    padding: 22px 18px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.question-sheet__meta {
    text-align: center;
    color: #c4493f;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

.question-sheet__title {
    margin: 0 0 20px;
    color: #3b281d;
    font-size: 17px;
    line-height: 1.55;
    font-weight: 700;
}

.question-sheet__options {
    display: grid;
    gap: 9px;
}

.question-option {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    padding: 8px 9px;
    border: 1px solid rgba(196, 73, 63, 0.18);
    border-radius: 12px;
    background: rgba(255, 250, 241, 0.82);
    cursor: pointer;
}

.question-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.question-option__key {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #f5e6cf;
    color: #b9423a;
    font-weight: 700;
}

.question-option input:checked+.question-option__key {
    background: #d84940;
    color: #fff;
}

.question-option__label {
    color: #3e2d23;
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.question-sheet-submit-wrap {
    padding: 12px 0 24px;
    display: flex;
    justify-content: center;
}

.question-action-btn {
    position: relative;
    border: none;
    background: transparent;
    padding: 0;
    width: 45%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.question-action-btn:active {
    transform: scale(0.95);
}

.question-action-btn img {
    width: 100%;
    display: block;
    height: auto;
}

.question-action-btn span {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -54%);
    color: #fff;
    font-size: 19px;
    font-weight: bold;
    letter-spacing: 2px;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(160, 30, 20, 0.8);
}

.result-sheet {
    position: absolute;
    inset: 25vh 0 0 0;
    display: flex;
    flex-direction: column;
}

.result-sheet-card {
    margin: 0 auto;
    position: relative;
    width: 86%;
    background: #fffdf5;
    border-radius: 12px;
    padding: 24px 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.result-sheet-illustration {
    width: 100%;
    max-width: 280px;
    height: auto;
    display: block;
    margin: 0 auto 16px;
}

.result-sheet-title {
    font-size: 20px;
    font-weight: bold;
    margin: 0 0 16px 0;
    text-align: center;
}

.result-sheet-title.is-correct {
    color: #df4433;
}

.result-sheet-title.is-wrong {
    color: #666;
}

.result-overlay__message {
    width: 102%;
    margin-left: -1%;
    background-color: #fff;
    color: #d94a42;
    text-align: center;
    font-size: 16px;
    line-height: 1.5;
    font-weight: 700;
    padding: 10px 0;
    margin-top: 4px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.lottery-ui {
    position: absolute;
    inset: 0;
}

.lottery-ui__chips {
    position: absolute;
    left: 8%;
    right: 8%;
    top: 41%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.lottery-chip {
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: #ad3c2d;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 5px 14px rgba(231, 103, 33, 0.14);
}

.lottery-ui__hint {
    position: absolute;
    left: 16%;
    right: 16%;
    top: 37%;
    text-align: center;
    color: #a63b35;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 700;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.art-hit--lottery-draw {
    left: 29%;
    top: 85%;
    width: 42%;
    height: 7%;
}

.lottery-ui__actions {
    position: absolute;
    left: 7%;
    right: 7%;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    display: flex;
    justify-content: space-between;
}

.prize-ui,
.lottery-ui,
.wallet-ui {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 100;
}

.prize-ui>*,
.lottery-ui>*,
.wallet-ui>* {
    pointer-events: auto;
}

.popup-shade {
    background: rgba(0, 0, 0, 0.76);
    display: flex;
    align-items: center;
    justify-content: center;
}

.prize-popup {
    position: relative;
    width: 85%;
    margin-top: -10%;
}

.prize-img {
    width: 100%;
    height: auto;
    display: block;
}

.thanks-shade {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.share-guide-shade {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 220;
    pointer-events: auto;
}

.share-guide-arrow {
    position: absolute;
    top: 5%;
    right: 8%;
    color: #fff6da;
    font-size: 72px;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
    transform: rotate(-12deg);
}

.share-guide-card {
    position: absolute;
    left: 8%;
    right: 8%;
    top: 18%;
    border-radius: 22px;
    background: rgba(255, 250, 240, 0.96);
    padding: 22px 18px 18px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.18);
    color: #6c3515;
}

.share-guide-title {
    font-size: 21px;
    line-height: 1.45;
    font-weight: 800;
    color: #8f4319;
}

.share-guide-text {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.7;
    color: rgba(89, 46, 20, 0.84);
}

.share-guide-button {
    margin-top: 18px;
    width: 100%;
    border: 0;
    border-radius: 14px;
    padding: 12px 14px;
    background: linear-gradient(180deg, #d86d42 0%, #b24d28 100%);
    color: #fffaf2;
    font-size: 15px;
    font-weight: 700;
}

.thanks-popup {
    position: relative;
    width: 85%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.thanks-img {
    width: 100%;
    height: auto;
    display: block;
}

.thanks-text {
    position: absolute;
    bottom: -36px;
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    font-size: 16px;
    letter-spacing: 1px;
}

.prize-touch-area {
    position: absolute;
    bottom: 5%;
    left: 15%;
    right: 15%;
    height: 18%;
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.wallet-ui-container {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    pointer-events: auto;
    -webkit-overflow-scrolling: touch;
}

.wallet-ui-container>* {
    pointer-events: auto;
}

.wallet-sheet {
    position: relative;
    margin: 20vh 8% 0;
    display: flex;
    flex-direction: column;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 44px);
}

.wallet-sheet-card {
    position: relative;
    background: #fffdf5;
    border-radius: 20px;
    padding: 36px 20px 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.wallet-sheet-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 18px;
    border-radius: 999px;
    background: #c35c4d;
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 2px;
    white-space: nowrap;
}

.wallet-item {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid #d4d0c1;
    padding-bottom: 12px;
}

.wallet-item:last-child {
    margin-bottom: 0;
}

.wallet-label {
    flex-shrink: 0;
    font-size: 18px;
    font-weight: 500;
    color: #333;
    margin-right: 16px;
}

.wallet-page-title {
    width: 80%;
    margin: 0 auto 50px;
    display: block;
}

.wallet-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
}

.wallet-tab {
    border: none;
    border-radius: 999px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.72);
    color: #8b3e25;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(100, 50, 16, 0.08);
}

.wallet-tab.is-active {
    background: linear-gradient(180deg, #d66542 0%, #b54934 100%);
    color: #fff8ef;
}

.wallet-panel.is-hidden {
    display: none;
}

.wallet-val {
    flex-grow: 1;
    font-size: 16px;
    letter-spacing: -0.5px;
    font-weight: bold;
    color: #111;
    word-break: break-all;
    text-align: right;
}

.wallet-meta {
    text-align: center;
    color: #a63b35;
    font-size: 13px;
    margin-top: 12px;
    margin-bottom: 32px;
    font-weight: 500;
}

.wallet-instructions {
    padding: 0 8px;
}

.wallet-guide-title {
    color: #c93427;
    font-size: 16px;
    font-weight: bold;
    margin: 0 0 12px 0;
}

.wallet-guide-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.wallet-guide-list li {
    position: relative;
    padding-left: 18px;
    color: #333;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 10px;
    font-weight: 500;
}

.wallet-guide-list li::before {
    content: "▶";
    position: absolute;
    left: 0;
    top: 2px;
    color: #c93427;
    font-size: 10px;
}

.wallet-history-card {
    background: rgba(255, 253, 245, 0.96);
    border-radius: 20px;
    padding: 20px 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.wallet-history-title {
    font-size: 17px;
    font-weight: 700;
    color: #8c3c25;
    margin-bottom: 14px;
}

.wallet-history-list {
    display: grid;
    gap: 10px;
    max-height: 40vh;
    overflow-y: auto;
    padding-right: 4px;
}

.wallet-history-item {
    border: 1px solid rgba(194, 90, 65, 0.12);
    border-radius: 16px;
    background: #fff;
    padding: 14px 14px 12px;
    text-align: left;
    display: grid;
    gap: 4px;
}

.wallet-history-item.is-active {
    border-color: rgba(194, 90, 65, 0.4);
    box-shadow: 0 10px 18px rgba(194, 90, 65, 0.12);
}

.wallet-history-item__level {
    font-size: 12px;
    font-weight: 700;
    color: #c34a36;
}

.wallet-history-item__name {
    font-size: 15px;
    font-weight: 700;
    color: #2e2118;
}

.wallet-history-item__time {
    font-size: 12px;
    color: rgba(70, 45, 32, 0.64);
}

.wallet-history-empty,
.wallet-empty-state {
    text-align: center;
    color: #6e5746;
}

.wallet-empty-state {
    margin: 40vh 8% 0;
    display: grid;
    gap: 10px;
    padding: 18px 16px;
    border-radius: 18px;
    background: rgba(255, 253, 245, 0.92);
}

.wallet-empty-state strong {
    font-size: 18px;
    color: #734024;
}

.wallet-empty-state span {
    font-size: 13px;
    line-height: 1.6;
}

.toast {
    position: absolute;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(20px);
    min-width: 160px;
    max-width: 82%;
    padding: 12px 16px;
    border-radius: 999px;
    background: rgba(18, 15, 13, 0.92);
    color: #fff7ef;
    font-size: 13px;
    text-align: center;
    z-index: 4;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.music-toggle {
    position: absolute;
    top: calc(env(safe-area-inset-top, 0px) + 14px);
    right: 14px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.75);
    background: rgba(255, 251, 240, 0.9);
    color: #9a4a1d;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 260;
    box-shadow: 0 10px 24px rgba(54, 31, 15, 0.16);
}

.music-toggle__icon {
    font-size: 18px;
    line-height: 1;
}

.music-toggle.is-playing .music-toggle__icon {
    animation: music-spin 3.6s linear infinite;
}

.music-toggle.is-muted {
    opacity: 0.6;
}

@keyframes music-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.dev-panel {
    display: none;
}

body.is-dev .app-shell {
    justify-content: center;
    gap: 24px;
    padding: 20px 24px;
}

body.is-dev .phone-shell {
    width: auto;
    flex: 0 0 auto;
}

body.is-dev .dev-panel {
    width: var(--panel-width);
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    background: var(--panel-bg);
    color: var(--panel-text);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    backdrop-filter: blur(14px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.dev-panel__header,
.dev-panel__footer {
    padding: 16px;
}

.dev-panel__header {
    border-bottom: 1px solid var(--panel-border);
}

.dev-panel__meta {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--panel-text-muted);
}

.screen-list {
    padding: 12px;
    overflow: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.debug-tools {
    padding: 14px 12px 0;
    display: grid;
    gap: 8px;
}

.debug-tools__title {
    font-size: 12px;
    color: var(--panel-text-muted);
}

.debug-tools button,
.debug-tools__toggle {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    text-align: left;
    background: rgba(255, 255, 255, 0.04);
    color: var(--panel-text);
    cursor: pointer;
}

.debug-tools button:hover,
.debug-tools__toggle:hover {
    background: rgba(255, 255, 255, 0.09);
}

.debug-tools__toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.debug-tools__toggle input {
    margin: 0;
}

.screen-list button {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    text-align: left;
    background: rgba(255, 255, 255, 0.04);
    color: var(--panel-text);
    cursor: pointer;
    transition: 0.2s ease;
}

.screen-list button:hover {
    background: rgba(255, 255, 255, 0.09);
}

.screen-list button.is-active {
    border-color: rgba(246, 159, 90, 0.45);
    background: rgba(246, 159, 90, 0.16);
    color: #fff2e8;
}

.dev-panel__footer {
    border-top: 1px solid var(--panel-border);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.dev-panel__footer a {
    color: #ffd5b0;
    text-decoration: none;
    font-size: 13px;
}

body.is-dev .hotspot {
    background: rgba(255, 176, 103, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 196, 137, 0.85);
}

body.is-dev .hotspot::after {
    content: attr(data-label);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    color: rgba(255, 247, 238, 0.96);
}

body.is-compare .hotspot,
body.is-compare .dev-panel {
    display: none !important;
}

@media (max-width: 980px) {
    body.is-dev {
        overflow: auto;
    }

    body.is-dev .app-shell {
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
    }

    body.is-dev .dev-panel {
        width: min(94vw, 580px);
        max-height: none;
    }
}

@media (max-width: 640px) {
    .login-scene {
        padding: 26px 18px 18px;
    }

    .login-panel {
        width: min(94%, 556px);
        height: min(74%, 540px);
        min-height: 410px;
    }

    .login-panel__content {
        inset: 12% 8% 12%;
    }

    .login-panel .overlay-card__title {
        font-size: 18px;
    }

    .scroll-story {
        padding: 12px 0 24px;
    }

    .scroll-story__frame {
        width: 100%;
        height: min(92%, 1180px);
    }

    .scroll-story__content {
        left: 11%;
        right: 11%;
        top: 18%;
        bottom: 17%;
    }

    .scroll-story__columns {
        font-size: 16px;
        gap: 14px;
    }

    .overlay-card {
        width: min(92%, 560px);
        padding: 18px 16px;
        border-radius: 20px;
    }

    .overlay-card__title {
        font-size: 21px;
    }

    .overlay-card--thanks .overlay-card__title {
        font-size: 24px;
    }

    .button-row {
        grid-template-columns: 1fr;
    }

    .floating-actions {
        width: min(48%, 170px);
    }

    .question-sheet__title {
        font-size: 16px;
    }

    .question-option {
        padding: 8px 9px;
    }

    .question-option__label {
        font-size: 13px;
    }

    .wallet-ui__value {
        font-size: 18px;
    }
}
