﻿:root {
    --primary: #d86f72;
    --secondary: #6fb7a8;
    --amber: #d6a85f;
    --bg: #111113;
    --wall: #1a1718;
    --floor: #121415;
    --panel: rgba(31, 29, 31, 0.78);
    --panel-soft: rgba(255, 255, 255, 0.06);
    --text: #fff8f0;
    --muted: #c9c0b7;
    --line: rgba(255, 255, 255, 0.12);
    --shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100%;
    color: var(--text);
    background:
        linear-gradient(180deg, rgba(216, 111, 114, 0.1), transparent 340px),
        linear-gradient(135deg, rgba(111, 183, 168, 0.1), transparent 520px),
        linear-gradient(180deg, #171416 0%, #101113 62%, #0d0e0f 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    letter-spacing: 0;
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.memorial-app {
    width: min(1320px, calc(100% - 28px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 16px 0 34px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    align-items: start;
}

.hero-panel {
    min-height: calc(100vh - 32px);
    position: sticky;
    top: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 246, 232, 0.08), transparent 34%),
        linear-gradient(180deg, #2a2220 0%, #1b1818 56%, #141413 57%, #0f1010 100%);
    box-shadow: var(--shadow);
}

.hero-panel::before {
    display: none;
}

.hero-panel::after {
    display: none;
}

.title-group {
    position: absolute;
    z-index: 4;
    top: 18px;
    left: 18px;
    display: grid;
    gap: 6px;
    max-width: min(380px, calc(100% - 36px));
    padding: 13px 15px;
    border-radius: 8px;
    background: rgba(17, 15, 16, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(14px);
}

.eyebrow {
    margin: 0;
    color: var(--secondary);
    font-size: 12px;
    font-weight: 700;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: clamp(32px, 5vw, 56px);
    line-height: 1;
    letter-spacing: 0;
}

.title-group p:last-child {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.life-overlay {
    position: absolute;
    z-index: 4;
    top: 14px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    max-width: min(520px, calc(100% - 28px));
    padding: 9px 12px;
    border-radius: 8px;
    background: rgba(17, 15, 16, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(14px);
    color: var(--muted);
    font-size: 13px;
}

.life-overlay span,
.life-overlay strong {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
}

.life-overlay strong {
    color: var(--text);
}

.stage-wrap {
    min-height: calc(100vh - 32px);
    position: relative;
    display: grid;
}

.video-stage {
    min-height: calc(100vh - 32px);
    display: grid;
    align-items: center;
    justify-items: center;
    overflow: hidden;
    background: #050505;
    padding: 0;
}

.video-stage video {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    background: #050505;
    mix-blend-mode: normal;
    filter: none;
}

.video-placeholder {
    width: 100%;
    height: 100%;
    min-height: calc(100vh - 32px);
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    padding: 24px;
    text-align: center;
    color: var(--muted);
}

.video-placeholder strong {
    color: var(--text);
    font-size: 36px;
}

.response-bubble {
    display: none;
}

.control-panel {
    min-height: calc(100vh - 32px);
    display: grid;
    gap: 14px;
    align-content: start;
}

.mobile-scroll-panel {
    min-width: 0;
    display: grid;
    gap: 14px;
}

.life-card,
.care-card,
.talk-card,
.action-card {
    padding: 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: var(--panel);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(14px);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.panel-header h2 {
    margin: 0;
    font-size: 20px;
    line-height: 1.2;
}

.panel-header span,
#statusText,
#lifeHomeDays {
    color: var(--secondary);
    font-size: 13px;
    white-space: nowrap;
}

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

.status-meter {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 7px 8px;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-meter span {
    color: var(--muted);
    font-size: 13px;
}

.status-meter strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.status-meter i {
    grid-column: 1 / -1;
    height: 6px;
    display: block;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
}

.status-meter b {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    transition: width 0.35s ease;
}

.status-meter[data-state="hunger"] b {
    background: linear-gradient(90deg, var(--secondary), var(--amber), var(--primary));
}

.care-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.care-btn,
.action-btn,
.primary-btn,
.icon-btn {
    min-height: 44px;
    border-radius: 8px;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.care-btn {
    min-height: 64px;
    display: grid;
    gap: 5px;
    justify-items: center;
    align-content: center;
    padding: 8px 6px;
    background: rgba(255, 255, 255, 0.06);
}

.care-btn span {
    color: var(--secondary);
    font-size: 18px;
    line-height: 1;
}

.care-btn strong {
    font-size: 13px;
    line-height: 1.2;
}

.talk-box {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
}

input,
textarea {
    width: 100%;
    min-width: 0;
    color: var(--text);
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    outline: none;
    padding: 12px 13px;
}

input::placeholder,
textarea::placeholder {
    color: rgba(255, 248, 240, 0.42);
}

input:focus,
textarea:focus {
    border-color: var(--secondary);
}

.primary-btn {
    padding: 0 16px;
    background: var(--primary);
    border-color: transparent;
}

.icon-btn {
    padding: 0 13px;
    background: rgba(111, 183, 168, 0.18);
    border-color: rgba(111, 183, 168, 0.36);
}

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

.action-btn {
    min-height: 62px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: center;
    padding: 12px;
    text-align: left;
    background: rgba(255, 255, 255, 0.055);
}

.action-btn span {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: var(--secondary);
    background: rgba(255, 255, 255, 0.08);
}

.action-btn strong {
    font-size: 14px;
    line-height: 1.35;
}

.care-btn:hover,
.action-btn:hover,
.primary-btn:hover,
.icon-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

.setup-state {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.setup-state section {
    max-width: 680px;
    padding: 24px;
    border-radius: 8px;
    background: var(--panel);
    border: 1px solid var(--line);
}

.muted {
    color: var(--muted);
}

@media (max-width: 1080px) {
    .memorial-app {
        grid-template-columns: 1fr;
        width: min(100% - 20px, 820px);
        padding-top: 10px;
    }

    .hero-panel {
        position: sticky;
        top: 10px;
        z-index: 5;
        min-height: 64svh;
        height: 64svh;
    }

    .stage-wrap,
    .video-stage,
    .video-placeholder {
        min-height: 100%;
        height: 100%;
    }

    .control-panel {
        position: relative;
        z-index: 2;
        min-height: auto;
    }
}

@media (max-width: 680px) {
    html,
    body {
        height: 100%;
        overflow: hidden;
    }

    body {
        background: #0d0e0f;
    }

    .memorial-app {
        width: 100vw;
        height: 100vh;
        height: 100svh;
        min-height: 100vh;
        min-height: 100svh;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 0;
        overflow: hidden;
    }

    .hero-panel {
        position: relative;
        top: auto;
        z-index: 5;
        flex: 0 0 62vh;
        flex-basis: min(66svh, calc(100svh - 168px));
        width: 100vw;
        min-height: 0;
        height: auto;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        overflow: hidden;
        border: 0;
        border-radius: 0;
        background: #050505;
        box-shadow: none;
    }

    .stage-wrap,
    .video-stage,
    .video-placeholder {
        min-height: 0;
        height: 100%;
    }

    .stage-wrap {
        min-width: 0;
    }

    .video-stage {
        width: 100vw;
        align-items: stretch;
        justify-items: stretch;
    }

    .video-stage video {
        display: block;
        width: 100vw;
        height: 100%;
        object-fit: cover;
        object-position: center center;
    }

    .video-placeholder {
        min-height: 0;
    }

    .title-group {
        top: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
        padding: 10px 12px;
    }

    h1 {
        font-size: 34px;
    }

    .title-group p:last-child {
        display: none;
    }

    .life-overlay {
        position: relative;
        left: auto;
        right: auto;
        top: auto;
        transform: none;
        width: 100vw;
        max-width: none;
        min-height: 42px;
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 8px;
        overflow-x: auto;
        padding: 8px 10px;
        border-width: 0 0 1px;
        border-radius: 0;
        background: rgba(17, 15, 16, 0.92);
        scrollbar-width: none;
    }

    .life-overlay::-webkit-scrollbar {
        display: none;
    }

    .life-overlay span,
    .life-overlay strong {
        flex: 0 0 auto;
        min-height: 24px;
        font-size: 12px;
        line-height: 1.2;
        white-space: nowrap;
    }

    .control-panel {
        position: relative;
        z-index: 6;
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        gap: 0;
        overflow: hidden;
        background: #101113;
    }

    .mobile-scroll-panel {
        flex: 1 1 auto;
        min-height: 0;
        display: grid;
        align-content: start;
        gap: 10px;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding: 10px 8px calc(16px + env(safe-area-inset-bottom));
    }

    .life-card {
        flex: 0 0 auto;
        padding: 8px 10px 10px;
        border-width: 0 0 1px;
        border-radius: 0;
        background: rgba(31, 29, 31, 0.94);
        box-shadow: none;
    }

    .care-card,
    .talk-card,
    .action-card {
        padding: 12px;
        box-shadow: none;
    }

    .life-card .panel-header {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        margin-bottom: 8px;
    }

    .life-card .panel-header h2 {
        max-width: 58%;
        overflow: hidden;
        font-size: 15px;
        line-height: 1.2;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #lifeHomeDays {
        font-size: 12px;
    }

    .status-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .status-meter {
        min-width: 0;
        padding: 6px;
        gap: 4px 5px;
        border-radius: 6px;
    }

    .status-meter span,
    .status-meter strong {
        min-width: 0;
        font-size: 11px;
        line-height: 1.1;
    }

    .status-meter strong {
        text-align: right;
    }

    .status-meter i {
        height: 4px;
    }

    .care-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .action-grid {
        grid-template-columns: 1fr;
    }

    .talk-box {
        grid-template-columns: 1fr;
    }

    .panel-header {
        align-items: center;
        flex-direction: row;
        gap: 8px;
        margin-bottom: 10px;
    }

    .panel-header h2 {
        font-size: 17px;
    }

    .panel-header span,
    #statusText {
        font-size: 12px;
    }
}


