:root {
  --orange: #FF6B00;
  --orange-hover: #E05500;
  --orange-light: rgba(255, 107, 0, 0.1);
  --blue: #003399;
  --blue-dark: #002266;
  --white: #FFFFFF;
  --bg: #0F172A;
  --card-bg: rgba(30, 41, 59, 0.7);
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #F8FAFC;
  --text-muted: #94A3B8;
  --border: rgba(255, 255, 255, 0.1);
  --green: #10B981;
  --green-light: rgba(16, 185, 129, 0.15);
  --red: #EF4444;
  --red-light: rgba(239, 68, 68, 0.15);
  --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  --glass: backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at top, #1E293B 0%, #0F172A 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  padding-top: 6px;
  padding-bottom: 60px;
}

/* Dutch Flag Header Accent */
.app-header {
  background: linear-gradient(to right, #C8102E 0%, #C8102E 33.3%, #FFFFFF 33.3%, #FFFFFF 66.6%, #003C8F 66.6%, #003C8F 100%);
  height: 6px;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
}

.header {
  background: rgba(15, 23, 42, 0.85);
  --glass;
  border-bottom: 1px solid var(--card-border);
  color: white;
  padding: 18px 24px;
  position: sticky;
  top: 6px;
  z-index: 100;
}

.header-container {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, #FF6B00 0%, #FFA500 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sub {
  font-size: 13px;
  color: var(--text-muted);
}

.header-nav {
  display: flex;
  gap: 8px;
}

.header-nav button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-nav button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.header-nav button.active {
  background: var(--orange);
  border-color: var(--orange);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 107, 0, 0.3);
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px 12px;
  animation: fadeIn 0.4s ease;
}

.phase-banner {
  font-size: 13px;
  color: var(--orange);
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--orange-light);
  padding: 8px 12px;
  border-radius: 8px;
  border-left: 3px solid var(--orange);
}

.card {
  background: var(--card-bg);
  --glass;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.match-card {
  background: var(--card-bg);
  --glass;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.match-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 107, 0, 0.3);
}

.round-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.teams {
  font-size: 19px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 4px;
}

.meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
  align-items: center;
}

.closed {
  color: var(--red);
  background: var(--red-light);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.split-score {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.split-score input {
  width: 54px;
  padding: 8px;
  background: rgba(15, 23, 42, 0.6);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--white);
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s;
}

.split-score input:focus {
  border-color: var(--orange);
}

.split-score .vs {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.save-split-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: var(--orange);
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.save-split-btn:hover {
  background: var(--orange-hover);
  box-shadow: 0 4px 12px rgba(255, 107, 0, 0.2);
}

.ft-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.ft-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.ht-section {
  margin-top: 12px;
}

.ht-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.result-display {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.result-display strong {
  color: var(--white);
  font-size: 17px;
}

.result-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  margin-left: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.result-badge.exact {
  background: var(--green-light);
  color: var(--green);
}

.result-badge.trend {
  background: var(--orange-light);
  color: var(--orange);
}

.result-badge.wrong {
  background: var(--red-light);
  color: var(--red);
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-align: center;
}

.btn-primary {
  background: var(--orange);
  color: white;
  width: 100%;
}

.btn-primary:hover {
  background: var(--orange-hover);
  box-shadow: 0 4px 14px rgba(255, 107, 0, 0.3);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--orange);
  color: var(--orange);
}

.btn-outline:hover {
  background: var(--orange-light);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
  width: auto;
  border-radius: 8px;
}

.btn-danger {
  background: var(--red);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 14px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

.status-bar {
  background: var(--orange-light);
  border: 1px solid rgba(255, 107, 0, 0.2);
  color: var(--white);
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
}

.pool-status {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.stat {
  flex: 1;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat .num {
  font-size: 26px;
  font-weight: 800;
  color: var(--orange);
}

.stat .label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.toast {
  position: fixed;
  top: 75px;
  right: 16px;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  z-index: 9999;
  display: none;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  animation: slideIn 0.3s ease;
}

.toast.success {
  background: var(--green);
  color: white;
  display: block;
}

.toast.error {
  background: var(--red);
  color: white;
  display: block;
}

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

.rank-item:last-child {
  border: none;
}

.rank-pos {
  font-weight: 800;
  color: var(--orange);
  min-width: 30px;
  font-size: 16px;
}

.rank-name {
  font-weight: 600;
  flex: 1;
  font-size: 15px;
  color: var(--white);
}

.rank-points {
  font-weight: 800;
  color: var(--orange);
  font-size: 16px;
}

.rank-detail {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: -6px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding-bottom: 8px;
}

.admin-section {
  margin-bottom: 18px;
}

.admin-section h3 {
  font-size: 16px;
  margin-bottom: 12px;
  color: var(--orange);
  font-weight: 800;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

th, td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

th {
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  color: var(--white);
}

.auth-form {
  max-width: 380px;
  margin: 60px auto;
  background: var(--card-bg);
  --glass;
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 30px;
  box-shadow: var(--shadow);
}

.auth-form h2 {
  text-align: center;
  margin-bottom: 8px;
  font-weight: 800;
  font-size: 24px;
  background: linear-gradient(135deg, #FF6B00 0%, #FFA500 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-form input {
  width: 100%;
  padding: 12px;
  margin-bottom: 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--white);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.auth-form input:focus {
  border-color: var(--orange);
}

.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 16px;
  cursor: pointer;
}

.auth-switch span {
  color: var(--orange);
  font-weight: 600;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  --glass;
  z-index: 500;
  display: none;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.25s ease;
}

.overlay.show {
  display: flex;
}

.popup {
  background: #1E293B;
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.close-btn {
  float: right;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s;
}

.close-btn:hover {
  color: var(--white);
}

#fund-content input {
  background: rgba(15, 23, 42, 0.6);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--white);
  outline: none;
}

#fund-content input:focus {
  border-color: var(--orange);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

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