@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #222;
    overflow: hidden;
    font-family: 'Press Start 2P', cursive, sans-serif;
}

#game-container {
    position: relative;
    width: 800px;
    height: 600px;
    overflow: hidden;
    touch-action: none; /* Mobilde kaydirma/yakinlastirmanin oyunu bozmasini engeller */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    background-color: #87CEEB; /* Fallback */
    transition: background-color 1s ease;
}

.speed-mode-fx {
    box-shadow: inset 0 0 100px rgba(0, 242, 254, 0.8), 0 0 30px rgba(0, 242, 254, 0.5) !important;
}

#background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    transition: filter 1s ease-in-out;
}

.hell-mode-fx #background {
    opacity: 0;
    pointer-events: none;
}

#player {
    position: absolute;
    width: 100px; /* Karakter genişliği */
    height: auto;
    z-index: 3;
    /* initial placeholder for CSS, JS overrides this */
    left: 100px;
    top: 250px;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none; /* Let clicks pass through if needed, though we will track space/clicks on document */
}

#score-display {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 40px;
    color: white;
    text-shadow: 3px 3px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000;
    z-index: 11;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 20;
    pointer-events: auto; /* Re-enable clicks for menu screens */
}

.hidden {
    display: none !important;
}

.panel {
    background-color: #ded895;
    border: 4px solid #543847;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    box-shadow: inset 0 -4px 0 rgba(0,0,0,0.2), 0 5px 15px rgba(0,0,0,0.5);
    color: #543847;
    display: flex;
    flex-direction: column;
    gap: 20px;
    pointer-events: auto; /* Re-enable clicks for the panel */
}

.panel h1, .panel h2 {
    margin: 0;
    font-size: 28px;
    text-shadow: 2px 2px 0px #fff;
}

.panel p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.score-board {
    background-color: #cfc686;
    border: 3px solid #543847;
    padding: 15px;
    border-radius: 5px;
}

.score-board p {
    font-size: 12px;
    margin-bottom: 5px;
    color: #e27a3c;
    text-shadow: 1px 1px 0px #fff;
}

.score-board h3 {
    margin: 0 0 15px 0;
    font-size: 24px;
    color: white;
    text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

.score-board h3:last-child {
    margin-bottom: 0;
}

.blink {
    animation: blinker 1s linear infinite;
    font-size: 10px !important;
    color: #e27a3c;
}

@keyframes blinker {
    50% {
        opacity: 0;
    }
}

.speed-portal {
    position: absolute;
    width: 60px;
    background: linear-gradient(0deg, rgba(0,242,254,0.3) 0%, rgba(79,172,254,0.8) 50%, rgba(0,242,254,0.3) 100%);
    border-left: 3px solid #00f2fe;
    border-right: 3px solid #00f2fe;
    box-shadow: 0 0 20px #00f2fe, inset 0 0 20px rgba(255,255,255,0.5);
    z-index: 2;
    opacity: 0.9;
    pointer-events: none;
}

.wave-portal {
    position: absolute;
    width: 80px;
    height: 120px;
    background-image: url('Görseller/wave_portal.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 2;
    filter: drop-shadow(0 0 15px #ff00ff);
    pointer-events: none;
}

.cube-portal {
    position: absolute;
    width: 80px;
    height: 120px;
    background-image: url('Görseller/cube_portal.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 2;
    filter: drop-shadow(0 0 15px #00ff00);
    pointer-events: none;
}

.wave-mode-fx {
    box-shadow: inset 0 0 100px rgba(255, 0, 255, 0.4), 0 0 30px rgba(255, 0, 255, 0.2) !important;
}

.cube-mode-fx {
    box-shadow: inset 0 0 100px rgba(0, 255, 0, 0.4), 0 0 30px rgba(0, 255, 0, 0.2) !important;
}

#player.wave-active {
    filter: hue-rotate(280deg) brightness(1.2);
    transition: transform 0.2s;
}

#player.cube-active {
    filter: hue-rotate(90deg) brightness(1.2);
    transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28); /* Zıplama esnekliği hissi */
}

#player.cube-enter-drop {
    transition: top 0.3s ease-in, transform 0.3s linear;
    transform: rotate(360deg) scale(0.8);
}

#player.invincible {
    filter: drop-shadow(0 0 15px #ffff00) brightness(1.5);
    opacity: 0.8 !important; /* Birbiriyle çakışmasın diye opacity vurguladık */
}

/* MONSTER OBSTACLES */
.obstacle-top, .obstacle-bottom {
    position: absolute;
    width: 80px;
    z-index: 1; 
    display: flex;
    flex-direction: column;
}

.obstacle-top {
    transform-origin: top center;
}

.obstacle-bottom {
    transform-origin: bottom center;
}

.monster-body {
    background-color: #000;
    border-left: 4px solid #222;
    border-right: 4px solid #222;
    width: 100%;
    height: calc(100% - 30px);
    box-sizing: border-box;
    position: relative;
    box-shadow: inset 0 0 15px rgba(255,255,255,0.1);
}

.obstacle-top .monster-body {
    border-top: 4px solid #222;
    border-radius: 10px 10px 0 0;
}

.obstacle-bottom .monster-body {
    border-bottom: 4px solid #222;
    border-radius: 0 0 10px 10px;
}

/* Dikensi dişler için degradeler */
.monster-teeth-top {
    width: 100%;
    height: 30px;
    background: linear-gradient(135deg, #000 48%, transparent 52%) 0 0,
                linear-gradient(225deg, #000 48%, transparent 52%) 0 0;
    background-size: 20px 30px; 
    position: relative;
    z-index: 2; /* Dişler gövdenin üstünde dursun */
    margin-top: -1px; /* Boşluk kalmasın */
}

.monster-teeth-bottom {
    width: 100%;
    height: 30px;
    background: linear-gradient(45deg, #000 48%, transparent 52%) 0 100%,
                linear-gradient(315deg, #000 48%, transparent 52%) 0 100%;
    background-size: 20px 30px; 
    position: relative;
    background-repeat: repeat-x;
    z-index: 2;
    margin-bottom: -1px; /* Alt çeneyle birleşsin */
}

/* Canavar gözleri */
.monster-eye {
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: #ff3333;
    border-radius: 50%;
    box-shadow: 0 0 10px #ff0000;
    border: 2px solid #550000;
}

.eye-left { left: 12px; }
.eye-right { right: 12px; }

.obstacle-top .monster-eye { bottom: 10px; }
.obstacle-bottom .monster-eye { top: 10px; }

.monster-eye::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 10px;
    background-color: black;
    border-radius: 50%;
    top: 3px;
    left: 6px;
}

/* MENU BUTTONS */
.menu-btn {
    background-color: #543847;
    color: white;
    border: none;
    padding: 10px 20px;
    font-family: 'Press Start 2P', cursive;
    font-size: 14px;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 4px 0 #33222c;
    transition: transform 0.1s;
}

.menu-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #33222c;
}

.menu-btn:hover {
    background-color: #6a495b;
}

/* TOGGLE SWITCH */
.toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 12px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

input:checked + .slider {
  background-color: #4facfe;
}

input:focus + .slider {
  box-shadow: 0 0 1px #4facfe;
}

input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* PRACTICE MODE INDICATOR */
#practice-indicator {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 12px;
    color: #4facfe;
    background: rgba(0,0,0,0.5);
    padding: 5px 10px;
    border-radius: 3px;
    z-index: 100;
    pointer-events: none;
}

.checkpoint-marker {
    position: absolute;
    width: 60px;
    height: 120px;
    background-image: url('Görseller/checkpoint.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 5;
    pointer-events: none;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 0 10px rgba(0, 255, 0, 0.7));
    animation: bob 1s ease-in-out infinite alternate;
}

@keyframes bob {
    from {
        transform: translate(-50%, -50%) translateY(-5px);
    }
    to {
        transform: translate(-50%, -50%) translateY(5px);
    }
}

.explosion-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: #ff00ff;
    box-shadow: 0 0 10px #ff00ff, 0 0 20px #ff00ff;
    border-radius: 50%;
    z-index: 10;
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: explode 0.6s ease-out forwards;
}

@keyframes explode {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0);
        opacity: 0;
    }
}

.mode-notification {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px rgba(0,0,0,0.8), 0 0 20px #ff0000;
    z-index: 100;
    pointer-events: none;
    animation: notifyIn 1s ease-out forwards;
}

@keyframes notifyIn {
    0% { opacity: 0; transform: translate(-50%, -100%) scale(0.5); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
}

.mode-progress-container {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 10px;
    background: rgba(0,0,0,0.5);
    border: 2px solid #fff;
    border-radius: 5px;
    overflow: hidden;
    z-index: 10;
}

.mode-progress-bar {
    width: 0%;
    height: 100%;
    background: #0f0;
    transition: width 0.3s;
}

.hell-mode-fx {
    background-color: #900 !important;
    box-shadow: inset 0 0 150px rgba(0, 0, 0, 0.8) !important;
}

.monster-large {
    /* JS tarafındaki hitbox hesaplamasıyla uyumlu olması için scale burada sabit kalmalı */
    transform: scale(1.15) !important;
}

.hell-mode-fx .monster-body {
    background-color: #000 !important; /* Kapkara gövde */
    border-color: #400 !important;
    box-shadow: inset 0 0 30px #f00 !important;
    animation: monsterJitter 0.1s infinite;
}

.hell-mode-fx .monster-eye {
    background-color: #fff !important; /* Parlayan ruhanî beyaz gözler */
    box-shadow: 0 0 20px #f00, 0 0 40px #f00 !important;
    width: 20px;
    height: 20px;
}

.hell-mode-fx .monster-eye::after {
    background-color: #f00 !important; /* Kan kırmızısı küçük göz bebeği */
    width: 6px;
    height: 6px;
    top: 7px;
    left: 7px;
}

.hell-mode-fx .monster-teeth-top {
    background: linear-gradient(135deg, #f00 48%, transparent 52%) 0 0,
                linear-gradient(225deg, #f00 48%, transparent 52%) 0 0;
    background-size: 20px 30px;
    filter: drop-shadow(0 0 10px #f00) brightness(1.5);
    animation: teethPulse 0.5s ease-in-out infinite alternate;
    z-index: 5;
    margin-top: -2px;
}

.hell-mode-fx .monster-teeth-bottom {
    background: linear-gradient(45deg, #f00 48%, transparent 52%) 0 100%,
                linear-gradient(315deg, #f00 48%, transparent 52%) 0 100%;
    background-size: 20px 30px;
    filter: drop-shadow(0 0 10px #f00) brightness(1.5);
    animation: teethPulse 0.5s ease-in-out infinite alternate;
    z-index: 5;
    margin-bottom: -2px;
}

@keyframes teethPulse {
    from { opacity: 0.8; filter: drop-shadow(0 0 5px #f00) brightness(1.2); }
    to { opacity: 1; filter: drop-shadow(0 0 15px #f00) brightness(1.8); }
}

@keyframes monsterJitter {
    0% { transform: scale(1.15); }
    25% { transform: scale(1.16) translate(1px, -1px); }
    50% { transform: scale(1.15) translate(-1px, 1px); }
    75% { transform: scale(1.16) translate(1px, 1px); }
    100% { transform: scale(1.15); }
}

.speed-particle-wind {
    position: absolute;
    width: 30px;
    height: 3px;
    background: rgba(255, 255, 255, 0.4);
    pointer-events: none;
    z-index: 1;
}

.spike {
    position: absolute;
    width: 36px;
    height: 30px;
    background-color: #aaa;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    z-index: 3;
    pointer-events: none;
    filter: drop-shadow(0 0 4px rgba(0,0,0,0.6));
}

/* METEOR PHASE & TRANSITION */
#transition-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    z-index: 200;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    pointer-events: none;
}

#transition-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.meteor {
    position: absolute;
    width: 100px;
    height: 100px;
    background-image: url('Görseller/meteor.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 5;
    filter: drop-shadow(0 0 15px #f60);
    /* Meteor görselini -45 derece döndürdük */
    transform: rotate(-45deg);
}

.mermi {
    position: absolute;
    width: 40px;
    height: 40px;
    background-image: url('Görseller/mermi.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 5;
    /* Mermiyi sola bakacak şekilde -90 derece döndürdük */
    transform: rotate(-90deg);
}

.plane {
    position: absolute;
    width: 120px;
    height: 80px;
    background-image: url('Görseller/uçak-Photoroom.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 5;
    /* Uçağı sola bakacak şekilde döndürdük (eğer orijinali sağa bakıyorsa) */
    transform: scaleX(-1);
    filter: drop-shadow(0 0 10px rgba(0,0,0,0.5));
}

.mod-panel {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
    border: 4px solid #00e5ff !important;
    box-shadow: 0 0 30px #00e5ff, inset 0 0 20px #00e5ff !important;
    color: #e0faff !important;
    min-width: 450px;
}

.mod-panel h2 {
    color: #00e5ff !important;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.5), 0 0 10px #00e5ff !important;
}

.ufo-options {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
}

.ufo-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s, filter 0.2s;
    padding: 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid transparent;
}

.ufo-option:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 15px #00e5ff);
    background: rgba(0,229,255,0.1);
    border: 1px solid #00e5ff;
}

.ufo-option img {
    width: 100px;
    height: auto;
    margin-bottom: 10px;
}

.ufo-option span {
    font-size: 10px;
    font-weight: bold;
}

.ufo-option.center img {
    width: 80px;
}

#mod-station-screen {
    background-color: rgba(0, 0, 0, 0.85);
}

/* EGG BUTTON (EASTER EGG) */
.egg-btn {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 6px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    cursor: pointer;
    z-index: 100;
    transition: background-color 0.3s;
}

.egg-btn:hover {
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 5px white;
}

#level-select-screen .panel {
    min-width: 300px;
    background: linear-gradient(135deg, #ded895 0%, #cfc686 100%);
}

#level-select-screen .menu-btn {
    margin: 5px 0;
    width: 100%;
}
/* LINTI DISPLAY */
#linti-display {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 16px;
    color: #ffeb3b;
    text-shadow: 2px 2px 0 #000;
    z-index: 11;
}

/* DAILY REWARDS */
.rewards-grid {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.reward-item {
    background-color: #cfc686;
    border: 3px solid #543847;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100px;
    transition: transform 0.2s, filter 0.2s, background-color 0.3s;
    position: relative;
}

.reward-item h3 {
    font-size: 10px;
    margin: 0;
    color: #543847;
}

.reward-icon {
    width: 40px;
    height: 40px;
    background-image: url('Görseller/ufo.png'); /* Placeholder icon */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: sepia(1) saturate(5) hue-rotate(10deg); /* Make it look golden */
}

.reward-amount {
    font-size: 8px;
    font-weight: bold;
    color: #e27a3c;
}

.claim-btn {
    background-color: #4caf50;
    color: white;
    border: none;
    padding: 5px 10px;
    font-family: inherit;
    font-size: 10px;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 3px 0 #2e7d32;
}

.claim-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #2e7d32;
}

.claim-btn:disabled {
    background-color: #777;
    box-shadow: 0 3px 0 #444;
    cursor: default;
}

/* STATES */
.reward-item.claimed {
    background-color: #aab;
    filter: grayscale(0.8);
    opacity: 0.7;
}

.reward-item.claimed::after {
    content: 'ALINDI';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-20deg);
    background-color: rgba(0,0,0,0.7);
    color: #0f0;
    padding: 2px 5px;
    font-size: 10px;
    border-radius: 3px;
    pointer-events: none;
}

.reward-item.current {
    border-color: #ffeb3b;
    box-shadow: 0 0 15px #ffeb3b;
    transform: scale(1.05);
}

.reward-item.locked {
    filter: blur(1px) brightness(0.7);
}

.reward-item.locked .claim-btn {
}

/* UFO LOCKING & GARAGE */
.ufo-option {
    position: relative;
}

.lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    border-radius: 10px;
    z-index: 5;
    pointer-events: none;
}

#reward-ufo-option.unlocked .lock-overlay,
#ufo5-option.unlocked .lock-overlay,
#ufo6-option.unlocked .lock-overlay {
    display: none;
}

.ufo-option.selected {
    border: 2px solid #ffeb3b !important;
    box-shadow: 0 0 10px #ffeb3b !important;
    background: rgba(255, 235, 59, 0.2) !important;
}

.help-icon {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 14px;
    opacity: 0.5;
    cursor: pointer;
    font-weight: bold;
    user-select: none;
    color: #543847;
}

.help-icon:hover {
    opacity: 0.8;
}
