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

body {
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    overflow: hidden;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: none;
    justify-content: center;
    align-items: center;
}

#screen1 {
    background-image: url('../img/bgv.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.screen.active {
    display: flex;
}

.container {
    background: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

h1 {
    color: #e83a66;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.form-group {
    margin-bottom: 1rem;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: #e83a66;
    font-weight: bold;
}

input, textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
    font-family: Arial, sans-serif;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #2c3e50;
}

button {
    background: transparent;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s;
}

button img {
    max-width: 120px;
    height: auto;
    display: block;
}

button:not([type="submit"]) {
    background: #2c3e50;
    padding: 1rem 2rem;
}

button:hover {
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

.instructions {
    text-align: left;
    margin-bottom: 2rem;
}

.instructions ul {
    margin-left: 1.5rem;
    margin-top: 1rem;
}

.instructions li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.game-screen {
    background-image: url('../img/bgh.png');
    background-size: 99%;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    padding: 0.5%;
}

.landscape-alert, .portrait-alert {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.landscape-alert.show, .portrait-alert.show {
    display: flex;
}

.alert-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    max-width: 300px;
}

.rotate-icon {
    font-size: 2rem;
    margin-top: 1rem;
}

.game-area {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.game-header {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    width: calc(100% - 40px);
}

.attempt-counter, .overlap-result-header {
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    color: #333;
}

.game-canvas {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    cursor: pointer;
}


#screen4 {
    background-image: url('../img/tyh.png');
    background-size: 96%;
    background-position: center;
    background-repeat: no-repeat;
    padding: 2%;
    cursor: pointer;
}

@media screen and (orientation: portrait) {
    .game-screen .landscape-alert {
        display: flex;
    }
}

@media screen and (orientation: landscape) {
    .game-screen .landscape-alert {
        display: none;
    }
    
    .game-screen .game-area {
        display: block;
    }
    
    #screen1 .portrait-alert {
        display: flex;
    }
}

@media screen and (orientation: portrait) {
    #screen1 .portrait-alert {
        display: none;
    }
}

@media screen and (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
}

.error {
    color: red;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: none;
}

.error.show {
    display: block;
}

.fullscreen-image {
    width: 98%;
    height: 98vh;
    object-fit: cover;
    position: absolute;
    top: 1%;
    left: 1%;
}

#screen2 {
    cursor: pointer;
}

.overlay-button {
    position: absolute;
    bottom: 130px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background: transparent !important;
    padding: 0.5rem !important;
}

.overlay-button img {
    max-width: 100px;
    height: auto;
}