/* Genel stil ayarları */
* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    user-select: none;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
}

/* Buton ve sonuç kutusu için ortak stiller */
button, .result_box {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Başlangıç butonu stilleri */
.start button {
    position: static !important;
    transform: none !important;
    margin: 0 !important;
    width: 240px;
    height: 70px;
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    padding: 15px 30px;
    outline: none;
    border: none;
    border-radius: 50px;
    background: linear-gradient(45deg, #6a11cb, #2575fc);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(106, 17, 203, 0.4);
    letter-spacing: 1px;
    text-transform: uppercase;
    animation: fadeIn 0.5s ease-out, pulse 2s infinite;
}

.start button:hover {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 8px 25px rgba(106, 17, 203, 0.6);
    background: linear-gradient(45deg, #2575fc, #6a11cb);
}

/* Ana oyun alanı stilleri */
#game {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Arka plan stilleri */
.background {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    z-index: -1;
}

/* Oyun konteyneri ve kareler için ortak stiller */
#game #game-container,
#game #tiles {
    position: absolute;
    width: 100%;
    max-width: 600px;
    height: 100%;
    display: flex;
    z-index: 2;
    left: 50%;
    transform: translateX(-50%);
}

/* Skor göstergesi stilleri */
#game .score {
    width: 100%;
    max-width: 600px;
    height: auto;
    position: absolute;
    display: flex;
    justify-content: center;
    padding: 25px 0;
    z-index: 5;
    left: 50%;
    transform: translateX(-50%);
}

#game .score p {
    font-size: 42px;
    width: auto;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 30px;
    border-radius: 50px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Oyun çizgileri stilleri */
#game #game-container .line {
    width: 25%;
    border-right: solid 1px rgba(255, 255, 255, 0.1);
}

#game #game-container #line4 {
    border-right: none;
}

/* Kareler alanı stilleri */
#game #tiles {
    display: block;
    overflow: hidden;
}

/* Kare stilleri */
#game #tiles div {
    width: 25%;
    height: 30%;
    position: absolute;
    top: -30%;
    background: linear-gradient(45deg, #6a11cb, #2575fc);
    outline: none;
    cursor: pointer;
    border-radius: 8px;
    margin: 0 1px;
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.2),
                0 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 2.5s;
}

#game #tiles div:active {
    transform: scale(0.95);
    background: linear-gradient(45deg, #2575fc, #6a11cb);
}

/* Kare hareket animasyonları */
.move {
    transform: translateY(145vh);
    transition: transform linear 3s;
}

.speedX1 { transition: transform linear 4s; }
.speedX2 { transition: transform linear 5s; }
.speedX3 { transition: transform linear 6s; }
.speedX4 { transition: transform linear 7s; }

/* Sonuç kutusu stilleri */
.result_box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(255, 255, 255, 0.95);
    width: 90%;
    max-width: 480px;
    height: auto;
    padding: 30px 40px;
    border-radius: 15px;
    display: flex;
    text-align: center;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    margin: 0;
}

/* Aktif sonuç kutusu stilleri */
.result_box.activeResult {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
    transition: all 0.3s ease-in-out;
}

/* Sonuç kutusu metin stilleri */
.result_box .complete_text {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.result_box .score_text {
    margin: 15px 0;
    font-size: 20px;
    font-weight: 500;
    color: #555;
}

.result_box .icon {
    font-size: 100px;
    color: #6a11cb;
    margin-bottom: 20px;
    text-shadow: 0 5px 15px rgba(106, 17, 203, 0.3);
}

/* Sonuç kutusu buton alanı stilleri */
.result_box .buttons {
    position: relative;
    display: flex;
    margin: 25px 0 10px;
    width: 100%;
    justify-content: center;
    z-index: 2;
}

/* Sonuç kutusu buton stilleri */
.result_box .buttons button {
    position: relative;
    margin: 0 15px;
    width: auto;
    height: 45px;
    padding: 0 25px;
    border: none;
    outline: none;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    transform: none;
    top: auto;
    left: auto;
}

.result_box .buttons button.restart {
    background: linear-gradient(45deg, #6a11cb, #2575fc);
    color: white;
    box-shadow: 0 5px 15px rgba(106, 17, 203, 0.4);
}

.result_box .buttons button.exit {
    background: rgba(255, 255, 255, 0.9);
    color: #6a11cb;
    border: 2px solid #6a11cb;
}

.result_box .buttons button:hover {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 8px 25px rgba(106, 17, 203, 0.5);
}

/* Animasyonlar */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.result_box.activeResult {
    animation: fadeIn 0.3s ease-out;
}

/* Mobil cihazlar için responsive tasarım */
@media (max-width: 768px) {
    .result_box {
        width: 95%;
        padding: 25px 30px;
    }
}

@media (max-width: 480px) {
    .result_box {
        width: 98%;
        padding: 20px;
        max-height: 85vh;
    }
}

@media(max-width: 375px) {
    .result_box .complete_text {
        font-size: 20px;
    }
    
    .result_box .buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .result_box .buttons button {
        margin: 8px 0;
        width: 80%;
    }
}

/* DPU Logo styles */
.dpuLogo {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 200px;
    width: 20%;
    min-width: 150px;
    height: auto;
    z-index: 10;
}

/* İsim giriş formu stilleri */
.name_form {
    width: 100%;
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 2;
}

.name_form input {
    width: 80%;
    padding: 10px 15px;
    border: 2px solid #6a11cb;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    background: white;
}

.name_form input:focus {
    border-color: #2575fc;
    box-shadow: 0 0 10px rgba(37, 117, 252, 0.3);
}

.name_form button {
    background: linear-gradient(45deg, #6a11cb, #2575fc);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    transform: none;
    top: auto;
    left: auto;
    margin-top: 5px;
}

.name_form button:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(106, 17, 203, 0.4);
}

/* Liderlik tablosu stilleri */
.leaderboard {
    width: 100%;
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

.leaderboard h3 {
    color: #333;
    text-align: center;
    margin-bottom: 15px;
    font-size: 20px;
}

.leaderboard_list {
    max-height: 200px;
    overflow-y: auto;
}

.leaderboard_item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 5px;
    font-size: 14px;
}

.leaderboard_item .rank {
    font-weight: bold;
    color: #6a11cb;
}

.leaderboard_item .player_name {
    flex: 1;
    margin: 0 10px;
    color: #333;
}

.leaderboard_item .player_score {
    font-weight: bold;
    color: #2575fc;
}

/* Scrollbar stilleri */
.leaderboard_list::-webkit-scrollbar {
    width: 5px;
}

.leaderboard_list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.leaderboard_list::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #6a11cb, #2575fc);
    border-radius: 5px;
}

/* Top Scores Styles */
.top-scores {
    width: 100%;
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(5px);
    position: relative;
    z-index: 1;
}

.top-scores h3 {
    color: #333;
    text-align: center;
    margin-bottom: 15px;
    font-size: 20px;
}

.top-scores-list {
    margin-bottom: 15px;
}

.top-score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 5px;
    font-size: 14px;
}

.top-score-item .rank {
    font-weight: bold;
    color: #6a11cb;
    width: 30px;
}

.top-score-item .player-name {
    flex: 1;
    margin: 0 10px;
    color: #333;
}

.top-score-item .player-score {
    font-weight: bold;
    color: #2575fc;
}

.view-all-scores {
    display: block;
    text-align: center;
    color: #6a11cb;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.view-all-scores:hover {
    color: #2575fc;
    transform: translateX(5px);
}

.view-all-scores i {
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.view-all-scores:hover i {
    transform: translateX(5px);
}

/* Start screen styles */
.start {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 10;
    width: auto;
}

/* Difficulty Selection Screen */
.difficulty-select {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 10;
    width: auto;
}

.difficulty-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.difficulty-btn {
    width: 180px;
    height: 60px;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.difficulty-btn.easy {
    background: linear-gradient(45deg, #4CAF50, #8BC34A);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.difficulty-btn.normal {
    background: linear-gradient(45deg, #2196F3, #03A9F4);
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
}

.difficulty-btn.hard {
    background: linear-gradient(45deg, #F44336, #FF5722);
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
}

.difficulty-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.back-btn {
    width: 120px;
    height: 40px;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}