/* ==========================================================================
   base.css — Sıfırlama, renkler, düğmeler, pencereler, bildirimler, reklam alanları
   ========================================================================== */

:root {
    --bg: #1b1b1d;
    --panel: #2a2a2f;
    --panel-2: #36363d;
    --line: rgba(255, 255, 255, 0.12);
    --text: #ffffff;
    --dim: #9a9aa3;
    --green: #2fd06a;
    --green-2: #12a14b;
    --gold: #ffd21f;
    --gold-2: #f0a500;
    --blue: #2f7bff;
    --red: #ff5468;
    --font: "Trebuchet MS", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    --safe-t: env(safe-area-inset-top, 0px);
    --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }

html, body {
    margin: 0; width: 100%; height: 100%; overflow: hidden;
    background: var(--bg); color: var(--text); font-family: var(--font);
    user-select: none; -webkit-user-select: none; touch-action: manipulation;
    overscroll-behavior: none;
}

body {
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.045) 0 2px, transparent 3px),
        radial-gradient(circle at 62% 42%, rgba(255, 255, 255, 0.04) 0 3px, transparent 4px),
        radial-gradient(circle at 34% 78%, rgba(255, 255, 255, 0.04) 0 2px, transparent 3px),
        radial-gradient(circle at 86% 88%, rgba(255, 255, 255, 0.045) 0 3px, transparent 4px),
        radial-gradient(ellipse at 50% 0%, rgba(80, 90, 140, 0.18), transparent 60%);
    background-size: 90px 90px, 130px 130px, 110px 110px, 150px 150px, 100% 100%;
}

button { font-family: inherit; color: inherit; }
.hidden { display: none !important; }

#app { position: fixed; inset: 0; }

.screen {
    position: absolute; inset: 0; display: none; flex-direction: column;
    padding-top: var(--safe-t); padding-bottom: var(--safe-b);
}
.screen.is-active { display: flex; }

/* ---------- Düğmeler ---------- */
.btn {
    border: 0; border-radius: 16px; padding: 13px 20px; font-size: 16px; font-weight: 800;
    cursor: pointer; color: #fff; letter-spacing: 0.02em;
    transition: transform 0.1s, filter 0.15s;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.55; pointer-events: none; }

.btn-play {
    background: linear-gradient(180deg, #43e07d, #17a84f);
    box-shadow: 0 5px 0 #0d7a37, 0 10px 18px rgba(0, 0, 0, 0.35);
}
.btn-gold {
    background: linear-gradient(180deg, #ffe45c, #f0a500); color: #4a3200;
    box-shadow: 0 5px 0 #b57400, 0 10px 18px rgba(0, 0, 0, 0.35);
}
.btn-ghost {
    background: rgba(255, 255, 255, 0.1); border: 1.5px solid var(--line);
}
.btn-ghost.danger { color: var(--red); }
.btn-link { background: none; color: var(--dim); font-weight: 700; }

.pill {
    border: 0; border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 800;
    background: linear-gradient(180deg, #ffe45c, #f0a500); color: #4a3200; cursor: pointer;
}

/* ---------- Yıldız ---------- */
.star { width: 1em; height: 1em; display: inline-block; fill: #f4f4f6; transition: fill 0.25s; }
.star.on { fill: var(--gold); filter: drop-shadow(0 0 4px rgba(255, 210, 31, 0.55)); }
.star.pop { animation: starPop 0.45s ease-out; }
@keyframes starPop { 0% { transform: scale(0.2) rotate(-40deg); } 60% { transform: scale(1.4) rotate(8deg); } 100% { transform: scale(1) rotate(0); } }

/* ---------- Pencereler ---------- */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.62); opacity: 0; transition: opacity 0.2s; padding: 16px;
}
.modal-backdrop.is-open { opacity: 1; }
.modal-card {
    width: 100%; max-width: 340px; max-height: 88vh; overflow: auto;
    background: linear-gradient(180deg, #34343c, #26262b); border: 1.5px solid var(--line);
    border-radius: 24px; padding: 22px 20px 18px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
    transform: scale(0.92); transition: transform 0.22s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.modal-card.wide { max-width: 380px; display: flex; flex-direction: column; }
.modal-backdrop.is-open .modal-card { transform: scale(1); }
.modal-card h2 { margin: 0 0 12px; font-size: 22px; text-align: center; }
.modal-card .lead { margin: 0 0 16px; text-align: center; color: #d6d6dc; line-height: 1.45; }
.modal-card .fine { margin: 10px 0 0; text-align: center; color: var(--dim); font-size: 12px; }
.modal-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }

.toggle-row {
    width: 100%; display: flex; justify-content: space-between; align-items: center;
    background: rgba(255, 255, 255, 0.07); border: 1.5px solid var(--line); border-radius: 14px;
    padding: 12px 14px; margin-bottom: 8px; font-size: 16px; font-weight: 700; cursor: pointer;
}
.switch { width: 46px; height: 26px; border-radius: 999px; background: #55555e; position: relative; transition: background 0.2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.switch.on { background: var(--green-2); }
.switch.on::after { transform: translateX(20px); }

/* ---------- Bildirim ---------- */
#toast-root { position: fixed; left: 0; right: 0; bottom: calc(150px + var(--safe-b)); z-index: 150; display: flex; justify-content: center; pointer-events: none; }
.toast {
    max-width: 86%; padding: 11px 18px; border-radius: 14px; font-weight: 700; font-size: 14px; text-align: center;
    background: rgba(18, 18, 22, 0.94); border: 1.5px solid var(--line); opacity: 0; transform: translateY(10px);
    transition: opacity 0.2s, transform 0.2s;
}
.toast.is-on { opacity: 1; transform: none; }
.toast.warn { border-color: #ff9d2e; }
.toast.good { border-color: var(--green); }

/* ---------- Konfeti ---------- */
#fx-root { position: fixed; inset: 0; pointer-events: none; z-index: 180; overflow: hidden; }
.confetti { position: fixed; width: 8px; height: 12px; border-radius: 2px; animation: confetti 1.3s ease-out forwards; }
@keyframes confetti {
    0% { transform: translate(0, 0) rotate(0); opacity: 1; }
    100% { transform: translate(var(--dx), calc(var(--dy) + 240px)) rotate(var(--rot)); opacity: 0; }
}

/* ---------- Reklam alanları ---------- */
.ad-slot { display: none; flex: none; align-items: center; justify-content: center; width: 100%; }
.ad-slot.is-on { display: flex; height: var(--ad-h, 50px); }
.ad-mock {
    width: calc(100% - 16px); height: calc(100% - 6px); border: 1.5px dashed rgba(255, 255, 255, 0.25); border-radius: 8px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: rgba(255, 255, 255, 0.5); font-size: 12px; font-weight: 800; letter-spacing: 0.1em;
}
.ad-mock small { font-weight: 600; letter-spacing: 0; opacity: 0.7; }

.ad-overlay { position: fixed; inset: 0; z-index: 300; display: none; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.88); padding: 20px; }
.ad-overlay.is-open { display: flex; }
.ad-mock-card { width: 100%; max-width: 320px; text-align: center; background: #fff; color: #111; border-radius: 22px; padding: 22px 18px; display: flex; flex-direction: column; gap: 10px; }
.ad-mock-card h3 { margin: 0; font-size: 20px; }
.ad-mock-card p { margin: 0; color: #555; font-size: 13px; }
.ad-mock-tag { font-size: 11px; font-weight: 800; color: #888; letter-spacing: 0.1em; }
.ad-mock-bar { height: 8px; border-radius: 99px; background: #e3e3e8; overflow: hidden; }
.ad-mock-bar i { display: block; height: 100%; width: 0; background: var(--green-2); }
.ad-mock-card .btn-ghost { color: #333; background: #eee; border-color: #ddd; }
