:root {
    --ink: #f7f3ea;
    --muted: rgba(247, 243, 234, 0.68);
    --line: rgba(247, 243, 234, 0.18);
    --panel: rgba(13, 16, 18, 0.72);
    --accent: #d8d3cc;
    --accent-soft: rgba(216, 211, 204, 0.18);
    --deep: #101417;
    --red: #b8b2aa;
    --paper: #d8d3cc;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--deep);
    color: var(--ink);
}

button,
input {
    font: inherit;
}

.kiosk-screen {
    overflow: hidden;
}

.screen-stage {
    position: relative;
    display: grid;
    grid-template-columns: minmax(330px, 40vw) 1fr;
    min-height: 100vh;
    background:
        linear-gradient(90deg, rgba(216, 211, 204, 0.08), rgba(216, 211, 204, 0) 14%),
        #121517;
}

.hero-portrait {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background: #07090a;
}

.hero-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.03);
    transition: opacity 800ms ease, transform 1400ms ease;
}

.hero-portrait img.is-visible {
    opacity: 1;
    transform: scale(1);
}

.portrait-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0) 52%, rgba(18, 21, 23, 0.9)),
        linear-gradient(0deg, rgba(216, 211, 204, 0.1), rgba(216, 211, 204, 0) 34%);
}

.museum-watermark {
    position: absolute;
    left: clamp(24px, 3.2vw, 58px);
    bottom: clamp(22px, 3vw, 48px);
    z-index: 1;
    width: clamp(118px, 12vw, 210px);
    height: auto;
    opacity: 0.62;
    filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.55));
    pointer-events: none;
}

.hero-story {
    position: relative;
    display: block;
    min-height: 100vh;
    max-height: 100vh;
    padding: 3.1vh 3vw 5vh 2.5vw;
    overflow: hidden;
    min-width: 0;
    background:
        linear-gradient(135deg, rgba(37, 41, 43, 0.92), rgba(18, 21, 23, 0.96) 58%),
        #171a1c;
}

.hero-story::before {
    content: "";
    position: absolute;
    right: -10vw;
    bottom: -28vh;
    width: min(56vw, 760px);
    aspect-ratio: 1397 / 1894;
    background: url("/kiosk/assets/museum-back.png") center / contain no-repeat;
    opacity: 0.13;
    pointer-events: none;
}

.screen-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.screen-topline {
    display: flex;
    gap: 16px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hero-story h1 {
    position: relative;
    z-index: 1;
    margin: 0 0 24px;
    max-width: calc(100% - 220px);
    font-size: clamp(38px, 3.7vw, 64px);
    line-height: 0.96;
    letter-spacing: 0;
}

.hero-text {
    position: relative;
    z-index: 1;
    max-width: none;
    color: rgba(247, 243, 234, 0.9);
    font-size: clamp(17px, 1.28vw, 24px);
    line-height: 1.42;
}

.translation-notice {
    position: relative;
    z-index: 1;
    width: max-content;
    max-width: 100%;
    padding: 9px 13px;
    margin-bottom: 18px;
    border: 1px solid rgba(216, 211, 204, 0.36);
    color: var(--accent);
    font-size: clamp(15px, 1.1vw, 20px);
    line-height: 1.25;
}

.hero-text p {
    margin: 0 0 0.7em;
}

.hero-text strong {
    color: #fff;
}

.qr-panel {
    position: absolute;
    z-index: 2;
    top: 24px;
    right: 3vw;
    width: 172px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.96);
    color: #171717;
    border: 2px solid rgba(216, 211, 204, 0.86);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.qr-flow-spacer {
    float: right;
    width: 172px;
    height: 248px;
    margin: 0 0 22px 34px;
    pointer-events: none;
}

.qr-panel img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
}

.qr-panel p {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.25;
    font-weight: 700;
}

.qr-panel small {
    display: block;
    margin-top: 7px;
    max-width: 100%;
    overflow: hidden;
    color: #555;
    font-size: 8px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.remote-screen {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(216, 211, 204, 0.34), rgba(216, 211, 204, 0) 42%),
        #f7f5f2;
    color: #171717;
}

.remote-shell {
    width: min(720px, 100%);
    margin: 0 auto;
    padding: 22px 16px 34px;
}

.remote-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 2px solid rgba(39, 43, 45, 0.18);
}

.remote-kicker {
    display: block;
    margin-bottom: 4px;
    color: #5e5a55;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
}

.remote-header h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.1;
    letter-spacing: 0;
}

.language-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid rgba(39, 43, 45, 0.24);
}

.language-switch button {
    min-width: 54px;
    min-height: 44px;
    border: 0;
    background: transparent;
    color: #171717;
}

.language-switch button.is-active {
    background: #272b2d;
    color: #fff;
}

.remote-status {
    margin: 18px 0;
    padding: 12px 0;
    color: #5e5a55;
    font-size: 15px;
    border-bottom: 1px solid rgba(39, 43, 45, 0.14);
}

.remote-controls {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 18px;
}

.control-button,
.release-button,
.hero-list button {
    min-height: 48px;
    border: 1px solid rgba(39, 43, 45, 0.18);
    background: #fffdf8;
    color: #171717;
}

.control-button:active,
.release-button:active,
.hero-list button:active {
    transform: translateY(1px);
}

.search-box {
    display: grid;
    gap: 7px;
    margin-bottom: 14px;
    color: #5e5a55;
    font-size: 14px;
}

.search-box input {
    width: 100%;
    min-height: 52px;
    padding: 0 14px;
    border: 1px solid rgba(39, 43, 45, 0.22);
    background: #fff;
    color: #171717;
}

.hero-list {
    display: grid;
    gap: 8px;
}

.hero-list button {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 12px;
    align-items: center;
    width: 100%;
    padding: 7px 10px;
    text-align: left;
}

.hero-list img {
    width: 54px;
    height: 64px;
    object-fit: cover;
    background: #ddd;
}

.hero-list strong {
    display: block;
    font-size: 16px;
    line-height: 1.2;
}

.hero-list small {
    display: block;
    margin-top: 3px;
    color: #5e5a55;
}

.remote-footer {
    position: sticky;
    bottom: 0;
    margin-top: 18px;
    padding-top: 12px;
    background: linear-gradient(rgba(247, 245, 242, 0), #f7f5f2 22%);
}

.release-button {
    width: 100%;
    background: #171717;
    border-color: #171717;
    color: #fff;
}

.control-button:focus,
.release-button:focus,
.hero-list button:focus,
.search-box input:focus {
    outline: 2px solid #5e5a55;
    outline-offset: 2px;
}

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

.thanks-panel {
    width: min(560px, 100%);
    padding: 28px 0;
}

.thanks-panel h1 {
    margin: 0;
    color: #272b2d;
    font-size: clamp(34px, 10vw, 58px);
    line-height: 1.02;
    letter-spacing: 0;
}

.thanks-panel p {
    margin: 18px 0 0;
    color: #5e5a55;
    font-size: 18px;
    line-height: 1.4;
}

.thanks-panel a {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    margin-top: 28px;
    padding: 0 18px;
    border: 1px solid rgba(23, 23, 23, 0.22);
    background: #fffdf8;
    color: #171717;
    text-decoration: none;
}

@media (max-width: 900px) {
    .screen-stage {
        grid-template-columns: 1fr;
    }

    .hero-portrait {
        position: absolute;
        inset: 0;
        opacity: 0.32;
    }

    .portrait-shade {
        background: rgba(18, 21, 23, 0.72);
    }

    .hero-story {
        position: relative;
        min-height: 100vh;
        padding: 64px 28px 220px;
    }

    .qr-panel {
        top: 18px;
        right: 18px;
        width: 142px;
    }

    .qr-flow-spacer {
        width: 142px;
        height: 220px;
        margin: 0 0 18px 20px;
    }
}

@media (min-width: 1500px) {
    .qr-panel {
        width: 184px;
    }

    .hero-story h1 {
        max-width: calc(100% - 232px);
    }

    .qr-flow-spacer {
        width: 184px;
        height: 244px;
        margin-left: 42px;
    }

    .hero-text {
        font-size: clamp(18px, 1.22vw, 25px);
    }
}
