* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    position: fixed;
    touch-action: none;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: #0b0c10;
    color: #fff;
}

#game-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* UI Layer */
#ui-layer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    z-index: 50;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
}

.stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    max-width: 800px;
    margin: 0 auto;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.health-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

#hearts-container {
    display: flex;
    gap: 8px;
    font-size: 2rem;
}

.heart {
    transition: transform 0.2s;
}

.timer-board {
    margin-left: 20px;
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 12, 16, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    text-align: center;
    padding: 20px;
}
.screen.active {
    opacity: 1;
    pointer-events: all;
}

/* Ã–zel Oyun Sonu EkranÄ± (Arka planÄ± gÃ¶steren ÅŸeffaf yapÄ±) */
#game-over-screen {
    background: rgba(0, 0, 0, 0.3); /* Ã‡ok hafif karartma ki TuÄŸÃ§e'nin sinirli hali net gÃ¶rÃ¼nsÃ¼n */
}

.angry-text {
    font-size: 3.5rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.85); /* Hafif ÅŸeffaf yazÄ± */
    text-shadow: 3px 3px 15px rgba(0,0,0,0.9);
    margin-bottom: 20px;
}

.screen h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #e94560;
}
.screen p {
    font-size: 1.5rem;
    margin-bottom: 30px;
    line-height: 1.5;
    max-width: 600px;
}
button {
    padding: 15px 40px;
    font-size: 1.5rem;
    font-family: 'Outfit', sans-serif;
    background-color: #e94560;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(233, 69, 96, 0.4);
    transition: transform 0.1s;
}
button:active { transform: scale(0.95); }

/* Room Environment with provided images */
#room {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 0.2s ease-in-out;
    z-index: 1;
}

/* Image States */
#room.state-sleep {
    background-image: url('sleep.jpg');
}
#room.state-shield {
    background-image: url('shield.jpg');
}
#room.state-angry {
    background-image: url('angry.jpg');
}

/* Entities */
#entities-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    pointer-events: none;
}

.entity {
    position: absolute;
    pointer-events: all;
    /* BOYUTLAR BÃœYÃœTÃœLDÃœ */
    width: 150px;
    height: 150px;
    cursor: pointer;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transform-origin: center bottom;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.6));
}

.entity.hit {
    animation: popOut 0.2s forwards;
    pointer-events: none;
}

/* Specific Character Images */
.entity.cockroach { background-image: url('cockroach.png'); }
.entity.rooster { background-image: url('rooster.png'); }
.entity.mosquito { background-image: url('mosquito.png'); }
.entity.seagull { background-image: url('seagull.png'); }
.entity.boyfriend { background-image: url('lover.png'); }

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes popOut {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

@media (max-width: 600px) {
    .entity { width: 110px; height: 110px; }
    .stats { font-size: 1.2rem; }
    #hearts-container { font-size: 1.5rem; }
    .angry-text { font-size: 2rem; }
}

/* ==========================================
   2. BÃ–LÃœM (OKUL & YAKALAMA OYUNU) STÄ°LLERÄ°
   ========================================== */

/* Okul Arka PlanÄ± (Dikey/Mobil Ã¶n tanÄ±mlÄ±, Yatay/MasaÃ¼stÃ¼ duyarlÄ±) */
#school-room {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('school_portrait.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 5;
    overflow: hidden;
    transition: background-image 0.3s ease-in-out;
}

/* Yan Telefon ve MasaÃ¼stÃ¼ Ekranlar (Yatay / Landscape) */
@media (orientation: landscape) {
    #school-room {
        background-image: url('school_landscape.jpg');
    }
}

#falling-items-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* DÃ¼ÅŸen EÅŸya KartlarÄ± */
.falling-item {
    position: absolute;
    width: 65px;
    height: 65px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    user-select: none;
    pointer-events: none;
    transition: transform 0.1s linear;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.falling-item.item-bad {
    border-color: rgba(239, 68, 68, 0.6);
    background: rgba(239, 68, 68, 0.2);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.falling-item.item-good {
    border-color: rgba(52, 211, 153, 0.6);
}

/* Ã–zel YÃ¼klenen Resimli EÅŸyalar */
.falling-item.bunny {
    background-image: url('bunny.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    border: none;
    box-shadow: none;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));
    width: 75px;
    height: 75px;
}

.falling-item.flowers {
    background-image: url('flowers.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    border: none;
    box-shadow: none;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));
    width: 75px;
    height: 75px;
}

.falling-item.naughty {
    background-image: url('naughty.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: rgba(239, 68, 68, 0.15);
    border: 2px solid rgba(239, 68, 68, 0.6);
    border-radius: 16px;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));
    width: 75px;
    height: 75px;
}

.falling-item.milka {
    background-image: url('milka.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    border: none;
    box-shadow: none;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));
    width: 85px;
    height: 70px;
}

.falling-item.lover {
    background-image: url('lover.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: rgba(244, 114, 182, 0.2);
    border: 2px solid rgba(244, 114, 182, 0.8);
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(244, 114, 182, 0.6);
    filter: drop-shadow(0 6px 12px rgba(244, 114, 182, 0.8));
    width: 85px;
    height: 85px;
    animation: heartGlow 1.5s infinite alternate;
}

@keyframes heartGlow {
    0% { box-shadow: 0 0 10px rgba(244, 114, 182, 0.4); transform: scale(1); }
    100% { box-shadow: 0 0 25px rgba(236, 72, 153, 0.9); transform: scale(1.06); }
}

.falling-item.bell {
    background-image: url('bell.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: rgba(239, 68, 68, 0.15);
    border: 2px solid rgba(239, 68, 68, 0.6);
    border-radius: 16px;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));
    width: 75px;
    height: 75px;
}

/* Yakalayan TuÄŸÃ§e Karakteri */
#tugce-catcher {
    position: absolute;
    bottom: 25px;
    left: 50%;
    width: 200px;
    height: auto;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 30;
    pointer-events: none;
    transition: left 0.05s linear;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.catcher-avatar {
    height: 200px;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));
    animation: floatBounce 2s ease-in-out infinite alternate;
}

.catcher-label {
    background: rgba(233, 69, 96, 0.85);
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    margin-top: 4px;
}

/* Skor TabelasÄ± */
.score-board {
    background: rgba(78, 172, 197, 0.3);
    border: 1px solid rgba(78, 172, 197, 0.6);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 1.3rem;
    color: #38bdf8;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

/* GÃ¶rsel Efektler */
@keyframes floatBounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-6px); }
}

.catch-pop {
    animation: popCatch 0.3s ease-out forwards;
}

@keyframes popCatch {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.8; }
    100% { transform: scale(0); opacity: 0; }
}

.floating-score {
    position: absolute;
    font-size: 1.8rem;
    font-weight: 900;
    pointer-events: none;
    z-index: 40;
    animation: floatUpFade 0.8s ease-out forwards;
}
.floating-score.plus { color: #4ade80; text-shadow: 0 0 10px rgba(74, 222, 128, 0.6); }
.floating-score.minus { color: #f87171; text-shadow: 0 0 10px rgba(248, 113, 113, 0.6); }

@keyframes floatUpFade {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-50px) scale(1.3); }
}

/* Gyroscope Controls */
#gyro-control-bar {
    position: absolute;
    top: 65px;
    right: 20px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    pointer-events: all;
}

#gyro-toggle-btn {
    padding: 8px 16px;
    font-size: 0.95rem;
    background: rgba(78, 172, 197, 0.85);
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    cursor: pointer;
}

#gyro-pc-sim {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e2e8f0;
}

#gyro-slider {
    width: 120px;
    cursor: pointer;
    accent-color: #38bdf8;
}

@media (max-width: 600px) {
    #gyro-pc-sim { display: none; }
    #tugce-catcher { width: 170px !important; bottom: 40px !important; }
    .catcher-avatar { height: 170px !important; }
    .falling-item { width: 45px !important; height: 45px !important; }
    .falling-item.bunny, .falling-item.flowers, .falling-item.naughty, .falling-item.bell { width: 55px !important; height: 55px !important; }
    .falling-item.milka, .falling-item.lover { width: 65px !important; height: 65px !important; }
}

/* Miss You Screen */
#miss-you-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0b0c10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.miss-title {
    font-size: 3rem;
    text-align: center;
    color: #ec4899;
    padding: 0 20px;
    margin-bottom: 50px;
    text-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
}

.miss-actions {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
}

#ilgilenmiyorum-btn {
    position: absolute;
    transition: left 0.15s ease-out, top 0.15s ease-out;
    z-index: 105;
}

#az-bisus-btn {
    z-index: 100;
}

@media (max-width: 600px) {
    .miss-title {
        font-size: 2rem;
    }
    #ilgilenmiyorum-btn, #az-bisus-btn {
        padding: 15px 20px;
        font-size: 1.2rem;
    }
}


/* Heartfelt Pop-up */
.popup-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.90);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
    backdrop-filter: blur(5px);
}
.popup-content {
    background: #1f2937;
    padding: 35px 25px;
    border-radius: 15px;
    border: 2px solid #e94560;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(233, 69, 96, 0.3);
}
.popup-content p {
    font-size: 1.15rem;
    line-height: 1.6;
    color: #f3f4f6;
    margin-bottom: 25px;
    font-family: 'Outfit', sans-serif;
    text-align: left;
}
#close-popup-btn {
    background-color: #e94560;
    color: white;
    border: none;
    padding: 12px 40px;
    font-size: 1.2rem;
    border-radius: 30px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 4px 10px rgba(233, 69, 96, 0.4);
}

