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

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: #f8fafc;
  color: #334155;
  min-height: 100dvh;
}

/* â”€â”€ TOPBAR â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  height: 60px;
  background: #0f172a;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

/* Left zone â€” back arrow */
.topbar-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  z-index: 1;
  min-width: 44px;
}

/* Center zone â€” tournament title, truly centered */
.topbar-middle {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 180px);
  display: flex;
  align-items: center;
  pointer-events: none;
}
.topbar-middle a,
.topbar-middle span { pointer-events: auto; }

/* Right zone â€” avatar + hamburger */
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  z-index: 1;
}

.topbar-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.6);
  text-decoration: none;
  font-size: 16px;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: background .15s, color .15s;
}
.topbar-back:hover { background: rgba(255,255,255,.13); color: #fff; }

.topbar-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  letter-spacing: -.01em;
}
a.topbar-title:hover { color: rgba(255,255,255,.8); }

/* â”€â”€ Hamburger â”€â”€ */
.topbar-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  background: rgba(255,255,255,.07);
  border: none;
  color: rgba(255,255,255,.65);
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.topbar-hamburger:hover { background: rgba(255,255,255,.13); color: #fff; }

/* â”€â”€ Avatar / dropdown â”€â”€ */
.topbar-profile { position: relative; }

.topbar-create-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: background .15s, transform .08s;
}

.topbar-create-btn:hover {
  background: #1d4ed8;
}

.topbar-create-btn:active {
  transform: translateY(1px);
}

.topbar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #1e3a5f;
  border: 2px solid rgba(255,255,255,.15);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .2s;
  flex-shrink: 0;
  user-select: none;
}
.topbar-avatar:hover { border-color: rgba(255,255,255,.4); }
.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }

.topbar-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  min-width: 168px;
  overflow: hidden;
  z-index: 500;
}
.topbar-dropdown.open { display: block; }

.topbar-dropdown-user {
  padding: 12px 16px 10px;
  border-bottom: 1px solid #e2e8f0;
}
.topbar-dropdown-name  { font-size: 13px; font-weight: 700; color: #1e293b; }
.topbar-dropdown-email {
  font-size: 11px; color: #64748b; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px;
}

.topbar-dropdown a {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  font-size: 13px;
  color: #334155;
  text-decoration: none;
  transition: background .15s;
}
.topbar-dropdown a:hover { background: #f8fafc; }
.topbar-dropdown a.danger { color: #dc2626; }
.topbar-dropdown a.danger:hover { background: #fef2f2; }

/* â”€â”€ SIDEBAR â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 149;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.sidebar-backdrop.open { display: block; }

.sidebar {
  position: fixed;
  top: 60px;
  left: 0;
  bottom: 0;
  width: 220px;
  background: #0f172a;
  border-right: 1px solid rgba(255,255,255,.06);
  z-index: 150;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 12px 0 32px;
  transition: transform .28s ease;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: rgba(255,255,255,.5);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
}
.sidebar-nav li a:hover {
  color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.05);
}
.sidebar-nav li a.active {
  color: #fff;
  background: rgba(37,99,235,.2);
  border-left-color: #2563eb;
  font-weight: 600;
}

.sidebar-nav li a.is-disabled,
.sidebar-nav li a.is-disabled:hover {
  color: rgba(255,255,255,.28);
  background: transparent;
  border-left-color: transparent;
  cursor: not-allowed;
  pointer-events: none;
}

.sidebar-nav li a .nav-icon {
  font-size: 14px;
  width: 18px;
  flex-shrink: 0;
  text-align: center;
}

.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,.06);
  margin: 8px 16px;
}

.sidebar-install {
  margin-top: auto;
  padding-bottom: 8px;
}

.sidebar-install-btn {
  width: calc(100% - 32px);
  margin: 12px 16px 0;
  padding: 11px 14px;
  border: 1px solid rgba(96,165,250,.28);
  border-radius: 12px;
  background: rgba(37,99,235,.18);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}

.sidebar-install-btn:hover {
  background: rgba(37,99,235,.28);
  border-color: rgba(147,197,253,.42);
  transform: translateY(-1px);
}

/* â”€â”€ CONTENT â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.content {
  margin-left: 220px;
  padding: 28px 28px 64px;
  min-height: calc(100dvh - 60px);
}

/* â”€â”€ MOBILE â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 768px) {
  .topbar {
    gap: 10px;
    padding: 0 12px;
  }

  .topbar-left,
  .topbar-middle,
  .topbar-right {
    min-width: 0;
  }

  .topbar-middle {
    position: static;
    left: auto;
    transform: none;
    flex: 1 1 auto;
    max-width: none;
    justify-content: flex-start;
    overflow: hidden;
    pointer-events: auto;
  }

  .topbar-title {
    display: block;
    max-width: 100%;
  }

  .topbar-right {
    gap: 6px;
  }

  .topbar-create-btn {
    height: 32px;
    padding: 0 10px;
    font-size: 11px;
  }

  .topbar-hamburger { display: flex; }

  .sidebar {
    transform: translateX(-100%);
    width: 240px;
    top: 60px;
  }
  .sidebar.open { transform: translateX(0); }

  .content {
    margin-left: 0;
    padding: 20px 16px 60px;
  }
}
