/* ==========================================================================
   base.css — Sıfırlama, renkler, düğmeler, pencereler, bildirimler, reklam alanları
   ========================================================================== */

:root {
    --bg: #0b1030;
    --panel: #1a2250;
    --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(ellipse at 50% 0%, rgba(70, 90, 180, 0.35), transparent 65%);
}

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;
}

/* ---------- 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, #232d66, #141a45); 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; }

/* ---------- Ortak parçalar ---------- */
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 12px; }
.btn-equipped { background: rgba(47, 208, 106, 0.18); border: 1.5px solid var(--green); color: #7dffb0; }
.row { display: flex; gap: 8px; align-items: center; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.field > span, .slider > span { font-size: 12px; font-weight: 800; color: var(--dim); }
.field input[type="text"] { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: rgba(0, 0, 0, 0.3); color: #fff; font: inherit; font-weight: 700; }
.slider { display: flex; flex-direction: column; gap: 4px; margin: -2px 4px 10px; }
.slider input { width: 100%; accent-color: #ffb02e; }
.tabs { display: flex; gap: 6px; padding: 4px; border-radius: 14px; background: rgba(0, 0, 0, 0.3); }
.tabs.scroll { overflow-x: auto; scrollbar-width: none; }
.tab { flex: 1 0 auto; border: 0; border-radius: 11px; padding: 9px 12px; background: transparent; color: #aab3d8; font-weight: 800; font-size: 13px; cursor: pointer; white-space: nowrap; }
.tab.on { background: linear-gradient(180deg, #ffc23a, #f08a00); color: #3a2200; }
.round-btn {
    flex: none; width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.22);
    background: radial-gradient(circle at 35% 30%, #34408a, #141a45); color: #fff; font-size: 20px; font-weight: 900;
    display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4); padding: 0;
}
.round-btn svg { width: 20px; height: 20px; fill: #fff; }
.round-btn:active { transform: scale(0.92); }
.badge {
    position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px;
    background: #ff3b52; color: #fff; border: 2px solid #fff; font-style: normal; font-size: 11px; font-weight: 900;
    display: flex; align-items: center; justify-content: center; line-height: 1;
}
.xpbar { display: block; height: 7px; border-radius: 99px; background: rgba(255, 255, 255, 0.22); overflow: hidden; }
.xpbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffe45c, #ff9a1f); border-radius: 99px; transition: width 0.4s; }
.chip-gold {
    display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 10px; border-radius: 99px;
    background: rgba(0, 0, 0, 0.45); border: 1.5px solid rgba(255, 210, 60, 0.45); font-weight: 900; font-size: 15px;
}
.chip-gold .plus { width: 26px; height: 26px; border-radius: 50%; border: 0; background: linear-gradient(180deg, #43e07d, #17a84f); color: #fff; font-weight: 900; font-size: 18px; line-height: 1; cursor: pointer; padding: 0; }
.chip { display: inline-block; padding: 6px 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); border: 1.5px solid var(--line); font-weight: 800; font-size: 13px; }
