:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --background-color: #ecf0f1;
    --text-color: #2c3e50;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 30px;
}

nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

select.form-control {
    background-color: white;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.puzzle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.puzzle-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.puzzle-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.puzzle-info {
    padding: 1rem;
    background: rgba(255,255,255,0.9);
}

.puzzle-info p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.puzzle-info .visibility {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    background: #e0e0e0;
}

.puzzle-info .visibility.private {
    background: #ffd700;
    color: #000;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        flex-direction: column;
        text-align: center;
    }
    
    nav {
        margin-top: 10px;
    }
}

.no-puzzles {
    text-align: center;
    color: #666;
    padding: 20px;
    grid-column: 1 / -1;
}

/* Dolu slot'ların üzerine gelindiğinde sürüklenemez imleci göster */
.puzzle-slot:not(:empty) {
    cursor: not-allowed;
}

/* Kilitli parçalar için sürüklenemez imleci */
.puzzle-piece.locked {
    cursor: not-allowed;
}

/* Sürükleme sırasında dolu slot'ların üzerine gelindiğinde stil */
.puzzle-slot:not(:empty).hover {
    cursor: not-allowed;
    background-color: rgba(255, 0, 0, 0.1);
}

.puzzle-slot.occupied {
    cursor: not-allowed;
    background-color: rgba(255, 0, 0, 0.1);
}

.puzzle-piece.dragging {
    opacity: 0.6;
}

.puzzle-slot.hover:not(.occupied) {
    background-color: rgba(52, 152, 219, 0.2);
}

/* Sadece doğru yerleştirilen parçalar için kilitleme */
.puzzle-piece.locked {
    cursor: not-allowed;
}

.game-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.btn-control {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    background-color: var(--secondary-color);
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-control:hover {
    background-color: #2980b9;
}

#resetButton {
    background-color: #e74c3c;
}

#resetButton:hover {
    background-color: #c0392b;
}

/* Completion Popup Styles */
.completion-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.completion-popup-overlay.active {
    opacity: 1;
}

.completion-popup {
    background: linear-gradient(135deg, #fff6f6 0%, #ffe4e1 100%);
    border-radius: 20px;
    padding: 30px;
    max-width: 90%;
    width: 400px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    animation: popup-appear 0.5s ease forwards;
}

.completion-popup-overlay.active .completion-popup {
    transform: scale(1);
}

.completion-icon {
    font-size: 50px;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

.completion-title {
    color: #ff6b6b;
    font-size: 28px;
    margin-bottom: 15px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.completion-message {
    color: #666;
    font-size: 18px;
    line-height: 1.5;
    margin-bottom: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.completion-time {
    color: #888;
    font-size: 16px;
    margin-bottom: 20px;
    font-family: monospace;
}

.completion-stars {
    color: #ffd700;
    font-size: 24px;
    margin-bottom: 25px;
    animation: stars-shine 2s infinite;
}

.completion-close-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.completion-close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

@keyframes popup-appear {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes stars-shine {
    0% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.5;
    }
}

/* Mobil uyumluluk için medya sorguları */
@media (max-width: 480px) {
    .completion-popup {
        padding: 20px;
        width: 85%;
    }

    .completion-title {
        font-size: 24px;
    }

    .completion-message {
        font-size: 16px;
    }

    .completion-icon {
        font-size: 40px;
    }

    .completion-stars {
        font-size: 20px;
    }

    .completion-close-btn {
        padding: 10px 25px;
        font-size: 14px;
    }
}

.visibility-select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.3s;
}

.visibility-select:hover {
    border-color: var(--secondary-color);
}

.visibility-select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Durum seçenekleri için renkler */
.visibility-select option[value="public"] {
    background-color: #e8f5e9;
}

.visibility-select option[value="private"] {
    background-color: #fff3e0;
}

.user-credits {
    background: #4CAF50;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    margin-right: 10px;
}

.credit-warning {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #ef9a9a;
}

.credit-info {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #a5d6a7;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert-success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.alert-error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.image-preview-container {
    margin: 20px 0;
    text-align: center;
}

.preview-wrapper {
    max-width: 600px;
    margin: 0 auto;
    background: #f5f5f5;
    border: 2px dashed #ddd;
    border-radius: 4px;
    overflow: hidden;
}

#preview {
    max-width: 100%;
    display: block;
}

.crop-info {
    margin: 10px 0;
    color: #666;
    font-style: italic;
}

.crop-controls {
    margin: 10px 0;
}

.crop-controls button {
    margin: 0 5px;
}

.cropper-container {
    margin: 0 auto;
}

.completion-message-input {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-top: 4px;
    transition: all 0.3s ease;
}

.completion-message-input:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.completion-message-input:hover {
    border-color: var(--secondary-color);
}

/* Toast bildirim stilleri */
.toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
}

.toast {
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.3s ease;
    max-width: 90vw;
    width: auto;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: #4CAF50;
    color: white;
}

.toast .toast-icon {
    font-size: 20px;
}

.toast .toast-message {
    font-size: 14px;
    font-weight: 500;
}

/* Mobil için düzenlemeler */
@media (max-width: 768px) {
    .toast {
        font-size: 13px;
        padding: 10px 16px;
        bottom: 10px;
    }
    
    .toast .toast-icon {
        font-size: 18px;
    }
    
    .toast .toast-message {
        font-size: 13px;
    }
}

/* Çok küçük ekranlar için */
@media (max-width: 360px) {
    .toast {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .toast .toast-icon {
        font-size: 16px;
    }
    
    .toast .toast-message {
        font-size: 12px;
    }
}

.toast.error {
    background: #f44336;
    color: white;
}

.toast.error .toast-icon {
    content: "✕";
}

/* YouTube URL kontrol stilleri */
.youtube-url-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.youtube-url-container input {
    flex: 1;
}

.youtube-url-container button {
    white-space: nowrap;
    padding: 8px 16px;
}

.youtube-preview {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px;
    margin: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideDown 0.3s ease;
}

.video-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.video-thumbnail {
    width: 120px;
    height: 68px;
    border-radius: 4px;
    object-fit: cover;
}

.video-details {
    flex: 1;
}

.video-title {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.video-channel {
    margin: 4px 0 0;
    font-size: 12px;
    color: #666;
}

.btn-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 0 8px;
}

.btn-close:hover {
    color: #333;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hata durumu için stiller */
.youtube-preview.error {
    background: #fff3f3;
    border-color: #dc3545;
}

.youtube-preview.error .video-title {
    color: #dc3545;
}

/* Mobil uyumluluk */
@media (max-width: 768px) {
    .youtube-url-container {
        flex-direction: column;
    }
    
    .youtube-preview {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .video-info {
        flex-direction: column;
    }
    
    .video-thumbnail {
        width: 100%;
        max-width: 200px;
        height: auto;
    }
}

/* Oyun alanı için stil izolasyonu */
.game-container {
    /* Oyun sayfası için gerekli genel stiller */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color, #ecf0f1);
    color: var(--text-color, #2c3e50);
    line-height: 1.6;
    padding: 20px 0;
    margin-top: 100px; /* Ana site header'ından sonra gerekli boşluk */
}

/* Oyun içi elementleri kapsayan stiller burada kalacak */
/* ... Diğer oyun stilleri ... */