/* ============================================================
   KARMA — общий стиль. Разделы рисуются через эти классы,
   поэтому изменения здесь применяются ко всей игре сразу.
   ============================================================ */

:root {
    --bg: #0B0B10;
    --surface: #1B1B26;
    --surface-2: #15151E;
    --line: rgba(255, 255, 255, 0.07);
    --text: #E6E6EE;
    --muted: #8A8A9B;
    --gold: #FFD700;
    --gold-2: #F59E0B;
    --radius: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { background: var(--bg); }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    min-height: 100vh;
    background:
        radial-gradient(900px 500px at 0% -10%, rgba(255, 215, 0, 0.09), transparent 60%),
        radial-gradient(800px 500px at 110% 15%, rgba(139, 92, 246, 0.10), transparent 60%),
        radial-gradient(700px 600px at 50% 110%, rgba(16, 185, 129, 0.06), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(255, 215, 0, 0.3); }

.app { max-width: 480px; margin: 0 auto; padding: 0 16px calc(24px + env(safe-area-inset-bottom)); }

/* ---------- шапка ---------- */
.header {
    position: sticky; top: 0; z-index: 50;
    display: flex; justify-content: space-between; align-items: center;
    margin: 0 -16px; padding: 12px 16px;
    background: rgba(11, 11, 16, 0.72);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.header h1 {
    font-size: 22px; font-weight: 900; letter-spacing: 1px;
    background: linear-gradient(135deg, #FFE46B, var(--gold) 40%, var(--gold-2));
    -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 0 10px rgba(255, 200, 0, 0.35));
}

/* ---------- вкладки ---------- */
.tabs {
    display: flex; gap: 4px; margin: 14px 0;
    padding: 4px; border-radius: 14px;
    background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line);
}
.tab-btn {
    flex: 1; padding: 10px; border: none; border-radius: 10px;
    background: transparent; color: var(--muted);
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    box-shadow: none !important;
}
.tab-btn:not(.active):active { background: rgba(255, 255, 255, 0.05); }
.tab-btn.active {
    background: linear-gradient(135deg, var(--gold), var(--gold-2));
    color: #1A1300;
    box-shadow: 0 4px 14px rgba(255, 191, 0, 0.35) !important;
}

.tab { display: none; }
.tab.active { display: block; }
.tab.tab-enter { animation: tab-in 0.25s ease-out; }
.tab h2 {
    font-size: 19px; font-weight: 800; margin-bottom: 12px;
    display: inline-block; padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, var(--gold), transparent) 1;
}

@keyframes tab-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes card-in { from { opacity: 0; transform: translateY(8px) scale(0.99); } to { opacity: 1; transform: none; } }

/* ---------- карточки ---------- */
.cards { display: grid; gap: 10px; }
.card {
    background: linear-gradient(180deg, var(--surface), var(--surface-2));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
/* Только в момент переключения вкладки (класс ставит main.js) — иначе карточки мигали бы при каждой перерисовке */
.tab.tab-enter .card { animation: card-in 0.3s ease-out both; }
.tab.tab-enter .card:nth-child(2) { animation-delay: 0.03s; }
.tab.tab-enter .card:nth-child(3) { animation-delay: 0.06s; }
.tab.tab-enter .card:nth-child(4) { animation-delay: 0.09s; }
.card h3 { font-size: 15px; font-weight: 700; margin-bottom: 8px; color: var(--gold); }

.info-block {
    background: linear-gradient(180deg, var(--surface), var(--surface-2));
    border: 1px solid var(--line); padding: 14px; border-radius: var(--radius); line-height: 1.6;
}

/* ---------- кнопки ---------- */
button {
    font-family: inherit;
    transition: transform 0.08s ease, filter 0.15s, opacity 0.15s, box-shadow 0.15s;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 2px 8px rgba(0, 0, 0, 0.25);
}
button:not(:disabled):active { transform: scale(0.97); filter: brightness(1.12); }
button:disabled { cursor: not-allowed; box-shadow: none; }
.card button { padding: 10px; background: var(--gold); color: #000; border: none; border-radius: 8px; font-weight: bold; cursor: pointer; }

/* ---------- поля ввода ---------- */
input, select, textarea { font-family: inherit; font-size: 14px; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.card input, .card select {
    width: 100%; padding: 10px; background: #111118; color: var(--text);
    border: 1px solid #34344A; border-radius: 8px;
}
input:focus, select:focus { border-color: var(--gold) !important; box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.15); }
input::placeholder { color: #6B7280; }

/* ---------- прокрутка ---------- */
* { scrollbar-width: thin; scrollbar-color: #34344A transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #34344A; border-radius: 3px; }

@media (prefers-reduced-motion: reduce) {
    .tab.tab-enter, .tab.tab-enter .card { animation: none; }
    button { transition: none; }
}
