:root {
    --paper: #E6D0A1;
    --moss: #8FAF6D;
    --vermilion: #B7382E;
    --ink: #14100C;
    --lacquer: #4A2418;
    --rose: #D8A0A0;
    --neon: #1E5B73;
    --olive: #78734B;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--ink);
    color: var(--paper);
    font-family: "Noto Serif JP", serif;
}

button { font: inherit; color: inherit; }

.grain,
.static-field,
.shoji-wipe {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 20;
}

.grain {
    opacity: .24;
    mix-blend-mode: multiply;
    background:
        radial-gradient(circle at 20% 30%, rgba(74,36,24,.55) 0 1px, transparent 2px),
        radial-gradient(circle at 70% 60%, rgba(20,16,12,.5) 0 1px, transparent 2px),
        linear-gradient(90deg, rgba(230,208,161,.08), rgba(183,56,46,.04));
    background-size: 8px 8px, 13px 13px, 100% 100%;
}

.static-field {
    z-index: 21;
    opacity: .18;
    background-image: radial-gradient(circle, #E6D0A1 0 1px, transparent 1.5px);
    background-size: 11px 11px;
    animation: staticDrift .45s steps(2) infinite;
}

.shoji-wipe {
    z-index: 30;
    transform: translateX(-110%);
    background:
        linear-gradient(90deg, transparent 0 4%, rgba(230,208,161,.96) 4% 20%, rgba(120,115,75,.95) 20% 22%, rgba(230,208,161,.96) 22% 38%, rgba(120,115,75,.95) 38% 40%, rgba(230,208,161,.96) 40% 58%, rgba(120,115,75,.95) 58% 60%, rgba(230,208,161,.96) 60% 78%, rgba(120,115,75,.95) 78% 80%, rgba(230,208,161,.96) 80% 96%, transparent 96%);
}

.shoji-wipe.moving { animation: shojiSlide .68s cubic-bezier(.65,0,.2,1); }

.site-header {
    position: fixed;
    top: 24px;
    left: 28px;
    right: 28px;
    z-index: 25;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.matchbox-logo {
    position: relative;
    width: 168px;
    height: 70px;
    padding: 12px 16px;
    color: var(--lacquer);
    background: var(--paper);
    border: 3px solid var(--vermilion);
    box-shadow: 8px 8px 0 rgba(20,16,12,.5), inset 0 0 0 2px var(--olive);
    transform: rotate(-3deg);
}

.matchbox-logo span {
    display: block;
    font-family: "Shippori Mincho", serif;
    font-weight: 800;
    font-size: 24px;
    letter-spacing: .04em;
}

.matchbox-logo i {
    position: absolute;
    right: 12px;
    bottom: 9px;
    width: 42px;
    height: 10px;
    border-top: 2px solid var(--vermilion);
    border-bottom: 2px solid var(--vermilion);
}

.era-tabs {
    display: flex;
    gap: 8px;
    padding: 8px;
    background: rgba(20,16,12,.52);
    border: 1px solid rgba(230,208,161,.35);
}

.era-tabs button {
    border: 0;
    padding: 7px 12px;
    background: var(--lacquer);
    font-family: "BIZ UDPGothic", sans-serif;
    font-size: 13px;
    cursor: pointer;
}

.era-tabs button.active { background: var(--vermilion); color: var(--paper); }

.picture-scroll {
    position: relative;
    height: 100vh;
    width: 100vw;
    perspective: 1400px;
}

.scene {
    position: absolute;
    inset: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateX(12%) rotateY(-7deg) scale(.98);
    transition: opacity .72s ease, transform .72s cubic-bezier(.2,.8,.2,1);
    background: var(--ink);
}

.scene.active {
    opacity: 1;
    transform: translateX(0) rotateY(0) scale(1);
    z-index: 2;
}

.scene-card {
    position: absolute;
    left: clamp(28px, 8vw, 120px);
    bottom: clamp(48px, 10vh, 110px);
    max-width: 560px;
    padding: 28px 32px;
    background: rgba(230,208,161,.9);
    color: var(--ink);
    border: 2px solid var(--lacquer);
    box-shadow: 14px 14px 0 rgba(74,36,24,.5);
    clip-path: polygon(0 0, 96% 0, 100% 10%, 100% 100%, 4% 100%, 0 90%);
}

.era-stamp {
    margin: 0 0 12px;
    font-family: "BIZ UDPGothic", sans-serif;
    font-weight: 700;
    color: var(--vermilion);
    letter-spacing: .08em;
}

h1, h2 {
    margin: 0;
    font-family: "Shippori Mincho", serif;
    line-height: .96;
}

h1 { font-size: clamp(64px, 12vw, 168px); color: var(--lacquer); }
h2 { font-size: clamp(34px, 5vw, 72px); }

.scene-card p:last-child {
    margin: 18px 0 0;
    font-size: 18px;
    line-height: 1.75;
}

.radio-dawn {
    background:
        radial-gradient(circle at 75% 25%, rgba(216,160,160,.22), transparent 19%),
        linear-gradient(180deg, #14100C 0%, #4A2418 62%, #78734B 100%);
}

.sun-disc {
    position: absolute;
    right: 14vw;
    top: 12vh;
    width: 42vmin;
    height: 42vmin;
    border-radius: 50%;
    background: radial-gradient(circle, #B7382E 0 22%, #D8A0A0 23% 30%, transparent 31%);
    opacity: .62;
    filter: blur(.4px);
}

.tatami-grid {
    position: absolute;
    inset: auto 0 0;
    height: 44vh;
    background:
        linear-gradient(90deg, rgba(20,16,12,.25) 1px, transparent 1px),
        linear-gradient(0deg, rgba(20,16,12,.22) 1px, transparent 1px),
        #78734B;
    background-size: 18vw 100%, 100% 11vh, 100% 100%;
    transform: skewY(-3deg);
    transform-origin: bottom left;
}

.hanging-lamp {
    position: absolute;
    left: 50%;
    top: -6vh;
    width: 2px;
    height: 34vh;
    background: rgba(230,208,161,.42);
}

.hanging-lamp:after {
    content: "";
    position: absolute;
    left: -52px;
    bottom: -38px;
    width: 104px;
    height: 76px;
    border-radius: 50% 50% 42% 42%;
    background: radial-gradient(circle, #E6D0A1, #D8A0A0 56%, #B7382E 80%);
    box-shadow: 0 0 90px #D8A0A0;
}

.ghost {
    position: absolute;
    right: 25vw;
    bottom: 30vh;
    width: 110px;
    height: 220px;
    background: linear-gradient(rgba(230,208,161,.15), rgba(230,208,161,.02));
    border-radius: 55px 55px 18px 18px;
    filter: blur(2px);
    animation: ghostFloat 4s ease-in-out infinite;
}

.radio {
    position: absolute;
    right: 9vw;
    bottom: 13vh;
    width: 330px;
    height: 210px;
    padding: 22px;
    border-radius: 24px 24px 12px 12px;
    background: linear-gradient(135deg, #4A2418, #14100C);
    border: 4px solid #78734B;
    box-shadow: 0 24px 0 rgba(20,16,12,.35), 0 0 80px rgba(183,56,46,.28);
    cursor: pointer;
}

.radio-face { position: relative; height: 100%; border: 2px solid #E6D0A1; }
.dial { position: absolute; left: 28px; top: 32px; width: 118px; height: 72px; border-radius: 50%; background: #E6D0A1; box-shadow: 0 0 36px #B7382E; }
.dial span { position: absolute; inset: 14px; border-radius: inherit; background: repeating-linear-gradient(90deg, #14100C 0 2px, transparent 2px 10px), #D8A0A0; }
.speaker-lines { position: absolute; right: 26px; top: 30px; width: 105px; }
.speaker-lines i { display: block; height: 8px; margin: 12px 0; background: #8FAF6D; }
.knob { position: absolute; right: 38px; bottom: 22px; width: 42px; height: 42px; border-radius: 50%; background: #B7382E; border: 6px solid #E6D0A1; transition: transform .4s ease; }
.radio.tuned .knob { transform: rotate(120deg); }

.ration-kitchen { background: linear-gradient(150deg, #E6D0A1 0%, #78734B 46%, #4A2418 100%); }
.coupon-wall { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(6, 1fr); opacity: .72; }
.coupon-wall span { display: grid; place-items: center; min-height: 33vh; border: 1px dashed rgba(74,36,24,.45); color: rgba(74,36,24,.5); font-family: "Zen Antique", serif; font-size: 8vw; transform: rotate(-8deg); }
.kitchen-shelf { position: absolute; right: 10vw; top: 22vh; width: 360px; height: 24px; background: #4A2418; box-shadow: 0 160px 0 #4A2418; }
.kitchen-shelf i { position: relative; display: inline-block; top: -80px; width: 70px; height: 110px; margin: 0 18px; background: #D8A0A0; border: 5px solid #14100C; }
.rice-pot { position: absolute; right: 16vw; bottom: 18vh; width: 250px; height: 150px; border-radius: 0 0 110px 110px; background: #14100C; border-top: 24px solid #1E5B73; }
.rice-pot:before, .rice-pot:after { content:""; position:absolute; top:-92px; width:34px; height:90px; border-radius:50%; border-left: 5px solid rgba(230,208,161,.6); animation: steam 2.8s ease-in-out infinite; }
.rice-pot:before { left:70px; } .rice-pot:after { right:70px; animation-delay:.7s; }
.ticket-card { transform: rotate(1deg); }
.pull-tab, .curtain-pull, .rewind { position: absolute; right: 12vw; bottom: 10vh; border: 2px solid #14100C; background: #B7382E; color: #E6D0A1; padding: 14px 22px; font-family: "BIZ UDPGothic", sans-serif; box-shadow: 7px 7px 0 rgba(20,16,12,.4); cursor: pointer; }
.ration-kitchen.pulled .coupon-wall span { animation: couponFlutter .8s ease; }

.shotengai-rain { background: linear-gradient(180deg, #1E5B73, #14100C 80%); }
.rain { position:absolute; inset:0; background: repeating-linear-gradient(105deg, transparent 0 20px, rgba(230,208,161,.28) 21px 23px, transparent 24px 44px); animation: rainFall .35s linear infinite; }
.awning-row { position:absolute; top: 18vh; left: 0; right: 0; display:flex; height: 100px; }
.awning-row i { flex:1; background: repeating-linear-gradient(90deg, #B7382E 0 42px, #E6D0A1 42px 84px); clip-path: polygon(0 0,100% 0,95% 100%,5% 100%); border-bottom: 9px solid #4A2418; }
.neon-signs { position:absolute; right: 9vw; top: 31vh; display:grid; gap: 20px; }
.neon-signs b { display:block; padding: 14px 30px; border: 3px solid #D8A0A0; color:#D8A0A0; font-family:"Zen Antique", serif; font-size:42px; text-shadow: 0 0 18px #D8A0A0; box-shadow: inset 0 0 24px rgba(216,160,160,.2), 0 0 24px rgba(216,160,160,.25); }
.postbox { position:absolute; right: 22vw; bottom: 8vh; width: 95px; height: 190px; border-radius: 42px 42px 8px 8px; background:#B7382E; box-shadow: 12px 0 0 #4A2418; }
.postbox:before { content:"〒"; position:absolute; top:35px; width:100%; text-align:center; font-size:36px; color:#E6D0A1; }

.cinema-night { background: radial-gradient(circle at 55% 25%, #78734B 0 9%, transparent 10%), linear-gradient(180deg, #14100C, #4A2418); }
.curtains i { position:absolute; top:0; bottom:0; width: 31vw; background: repeating-linear-gradient(90deg, #4A2418 0 24px, #B7382E 24px 52px); transition: transform .7s ease; z-index:1; }
.curtains i:first-child { left:0; } .curtains i:last-child { right:0; }
.cinema-night.open .curtains i:first-child { transform: translateX(-65%); } .cinema-night.open .curtains i:last-child { transform: translateX(65%); }
.moon { position:absolute; right:19vw; top:13vh; width:120px; height:120px; border-radius:50%; background:#E6D0A1; box-shadow:0 0 70px #D8A0A0; }
.kaiju { position:absolute; right: 24vw; bottom: 11vh; width: 210px; height: 330px; background:#14100C; clip-path: polygon(45% 0,60% 10%,56% 22%,74% 31%,64% 45%,80% 61%,65% 67%,72% 100%,28% 100%,36% 68%,18% 60%,34% 45%,24% 32%,42% 22%); filter: drop-shadow(0 0 22px #B7382E); }
.ticket-strip { position:absolute; left: 10vw; top: 20vh; display:flex; transform: rotate(-7deg); }
.ticket-strip span { padding:15px 22px; background:#E6D0A1; color:#4A2418; border:2px dashed #B7382E; font-family:"Zen Antique", serif; }
.cinema-card { z-index:2; }

.expo-pavilion { background: radial-gradient(circle at 50% 42%, rgba(143,175,109,.36), transparent 31%), linear-gradient(135deg, #E6D0A1, #1E5B73 70%); }
.expo-orbits { position:absolute; right:10vw; top:12vh; width:45vw; height:60vh; }
.expo-orbits i { position:absolute; inset: 12%; border:3px solid rgba(230,208,161,.72); border-radius:50%; transform: rotate(20deg); animation: orbit 8s linear infinite; }
.expo-orbits i:nth-child(2) { inset: 25%; border-color:#D8A0A0; animation-duration: 6s; } .expo-orbits i:nth-child(3) { inset: 38%; border-color:#B7382E; animation-duration: 4s; }
.pavilion-dome { position:absolute; right:15vw; bottom:12vh; width:420px; height:210px; border-radius: 220px 220px 0 0; background: repeating-conic-gradient(from 0deg, #E6D0A1 0 10deg, #8FAF6D 10deg 20deg); border: 12px solid #14100C; }
.tin-toy { position:absolute; right: 42vw; bottom: 17vh; width:100px; height:140px; background:#D8A0A0; border:5px solid #14100C; }
.tin-toy:before { content:""; position:absolute; left:25px; top:-35px; width:40px; height:40px; border-radius:50%; background:#B7382E; }

.last-train { background: linear-gradient(180deg, #14100C, #1E5B73 44%, #78734B); }
.train-window { position:absolute; inset: 12vh 7vw 28vh 42vw; display:flex; gap:20px; padding:24px; background:#4A2418; border:10px solid #E6D0A1; }
.train-window i { flex:1; background: linear-gradient(#14100C, #1E5B73); border:4px solid #14100C; }
.strap-handles { position:absolute; left: 42vw; right: 7vw; top: 10vh; display:flex; justify-content:space-around; }
.strap-handles i { width: 52px; height: 92px; border: 7px solid #E6D0A1; border-top: 26px solid #E6D0A1; border-radius: 0 0 26px 26px; animation: sway 2.5s ease-in-out infinite; transform-origin: top; }
.platform-ghosts i { position:absolute; bottom: 16vh; width:70px; height:160px; border-radius:40px 40px 10px 10px; background:rgba(230,208,161,.16); filter: blur(2px); }
.platform-ghosts i:nth-child(1){ right:34vw; } .platform-ghosts i:nth-child(2){ right:24vw; height:130px; } .platform-ghosts i:nth-child(3){ right:14vw; height:180px; }
.rewind { background:#1E5B73; }

.rotary-nav {
    position: fixed;
    right: 28px;
    bottom: 30px;
    z-index: 26;
    text-align: center;
    font-family: "BIZ UDPGothic", sans-serif;
    color: var(--paper);
}

.rotary-face {
    position: relative;
    width: 156px;
    height: 156px;
    border-radius: 50%;
    background: radial-gradient(circle, #E6D0A1 0 24%, #4A2418 25% 58%, #14100C 59%);
    border: 4px solid #78734B;
    box-shadow: 0 0 0 5px rgba(230,208,161,.2);
}

.rotary-face button {
    position: absolute;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 0;
    background: #E6D0A1;
    color: #14100C;
    cursor: pointer;
}

.rotary-face button:nth-child(1){ left:61px; top:8px; }
.rotary-face button:nth-child(2){ right:20px; top:34px; }
.rotary-face button:nth-child(3){ right:20px; bottom:34px; }
.rotary-face button:nth-child(4){ left:61px; bottom:8px; }
.rotary-face button:nth-child(5){ left:20px; bottom:34px; }
.rotary-face button:nth-child(6){ left:20px; top:34px; }
.rotary-pointer { position:absolute; left:73px; top:25px; width:10px; height:54px; background:#B7382E; transform-origin: 50% 53px; transition: transform .55s ease; }
.rotary-nav p { margin: 8px 0 0; font-size: 12px; letter-spacing: .15em; }

.scroll-hint { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 25; font-family:"BIZ UDPGothic", sans-serif; color:#E6D0A1; background:rgba(20,16,12,.55); padding:8px 14px; }

@keyframes staticDrift { to { transform: translate(7px, -5px); } }
@keyframes shojiSlide { 0% { transform: translateX(-110%); } 45%,55% { transform: translateX(0); } 100% { transform: translateX(110%); } }
@keyframes ghostFloat { 50% { transform: translateY(-18px); opacity:.65; } }
@keyframes steam { 50% { transform: translateY(-25px) scaleX(1.5); opacity:.25; } }
@keyframes couponFlutter { 50% { transform: rotate(7deg) translateY(-18px); } }
@keyframes rainFall { to { background-position: 0 44px; } }
@keyframes orbit { to { transform: rotate(380deg); } }
@keyframes sway { 50% { transform: rotate(7deg); } }

@media (max-width: 820px) {
    .era-tabs { display: none; }
    .scene-card { left: 18px; right: 18px; bottom: 96px; padding: 20px; }
    .radio, .kitchen-shelf, .rice-pot, .neon-signs, .pavilion-dome, .train-window { transform: scale(.72); transform-origin: bottom right; right: 0; }
    .rotary-nav { transform: scale(.78); transform-origin: bottom right; }
    .scroll-hint { display: none; }
}
