/* Algoritma Oyunları Sayfası */

.header-compact {
    padding: 1rem 1rem 0.5rem;
}

.header-compact .logo h1 {
    font-size: 1.5rem;
}

/* Kademe ve İlerleme */
.kademe-display {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.kademe-badges {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.kademe-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5e7eb;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
}

.kademe-badge.active {
    background: var(--primary);
    color: white;
}

.kademe-badge.completed {
    background: var(--success);
    color: white;
}

.kademe-info {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.back-link {
    display: inline-block;
    margin-bottom: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: transform 0.2s;
}

.back-link:hover {
    transform: translateX(-4px);
}

.main-algoritma {
    max-width: 700px;
}

/* Oyun Sekmeleri */
.game-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.game-tab {
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    padding: 0.75rem 1.25rem;
    border: 3px solid var(--primary);
    background: white;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.game-tab:hover {
    background: #eef2ff;
}

.game-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary-dark);
}

.tab-emoji {
    font-size: 1.25rem;
}

/* Oyun Panelleri */
.game-panel {
    display: none;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.game-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.game-intro {
    margin-bottom: 1.5rem;
}

.game-intro h2 {
    font-size: 1.5rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.game-intro p {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text);
}

/* Sıralama Oyunu */
.game-scenario {
    margin-bottom: 1rem;
}

.scenario-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}

.scenario-desc {
    font-size: 0.95rem;
    color: var(--text-light);
}

.scenario-progress {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 0.5rem;
}

.game-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1rem;
}

.nav-buttons {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.btn-nav {
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-nav:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.sort-game {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.sort-target {
    flex: 1;
    min-width: 200px;
    min-height: 120px;
    padding: 1rem;
    background: #eef2ff;
    border: 3px dashed var(--primary);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sort-target.drag-over {
    background: #c7d2fe;
    border-color: var(--primary-dark);
}

.sort-options {
    padding: 0.5rem;
    border-radius: 12px;
    border: 2px dashed transparent;
}

.sort-options.drag-over {
    background: #c7d2fe;
    border-color: var(--primary);
}

.sort-placeholder {
    color: var(--text-light);
    font-size: 0.9rem;
}

.sort-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 180px;
}

.sort-step {
    padding: 0.75rem 1rem;
    background: white;
    border: 2px solid var(--primary);
    border-radius: 12px;
    cursor: grab;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.sort-step:hover {
    background: #eef2ff;
}

.sort-step:active {
    cursor: grabbing;
}

.sort-step.dragging {
    opacity: 0.5;
}

.sort-step.in-target {
    background: #c7d2fe;
    border-color: var(--primary-dark);
}

/* Döngü Oyunu */
.loop-game {
    margin: 1.5rem 0;
}

.loop-instruction {
    padding: 1rem;
    background: #eef2ff;
    border-radius: 16px;
    margin-bottom: 1rem;
}

.loop-instruction p {
    font-size: 1.1rem;
    text-align: center;
}

.loop-visual {
    margin: 1.5rem 0;
}

.robot-track {
    position: relative;
    padding: 1rem;
    background: #f3f4f6;
    border-radius: 16px;
}

.robot {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    transition: transform 0.5s ease;
}

.track-cells {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.track-cell {
    width: 40px;
    height: 40px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.track-cell.filled {
    background: var(--primary);
    border-color: var(--primary-dark);
    color: white;
}

.loop-choices {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.choice-btn {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 1rem 1.5rem;
    border: 3px solid var(--primary);
    background: white;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.choice-btn:hover {
    background: #eef2ff;
    transform: scale(1.05);
}

.choice-btn.correct {
    background: var(--success);
    border-color: #059669;
    color: white;
}

.choice-btn.wrong {
    background: #fecaca;
    border-color: #dc2626;
}

/* Koşul Oyunu */
.condition-game {
    margin: 1.5rem 0;
}

.condition-scenario {
    padding: 1rem;
    background: #fdf2f8;
    border-radius: 16px;
    margin-bottom: 1.5rem;
}

.condition-scenario p {
    font-size: 1.1rem;
    text-align: center;
}

.condition-question p {
    font-size: 1.15rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.condition-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.cond-btn {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 1rem 1.5rem;
    border: 3px solid var(--accent);
    background: white;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.cond-btn:hover {
    background: #fdf2f8;
    transform: scale(1.05);
}

.cond-btn.correct {
    background: var(--success);
    border-color: #059669;
    color: white;
}

.cond-btn.wrong {
    background: #fecaca;
    border-color: #dc2626;
}

/* Geri Bildirim */
.game-feedback {
    min-height: 50px;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
}

.game-feedback.success {
    background: #d1fae5;
    color: #065f46;
}

.game-feedback.error {
    background: #fee2e2;
    color: #991b1b;
}

.game-feedback:empty {
    display: none;
}

/* Butonlar */
.btn-check {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.75rem 1.5rem;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    margin-right: 0.5rem;
    transition: all 0.2s;
}

.btn-check:hover {
    background: #059669;
    transform: scale(1.05);
}

.btn-restart {
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    padding: 0.75rem 1.25rem;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-restart:hover {
    background: #d97706;
    transform: scale(1.05);
}

@media (max-width: 500px) {
    .sort-game {
        flex-direction: column;
    }

    .sort-options {
        width: 100%;
    }
}
