@import url('reset.css');
@import url('font.css');
@import url('animations.css');

.screen1 {
    background-image: linear-gradient(to bottom, #FFFFFF, #d1d1d1);
    display: flex;
    flex-direction: column;
    padding: 50px;
    gap: 500px;
    position: relative;
    min-height: 100vh;
}

.screen1_top {
    display: flex;
    flex-direction: row;
    gap: 780px;
}

.screen1_top_left {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 85px;
    font-family: 'Doloto', sans-serif;
    color: white;
    background-image: url(../assets/images/bg_text.png);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 335px;
    text-align: center;
}

.screen1_top_right {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 85px;
    font-family: 'Doloto', sans-serif;
    color: white;
    background-image: url(../assets/images/bg_text.png);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 335px;
    text-align: center;
}

.screen1_bottom {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 15px;
    position: relative;
    width: 100%;
    margin-top: auto;
    min-height: 200px;
}

.screen1_bottom_box {
    display: flex;
    background-image: url(../assets/images/box.svg);
    width: 251px;
    height: 85px;
    transition: left 0.05s ease-out;
    position: relative;
    left: 0;
}

.screen1_bottom_box.catcher-box {
    cursor: grab;
    z-index: 100;
}

.screen1_bottom_box.catcher-box:active {
    cursor: grabbing;
}


.screen1_bottom_floor {
    display: flex;
    background-image: url(../assets/images/floor.svg);
    width: 1218px;
    height: 183px;
    position: relative;
    z-index: 99;
    pointer-events: none;
    transition: none;
    margin-top: auto;
    background-size: cover;
    background-repeat: no-repeat;
}

.screen1_bottom_floor.build_active {
    position: fixed !important;
    bottom: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin-top: 0 !important;
    z-index: 1000 !important;
}
.falling_items_container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

.falling_item {
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    z-index: 90;
    top: 0;
}



.popup_overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.popup_content {
    background-image: url(../assets/images/bg_popup.svg);
    background-size: cover;
    background-position: center;
    padding: 40px;
    text-align: center;
    position: relative;
    max-width: 500px;
    width: 90%;
    border: 2px solid #ff4444;
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.5);
}

.popup_text {
    font-family: 'Doloto', sans-serif;
    font-size: 50px;
    color: white;
    text-transform: uppercase;
    line-height: 1.4;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.popup_close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background-color: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.popup_close:hover {
    background-color: #ff6666;
}

.summary_popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.summary_content {
    background-image: url(../assets/images/bg_popup.svg);
    background-size: cover;
    background-position: center;
    padding: 60px;
    border-radius: 10px;
    text-align: center;
    position: relative;
    max-width: 600px;
    width: 90%;
    border: 3px solid #4CAF50;
    box-shadow: 0 0 30px rgba(76, 175, 80, 0.7);
}

.summary_text {
    font-family: 'Roboto', sans-serif;
    font-size: 26px;
    color: white;
}

.summary_close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.summary_close:hover {
    background-color: #45a049;
}

.screen2 {
    display: flex;
    background-image: linear-gradient(to bottom, #d1d1d1, #FFFFFF);

    align-items: center;
    justify-content: center;
    padding: 214px 0px 120px;
}

.puzzle {
    display: flex;
    flex-direction: column;
    gap: 0px;
    align-items: flex-start;
    justify-content: flex-start;
}

.puzzle_content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    border: 5px solid #A10101;
    width: 785px;
    min-height: 545px;
    padding: 20px;
    gap: 10px;
    transition: background-color 0.2s;
}

.text_content_puzzle {
    display: flex;
    align-self: flex-start;
    color: white;
    background-color: #A10101;
    font-size: 23px;
    font-family: 'Roboto', sans-serif;
    padding: 15px;
    line-height: 120%;
}

.puzzle_piece {
    cursor: grab;
    object-fit: contain;
}

.puzzle_piece:active {
    cursor: grabbing;
}

.puzzle_content {
    width: 785px;
    height: 545px;
    border: 10px solid #A10101;
    position: relative;
    overflow: hidden;
}

.puzzle_piece.placed {
    position: absolute;
    cursor: move;
    z-index: 10;
}

.pieces_container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
    margin-bottom: 20px;
    width: 785px;
}

.screen3 {
    display: flex;
    background-image: linear-gradient(to bottom, #FFFFFF, #d1d1d1);

    gap: 0px;
    position: relative;
    min-height: 100vh;
    overflow-x: clip;
}

.screen3_left_part {
    display: flex;
    flex-direction: column;
    gap: 140px;
    position: relative;
    z-index: 2;
}

.screen3_title {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    font-size: 85px;
    font-family: 'Doloto', sans-serif;
    color: white;
    text-align: center;
    background-color: #A10101;
    width: 900px;
    height: 180px;
    transform: translateX(-100%);
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.screen3_title.visible {
    transform: translateX(0);
}

.wall {
    display: flex;
    background-image: url(../assets/images/wall.svg);
    width: 730px;
    height: 680px;
    position: relative;
    z-index: 2;
}

.arch {
    background-image: url(../assets/images/arch.svg);
    width: 630px;
    height: 1000px;
    position: relative;
    z-index: 3;
}

.timeline_texts {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.timeline_item {
    position: absolute;
    left: 100%;
    font-family: 'Roboto', sans-serif;
    font-size: 30px;
    color: white;
    background-color: #A10101;
    padding: 20px 40px;
    white-space: nowrap;
    transition: left 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: left;
    z-index: 10;
    display: inline-block;
    width: max-content;
    max-width: 90vw;
}

.timeline_item.visible {
    left: 0px;
}

#timeline1 {
    top: 37%;
}

#timeline2 {
    top: 53%;
}

#timeline3 {
    top: 69%;
}

#timeline4 {
    top: 86%;
}

.screen4 {
    display: flex;
    flex-direction: column;
    background-image: linear-gradient(to bottom, #d1d1d1, #FFFFFF);

    align-items: center;
    justify-content: center;
    padding: 100px 50px 0px;
    min-height: 100vh;
    gap: 50px;
}

.screen4_top {
    display: flex;
    gap: 75px;
}

.music {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.music_grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 800px;
}

.music_row {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.music_btn {
    width: 170px;
    height: 90px;
    border: 7px solid #868686;
    color: white;
    background-color: #A10101;
    font-family: 'Roboto', sans-serif;
    font-size: 23px;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 13px;
}

.music_btn:hover {
    background-color: #710000;
    transform: scale(1.05);
}

.music_btn.active {
    background-color: #710000;
    box-shadow: 0 0 10px #710000;
}

.music_controls {
    display: flex;
    gap: 30px;
    margin-top: 40px;
}

.record_btn,
.play_btn {
    width: 200px;
    height: 80px;
    font-family: 'Roboto', sans-serif;
    font-size: 23px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 13px;
}

.record_btn {
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: center;
    background-color: #BABABA;
    border: 7px solid #868686;
    color: white;
}

.record_btn.recording {
    background-color: #9c9c9c;
    animation: pulse 5s infinite;
}

.play_btn {
    background-color: #BABABA;
    border: 7px solid #868686;
    color: white;
}

.play_btn:active {
    background-color: #9c9c9c;
}

.circle {
    width: 20px;
    height: 20px;
    background-color: #A10101;
    border-radius: 100px;
}

.square {
    width: 20px;
    height: 20px;
    background-color: #A10101;
}

.screen4_text {
    display: flex;
    color: white;
    font-family: 'Roboto', sans-serif;
    font-size: 25px;
    background-image: url(../assets/images/background_wall.svg);
    height: 200px;
    width: 590px;
    align-items: center;
    justify-content: center;
}

.screen4_bottom {
    display: flex;
    flex-direction: column;
    gap: 0px;
    align-self: flex-end;
}

.cows {
    display: flex;
    gap: 0px;
    align-items: center;
    justify-content: center;
    padding: 0px;
}

.cow_left {
    width: 390px;
    height: 220px;
    align-self: flex-end;
    background-image: url(../assets/images/cow.svg);
    background-size: cover;
    transform: scaleX(-1);
    z-index: 2;
}

.cow_right {
    width: 500px;
    height: 290px;
    background-image: url(../assets/images/cow.svg);
    z-index: 3;
}

.cows_floor {
    display: flex;
    width: 965px;
    height: 227px;
    background-image: url(../assets/images/cows_floor.svg);
    background-size: cover;
    z-index: 10;
}

.cow_left,
.cow_right {
    transition: transform 0.1s ease-out;
    transform-origin: bottom center;
}

.cow_left.dancing {
    animation: cowJumpLeft 0.3s ease-in-out;
}

.cow_right.dancing {
    animation: cowJump 0.3s ease-in-out;
}

.screen5 {
    display: flex;
    flex-direction: column;
    background-image: linear-gradient(to bottom, #FFFFFF, #d1d1d1);

    gap: 0px;
    align-items: center;
    justify-content: center;
    padding: 120px 60px 30px;
    position: relative;
}

.house {
    display: flex;
    width: 600px;
    height: 700px;
    background-image: url(../assets/images/house_whole.svg);
    background-size: cover;
    position: relative;
}

.house_floor {
    display: flex;
    color: white;
    font-size: 35px;
    font-family: 'Doloto', sans-serif;
    align-items: center;
    justify-content: center;
    background-image: url(../assets/images/house_floor.svg);
    background-size: cover;
    width: 1430px;
    height: 170px;
    padding: 0px 0px 35px;
    transition: all 0.3s ease;
    text-align: center;
    line-height: 1.4;
}

.window_popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.window_popup_content {
    background-image: url(../assets/images/bg_popup.svg);
    background-size: cover;
    background-position: center;
    padding: 40px;
    text-align: center;
    position: relative;
    max-width: 500px;
    width: 90%;
    border: 2px solid #ff4444;
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.5);
}

.window_popup_text {
    font-family: 'Roboto', sans-serif;
    font-size: 28px;
    color: white;
    line-height: 1.4;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.window_popup_close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background-color: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.window_popup_close:hover {
    background-color: #ff6666;
}

.diamond_img {
    transition: all 0.3s ease;
    pointer-events: none;
    object-fit: contain;
}

.window:hover .diamond_img {
    transform: scale(1.1);
    filter: brightness(1.1);
}

.window {
    position: absolute;
    cursor: pointer;
    transition: transform 0.3s ease;
    width: 40px;
    height: 40px;
}

#window1 {
    width: 59px;
    height: 60px;
    top: 40%;
    left: 28.5%;
}

#window2 {
    top: 21.5%;
    left: 65%;
}

#window3 {
    top: 48%;
    left: 73.5%;
}

#window4 {
    top: 63%;
    left: 68%;
}
footer{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Doloto', sans-serif;
    padding: 20px;
    gap: 40px;
    background-image: url(../assets/images/footer.svg);
    background-size: cover;
}
.footer_top{
    display: flex;
    color: white;
    font-size: 90px;
}
.footer_bottom{
    display: flex;
    flex-direction: row;
    color: white;
    justify-content: space-between;
    gap: 320px;
    p{
        font-size: 55px;
        align-self: self-end;
    }
}
.footer_title{
    font-size: 90px;
}
.puzzle_description_btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #A10101;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.3s;
    color: white;
    font-size: 20px;
}

@media (max-width: 1920px) and (min-width: 1561px) {
    .screen1_top { gap: 600px; }
    .screen1_top_left, .screen1_top_right { width: 300px; font-size: 70px; }
    .screen1_bottom_floor { width: 1000px; }
    .puzzle_content, .pieces_container { width: 700px; }
    .screen3_title { width: 750px; font-size: 70px; }
    .wall { width: 600px; }
    .arch { width: 500px; }
    .timeline_item { font-size: 26px; padding: 15px 30px; }
    .house_floor { width: 1100px; font-size: 28px; }
    .footer_bottom { gap: 180px; }
    .footer_top, .footer_title { font-size: 70px; }
    .footer_bottom p { font-size: 40px; }
}

@media (max-width: 1200px) {
    .screen1 { padding: 30px; gap: 300px; }
    .screen1_top { gap: 400px; }
    .screen1_top_left, .screen1_top_right { width: 250px; font-size: 55px; }
    .screen1_bottom_floor { width: 800px; height: 140px; background-size: contain; }
    .screen1_bottom_box { width: 200px; height: 68px; background-size: contain; }
    
    .screen2 { padding: 100px 0px 80px; }
    .puzzle_content, .pieces_container { width: 600px; height: 450px; }
    .text_content_puzzle { font-size: 18px; padding: 10px; }
    .puzzle_piece { width: 80px; height: 80px; }
    .pieces_container { gap: 15px; padding: 15px; }
    
    .screen3 { min-height: 80vh; }
    .screen3_left_part { gap: 80px; }
    .screen3_title { width: 550px; height: 120px; font-size: 48px; }
    .wall { width: 500px; height: 500px; background-size: contain; }
    .arch { width: 400px; height: 700px; background-size: contain; }
    .timeline_item { font-size: 20px; padding: 12px 24px; }
    
    .screen4 { padding: 60px 30px 0px; gap: 30px; }
    .screen4_top { gap: 40px; flex-wrap: wrap; justify-content: center; }
    .music_btn { width: 120px; height: 70px; font-size: 18px; }
    .record_btn, .play_btn { width: 150px; height: 60px; font-size: 18px; }
    .screen4_text { width: 450px; height: 180px; font-size: 18px; }
    .cow_left { width: 280px; height: 160px; }
    .cow_right { width: 360px; height: 210px; }
    .cows_floor { width: 700px; height: 170px; background-size: contain; }
    
    .screen5 { padding: 60px 30px 20px; }
    .house { width: 450px; height: 525px; }
    .house_floor { width: 900px; height: 120px; font-size: 24px; padding: 0px 0px 20px; background-size: contain; }
    .window { width: 30px; height: 30px; }
    #window1 { width: 45px; height: 45px; top: 38%; left: 27%; }
    #window2 { top: 20%; left: 64%; }
    #window3 { top: 45%; left: 72%; }
    #window4 { top: 61%; left: 67%; }
    
    .footer_bottom { gap: 100px; flex-wrap: wrap; justify-content: center; }
    .footer_top, .footer_title { font-size: 50px; }
    .footer_bottom p { font-size: 30px; }
}

@media (max-width: 768px) {
    .screen1_bottom_floor {
        width: 600px;
        height: 100px;
        background-size: contain;
    }
    .screen1_bottom_floor.build_active {
        width: 600px !important;
        height: 100px !important;
    }
    .screen2 { padding: 60px 0px 50px; }
    .puzzle_content, .pieces_container { 
        width: 450px; 
        height: auto; 
        min-height: 327px;
        aspect-ratio: 785 / 545; 
    }
    .puzzle_content {
        height: auto;
        min-height: 313px;
    }
    .pieces_container {
        width: 450px;
        flex-wrap: wrap;
        justify-content: center;
    }
    .puzzle_piece {
        width: 60px;
        height: 60px;
    }
    .text_content_puzzle { 
        font-size: 14px; 
        padding: 8px;
        display: none;
    }
    .text_content_puzzle.show { display: flex; }
    
    .puzzle_description_btn {
        display: flex;
        margin: 10px auto;
    }
     .screen3 { 
        flex-direction: row; 
        align-items: flex-start; 
        justify-content: center;
        flex-wrap: wrap;
    }
    .arch { display: none; } 
    .screen3_left_part { 
        width: auto; 
        align-items: center; 
        gap: 30px;
    }
    .screen3_title { 
        width: 90%; 
        font-size: 32px; 
        height: auto; 
        padding: 20px;
        margin: 0 auto;
    }
    .wall { 
        width: 90%; 
        max-width: 500px;
        height: auto; 
        background-size: contain; 
        background-repeat: no-repeat;
        aspect-ratio: 730 / 680;
    }
    .timeline_texts { 
        position: relative; 
        display: flex; 
        flex-direction: column; 
        gap: 15px; 
        margin-top: 20px;
        width: 100%;
    }
    .timeline_item { 
        position: relative; 
        left: 0; 
        opacity: 0; 
        transition: opacity 0.5s;
        width: 90%;
        margin: 0 auto;
        white-space: normal;
        text-align: center;
        font-size: 16px;
        padding: 12px 20px;
    }
    .timeline_item.visible { opacity: 1; left: 0; }
    .cow_right { display: none; }
    .cow_left { 
        width: 280px; 
        height: 160px;
        transform: scaleX(-1);
        margin: 0 auto;
    }
    .cows { 
        justify-content: center;
    }
    .cows_floor { 
        width: 100%;
        max-width: 450px;
        height: auto;
        background-size: contain;
        background-repeat: no-repeat;
        aspect-ratio: 965 / 227;
    }
    
    .screen4_text {
        width: 280px;
        height: auto;
        min-height: 150px;
        font-size: 14px;
        padding: 15px;
    }
    .music_btn {
        width: 70px;
        height: 60px;
        font-size: 14px;
    }
    .music_row {
        gap: 10px;
    }
    .record_btn, .play_btn {
        width: 100px;
        height: 50px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .screen1 { padding: 15px; gap: 100px; }
    .screen1_top { gap: 50px; }
    .screen1_top_left, .screen1_top_right { width: 140px; font-size: 28px; }
    .screen1_bottom_floor { width: 280px; height: 50px; }
    .screen1_bottom_box { width: 100px; height: 35px; }
    
    .screen2 { padding: 40px 0px 30px; }
    .puzzle_content, .pieces_container { width: 280px; height: 220px; }
    .text_content_puzzle { font-size: 10px; padding: 5px; }
    .puzzle_piece { width: 45px; height: 45px; }
    .pieces_container { gap: 8px; padding: 8px; }
    
    .screen3_title { font-size: 22px; }
    .timeline_item { font-size: 12px; padding: 8px 12px; }
    .cow_right { display: none; }
    .cow_left { 
        width: 180px; 
        height: 100px;
    }
    .cows_floor {
        width: 270px;
        height: auto;
        aspect-ratio: 965 / 227;
    }
    .screen4_text {
        width: 240px;
        font-size: 11px;
        padding: 10px;
    }
    .music_btn {
        width: 55px;
        height: 45px;
        font-size: 11px;
    }
    .music_row {
        gap: 8px;
    }
    
    .house_floor { font-size: 11px; padding: 10px; }
    #window1 { width: 14%; top: 35%; left: 24%; }
    #window2, #window3, #window4 { width: 9%; }
    
    .popup_text, .window_popup_text { font-size: 20px; }
    .summary_text { font-size: 14px; }
    .popup_content, .window_popup_content, .summary_content { padding: 20px; }
    
    .footer_top, .footer_title { font-size: 22px; }
    .footer_bottom p { font-size: 14px; }
    .footer_bottom { gap: 20px; }
}