/* =========================================================
   Общая шапка games.daryn.kz  (header.php)
   Все классы начинаются с .dh — не пересекаются со старыми стилями
   ========================================================= */

.dh{
  --dh-ink: #132029;
  --dh-steel: #526270;
  --dh-line: #dbe3e6;
  --dh-azure: #0a5872;
  --dh-azure-deep: #083e51;
  --dh-azure-bright: #1490b3;
  --dh-blue: #0071bb;
  --dh-soft: #e3f0f4;

  position: relative;
  z-index: 50;
  max-width: 960px;
  margin: 0 auto 24px;
  font-family: 'Open Sans', sans-serif;
  text-align: left;   /* .center в profilepage.css центрирует текст — в шапке не нужно */
  box-sizing: border-box;
}
.dh *, .dh *::before, .dh *::after{ box-sizing: border-box; }

.dh-bar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: #fff;
  border: 1px solid var(--dh-line);
  border-top: none;
  border-radius: 0 0 16px 16px;
  box-shadow: 0 1px 2px rgba(19,32,41,.04), 0 12px 28px -18px rgba(10,58,74,.25);
}

/* ---------- Логотип и название ---------- */
.dh-brand{
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  text-decoration: none;
  color: var(--dh-ink);
}
.dh .dh-logo{
  width: auto !important;
  height: 46px;
  flex-shrink: 0;
  display: block;
}
.dh-name{
  padding-left: 14px;
  border-left: 1px solid var(--dh-line);
  white-space: pre-line;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: .2px;
  text-transform: uppercase;
  color: var(--dh-ink);
}

/* ---------- Правая часть ---------- */
.dh-actions{
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* ---------- Меню «Өткен іс-шаралар» ---------- */
.dh-events{ position: relative; }
.dh-events-btn{
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border: 1.4px solid var(--dh-line);
  border-radius: 999px;
  background: #fbfcfd;
  color: var(--dh-azure-deep);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.dh-events-btn:hover,
.dh-events.is-open .dh-events-btn{
  border-color: var(--dh-azure);
  background: #fff;
}
.dh-events-btn:focus-visible{
  outline: 2px solid var(--dh-azure-bright);
  outline-offset: 2px;
}
.dh-events-arrow{ transition: transform .15s ease; }
.dh-events.is-open .dh-events-arrow{ transform: rotate(180deg); }

.dh-events-menu{
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 300px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--dh-line);
  border-radius: 12px;
  box-shadow: 0 16px 36px -14px rgba(10,58,74,.35);
  z-index: 60;
}
.dh-events.is-open .dh-events-menu{ display: block; }
.dh-events-link{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--dh-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
}
.dh-events-link::before{
  content: "";
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dh-azure-bright);
}
.dh-events-link:hover{
  background: #f1f8fb;
  color: var(--dh-azure-deep);
}

/* ---------- Кнопка «Бізбен хабарласу» ---------- */
.dh-contact{ position: relative; }

.dh-contact-btn{
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 10px 16px;
  border: none;
  border-radius: 999px;
  background: var(--dh-blue);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color .15s ease, transform .15s ease;
}
.dh-contact-btn, .dh-contact-btn:hover, .dh-contact-btn:visited{ text-decoration: none; color: #fff; }
.dh-contact-btn:hover{ background: var(--dh-azure); }
.dh-contact-btn:active{ transform: scale(.97); }
.dh-contact-btn:focus-visible{
  outline: 3px solid rgba(20,144,179,.35);
  outline-offset: 2px;
}

/* Мигающая «волна» вокруг кнопки */
.dh-pulse{
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  animation: dh-pulse 1.8s ease-out infinite;
}
@keyframes dh-pulse{
  0%   { box-shadow: 0 0 0 0 rgba(0,113,187,.55); }
  70%  { box-shadow: 0 0 0 12px rgba(0,113,187,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,113,187,0); }
}
/* Иконка телефона слегка «звонит» */
.dh-contact-icon{
  flex-shrink: 0;
  transform-origin: 50% 50%;
  animation: dh-ring 2.4s ease-in-out infinite;
}
@keyframes dh-ring{
  0%, 60%, 100% { transform: rotate(0); }
  64% { transform: rotate(-14deg); }
  68% { transform: rotate(12deg); }
  72% { transform: rotate(-10deg); }
  76% { transform: rotate(8deg); }
  80% { transform: rotate(0); }
}


/* ---------- Переключатель языка ---------- */
.dh-lang{
  position: relative;
  display: inline-flex;
  padding: 3px;
  background: #eef3f5;
  border: 1px solid var(--dh-line);
  border-radius: 999px;
}
.dh-lang-btn{
  min-width: 46px;
  padding: 7px 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--dh-steel);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .3px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.dh-lang-btn:hover{ color: var(--dh-azure); }
.dh-lang-btn.is-active{
  background: #fff;
  color: var(--dh-azure-deep);
  box-shadow: 0 1px 3px rgba(19,32,41,.15);
}
.dh-lang-btn:focus-visible{
  outline: 2px solid var(--dh-azure-bright);
  outline-offset: 1px;
}
.dh-lang-select{
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0;
  pointer-events: none;
}

/* ---------- Планшет ---------- */
@media screen and (max-width: 991px){
  .dh{ margin-bottom: 18px; }
  .dh-bar{ padding: 10px 14px; border-radius: 0 0 14px 14px; }
  .dh .dh-logo{ height: 38px; }
  .dh-name{ font-size: 11.5px; padding-left: 10px; }
  .dh-brand{ gap: 10px; }
}

/* ---------- Узкий планшет: название сверху, кнопки строкой ниже ---------- */
@media screen and (max-width: 860px){
  .dh-bar{ flex-wrap: wrap; row-gap: 10px; }
  .dh-brand{ flex: 1 1 100%; justify-content: center; }
  .dh-actions{ flex: 1 1 100%; justify-content: center; }
}
/* ---------- Телефон ---------- */
@media screen and (max-width: 640px){
  .dh-bar{
    flex-wrap: wrap;
    gap: 10px;
    border-left: none;
    border-right: none;
    border-radius: 0 0 14px 14px;
  }
  .dh-brand{ flex: 1 1 100%; justify-content: center; }
  .dh-name{ font-size: 10.5px; }
  .dh-actions{
    flex: 1 1 100%;
    justify-content: space-between;
    position: static;
  }
  .dh-actions{ flex-wrap: wrap; }
  /* меню мероприятий — отдельной строкой на всю ширину, список открывается под кнопкой */
  .dh-events{ order: 3; flex: 1 1 100%; }
  .dh-events-btn{ width: 100%; justify-content: center; }
  .dh-events-menu{ position: static; min-width: 0; margin-top: 8px; box-shadow: none; background: #f7fafb; }
}

/* ---------- Телефон: шапка закреплена сверху ---------- */
@media screen and (max-width: 640px){
  .dh{
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    max-width: none;
    margin: 0;
  }
  .dh-bar{ transition: padding .2s ease; }

  /* при прокрутке — компактная шапка в одну строку */
  .dh.is-compact .dh-bar{ flex-wrap: nowrap; gap: 8px; padding: 8px 10px; }
  .dh.is-compact .dh-brand{ flex: 0 0 auto; }
  .dh.is-compact .dh-name{ display: none; }
  .dh.is-compact .dh-logo{ height: 30px; }
  .dh.is-compact .dh-actions{ flex: 1 1 auto; flex-wrap: nowrap; justify-content: flex-end; gap: 8px; }
  .dh.is-compact .dh-events{ order: 0; flex: 0 0 auto; position: static; }
  .dh.is-compact .dh-events-btn{ width: auto; padding: 9px 10px; }
  .dh.is-compact .dh-events-btn > span,
  .dh.is-compact .dh-events-arrow{ display: none; }
  .dh.is-compact .dh-events-menu{
    position: absolute;
    top: calc(100% + 6px);
    left: 8px;
    right: 8px;
    margin: 0;
    background: #fff;
    box-shadow: 0 16px 36px -14px rgba(10,58,74,.35);
  }
  .dh.is-compact .dh-contact-btn{ padding: 10px; }
  .dh.is-compact .dh-contact-text{ display: none; }
  .dh.is-compact .dh-lang-btn{ min-width: 38px; padding: 7px 8px; }
}

/* Если пользователь отключил анимации в системе */
@media (prefers-reduced-motion: reduce){
  .dh-pulse, .dh-contact-icon{ animation: none; }
}