/* ========== DARK MODE CSS VARIABLES ========== */
:root {
    /* Dark Mode Colors */
    --bg-primary: #0a0a0a;
    --bg-secondary: #121212;
    --bg-tertiary: #1a1a1a;
    --bg-card: #1e1e1e;
    --bg-elevated: #252525;

    /* Accent Colors - Terracotta/Burnt Orange + Taupe */
    --accent-primary: #d97706;
    --accent-secondary: #92400e;
    --accent-gradient: linear-gradient(135deg, #d97706 0%, #92400e 100%);

    /* Status Colors */
    --success: #00e676;
    --warning: #ffc107;
    --danger: #ff5252;
    --info: #00bcd4;

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-tertiary: #707070;
    --text-disabled: #505050;

    /* Border & Dividers */
    --border-color: #2a2a2a;
    --divider-color: #333333;

    /* Glassmorphism */
    --glass-bg: rgba(30, 30, 30, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;

    /* Layout */
    --header-height: 60px;
    --bottom-nav-height: 80px;
    --fab-size: 64px;
    --sidebar-width: 300px;

    /* iOS Safe Area */
    --safe-area-inset-top: env(safe-area-inset-top);
    --safe-area-inset-bottom: env(safe-area-inset-bottom);
    --safe-area-inset-left: env(safe-area-inset-left);
    --safe-area-inset-right: env(safe-area-inset-right);

    /* Shadows - Dark Mode optimiert */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.7);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-Index */
    --z-header: 100;
    --z-fab: 90;
    --z-bottom-nav: 200;
    --z-sidebar: 300;
    --z-overlay: 250;
    --z-modal: 400;
}

/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: 0; /* Kein Header mehr */
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-inset-bottom));
    position: relative;
}

body.sidebar-open {
    overflow: hidden;
}

/* Animated Background Gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(217, 119, 6, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: float 20s ease-in-out infinite;
}

body::after {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(217, 119, 6, 0.03) 2px,
        rgba(217, 119, 6, 0.03) 4px
    );
    pointer-events: none;
    z-index: 0;
    animation: rotate3D 60s linear infinite;
    opacity: 0.3;
}

.app-content {
    position: relative;
    z-index: 1;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    background: none;
    font-family: inherit;
    cursor: pointer;
    outline: none;
}

/* ========== ULTRA-FLASHY FLOATING AVATAR (TOP RIGHT) ========== */
.app-header {
    display: none; /* Komplett weg */
}

.menu-btn {
    display: none;
}

.header-title {
    display: none;
}

.header-avatar {
    position: fixed;
    top: calc(var(--spacing-lg) + var(--safe-area-inset-top));
    right: var(--spacing-lg);
    cursor: pointer;
    z-index: var(--z-header);
    transition: all 0.3s ease;
    animation: float 4s ease-in-out infinite;
}

.header-avatar:hover {
    transform: scale(1.15) rotate(5deg);
    filter: drop-shadow(0 0 20px rgba(217, 119, 6, 0.8));
}

.header-avatar:active {
    transform: scale(1.05);
}

.header-avatar img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    border: 3px solid rgba(217, 119, 6, 0.5);
    box-shadow:
        0 0 20px rgba(217, 119, 6, 0.4),
        0 8px 16px rgba(0, 0, 0, 0.3);
    background: var(--bg-card);
    animation: neonGlow 2s ease-in-out infinite;
}

/* ========== ULTRA-MODERN SIDE MENU (VON RECHTS) - ROUNDED ========== */
.side-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--sidebar-width);
    overflow-x: hidden;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.95) 0%, rgba(15, 15, 15, 0.98) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.5s cubic-bezier(0.34, 0.36, 0.13, 1),
                opacity 0.5s cubic-bezier(0.34, 0.36, 0.13, 1),
                visibility 0.5s cubic-bezier(0.34, 0.36, 0.13, 1);
    z-index: var(--z-sidebar);
    box-shadow:
        -10px 0 50px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(217, 119, 6, 0.2) inset;
    display: flex;
    flex-direction: column;
    padding-top: var(--safe-area-inset-top);
    border-left: 2px solid transparent;
    background-clip: padding-box;
    border-radius: var(--radius-xl) 0 0 var(--radius-xl);
}

.side-menu.open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    border-left-color: rgba(217, 119, 6, 0.5);
}

.side-menu-header {
    padding: var(--spacing-md) var(--spacing-lg);
    background: linear-gradient(-45deg, #d97706, #ea580c, #92400e, #78350f);
    background-size: 400% 400%;
    animation: gradientShift 10s ease infinite;
    color: white;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(217, 119, 6, 0.4);
    border-radius: var(--radius-xl) 0 0 0;
}

.side-menu-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate3D 15s linear infinite;
}

.side-menu-avatar img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    border: 2px solid rgba(255,255,255,0.5);
    box-shadow:
        0 0 15px rgba(255, 255, 255, 0.3),
        0 6px 12px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    animation: float 3s ease-in-out infinite;
}

.side-menu-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.side-menu-info p {
    font-size: 12px;
    opacity: 0.9;
}

.side-menu-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md) 0;
}

.side-menu-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 15px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    margin: 2px var(--spacing-xs);
    border-radius: var(--radius-xl);
}

.side-menu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--accent-gradient);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.side-menu-item::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, rgba(217, 119, 6, 0.15), transparent);
    transition: width 0.4s ease;
}

.side-menu-item:hover {
    background: rgba(217, 119, 6, 0.1);
    transform: translateX(8px);
    color: var(--accent-primary);
}

.side-menu-item:hover::before {
    transform: scaleY(0);
}

.side-menu-item:hover::after {
    width: 100%;
}

.side-menu-item:hover .icon {
    transform: scale(1.2) rotate(5deg);
    filter: drop-shadow(0 0 8px rgba(217, 119, 6, 0.8));
}

.side-menu-item:active {
    transform: translateX(5px) scale(0.98);
    background: rgba(217, 119, 6, 0.2);
}

.side-menu-item.active {
    color: var(--accent-primary);
    background: transparent;
}

.side-menu-item.active::before {
    transform: scaleY(0);
}

.side-menu-item.active::after {
    width: 0%;
}

.side-menu-item.active .icon {
    transform: scale(1.15);
    filter: drop-shadow(0 0 8px rgba(217, 119, 6, 0.8));
}

.side-menu-item.active:hover {
    background: rgba(217, 119, 6, 0.1);
    transform: translateX(8px);
}

.side-menu-item.active:hover .icon {
    transform: scale(1.25) rotate(5deg);
}

.side-menu-item .icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.side-menu-item .icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn-logout .icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-logout .icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.side-menu-footer {
    padding: var(--spacing-md) var(--spacing-lg);
    padding-bottom: calc(var(--spacing-md) + var(--safe-area-inset-bottom));
    border-top: 1px solid var(--border-color);
}

.btn-logout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    color: var(--danger);
    font-weight: 600;
    transition: background var(--transition-fast);
}

.btn-logout:active {
    background: var(--bg-elevated);
}

/* ========== OVERLAY ========== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
    z-index: var(--z-overlay);
    backdrop-filter: blur(4px);
}

.overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ========== MAIN CONTENT ========== */
.app-content {
    min-height: calc(100vh - var(--bottom-nav-height));
    padding: var(--spacing-lg);
    padding-top: calc(var(--spacing-lg) + var(--safe-area-inset-top));
    padding-bottom: calc(var(--spacing-xl) + var(--bottom-nav-height));
}

/* ========== FAB ENTFERNT ========== */
.fab {
    display: none; /* Komplett weg */
}

/* ========== ULTRA-MODERN BOTTOM NAVIGATION (GLASSMORPHISM) ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-nav-height) + var(--safe-area-inset-bottom));
    background: var(--glass-bg);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border-top: 1px solid rgba(217, 119, 6, 0.3);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding-bottom: var(--safe-area-inset-bottom);
    box-shadow:
        0 -2px 10px rgba(0, 0, 0, 0.3),
        0 -1px 0 rgba(217, 119, 6, 0.2) inset;
    z-index: var(--z-bottom-nav);
    animation: slideInUp 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-tertiary);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    padding: var(--spacing-sm) 0;
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: var(--accent-gradient);
    border-radius: 0 0 3px 3px;
    opacity: 0;
    transition: all 0.3s ease;
}

.nav-item.active {
    color: var(--accent-primary);
    transform: translateY(-5px);
}

.nav-item.active::before {
    opacity: 1;
}

.nav-item.active .nav-icon {
    transform: scale(1.2);
    filter: drop-shadow(0 0 8px rgba(217, 119, 6, 0.8));
}

.nav-item:hover {
    color: var(--accent-primary);
    transform: translateY(-3px);
}

.nav-item:active {
    transform: translateY(-2px) scale(0.95);
}

.nav-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.nav-icon svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ========== VIEW COMPONENTS (DARK MODE) ========== */
.view-container {
    max-width: 600px;
    margin: 0 auto;
}

.view-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: var(--spacing-xl);
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

/* Stats Cards (Modern Dark) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
    border: 1px solid var(--border-color);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.stat-card:active {
    transform: scale(0.98);
}

.stat-card.full-width {
    grid-column: 1 / -1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.stat-value {
    font-size: 36px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: var(--spacing-xs);
}

.stat-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Area Cards */
.area-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.area-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.area-card:active {
    transform: scale(0.98);
    border-color: var(--accent-primary);
}

.area-card h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.area-card p {
    font-size: 14px;
    color: var(--text-secondary);
}

.area-badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    margin-top: var(--spacing-sm);
    border: 1px solid var(--border-color);
}

/* Ranking List */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.ranking-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.ranking-item.highlight {
    border: 2px solid var(--accent-primary);
    background: var(--bg-elevated);
}

.ranking-position {
    width: 44px;
    height: 44px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.ranking-position.gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #000;
    border: none;
}

.ranking-position.silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    color: #000;
    border: none;
}

.ranking-position.bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #e8a870 100%);
    color: #000;
    border: none;
}

.ranking-info {
    flex: 1;
}

.ranking-name {
    font-weight: 600;
    margin-bottom: 2px;
    font-size: 15px;
    color: var(--text-primary);
}

.ranking-team {
    font-size: 13px;
    color: var(--text-secondary);
}

.ranking-score {
    font-weight: 800;
    font-size: 20px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Buttons (Modern Dark) */
.btn-primary {
    display: block;
    width: 100%;
    padding: var(--spacing-md);
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 16px;
    text-align: center;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    box-shadow: 0 4px 16px rgba(217, 119, 6, 0.3);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    display: block;
    width: 100%;
    padding: var(--spacing-md);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 16px;
    text-align: center;
    transition: background var(--transition-fast);
    border: 1px solid var(--border-color);
}

.btn-secondary:active {
    background: var(--bg-elevated);
}

/* Profile Section */
.profile-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.profile-section h3 {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-tertiary);
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.profile-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border-color);
}

.profile-item:last-child {
    border-bottom: none;
}

.profile-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.profile-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Photo Upload */
.photo-upload-row {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.photo-upload-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.photo-upload-area {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s ease;
    background: var(--bg-elevated);
}

.photo-upload-area:hover {
    border-color: var(--accent-primary);
    background: rgba(217, 119, 6, 0.1);
}

.photo-upload-area:active {
    transform: scale(0.95);
}

.photo-placeholder {
    width: 40px;
    height: 40px;
    color: var(--text-tertiary);
}

.photo-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-xxl) var(--spacing-lg);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--spacing-md);
    opacity: 0.3;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.empty-state-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ========== ULTRA-FLASHY ANIMATIONS ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes drawLine {
    from {
        stroke-dashoffset: 1000;
    }
    to {
        stroke-dashoffset: 0;
    }
}

/* ========== NEUE FLASHY ANIMATIONEN ========== */
@keyframes neonGlow {
    0%, 100% {
        box-shadow:
            0 0 10px rgba(217, 119, 6, 0.5),
            0 0 20px rgba(217, 119, 6, 0.3),
            0 0 30px rgba(217, 119, 6, 0.2);
    }
    50% {
        box-shadow:
            0 0 20px rgba(217, 119, 6, 0.8),
            0 0 40px rgba(217, 119, 6, 0.5),
            0 0 60px rgba(217, 119, 6, 0.3);
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes rotate3D {
    from {
        transform: perspective(1000px) rotateY(0deg);
    }
    to {
        transform: perspective(1000px) rotateY(360deg);
    }
}

@keyframes liquidMorph {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

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

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(-50px);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes glowPulse {
    0%, 100% {
        filter: drop-shadow(0 0 5px rgba(217, 119, 6, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(217, 119, 6, 1));
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

@keyframes particleFloat {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-40px) translateX(10px);
        opacity: 0;
    }
}

.view-container {
    animation: slideInFromRight 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ========== FLASHY DASHBOARD STYLES ========== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

/* Live Chart Card - ULTRA MODERN */
.chart-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    animation: slideUp 0.6s ease-out;
    height: auto;
}

.chart-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(217, 119, 6, 0.15), transparent);
    animation: shimmer 3s infinite;
}

.chart-card:hover {
    border-color: rgba(217, 119, 6, 0.5);
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(217, 119, 6, 0.15);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xs);
}

.chart-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-value {
    font-size: 24px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chart-change {
    font-size: 12px;
    font-weight: 600;
    margin-top: 2px;
}

.chart-change.positive {
    color: var(--success);
}

.chart-canvas {
    height: 140px;
    position: relative;
}

.chart-canvas canvas {
    display: block;
    width: 100%;
}

/* Animated Stats */
.animated-stat {
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.animated-stat:nth-child(1) { animation-delay: 0.1s; opacity: 0; animation-fill-mode: forwards; }
.animated-stat:nth-child(2) { animation-delay: 0.2s; opacity: 0; animation-fill-mode: forwards; }
.animated-stat:nth-child(3) { animation-delay: 0.3s; opacity: 0; animation-fill-mode: forwards; }
.animated-stat:nth-child(4) { animation-delay: 0.4s; opacity: 0; animation-fill-mode: forwards; }

/* Ranking Animation */
.ranking-item {
    animation: slideInFromLeft 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
    animation-fill-mode: forwards;
}

.ranking-item:nth-child(1) { animation-delay: 0.1s; }
.ranking-item:nth-child(2) { animation-delay: 0.2s; }
.ranking-item:nth-child(3) { animation-delay: 0.3s; }
.ranking-item:nth-child(4) { animation-delay: 0.4s; }
.ranking-item:nth-child(5) { animation-delay: 0.5s; }

.ranking-position {
    animation: pulse 2s infinite;
}

/* Hero Stat (Big Card) - ULTRA FLASHY */
.hero-stat {
    background: linear-gradient(-45deg, #d97706, #ea580c, #92400e, #78350f);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite, bounceIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    text-align: center;
    margin-bottom: var(--spacing-lg);
    position: relative;
    overflow: hidden;
    box-shadow:
        0 10px 40px rgba(217, 119, 6, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.hero-stat::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate3D 20s linear infinite;
}

.hero-stat:hover {
    transform: translateY(-5px) scale(1.02);
    transition: all 0.3s ease;
}

.hero-stat-label {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.hero-stat-value {
    font-size: 72px;
    font-weight: 900;
    color: white;
    line-height: 1;
    margin-bottom: var(--spacing-xs);
    position: relative;
    z-index: 1;
    text-shadow:
        0 0 10px rgba(255, 255, 255, 0.5),
        0 0 20px rgba(255, 255, 255, 0.3),
        0 5px 15px rgba(0, 0, 0, 0.3);
    animation: glowPulse 3s ease-in-out infinite;
}

.hero-stat-subtitle {
    font-size: 16px;
    color: rgba(255,255,255,0.9);
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
}

.hero-stat-trend {
    font-size: 14px;
    color: var(--success);
    font-weight: 600;
}

/* Mini Stats Grid - ULTRA MODERN */
.mini-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.mini-stat {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    text-align: center;
    animation: slideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation-delay: var(--delay);
    opacity: 0;
    animation-fill-mode: forwards;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.mini-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(217, 119, 6, 0.2), transparent);
    transition: left 0.5s ease;
}

.mini-stat:hover {
    transform: translateY(-8px) scale(1.05);
    border-color: var(--accent-primary);
    box-shadow:
        0 10px 30px rgba(217, 119, 6, 0.3),
        0 0 20px rgba(217, 119, 6, 0.2);
}

.mini-stat:hover::before {
    left: 100%;
}

.mini-stat:active {
    transform: translateY(-5px) scale(1.02);
}

.mini-stat-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto var(--spacing-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
}

.mini-stat-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mini-stat-value {
    font-size: 24px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.mini-stat-label {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
    font-weight: 600;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.section-header h3 {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.section-link {
    font-size: 13px;
    color: var(--accent-primary);
    font-weight: 600;
}

/* Quick Actions Horizontal Scroll - ULTRA FLASHY */
.quick-actions-scroll {
    display: flex;
    gap: var(--spacing-md);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: var(--spacing-xl);
    padding: 8px var(--spacing-xs) 12px;
}

.quick-actions-scroll::-webkit-scrollbar {
    display: none;
}

.action-card {
    min-width: 100px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg) var(--spacing-md);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

.action-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(217, 119, 6, 0.3), transparent);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    pointer-events: none;
}

.action-card:hover {
    transform: translateY(-4px) scale(1.03);
    border-color: var(--accent-primary);
    box-shadow:
        0 10px 25px rgba(217, 119, 6, 0.4),
        0 0 20px rgba(217, 119, 6, 0.2);
}

.action-card:hover::before {
    width: 300px;
    height: 300px;
}

.action-card:hover .action-icon {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 0 8px rgba(217, 119, 6, 0.8));
}

.action-card:active {
    transform: translateY(-2px) scale(1.01);
}

.action-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
    position: relative;
    z-index: 1;
    color: var(--accent-primary);
}

.action-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.action-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* Leaderboard */
.leaderboard {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
}

.leaderboard-item {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    animation: slideInFromLeft 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
    animation-fill-mode: forwards;
}

.leaderboard-item.is-you {
    border: 2px solid var(--accent-primary);
    background: var(--bg-elevated);
}

/* Leaderboard Avatar */
.leaderboard-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
    flex-shrink: 0;
}
.leaderboard-item.rank-1 .leaderboard-avatar { border-color: #ffd700; box-shadow: 0 0 10px rgba(255, 215, 0, 0.4); }
.leaderboard-item.rank-2 .leaderboard-avatar { border-color: #c0c0c0; box-shadow: 0 0 8px rgba(192, 192, 192, 0.3); }
.leaderboard-item.rank-3 .leaderboard-avatar { border-color: #cd7f32; box-shadow: 0 0 6px rgba(205, 127, 50, 0.3); }

.leaderboard-item:nth-child(1) { animation-delay: 0.1s; }
.leaderboard-item:nth-child(2) { animation-delay: 0.2s; }
.leaderboard-item:nth-child(3) { animation-delay: 0.3s; }

.leaderboard-position {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 20px;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
    background: var(--bg-elevated);
}

.leaderboard-position.gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #000;
    border: none;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.leaderboard-position.silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    color: #000;
    border: none;
    box-shadow: 0 4px 12px rgba(192, 192, 192, 0.3);
}

.leaderboard-position.bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #e8a870 100%);
    color: #000;
    border: none;
    box-shadow: 0 4px 12px rgba(205, 127, 50, 0.3);
}

.leaderboard-info {
    flex: 1;
}

.leaderboard-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.leaderboard-team {
    font-size: 12px;
    color: var(--text-secondary);
}

.leaderboard-score {
    text-align: right;
}

.score-value {
    font-size: 24px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.score-label {
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 2px;
    font-weight: 600;
}

/* Campaign Banner */
.campaign-banner {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.campaign-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
}

.campaign-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.campaign-info {
    flex: 1;
}

.campaign-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.campaign-team {
    font-size: 13px;
    color: var(--text-secondary);
}

.campaign-status {
    padding: var(--spacing-xs) var(--spacing-md);
    background: linear-gradient(135deg, #00e676 0%, #00c853 100%);
    color: white;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

/* ========== RESPONSIVE ========== */
@media (min-width: 768px) {
    .app-content {
        padding: var(--spacing-xl);
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========== SCROLLBAR (DARK) ========== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-disabled);
}

/* ========== ULTRA-FLASHY RANKING STYLES ========== */

/* Champion Banner - Normal Layout Flow */
.champion-banner-fixed {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    background: linear-gradient(-45deg, #ffd700, #ffed4e, #ffa500, #ff8c00);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    border-radius: var(--radius-lg);
    padding: var(--spacing-md) var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow:
        0 4px 20px rgba(255, 215, 0, 0.4),
        0 0 30px rgba(255, 215, 0, 0.2) inset;
}

.champion-banner-fixed .winner-crown {
    width: 48px;
    height: 48px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
    flex-shrink: 0;
}

.champion-banner-fixed .winner-crown svg {
    width: 100%;
    height: 100%;
    color: #fff;
}

.champion-banner-fixed .winner-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.champion-banner-fixed .winner-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(0, 0, 0, 0.7);
}

.champion-banner-fixed .winner-name {
    font-size: 16px;
    font-weight: 900;
    color: #000;
    text-shadow: 0 1px 5px rgba(255, 255, 255, 0.5);
    flex: 1;
}

.champion-banner-fixed .winner-score {
    font-size: 16px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.8);
}

/* Winner Banner - Champion Spotlight */
.winner-banner {
    position: relative;
    background: linear-gradient(-45deg, #ffd700, #ffed4e, #ffa500, #ff8c00);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    text-align: center;
    overflow: hidden;
    box-shadow:
        0 10px 40px rgba(255, 215, 0, 0.4),
        0 0 60px rgba(255, 215, 0, 0.2) inset;
}

.winner-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.1) 10px,
        rgba(255, 255, 255, 0.1) 20px
    );
    animation: rotate3D 30s linear infinite;
}

.winner-crown {
    width: 60px;
    height: 60px;
    margin: 0 auto var(--spacing-md);
    animation: float 3s ease-in-out infinite, rotate360 10s linear infinite;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
}

.winner-crown svg {
    width: 100%;
    height: 100%;
    color: #fff;
}

.winner-content {
    position: relative;
    z-index: 1;
}

.winner-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(0, 0, 0, 0.7);
    margin-bottom: var(--spacing-xs);
}

.winner-name {
    font-size: 28px;
    font-weight: 900;
    color: #000;
    margin-bottom: var(--spacing-xs);
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.5);
}

.winner-score {
    font-size: 16px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.8);
}

/* Ranking Tabs - Ultra Flashy */
.ranking-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-lg);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xs);
}

.ranking-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--spacing-sm) var(--spacing-xs);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.ranking-tab svg {
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
}

.ranking-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ranking-tab.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
    box-shadow:
        0 10px 30px rgba(217, 119, 6, 0.4),
        0 0 20px rgba(217, 119, 6, 0.3);
}

.ranking-tab.active svg {
    transform: scale(1.2);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
}

.ranking-tab:hover:not(.active) {
    background: rgba(217, 119, 6, 0.1);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.ranking-tab:active {
    transform: translateY(0) scale(0.95);
}

/* Your Position Card */
.your-position-card {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
    margin-bottom: var(--spacing-lg);
    position: relative;
    overflow: hidden;
    animation: pulse 3s ease-in-out infinite;
}

.your-position-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    animation: rotate3D 15s linear infinite;
}

.position-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.8);
    margin-bottom: var(--spacing-xs);
}

.position-rank {
    font-size: 56px;
    font-weight: 900;
    color: white;
    line-height: 1;
    margin-bottom: var(--spacing-xs);
    position: relative;
    z-index: 1;
    text-shadow:
        0 0 20px rgba(255, 255, 255, 0.5),
        0 5px 15px rgba(0, 0, 0, 0.3);
}

.position-total {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.9);
}

/* Ranking Section Header */
.ranking-section {
    margin-bottom: var(--spacing-xl);
}

.ranking-section .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.trophy-icon {
    width: 24px;
    height: 24px;
    color: var(--accent-primary);
    animation: float 3s ease-in-out infinite;
}

/* Flashy Ranking List */
.flashy-ranking-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.flashy-ranking-item {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-sm);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

.flashy-ranking-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(217, 119, 6, 0.1), transparent);
    transition: left 0.5s ease;
}

.flashy-ranking-item:hover::before {
    left: 100%;
}

.flashy-ranking-item.is-you {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.1), rgba(118, 75, 162, 0.1));
}

/* Rank Avatar */
.rank-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
    flex-shrink: 0;
}
.rank-1 .rank-avatar { border-color: #ffd700; box-shadow: 0 0 10px rgba(255, 215, 0, 0.4); }
.rank-2 .rank-avatar { border-color: #c0c0c0; box-shadow: 0 0 8px rgba(192, 192, 192, 0.3); }
.rank-3 .rank-avatar { border-color: #cd7f32; box-shadow: 0 0 6px rgba(205, 127, 50, 0.3); }

/* Rank Badge - Base Styles */
.rank-badge {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 18px;
    flex-shrink: 0;
    border: 3px solid var(--border-color);
    background: var(--bg-elevated);
    position: relative;
    overflow: hidden;
}

/* Medal Icon */
.medal-icon {
    width: 28px;
    height: 28px;
    position: relative;
    z-index: 2;
}

/* Medal Shine Effect */
.medal-shine {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: medalShine 3s linear infinite;
}

@keyframes medalShine {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

/* Gold Medal - ULTRA FLASHY */
.rank-badge.gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ffa500 100%);
    border: none;
    box-shadow:
        0 0 30px rgba(255, 215, 0, 0.8),
        0 0 60px rgba(255, 215, 0, 0.4),
        0 10px 40px rgba(255, 215, 0, 0.3);
    animation: goldPulse 2s ease-in-out infinite, float 3s ease-in-out infinite;
}

.rank-badge.gold .medal-icon {
    color: #000;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
    animation: rotate360 10s linear infinite;
}

@keyframes goldPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow:
            0 0 30px rgba(255, 215, 0, 0.8),
            0 0 60px rgba(255, 215, 0, 0.4),
            0 10px 40px rgba(255, 215, 0, 0.3);
    }
    50% {
        transform: scale(1.1);
        box-shadow:
            0 0 50px rgba(255, 215, 0, 1),
            0 0 80px rgba(255, 215, 0, 0.6),
            0 15px 50px rgba(255, 215, 0, 0.5);
    }
}

/* Silver Medal - FLASHY */
.rank-badge.silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 50%, #a8a8a8 100%);
    border: none;
    box-shadow:
        0 0 20px rgba(192, 192, 192, 0.6),
        0 0 40px rgba(192, 192, 192, 0.3),
        0 8px 30px rgba(192, 192, 192, 0.25);
    animation: silverPulse 2.5s ease-in-out infinite, float 3.5s ease-in-out infinite;
}

.rank-badge.silver .medal-icon {
    color: #000;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
    animation: rotate360 12s linear infinite;
}

@keyframes silverPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow:
            0 0 20px rgba(192, 192, 192, 0.6),
            0 0 40px rgba(192, 192, 192, 0.3),
            0 8px 30px rgba(192, 192, 192, 0.25);
    }
    50% {
        transform: scale(1.08);
        box-shadow:
            0 0 35px rgba(192, 192, 192, 0.8),
            0 0 60px rgba(192, 192, 192, 0.5),
            0 12px 40px rgba(192, 192, 192, 0.4);
    }
}

/* Bronze Medal - SUBTLE FLASH */
.rank-badge.bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #e8a870 50%, #b5651d 100%);
    border: none;
    box-shadow:
        0 0 15px rgba(205, 127, 50, 0.5),
        0 0 30px rgba(205, 127, 50, 0.25),
        0 6px 20px rgba(205, 127, 50, 0.2);
    animation: bronzePulse 3s ease-in-out infinite, float 4s ease-in-out infinite;
}

.rank-badge.bronze .medal-icon {
    color: #000;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.4));
    animation: rotate360 15s linear infinite;
}

@keyframes bronzePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow:
            0 0 15px rgba(205, 127, 50, 0.5),
            0 0 30px rgba(205, 127, 50, 0.25),
            0 6px 20px rgba(205, 127, 50, 0.2);
    }
    50% {
        transform: scale(1.05);
        box-shadow:
            0 0 25px rgba(205, 127, 50, 0.7),
            0 0 45px rgba(205, 127, 50, 0.4),
            0 10px 30px rgba(205, 127, 50, 0.3);
    }
}

@keyframes rotate360 {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Rank Particles - For Top 3 */
.rank-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.rank-particles::before,
.rank-particles::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-primary);
    opacity: 0;
    animation: particleFloat 3s infinite;
}

.rank-particles::before {
    left: 20%;
    animation-delay: 0s;
}

.rank-particles::after {
    left: 80%;
    animation-delay: 1.5s;
}

.rank-1 .rank-particles::before,
.rank-1 .rank-particles::after {
    background: #ffd700;
}

.rank-2 .rank-particles::before,
.rank-2 .rank-particles::after {
    background: #c0c0c0;
}

.rank-3 .rank-particles::before,
.rank-3 .rank-particles::after {
    background: #cd7f32;
}

/* Rank Info */
.rank-info {
    flex: 1;
}

.rank-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.you-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rank-team {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Rank Score */
.rank-score {
    text-align: right;
}

.rank-score .score-value {
    font-size: 24px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.rank-score .score-label {
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 2px;
    font-weight: 600;
}

/* Special Effects for Top 3 Items */
.rank-1 {
    border-color: #ffd700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 237, 78, 0.05));
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
}

.rank-2 {
    border-color: #c0c0c0;
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.1), rgba(232, 232, 232, 0.05));
    box-shadow: 0 0 20px rgba(192, 192, 192, 0.15);
}

.rank-3 {
    border-color: #cd7f32;
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.1), rgba(232, 168, 112, 0.05));
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.1);
}

/* ========== PROFILE FORM STYLES ========== */

/* Profile Header */
.profile-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    border: 2px solid var(--border-color);
}

.profile-avatar-section {
    flex-shrink: 0;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    border: 3px solid var(--accent-primary);
    box-shadow: 0 4px 20px rgba(217, 119, 6, 0.3);
}

.profile-header-info {
    flex: 1;
}

.profile-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.profile-role-badge {
    display: inline-block;
    background: var(--accent-gradient);
    color: white;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

/* Form Sections */
.profile-form-section {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    border: 2px solid var(--border-color);
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--border-color);
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.form-group-2col {
    grid-column: span 2;
}

/* Form Labels and Inputs */
.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-elevated);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

.form-input::placeholder {
    color: var(--text-disabled);
}

.form-input:hover:not(:focus) {
    border-color: var(--text-disabled);
}

/* Fix iOS/Safari select styling */
select.form-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--spacing-sm) center;
    background-size: 12px;
    padding-right: calc(var(--spacing-md) + 24px);
}

/* Input with Icon */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon .form-input {
    padding-right: 40px;
}

.input-icon {
    position: absolute;
    right: 12px;
    width: 20px;
    height: 20px;
    color: var(--text-disabled);
    pointer-events: none;
}

.input-icon-success {
    color: #00e676;
}

/* Upload Grid */
.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--spacing-md);
}

.upload-box {
    background: var(--bg-elevated);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 160px;
}

.upload-box:hover {
    border-color: var(--accent-primary);
    background: rgba(217, 119, 6, 0.05);
    transform: translateY(-2px);
}

.upload-icon {
    width: 40px;
    height: 40px;
    color: var(--text-disabled);
    transition: all 0.3s ease;
}

.upload-box:hover .upload-icon {
    color: var(--accent-primary);
    transform: scale(1.1);
}

.upload-icon svg {
    width: 100%;
    height: 100%;
}

.upload-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: center;
}

/* Profile Actions */
.profile-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: var(--spacing-lg);
}

.btn-save {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 15px;
    font-weight: 600;
}

.btn-save svg {
    width: 18px;
    height: 18px;
}

/* Address Autocomplete Suggestions */
.address-suggestions {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border: 2px solid var(--accent-primary);
    border-radius: var(--radius-md);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    display: none;
}

.address-suggestion-item {
    padding: var(--spacing-sm) var(--spacing-md);
    min-height: 44px;
    display: flex;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

.address-suggestion-item:last-child {
    border-bottom: none;
}

.address-suggestion-item:hover {
    background: rgba(217, 119, 6, 0.1);
}

.suggestion-main {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Responsive Form Grid */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group-2col {
        grid-column: span 1;
    }

    .upload-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== LOGIN MODAL ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--glass-border);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.modal-close svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-secondary);
}

.modal-close:hover {
    background: var(--bg-elevated);
}

.modal-close:hover svg {
    stroke: var(--text-primary);
}

#loginForm .form-group {
    margin-bottom: var(--spacing-md);
}

#loginForm .form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

#loginForm .form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 16px;
    transition: var(--transition-fast);
}

#loginForm .form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-elevated);
}

#loginForm .form-input::placeholder {
    color: var(--text-tertiary);
}

.login-error {
    background: rgba(255, 82, 82, 0.15);
    color: var(--danger);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: var(--spacing-md);
    border: 1px solid rgba(255, 82, 82, 0.3);
}

.btn-login {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    margin-top: var(--spacing-sm);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========== LOADING OVERLAY ========== */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 10, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: var(--spacing-md);
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ========== AUTH-REQUIRED STATES ========== */
.auth-required-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xxl);
    text-align: center;
    min-height: 300px;
}

.auth-required-message svg {
    width: 64px;
    height: 64px;
    stroke: var(--text-tertiary);
    margin-bottom: var(--spacing-lg);
}

.auth-required-message h3 {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.auth-required-message p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: var(--spacing-lg);
}

.btn-auth {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ========== TC FUNKTIONEN (Teamchef) ========== */

/* Letzte Schriebe Grid - 2 Reihen á 5 */
.latest-records-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 1024px) {
    .latest-records-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .latest-records-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .latest-records-grid {
        grid-template-columns: 1fr;
    }
}

/* Record Card */
.record-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition-fast);
    min-width: 140px;
}

.record-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.record-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-xs);
    gap: 4px;
}

.record-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.record-eh {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-primary);
    background: rgba(227, 6, 19, 0.1);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.record-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.record-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.record-time {
    font-size: 11px;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.record-area {
    font-size: 10px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.record-werber {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Werber Assignment List */
.werber-assignment-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.werber-assignment-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
}

.werber-assignment-item .werber-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.werber-area-select {
    flex: 1;
    max-width: 200px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.werber-area-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.werber-area-select:hover {
    border-color: var(--accent-primary);
}

/* ========== iPad OPTIMIERUNG ========== */
/* iPad Mini & Air (Portrait): 768px - 834px */
/* iPad Pro 11" & Air (Landscape): 834px - 1024px */
/* iPad Pro 12.9" (Portrait): 1024px */

/* General iPad Styles (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {

    /* Größere Basis-Schrift für bessere Lesbarkeit */
    html {
        font-size: 17px;
    }

    /* Mehr Padding für bessere Touch-Bereiche */
    body {
        padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-inset-bottom) + 20px);
    }

    /* App Content - Mehr Platz */
    .app-content {
        padding: var(--spacing-xl);
        padding-top: calc(var(--spacing-xl) + var(--safe-area-inset-top));
        padding-bottom: calc(var(--spacing-xxl) + var(--bottom-nav-height));
        max-width: 900px;
        margin: 0 auto;
    }

    /* View Container breiter */
    .view-container {
        max-width: 800px;
    }

    /* View Title größer */
    .view-title {
        font-size: 38px;
    }

    /* ========== TOUCH TARGETS MIN 44px ========== */

    /* Bottom Navigation - Größere Touch-Bereiche */
    .bottom-nav {
        height: calc(90px + var(--safe-area-inset-bottom));
        grid-template-columns: repeat(5, 1fr);
    }

    .nav-item {
        min-height: 70px;
        padding: var(--spacing-md) 0;
    }

    .nav-icon {
        width: 32px;
        height: 32px;
    }

    .nav-icon svg {
        width: 28px;
        height: 28px;
    }

    .nav-label {
        font-size: 12px;
        font-weight: 600;
    }

    /* Side Menu Items - Touch-freundlich */
    .side-menu {
        width: 340px;
    }

    .side-menu-item {
        min-height: 52px;
        padding: var(--spacing-md) var(--spacing-lg);
        font-size: 16px;
    }

    .side-menu-item .icon {
        width: 28px;
        height: 28px;
    }

    /* Avatar größer & Touch-freundlich */
    .header-avatar {
        right: var(--spacing-xl);
        top: calc(var(--spacing-xl) + var(--safe-area-inset-top));
    }

    .header-avatar img {
        width: 56px;
        height: 56px;
    }

    /* Buttons - Größere Touch-Targets */
    .btn-primary,
    .btn-secondary {
        min-height: 50px;
        padding: var(--spacing-md) var(--spacing-lg);
        font-size: 17px;
    }

    .btn-logout {
        min-height: 52px;
        padding: var(--spacing-md) var(--spacing-lg);
    }

    /* ========== STATS GRID - iPad Layout ========== */

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-md);
    }

    .stat-card {
        padding: var(--spacing-lg);
    }

    .stat-value {
        font-size: 42px;
    }

    .stat-label {
        font-size: 13px;
    }

    /* Mini Stats Grid - 4 Spalten auf iPad */
    .mini-stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-md);
    }

    .mini-stat {
        padding: var(--spacing-md) var(--spacing-lg);
        min-height: 100px;
    }

    .mini-stat-value {
        font-size: 28px;
    }

    .mini-stat-label {
        font-size: 12px;
    }

    /* Hero Stat - iPad angepasst */
    .hero-stat {
        padding: var(--spacing-xxl);
    }

    .hero-stat-value {
        font-size: 84px;
    }

    .hero-stat-label {
        font-size: 14px;
    }

    .hero-stat-subtitle {
        font-size: 18px;
    }

    /* ========== RANKING - iPad Layout ========== */

    .ranking-tabs {
        padding: var(--spacing-sm);
    }

    .ranking-tab {
        min-height: 52px;
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 12px;
    }

    .ranking-tab svg {
        width: 24px;
        height: 24px;
    }

    .flashy-ranking-item {
        padding: var(--spacing-md);
        gap: var(--spacing-md);
    }

    .rank-badge {
        width: 56px;
        height: 56px;
        font-size: 20px;
    }

    .rank-name {
        font-size: 17px;
    }

    .rank-team {
        font-size: 14px;
    }

    .rank-score .score-value {
        font-size: 28px;
    }

    .rank-score .score-label {
        font-size: 12px;
    }

    /* Your Position Card */
    .your-position-card {
        padding: var(--spacing-xl);
    }

    .position-rank {
        font-size: 64px;
    }

    .position-total {
        font-size: 15px;
    }

    /* Champion Banner */
    .champion-banner-fixed {
        padding: var(--spacing-lg) var(--spacing-xl);
    }

    .champion-banner-fixed .winner-crown {
        width: 56px;
        height: 56px;
    }

    .champion-banner-fixed .winner-name {
        font-size: 20px;
    }

    /* ========== TEAM VIEW - iPad Layout ========== */

    .area-card {
        padding: var(--spacing-lg);
    }

    .area-card h3 {
        font-size: 18px;
    }

    .area-card p {
        font-size: 15px;
    }

    /* ========== PROFILE - iPad Layout ========== */

    .profile-header {
        padding: var(--spacing-xl);
    }

    .profile-avatar {
        width: 100px;
        height: 100px;
    }

    .profile-name {
        font-size: 28px;
    }

    .profile-role-badge {
        font-size: 14px;
        padding: 8px 20px;
    }

    .form-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }

    .form-input {
        min-height: 48px;
        padding: var(--spacing-md);
        font-size: 16px;
    }

    .form-label {
        font-size: 14px;
    }

    .upload-box {
        min-height: 180px;
        padding: var(--spacing-xl);
    }

    .upload-icon {
        width: 48px;
        height: 48px;
    }

    .upload-label {
        font-size: 15px;
    }

    /* ========== TC FUNKTIONEN - iPad Layout ========== */

    .latest-records-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-md);
    }

    .record-card {
        padding: var(--spacing-md);
        min-width: 160px;
    }

    .record-name {
        font-size: 14px;
    }

    .record-eh {
        font-size: 13px;
        padding: 3px 10px;
    }

    .record-time {
        font-size: 12px;
    }

    .record-area {
        font-size: 11px;
    }

    .record-werber {
        font-size: 12px;
    }

    .werber-assignment-item {
        padding: var(--spacing-md) var(--spacing-lg);
        min-height: 56px;
    }

    .werber-assignment-item .werber-name {
        font-size: 16px;
    }

    .werber-area-select {
        min-height: 44px;
        padding: 12px 16px;
        font-size: 15px;
        max-width: 260px;
    }

    /* ========== QUICK ACTIONS - iPad Layout ========== */

    .quick-actions-scroll {
        gap: var(--spacing-lg);
    }

    .action-card {
        min-width: 120px;
        padding: var(--spacing-lg);
    }

    .action-icon {
        width: 48px;
        height: 48px;
    }

    .action-label {
        font-size: 13px;
    }

    /* ========== MODALS - iPad optimiert ========== */

    .modal-content {
        max-width: 480px;
        padding: var(--spacing-xl);
    }

    .modal-header h2 {
        font-size: 24px;
    }

    .modal-close {
        width: 44px;
        height: 44px;
    }

    #loginForm .form-input {
        min-height: 52px;
        padding: 16px 18px;
        font-size: 17px;
    }

    .btn-login {
        min-height: 52px;
        font-size: 17px;
    }

    /* ========== CHARTS - iPad Layout ========== */

    .chart-card {
        padding: var(--spacing-md);
    }

    .chart-header {
        margin-bottom: var(--spacing-sm);
    }

    .chart-title {
        font-size: 13px;
    }

    .chart-value {
        font-size: 28px;
    }

    .chart-canvas {
        height: 160px;
    }

    /* ========== LEADERBOARD - iPad Layout ========== */

    .leaderboard-item {
        padding: var(--spacing-md) var(--spacing-lg);
        min-height: 72px;
    }

    .leaderboard-position {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }

    .leaderboard-name {
        font-size: 17px;
    }

    .leaderboard-team {
        font-size: 14px;
    }

    .score-value {
        font-size: 28px;
    }

    /* ========== SECTION HEADERS ========== */

    .section-header h3 {
        font-size: 16px;
    }

    .section-link {
        font-size: 14px;
    }
}

/* ========== iPad LANDSCAPE (> 1024px width) ========== */
@media (min-width: 1024px) and (max-width: 1400px) {

    /* Breiter View Container */
    .view-container {
        max-width: 960px;
    }

    .app-content {
        max-width: 1100px;
    }

    /* 5-Spalten Grid für Letzte Schriebe */
    .latest-records-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    /* Stats Grid - volle 4 Spalten */
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .mini-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========== iPad PORTRAIT Specific (768px - 834px) ========== */
@media (min-width: 768px) and (max-width: 834px) and (orientation: portrait) {

    /* 3-Spalten Grid für kompaktere Ansicht */
    .latest-records-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Stats 2x2 Grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mini-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-stat-value {
        font-size: 72px;
    }
}

/* ========== iPad Pro 12.9" (1024px+) ========== */
@media (min-width: 1024px) {

    html {
        font-size: 18px;
    }

    .view-container {
        max-width: 1000px;
    }

    .app-content {
        max-width: 1200px;
        padding: var(--spacing-xxl);
    }

    .view-title {
        font-size: 42px;
    }

    .hero-stat-value {
        font-size: 96px;
    }

    /* Breites Side Menu */
    .side-menu {
        width: 380px;
    }

    .side-menu-item {
        font-size: 17px;
        padding: var(--spacing-lg) var(--spacing-xl);
    }
}

/* ========== TOUCH-FRIENDLY ALLGEMEIN (für alle Touch-Geräte) ========== */
@media (hover: none) and (pointer: coarse) {

    /* Alle klickbaren Elemente mindestens 44px */
    button,
    .btn-primary,
    .btn-secondary,
    .nav-item,
    .side-menu-item,
    .ranking-tab,
    .action-card,
    .werber-area-select {
        min-height: 44px;
    }

    /* Links & Touch-Bereiche */
    a {
        padding: 4px 0;
    }

    /* Form Inputs größer */
    input,
    select,
    textarea {
        min-height: 44px;
        font-size: 16px; /* Verhindert Auto-Zoom auf iOS */
    }

    /* Mehr Platz zwischen Touch-Elementen */
    .ranking-list,
    .flashy-ranking-list,
    .area-list,
    .werber-assignment-list {
        gap: var(--spacing-md);
    }

    /* Hover-Effekte für Touch entfernen */
    .nav-item:hover,
    .side-menu-item:hover,
    .action-card:hover,
    .mini-stat:hover {
        transform: none;
    }

    /* Active States statt Hover */
    .nav-item:active,
    .side-menu-item:active,
    .action-card:active,
    .mini-stat:active {
        transform: scale(0.97);
        opacity: 0.9;
    }
}

/* ========== TOAST NOTIFICATIONS ========== */
.toast-notification {
    position: fixed;
    bottom: calc(var(--bottom-nav-height, 60px) + 16px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9998;
    max-width: 90%;
    opacity: 0;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-error {
    border-color: #ff5252;
    background: rgba(255, 82, 82, 0.15);
}

.toast-success {
    border-color: #4caf50;
    background: rgba(76, 175, 80, 0.15);
}

.toast-info {
    border-color: var(--primary);
    background: rgba(0, 122, 255, 0.1);
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.toast-error .toast-icon {
    background: #ff5252;
    color: white;
}

.toast-success .toast-icon {
    background: #4caf50;
    color: white;
}

.toast-info .toast-icon {
    background: var(--primary);
    color: white;
}

.toast-message {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

/* ========== RECORD AREA BADGE ========== */
.record-area {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
    padding: 2px 6px;
    background: var(--bg-secondary);
    border-radius: 4px;
    display: inline-block;
}
