/* ═══════════════════════════════════════════════════════════
   Mini Master — Base Styles
   ═══════════════════════════════════════════════════════════ */

/* ─── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--ink);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Uppercase für bestimmte Elemente */
.uppercase,
.page-eyebrow, .nav-section-label, .stat-card-label,
.card-stat-lbl, .unit-meta, .activity-meta,
.rank-sub, .level-xp-text, .xp-label,
.btn, .tab-btn, .flabel { text-transform: uppercase; }

/* ─── Noise Overlay ──────────────────────────────────────────── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
    opacity: 0.6;
}

/* ─── Scanlines ──────────────────────────────────────────────── */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.08) 2px,
        rgba(0,0,0,0.08) 4px
    );
    pointer-events: none;
    z-index: 9998;
}

/* ─── Typography ─────────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--font-display); letter-spacing: 2px; }

a { color: var(--red); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--red-glow); }

/* ─── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ─── Selection ──────────────────────────────────────────────── */
::selection { background: rgba(192,57,43,0.3); color: var(--text-bright); }

/* ─── Focus Ring ─────────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* ─── Status Pulse ───────────────────────────────────────────── */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes hex-pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(192,57,43,.5), 0 0 60px rgba(192,57,43,.1); }
    50%       { box-shadow: 0 0 32px rgba(192,57,43,.8), 0 0 80px rgba(192,57,43,.2); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─── View Transitions ───────────────────────────────────────── */
.view { display: none; }
.view.active { display: block; }

.view.active > * {
    animation: fadeUp 0.3s ease both;
}
.view.active > *:nth-child(2) { animation-delay: 0.05s; }
.view.active > *:nth-child(3) { animation-delay: 0.1s; }
.view.active > *:nth-child(4) { animation-delay: 0.15s; }

/* ─── Tab Content ────────────────────────────────────────────── */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ─── Empty State ────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 52px;
    color: var(--text-dim);
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-title {
    font-family: var(--font-display);
    font-size: 24px;
    letter-spacing: 2px;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.empty-sub { font-size: 13px; color: var(--muted); }

/* ─── Toast Notification ─────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--panel);
    border: 1px solid var(--border-bright);
    border-left: 3px solid var(--teal);
    padding: 12px 18px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text);
    animation: slideInRight 0.3s ease;
    max-width: 320px;
    pointer-events: auto;
}

.toast.toast-err  { border-left-color: var(--red); }
.toast.toast-ok   { border-left-color: var(--teal); }
.toast.toast-gold { border-left-color: var(--gold); }

/* ─── Loading Spinner ────────────────────────────────────────── */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

/* ─── Level-Up Overlay ───────────────────────────────────────── */
.levelup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 9500;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
}

.levelup-overlay.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.levelup-hex {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 60px rgba(201,168,76,0.6);
    animation: hex-pulse 1.5s infinite;
}

.levelup-num {
    font-family: var(--font-display);
    font-size: 64px;
    color: var(--ink);
    line-height: 1;
}

.levelup-title {
    font-family: var(--font-display);
    font-size: 32px;
    color: var(--gold-light);
    letter-spacing: 4px;
}

.levelup-sub {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-dim);
    letter-spacing: 3px;
}
