/* ==========================================================================
   Prenses Sare'nin Sihirli Krallığı — Tasarım Sistemi & Uygulama Kabuğu
   --------------------------------------------------------------------------
   İçindekiler
     1. Tasarım belirteçleri
     2. Sıfırlama ve temel
     3. Dekoratif arka plan
     4. Açılış ekranı
     5. Oyun Sarayı (hub)
     6. Oyun ekranı
     7. Modallar (ayarlar / rozetler / büyükler)
     8. Bildirimler ve yıldız animasyonu
     9. Duyarlılık ve erişilebilirlik
   ========================================================================== */

/* ------------------------------ 1. BELİRTEÇLER ------------------------------ */
:root {
    --pink-600: #F43F7E;
    --pink-500: #FF5C8D;
    --pink-300: #FFB3C9;
    --pink-100: #FFE7EF;

    --lilac-500: #8B5CF6;
    --lilac-300: #C4B5FD;
    --sky-500: #38BDF8;
    --mint-500: #34D399;
    --sun-500: #FFC53D;
    --sun-600: #F59E0B;

    --cream: #FFF8F3;
    --paper: #FFFFFF;
    --ink: #2C2140;
    --ink-2: #6C5C87;
    --ink-3: #9A8DAF;

    --line: rgba(44, 33, 64, 0.08);

    --radius-xl: 34px;
    --radius-lg: 26px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --radius-pill: 999px;

    --shadow-soft: 0 10px 30px rgba(96, 62, 132, 0.10);
    --shadow-card: 0 14px 34px rgba(96, 62, 132, 0.13);
    --shadow-pop: 0 22px 60px rgba(96, 62, 132, 0.22);

    --font-round: ui-rounded, "SF Pro Rounded", "Segoe UI Variable", "Segoe UI",
                  -apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, sans-serif;

    --ease-pop: cubic-bezier(0.22, 1.2, 0.36, 1);
    --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ------------------------------ 2. TEMEL ------------------------------ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed;
    overscroll-behavior: none;
    font-family: var(--font-round);
    color: var(--ink);
    background: var(--cream);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button, input {
    font-family: inherit;
    color: inherit;
    border: none;
    background: none;
}

button {
    cursor: pointer;
    touch-action: manipulation;
}

button:focus-visible,
input:focus-visible {
    outline: 3px solid var(--lilac-500);
    outline-offset: 3px;
}

img, svg { display: block; }

.app {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background:
        radial-gradient(120% 90% at 8% 0%, #FFE9F1 0%, rgba(255, 233, 241, 0) 55%),
        radial-gradient(110% 90% at 100% 8%, #E9E1FF 0%, rgba(233, 225, 255, 0) 60%),
        radial-gradient(90% 80% at 50% 110%, #E3FBF2 0%, rgba(227, 251, 242, 0) 62%),
        linear-gradient(180deg, #FFF9F4 0%, #FFF3F7 45%, #F4F1FF 100%);
}

/* ------------------------------ 3. ARKA PLAN ------------------------------ */
.app-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

/* Lekeler zaten yumuşak radyal geçiş; üstüne blur(60px) her karede büyük alanı yeniden çizdiriyor, video
   oynarken bilgisayarı ve iPad'i kastırıyordu. Blur yok, yalnız transform animasyonu (ekran kartında ucuz). */
.bg-blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.55;
    will-change: transform;
    animation: blobFloat 18s ease-in-out infinite alternate;
}

.blob-1 {
    width: 46vw;
    height: 46vw;
    top: -14vw;
    left: -10vw;
    background: radial-gradient(circle, #FFC2D6 0%, rgba(255, 194, 214, 0) 70%);
}

.blob-2 {
    width: 40vw;
    height: 40vw;
    top: 4vw;
    right: -12vw;
    background: radial-gradient(circle, #CFC0FF 0%, rgba(207, 192, 255, 0) 70%);
    animation-delay: -6s;
}

.blob-3 {
    width: 52vw;
    height: 40vw;
    bottom: -20vw;
    left: 28vw;
    background: radial-gradient(circle, #B9F5DF 0%, rgba(185, 245, 223, 0) 70%);
    animation-delay: -11s;
}

.bg-grain {
    position: absolute;
    inset: 0;
    opacity: 0.35;
    background-image: radial-gradient(rgba(255, 255, 255, 0.9) 1px, transparent 1px);
    background-size: 26px 26px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.5), transparent 55%);
}

.bg-sparkles span {
    position: absolute;
    font-size: 15px;
    color: #FFC861;
    opacity: 0.75;
    animation: twinkle 4.5s ease-in-out infinite;
}

@keyframes blobFloat {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(2vw, 2.4vw, 0) scale(1.08); }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.15; transform: scale(0.85) rotate(0deg); }
    50%      { opacity: 0.9;  transform: scale(1.15) rotate(12deg); }
}

/* ------------------------------ EKRANLAR ------------------------------ */
.screen {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.985);
    transition: opacity 0.38s var(--ease-out), transform 0.38s var(--ease-out), visibility 0.38s;
}

/* Solup giden ekran (açılış ekranı z-index 40 ile en üstte) solma bitmeden dokunuş yutmasın */
.screen:not(.is-active) { pointer-events: none; }

/* Görünmeyen ekranlardaki animasyonlar (açılıştaki dönen yükleme, menüdeki 12 kartın sallanması) dursun;
   ekran açılınca kaldığı yerden sürer. Oyun açıkken arkadaki lekeler ve pırıltılar hiç çizilmesin. */
.screen:not(.is-active), .screen:not(.is-active) * { animation-play-state: paused !important; }
body:has(.game-screen.is-active) .bg-blob,
body:has(.game-screen.is-active) .bg-sparkles { display: none; }

.screen.is-active {
    opacity: 1;
    visibility: visible;
    transform: none;
    z-index: 3;
}

/* ------------------------------ 4. AÇILIŞ ------------------------------ */
.splash-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    background:
        radial-gradient(60% 50% at 50% 38%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 70%);
    z-index: 40;
}

.splash-scene {
    position: relative;
    width: 190px;
    height: 190px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
}

.splash-halo {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle, #FFE3EC 0%, #F3E7FF 45%, rgba(243, 231, 255, 0) 72%);
    animation: haloPulse 3s ease-in-out infinite;
}

.splash-crown {
    position: relative;
    font-size: 84px;
    filter: drop-shadow(0 14px 18px rgba(244, 63, 126, 0.28));
    animation: crownBounce 2.4s var(--ease-pop) infinite;
}

.splash-orbit {
    position: absolute;
    inset: 8px;
    animation: spin 22s linear infinite;
}

.splash-orbit span {
    position: absolute;
    font-size: 24px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.08));
}

.splash-orbit span:nth-child(1) { top: -4px;  left: 50%; transform: translateX(-50%); }
.splash-orbit span:nth-child(2) { top: 32px;  right: 0; }
.splash-orbit span:nth-child(3) { bottom: 26px; right: 12px; }
.splash-orbit span:nth-child(4) { bottom: 0;  left: 50%; transform: translateX(-50%); }
.splash-orbit span:nth-child(5) { bottom: 26px; left: 10px; }
.splash-orbit span:nth-child(6) { top: 32px;  left: 0; }

.splash-title {
    font-size: clamp(34px, 6vw, 56px);
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--ink);
    text-shadow: 0 2px 0 #fff;
}

.splash-sub {
    margin-top: 4px;
    font-size: clamp(16px, 2.4vw, 22px);
    font-weight: 800;
    color: var(--pink-600);
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.splash-loader {
    margin-top: 30px;
    width: min(280px, 70vw);
    height: 12px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: inset 0 2px 6px rgba(96, 62, 132, 0.12);
    overflow: hidden;
}

.splash-loader span {
    display: block;
    height: 100%;
    width: 40%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--pink-500), var(--lilac-500), var(--sky-500));
    animation: loaderSlide 1.4s ease-in-out infinite;
}

.splash-note {
    margin-top: 14px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink-2);
}

@keyframes crownBounce {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50%      { transform: translateY(-12px) rotate(2deg); }
}

@keyframes haloPulse {
    0%, 100% { transform: scale(0.94); opacity: 0.75; }
    50%      { transform: scale(1.04); opacity: 1; }
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes loaderSlide {
    0%   { transform: translateX(-110%); }
    100% { transform: translateX(360%); }
}

/* ------------------------------ 5. OYUN SARAYI ------------------------------ */
.hub-screen {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hub-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: max(14px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right))
             10px max(22px, env(safe-area-inset-left));
    flex: 0 0 auto;
}

.hub-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.crest {
    width: 54px;
    height: 54px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    font-size: 28px;
    background: linear-gradient(160deg, #FFE082, #FFB300);
    border: 3px solid #fff;
    box-shadow: 0 10px 22px rgba(255, 179, 0, 0.45);
    transform: rotate(-4deg);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-name {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.brand-sub {
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--pink-600);
}

.hub-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    background: linear-gradient(160deg, #FFF3C4, #FFD54F);
    border: 2.5px solid #fff;
    box-shadow: 0 8px 18px rgba(245, 158, 11, 0.35);
    font-size: 18px;
    font-weight: 900;
    color: #7A4B00;
}

.chip-stars.bump { animation: chipBump 0.5s var(--ease-pop); }

@keyframes chipBump {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.16); }
    100% { transform: scale(1); }
}

.icon-btn {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 23px;
    background: rgba(255, 255, 255, 0.92);
    border: 2.5px solid #fff;
    box-shadow: 0 8px 20px rgba(96, 62, 132, 0.14);
    transition: transform 0.16s var(--ease-pop), box-shadow 0.16s;
}

.icon-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(96, 62, 132, 0.18); }
.icon-btn:active { transform: scale(0.93); }

.hub-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 6px max(22px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom))
             max(22px, env(safe-area-inset-left));
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
}

.greeting { padding: 6px 4px 18px; }

.greeting h2 {
    font-size: clamp(26px, 3.6vw, 38px);
    font-weight: 900;
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.greeting p {
    margin-top: 6px;
    font-size: clamp(14px, 1.6vw, 17px);
    font-weight: 700;
    color: var(--ink-2);
}

/* --- Kahraman kart (3D Krallık) --- */
.hero-card {
    position: relative;
    width: 100%;
    min-height: 208px;
    display: block;
    text-align: left;
    border-radius: var(--radius-xl);
    padding: 26px 30px;
    overflow: hidden;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.55) 46%, rgba(255, 255, 255, 0.05) 72%),
        linear-gradient(135deg, #FFD3E2 0%, #E9D5FF 52%, #CDEFFF 100%);
    border: 3px solid #fff;
    box-shadow: var(--shadow-card);
    transition: transform 0.22s var(--ease-pop), box-shadow 0.22s;
}

.hero-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-pop); }
.hero-card:active { transform: scale(0.99); }

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 56%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--lilac-500);
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.16);
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mint-500);
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18);
    animation: livePulse 1.8s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18); }
    50%      { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0.05); }
}

.hero-title {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1;
    color: #3B2A57;
}

.hero-desc {
    font-size: clamp(13px, 1.5vw, 16px);
    font-weight: 700;
    color: #6B5786;
    max-width: 30ch;
    line-height: 1.4;
}

.hero-cta {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--pink-500), #C056F0);
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0.01em;
    box-shadow: 0 12px 26px rgba(244, 63, 126, 0.38);
}

.hero-cta b { font-size: 18px; transition: transform 0.2s; }
.hero-card:hover .hero-cta b { transform: translateX(4px); }

/* Kahraman görsel sahnesi */
.hero-art {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.hero-sky {
    position: absolute;
    right: -4%;
    bottom: -20%;
    width: 54%;
    height: 130%;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 40%, #FFF5B8 0%, #FFE9A8 30%, rgba(255, 233, 168, 0) 68%);
    opacity: 0.9;
}

.hero-castle {
    position: absolute;
    right: 9%;
    bottom: -18px;
    font-size: clamp(110px, 15vw, 168px);
    filter: drop-shadow(0 18px 26px rgba(110, 70, 150, 0.22));
    line-height: 1;
    animation: heroFloat 6s ease-in-out infinite;
}

.hero-princess {
    position: absolute;
    right: 30%;
    bottom: 22px;
    font-size: clamp(30px, 4vw, 44px);
    filter: drop-shadow(0 8px 10px rgba(110, 70, 150, 0.22));
    animation: heroFloat 4.4s ease-in-out infinite reverse;
}

.hero-cloud {
    position: absolute;
    font-size: 34px;
    opacity: 0.85;
    animation: cloudDrift 9s ease-in-out infinite alternate;
}

.hero-cloud.c1 { right: 34%; top: 22px; }
.hero-cloud.c2 { right: 4%;  top: 48px; font-size: 24px; animation-delay: -3s; }

.hero-rainbow {
    position: absolute;
    right: 44%;
    top: 8px;
    font-size: clamp(40px, 5vw, 58px);
    opacity: 0.9;
    animation: heroFloat 7s ease-in-out infinite;
}

.hero-unicorn {
    position: absolute;
    right: 48%;
    bottom: 18px;
    font-size: clamp(30px, 4vw, 42px);
    filter: drop-shadow(0 8px 10px rgba(110, 70, 150, 0.18));
    animation: heroFloat 5.2s ease-in-out infinite;
}

@keyframes heroFloat {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50%      { transform: translateY(-9px) rotate(1deg); }
}

@keyframes cloudDrift {
    from { transform: translateX(0); }
    to   { transform: translateX(14px); }
}

/* --- Bölüm başlığı ve oyun ızgarası --- */
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 26px 4px 12px;
}

.section-head h3 {
    font-size: clamp(19px, 2.2vw, 24px);
    font-weight: 900;
    letter-spacing: -0.02em;
}

.section-badge {
    font-size: 12.5px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-3);
    background: rgba(255, 255, 255, 0.8);
    padding: 6px 12px;
    border-radius: var(--radius-pill);
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(226px, 1fr));
    gap: 14px;
}

.game-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.9);
    border: 2.5px solid #fff;
    box-shadow: var(--shadow-soft);
    text-align: left;
    transition: transform 0.2s var(--ease-pop), box-shadow 0.2s, background 0.2s;
    animation: cardIn 0.5s var(--ease-out) backwards;
    animation-delay: calc(var(--i) * 40ms + 120ms);
    overflow: hidden;
}

.game-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(120deg, var(--c1), var(--c2));
    opacity: 0;
    transition: opacity 0.25s;
    z-index: 0;
}

.game-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card);
}

.game-card:hover::after { opacity: 0.10; }
.game-card:active { transform: scale(0.975); }

.game-card-art {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    width: 62px;
    height: 62px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    font-size: 31px;
    background: linear-gradient(150deg, var(--c1), var(--c2));
    box-shadow: inset 0 -4px 10px rgba(0, 0, 0, 0.10), 0 8px 16px rgba(96, 62, 132, 0.16);
}

.game-card-body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.game-card-title {
    font-size: 16.5px;
    font-weight: 900;
    letter-spacing: -0.015em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-card-tagline {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink-2);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-card-stars {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 2;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.06em;
    color: var(--sun-600);
    text-transform: uppercase;
}

.game-card-stars.is-new {
    color: var(--mint-500);
    background: rgba(52, 211, 153, 0.12);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to   { opacity: 1; transform: none; }
}

.hub-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 30px 0 8px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink-3);
}

.footer-dot { opacity: 0.5; }

/* ------------------------------ 6. OYUN EKRANI ------------------------------ */
.game-screen {
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #FFF8F4 0%, #FBF3FF 60%, #F0F8FF 100%);
}

.game-topbar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: max(12px, env(safe-area-inset-top)) 18px 12px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 6px 20px rgba(96, 62, 132, 0.07);
    z-index: 5;
}

.back-btn {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: #fff;
    border: 2.5px solid #fff;
    display: grid;
    place-items: center;
    font-size: 24px;
    font-weight: 900;
    color: var(--pink-600);
    box-shadow: 0 6px 16px rgba(96, 62, 132, 0.14);
    transition: transform 0.15s var(--ease-pop);
}

.back-btn:active { transform: scale(0.9); }

.game-topbar-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
}

.game-topbar-emoji {
    font-size: 30px;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 16px rgba(96, 62, 132, 0.12);
}

.game-topbar-title h3 {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-topbar-title p {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chip.small {
    padding: 8px 14px;
    font-size: 16px;
}

.game-viewport {
    flex: 1 1 auto;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 14px;
    display: flex;
}

.game-mounts { display: none; }

.game-mount {
    flex: 1 1 auto;
    min-height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.72);
    border: 2.5px solid #fff;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.game-surface {
    flex: 1 1 auto;
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 18px;
    min-height: 0;
}

/* ------------------------------ 7. MODALLAR ------------------------------ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 20px;
}

.modal[hidden] { display: none; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(44, 33, 64, 0.42);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.24s;
}

.modal.is-open .modal-backdrop { opacity: 1; }

.modal-card {
    position: relative;
    width: min(520px, 100%);
    max-height: min(86vh, 780px);
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-pop);
    opacity: 0;
    transform: translateY(22px) scale(0.96);
    transition: opacity 0.26s var(--ease-out), transform 0.3s var(--ease-pop);
    overflow: hidden;
}

.modal-card.wide { width: min(720px, 100%); }
.modal.is-open .modal-card { opacity: 1; transform: none; }

.modal-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 22px 24px 12px;
}

.modal-head h3 {
    font-size: 21px;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.modal-close {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #F4F0FA;
    font-size: 40px;
    line-height: 1;
    display: grid;
    place-items: center;
    color: var(--ink-2);
    transition: transform 0.15s, background 0.15s;
}

.modal-close:hover { background: #EDE7F6; }
.modal-close:active { transform: scale(0.9); }

.modal-body {
    padding: 8px 24px 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-note {
    margin-top: 16px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.55;
    color: var(--ink-3);
    text-align: center;
}

/* Ayar satırları */
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 14px;
    border-radius: var(--radius-md);
    transition: background 0.15s;
}

.setting-row + .setting-row { margin-top: 4px; }
.setting-row:hover { background: #FBF7FF; }

.setting-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.setting-icon {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    font-size: 19px;
    background: #F6F1FF;
}

.setting-info b {
    display: block;
    font-size: 15px;
    font-weight: 800;
}

.setting-info small {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-3);
    margin-top: 2px;
}

.switch {
    flex: 0 0 auto;
    width: 60px;
    height: 34px;
    border-radius: var(--radius-pill);
    background: #E4DCEF;
    padding: 4px;
    transition: background 0.2s;
}

.switch span {
    display: block;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 3px 8px rgba(44, 33, 64, 0.22);
    transition: transform 0.22s var(--ease-pop);
}

.switch.on { background: linear-gradient(135deg, var(--mint-500), #22C55E); }
.switch.on span { transform: translateX(26px); }

/* Rozetler */
.badge-progress-line {
    text-align: center;
    font-size: 13px;
    font-weight: 800;
    color: var(--ink-2);
    margin-bottom: 14px;
}

.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.badge-card {
    text-align: center;
    padding: 16px 12px;
    border-radius: var(--radius-md);
    background: #FBF8FF;
    border: 2px solid transparent;
    transition: transform 0.2s var(--ease-pop);
}

.badge-card.owned {
    background: linear-gradient(160deg, #FFF8E6, #FFF1F6);
    border-color: #FFE1A8;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.14);
}

.badge-card.owned:hover { transform: translateY(-3px); }

.badge-art {
    font-size: 34px;
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 6px rgba(96, 62, 132, 0.14));
}

.badge-card.locked .badge-art { opacity: 0.35; filter: grayscale(1); }

.badge-name {
    font-size: 13.5px;
    font-weight: 900;
}

.badge-desc {
    margin-top: 3px;
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-3);
    line-height: 1.35;
}

.badge-card.locked .badge-name { color: var(--ink-3); }

/* Büyükler */
.parent-gate-q {
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink-2);
}

.parent-math {
    text-align: center;
    font-size: 34px;
    font-weight: 900;
    letter-spacing: 0.02em;
    margin: 10px 0 4px;
}

.parent-answer {
    text-align: center;
    font-size: 26px;
    font-weight: 900;
    color: var(--pink-600);
    min-height: 34px;
    letter-spacing: 0.1em;
}

.numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 14px auto 0;
    width: min(320px, 100%);
}

.numpad button {
    height: 58px;
    border-radius: var(--radius-md);
    background: #F6F2FC;
    font-size: 21px;
    font-weight: 900;
    color: var(--ink);
    transition: transform 0.12s var(--ease-pop), background 0.15s;
}

.numpad button:hover { background: #EFE8FA; }
.numpad button:active { transform: scale(0.93); }
.numpad button[data-key="ok"] { background: linear-gradient(135deg, var(--mint-500), #10B981); color: #fff; }
.numpad button[data-key="clear"] { color: var(--pink-600); }

.parent-gate-hint {
    margin-top: 14px;
    text-align: center;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink-3);
}

.parent-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

.pstat {
    text-align: center;
    padding: 14px 8px;
    border-radius: var(--radius-md);
    background: linear-gradient(160deg, #FBF7FF, #FFF6FA);
}

.pstat strong {
    display: block;
    font-size: 26px;
    font-weight: 900;
    color: var(--lilac-500);
}

.pstat span {
    font-size: 11.5px;
    font-weight: 800;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.parent-name-row {
    padding: 14px;
    border-radius: var(--radius-md);
    background: #FBF8FF;
    margin-bottom: 16px;
}

.parent-name-row > label {
    display: block;
    font-size: 12px;
    font-weight: 900;
    color: var(--ink-2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.parent-name-controls { display: flex; gap: 10px; }

.parent-name-controls input {
    flex: 1 1 auto;
    min-width: 0;
    height: 46px;
    border-radius: 14px;
    border: 2px solid #E9E1F6;
    background: #fff;
    padding: 0 14px;
    font-size: 15px;
    font-weight: 700;
    -webkit-user-select: text;
    user-select: text;
}

.btn-soft {
    flex: 0 0 auto;
    padding: 0 20px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--lilac-500), #6D3FE0);
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(139, 92, 246, 0.32);
}

.parent-playlist {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 18px;
}

.parent-play-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    font-weight: 700;
}

.ppr-emoji { width: 20px; text-align: center; }
.ppr-title { flex: 0 0 132px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ppr-bar { flex: 1 1 auto; height: 8px; border-radius: 99px; background: #F1EBFA; overflow: hidden; }
.ppr-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--pink-500), var(--lilac-500)); }
.ppr-count { flex: 0 0 26px; text-align: right; font-weight: 900; color: var(--ink); }

.btn-danger {
    width: 100%;
    height: 50px;
    border-radius: var(--radius-md);
    background: #FFF0F3;
    color: #D91A4A;
    font-size: 14px;
    font-weight: 900;
    border: 2px solid #FFD6E0;
    transition: background 0.15s, transform 0.12s;
}

.btn-danger:hover { background: #FFE2E8; }
.btn-danger:active { transform: scale(0.98); }
.btn-danger.armed { background: #D91A4A; color: #fff; border-color: #D91A4A; }

/* ------------------------------ 8. BİLDİRİM ------------------------------ */
.toast-layer {
    position: fixed;
    left: 50%;
    bottom: max(26px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 300;
    pointer-events: none;
    width: min(520px, calc(100vw - 40px));
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 20px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 16px 40px rgba(44, 33, 64, 0.22);
    border: 2px solid #fff;
    opacity: 0;
    transform: translateY(18px) scale(0.94);
    transition: opacity 0.3s var(--ease-out), transform 0.35s var(--ease-pop);
    max-width: 100%;
}

.toast.show { opacity: 1; transform: none; }

.toast-icon { font-size: 24px; flex: 0 0 auto; }

.toast-text {
    font-size: 14.5px;
    font-weight: 800;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.toast-text b {
    flex: 0 0 auto;
    font-size: 12.5px;
    color: #8A5B00;
    background: linear-gradient(160deg, #FFF0B8, #FFD54F);
    border-radius: 99px;
    padding: 3px 9px;
}

.star-fly-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 290;
}

.flying-star {
    position: absolute;
    font-size: 26px;
    transform: translate(0, 0) scale(1);
    transition: transform 0.9s cubic-bezier(0.4, 0, 0.6, 1), opacity 0.9s;
    filter: drop-shadow(0 4px 8px rgba(245, 158, 11, 0.5));
}

/* ------------------------------ 9. DUYARLILIK ------------------------------ */
@media (max-width: 860px) {
    .hero-content { max-width: 62%; }
    .hero-card { min-height: 190px; padding: 22px; }
    .hero-castle { right: 2%; font-size: 120px; }
    .hero-rainbow { right: 40%; }
    .hero-princess { right: 26%; }
    .game-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

@media (max-width: 620px) {
    .brand-text { display: none; }
    .hub-actions { gap: 7px; }
    .icon-btn { width: 46px; height: 46px; font-size: 20px; border-radius: 15px; }
    .chip { padding: 9px 14px; font-size: 16px; }
    .crest { width: 46px; height: 46px; font-size: 23px; border-radius: 16px; }
    .greeting { padding-bottom: 14px; }
    .hero-card { min-height: 176px; padding: 20px; }
    .hero-content { max-width: 70%; }
    .hero-desc { display: none; }
    .hero-cta { padding: 11px 20px; font-size: 14px; }
    .hero-castle { right: -2%; font-size: 104px; bottom: -14px; }
    .hero-princess { right: 24%; bottom: 12px; }
    .hero-rainbow { display: none; }
    .hero-unicorn { right: 36%; bottom: 10px; font-size: 26px; }
    .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .game-card { flex-direction: column; align-items: flex-start; gap: 9px; padding: 12px; border-radius: 22px; }
    .game-card-art { width: 50px; height: 50px; font-size: 25px; border-radius: 16px; }
    .game-card-title { font-size: 14px; white-space: normal; }
    .game-card-tagline { display: none; }
    .game-card-stars { top: 10px; right: 10px; }
    .game-viewport { padding: 8px; }
    .game-topbar { padding: max(10px, env(safe-area-inset-top)) 12px 10px; gap: 10px; }
    .game-topbar-emoji { display: none; }
    .game-topbar-title h3 { font-size: 16px; }
    .game-topbar-title p { font-size: 11px; }
    .back-btn { width: 44px; height: 44px; }
    .chip.small { padding: 7px 11px; font-size: 14px; }
    .game-surface { padding: 12px; }
    .modal { padding: 12px; }
    .modal-card { max-height: 90vh; }
    .modal-head { padding: 18px 18px 10px; }
    .modal-body { padding: 6px 18px 20px; }
    .badge-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-height: 560px) and (orientation: landscape) {
    .greeting { padding-top: 0; padding-bottom: 10px; }
    .greeting h2 { font-size: 25px; }
    .hero-card { min-height: 150px; }
    .hero-castle { font-size: 120px; }
    .section-head { padding-top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

body.no-effects .bg-sparkles,
body.no-effects .hero-castle,
body.no-effects .hero-princess,
body.no-effects .hero-unicorn,
body.no-effects .hero-cloud,
body.no-effects .splash-orbit {
    animation: none !important;
}

/* ------------------------------------------------------------------ Papağan Pıtır (js/ingilizce.js) */
.kelime-balon {
    position: fixed; right: 18px; bottom: 18px; z-index: 9000;
    display: flex; align-items: center; gap: 10px;
    padding: 10px 22px 10px 12px; border-radius: 999px;
    background: #fff; border: 4px solid #ff8cc6; box-shadow: 0 8px 24px rgba(120, 30, 90, .25);
    font: 800 34px/1.1 'Fredoka', 'Nunito', sans-serif; color: #8a2a6a;
    transform: translateY(140%) scale(.8); opacity: 0; pointer-events: none;
    transition: transform .35s cubic-bezier(.3, 1.6, .5, 1), opacity .25s;
}
.kelime-balon.gor { transform: none; opacity: 1; }
.kelime-papagan { font-size: 48px; display: inline-block; }
.kelime-papagan.konus { animation: papagan-konus .5s ease-in-out 2; }
@keyframes papagan-konus { 0%, 100% { transform: rotate(0) } 30% { transform: rotate(-14deg) scale(1.15) } 60% { transform: rotate(10deg) } }
.bm-hedef { display: inline-block; width: 34px; height: 42px; border-radius: 50% 50% 46% 46%; box-shadow: inset -4px -6px 0 rgba(0,0,0,.12); animation: papagan-konus 1s ease-in-out infinite; }
