:root {
    --bg: #0f172a;
    --card: rgba(30, 41, 59, 0.7);
    --primary: #ffaa00; 
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
    --glass: blur(16px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    background-color: var(--bg); color: var(--text);
    font-family: 'Inter', sans-serif; min-height: 100vh; padding-bottom: 60px;
    -webkit-font-smoothing: antialiased;
}

.background-orb {
    position: fixed; top: -20vh; right: -20vw; width: 80vw; height: 80vw;
    background: radial-gradient(circle, rgba(255,170,0,0.08) 0%, rgba(0,0,0,0) 70%);
    pointer-events: none; z-index: -1;
}

header { padding: 20px 0; margin-bottom: 10px; }
.header-inner { max-width: 600px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; }
.logo-area { display: flex; align-items: center; cursor: pointer; }
.logo-area h1 { font-family: 'Rajdhani', sans-serif; font-size: 24px; font-weight: 700; margin-left: 10px; }
.highlight { color: var(--primary); }
.brand-dot { width: 12px; height: 12px; background: var(--primary); border-radius: 50%; box-shadow: 0 0 12px var(--primary); }

.header-controls { display: flex; align-items: center; gap: 8px; }
.balance-pill { font-size: 12px; font-weight: 600; color: var(--primary); background: rgba(255,170,0,0.1); padding: 4px 10px; border-radius: 20px; border: 1px solid rgba(255,170,0,0.2); }

/* Euro Toggle Button */
.btn-icon {
    background: rgba(255,255,255,0.05); border: 1px solid var(--border); color: var(--text-muted);
    width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.btn-icon.active { background: var(--primary); color: #000; border-color: var(--primary); }

.container { max-width: 600px; margin: 0 auto; padding: 0 15px; }

.glass-panel {
    background: var(--card); backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass);
    border: 1px solid var(--border); border-radius: 20px; padding: 24px; margin-bottom: 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
h2, h3 { font-family: 'Rajdhani', sans-serif; font-weight: 700; }
.step-indicator { font-size: 12px; color: var(--text-muted); background: rgba(255,255,255,0.05); padding: 2px 8px; border-radius: 4px; }

/* Custom Dropdown Styles (Frontend) */
.row { display: flex; gap: 15px; margin-bottom: 15px; }
.col { flex: 1; position: relative; }
.custom-dropdown { position: relative; width: 100%; }
.custom-dropdown input {
    width: 100%; padding: 14px; padding-right: 40px; background: rgba(0,0,0,0.3);
    border: 1px solid var(--border); border-radius: 12px; color: white; font-size: 16px; outline: none; transition: 0.2s;
}
.custom-dropdown input:focus { border-color: var(--primary); }
.custom-dropdown input:read-only { cursor: pointer; }
.dd-arrow { position: absolute; right: 0; top: 0; bottom: 0; width: 40px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 10px; cursor: pointer; z-index: 10; }
.dd-options {
    position: absolute; top: calc(100% + 5px); left: 0; right: 0; background: #1e293b;
    border: 1px solid var(--border); border-radius: 12px; overflow-y: auto; max-height: 200px; z-index: 50;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.dd-option { padding: 12px 14px; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,0.03); font-size: 15px; }
.dd-option:hover { background: rgba(255,170,0,0.1); color: var(--primary); }

.form-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-size: 12px; color: var(--text-muted); text-transform: uppercase; font-weight: 600; }

/* Team Grid - HELLER HINTERGRUND */
.team-grid-selector { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.team-option {
    background: #f1f5f9; 
    border: 2px solid transparent; 
    border-radius: 12px; 
    padding: 0; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; 
    cursor: pointer; transition: 0.2s; overflow: hidden;
}
.team-option:hover { 
    background: #ffffff; 
    border-color: var(--primary); 
    transform: scale(1.02);
}
.team-option img { 
    width: 85%; height: 85%; 
    object-fit: contain; 
}
.team-option.selected { 
    background: #ffffff; 
    border-color: var(--primary); 
    box-shadow: 0 0 10px rgba(255, 170, 0, 0.5);
}

.amount-chips { display: flex; gap: 8px; align-items: flex-start; }
.chip { flex: 1; padding: 12px 0; background: rgba(255,255,255,0.05); border: 1px solid var(--border); color: var(--text-muted); border-radius: 10px; cursor: pointer; font-weight: 600; }
#amount { width: 100%; text-align: center; font-weight: bold; background: rgba(0,0,0,0.3); border: 1px solid var(--border); border-radius: 10px; color: white; padding: 12px; }

.input-fiat { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--text-muted); }

.btn-main {
    width: 100%; padding: 16px; margin-top: 10px; background: linear-gradient(135deg, #ffaa00, #ff8800);
    border: none; border-radius: 14px; color: #000; font-weight: 700; font-size: 16px; cursor: pointer;
}
.btn-main:active { transform: scale(0.98); }
.btn-main:disabled { opacity: 0.6; filter: grayscale(1); }

/* --- ACCORDION & RESULTS --- */
.accordion-card { cursor: pointer; transition: background 0.2s; }
.accordion-card:hover { background: rgba(30, 41, 59, 0.9); }

.event-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0; padding-bottom: 0; border: none; }
.accordion-card.open .event-header-row { margin-bottom: 15px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }

.header-left { display: flex; align-items: center; gap: 8px; }
.header-right { display: flex; align-items: center; gap: 10px; }

.header-winner-badge {
    background: linear-gradient(135deg, #ffaa00, #f59e0b);
    color: #000; font-size: 11px; font-weight: 700; padding: 2px 6px;
    border-radius: 6px; white-space: nowrap;
}

.count-badge { font-size: 12px; background: rgba(255,255,255,0.1); padding: 2px 8px; border-radius: 6px; }

.chevron { font-size: 12px; color: var(--text-muted); transition: transform 0.3s ease; display: inline-block; }
.accordion-card.open .chevron { transform: rotate(180deg); color: var(--primary); }

.accordion-content { display: none; }
.accordion-card.open .accordion-content { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

.bet-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.03); }
.bet-left { display: flex; align-items: center; gap: 12px; }
.bet-right { display: flex; flex-direction: column; align-items: flex-end; }

.mini-icon { width: 32px; height: 32px; object-fit: contain; background: rgba(255,255,255,0.05); border-radius: 50%; padding: 4px; }
.bet-details { display: flex; flex-direction: column; }
.bet-user { font-size: 14px; font-weight: 600; color: #fff; }
.bet-team { font-size: 12px; color: var(--text-muted); }
.bet-amt { font-family: monospace; color: var(--primary); font-size: 14px; }

.fiat-list-item { font-size: 10px; color: var(--text-muted); margin-bottom: 2px; }

.winner-banner {
    background: linear-gradient(90deg, rgba(255,170,0,0.2), transparent); border-radius: 12px;
    padding: 12px; margin-bottom: 15px; display: flex; align-items: center; gap: 12px;
}
.has-winner { border: 1px solid var(--primary); }
.winner-row { background: rgba(255, 170, 0, 0.15); border-radius: 8px; padding-left: 10px; padding-right: 10px; border: 1px solid rgba(255,170,0,0.3); }

.w-team { font-weight: 700; font-family: 'Rajdhani'; font-size: 18px; color: white; }
.w-user { font-size: 12px; color: var(--primary); }
.w-pot { font-size: 12px; color: #fff; background: rgba(0,0,0,0.3); padding: 2px 6px; border-radius: 4px; margin-top: 2px; display: inline-block; }
.w-img { width: 40px; height: 40px; object-fit: contain; }

/* --- LEADERBOARD --- */
.leaderboard-table-wrapper { overflow-x: auto; }
.leaderboard-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.leaderboard-table th { color: var(--text-muted); border-bottom: 1px solid var(--border); padding: 8px 4px; text-align: left; font-size: 11px; text-transform: uppercase; }
.leaderboard-table td { border-bottom: 1px solid rgba(255,255,255,0.03); padding: 10px 4px; vertical-align: middle; }
.leaderboard-table .text-right { text-align: right; }
.leaderboard-table .highlight { color: var(--primary); font-family: monospace; font-weight: bold; }
.leaderboard-table .muted-col { color: var(--text-muted); font-family: monospace; }

/* Wrapper für Flexbox in Zelle */
.td-flex { display: flex; flex-direction: column; align-items: flex-end; }

.rank-col { width: 30px; font-size: 16px; }
.player-col { font-weight: 600; }

/* Overlay & Admin */
.overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.9); backdrop-filter: blur(10px);
    display: flex; justify-content: center; align-items: center; z-index: 100;
}
.hidden { display: none !important; }
.overlay-content {
    background: #1e293b; padding: 30px; border-radius: 24px;
    text-align: center; width: 90%; max-width: 360px; border: 1px solid var(--border);
}

.admin-content { max-width: 600px; width: 95%; max-height: 85vh; overflow-y: auto; text-align: left; }
.admin-tabs { display: flex; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.tab-btn { flex: 1; background: none; border: none; color: var(--text-muted); padding: 10px; cursor: pointer; border-bottom: 2px solid transparent; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

.admin-select {
    width: 100%; padding: 12px; border-radius: 8px; 
    background-color: #334155; color: #fff; border: 1px solid var(--border);
    font-size: 16px; appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}

.admin-bet-list { display: flex; flex-direction: column; gap: 15px; }

.admin-bet-card {
    background: rgba(0,0,0,0.2); border: 1px solid var(--border); border-radius: 12px; padding: 15px;
    display: flex; flex-direction: column; gap: 10px;
}
.bet-edit-header { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 8px; }
.bet-edit-body { display: flex; flex-direction: column; gap: 10px; }
.bet-edit-body label { margin-bottom: 2px; font-size: 10px; }

.admin-input-full { width: 100%; padding: 10px; background: #334155; border: 1px solid var(--border); color: #fff; border-radius: 6px; }
.admin-select-full { width: 100%; padding: 10px; background: #334155; border: 1px solid var(--border); color: #fff; border-radius: 6px; }

.bet-edit-footer { margin-top: 5px; display: flex; gap: 10px; }
.small-btn { padding: 6px 12px; margin: 0; font-size: 12px; width: auto; display: inline-block; }

.btn-danger {
    background: rgba(220, 38, 38, 0.2); color: #fca5a5; border: 1px solid rgba(220, 38, 38, 0.5);
    border-radius: 14px; font-weight: 700; cursor: pointer;
}
.btn-danger:hover { background: rgba(220, 38, 38, 0.4); color: #fff; }

/* Copy Row */
.copy-row {
    display: flex; gap: 8px; align-items: center; margin: 15px 0;
}
#lnInvoice {
    width: 100%; padding: 10px; background: rgba(0,0,0,0.2); 
    border: 1px solid var(--border); color: var(--text-muted); 
    border-radius: 8px; font-size: 12px; font-family: monospace;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.btn-copy {
    background: var(--primary); border: none; border-radius: 8px; 
    width: 40px; height: 38px; cursor: pointer; font-size: 18px; 
    display: flex; align-items: center; justify-content: center;
}

.qr-box { background: white; padding: 10px; border-radius: 12px; display: inline-block; margin: 15px 0 0; }
.btn-secondary { display: block; background: rgba(255,255,255,0.1); color: white; text-decoration: none; padding: 12px; border-radius: 10px; margin-bottom: 10px; text-align: center; border:none; cursor:pointer; width:100%; font-size:14px; }
.btn-text { background: none; border: none; color: var(--text-muted); text-decoration: underline; cursor: pointer; }
.loader { margin-top: 15px; font-size: 12px; color: var(--primary); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.5; } }