/* Kicker App - Einfache CSS für Aufstellung und Drag & Drop */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #f6f6f6;
    color: #333;
}

/* Intro Banner */
.intro-banner {
    grid-column: 1 / -1;
    margin: 0;
    padding: 0;
}

.intro-content {
    background: linear-gradient(135deg, #eef3ff, #ffffff);
    border: 1px solid #e5e9f2;
    border-radius: 16px;
    padding: 12px 16px;
    box-shadow: none;
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

.intro-content h2 {
    color: #2a5298;
    margin: 0 0 0.5rem 0;
    font-size: 1.4rem;
}

.intro-content p {
    margin: 0;
    line-height: 1.5;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: rgb(204,0,0);
    padding: 1rem;
    border-bottom: 2px solid #2a5298;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo i {
    font-size: 2rem;
    color: #2a5298;
}

.crystal-ball {
    font-size: 2.2rem;
    margin: 0 0.5rem;
    filter: drop-shadow(0 0 8px rgba(138, 43, 226, 0.6));
    animation: crystal-glow 3s ease-in-out infinite alternate;
}

@keyframes crystal-glow {
    0% {
        filter: drop-shadow(0 0 8px rgba(138, 43, 226, 0.6));
        transform: scale(1);
    }
    100% {
        filter: drop-shadow(0 0 15px rgba(138, 43, 226, 0.8));
        transform: scale(1.05);
    }
}

.logo h1 {
    font-size: 1.5rem;
    color: #ffffff;
    margin: 0;
    font-family: 'Inter', 'Segoe UI', 'Roboto', sans-serif;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Header actions (right side) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.support-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.8rem;
    background: transparent;
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 9999px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease, border-color 0.2s ease;
}

.support-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.support-btn:active {
    transform: translateY(1px);
}

.support-btn svg {
    display: block;
    width: 20px;
    height: 20px;
}

@media (max-width: 520px) {
    .support-text { display: none; }
}

.formation-display {
    background: #f0f0f0;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    border: 2px solid #2a5298;
}

.formation-label {
    color: #666;
    font-size: 0.9rem;
}

.formation-value {
    color: #2a5298;
    font-size: 1.1rem;
    font-weight: bold;
}

/* Main Content */
.main-content {
    flex: 1;
    display: grid;
    grid-template-columns: 6fr 4fr;
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Aufstellungsfeld - Das Wichtigste! */
.formation-field {
    background: #009b55;
    border: 3px solid #ffffff;
    border-radius: 20px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 750px;
    max-height: 750px;
    position: relative;
}

/* Field Container für Startelf und Ersatzbank */
.field-container {
    display: flex;
    gap: 2rem;
    flex: 1;
}

/* Startelf und Ersatzbank */
.starting-eleven,
.substitute-bench {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Team Section Title */
.team-section-title {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    background: #000000;
    padding: 0.5rem 1rem;
    border-radius: 15px;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Position Groups - Klare Aufstellung */
.position-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    min-width: 300px;
}

.position-label {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: bold;
    background: #000000;
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    min-width: 80px;
    text-align: center;
    margin-bottom: 8px;
}

/* Spieler-Positionen */
.player-position {
    width: 60px;
    height: 60px;
    border: 3px dashed #ffffff;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.position-positions {
    display: flex;
    gap: 12px;
    justify-content: center;
    min-width: 280px;
    justify-content: space-evenly;
}

.player-position:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: #ffff00;
    transform: scale(1.05);
}

.player-position.filled {
    background: rgba(255, 255, 255, 0.8);
    border-color: #00ff00;
}

.player-position.filled .player-info {
    color: #000000;
    font-weight: bold;
    font-size: 0.7rem;
    text-align: center;
}

/* Spieler Markt */
.player-market {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    height: 750px;
    max-height: 750px;
    overflow-y: auto;
}

.market-header h2 {
    color: #2a5298;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.market-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.market-filters {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.6rem 0.9rem;
    background: #f4f6fb;
    border: 1px solid #e5e9f2;
    border-radius: 12px;
}

.search-row {
    margin-bottom: 0.5rem;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: #6b7280;
    z-index: 1;
}

.search-input {
    width: 100%;
    padding: 0.6rem 0.6rem 0.6rem 2.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    font-size: 0.9rem;
    color: #2a5298;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

.clear-search-btn {
    position: absolute;
    right: 8px;
    background: #e5e7eb;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.clear-search-btn:hover {
    background: #d1d5db;
    color: #374151;
}

.filter-header { display:flex; align-items:center; gap:0.5rem; }
.filter-title { color:#2a5298; font-weight:600; font-size:0.9rem; }
.filter-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(140px, 1fr));
    gap: 0.5rem;
    width: 100%;
}

@media (max-width: 640px) {
    .filter-row {
        grid-template-columns: 1fr;
    }
}

.filter-select {
    padding: 0.35rem 0.6rem;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    font-size: 0.9rem;
    color: #2a5298;
}

.filter-icon svg {
    color: #2a5298;
}



.player-category {
    margin-bottom: 1.5rem;
}

.player-category h3 {
    color: #2a5298;
    font-size: 1rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid #2a5298;
}

.player-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.market-player {
    display: grid;
    grid-template-columns: auto 1fr minmax(140px, auto) auto;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 12px;
    cursor: grab;
    transition: all 0.2s ease;
}

.market-player .buy-btn {
    margin-left: auto;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.4rem 0.7rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s ease;
}

.market-player .buy-btn.buy { background: #28a745; }
.market-player .buy-btn.buy:hover { background: #218838; }

.market-player .buy-btn.sell { background: #e74c3c; }
.market-player .buy-btn.sell:hover { background: #c0392b; }

.market-player:hover {
    background: #f0f0f0;
    border-color: #2a5298;
    transform: translateY(-2px);
}

.market-player:active {
    cursor: grabbing;
}

.player-avatar {
    width: 40px;
    height: 40px;
    background: #2a5298;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.player-info {
    flex: 1;
}

.player-points-badge {
    background: #eef3ff;
    color: #2a5298;
    border: 1px solid #cbd5e1;
    padding: 0.3rem 0.5rem;
    border-radius: 8px;
    font-size: 0.8rem;
    white-space: nowrap;
    justify-self: center;
    text-align: center;
}

.player-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 0.2rem;
}

.player-club {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.2rem;
}

.player-value {
    font-size: 0.8rem;
    color: #2a5298;
    font-weight: bold;
}

.player-points {
    font-size: 0.8rem;
    color: #555;
    font-weight: 600;
}

/* Formation Filter */
.formation-filter {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #ffffff;
    border-radius: 15px;
    padding: 8px 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.formation-filter label {
    color: #000000;
    font-weight: bold;
    font-size: 0.9rem;
}

.formation-select {
    background: #ffffff;
    border: 2px solid #2a5298;
    border-radius: 10px;
    padding: 5px 10px;
    font-size: 0.9rem;
    color: #2a5298;
    font-weight: bold;
    cursor: pointer;
    outline: none;
}

.formation-select:focus {
    border-color: #ffff00;
    box-shadow: 0 0 5px rgba(255, 255, 0, 0.5);
}

.player-count {
    background: rgb(42,82,152);
    color: white;
    padding: 5px 10px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 0.9rem;
    min-width: 45px;
    text-align: center;
    margin-left: 10px;
}

.budget-display {
    background: rgb(42,82,152);
    color: white;
    padding: 5px 10px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 0.9rem;
    min-width: 120px;
    text-align: center;
    margin-left: 10px;
}

/* Drag & Drop Styles */
.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.drag-over {
    background: rgba(0, 255, 0, 0.3) !important;
    border-color: #00ff00 !important;
}

/* Responsive */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .intro-banner { order: 0; }
    .formation-field { order: 1; }
    .player-market { order: 2; }
}

@media (max-width: 768px) {
    .formation-field {
        padding: 20px;
    }
    
    .position-row {
        gap: 15px;
    }
    
    .player-position {
        width: 60px;
        height: 60px;
    }

    /* Make header span full viewport width on mobile */
    .header {
        padding-left: 0;
        padding-right: 0;
        width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
    }
    .header-content {
        max-width: none;
        padding: 0 1rem;
    }
}

/* Prognosis Card (fancy score banner) */
.prognosis-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, #2a5298, #6a11cb);
    border: 1px solid rgba(42, 82, 152, 0.25);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    text-align: center;
    width: 100%;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    will-change: transform, filter;
}

.flame-emoji {
    font-size: 2.2rem;
    filter: drop-shadow(0 0 8px rgba(255, 140, 0, 0.6));
    animation: flame-flicker 1.8s ease-in-out infinite alternate;
}

@keyframes flame-flicker {
    0% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(255, 140, 0, 0.55)); }
    100% { transform: scale(1.08); filter: drop-shadow(0 0 14px rgba(255, 99, 0, 0.75)); }
}

.prognosis-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    text-align: center;
}

.prognosis-title {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 700;
    letter-spacing: 0.2px;
    font-size: 1.25rem;
}

.prognosis-hint {
    color: rgba(255,255,255,0.8);
    font-weight: 600;
    font-size: 0.95rem;
    margin-left: 6px;
}

.prognosis-score {
    color: #ffffff;
    font-weight: 800;
    font-size: 3rem;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

@media (min-width: 1024px) {
    .prognosis-score { font-size: 3.6rem; }
    .prognosis-title { font-size: 1.5rem; }
}

/* Simple, smooth X-axis flip for completion */
#prognosisSection.spin-all .intro-content {
    animation: prognosis-flip-x 700ms ease-out;
}

@keyframes prognosis-flip-x {
    0%   { transform: perspective(1000px) rotateX(0deg)   scale(0.98); box-shadow: 0 8px 20px rgba(0,0,0,0.10); }
    50%  { transform: perspective(1000px) rotateX(180deg) scale(1.02); box-shadow: 0 14px 24px rgba(0,0,0,0.11); }
    100% { transform: perspective(1000px) rotateX(360deg) scale(1.00); box-shadow: 0 8px 18px rgba(0,0,0,0.08); }
}

/* Score reveal helpers */
.prognosis-score.hidden { opacity: 0; }
.prognosis-score.reveal { animation: score-reveal 220ms ease-out forwards; }

@keyframes score-reveal {
    from { opacity: 0; transform: translateY(2px); }
    to   { opacity: 1; transform: translateY(0); }
}



/* Modal styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

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

.modal {
    background: #ffffff;
    border-radius: 16px;
    max-width: 560px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
    padding: 1.25rem 1.25rem 1rem 1.25rem;
    position: relative;
}

.modal-title {
    margin: 0 0 0.5rem 0;
    color: #1e3c72;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-body p { margin: 0.5rem 0; }

.modal-qr {
    display: block;
    max-width: 220px;
    width: 100%;
    height: auto;
    margin: 0.5rem auto;
    border-radius: 8px;
    border: 1px solid #e5e9f2;
}

.modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #e74c3c;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.modal-close:hover { background: #c0392b; }
