:root {
    --black: #000000;
    --red: #DD0000;
    --gold: #FFCC00;
    --dark: #1a1a2e;
    --darker: #0f0f1a;
    --card-bg: #16213e;
    --card-border: #1a3a5c;
    --text: #e0e0e0;
    --text-light: #a0a0a0;
    --success: #27ae60;
    --warning: #f39c12;
    --error: #e74c3c;
    --info: #3498db;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; background: var(--darker); color: var(--text); line-height: 1.6; min-height: 100vh; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

.header { background: linear-gradient(135deg, var(--black), #1a0000); border-bottom: 3px solid var(--red); position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow); }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 0 1rem; display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-size: 1.4rem; font-weight: 700; color: var(--gold); text-decoration: none; white-space: nowrap; }
.nav-toggle { display: none; background: none; border: 2px solid var(--gold); color: var(--gold); font-size: 1.5rem; cursor: pointer; padding: 4px 10px; border-radius: var(--radius); line-height: 1; }
.nav-links { display: flex; align-items: center; gap: 0.5rem; }
.nav-links a { color: var(--text); padding: 0.5rem 0.75rem; border-radius: var(--radius); font-size: 0.9rem; transition: background 0.2s; white-space: nowrap; }
.nav-links a:hover, .nav-links a.active { background: rgba(221, 0, 0, 0.3); color: #fff; text-decoration: none; }
.nav-logout { color: var(--error) !important; border-left: 1px solid rgba(255,255,255,0.1); margin-left: 0.5rem; padding-left: 1rem !important; }

main { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem; min-height: calc(100vh - 60px); }
.container { width: 100%; }

.alert { padding: 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.95rem; }
.alert-success { background: rgba(39, 174, 96, 0.2); border-left: 4px solid var(--success); }
.alert-error { background: rgba(231, 76, 60, 0.2); border-left: 4px solid var(--error); }
.alert-warning { background: rgba(243, 156, 18, 0.2); border-left: 4px solid var(--warning); }
.alert-info { background: rgba(52, 152, 219, 0.2); border-left: 4px solid var(--info); }
.alert a { color: #fff; text-decoration: underline; }

.btn { display: inline-block; padding: 0.6rem 1.2rem; border: none; border-radius: var(--radius); font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: all 0.2s; text-align: center; min-height: 44px; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: #ff1a1a; transform: translateY(-1px); }
.btn-secondary { background: var(--card-bg); color: var(--text); border: 1px solid var(--card-border); }
.btn-secondary:hover { background: var(--card-border); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-small { padding: 0.4rem 0.8rem; font-size: 0.85rem; min-height: 36px; }
.btn-block { display: block; width: 100%; }
.btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.3rem; font-weight: 600; font-size: 0.9rem; color: var(--gold); }
.form-group input, .form-group select { width: 100%; padding: 0.6rem 0.8rem; border: 1px solid var(--card-border); border-radius: var(--radius); background: var(--darker); color: var(--text); font-size: 1rem; min-height: 44px; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255, 204, 0, 0.2); }
.form-group small { display: block; margin-top: 0.3rem; font-size: 0.8rem; color: var(--text-light); }
.form-select { width: 100%; padding: 0.6rem 0.8rem; border: 1px solid var(--card-border); border-radius: var(--radius); background: var(--darker); color: var(--text); font-size: 1rem; min-height: 44px; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 120px; }
.form-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-lg); padding: 1.5rem; max-width: 500px; }

/* Pott-Banner */
.pot-banner { background: linear-gradient(135deg, #1a472a, #0d2818); border: 2px solid var(--gold); border-radius: var(--radius-lg); padding: 1.5rem; text-align: center; margin-bottom: 1.5rem; box-shadow: 0 0 20px rgba(255, 204, 0, 0.15); }
.pot-main { display: flex; align-items: center; justify-content: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.pot-emoji { font-size: 2.5rem; }
.pot-amount { font-size: 2.5rem; font-weight: 700; color: var(--gold); }
.pot-label { font-size: 1.2rem; color: var(--text-light); }
.pot-details { font-size: 0.85rem; color: var(--text-light); display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }

.welcome-banner h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1.5rem 0; }
.stat-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-lg); padding: 1.2rem; text-align: center; box-shadow: var(--shadow); }
.stat-number { font-size: 2rem; font-weight: 700; color: var(--gold); }
.stat-label { font-size: 0.85rem; color: var(--text-light); margin-top: 0.3rem; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 1.5rem; }
.col h2 { font-size: 1.2rem; color: var(--gold); margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--red); }

.match-list { display: flex; flex-direction: column; gap: 0.75rem; }
.match-item { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.match-item.finished { border-left: 3px solid var(--success); }
.match-item.upcoming { border-left: 3px solid var(--info); }
.match-type { font-size: 0.75rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.3rem; }
.match-opponent { font-size: 1.1rem; font-weight: 600; }
.match-date { font-size: 0.85rem; color: var(--text-light); margin-top: 0.3rem; }
.match-result { font-size: 1.3rem; font-weight: 700; margin-top: 0.5rem; }
.match-points { margin-top: 0.3rem; font-size: 0.9rem; }
.info-bar { background: rgba(52, 152, 219, 0.15); border: 1px solid rgba(52, 152, 219, 0.3); border-radius: var(--radius); padding: 0.75rem 1rem; font-size: 0.85rem; margin: 1rem 0; }
.empty { color: var(--text-light); font-style: italic; }
.tipp-info { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 0.75rem 1rem; margin-bottom: 1.5rem; font-size: 0.9rem; }

.match-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.tipp-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.tipp-card.finished { border-top: 3px solid var(--success); }
.tipp-card.upcoming { border-top: 3px solid var(--info); }
.tipp-card-header { background: rgba(0,0,0,0.2); padding: 0.5rem 1rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.8rem; }
.match-type-badge { background: var(--red); color: #fff; padding: 0.1rem 0.5rem; border-radius: 4px; font-weight: 600; }
.match-date-small { color: var(--text-light); }
.home-badge { background: var(--success); color: #fff; padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.7rem; }
.away-badge { background: var(--info); color: #fff; padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.7rem; }
.tipp-card-body { padding: 1rem; }
.tipp-teams { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 1rem; }
.tipp-team { text-align: center; flex: 1; }
.tipp-team .flag { font-size: 2rem; display: block; margin-bottom: 0.3rem; }
.tipp-team .team-name { font-weight: 600; font-size: 0.95rem; }
.tipp-vs { color: var(--text-light); font-weight: 700; font-size: 1.1rem; }
.tipp-form { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.tipp-inputs { display: flex; align-items: center; gap: 0.5rem; }
.tipp-input-group { text-align: center; }
.tipp-input-group label { display: block; font-size: 0.7rem; color: var(--text-light); margin-bottom: 0.2rem; }
.tipp-input-group input { width: 60px; padding: 0.5rem; text-align: center; border: 2px solid var(--card-border); border-radius: var(--radius); background: var(--darker); color: var(--text); font-size: 1.3rem; font-weight: 700; min-height: 48px; }
.tipp-input-group input:focus { border-color: var(--gold); outline: none; }
.tipp-colon { font-size: 1.5rem; font-weight: 700; color: var(--text-light); }
.tipp-result { text-align: center; padding: 0.5rem; }
.result-score { display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.score-num { font-size: 2.5rem; font-weight: 700; color: var(--gold); }
.score-sep { font-size: 2rem; color: var(--text-light); }
.tipp-comparison { text-align: center; margin-top: 0.5rem; font-size: 0.9rem; color: var(--text-light); }
.points-4 { color: var(--gold); }
.points-3 { color: var(--success); }
.points-2 { color: var(--info); }
.points-0 { color: var(--text-light); }

.ranking-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 1rem; }
.ranking-table, .admin-table, .detail-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.ranking-table th, .admin-table th, .detail-table th { background: var(--card-bg); color: var(--gold); padding: 0.75rem 0.5rem; text-align: left; border-bottom: 2px solid var(--red); white-space: nowrap; font-size: 0.85rem; }
.ranking-table td, .admin-table td, .detail-table td { padding: 0.6rem 0.5rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
.ranking-table tbody tr:hover, .admin-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.my-row { background: rgba(255, 204, 0, 0.08) !important; }
.my-row td { border-bottom-color: rgba(255, 204, 0, 0.2) !important; }
.you-badge { background: var(--gold); color: var(--black); padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.7rem; font-weight: 700; margin-left: 0.3rem; }
.rank-col { width: 50px; text-align: center; }
.num-col { width: 60px; text-align: center; }
.points-col { width: 80px; text-align: center; }
.detail-section { display: flex; flex-direction: column; gap: 1rem; }
.detail-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-lg); padding: 1rem; }
.detail-card h3 { color: var(--gold); font-size: 1.1rem; margin-bottom: 0.75rem; }
.detail-card h3 small { color: var(--text-light); font-weight: 400; }

.login-wrapper { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem; }
.login-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-lg); padding: 2rem; width: 100%; max-width: 400px; box-shadow: var(--shadow-lg); }
.login-header { text-align: center; margin-bottom: 1.5rem; }
.login-header h1 { font-size: 2rem; color: var(--gold); }
.login-header p { color: var(--text-light); }
.login-footer { text-align: center; margin-top: 1.5rem; color: var(--text-light); }

.admin-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.tab-btn { padding: 0.6rem 1.2rem; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); color: var(--text); cursor: pointer; font-size: 0.95rem; min-height: 44px; transition: all 0.2s; }
.tab-btn.active { background: var(--red); color: #fff; border-color: var(--red); }
.tab-content { display: none; }
.tab-content.active { display: block; }
.admin-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.5rem; }
.admin-card h2 { color: var(--gold); font-size: 1.2rem; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--card-border); }
.admin-card p { margin-bottom: 0.75rem; }
.status-info { margin-top: 1rem; padding: 0.75rem; background: rgba(0,0,0,0.2); border-radius: var(--radius); font-size: 0.9rem; }
.status-info p { margin-bottom: 0.3rem; }
.cron-output { background: var(--darker); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 1rem; margin-top: 1rem; font-family: 'Courier New', monospace; font-size: 0.85rem; overflow-x: auto; white-space: pre-wrap; max-height: 400px; overflow-y: auto; }

.result-badge { display: inline-block; padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; margin-left: 0.5rem; vertical-align: middle; }
.result-badge.win { background: var(--success); color: #fff; }
.result-badge.loss { background: var(--error); color: #fff; }
.result-badge.draw { background: var(--warning); color: #000; }

@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-links { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--dark); flex-direction: column; padding: 1rem; border-bottom: 3px solid var(--red); box-shadow: var(--shadow-lg); }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 0.75rem 1rem; width: 100%; border-radius: var(--radius); }
    .nav-logout { border-left: none !important; margin-left: 0 !important; padding-left: 1rem !important; border-top: 1px solid rgba(255,255,255,0.1); margin-top: 0.5rem; padding-top: 0.75rem !important; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .two-col { grid-template-columns: 1fr; }
    .match-cards { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; }
    .admin-tabs { flex-direction: column; }
    .tab-btn { width: 100%; text-align: center; }
    .btn-group { flex-direction: column; }
    .btn-group .btn { width: 100%; }
}

@media (max-width: 480px) {
    html { font-size: 15px; }
    main { padding: 1rem 0.75rem; }
    .header-inner { padding: 0 0.75rem; }
    .logo { font-size: 1.2rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    .stat-card { padding: 0.8rem; }
    .stat-number { font-size: 1.5rem; }
    .welcome-banner h1 { font-size: 1.2rem; }
    .pot-amount { font-size: 1.8rem; }
    .pot-emoji { font-size: 1.8rem; }
    .tipp-team .flag { font-size: 1.5rem; }
    .tipp-team .team-name { font-size: 0.85rem; }
    .tipp-input-group input { width: 50px; font-size: 1.1rem; }
    .score-num { font-size: 2rem; }
    .login-card { padding: 1.5rem; }
    .form-card { padding: 1rem; }
    .admin-card { padding: 1rem; }
    .ranking-table, .admin-table, .detail-table { font-size: 0.8rem; }
    .ranking-table th, .admin-table th, .detail-table th { padding: 0.5rem 0.3rem; }
    .ranking-table td, .admin-table td, .detail-table td { padding: 0.5rem 0.3rem; }
}

@media (max-height: 500px) and (orientation: landscape) {
    .login-wrapper { min-height: auto; padding: 1rem; }
    .header-inner { height: 50px; }
}

/* =============================================
   Footer
   ============================================= */
.site-footer {
    background: var(--dark);
    border-top: 2px solid var(--red);
    padding: 1rem;
    text-align: center;
    margin-top: 2rem;
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    color: var(--text-light);
    font-size: 0.85rem;
}
