/* Game entry for the current ctbattle.ru masthead.
   This stylesheet uses the site's existing dark/light/coffee variables. */
.masthead.ctb-game-enabled .ctb-header-actions {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}
.masthead.ctb-game-enabled .ctb-game-entry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 7px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--theme-accent-border, var(--line));
  border-radius: 5px;
  background: var(--theme-soft, var(--panel));
  color: var(--lime);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  touch-action: manipulation;
}
.masthead.ctb-game-enabled .ctb-game-entry:hover {
  border-color: var(--lime);
  background: var(--theme-hover, #252935);
  color: var(--theme-accent-hover, var(--lime));
}
.masthead.ctb-game-enabled .ctb-game-entry:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 4px;
}
.masthead.ctb-game-enabled .ctb-game-entry__icon {
  display: block;
  flex: 0 0 auto;
  width: 28px;
  height: 24px;
}
.masthead.ctb-game-enabled .ctb-header-actions > .screen-button {
  flex: 0 0 auto;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}
@media (min-width: 1051px) and (max-width: 1350px) {
  /* Match the current light/coffee layout in every theme: the navigation
     must wrap within its own column rather than overlap the brand. */
  .masthead.ctb-game-enabled .main-nav {
    flex-wrap: wrap;
    max-width: 100%;
  }
  .masthead.ctb-game-enabled .main-nav a {
    font-size: 12px;
    line-height: 1.25;
    padding: 7px 10px;
  }
}
@media (min-width: 1051px) {
  /* Keep the new navigation entry out of the event's projection view,
     just as the existing main navigation is hidden in this mode. */
  .screen-mode .masthead.ctb-game-enabled .ctb-game-entry {
    visibility: hidden;
  }
}
@media (max-width: 1050px) {
  /* The five existing routes move into the bottom bar at this breakpoint.
     Reuse the now-free first masthead column for the game entry. */
  .masthead.ctb-game-enabled .ctb-header-actions {
    display: contents;
  }
  .masthead.ctb-game-enabled .ctb-game-entry {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    padding-inline: 10px;
  }
}
@media (max-width: 600px) {
  /* Keep both the icon and the word visible without squeezing the logos. */
  .masthead.ctb-game-enabled .ctb-game-entry {
    flex-direction: column;
    gap: 2px;
    width: 44px;
    min-height: 44px;
    padding: 4px;
    font-size: 11px;
  }
  .masthead.ctb-game-enabled .ctb-game-entry__icon {
    width: 23px;
    height: 20px;
  }
}
@media (max-width: 360px) {
  .masthead.ctb-game-enabled {
    gap: 4px;
  }
}
