@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600;700&display=swap');

:root {
    --primary: #3498db;
    --secondary: #2ecc71;
    --accent: #f39c12;
    --danger: #e74c3c;
    --bg-light: #f7f9fc;
    --text-dark: #2c3e50;
    --white: #ffffff;
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --shadow-premium: 0 20px 40px rgba(0,0,0,0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Quicksand', "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
    background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

.dash-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.icon-img {
    height: 1.2em;
    width: auto;
    vertical-align: middle;
    margin-right: 4px;
    object-fit: contain;
}

header {
    text-align: center;
    padding: 40px 0;
}

h1 {
    font-size: 2.5rem;
    color: var(--primary);
    text-shadow: 2px 2px 0px rgba(255,255,255,0.5);
    margin-bottom: 10px;
}

.card {
    background: var(--white);
    border-radius: 30px;
    padding: 30px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    text-align: center;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

/* Avatar Seçimi */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.avatar-item {
    cursor: pointer;
    border: 5px solid transparent;
    border-radius: 50%;
    overflow: hidden;
    transition: all 0.3s ease;
}

.avatar-item:hover, .avatar-item.selected {
    border-color: var(--secondary);
    transform: scale(1.1);
}

.avatar-item img {
    width: 100%;
    display: block;
}

/* Butonlar */
.btn {
    display: inline-block;
    padding: 15px 30px;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-primary { background-color: var(--primary); color: white; }
.btn-secondary { background-color: var(--secondary); color: white; }
.btn-accent { background-color: var(--accent); color: white; }

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

/* Oyun Ekranı */
.game-box {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.big-text {
    font-size: 5rem;
    font-weight: 700;
    color: var(--primary);
    margin: 40px 0;
    min-height: 1.2em;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 100%;
}

@media (max-width: 600px) {
    .options-grid { grid-template-columns: 1fr; }
    .big-text { font-size: 3rem; }
}

/* Puan ve Seviye */
.stats-bar {
    display: flex;
    justify-content: space-between;
    background: rgba(255,255,255,0.8);
    padding: 15px 25px;
    border-radius: 50px;
    margin-bottom: 20px;
    font-weight: 700;
}

.badge {
    background: var(--accent);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Okuma Testi Metni */
.reading-text {
    font-size: 1.5rem;
    line-height: 2;
    text-align: left;
    white-space: pre-wrap;
    user-select: none;
}

.word-span {
    padding: 2px 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

.word-span:hover {
    background: #e0e0e0;
}

.word-span.clicked {
    background: var(--secondary);
    color: white;
}

/* Animasyonlar */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.bounce { animation: bounce 2s infinite; }

/* --- Karakter Giydirme Sistemi (Gelişmiş Katmanlı Yapı) --- */
.avatar-container, .preview-box {
    position: relative;
    font-size: 5.5rem;
    width: 170px;
    height: 170px;
    margin: 0 auto 20px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    z-index: 1;
    overflow: visible;
}

#preview-avatar, #dash-avatar {
    z-index: 5;
    position: relative;
    user-select: none;
    line-height: 1;
}

.equipped-on-dash, .equipped-icon {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    line-height: 1;
    white-space: nowrap;
}

.hat { margin-top: -65px; font-size: 4rem; z-index: 10; }
.glass { margin-top: -5px; font-size: 3.2rem; z-index: 15; }
.cape {
    margin-top: 30px; font-size: 5rem; z-index: -1; opacity: 0.95;
    transform: translate(-50%, -50%) scaleX(-1);
}

/* --- Karakterlere Özel Uyum (Hizalama) --- */
/* Tavşan (Uzun kulaklar nedeniyle şapka daha yukarıda) */
.char-🐰 .hat { margin-top: -95px; }
.char-🐰 .glass { margin-top: -8px; }

/* Aslan (Yele nedeniyle gözlük biraz büyük olabilir) */
.char-🦁 .glass { font-size: 3.5rem; }
.char-🦁 .hat { margin-top: -70px; }

/* Ayı ve Panda (Daha geniş ve düz kafalar) */
.char-🐻 .hat, .char-🐼 .hat { margin-top: -60px; font-size: 4.5rem; }
.char-🐻 .glass, .char-🐼 .glass { margin-top: 0px; font-size: 3.5rem; }

/* Tek boynuz, Ejderha, Dinozor (Boynuz / Uzun kafa yapıları) */
.char-🦄 .hat { margin-top: -80px; transform: translate(-40%, -50%) rotate(10deg); }
.char-🐉 .hat, .char-🐲 .hat, .char-🦖 .hat { margin-top: -75px; }
.char-🦖 .glass, .char-🐲 .glass { margin-top: -10px; font-size: 3.5rem; }

/* Robot ve Astronot (Köşeli veya vizörlü kafalar) */
.char-🤖 .hat { margin-top: -55px; font-size: 4.2rem; }
.char-🤖 .glass { margin-top: 2px; }
.char-👨‍🚀 .hat { margin-top: -85px; font-size: 4.5rem; }
.char-👨‍🚀 .glass { margin-top: -15px; font-size: 3.8rem; }

/* --- Karaoke & Okuma Testi --- */
.word-span {
    padding: 2px 5px;
    margin: 0 2px;
    border-radius: 5px;
    transition: all 0.2s;
    display: inline-block;
}

.word-span.read {
    color: #27ae60;
    background: rgba(46, 204, 113, 0.1);
    font-weight: bold;
}

.word-span.current {
    background: rgba(241, 196, 15, 0.2);
    color: var(--primary);
    font-weight: bold;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.3);
    border-bottom: 3px solid #f1c40f;
    animation: pulsate 1.5s infinite;
}

@keyframes pulsate {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.mic-status {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin: 10px 0;
    font-weight: bold;
    color: #7f8c8d;
}

.mic-dot {
    width: 12px;
    height: 12px;
    background: #e74c3c;
    border-radius: 50%;
}

.mic-dot.active {
    background: #2ecc71;
    box-shadow: 0 0 10px #2ecc71;
    animation: breathe 2s infinite;
}

@keyframes breathe {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

/* Splash Geliştirmeleri */
.splash-overlay {
    position: fixed; inset: 0; 
    background: linear-gradient(rgba(52, 152, 219, 0.95), rgba(41, 128, 185, 0.95)); 
    z-index: 9999;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: white; text-align: center; padding: 20px;
    backdrop-filter: blur(8px);
}

#splash-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.splash-content {
    max-width: 600px;
    padding: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 40px;
    border: 2px solid rgba(255,255,255,0.2);
}

/* Shop Karakter Geliştirmeleri */
.preview-box {
    box-shadow: 0 15px 35px rgba(0,0,0,0.2) !important;
}

/* Kategori Butonları Hovers */
.tab-btn:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    color: var(--primary);
}

/* --- Modals --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.3);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Glassmorphism utility */
.glass-card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-premium);
}

/* Entry Animation */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeInUp 0.5s ease forwards;
}

