* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: #0f1115;
  color: #e8e8ec;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; background: #161922; border-bottom: 1px solid #262b38;
  position: sticky; top: 0; z-index: 10; flex-wrap: wrap; gap: 10px;
}
.brand { font-weight: 700; font-size: 18px; }
.nav { display: flex; gap: 18px; }
.nav a { opacity: .85; font-weight: 600; font-size: 15px; }
.nav a:hover { opacity: 1; color: #4ade80; }

.admin-area { display: flex; align-items: center; gap: 10px; }
.admin-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: #4ade80; font-weight: 600; }

.btn {
  border: none; border-radius: 10px; padding: 11px 18px; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: transform .05s ease, opacity .15s ease;
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:active { transform: scale(.96); }
.btn-primary { background: #4ade80; color: #08210f; }
.btn-primary:hover { opacity: .9; }
.btn-ghost { background: #232733; color: #e8e8ec; border: 1px solid #333949; }
.btn-ghost:hover { background: #2b3040; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-sm { padding: 8px 12px; font-size: 13px; min-height: 36px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.link-btn { background: none; border: none; color: #f87171; cursor: pointer; font-size: 13px; padding: 4px; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }

.icon-btn {
  display: inline-flex; align-items: center; gap: 5px; border: 1px solid #333949; background: #1b1f29;
  color: #e8e8ec; border-radius: 8px; padding: 7px 11px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.icon-btn:hover { background: #232733; }
.icon-btn.danger { color: #f87171; border-color: #4a2a2a; }
.icon-btn.danger:hover { background: #2a1717; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.container { max-width: 1000px; margin: 0 auto; padding: 20px 16px 60px; }
.footer { text-align: center; padding: 24px; color: #666; font-size: 13px; }

.dashboard-strip {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 20px;
}
.dash-card {
  background: #161922; border: 1px solid #262b38; border-radius: 10px;
  padding: 14px 10px; text-align: center;
}
.dash-num { font-size: 22px; font-weight: 700; color: #4ade80; }
.dash-label { font-size: 12px; color: #9aa1b1; margin-top: 4px; }

.panel { background: #161922; border: 1px solid #262b38; border-radius: 12px; padding: 18px; margin-bottom: 20px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.panel-header h2 { margin: 0; font-size: 18px; }

/* Admin-only elementler default gizlidir, <body class="is-admin"> olduqda gorunur */
.admin-only, .admin-cell { display: none; }
body.is-admin .admin-only { display: flex; gap: 8px; flex-wrap: wrap; }
body.is-admin .admin-cell { display: table-cell; }

.form-error { color: #f87171; font-size: 13px; margin-top: 6px; }

.table-wrap { overflow-x: auto; }
.standings-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.standings-table th, .standings-table td { padding: 10px 8px; text-align: center; border-bottom: 1px solid #232733; }
.standings-table thead th { color: #9aa1b1; font-weight: 700; font-size: 12px; text-transform: uppercase; }
.col-team { text-align: left !important; min-width: 170px; }
.team-link { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.team-link:hover { color: #4ade80; }
.xal-cell { font-weight: 800; color: #4ade80; font-size: 15px; }
.col-form { font-size: 13px; letter-spacing: 1px; }
.empty-row { text-align: center; color: #9aa1b1; padding: 28px 12px; font-size: 15px; line-height: 1.6; }

.logo-sm { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.logo-placeholder { display: inline-block; border-radius: 50%; }
.logo-lg { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; }

.round-title { margin: 22px 0 10px; font-size: 15px; color: #9aa1b1; font-weight: 700; }
.game-list { display: flex; flex-direction: column; gap: 10px; }
.game-row {
  background: #0f1115; border: 1px solid #232733; border-radius: 12px;
  padding: 14px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
.game-teams { display: flex; align-items: center; gap: 10px; font-weight: 700; flex: 1; min-width: 220px; font-size: 15px; }
.game-team { display: flex; align-items: center; gap: 6px; flex: 1; }
.game-teams .game-team:last-child { justify-content: flex-end; text-align: right; }
.game-score { min-width: 60px; text-align: center; color: #4ade80; font-weight: 800; font-size: 16px; }
.game-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #9aa1b1; }
.status-badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.status-BITIB { background: #14321f; color: #4ade80; }
.status-OYNANIR { background: #3a2e12; color: #fbbf24; }
.status-OYNANMAYIB { background: #232733; color: #9aa1b1; }
.game-admin { align-items: center; gap: 6px; width: 100%; justify-content: flex-end; }

.team-profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.muted { color: #9aa1b1; margin: 2px 0; }
.form-line { font-size: 14px; }

/* ---- Modal (popup) ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.65);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px;
}
.modal { background: #161922; border: 1px solid #262b38; border-radius: 16px; padding: 24px; width: 100%; max-width: 340px; max-height: 90vh; overflow-y: auto; }
.modal-wide { max-width: 420px; }
.modal h3 { margin: 0 0 6px; font-size: 19px; }
.modal input, .modal select { width: 100%; padding: 11px; border-radius: 9px; border: 1px solid #333949; background: #0f1115; color: #e8e8ec; font-size: 15px; }
.modal input[type=color] { padding: 3px; height: 44px; }
.modal input[type=file] { padding: 8px; font-size: 13px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.error-text { color: #f87171; font-size: 13px; }

.field { margin: 12px 0; }
.field label { display: block; font-size: 13px; color: #9aa1b1; font-weight: 600; margin-bottom: 5px; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }

.date-field-wrap { position: relative; display: block; }
.date-input { width: 100%; cursor: pointer; }
.date-native-hidden { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; border: none; padding: 0; margin: 0; left: 0; top: 0; }

.time-select-row { display: flex; align-items: center; gap: 8px; }
.time-select-row select { flex: 1; }

.crop-frame {
  height: 240px; margin-top: 10px; border-radius: 10px; overflow: hidden;
  background: #000; border: 1px solid #333949;
}
.crop-frame img { display: block; max-width: 100%; }
.crop-hint { font-size: 12px; margin-top: 6px; }
.logo-preview-current { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 13px; color: #9aa1b1; }

.score-fields { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 18px 0; }
.score-fields .team-name { font-weight: 700; text-align: center; flex: 1; font-size: 14px; }
.score-fields input { width: 70px; text-align: center; font-size: 24px; font-weight: 800; padding: 10px; }
.score-fields .vs { font-size: 18px; color: #9aa1b1; font-weight: 700; }

/* ---- Toast ---- */
.toast-container {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
  width: 100%; padding: 0 16px; pointer-events: none;
}
.toast {
  background: #1f2430; color: #e8e8ec; border: 1px solid #333949; border-radius: 12px;
  padding: 12px 18px; font-size: 14px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.4);
  animation: toast-in .2s ease-out; max-width: 100%;
}
.toast.success { border-color: #24513a; color: #4ade80; }
.toast.error { border-color: #532323; color: #f87171; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  .dashboard-strip { grid-template-columns: repeat(3, 1fr); }
  .topbar { justify-content: center; text-align: center; }
  .nav { justify-content: center; }
  .field-row { flex-direction: column; gap: 0; }
  .row-actions { justify-content: flex-start; width: 100%; }
}
