:root {
    --bg-dark: #121212;
    --bg-card: #242424;
    --bg-hover: #333333;
    --porsche-red: #d5001c;
    --text-light: #f5f5f5;
    --text-muted: #aaaaaa;
    --gold: #FFD700;
    --silver: #C0C0C0;
    --bronze: #cd7f32;
    --porsche-blue: #004b98;
}

body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: var(--bg-dark); color: var(--text-light); margin: 0; padding: 0; display: flex; flex-direction: column; align-items: center; }

/* --- PFEIL-SYSTEM ENTFERNEN (GLOBAL) --- */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] {
    -moz-appearance: textfield;
}

.header { width: 100%; background-color: var(--bg-card); padding: 20px 0; text-align: center; border-bottom: 3px solid var(--porsche-red); position: sticky; top: 0; z-index: 100; }
.header h1 { color: var(--text-light); font-size: 1.8rem; margin: 0; letter-spacing: 1px; }
.header h1 span { color: var(--porsche-red); }
.user-info { font-size: 0.9rem; color: var(--text-muted); margin-top: 5px; }

.back-btn { position: absolute; left: 20px; top: 22px; background: none; border: none; color: var(--porsche-red); font-size: 1.1rem; cursor: pointer; display: none; font-weight: bold; }
.logout-btn { position: absolute; right: 20px; top: 22px; background: none; border: none; color: #aaa; font-size: 1rem; cursor: pointer; transition: 0.3s; }
.logout-btn:hover { color: white; }

.container { width: 95%; max-width: 1400px; padding: 30px 0; }
.view { display: none; }

.view-title { margin-bottom: 15px; border-bottom: 2px solid var(--porsche-red); padding-bottom: 5px; font-size: 1.4rem; }

/* Login & Modals */
.login-box { background-color: var(--bg-card); max-width: 450px; margin: 50px auto; padding: 40px; border-radius: 12px; text-align: center; border-top: 4px solid var(--porsche-red); box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
.login-tabs { display: flex; justify-content: center; gap: 10px; margin-bottom: 25px; border-bottom: 1px solid #333; padding-bottom: 10px; }
.login-tab { background: none; border: none; color: var(--text-muted); font-size: 1rem; cursor: pointer; padding: 5px 10px; font-weight: bold; transition: 0.3s; }
.login-tab.active { color: var(--porsche-red); border-bottom: 2px solid var(--porsche-red); }

.toggle-password { position: absolute; right: 15px; top: 12px; cursor: pointer; font-size: 1.1rem; opacity: 0.5; }

.ds-check-area { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 25px; text-align: left; background: #1a1a1a; padding: 15px; border-radius: 8px; border: 1px solid #444; }
.ds-check-area input[type="checkbox"] { transform: scale(1.4); margin-top: 4px; cursor: pointer; accent-color: var(--porsche-red); }
.ds-check-area label { color: var(--text-muted); font-size: 0.9rem; cursor: pointer; line-height: 1.4; }

/* App Grid */
.app-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.app-tile { background-color: var(--bg-card); border-radius: 12px; padding: 25px 20px; text-align: center; cursor: pointer; transition: 0.3s; border: 1px solid #333; }
.app-tile:hover { transform: translateY(-5px); border-color: var(--porsche-red); }
.app-tile .icon { font-size: 3rem; margin-bottom: 15px; }
.app-tile h2 { margin: 0; font-size: 1.3rem; }
.admin-tile { border-top: 3px solid var(--gold); display: none; }

/* Match Cards */
.match-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 20px; }
.match-card { background-color: var(--bg-card); border-radius: 10px; overflow: hidden; border-top: 3px solid var(--porsche-red); box-shadow: 0 4px 6px rgba(0,0,0,0.2); }
.match-card.locked { opacity: 0.6; }
.match-header { background-color: #1a1a1a; padding: 10px 15px; text-align: center; color: var(--text-muted); font-size: 0.85rem; display: flex; justify-content: space-between; border-bottom: 1px solid #333; }
.teams { display: flex; justify-content: space-between; align-items: center; padding: 15px; font-weight: bold; font-size: 1.1rem; }
.vs { color: var(--porsche-red); width: 10%; text-align: center; }
.betting-area { background-color: #1a1a1a; padding: 15px 10px; display: flex; justify-content: center; align-items: center; gap: 10px; border-top: 1px solid #333; }
.bet-input { width: 50px; height: 50px; text-align: center; font-size: 1.4rem; font-weight: bold; background-color: var(--bg-dark); color: white; border: 2px solid #555; border-radius: 8px; outline: none; }
.bet-input:focus { border-color: var(--porsche-red); }

/* Buttons */
.btn-save { background-color: var(--porsche-red); color: white; border: none; padding: 12px 20px; border-radius: 6px; cursor: pointer; font-weight: bold; transition: 0.2s; }
.btn-save:hover { background-color: #a00015; }
.btn-info { background-color: var(--porsche-blue); color: white; border: none; padding: 10px 20px; border-radius: 20px; cursor: pointer; font-weight: bold; }
.btn-success { background-color: #4CAF50; color: white; border: none; padding: 10px 15px; border-radius: 6px; cursor: pointer; font-weight: bold; }
.btn-unlock { background-color: #ff9800; color: white; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 0.8rem; }

/* Admin Inputs */
.admin-input { width: 100%; padding: 12px; margin-bottom: 15px; background-color: var(--bg-dark); border: 1px solid #444; color: white; border-radius: 6px; box-sizing: border-box; font-size: 1rem; }
.admin-section { background-color: #1a1a1a; padding: 20px; border-radius: 8px; margin-bottom: 25px; border: 1px solid #333; }
.admin-team-input { width: 42%; padding: 8px; background-color: #2a2a2a; border: 1px solid #555; color: white; text-align: center; border-radius: 4px; }

/* Wettschein */
.ticket-user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; max-height: 250px; overflow-y: auto; }
.btn-user-ticket { background-color: #2a2a2a; color: white; border: 1px solid #444; padding: 12px; border-radius: 6px; cursor: pointer; }
.btn-user-ticket.active { background-color: var(--porsche-red); border-color: var(--porsche-red); }
.ticket-card { background-color: #2a2a2a; border: 1px dashed #666; padding: 20px; border-top: 5px solid var(--porsche-red); border-radius: 8px; }
.ticket-row { display: flex; justify-content: space-between; border-bottom: 1px dotted #444; padding: 8px 0; font-size: 0.95rem; }

/* Modals */
.custom-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); display: none; justify-content: center; align-items: center; z-index: 10000; backdrop-filter: blur(5px); }
.custom-modal-box { background-color: var(--bg-card); padding: 35px; border-radius: 15px; border-top: 5px solid var(--porsche-red); width: 90%; max-width: 500px; text-align: center; box-shadow: 0 20px 40px rgba(0,0,0,0.8); }

.ranking-table { width: 100%; border-collapse: collapse; background: var(--bg-card); border-radius: 8px; overflow: hidden; }
.ranking-table th, .ranking-table td { padding: 15px; text-align: left; border-bottom: 1px solid #333; }
.rank-1 { color: var(--gold); font-weight: bold; font-size: 1.1rem; }
.rank-2 { color: var(--silver); font-weight: bold; }
.rank-3 { color: var(--bronze); font-weight: bold; }

.pagination { display: flex; justify-content: center; gap: 8px; margin-bottom: 25px; flex-wrap: wrap; }
.page-btn { background-color: var(--bg-card); color: white; border: 1px solid #444; padding: 10px 16px; border-radius: 30px; cursor: pointer; font-size: 0.9rem; }
.page-btn.active { background-color: var(--porsche-red); border-color: var(--porsche-red); font-weight: bold; }