.portal-layer {
  z-index: 50;
}
.portal-card {
  width: min(68rem, 100%);
  max-height: 90dvh;
  overflow: auto;
}
.portal-nav {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding: 0 0 1rem;
  margin-bottom: 1.4rem;
}
.portal-nav button {
  font: 600 0.72rem/1.2 inherit;
  color: var(--muted);
  padding: 0.7rem 0.9rem;
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  min-width: 2.75rem;
  min-height: 2.75rem;
}
.portal-nav button.selected,
.portal-nav button:hover {
  color: var(--amber);
  border-color: var(--line);
  background: #edad490b;
}
.portal-intro {
  font-size: 1rem;
  color: var(--muted);
  max-width: 40rem;
  margin: 0 0 1.5rem;
}
.overview-grid,
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.overview-grid > div,
.profile-stats > div {
  padding: 1.25rem;
  border: 1px solid var(--line);
  background: #ffffff03;
  border-radius: 6px;
}
.overview-grid span,
.profile-stats span {
  display: block;
  color: var(--muted);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.overview-grid strong {
  display: block;
  font-size: 2.3rem;
  color: var(--amber);
  margin-top: 0.5rem;
}
.overview-grid small {
  font-size: 1rem;
  color: var(--muted);
}
.small-copy {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 1.25rem;
}
.small-copy a {
  color: var(--amber);
}
.board-filters {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 0.75rem;
}
.board-filters label,
.profile-form label {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}
.board-filters select,
.profile-form select,
.profile-form input {
  width: 100%;
  background: #14221e;
  color: #ecede3;
  border: 1px solid #ffffff20;
  border-radius: 4px;
  padding: 0.8rem;
  font: inherit;
  font-size: 0.85rem;
  color-scheme: dark;
  min-height: 2.75rem;
}
.board-filters select,
.profile-form select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 3rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23edb65d' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 1.25rem;
}
.board-scroll,
.compare-scroll {
  overflow: auto;
  margin: 1.1rem 0;
}
.leaderboard-table,
.compare-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.8rem;
}
.leaderboard-table {
  min-width: 680px;
}
.leaderboard-table th,
.compare-table th {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.leaderboard-table td,
.leaderboard-table th,
.compare-table td,
.compare-table th {
  padding: 1rem 0.7rem;
  border-bottom: 1px solid var(--line);
}
.leaderboard-table .board-score {
  color: var(--amber);
  font:
    600 1.1rem ui-monospace,
    monospace;
}
.is-you {
  background: #edad490b;
}
.player-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  min-height: 2.75rem;
}
.player-link:hover {
  color: var(--amber);
}
.player-link small {
  font-size: 0.55rem;
  color: var(--amber);
}
.avatar {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border: 1px solid #edad4940;
  color: var(--amber);
  background: #edad4910;
  font:
    600 0.65rem ui-monospace,
    monospace;
  border-radius: 5px;
}
.avatar.large {
  width: 4rem;
  height: 4rem;
  font-size: 1.35rem;
}
.player-heading {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  margin: 1.5rem 0;
}
.player-heading h3 {
  margin: 0;
  font-size: 1.6rem;
  overflow-wrap: anywhere;
}
.player-heading > div:last-child { min-width: 0; }
.player-heading p {
  margin: 0.4rem 0;
  color: var(--muted);
}
.player-heading small {
  font-size: 0.7rem;
  color: var(--muted);
}
.profile-stats {
  grid-template-columns: repeat(4, 1fr);
}
.profile-stats strong {
  display: block;
  margin-top: 0.6rem;
  font:
    600 1.55rem ui-monospace,
    monospace;
}
.profile-form {
  display: grid;
  gap: 1rem;
  max-width: 30rem;
  margin: 1.5rem 0;
}
.profile-form [role="alert"] {
  color: #efb29e;
  margin: 0;
}
.profile-form .small-copy { margin: 0; }
.profile-edit {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin-top: 1.5rem;
}
.profile-edit summary {
  cursor: pointer;
  color: var(--amber);
  font-size: 0.8rem;
  min-height: 2.75rem;
  padding: 0.75rem 0;
}
.profile-welcome {
  max-width: 36rem;
  text-align: center;
  margin: 2rem auto;
}
.profile-welcome p {
  color: var(--muted);
  line-height: 1.7;
}
.profile-welcome h3 {
  font-size: 1.5rem;
}
.google-button {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
}
.google-button span {
  display: grid;
  place-items: center;
  background: #fff;
  color: #4285f4;
  border-radius: 3px;
  width: 1.6rem;
  height: 1.6rem;
  font:
    700 1rem Arial,
    sans-serif;
}
.settings-list {
  display: grid;
  gap: 0;
}
.settings-list label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}
.settings-list small {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.7rem;
}
.settings-list input {
  accent-color: var(--amber);
}
.settings-list input[type="checkbox"] {
  width: 1.2rem;
  height: 1.2rem;
}
.settings-list input[type="range"] {
  width: 10rem;
  min-height: 2.75rem;
}
.empty-board {
  border: 1px dashed var(--line);
  padding: 2rem;
  margin: 1.5rem 0;
  text-align: center;
  color: var(--muted);
}
.empty-board strong {
  color: var(--amber);
}
.your-place {
  border: 1px solid #edad4940;
  padding: 0.9rem;
  color: var(--amber);
  font-size: 0.85rem;
}
.weapon-card {
  cursor: default !important;
}
.weapon-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 1rem;
}
.weapon-actions button {
  padding: 0.6rem !important;
  font-size: 0.65rem !important;
  min-height: 2.75rem;
}
.weapon-actions [aria-pressed="true"] {
  border-color: var(--amber);
  color: var(--amber);
}
.weapon-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.ammo-note {
  font-size: 0.7rem;
  color: var(--muted);
}
.compare-table {
  min-width: 0;
  table-layout: fixed;
}
.compare-table th:first-child { width: 36%; }
.armory-head { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 1rem; }
.armory-tools { display: flex; align-items: flex-start; gap: .55rem; }
@media (max-width: 600px) {
 .armory-tools { display: contents; }
 .armory-head > div:first-child { grid-column: 1; grid-row: 1; }
 .armory-head .close-button { grid-column: 2; grid-row: 1; }
 .armory-head .career-chip { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
}
.compare-table caption {
  text-align: left;
  color: var(--amber);
  padding: 1rem 0;
  font-size: 0.8rem;
}
.compare-table thead th {
  color: var(--amber);
}
.compare-table tbody th {
  text-transform: none;
  letter-spacing: 0;
}
.armory-card {
  max-height: 90dvh;
  overflow: auto;
}
.toast {
  position: fixed;
  z-index: 100;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 2rem);
  padding: 0.9rem 1.2rem;
  border: 1px solid #edad4970;
  background: #14221ef2;
  color: #f7d491;
  border-radius: 5px;
  font-size: 0.82rem;
  text-align: center;
  box-shadow: 0 5px 30px #0005;
}
.account-note {
  font-size: 0.75rem;
  color: var(--amber-soft);
  line-height: 1.6;
  max-width: 36rem;
}
.briefing .account-note {
  margin: 1.5rem auto 0;
  max-width: 34rem;
  font-size: .82rem;
  color: #a7b5ae;
  line-height: 1.65;
}
.account-link {
  min-height: 2.75rem;
  padding: .35rem .3rem;
  border: 0;
  background: transparent;
  color: var(--amber-soft);
  font: inherit;
  line-height: 1.4;
  text-decoration: underline;
  text-underline-offset: .25rem;
  cursor: pointer;
}
.account-link:hover { color: var(--ink); }
.account-link:focus-visible { outline: 2px solid var(--amber-soft); outline-offset: 3px; }
.account-link:disabled { opacity: .65; cursor: wait; }
.about-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 12px; font-size: .8rem; color: var(--muted); }
.analytics-choice { margin: 24px auto 0; max-width: 36rem; padding-top: 20px; border-top: 1px solid var(--line); }
.analytics-choice[hidden] { display: none; }
.briefing .analytics-choice p { font-size: .8rem; line-height: 1.6; }
.analytics-choice a { color: var(--amber); text-underline-offset: .2em; }
.consent-actions { display: flex; gap: 12px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.consent-actions .secondary-button { min-height: 44px; padding: 10px 16px; font-size: .8rem; letter-spacing: .02em; }
.game-shell:has(.start-screen:not(.is-hidden)) {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
}
.game-shell:has(.start-screen:not(.is-hidden)) .start-screen {
  position: relative;
  inset: auto;
  grid-row: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 1.5rem;
}
.start-screen .briefing { flex: 0 0 auto; margin-block: auto; }
.game-shell:has(.start-screen:not(.is-hidden)) .utility-buttons {
  position: relative;
  grid-row: 2;
  left: auto;
  bottom: auto;
  width: 100%;
  justify-content: center;
  gap: .65rem !important;
  padding: .75rem 1rem max(1rem, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(224, 233, 225, .1);
  background: rgba(8, 13, 15, .78);
}
.utility-buttons .is-hidden { display: none; }
.telemetry #runClock { display: block; margin-top: .35rem; }
@media (max-width: 1240px) {
  .game-shell:not(:has(.start-screen:not(.is-hidden))) .hud {
    padding-bottom: calc(max(1rem, env(safe-area-inset-bottom)) + 3.75rem);
  }
  .game-shell:not(:has(.start-screen:not(.is-hidden))) .utility-buttons {
    left: max(1rem, env(safe-area-inset-left));
    bottom: max(1rem, env(safe-area-inset-bottom));
  }
  .game-shell:not(:has(.start-screen:not(.is-hidden))) .weapon-dock {
    justify-self: center;
  }
}
.game-shell:has(.start-screen:not(.is-hidden)) .weapon-dock {
  opacity: 0;
  visibility: hidden;
}
@media (max-width: 760px) {
  .target-legend { display: none; }
}
.ad-slot {
  margin-top: 160px;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  min-height: 110px;
}
.ad-slot small {
  display: block;
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-bottom: 1rem;
}
.modal-card {
  max-height: 90dvh;
  overflow: auto;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 4px;
}
.result-actions {
  flex-wrap: wrap !important;
}
#saveStatus {
  font-size: 0.78rem;
  color: var(--amber-soft);
  line-height: 1.5;
}
#retrySaveButton.is-hidden {
  display: none;
}
.result-signin {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1.15rem;
  border: 1px solid rgba(237, 174, 73, .35);
  background: rgba(237, 174, 73, .055);
}
.result-signin[hidden] { display: none; }
.result-signin strong { font-size: 1rem; }
.result-signin p {
  margin: .45rem 0 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.55;
}
.result-signin button { width: 100%; min-height: 2.75rem; }
.result-signin button:disabled { opacity: .65; cursor: wait; }
.portal-card button:disabled {
  opacity: 0.5;
}
.board-filters option {
  color: #ecede3;
}
#menuContent {
  min-height: 12rem;
}
@media (max-width: 700px) {
  .portal-card {
    padding: 1.1rem;
  }
  .portal-nav {
    gap: 0.5rem;
  }
  .portal-nav button {
    padding: 0.6rem;
    font-size: 0.65rem;
  }
  .overview-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
  }
  .overview-grid > div {
    padding: 0.8rem;
  }
  .overview-grid strong {
    font-size: 1.5rem;
  }
  .overview-grid span {
    font-size: 0.55rem;
  }
  .board-filters {
    grid-template-columns: 1fr 1fr;
  }
  .board-filters label:last-child {
    grid-column: 1/-1;
  }
  .profile-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .settings-list label {
    gap: 1rem;
  }
  .settings-list input[type="range"] {
    width: 7rem;
  }
  .weapon-grid {
    grid-template-columns: 1fr !important;
  }
  .toast {
    bottom: 1rem;
  }
  .briefing .actions {
    flex-wrap: wrap;
  }
  .account-note {
    font-size: 0.68rem;
  }
  .utility-buttons {
    gap: 0.35rem !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}

.comparison-details {
  border: 1px solid var(--line);
  padding: 0.8rem 1rem;
  margin: 1rem 0;
}
.comparison-details summary {
  cursor: pointer;
  color: var(--amber);
  font-size: 0.78rem;
  min-height: 2.75rem;
  padding: 0.75rem 0;
}
.compare-table td,
.compare-table th {
  padding: 0.55rem 0.7rem;
}
.compare-table caption {
  padding: 0.6rem 0;
}
.portal-nav button {
  font-family: inherit;
}
#menuButton {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  backdrop-filter: blur(16px);
}
@media (forced-colors: active) {
  .board-filters select,
  .profile-form select {
    appearance: auto;
    background-image: none;
  }
}
