/* ============================================
   OYUN BAHÇESİ - Oyun Ortak Stilleri
   ============================================ */

/* Oyun Container */
.game-container {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: linear-gradient(180deg, #E8F4FD 0%, #F0F8FF 100%);
    animation: fadeIn 0.3s ease both;
}

/* Oyun Toolbar */
.game-toolbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 var(--space-md);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.toolbar-btn {
    width: var(--touch-min);
    height: var(--touch-min);
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    color: var(--text-warm);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.toolbar-btn svg {
    width: 24px;
    height: 24px;
}

.toolbar-btn:active {
    transform: scale(0.9);
}

.toolbar-info {
    flex: 1;
    text-align: center;
}

.toolbar-title {
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-warm);
}

.toolbar-level {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 2px;
}

.toolbar-level .level-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--star-empty);
    transition: all 0.3s ease;
}

.toolbar-level .level-dot.active {
    background: var(--neutral);
    transform: scale(1.3);
}

.toolbar-level .level-dot.done {
    background: var(--success);
}

.toolbar-stars {
    display: flex;
    gap: 4px;
}

.toolbar-star {
    width: 24px;
    height: 24px;
    fill: var(--star-empty);
    transition: all 0.4s var(--ease-spring);
}

.toolbar-star.earned {
    fill: var(--star-gold);
    filter: drop-shadow(0 1px 4px rgba(255, 215, 0, 0.4));
}

/* Oyun Alanı */
.game-area {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: var(--space-md);
    overflow-y: auto;
    overflow-x: hidden;
    overflow-anchor: auto;
}

/* Oyun yönergesi */
.game-instruction {
    font-family: 'Fredoka', sans-serif;
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    font-weight: 600;
    color: var(--text-warm);
    text-align: center;
    margin-bottom: var(--space-lg);
    padding: var(--space-sm) var(--space-lg);
    background: rgba(255,255,255,0.8);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    animation: fadeInUp 0.4s var(--ease-spring) both;
}

/* Ortak oyun butonları */
.game-option-btn {
    min-width: var(--touch-min);
    min-height: var(--touch-min);
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 3px solid #E0E0E0;
    border-radius: var(--radius-md);
    font-family: 'Fredoka', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s var(--ease-bounce);
    box-shadow: var(--shadow-sm);
    padding: var(--space-md);
}

.game-option-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.game-option-btn:active {
    transform: scale(0.95);
}

.game-option-btn.correct {
    background: var(--success-light);
    border-color: var(--success);
    animation: successPulse 0.4s ease;
}

.game-option-btn.wrong {
    background: var(--error-light);
    border-color: var(--error);
    animation: wiggle 0.4s ease;
}

/* Sayı Butonları */
.number-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: white;
    border: 3px solid #E0E0E0;
    font-family: 'Fredoka', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease-bounce);
    box-shadow: 0 3px 0 #D5D5D5;
}

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

.number-btn.correct {
    background: var(--success);
    border-color: var(--success);
    color: white;
    box-shadow: 0 3px 0 #27AE60;
    animation: successPulse 0.4s ease;
}

.number-btn.wrong {
    animation: wiggle 0.4s ease;
    border-color: var(--error);
}

/* Hafıza Kartları */
.memory-grid {
    display: grid;
    gap: var(--space-md);
    perspective: 1000px;
}

.memory-card {
    position: relative;
    aspect-ratio: 1;
    min-width: 60px;
    min-height: 60px;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.memory-card:active {
    transform: scale(0.95);
}

.memory-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.5s var(--ease-smooth);
    transform-style: preserve-3d;
}

.memory-card.flipped .memory-card-inner {
    transform: rotateY(180deg);
}

.memory-card-front,
.memory-card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.memory-card-front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-size: 2rem;
    color: white;
    border: 3px solid rgba(255,255,255,0.3);
}

.memory-card-front::after {
    content: '?';
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 2.5rem;
    opacity: 0.6;
}

.memory-card-back {
    background: white;
    transform: rotateY(180deg);
    font-size: 2.5rem;
    border: 3px solid #E0E0E0;
}
.memory-card-back img {
    width: 72%;
    height: 72%;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.memory-card.matched .memory-card-back {
    border-color: var(--success);
    background: var(--success-light);
    animation: glow 2s ease-in-out infinite;
}

.memory-card.matched {
    pointer-events: none;
}

/* Boyama Alanı */
.coloring-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    width: 100%;
}

.coloring-svg {
    flex: 1;
    max-width: 100%;
    max-height: 60vh;
}

.coloring-svg path,
.coloring-svg rect,
.coloring-svg circle,
.coloring-svg ellipse,
.coloring-svg polygon {
    cursor: pointer;
    stroke: #333;
    stroke-width: 2;
    transition: fill 0.3s ease;
}

.coloring-svg path:hover,
.coloring-svg rect:hover,
.coloring-svg circle:hover,
.coloring-svg ellipse:hover,
.coloring-svg polygon:hover {
    opacity: 0.85;
}

.color-palette {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: rgba(255,255,255,0.9);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    flex-wrap: wrap;
    justify-content: center;
}

.color-swatch {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid white;
    cursor: pointer;
    transition: all 0.2s var(--ease-bounce);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.active {
    border-color: var(--text-dark);
    transform: scale(1.2);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.2);
}

/* Boyama Galeri */
.boyama-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    padding: 0.5rem;
    max-width: min(480px, 95vw);
    margin: 0 auto;
}
.boyama-gallery-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    background: white;
    border: 3px solid #E0E0E0;
    border-radius: 16px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}
.boyama-gallery-card:hover { transform: scale(1.05); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.boyama-gallery-card.completed { border-color: var(--success); background: #F0FFF0; }
.boyama-gallery-emoji { font-size: 2rem; }
.boyama-gallery-name { font-size: 0.75rem; font-weight: 700; color: #555; }
.boyama-gallery-check { position: absolute; top: 4px; right: 4px; font-size: 0.8rem; }
.boyama-back-btn {
    background: none; border: none; color: var(--primary); font-weight: 700;
    font-size: 0.85rem; cursor: pointer; padding: 0.3rem 0.8rem;
}

/* Sürükle Bırak Öğeleri */
.draggable-item {
    cursor: grab;
    touch-action: none;
    transition: transform 0.2s var(--ease-bounce), box-shadow 0.2s ease;
    user-select: none;
}

.draggable-item:active {
    cursor: grabbing;
}

.draggable-item.dragging {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    opacity: 0.9;
}

.drop-zone {
    border: 3px dashed #C0C0C0;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    background: rgba(255,255,255,0.3);
}

.drop-zone.highlight {
    border-color: var(--neutral);
    background: rgba(52, 152, 219, 0.1);
    transform: scale(1.05);
}

.drop-zone.filled {
    border-style: solid;
    border-color: var(--success);
    background: var(--success-light);
}

/* Seviye seçici */
.level-selector {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.level-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: white;
    border: 3px solid #E0E0E0;
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease-bounce);
    box-shadow: 0 3px 0 #D5D5D5;
}

.level-btn.active {
    background: var(--neutral);
    color: white;
    border-color: var(--neutral);
    box-shadow: 0 3px 0 #2980B9;
}

.level-btn.completed {
    background: var(--success);
    color: white;
    border-color: var(--success);
    box-shadow: 0 3px 0 #27AE60;
}

.level-btn:active {
    transform: translateY(2px);
}

/* Harf gösterim */
.letter-display {
    font-family: 'Fredoka', sans-serif;
    font-size: clamp(4rem, 12vw, 8rem);
    font-weight: 700;
    color: var(--harf-color);
    text-shadow: 3px 3px 0 rgba(0,0,0,0.08);
    animation: pop 0.4s var(--ease-spring) both;
    line-height: 1;
    margin-bottom: var(--space-md);
}

/* Renk hedef gösterimi */
.color-target {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-lg);
    border: 4px solid white;
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-md);
    animation: pop 0.3s var(--ease-spring) both;
}

/* Sıralama slotları */
.sorting-slots {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background: rgba(255,255,255,0.5);
    border-radius: var(--radius-lg);
}

.sorting-slot {
    min-width: 80px;
    min-height: 80px;
    border: 3px dashed #C0C0C0;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: rgba(255,255,255,0.5);
    transition: all 0.2s ease;
}

.sorting-slot.highlight {
    border-color: var(--neutral);
    background: rgba(52, 152, 219, 0.1);
}

/* Şekil SVG stilleri */
.shape-piece {
    cursor: grab;
    touch-action: none;
    transition: filter 0.2s ease;
}

.shape-piece:hover {
    filter: brightness(1.1);
}

.shape-outline {
    fill: none;
    stroke: #AAA;
    stroke-width: 3;
    stroke-dasharray: 10 5;
    transition: all 0.3s ease;
}

.shape-outline.highlight {
    stroke: var(--neutral);
    stroke-width: 4;
}

.shape-outline.filled {
    stroke: var(--success);
    stroke-dasharray: none;
    fill: rgba(46, 204, 113, 0.15);
}

/* ============================================
   Matematik Oyunu
   ============================================ */
.mat-game {
    max-width: 500px; margin: 0 auto; padding: 1rem;
    text-align: center;
}
.mat-progress {
    font-size: 0.85rem; font-weight: 600; color: #888; margin-bottom: 1rem;
}
.mat-question {
    display: flex; align-items: center; justify-content: center;
    gap: 0.6rem; margin-bottom: 2rem; flex-wrap: wrap;
}
.mat-num {
    font-family: 'Fredoka', sans-serif; font-size: 3rem; font-weight: 700;
    color: #2d3436; min-width: 60px; text-align: center;
    background: rgba(255,255,255,0.9); border-radius: 16px; padding: 8px 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.mat-op, .mat-eq {
    font-size: 2.5rem; font-weight: 700; color: #FF6348;
}
.mat-unknown {
    background: linear-gradient(135deg, #FFD93D, #FF6B6B); color: white;
    animation: pulse 1.5s ease-in-out infinite;
}
.mat-revealed { background: #2ECC71 !important; color: white !important; animation: none; }
.mat-choices {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
    max-width: 320px; margin: 0 auto;
}
.mat-choice {
    font-family: 'Fredoka', sans-serif; font-size: 2rem; font-weight: 700;
    color: white; border: none; border-radius: 20px; padding: 1rem;
    cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.mat-choice:hover:not(:disabled) { transform: scale(1.08); }
.mat-choice:disabled { opacity: 0.7; cursor: default; }
.mat-correct { box-shadow: 0 0 0 4px #2ECC71, 0 4px 16px rgba(46,204,113,0.4) !important; }
.mat-wrong { box-shadow: 0 0 0 4px #E74C3C !important; animation: shake 0.4s; }

/* ============================================
   Hece Birleştirme Oyunu
   ============================================ */
.hece-game {
    max-width: 500px; margin: 0 auto; padding: 1rem; text-align: center;
}
.hece-progress { font-size: 0.85rem; font-weight: 600; color: #888; margin-bottom: 0.5rem; }
.hece-target { margin-bottom: 1.5rem; }
.hece-emoji { font-size: 3.5rem; display: block; margin-bottom: 0.3rem; }
.hece-hint { font-size: 0.9rem; color: #636e72; font-weight: 600; }

.hece-answer-area {
    display: flex; justify-content: center; gap: 8px;
    margin-bottom: 1.5rem; min-height: 60px; flex-wrap: wrap;
}
.hece-slot {
    min-width: 70px; height: 50px; border: 3px dashed #ccc; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Fredoka', sans-serif; font-size: 1.3rem; font-weight: 600;
    color: #2d3436; background: rgba(255,255,255,0.8); transition: all 0.3s;
}
.hece-slot.hece-filled {
    border-color: #45B7D1; background: #E3F6FD; border-style: solid;
}

.hece-syllables {
    display: flex; justify-content: center; gap: 10px; flex-wrap: wrap;
    margin-bottom: 1rem;
}
.hece-btn {
    font-family: 'Fredoka', sans-serif; font-size: 1.2rem; font-weight: 600;
    padding: 12px 22px; border-radius: 16px; border: 3px solid #00897B;
    background: white; color: #00897B; cursor: pointer;
    transition: all 0.2s; box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}
.hece-btn:hover:not(:disabled) { background: #00897B; color: white; transform: scale(1.05); }
.hece-btn.hece-used { opacity: 0.3; transform: scale(0.9); }
.hece-btn.hece-selected { background: #00897B; color: white; }

.hece-reset-btn {
    font-size: 0.85rem; padding: 6px 16px; border-radius: 12px;
    border: 2px solid #ddd; background: white; color: #888; cursor: pointer;
    margin-top: 0.5rem;
}
.hece-reset-btn:hover { border-color: #aaa; color: #555; }

.hece-success { animation: bounceIn 0.5s; }
.hece-wrong { animation: shake 0.4s; }
.hece-word-reveal {
    font-family: 'Fredoka', sans-serif; font-size: 2rem; font-weight: 700;
    color: #2ECC71; padding: 1rem; animation: bounceIn 0.5s;
}

/* ============================================
   Jigsaw Bulmaca Oyunu
   ============================================ */
.jig-game {
    max-width: 500px; margin: 0 auto; padding: 1rem; text-align: center;
}
.jig-progress { font-size: 0.85rem; font-weight: 600; color: #888; margin-bottom: 1rem; }
.jig-board {
    display: inline-grid; gap: 4px; margin: 0 auto 1rem;
    background: rgba(0,0,0,0.05); border-radius: 16px; padding: 8px;
}
.jig-cell {
    background: rgba(255,255,255,0.6); border: 2px dashed #ccc; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s;
}
.jig-cell:hover:not(.jig-placed) { background: rgba(255,255,255,0.9); border-color: #9C27B0; }
.jig-cell.jig-placed {
    background: rgba(255,255,255,0.95); border: 2px solid #2ECC71; cursor: default;
}
.jig-cell.jig-pop { animation: bounceIn 0.4s; }
.jig-cell.jig-wrong { animation: shake 0.4s; border-color: #E74C3C !important; }
.jig-hint { font-size: 0.85rem; color: #636e72; margin-bottom: 0.8rem; }
.jig-pieces {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
}
.jig-piece {
    width: 56px; height: 56px; border-radius: 14px; border: 3px solid #9C27B0;
    background: white; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}
.jig-piece:hover { transform: scale(1.1); box-shadow: 0 6px 16px rgba(0,0,0,0.15); }
.jig-piece.jig-selected {
    background: #F3E5F5; border-color: #7B1FA2;
    box-shadow: 0 0 0 3px rgba(156,39,176,0.3), 0 6px 16px rgba(0,0,0,0.15);
    transform: scale(1.1);
}

/* ============================================
   Desen Tamamlama Oyunu
   ============================================ */
.desen-game {
    max-width: 500px; margin: 0 auto; padding: 1rem; text-align: center;
}
.desen-progress { font-size: 0.85rem; font-weight: 600; color: #888; margin-bottom: 0.5rem; }
.desen-instruction {
    font-family: 'Fredoka', sans-serif; font-size: 1.2rem; font-weight: 600;
    color: #2d3436; margin-bottom: 1.2rem;
}
.desen-sequence {
    display: flex; justify-content: center; align-items: center;
    gap: 6px; flex-wrap: wrap; margin-bottom: 2rem;
    background: rgba(255,255,255,0.8); border-radius: 20px; padding: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.desen-item {
    font-size: 2.2rem; min-width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s;
}
.desen-unknown {
    background: linear-gradient(135deg, #FFD93D, #FF6B6B); border-radius: 12px;
    animation: pulse 1.5s ease-in-out infinite; font-size: 1.5rem;
}
.desen-revealed {
    animation: bounceIn 0.5s; background: #2ECC71; border-radius: 12px; color: white;
}
.desen-choices {
    display: flex; justify-content: center; gap: 12px; flex-wrap: wrap;
}
.desen-choice {
    font-size: 2.5rem; width: 72px; height: 72px; border-radius: 18px;
    border: 3px solid #ddd; background: white; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}
.desen-choice:hover:not(:disabled) { transform: scale(1.1); border-color: #E040FB; }
.desen-choice:disabled { cursor: default; }
.desen-correct { border-color: #2ECC71 !important; box-shadow: 0 0 0 3px rgba(46,204,113,0.3) !important; }
.desen-wrong { border-color: #E74C3C !important; animation: shake 0.4s; }

@keyframes bounceIn {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 420px) {
    .mat-num { font-size: 2.2rem; padding: 6px 12px; min-width: 46px; }
    .mat-choice { font-size: 1.5rem; padding: 0.7rem; }
    .hece-btn { font-size: 1rem; padding: 10px 16px; }
    .hece-slot { min-width: 55px; height: 42px; font-size: 1.1rem; }
    .desen-item { font-size: 1.6rem; min-width: 36px; height: 36px; }
    .desen-choice { font-size: 1.8rem; width: 58px; height: 58px; }
    .jig-piece { width: 46px; height: 46px; }
}
