:root {
  --surface: #0f172a;
  --panel: #111827;
  --card: #1f2937;
  --ink: #e5e7eb;
  --muted: #9ca3af;
  --accent: #22c55e;
  --accent-2: #60a5fa;
  --warning: #f59e0b;
}

html, body {
  height: 100%;
}

body {
  font-family: "Afacad", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: linear-gradient(180deg,#000000,#0a0a0a 50%, #0b0b0b 100%);
  color: var(--ink);
}

.app {
  max-width: 1400px;
  margin: 24px auto;
  padding: 16px;
}

.glass {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.shadow-soft {
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.panel {
  padding: 16px;
}

.bracket {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 10px;
  align-items: start;
  overflow: auto;
  padding: 0 12px 12px;
}

.round {
  min-width: 220px;
}

.round h5 {
  font-weight: 700;
  letter-spacing: .2px;
}

.match {
  background: #0e0e0e;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 8px;
  margin-bottom: 12px;
  position: relative;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

.round-grid .match {
  margin-bottom: 0;
}

.match-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  margin-bottom: 6px;
}

.match-body {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px;
}

.player {
  background: #121212;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

.player-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score {
  width: 48px;
  text-align: center;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: #0a0a0a;
  color: var(--ink);
  padding: 6px 8px;
}

.score:disabled {
  opacity: .5;
}

#playersList {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding-left: 0;
  margin: 0;
}

#playersList .chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  color: var(--ink);
  width: auto;
}

#playersList .chip:hover, #playersList .chip:focus, #playersList .chip.active {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
}

#playersList .chip-remove {
  appearance: none;
  border: 0;
  background: rgba(255,255,255,0.10);
  color: var(--ink);
  border-radius: 999px;
  width: 22px;
  height: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#playersList .chip-remove:hover {
  background: rgba(255,255,255,0.2);
}

#playersList .chip-name {
  max-width: 220px;
}

#playersList .chip-empty {
  padding: 4px 0;
}

.badge-pill {
  border-radius: 999px;
  padding: .25rem .6rem;
  font-size: .85rem;
}

.badge-board {
  background: rgba(34,197,94,.12);
  color: #86efac;
  border: 1px solid rgba(34,197,94,.3);
}

.badge-wait {
  background: rgba(148,163,184,.12);
  color: #e5e7eb;
  border: 1px solid rgba(148,163,184,.3);
}

.badge-bye {
  background: rgba(245,158,11,.12);
  color: #fde68a;
  border: 1px solid rgba(245,158,11,.3);
}

.muted {
  color: var(--muted);
}

.winner {
  outline: 2px solid var(--accent);
}

input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

.form-control, .form-select {
  background: #0a0a0a;
  color: var(--ink);
  border: 1px solid rgba(255,255,255,0.15);
}

.form-control:focus, .form-select:focus {
  background: #0a0a0a;
  color: var(--ink);
  border-color: var(--accent);
  box-shadow: 0 0 0 .2rem rgba(34,197,94,.25);
}

.btn-primary {
  background: linear-gradient(180deg,#2b2b2b,#1f1f1f);
  border: 1px solid rgba(255,255,255,0.18);
  color: #ffffff;
}

.btn-success {
  background: linear-gradient(180deg,#16a34a,#15803d);
  border: 1px solid rgba(255,255,255,0.18);
}

.tick {
  width: 18px;
  height: 18px;
  display: inline-block;
  border-radius: 999px;
  border: 2px solid var(--accent);
  margin-left: 8px;
  position: relative;
}

.tick::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 1px;
  width: 8px;
  height: 12px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(40deg);
}

.footer-note {
  font-size: .9rem;
  color: #9aa4b2;
}

#roundSettings .setting-card {
  margin-bottom: 12px;
}

#roundSettings .setting-card:last-child {
  margin-bottom: 0;
}

.panel-scroll {
  max-height: calc(100vh - 80px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.form-text.help {
  margin-top: .25rem;
  margin-bottom: .25rem;
  color: var(--ink) !important;
}

.match.winner {
  border-color: var(--accent, #22c55e);
  box-shadow: 0 0 0 2px rgba(34,197,94,.35) inset, 0 0 14px rgba(34,197,94,.25);
}

.group-card {
  min-width: 360px;
}

.group-round-block {
  margin-bottom: 14px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
}

.group-round-title {
  font-size: .95rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.ko-wrap {
  margin-top: 16px;
}

.ko-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.notice-card {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(245,158,11,.1);
  border: 1px solid rgba(245,158,11,.28);
  color: #fde68a;
}

#sidebarCol, #contentCol {
  transition: all .25s ease;
}

body.menu-collapsed #sidebarCol {
  display: none;
}

body.menu-collapsed #contentCol {
  flex: 0 0 100%;
  max-width: 100%;
  width: 100%;
}

.menu-toggle-btn {
  min-width: 44px;
}

.floating-menu-btn {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 1050;
  display: none;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

body.menu-collapsed .floating-menu-btn {
  display: inline-flex;
}

@media (max-width: 991.98px) {
  .floating-menu-btn {
    top: auto;
    bottom: 18px;
    left: 18px;
  }
}

:root {
  --navbar-height: 77.3px;
}

.menu-toggle-btn {
  min-width: 44px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-minimise-icon {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 12px;
}

.menu-minimise-icon::before, .menu-minimise-icon::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 2px;
}

.menu-minimise-icon::before {
  left: 0;
  width: 4px;
  background: rgba(255,255,255,0.9);
}

.menu-minimise-icon::after {
  right: 0;
  width: 9px;
  border: 2px solid rgba(255,255,255,0.9);
  border-left: 0;
}

.floating-menu-btn {
  position: fixed;
  top: calc(var(--navbar-height) + 18px);
  left: 18px;
  z-index: 1050;
  display: none;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

body.menu-collapsed .floating-menu-btn {
  display: inline-flex;
}

@media (max-width: 991.98px) {
  .floating-menu-btn {
    top: calc(var(--navbar-height) + 12px);
    bottom: auto;
    left: 12px;
  }
}

