/* Shared game-page navigation. Loaded last so legacy game themes cannot
   rearrange the portal controls independently. */

.page-header,
.ct-topbar {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "brand navigation return";
  align-items: center;
  gap: 18px;
  width: 100%;
  max-width: 980px;
  min-height: 68px;
  margin: 0 auto;
  padding: 12px 0 !important;
  border-bottom: 1px solid rgba(151, 177, 207, 0.14);
}

.ct-topbar {
  padding-inline: 24px !important;
}

.page-header .ct-logo,
.page-header .cena-logo,
.page-header .game-site-logo,
.ct-topbar .ct-logo {
  grid-area: brand;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #f5f8fc;
  font-family: "Sora", "Segoe UI", system-ui, sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.game-site-logo b,
.page-header .ct-logo b,
.page-header .cena-logo b,
.ct-topbar .ct-logo b {
  color: #c8f542;
}

.cena-shell .page-header .cena-logo {
  color: #17233e;
}

.cena-shell .page-header .cena-logo b {
  color: #ff7417;
}

.game-site-logo .ct-logo-mark {
  display: grid;
  grid-template-columns: repeat(2, 7px);
  gap: 3px;
  transform: rotate(-8deg);
}

.game-site-logo .ct-logo-mark i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: #c8f542;
}

.game-site-logo .ct-logo-mark i:nth-child(2),
.game-site-logo .ct-logo-mark i:nth-child(3) {
  background: #fff;
}

.ripas-header .game-site-logo,
.tarpi-header .game-site-logo,
.grozs-header .game-site-logo {
  color: #17211f;
}

.ripas-header .game-site-logo .ct-logo-mark i:nth-child(2),
.ripas-header .game-site-logo .ct-logo-mark i:nth-child(3),
.tarpi-header .game-site-logo .ct-logo-mark i:nth-child(2),
.tarpi-header .game-site-logo .ct-logo-mark i:nth-child(3),
.grozs-header .game-site-logo .ct-logo-mark i:nth-child(2),
.grozs-header .game-site-logo .ct-logo-mark i:nth-child(3) {
  background: #17211f;
}

.page-header .game-toolbar,
.ct-topbar .game-toolbar {
  grid-area: navigation;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  width: max-content;
  gap: 3px;
  margin: 0;
  padding: 4px;
  border: 1px solid rgba(151, 177, 207, 0.14);
  border-radius: 10px;
  background: rgba(12, 25, 40, 0.72);
}

/* "Sākums" and "Spēles" previously opened the same catalogue anchor. */
.page-header .game-toolbar a:first-child,
.ct-topbar .game-toolbar a:first-child {
  display: none;
}

.page-header .game-toolbar a,
.ct-topbar .game-toolbar a {
  min-width: 72px;
  padding: 7px 13px;
  border-radius: 7px;
  color: #91a5bb;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  transition: color 150ms ease, background 150ms ease;
}

.page-header .game-toolbar a:nth-child(2),
.ct-topbar .game-toolbar a:nth-child(2) {
  background: #142a43;
  color: #f5f8fc;
  box-shadow: inset 0 -2px #c8f542;
}

.page-header .game-toolbar a:hover,
.ct-topbar .game-toolbar a:hover {
  background: #102238;
  color: #fff;
}

.page-header .back-link,
.ct-topbar .ct-back {
  grid-area: return;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(151, 177, 207, 0.2);
  border-radius: 9px;
  background: rgba(12, 25, 40, 0.55);
  color: #a8bad0;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.page-header .back-link:hover,
.ct-topbar .ct-back:hover {
  border-color: rgba(200, 245, 66, 0.38);
  background: rgba(20, 42, 67, 0.88);
  color: #fff;
  transform: none;
}

@media (max-width: 700px) {
  .page-header,
  .ct-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand return"
      "navigation navigation";
    gap: 10px 12px;
    padding-block: 12px !important;
  }

  .ct-topbar {
    padding-inline: 16px !important;
  }

  .page-header .game-toolbar,
  .ct-topbar .game-toolbar {
    justify-self: stretch;
    width: 100%;
  }

  .page-header .game-toolbar a,
  .ct-topbar .game-toolbar a {
    flex: 1;
    min-width: 0;
  }
}

@media (max-width: 420px) {
  .page-header .back-link,
  .ct-topbar .ct-back {
    padding-inline: 10px;
    font-size: 11px;
  }

  .page-header .ct-logo,
  .page-header .cena-logo,
  .page-header .game-site-logo,
  .ct-topbar .ct-logo {
    font-size: 16px;
  }
}
