/* ===== Group + Knockout Tool styles ===== */

.gk-root {
  min-height: 100vh;
  background: var(--bg, #f9fafb);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.gk-header {
  background: #fff;
  border-bottom: 1.5px solid var(--border, #e5e7eb);
  padding: 20px 32px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.gk-header-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.gk-tour-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.5px;
  margin: 0 0 4px;
}
.gk-tour-name-inp {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.5px;
  border: none;
  outline: none;
  border-bottom: 2px solid transparent;
  padding: 2px 0;
  width: 100%;
  max-width: 360px;
  background: transparent;
  transition: border-color .2s;
}
.gk-tour-name-inp:focus { border-bottom-color: #7C3AED; }
.gk-tour-meta {
  font-size: 13px;
  color: var(--muted, #6b7280);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.gk-game-sel {
  font-size: 12px !important;
  padding: 3px 8px !important;
  height: auto !important;
}
.gk-header-actions { display: flex; gap: 8px; }

/* ── Body ───────────────────────────────────────────────────────────────── */
.gk-body {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

/* ── Phase bar ──────────────────────────────────────────────────────────── */
.gk-phase-bar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 16px;
  padding: 8px 14px;
  margin-bottom: 28px;
}
.gk-phase-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 20px;
  border-radius: 10px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #111827);
  cursor: pointer;
  transition: background .18s, color .18s;
}
.gk-phase-btn.on {
  background: linear-gradient(135deg, #7C3AED, #EC4899);
  color: #fff;
}
.gk-phase-btn:hover:not(.on):not(.disabled) { background: #f3f4f6; }
.gk-phase-btn.disabled { opacity: .45; cursor: default; }
.gk-phase-ico { font-size: 15px; }
.gk-phase-arrow { color: #c4b5fd; font-size: 20px; font-weight: 300; }
.gk-phase-lock  { font-size: 11px; }

/* ── Groups grid ────────────────────────────────────────────────────────── */
.gk-groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

/* ── Group card ─────────────────────────────────────────────────────────── */
.gk-group-card {
  background: #fff;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 18px;
  overflow: hidden;
  transition: box-shadow .2s;
}
.gk-group-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,.07); }
.gk-group-done { border-color: #c4b5fd; }

.gk-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: linear-gradient(135deg, #f5f3ff 0%, #fdf4ff 100%);
}
.gk-group-name {
  font-size: 14px;
  font-weight: 800;
  color: #6d28d9;
  display: flex;
  align-items: center;
  gap: 8px;
}
.gk-done-pill {
  background: #d1fae5;
  color: #065f46;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  letter-spacing: .04em;
}
.gk-group-tabs { display: flex; gap: 4px; }
.gk-gtab {
  padding: 4px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--border, #e5e7eb);
  background: #fff;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted, #6b7280);
  cursor: pointer;
  transition: all .18s;
}
.gk-gtab.on { background: #7C3AED; border-color: #7C3AED; color: #fff; }

/* ── Standings table ────────────────────────────────────────────────────── */
.gk-table-wrap { overflow-x: auto; }
.gk-st-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.gk-st-table th, .gk-st-table td {
  padding: 7px 8px;
  text-align: center;
  border-bottom: 1px solid #f3f4f6;
}
.gk-st-table th {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted, #6b7280);
  background: #fafafa;
  cursor: default;
}
.gk-th-team { text-align: left !important; min-width: 120px; }
.gk-th-pts  { min-width: 32px; }
.gk-td-team { display: flex; align-items: center; gap: 7px; text-align: left; }
.gk-td-rank { width: 28px; }
.gk-td-pts  { font-size: 14px; }
.gk-flag    { font-size: 17px; flex-shrink: 0; }
.gk-flag img.emoji { width: 1.1em; height: 1.1em; vertical-align: -0.15em; }
.gk-team-name { font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.gk-dim { color: var(--muted); font-style: italic; font-weight: 400; }
.gk-q-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, #7C3AED, #EC4899);
  color: #fff; font-size: 10px; font-weight: 800;
}
.gk-rank-num { font-size: 12px; color: var(--muted); font-weight: 600; }
.gk-qualifier { background: #faf5ff; }
.gk-qualifier td { border-bottom-color: #ede9fe; }
.gk-pos { color: #16a34a; font-weight: 700; }
.gk-neg { color: #dc2626; font-weight: 700; }

/* ── Match rows ─────────────────────────────────────────────────────────── */
.gk-matches-list { padding: 4px 0; }
.gk-match-row {
  display: flex;
  align-items: center;
  padding: 7px 14px;
  gap: 8px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 12.5px;
  transition: background .15s;
}
.gk-match-row:last-child  { border-bottom: none; }
.gk-match-row:hover       { background: #fafafa; }
.gk-match-row.gk-played   { background: #f0fdf4; }
.gk-match-row.gk-played:hover { background: #dcfce7; }
.gk-match-team { flex: 1; font-weight: 600; font-size: 12px; line-height: 1.3; }
.gk-home { text-align: right; }
.gk-away { text-align: left;  }
.gk-score-cell {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 84px;
  justify-content: center;
  flex-shrink: 0;
}
.gk-score-inp {
  width: 34px; height: 30px;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 7px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  outline: none;
  transition: border .18s;
  -moz-appearance: textfield;
  color: var(--text);
}
.gk-score-inp::-webkit-outer-spin-button,
.gk-score-inp::-webkit-inner-spin-button { -webkit-appearance: none; }
.gk-score-inp:focus { border-color: #7C3AED; box-shadow: 0 0 0 3px #ede9fe; }
.gk-colon     { font-size: 14px; font-weight: 800; color: var(--muted); }
.gk-score-txt { font-size: 14px; font-weight: 800; min-width: 60px; text-align: center; }
.gk-match-row { flex-wrap: wrap; }
.gk-match-time {
  display: flex; align-items: center; gap: 4px;
  width: 100%; padding: 4px 0 0; font-size: 11px; color: var(--muted);
}
.gk-time-inp {
  border: 1px solid #e5e7eb; border-radius: 5px; padding: 2px 6px;
  font-size: 11px; color: var(--text); outline: none; background: #fafafa;
  flex: 1;
}
.gk-time-inp:focus { border-color: #7C3AED; background: #fff; }
.gk-match-time-display {
  width: 100%; font-size: 11px; color: var(--muted); padding-top: 3px;
}

/* ── Advance card ───────────────────────────────────────────────────────── */
.gk-advance-wrap { margin-top: 36px; display: flex; justify-content: center; }
.gk-advance-card {
  background: linear-gradient(135deg, #f5f3ff, #fdf4ff);
  border: 2px solid #c4b5fd;
  border-radius: 22px;
  padding: 36px 48px;
  text-align: center;
  max-width: 520px;
  width: 100%;
}
.gk-advance-title { font-size: 21px; font-weight: 800; margin-bottom: 12px; }
.gk-advance-card p { color: var(--muted); margin: 0 0 24px; font-size: 14px; line-height: 1.6; }
.gk-advance-btn { font-size: 15px !important; padding: 13px 30px !important; }

/* ── Empty states ───────────────────────────────────────────────────────── */
.gk-empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--muted);
}
.gk-empty-ico    { font-size: 52px; margin-bottom: 18px; }
.gk-empty-state h3 { font-size: 19px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.gk-empty-state p  { font-size: 14px; max-width: 360px; margin: 0 auto; line-height: 1.6; }
.gk-empty-msg { text-align: center; color: var(--muted); padding: 18px; font-size: 13px; }

/* ── Quick setup ────────────────────────────────────────────────────────── */
.gk-quick-setup { max-width: 500px; margin: 40px auto; }
.gk-qs-sub { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.gk-qs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}
.gk-qs-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.gk-qs-summary {
  text-align: center;
  background: #f5f3ff;
  border: 1.5px solid #ddd6fe;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  color: #7C3AED;
  margin-bottom: 22px;
}

/* ── Team name editor ───────────────────────────────────────────────────── */
.gk-team-editors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.gk-team-editor {
  background: #fff;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 14px;
  padding: 16px;
}
.gk-te-head {
  font-size: 12px;
  font-weight: 800;
  color: #7C3AED;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 12px;
}
.gk-te-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.gk-te-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: #f3f4f6;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; flex-shrink: 0; color: var(--muted);
}
.gk-flag-inp { max-width: 58px !important; text-align: center; font-size: 16px !important; }

/* ── Phase bar tweak ─────────────────────────────────────────────────────── */
.gk-phase-new { font-size: 13px; color: #a78bfa; font-weight: 800; }

/* ── Knockout toolbar ────────────────────────────────────────────────────── */
.gk-ko-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 20px; padding: 12px 18px;
  background: #fff; border: 1.5px solid var(--border, #e5e7eb); border-radius: 14px;
}
.gk-ko-info  { font-size: 13px; color: var(--muted, #6b7280); font-weight: 600; }
.gk-ko-btns  { display: flex; gap: 8px; }

/* ── Knockout seeder ─────────────────────────────────────────────────────── */
.gk-seeder {
  background: #fff;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 20px;
  overflow: hidden;
}
.gk-seeder-hd {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; padding: 20px 24px;
  border-bottom: 1.5px solid var(--border, #e5e7eb);
  background: linear-gradient(135deg, #f5f3ff 0%, #fdf4ff 100%);
  flex-wrap: wrap;
}
.gk-seeder-title { font-size: 17px; font-weight: 800; margin-bottom: 4px; }
.gk-seeder-sub   { font-size: 12.5px; color: var(--muted, #6b7280); }
.gk-seeder-hd-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

.gk-seeder-bd    { display: flex; min-height: 400px; }
.gk-seeder-left  {
  width: 310px; flex-shrink: 0; padding: 18px 16px;
  border-right: 1.5px solid var(--border, #e5e7eb);
  overflow-y: auto; max-height: 540px;
}
.gk-seeder-right {
  flex: 1; padding: 18px 16px;
  overflow-y: auto; max-height: 540px;
}

.gk-seeder-panel-title {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted, #6b7280);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.gk-seeder-count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: #7C3AED; color: #fff; border-radius: 100px;
  font-size: 10px; font-weight: 800; padding: 1px 7px;
}
.gk-seeder-bracket-hint {
  font-weight: 500; text-transform: none; letter-spacing: 0;
  color: #7C3AED; font-size: 11px;
}
.gk-seeder-empty-hint {
  text-align: center; color: var(--muted, #6b7280); padding: 32px 12px;
  font-size: 13px; border: 1.5px dashed #e5e7eb; border-radius: 12px;
}

/* Seed list */
.gk-seeds-list   { display: flex; flex-direction: column; gap: 4px; }
.gk-seed-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px; border-radius: 10px;
  border: 1.5px solid #f3f4f6; background: #fafafa;
  transition: all .15s;
}
.gk-seed-item:hover { border-color: #ddd6fe; background: #faf5ff; }
.gk-seed-n {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #7C3AED, #EC4899);
  color: #fff; font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.gk-seed-info  { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.gk-seed-name  { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gk-seed-ctrl  { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.gk-seed-mv {
  width: 22px; height: 22px; border-radius: 6px;
  border: 1.5px solid #e5e7eb; background: #fff;
  font-size: 11px; cursor: pointer; color: var(--muted, #6b7280);
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.gk-seed-mv:hover:not(:disabled) { background: #f3f4f6; border-color: #7C3AED; color: #7C3AED; }
.gk-seed-mv:disabled { opacity: .3; cursor: default; }
.gk-seed-rm {
  width: 22px; height: 22px; border-radius: 6px;
  border: 1.5px solid #fecaca; background: #fff;
  font-size: 11px; cursor: pointer; color: #ef4444;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.gk-seed-rm:hover { background: #fef2f2; border-color: #ef4444; }

/* Team rows */
.gk-seeder-grp       { margin-bottom: 16px; }
.gk-seeder-grp-name  {
  font-size: 10.5px; font-weight: 800; color: #6d28d9;
  text-transform: uppercase; letter-spacing: .06em;
  padding: 4px 0 6px; border-bottom: 1.5px solid #f3f4f6; margin-bottom: 4px;
}
.gk-seeder-trow {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 8px; border-radius: 8px;
  cursor: pointer; transition: background .15s; font-size: 12.5px;
}
.gk-seeder-trow:hover     { background: #f5f3ff; }
.gk-seeder-trow.in        { background: #f0fdf4; }
.gk-seeder-trow.in:hover  { background: #dcfce7; }
.gk-seeder-pos   { width: 16px; font-size: 11px; color: var(--muted, #6b7280); font-weight: 700; flex-shrink: 0; }
.gk-seeder-tname { flex: 1; font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gk-seeder-tpts  { font-size: 11px; color: var(--muted, #6b7280); flex-shrink: 0; white-space: nowrap; }
.gk-seeder-in-badge {
  font-size: 10.5px; font-weight: 700; color: #16a34a;
  background: #dcfce7; border-radius: 100px; padding: 2px 8px;
  flex-shrink: 0; white-space: nowrap; transition: all .15s;
}
.gk-seeder-trow:hover .gk-seeder-in-badge { background: #fecaca; color: #dc2626; }
.gk-seeder-add-btn {
  font-size: 11px; font-weight: 700; color: #7C3AED;
  background: #f5f3ff; border-radius: 100px; padding: 2px 8px;
  flex-shrink: 0; transition: background .15s;
}
.gk-seeder-trow:hover .gk-seeder-add-btn { background: #ede9fe; }

/* Footer */
.gk-seeder-ft {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 24px;
  border-top: 1.5px solid var(--border, #e5e7eb); background: #fafafa;
  flex-wrap: wrap;
}
.gk-seeder-ft-info { font-size: 12.5px; color: var(--muted, #6b7280); flex: 1; text-align: center; min-width: 160px; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .gk-groups-grid { grid-template-columns: 1fr; }
  .gk-qs-grid     { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .gk-seeder-bd   { flex-direction: column; }
  .gk-seeder-left { width: 100%; border-right: none; border-bottom: 1.5px solid var(--border, #e5e7eb); max-height: 280px; }
}
@media (max-width: 600px) {
  .gk-body    { padding: 16px 12px 60px; }
  .gk-header  { padding: 14px 16px; }
  .gk-advance-card { padding: 24px 20px; }
  .gk-phase-bar { flex-wrap: wrap; }
  .gk-ko-toolbar { flex-wrap: wrap; gap: 8px; }
}
