
.room-root {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding-bottom: 80px;
    position: relative;
}

.room-root.room-locked > *:not(.room-intro) {
    pointer-events: none;
    user-select: none;
}


.room-intro {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.room-intro.active {
    display: flex;
}

.room-intro-bg {
    position: absolute;
    inset: 0;
    background: #020810;
    transition: opacity 0.8s ease;
}

.room-intro-light {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(var(--t-glow-rgb), 0.25) 0%, transparent 55%);
    opacity: 0;
    transition: opacity 1s ease 0.3s;
}

.room-intro.doors-open .room-intro-light {
    opacity: 1;
}

.room-intro-frame {
    position: absolute;
    width: min(420px, 85vw);
    height: min(520px, 70vh);
    border: 4px solid rgba(var(--t-accent-rgb), 0.6);
    border-radius: 8px 8px 2px 2px;
    box-shadow: 0 0 60px rgba(0,0,0,0.8);
    z-index: 2;
    pointer-events: none;
}

.room-intro-door {
    position: absolute;
    top: 50%;
    width: min(210px, 42.5vw);
    height: min(520px, 70vh);
    background: linear-gradient(90deg, #0a1a3a, #001a4d);
    border: 2px solid rgba(var(--t-accent-rgb), 0.5);
    z-index: 3;
    transition: transform 1.1s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 0 40px rgba(0,0,0,0.6);
}

.room-intro-door-left {
    left: 50%;
    transform: translate(calc(-100% - 1px), -50%);
    border-radius: 6px 0 0 6px;
    border-right: 1px solid rgba(var(--t-accent-rgb), 0.3);
}

.room-intro-door-right {
    left: 50%;
    transform: translate(1px, -50%);
    border-radius: 0 6px 6px 0;
    border-left: 1px solid rgba(var(--t-accent-rgb), 0.3);
}

.room-intro-door-left::after,
.room-intro-door-right::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 10px;
    height: 10px;
    background: var(--t-accent);
    border-radius: 50%;
    transform: translateY(-50%);
    box-shadow: 0 0 8px var(--t-accent);
}

.room-intro-door-left::after { right: 16px; }
.room-intro-door-right::after { left: 16px; }

.room-intro.doors-open .room-intro-door-left {
    transform: translate(calc(-100% - 1px), -50%) translateX(-55%);
}

.room-intro.doors-open .room-intro-door-right {
    transform: translate(1px, -50%) translateX(55%);
}

.room-intro-caption {
    position: relative;
    z-index: 5;
    font-family: Muli, sans-serif;
    color: var(--t-accent);
    font-size: clamp(16px, 2.5vw, 22px);
    text-align: center;
    padding: 0 24px;
    max-width: 480px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    text-shadow: 0 2px 12px rgba(0,0,0,0.9);
    font-style: italic;
}

.room-intro.knock-done .room-intro-caption,
.room-intro.welcome-show .room-intro-caption {
    opacity: 1;
    transform: translateY(0);
}

.room-intro.fade-out {
    pointer-events: none;
}

.room-intro.fade-out .room-intro-bg,
.room-intro.fade-out .room-intro-door,
.room-intro.fade-out .room-intro-frame,
.room-intro.fade-out .room-intro-caption,
.room-intro.fade-out .room-intro-light {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.room-narrator {
    text-align: center;
    font-family: Muli, sans-serif;
    color: rgba(var(--t-glow-rgb), 0.75);
    font-size: 17px;
    font-style: italic;
    margin-bottom: 20px;
    min-height: 2.5em;
    transition: opacity 0.15s;
    padding: 0 16px;
}

.room-screen {
    display: none;
    animation: roomFadeIn 0.45s ease-out;
}

.room-screen-active {
    display: block;
}

@keyframes roomFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.room-back {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    font-family: Muli, sans-serif;
    background: rgba(var(--t-panel-rgb), 0.95);
    color: var(--t-accent);
    border: 2px solid var(--t-accent);
    border-radius: 24px;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    transition: background 0.2s, color 0.2s;
}

.room-back:hover {
    background: var(--t-accent);
    color: rgba(var(--t-panel-rgb), 1);
}

.room-floor {
    position: relative;
    background: linear-gradient(180deg, #0a1a3a 0%, #0a1a3a 58%, #3d2817 58%, #2a1a0f 100%);
    border: 2px solid rgba(var(--t-accent-rgb), 0.4);
    border-radius: 24px;
    min-height: clamp(700px, 78vh, 920px);
    width: 100%;
    overflow: hidden;
    box-shadow: inset 0 0 100px rgba(0,0,0,0.5), 0 10px 40px rgba(0,0,0,0.35);
}

.room-wall {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 58%;
    background:
        linear-gradient(90deg, transparent 48%, rgba(var(--t-accent-rgb), 0.08) 49%, rgba(var(--t-accent-rgb), 0.08) 51%, transparent 52%),
        linear-gradient(180deg, rgba(var(--t-panel-rgb), 0.5) 0%, transparent 100%);
    pointer-events: none;
}

.room-desk {
    position: absolute;
    bottom: 28%;
    left: 35%;
    width: 30%;
    height: 8%;
    background: linear-gradient(180deg, #4a3020, #2a1a0f);
    border-radius: 4px 4px 0 0;
    border-top: 2px solid rgba(var(--t-accent-rgb), 0.2);
    pointer-events: none;
    z-index: 1;
}

.room-shelf {
    position: absolute;
    top: 32%;
    left: 4%;
    width: 18%;
    height: 4px;
    background: rgba(var(--t-accent-rgb), 0.3);
    box-shadow: 0 30px 0 rgba(var(--t-accent-rgb), 0.2);
    pointer-events: none;
}

.room-rug {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 45%;
    height: 12%;
    background: radial-gradient(ellipse, rgba(139,69,19,0.35) 0%, transparent 70%);
    font-family: Muli, sans-serif;
    font-size: 11px;
    letter-spacing: 5px;
    color: rgba(var(--t-accent-rgb), 0.3);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.room-hotspot {
    position: absolute;
    background: rgba(var(--t-panel-rgb), 0.82);
    border: 2px solid rgba(var(--t-accent-rgb), 0.55);
    border-radius: 14px;
    padding: 14px 16px;
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    z-index: 3;
    min-width: 88px;
    color: var(--t-accent);
    font-family: Muli, sans-serif;
}

.room-hotspot:hover {
    transform: scale(1.1);
    border-color: var(--t-accent);
    box-shadow: 0 0 24px rgba(var(--t-accent-rgb), 0.5);
}

.room-hotspot:active {
    transform: scale(0.95);
}

.hs-icon {
    display: block;
    font-size: 32px;
    line-height: 1.2;
}

.hs-label {
    display: block;
    font-size: 12px;
    font-weight: bold;
    margin-top: 4px;
}

.hs-hint {
    display: block;
    font-size: 10px;
    opacity: 0.55;
    margin-top: 2px;
}

.room-window  { top: 6%;  left: 5%;  }
.room-boombox { top: 28%; left: 4%;  }
.room-pc      { top: 18%; right: 5%; }
.room-tea     { top: 44%; left: 40%; }
.room-jersey  { top: 6%;  right: 22%; }
.room-dog     { bottom: 20%; left: 8%; }
.room-diary   { top: 34%; right: 4%; }
.room-trash   { bottom: 12%; right: 6%; }
.room-drawer  { bottom: 28%; left: 28%; }
.room-fridge  { top: 20%; left: 22%; }
.room-bed     { bottom: 14%; left: 48%; }
.room-sock    { bottom: 22%; right: 22%; }
.room-clock   { top: 8%;  left: 38%; }
.room-poster  { top: 14%; right: 38%; }
.room-box     { bottom: 8%;  left: 62%; }

.mini-screen {
    background: rgba(var(--t-panel-rgb), 0.92);
    border: 1px solid rgba(var(--t-accent-rgb), 0.45);
    border-radius: 20px;
    padding: 36px 32px;
    text-align: center;
    color: var(--t-accent);
    font-family: Muli, sans-serif;
    max-width: 680px;
    margin: 0 auto;
}

.mini-screen-wide {
    max-width: 900px;
}

.mini-screen h2 {
    color: var(--t-accent);
    font-size: 22px;
    margin-bottom: 18px;
}

.room-action-btn {
    display: inline-block;
    margin-top: 18px;
    background: var(--t-accent);
    color: rgba(var(--t-panel-rgb), 1);
    border: none;
    border-radius: 14px;
    padding: 12px 26px;
    font-family: Muli, sans-serif;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.15s;
}

.room-action-btn:hover {
    transform: scale(1.06);
}

.room-link-btn {
    text-decoration: none;
}

@media (min-width: 1001px) {
    #starsView .stars-scene {
        max-width: 1204px;
        margin: 0 auto;
    }

    #starsView .stars-canvas-wrap {
        max-width: 1204px;
        max-height: 672px;
        width: 100%;
        min-height: unset;
        aspect-ratio: 16 / 9;
        height: auto;
        margin: 0 auto;
    }

    #starsView .stars-title {
        font-size: 32px;
    }

    #starsView .stars-sub {
        font-size: 16px;
    }

    #starsView .stars-panel {
        padding: 20px 26px;
    }

    #starsView .stars-panel h3 {
        font-size: 22px;
    }

    #starsView .stars-panel p {
        font-size: 17px;
    }

    .mini-screen-wide {
        max-width: 1260px;
    }
}

#cassettesView .cassette-scene {
    max-width: 100%;
}

#cassettesView .crt-screen {
    min-height: 180px;
}

.terminal-screen {
    text-align: left;
    max-width: 780px;
}

.terminal-screen h2 {
    font-size: 15px;
    margin-bottom: 14px;
    color: #3f3;
}

.terminal-output {
    background: #0a0f0a;
    border: 1px solid #2a2;
    border-radius: 10px;
    padding: 18px;
    min-height: 260px;
    max-height: 360px;
    overflow-y: auto;
    font-size: 14px;
    color: #2a2;
    margin-bottom: 14px;
}

.terminal-output div { margin: 4px 0; }

.terminal-input-row {
    display: flex;
    gap: 10px;
    align-items: center;
    color: #3f3;
}

.terminal-input-row input {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 1px solid #2a2;
    color: #3f3;
    font-family: Muli, sans-serif;
    font-size: 15px;
    outline: none;
    padding: 8px 0;
}

.tea-cup { font-size: 72px; animation: teaSteam 2s ease-in-out infinite; }

@keyframes teaSteam {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.tea-quote {
    font-size: 18px;
    line-height: 1.7;
    color: rgba(var(--t-glow-rgb), 0.85);
    min-height: 4em;
}

.bjk-canvas {
    width: 100%;
    max-width: 600px;
    height: 100px;
    margin: 0 auto 14px;
    display: block;
    border-radius: 10px;
}

.bjk-quote { font-size: 17px; line-height: 1.7; min-height: 3em; }

.dog-avatar { font-size: 80px; animation: dogWag 0.5s ease-in-out infinite alternate; }

@keyframes dogWag {
    from { transform: rotate(-6deg); }
    to { transform: rotate(6deg); }
}

.dog-thought { font-size: 17px; line-height: 1.7; font-style: italic; min-height: 3em; }

.diary-teaser { font-size: 15px; color: rgba(var(--t-glow-rgb), 0.6); }

.diary-quote {
    border-left: 4px solid var(--t-accent);
    padding: 14px 20px;
    margin: 18px 0;
    font-style: italic;
    text-align: left;
    font-size: 17px;
    color: rgba(var(--t-glow-rgb), 0.9);
}

.trash-can { font-size: 72px; animation: trashShake 0.3s ease-in-out infinite alternate; }

@keyframes trashShake {
    from { transform: rotate(-4deg); }
    to { transform: rotate(4deg); }
}

.trash-msg { font-size: 17px; line-height: 1.7; color: rgba(var(--t-glow-rgb), 0.85); min-height: 3em; }

.drawer-warn {
    color: #e74c3c;
    font-size: 14px;
    margin-bottom: 16px;
}

.drawer-list {
    text-align: left;
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 320px;
    overflow-y: auto;
}

.drawer-list li {
    padding: 10px 14px;
    border-bottom: 1px dashed rgba(var(--t-accent-rgb), 0.25);
    font-size: 15px;
    animation: drawerItem 0.4s ease-out backwards;
}

.drawer-list li:nth-child(odd) { background: rgba(0,0,0,0.15); }

@keyframes drawerItem {
    from { opacity: 0; transform: translateX(-12px); }
    to { opacity: 1; transform: translateX(0); }
}

.fridge-door {
    font-size: 72px;
    animation: fridgeOpen 1.5s ease-in-out infinite alternate;
}

@keyframes fridgeOpen {
    from { transform: scaleX(1); }
    to { transform: scaleX(0.92); }
}

.fridge-msg { font-size: 17px; line-height: 1.7; min-height: 3em; }

.bed-zzz { font-size: 72px; animation: bedPulse 2s ease-in-out infinite; }

@keyframes bedPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.08); }
}

.bed-msg { font-size: 17px; line-height: 1.7; font-style: italic; min-height: 3em; }

.sock-spin { font-size: 80px; animation: sockSpin 3s linear infinite; }

@keyframes sockSpin {
    from { transform: rotate(0deg) scaleX(-1); }
    to { transform: rotate(360deg) scaleX(-1); }
}

.sock-msg { font-size: 17px; line-height: 1.7; min-height: 4em; }

.clock-display {
    font-size: 64px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 20px var(--t-accent);
    letter-spacing: 4px;
    margin-bottom: 12px;
    font-variant-numeric: tabular-nums;
}

.clock-msg { font-size: 16px; line-height: 1.6; color: rgba(var(--t-glow-rgb), 0.7); }

.poster-frame {
    background: linear-gradient(135deg, #1a1a2e, #0a1a3a);
    border: 4px solid var(--t-accent);
    padding: 32px 28px;
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.5);
}

.poster-quote {
    font-size: 22px;
    font-weight: bold;
    line-height: 1.4;
    color: #fff;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.poster-author {
    display: block;
    margin-top: 16px;
    font-size: 12px;
    color: rgba(var(--t-glow-rgb), 0.5);
    font-style: italic;
}

.mystery-box {
    font-size: 80px;
    cursor: pointer;
    display: inline-block;
    transition: transform 0.1s;
}

.mystery-box.shaking {
    animation: boxShake 0.4s ease-in-out;
}

@keyframes boxShake {
    0%, 100% { transform: translateX(0) rotate(0); }
    20% { transform: translateX(-12px) rotate(-5deg); }
    40% { transform: translateX(12px) rotate(5deg); }
    60% { transform: translateX(-8px) rotate(-3deg); }
    80% { transform: translateX(8px) rotate(3deg); }
}

.mystery-msg { font-size: 17px; line-height: 1.7; min-height: 2.5em; }

.mystery-shake {
    font-size: 14px;
    color: rgba(var(--t-glow-rgb), 0.5);
    margin-top: 10px;
    min-height: 1.5em;
    font-style: italic;
}

.room-apartment {
    display: none;
}

article.content:has(#emreRoomRoot) {
    max-width: 100%;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

@media (max-width: 1000px) {
    .room-root {
        padding-bottom: 100px;
    }

    .room-floor {
        display: none !important;
    }

    .room-apartment {
        display: block;
    }

    .apt-room {
        border-radius: 20px;
        padding: 18px 14px 20px;
        margin-bottom: 8px;
        border: 2px solid rgba(var(--t-accent-rgb), 0.35);
        box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.25);
    }

    .apt-salon {
        background: linear-gradient(160deg, rgba(10, 26, 58, 0.95), rgba(var(--t-panel-rgb), 0.85));
    }

    .apt-bedroom {
        background: linear-gradient(160deg, rgba(20, 10, 40, 0.9), rgba(10, 26, 58, 0.9));
    }

    .apt-back {
        background: linear-gradient(160deg, rgba(15, 30, 25, 0.9), rgba(10, 26, 58, 0.9));
    }

    .apt-header {
        text-align: left;
        margin-bottom: 14px;
        padding-bottom: 10px;
        border-bottom: 1px dashed rgba(var(--t-accent-rgb), 0.3);
    }

    .apt-badge {
        display: inline-block;
        font-family: Muli, sans-serif;
        font-size: 18px;
        font-weight: bold;
        color: var(--t-accent);
        letter-spacing: 2px;
        text-transform: uppercase;
    }

    .apt-desc {
        margin: 6px 0 0;
        font-family: Muli, sans-serif;
        font-size: 13px;
        color: rgba(var(--t-glow-rgb), 0.5);
        font-style: italic;
    }

    .apt-hallway {
        text-align: center;
        font-family: Muli, sans-serif;
        font-size: 12px;
        color: rgba(var(--t-glow-rgb), 0.35);
        padding: 10px 0 14px;
        letter-spacing: 1px;
    }

    .apt-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }

    .room-mobile-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 88px;
        padding: 14px 10px;
        background: rgba(var(--t-panel-rgb), 0.85);
        border: 2px solid rgba(var(--t-accent-rgb), 0.45);
        border-radius: 16px;
        color: var(--t-accent);
        font-family: Muli, sans-serif;
        cursor: pointer;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        transition: transform 0.15s, border-color 0.15s, background 0.15s;
    }

    .room-mobile-btn:active {
        transform: scale(0.96);
        background: rgba(var(--t-accent-rgb), 0.25);
        border-color: var(--t-accent);
    }

    .mb-icon {
        font-size: 30px;
        line-height: 1.2;
    }

    .mb-label {
        font-size: 13px;
        font-weight: bold;
        margin-top: 6px;
    }

    .mb-hint {
        font-size: 10px;
        opacity: 0.55;
        margin-top: 2px;
    }

    .room-intro-door-left,
    .room-intro-door-right {
        height: min(420px, 58vh);
        width: min(180px, 38vw);
    }

    .room-intro-frame {
        height: min(420px, 58vh);
        width: min(360px, 76vw);
    }

    .room-intro.doors-open .room-intro-door-left {
        transform: translate(calc(-100% - 1px), -50%) translateX(-45%);
    }

    .room-intro.doors-open .room-intro-door-right {
        transform: translate(1px, -50%) translateX(45%);
    }

    .room-narrator {
        font-size: 14px;
        margin-bottom: 14px;
    }

    .room-back {
        bottom: max(14px, env(safe-area-inset-bottom));
        left: 50%;
        width: calc(100% - 32px);
        max-width: 360px;
        padding: 14px 20px;
        font-size: 15px;
        border-radius: 16px;
    }

    .mini-screen,
    .mini-screen-wide {
        max-width: 100%;
        padding: 24px 18px;
        margin: 0 4px;
    }

    .mini-screen h2 {
        font-size: 19px;
    }

    .clock-display { font-size: 44px; }
    .poster-quote { font-size: 16px; }

    #starsView .stars-scene,
    #cassettesView .cassette-scene {
        padding: 0 4px;
    }

    #starsView .stars-canvas-wrap {
        aspect-ratio: 4 / 3;
        min-height: 240px;
        max-height: 360px;
        border-radius: 12px;
    }

    #starsView .stars-title {
        font-size: 22px;
    }

    #starsView .stars-panel {
        left: 8px;
        right: 8px;
        bottom: 8px;
        padding: 12px 14px;
        max-height: 45%;
        overflow-y: auto;
    }

    #starsView .stars-panel h3 {
        font-size: 16px;
    }

    #starsView .stars-panel p {
        font-size: 13px;
    }

    #cassettesView .cassette-stage {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 14px;
    }

    #cassettesView .crt-screen {
        min-height: 140px;
    }

    #cassettesView .vu-meters {
        height: 60px;
        justify-content: center;
    }

    #cassettesView .boombox-deck {
        min-width: unset;
    }

    #cassettesView .tape-body {
        width: 120px;
    }

    .terminal-output {
        min-height: 200px;
        max-height: 280px;
        font-size: 13px;
    }

    .terminal-input-row input {
        font-size: 16px;
    }

    .drawer-list {
        max-height: 50vh;
    }

    .room-action-btn {
        min-height: 48px;
        padding: 12px 20px;
        width: 100%;
        max-width: 280px;
    }

    .room-link-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .apt-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
}

@media (max-width: 380px) {
    .apt-grid {
        gap: 10px;
    }

    .room-mobile-btn {
        min-height: 80px;
        padding: 12px 8px;
    }

    .mb-icon { font-size: 26px; }
    .mb-label { font-size: 12px; }
}
