/* ================= css/pages/cottage.css ================= */
/* 像素小屋（横版）：旋转 90° 铺满竖屏手机；左 3/4 小屋 + 右 1/4 数据面板 */

.cottage-subpage {
    background: #1f1b18;
    overflow: hidden;
}

/* ---- 强制横屏框 ---- */
/* 元素本身宽=竖屏高、高=竖屏宽，旋转 90° 后正好铺满视口 */
.cottage-landscape {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vh;
    height: 100vw;
    transform-origin: top left;
    transform: rotate(90deg) translateY(-100%);
    background: #1f1b18;
    overflow: hidden;
}

.cottage-body {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
}

/* ---- 左 3/4：小屋舞台 ---- */
.cottage-stage {
    position: relative;
    flex: 3 1 0;
    height: 100%;
    overflow: hidden;
    background: #1f1b18;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

#cottage-canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* 返回按钮（浮于左上） */
.cottage-back-fab {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.85);
    color: #8b5e3c;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.22);
    z-index: 6;
}
.cottage-back-fab:active { transform: scale(0.94); }

/* 房间标签（浮于上方居中） */
.cottage-room-tag {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 52px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: rgba(139, 94, 60, 0.78);
    padding: 6px 14px;
    border-radius: 999px;
    z-index: 4;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

/* ---- 靠近家具的可交互提示 ---- */
.cottage-hint {
    position: absolute;
    top: 56px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 88%;
    background: rgba(43, 34, 28, 0.84);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 14px;
    padding: 8px 12px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
    z-index: 5;
    animation: cottage-pop 0.18s ease;
}
.cottage-hint[hidden] { display: none; }
.cottage-hint-name { font-size: 14px; font-weight: 700; white-space: nowrap; }
.cottage-hint-name::before { content: "「"; opacity: 0.6; }
.cottage-hint-name::after  { content: "」"; opacity: 0.6; }
.cottage-hint-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cottage-chip {
    font-size: 12.5px;
    line-height: 1;
    color: #2b2622;
    background: #f2d9b8;
    border: none;
    border-radius: 999px;
    padding: 7px 11px;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.1s, background 0.1s;
}
.cottage-chip:active { transform: scale(0.93); background: #e8c49a; }

/* ---- 行动反馈 toast ---- */
.cottage-toast {
    position: absolute;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(43, 34, 28, 0.9);
    color: #fff;
    font-size: 13.5px;
    padding: 9px 16px;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: 6;
    animation: cottage-pop 0.2s ease;
}
.cottage-toast[hidden] { display: none; }

@keyframes cottage-pop {
    from { opacity: 0; transform: translateX(-50%) translateY(6px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ---- 控制层 ---- */
.cottage-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 18px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
    z-index: 5;
}
.cottage-controls > * { pointer-events: auto; }

.cottage-dpad { position: relative; width: 132px; height: 132px; opacity: 0.92; }
.dpad-btn {
    position: absolute;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
    color: #8b5e3c;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.22);
    cursor: pointer;
    touch-action: none;
}
.dpad-btn.active, .dpad-btn:active { background: #f2d9b8; transform: scale(0.95); }
.dpad-up    { top: 0;   left: 44px; }
.dpad-left  { top: 44px; left: 0; }
.dpad-down  { top: 88px; left: 44px; }
.dpad-right { top: 44px; left: 88px; }

.cottage-action-btn {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    border: none;
    background: rgba(242, 217, 184, 0.95);
    color: #8b5e3c;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    touch-action: none;
}
.cottage-action-btn:active { transform: scale(0.94); background: #e8c49a; }

/* ---- 右 1/4：数据面板 ---- */
.cottage-panel {
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
    background: #efe3d2;
    border-left: 2px solid #d9c3a3;
    display: flex;
    flex-direction: column;
}

.cottage-panel-tabs {
    display: flex;
    padding: 10px 10px 6px;
    gap: 6px;
    flex-shrink: 0;
}
.cpanel-tab {
    flex: 1;
    border: none;
    background: rgba(139, 94, 60, 0.1);
    color: #8b5e3c;
    font-size: 12.5px;
    font-weight: 600;
    padding: 8px 4px;
    border-radius: 10px;
    cursor: pointer;
}
.cpanel-tab.active { background: #8b5e3c; color: #fff; }

.cottage-panel-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 4px 12px 10px;
    -webkit-overflow-scrolling: touch;
}
.cottage-panel-mod[hidden] { display: none; }
.cottage-panel-note {
    flex-shrink: 0;
    text-align: center;
    font-size: 10.5px;
    color: #a98c6a;
    padding: 6px 4px 8px;
    border-top: 1px solid #e0cfb2;
}

/* 分组标题 */
.cp-group-title {
    font-size: 11.5px;
    font-weight: 700;
    color: #8b5e3c;
    margin: 12px 0 6px;
    letter-spacing: 0.5px;
}
.cp-group-title:first-child { margin-top: 4px; }

/* 指标条 */
.cp-bar-row { margin-bottom: 7px; }
.cp-bar-head {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #5d4a38;
    margin-bottom: 3px;
}
.cp-bar-val { color: #8b5e3c; font-weight: 600; }
.cp-bar-track {
    height: 7px;
    background: rgba(139, 94, 60, 0.14);
    border-radius: 999px;
    overflow: hidden;
}
.cp-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
}

/* 情绪卡 */
.cp-emotion {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    padding: 10px 12px;
    margin-top: 6px;
}
.cp-emotion-label { font-size: 16px; font-weight: 700; color: #6b4f3a; }
.cp-emotion-sub { font-size: 10.5px; color: #a98c6a; margin-top: 2px; }

/* 行为模块 */
.cp-state-card {
    background: rgba(255, 255, 255, 0.55);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
}
.cp-state-who { font-size: 11px; color: #a98c6a; }
.cp-state-act { font-size: 14px; font-weight: 600; color: #6b4f3a; margin-top: 2px; }
.cp-log-title { font-size: 11.5px; font-weight: 700; color: #8b5e3c; margin: 10px 0 6px; }
.cp-log-item {
    font-size: 11.5px;
    color: #5d4a38;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    margin-bottom: 5px;
}
.cp-log-empty { font-size: 11px; color: #a98c6a; padding: 4px; }
