.header {
  display: flex;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.header__left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header__center {
  flex: 1;
  text-align: center;
  min-width: 0;
  overflow: hidden;
  padding: 0 16px;
}

.header__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header__logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, #d4562a, #e2724a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
}

.header__logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.header__logo-text {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}
.header__logo-brand {
  color: #1e293b;
  text-transform: uppercase;
}
.header__logo-accent {
  color: #d4562a;
}

/* ----- Competition badge ----- */
.header__comp-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  background: #f1f5f9;
  font-weight: 600;
  font-size: 16px;
  color: #d4562a;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
}

.header__comp-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.header__comp-flag {
  width: 24px;
  height: 18px;
  border-radius: 3px;
  object-fit: cover;
  flex-shrink: 0;
}

.header__comp-code {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 18px;
  font-weight: 600;
  color: #d4562a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header__comp-city {
  font-weight: 700;
}

.header__comp-group {
  font-weight: 400;
  font-size: 13px;
  color: #64748b;
}

.header__comp-sep {
  font-weight: 400;
  color: #94a3b8;
}

/* Two-row competition display */
.header__comp-two {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.3;
}

.header__comp-row1 {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 16px;
  font-weight: 700;
  color: #d4562a;
  white-space: nowrap;
}

.header__comp-row2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 500;
  color: #64748b;
  white-space: nowrap;
}

/* Standalone: row1 is the championship name (larger), row2 has flag+city */
.header__comp-two--standalone .header__comp-row1 {
  font-size: 14px;
}
.header__comp-two--standalone .header__comp-row2 {
  font-size: 11px;
}

/* Desktop: show single-row, hide two-row. Mobile: opposite */
.header__comp-code--desktop { display: inline-flex; }
.header__comp-two--mobile { display: none; }

@media (max-width: 449px) {
  .header__comp-code--desktop { display: none; }
  .header__comp-two--mobile { display: inline-flex; }
  .header__comp-row1 { font-size: 12px; }
  .header__comp-row2 { font-size: 8px; }
  .header__comp-two--standalone .header__comp-row1 { font-size: 11px; }
  .header__comp-two--standalone .header__comp-row2 { font-size: 9px; }
}

/* ----- Language dropdown ----- */
.dropdown {
  position: relative;
  user-select: none;
}

.dropdown__trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  background: #f1f5f9;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  font-weight: 600;
  font-size: 14px;
  color: #d4562a;
}

.dropdown__trigger:hover {
  background: #e2e8f0;
}

.dropdown__arrow {
  color: #94a3b8;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.dropdown--open .dropdown__arrow {
  transform: rotate(180deg);
}

.dropdown__menu {
  display: none;
  position: absolute;
  top: 100%;
  margin-top: 4px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  min-width: 240px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  padding: 4px;
}

.dropdown--open .dropdown__menu {
  display: block;
}

.dropdown__menu::-webkit-scrollbar {
  width: 4px;
}

.dropdown__menu::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 2px;
}

.dropdown__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: #d4562a;
  cursor: pointer;
  transition: background 0.12s;
  text-decoration: none;
}

.dropdown__item:hover {
  background: rgba(212, 86, 42, 0.08);
}

.dropdown__item--active {
  background: rgba(212, 86, 42, 0.12);
  color: #d4562a;
}

.dropdown__item--disabled {
  color: #94a3b8;
  cursor: default;
}

.dropdown__item--disabled:hover {
  background: transparent;
}

.dropdown__item-title {
  font-weight: 600;
  font-size: 13px;
  color: #d4562a;
}

.dropdown__item-sub {
  font-size: 11px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 4px;
}

.dropdown__item-flag {
  width: 14px;
  height: 10px;
  border-radius: 1.5px;
  object-fit: cover;
}

.dropdown__lang-flag {
  width: 18px;
  height: 12px;
  border-radius: 2px;
  display: block;
  flex-shrink: 0;
}

/* Language dropdown */
.dropdown--lang .dropdown__menu {
  right: 0;
  min-width: 100px;
}

.dropdown--lang .dropdown__menu .dropdown__item {
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.03em;
  color: #64748b;
}

.dropdown--lang .dropdown__menu .dropdown__item--active {
  color: #d4562a;
}

.dropdown--lang .dropdown__trigger {
  padding: 6px 10px;
  background: transparent;
}

.dropdown--lang .dropdown__trigger:hover {
  background: #f1f5f9;
}

.header__search {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: #64748b;
  background: transparent;
  flex-shrink: 0;
  transition: background 0.15s;
}

.header__search:hover {
  background: #f1f5f9;
}

.header__search svg {
  width: 18px;
  height: 18px;
}

/* Sign-in button */
.header__signin {
  padding: 8px 20px;
  border-radius: 8px;
  background: linear-gradient(135deg, #d4562a, #e2724a);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.header__signin:hover {
  opacity: 0.9;
}

/* User block */
.header__user {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  white-space: nowrap;
  position: relative;
  background: #f1f5f9;
}

.header__user--clickable {
  cursor: pointer;
}

.header__user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4562a, #e2724a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  color: #fff;
}

.header__user-name {
  font-weight: 500;
  color: #d4562a;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header__user-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  min-width: 140px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.header__user-dropdown--open {
  display: block;
}

.header__user-dropdown-item {
  padding: 10px 16px;
  font-size: 13px;
  color: #d4562a;
  cursor: pointer;
  transition: background 0.15s;
}

.header__user-dropdown-item:hover {
  background: rgba(212, 86, 42, 0.06);
}

.header__user-dropdown-item:first-child {
  border-radius: 8px 8px 0 0;
}

.header__user-dropdown-item:last-child {
  border-radius: 0 0 8px 8px;
}

.header__user-dropdown-item--muted {
  color: #64748b;
  cursor: default;
  font-size: 12px;
}

.header__user-dropdown-item--muted:hover {
  background: transparent;
}

.header__user-dropdown-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 4px 0;
}

/* Mobile */
@media (max-width: 449px) {
  .header {
    padding: 10px 16px;
  }

  .header__logo-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
    border-radius: 8px;
  }

  .header__logo-text {
    display: none;
  }

  .header__comp-row1 { font-size: 12px; }
  .header__comp-row2 { font-size: 8px; }
  .header__comp-two--standalone .header__comp-row1 { font-size: 11px; }
  .header__comp-two--standalone .header__comp-row2 { font-size: 9px; }

  .header__right {
    gap: 4px;
  }

  .header__center {
    padding: 0 8px;
  }

  .header__comp-badge {
    padding: 4px 12px;
    font-size: 14px;
    gap: 4px;
  }

  .header__comp-icon {
    width: 18px;
    height: 18px;
  }

  .header__comp-code {
    font-size: 14px;
  }
  .header__comp-group {
    font-size: 11px;
  }

  .dropdown__lang-flag {
    width: 14px;
    height: 10px;
  }

  .header__search {
    display: none;
  }

  .header__user {
    padding: 4px 8px;
    background: #f1f5f9;
  }

  .header__user-name {
    display: none;
  }

  .header__user-avatar {
    width: 22px;
    height: 22px;
    font-size: 10px;
  }

  .header__signin {
    padding: 6px;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    justify-content: center;
  }
  .header__signin-label {
    display: none;
  }
}

/* Tablet */
@media (min-width: 450px) and (max-width: 767px) {
  .header {
    padding: 10px 12px;
  }

  .header__logo-icon {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }

  .header__logo-text {
    font-size: 10px;
    line-height: 1.2;
    white-space: normal;
    max-width: 50px;
  }

  .header__comp-badge {
    padding: 6px 14px;
    font-size: 15px;
    gap: 4px;
  }

  .header__comp-flag {
    width: 20px;
    height: 15px;
  }

  .header__comp-code {
    font-size: 15px;
    gap: 3px;
  }

  .header__comp-group {
    font-size: 11px;
  }

  .header__center {
    padding: 0 6px;
  }

  .header__right {
    gap: 4px;
  }

  .dropdown__trigger {
    padding: 4px 8px;
    font-size: 12px;
  }

  .dropdown__lang-flag {
    width: 15px;
    height: 10px;
  }

  .header__user {
    padding: 4px 10px;
    background: #f1f5f9;
  }

  .header__user-avatar {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }

  .header__signin {
    padding: 6px;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    justify-content: center;
  }
  .header__signin-label {
    display: none;
  }

  .dropdown__menu {
    min-width: 180px;
  }
}

/* Desktop */
@media (min-width: 768px) {
  .header {
    padding: 12px 32px;
  }

  .dropdown__trigger {
    padding: 8px 16px;
    font-size: 14px;
  }

  .header__user {
    padding: 4px 10px;
    background: #f1f5f9;
  }
}
