@font-face {
    font-family: 'Nostalgic';
    src: url('assets/fonts/nostalgic.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Print';
    src: url('assets/fonts/print.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Typewriter';
    src: url('assets/fonts/typewriter.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Nostalgic', 'Print', 'Typewriter', serif;
    cursor: default;
    background-color: #000;
}

.scene {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    transition: opacity 1.2s ease-in-out;
}

.scene.fade-out {
    opacity: 0;
}

.background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 0;
}

.background-inner {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    aspect-ratio: 16/9;
    background-image: url('assets/background/room.jpg');
    background-size: cover;
    background-position: center;
}

.objects-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.8s ease;
}

.objects-container.dissolving {
    opacity: 0;
}

.object-wrapper {
    position: absolute;
    pointer-events: auto;
    opacity: 0;
    transition: opacity 1s ease;
    will-change: opacity;
}

.object-wrapper.visible {
    opacity: 1;
}

.object-wrapper.hidden {
    opacity: 0 !important;
    pointer-events: none;
}

.object {
    width: 100%;
    height: 100%;
    cursor: grab;
    transition: filter 0.3s ease;
    will-change: transform;
    position: relative;
}

.object:active {
    cursor: grabbing;
}

.object img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.object:hover,
.object.hover {
    filter: brightness(1.15) drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.object:hover .object-name,
.object.hover .object-name {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

.object.clicked {
    filter: brightness(1.15) drop-shadow(0 0 8px rgba(255, 255, 255, 0.25));
}

.object.dragging {
    cursor: grabbing;
    filter: brightness(1.2) drop-shadow(0 0 15px rgba(255, 255, 255, 0.5));
    z-index: 1000 !important;
    transition: none;
}

.object-name {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-family: 'nostalgic', serif;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 
        0 0 8px rgba(0, 0, 0, 0.9),
        0 1px 3px rgba(0, 0, 0, 0.8),
        0 0 2px rgba(0, 0, 0, 1);
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
}

.iron-box-container {
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    z-index: 5;
    transition: left 1s ease;
    pointer-events: none;
}

.iron-box-container.visible {
    left: 50%;
    transform: translateY(-50%);
}

.iron-box-container.center {
    left: calc(50% - 240px);
    transform: translateY(-50%);
}

.iron-box {
    width: 480px;
    height: 320px;
    cursor: pointer;
    position: relative;
    pointer-events: none;
}

.iron-box-image {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none;
}

.iron-box-open {
    opacity: 1;
}

.iron-box-closed {
    opacity: 0;
    transform: scale(0.65);
    transform-origin: center center;
}

.iron-box.closed .iron-box-open {
    opacity: 0;
}

.iron-box.closed .iron-box-closed {
    opacity: 1;
    transform: scale(0.65);
    transform-origin: center center;
}

.iron-box-slots {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 50px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-top: 10px;
    pointer-events: none;
}

.slot {
    width: 40px;
    height: 40px;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    pointer-events: none;
}

.continue-text {
    position: absolute;
    bottom: 30px;
    right: 40px;
    z-index: 200;
    text-align: right;
    pointer-events: auto;
}

.continue-option,
.close-option,
.look-option {
    display: block;
    color: #39ff14;
    font-size: 0.8rem;
    line-height: 1.6;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: color 0.3s ease;
    text-shadow: 
        0 0 5px #39ff14,
        0 0 10px #39ff14,
        0 0 15px #39ff14;
}

.continue-option:hover,
.close-option:hover,
.look-option:hover {
    color: #222;
    text-shadow: none;
}

.close-option,
.look-option {
    display: none;
}

.continue-text.has-items .continue-option {
    display: none;
}

.continue-text.has-items .close-option,
.continue-text.has-items .look-option {
    display: block;
}

.continue-text.hidden {
    opacity: 0;
    pointer-events: none;
}

.text-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.text-overlay.visible {
    opacity: 1;
}

.text-content {
    max-width: 60%;
    text-align: center;
    color: #333;
    font-size: 1.2rem;
    line-height: 1.8;
    letter-spacing: 0.05em;
    text-shadow: 
        0 1px 2px rgba(255, 255, 255, 0.8),
        0 0 6px rgba(57, 255, 20, 0.6),
        0 0 12px rgba(57, 255, 20, 0.4),
        0 0 18px rgba(57, 255, 20, 0.3);
}

@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.01); }
}

@keyframes sway {
    0%, 100% { transform: rotate(-1deg); }
    50% { transform: rotate(1deg); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; }
}

@keyframes flicker {
    0%, 100% { filter: brightness(1); }
    92% { filter: brightness(1); }
    93% { filter: brightness(0.98); }
    94% { filter: brightness(1); }
    96% { filter: brightness(0.99); }
    97% { filter: brightness(1); }
}

.intro-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 1s ease;
}

.intro-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.intro-text {
    color: #ccc;
    font-size: 0.9rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.intro-text .char {
    display: inline-block;
    transition: all 0.8s ease;
    opacity: 0;
    transform: translateY(10px);
}

.intro-text .char.revealed {
    opacity: 1;
    transform: translateY(0);
}

.choice-container {
    position: absolute;
    top: calc(50% + 60px);
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 50;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

.choice-container.visible {
    opacity: 1;
    pointer-events: auto;
}

.choice-text {
    color: #2d2520;
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 40px;
    text-shadow: 
        0 0 6px rgba(57, 255, 20, 0.6),
        0 0 12px rgba(57, 255, 20, 0.4),
        0 0 18px rgba(57, 255, 20, 0.3);
}

.choice-text .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.8s ease;
}

.choice-text .char.revealed {
    opacity: 1;
    transform: translateY(0);
}

.choices {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0 40px;
    box-sizing: border-box;
}

.choice-option {
    color: #ff3333;
    font-size: 0.8rem;
    line-height: 1.6;
    text-shadow: 
        0 0 5px #ff3333,
        0 0 10px #ff3333,
        0 0 15px #ff3333;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(10px);
    display: none;
}

.choice-option.revealed {
    display: inline-block;
    opacity: 1;
    transform: translateY(0);
}

.choice-option:hover {
    color: #222;
}

.scene-text {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    color: #2d2520;
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 0.1em;
    text-align: center;
    z-index: 50;
    line-height: 1.8;
    text-shadow: 
        0 0 5px var(--glow-color),
        0 0 10px var(--glow-color),
        0 0 15px var(--glow-color);
}

.scene-text .char {
    display: inline-block;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.scene-text .char.revealed {
    opacity: 1;
}

.tea-container {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 51;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tea-image {
    width: 0;
    height: 0;
    opacity: 0;
    transition: all 1.5s ease;
}

.tea-image.revealed {
    width: 160px;
    height: 160px;
    opacity: 1;
}

.tea-option {
    margin-top: 15px;
    opacity: 0;
    font-size: 0.8rem;
    color: #2d2520;
    font-weight: bold;
    letter-spacing: 0.1em;
    text-shadow: 
        0 0 5px var(--glow-color),
        0 0 10px var(--glow-color),
        0 0 15px var(--glow-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tea-option.revealed {
    opacity: 1;
}

.tea-option:hover {
    color: #222;
    text-shadow: none;
}

.dissolve-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    opacity: 0;
    z-index: 1000;
    pointer-events: none;
    transition: opacity 1.5s ease;
}

.dissolve-overlay.visible {
    opacity: 1;
}