/* Shared compact vocabulary game topbar. Loaded after all mode styles. */
:root {
  --vocab-topbar-teal: #2fb6be;
  --vocab-topbar-coral: #ee7e90;
  --vocab-topbar-yellow: #f4c85d;
  --vocab-topbar-ink: #2f3b3d;
  --vocab-topbar-muted: #7d8988;
  --vocab-topbar-line: #e5ece9;
}

body.mode-game .yh-game-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(180px, 300px) minmax(300px, auto) auto 36px;
  min-height: 58px;
  height: auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 7px clamp(12px, 2vw, 28px);
  color: var(--vocab-topbar-ink);
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(90deg, var(--vocab-topbar-teal) 0 34%, var(--vocab-topbar-coral) 34% 67%, var(--vocab-topbar-yellow) 67% 100%) border-box;
  border: 0;
  border-top: 3px solid transparent;
  border-bottom: 1px solid var(--vocab-topbar-line);
  border-radius: 0;
  box-shadow: 0 5px 18px rgba(45, 75, 72, .09);
  box-sizing: border-box;
  backdrop-filter: none;
}

body.mode-game .yh-game-logo {
  display: inline-flex;
  min-width: 0;
  max-width: none;
  align-items: center;
  gap: 9px;
  padding: 0 !important;
  overflow: hidden;
  color: var(--vocab-topbar-ink) !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 850 !important;
  text-decoration: none;
}

body.mode-game .yh-game-logo span:first-child {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  color: #c95f73;
  background: #fff1f3;
  border: 1px solid #f5ccd3;
  border-radius: 7px;
  font-size: 19px;
  line-height: 1;
}

body.mode-game .yh-game-logo span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mode-game .yh-game-title {
  color: #bb6674;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

body.mode-game .yh-game-progress {
  display: grid;
  grid-template-columns: auto minmax(90px, 1fr) auto;
  min-width: 0;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--vocab-topbar-muted);
  font-size: 12px;
  font-weight: 850;
}

body.mode-game .yh-progress-label {
  color: #b96673;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

body.mode-game .yh-bar {
  width: 100%;
  height: 6px;
  overflow: hidden;
  background: #edf1ee;
  border-radius: 999px;
}

body.mode-game .yh-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--vocab-topbar-teal), #65c8a6);
  border-radius: inherit;
  transition: width .3s ease;
}

body.mode-game .yh-learning-hud--topbar {
  display: flex;
  min-width: 0;
  width: auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
  padding: 0;
  color: var(--vocab-topbar-ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.mode-game .yh-learning-hud--topbar .yh-learning-world {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

body.mode-game .yh-learning-hud--topbar .yh-learning-compass {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  color: #fff;
  background: var(--vocab-topbar-coral);
  border: 0;
  border-radius: 50%;
  box-shadow: none;
  font-size: 15px;
}

body.mode-game .yh-learning-hud--topbar .yh-learning-world > span:last-child {
  display: grid;
  min-width: 0;
}

body.mode-game .yh-learning-hud--topbar .yh-learning-world strong {
  font-size: 11px;
  line-height: 1.15;
  white-space: nowrap;
}

body.mode-game .yh-learning-hud--topbar .yh-learning-world small {
  max-width: 112px;
  overflow: hidden;
  color: var(--vocab-topbar-muted);
  font-size: 9px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mode-game .yh-learning-hud--topbar .yh-learning-stats {
  display: flex;
  align-items: center;
  gap: 5px;
}

body.mode-game .yh-learning-hud--topbar .yh-learning-stats > span {
  display: grid;
  grid-template-columns: auto auto;
  min-width: 50px;
  align-items: baseline;
  justify-content: center;
  gap: 3px;
  padding: 5px 6px;
  color: #74817d;
  background: #f7faf8;
  border: 1px solid #e4ebe7;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

body.mode-game .yh-learning-hud--topbar .yh-learning-stats b {
  display: inline;
  color: #566d68;
  font-size: 13px;
  line-height: 1;
}

body.mode-game .yh-learning-hud--topbar .yh-learning-stats small {
  margin: 0;
  color: #74817d;
  font-size: 9px;
}

body.mode-game .yh-game-score {
  display: flex;
  min-height: 32px;
  align-items: baseline;
  gap: 5px;
  padding: 6px 9px;
  color: #bb6070;
  background: #fff4f5;
  border: 1px solid #f4cbd2;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

body.mode-game .yh-score-label {
  color: #b96b77;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

body.mode-game .yh-game-close {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #bd6674;
  background: #fff;
  border: 1px solid #eed8dc;
  border-radius: 7px;
  font-size: 21px;
  line-height: 1;
  text-decoration: none;
}

body.mode-game .yh-game-close:hover,
body.mode-game .yh-game-close:focus-visible {
  color: #fff;
  background: var(--vocab-topbar-coral);
  border-color: var(--vocab-topbar-coral);
  outline: none;
}

body.mode-game .yh-game-main {
  padding-top: 16px;
}

@media (max-width: 1180px) {
  body.mode-game .yh-game-header {
    grid-template-columns: minmax(190px, 1fr) auto minmax(150px, 230px) auto auto 34px;
    gap: 8px;
  }

  body.mode-game .yh-learning-hud--topbar .yh-learning-world { display: none; }
  body.mode-game .yh-learning-hud--topbar .yh-learning-stats > span { min-width: 46px; padding-inline: 4px; }
}

@media (max-width: 900px) {
  body.mode-game .yh-game-header {
    grid-template-columns: minmax(170px, 1fr) minmax(150px, 230px) auto auto 34px;
  }

  body.mode-game .yh-game-title { display: none; }
}

@media (max-width: 760px) {
  body.mode-game .yh-game-header {
    grid-template-columns: minmax(0, 1fr) minmax(140px, 210px) auto 34px;
  }

  body.mode-game .yh-learning-hud--topbar { display: none; }
}

@media (max-width: 620px) {
  body.mode-game .yh-game-header {
    grid-template-columns: minmax(0, 1fr) auto 34px;
    min-height: 0;
    gap: 6px 8px;
    padding: 6px 9px 7px;
  }

  body.mode-game .yh-game-logo { order: 1; }
  body.mode-game .yh-game-logo span:first-child { width: 28px; height: 28px; flex-basis: 28px; }
  body.mode-game .yh-game-score { position: static; order: 2; min-height: 30px; padding: 5px 7px; }
  body.mode-game .yh-game-close { order: 3; width: 32px; height: 32px; }
  body.mode-game .yh-game-progress { order: 4; grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; width: 100%; }
  body.mode-game .yh-progress-label { display: none; }
}

@media (max-width: 420px) {
  body.mode-game .yh-game-logo { font-size: 12px !important; }
  body.mode-game .yh-score-label { display: none; }
}

/* Keep Samio visible while the live leaderboard replaces the regular topbar. */
body.mode-game.mode-live .yh-game-header--live .yh-game-logo {
  flex-shrink: 0;
  gap: 8px;
  overflow: visible;
}

body.mode-game.mode-live .yh-game-header--live .yh-game-logo::after {
  content: "";
  display: block;
  width: 104px;
  height: 29px;
  flex: 0 0 104px;
  background: url("images/logo.png") center / contain no-repeat;
}

@media (max-width: 900px) {
  body.mode-game.mode-live .yh-game-header--live .yh-game-logo::after {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    background-image: url("images/samio-icon.png");
  }
}

@media (max-width: 680px) {
  body.mode-game.mode-live .yh-game-header--live .yh-game-logo {
    width: 70px !important;
    min-width: 70px !important;
    height: 38px !important;
    gap: 6px;
    overflow: visible;
  }

  body.mode-game.mode-live .yh-game-header--live .yh-game-logo::after {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }
}
