/* === Bedroom Scene === */
.bedroom-scene {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Room background (for custom image overlay) */
.bedroom-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(180deg, #1a1228 0%, #2a1f3d 40%, #1e1533 100%);
}

/* === Room Hotspot Area (above action-bar) === */
.room-hotspot-area {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: calc(100% - 56px);
    z-index: 5;
    pointer-events: none;
}
.room-hotspot-area .wm-hotspot {
    pointer-events: all;
}
.room-hotspot-area.editing {
    z-index: 25;
    pointer-events: all;
}

/* === Bottom Action Bar === */
.action-bar {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 56px;
    background: linear-gradient(180deg, rgba(40,30,50,0.85), rgba(30,20,40,0.95));
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    z-index: 50;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-top: 1px solid rgba(255,255,255,0.1);
}

.action-btn {
    padding: 10px 18px;
    min-height: 44px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(180deg, #6a5acd, #5849b0);
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    white-space: nowrap;
}
.action-btn:hover {
    background: linear-gradient(180deg, #7b6bde, #6a5acd);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(106,90,205,0.4);
}
.action-btn:active {
    transform: translateY(0);
}
.action-btn .btn-icon {
    margin-right: 4px;
}

/* Pet canvas overlay — renders in front of all character sprites */
.pet-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 20;
    pointer-events: none;
}

/* Male protagonist standing position (left-center) */
.protagonist-slot {
    position: absolute;
    bottom: 56px;
    left: 20%;
    transform: translateX(-50%);
    width: 260px;
    height: 420px;
    z-index: 15;
    pointer-events: all;
    cursor: pointer;
}

/* Character standing position (right side for female, same height as male) */
.character-slot {
    position: absolute;
    bottom: 56px;
    right: 10%;
    width: 260px;
    height: 420px;
    z-index: 15;
    pointer-events: none;
}
.character-slot.active {
    pointer-events: all;
    cursor: pointer;
}

/* Visitor slot 2 — 右2: behind slot 1 on right side */
.character-slot-2 {
    right: 24% !important;
    z-index: 14 !important;
    opacity: 0.85;
}

/* Visitor slot 3 — 左1: left side front (beside protagonist) */
.character-slot-3 {
    position: absolute;
    bottom: 56px;
    left: 36%;
    transform: translateX(-50%);
    width: 260px;
    height: 420px;
    z-index: 14;
    opacity: 0.88;
    pointer-events: none;
}
.character-slot-3.active {
    pointer-events: all;
    cursor: pointer;
}

/* Visitor slot 4 — 左2: left side back (far left) */
.character-slot-4 {
    position: absolute;
    bottom: 56px;
    left: 8%;
    transform: translateX(-50%);
    width: 240px;
    height: 400px;
    z-index: 13;
    opacity: 0.75;
    pointer-events: none;
}
.character-slot-4.active {
    pointer-events: all;
    cursor: pointer;
}


/* === Livingroom Home Scene (客厅入口) === */
.livingroom-home-scene {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.livingroom-home-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(180deg, #1a2028 0%, #2a3040 40%, #1e2530 100%);
}

/* === Living Room / Garden Scene === */
.livingroom-scene {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.livingroom-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(180deg, #1a2818 0%, #2a3d1f 40%, #1e3318 100%);
}

/* === Kitchen Scene === */
.kitchen-scene {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.kitchen-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(180deg, #28201a 0%, #3d2f1f 40%, #33281e 100%);
}

/* === Girl's Home Scene === */
.girl-home-scene {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.girl-home-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(180deg, #281a28 0%, #3d1f3d 40%, #331e33 100%);
}


/* Character position in girl's home (same size as protagonist) */
.girl-home-char-slot {
    position: absolute;
    bottom: 56px;
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    height: 420px;
    z-index: 15;
    pointer-events: none;
}
.girl-home-char-slot.active {
    pointer-events: all;
    cursor: pointer;
}

/* === UserOC Room Scene === */
.useroc-room-scene {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.useroc-room-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(180deg, #1a1228 0%, #2a1f3d 50%, #1a1228 100%);
}

/* === Activity Overlay (eat / watch TV) === */
.activity-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-text {
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 4px;
    text-shadow: 0 2px 8px rgba(200, 150, 255, 0.4);
}

/* === Character Picker Overlay === */
.char-picker-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.char-picker-panel {
    width: 360px;
    max-width: 90%;
    max-height: 80%;
    background: linear-gradient(160deg, #2a1f3d, #1a1228);
    border-radius: 16px;
    border: 1px solid rgba(160, 120, 255, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.char-picker-title {
    font-size: 18px;
    font-weight: bold;
    color: #e8d0ff;
    text-align: center;
    margin-bottom: 16px;
    letter-spacing: 2px;
}

.char-picker-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.char-picker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all 0.2s;
}
.char-picker-item:hover {
    background: rgba(160, 120, 255, 0.15);
    border-color: rgba(160, 120, 255, 0.3);
}
.char-picker-item--disabled {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

.char-picker-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}
.char-picker-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.char-picker-info {
    flex: 1;
    min-width: 0;
}

.char-picker-name {
    font-size: 15px;
    color: #fff;
    font-weight: 600;
}

.char-picker-status {
    font-size: 12px;
    color: #aaa;
    margin-top: 2px;
}

.char-picker-empty {
    text-align: center;
    color: #888;
    padding: 24px 0;
    font-size: 14px;
}

.char-picker-close {
    margin-top: 14px;
    padding: 8px 0;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #ccc;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
}
.char-picker-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* === Away Overlay (character not home) === */
.away-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 60;
    pointer-events: none;
}

.away-text {
    font-size: 28px;
    color: #fff;
    font-weight: bold;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.away-sub {
    font-size: 14px;
    color: #aaa;
    margin-top: 8px;
}

/* ═══════════════════════════════════════════════
   Interaction Hub — date-scene style bottom bar
   ═══════════════════════════════════════════════ */
.interaction-hub {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 56px;
    z-index: 50;
}

.interaction-hub-actions {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 12px;
    background: linear-gradient(0deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.35) 70%, transparent 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
}

.interaction-hub-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 10px;
    border: none;
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    cursor: pointer;
    color: rgba(255,255,255,0.8);
    transition: all 0.15s;
    min-width: 48px;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
}
.interaction-hub-btn:hover {
    background: rgba(255,255,255,0.18);
}

.hub-btn-icon {
    font-size: 18px;
    line-height: 1;
}

/* Kenney PNG icon inside hub button */
.hub-btn-icon-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    opacity: 0.85;
    filter: brightness(1.1);
}

.hub-btn-label {
    font-size: 9px;
    color: rgba(255,255,255,0.5);
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════
   Interaction Zone — 通用交互区面板
   ═══════════════════════════════════════════════ */
.iz-overlay {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%;
    z-index: 60;
    background: linear-gradient(to top, rgba(15,15,30,0.95), rgba(15,15,30,0.7) 80%, transparent);
    transition: transform 0.3s ease;
}

.iz-title-bar {
    padding: 6px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.iz-title-text {
    font-size: 14px;
    color: rgba(255,255,255,0.8);
    letter-spacing: 1px;
}

.iz-close-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}
.iz-close-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.iz-stage {
    height: 250px;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 20px;
    padding: 0 16px;
}

.iz-char-slot {
    width: 180px;
    height: 250px;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s;
}
.iz-char-slot:hover {
    transform: scale(1.03);
}
.iz-char-slot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom;
}

.iz-char-name {
    text-align: center;
    font-size: 11px;
    color: #ccc;
    margin-top: 2px;
    position: absolute;
    bottom: -16px;
    left: 0; right: 0;
}

.iz-empty-hint {
    color: #666;
    font-size: 13px;
    text-align: center;
    padding-top: 100px;
    width: 100%;
}

.iz-actions {
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* dialogue-box inside interaction zone: flow layout instead of absolute */
.iz-overlay .dialogue-box {
    position: relative;
    bottom: auto; left: auto;
    width: 100%;
    margin: 0;
    border-radius: 0;
    border-left: none; border-right: none;
    z-index: auto;
}
.iz-overlay .dialogue-box.ai-mode {
    max-height: 220px;
}
