/* ==========================================================================
   Design-Tokens – abgeleitet vom Website-Design (Schwarz / Gold)
   ========================================================================== */
:root {
    color-scheme: dark;

    --bg: #000;
    --surface: rgba(17, 24, 39, 0.4);          /* gray-900/40 */
    --surface-strong: rgba(17, 24, 39, 0.6);   /* gray-900/60 */
    --surface-input: rgba(3, 7, 18, 0.85);     /* gray-950 */
    --surface-sheet: #07080c;

    --border: rgba(217, 119, 6, 0.2);           /* amber-600/20 */
    --border-soft: rgba(217, 119, 6, 0.1);
    --border-strong: rgba(217, 119, 6, 0.5);

    --gold: #d4af37;
    --gold-2: #e6c541;
    --gold-3: #f3d867;
    --amber-400: #fbbf24;
    --amber-300: #fcd34d;
    --gradient-gold: linear-gradient(135deg, #d4af37 0%, #e6c541 100%);

    --text: #f3f4f6;     /* gray-100 */
    --text-2: #9ca3af;   /* gray-400 */
    --text-3: #6b7280;   /* gray-500 */
    --text-4: #4b5563;   /* gray-600 */

    --pos: #34d399;      /* emerald-400 */
    --neg: #f87171;      /* red-400 */

    --radius-sm: 0.5rem;
    --radius: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;

    --font-sans: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;

    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --tabbar-h: 64px;
    --sidebar-w: 264px;
    --content-w: 920px;
}

/* ==========================================================================
   Basis
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100dvh;
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

html.has-modal body { overflow: hidden; }

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 700; line-height: 1.25; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
img, svg { display: block; }
[hidden] { display: none !important; }

::selection { background: rgba(212, 175, 55, 0.35); color: #fff; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; border-radius: var(--radius-sm); }

.icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }

.text-gradient {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount--pos { color: var(--pos); }
.amount--neg { color: var(--neg); }

/* Dezenter Hintergrund wie im Website-Hero: Goldschimmer + feines Raster */
.app-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(520px circle at 100% 0%, rgba(212, 175, 55, 0.09), transparent 65%),
        radial-gradient(460px circle at 0% 100%, rgba(212, 175, 55, 0.05), transparent 65%);
}
.app-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.035;
    background-image:
        linear-gradient(#d4af37 1px, transparent 1px),
        linear-gradient(90deg, #d4af37 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse at 70% 0%, #000 10%, transparent 60%);
    mask-image: radial-gradient(ellipse at 70% 0%, #000 10%, transparent 60%);
}

/* Startbildschirm, bis die App geladen ist */
.splash {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.splash img { width: 96px; height: 96px; animation: pulse 1.6s ease-in-out infinite; }
.splash__error { color: var(--text-2); text-align: center; }

/* ==========================================================================
   Animationen
   ========================================================================== */
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.6; transform: scale(0.96); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
