:root {
  --gft-shell-bg: #050606;
  --gft-shell-panel: #090c0d;
  --gft-shell-panel-strong: #0f1415;
  --gft-shell-line: rgba(226, 255, 244, 0.14);
  --gft-shell-text: #f7faf3;
  --gft-shell-muted: #aab6b0;
  --gft-shell-green: #bbff2a;
  --gft-shell-font: "Avenir Next", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --gft-shell-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

html {
  overflow-x: hidden;
}

body,
body[data-version],
body[data-theme][data-version] {
  min-width: 320px;
  overflow-x: hidden;
  font-family: var(--gft-shell-font);
}

body :where(button, input, select, textarea) {
  font-family: inherit;
}

.site-header,
.topbar,
.index-topbar,
.prices-topbar,
.hardware-topbar,
.hardware-sales-topbar,
.milestones-topbar,
.game-pass-toolkit-row,
.fh6-toolkit-row {
  top: 0;
  z-index: 60;
  min-height: 64px;
  border-bottom: 1px solid var(--gft-shell-line);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.96);
  box-shadow: none;
  color: var(--gft-shell-text);
  font-family: var(--gft-shell-font);
  backdrop-filter: blur(18px);
}

.game-pass-toolkit-row,
.fh6-toolkit-row {
  position: sticky;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100vw;
  margin-right: calc(50% - 50vw);
  margin-left: calc(50% - 50vw);
  padding: 10px max(16px, calc((100vw - 1240px) / 2));
}

.brand,
.site-nav {
  display: flex;
  align-items: center;
}

.brand {
  min-width: 0;
  gap: 10px;
  color: var(--gft-shell-text);
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 0;
  padding: 0;
  overflow: hidden;
  background: var(--gft-shell-green);
  box-shadow: 0 0 20px rgba(187, 255, 42, 0.48);
  color: transparent;
  font-size: 0;
  line-height: 0;
  text-indent: -999px;
}

.brand-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.brand-copy strong {
  overflow: hidden;
  color: var(--gft-shell-text);
  font-family: var(--gft-shell-font);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.12;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-copy small,
.brand-copy > span:not(.brand-title-line),
.site-nav a,
.toolkit-menu summary,
.toolkit-menu-button,
.toolkit-menu nav a {
  font-family: var(--gft-shell-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.brand-copy small,
.brand-copy > span:not(.brand-title-line) {
  display: none;
  overflow: hidden;
  color: var(--gft-shell-muted);
  font-size: 0.72rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-nav {
  justify-content: flex-end;
  margin-left: auto;
}

.toolkit-menu {
  position: relative;
  z-index: 70;
  display: grid;
  justify-items: end;
  margin-left: auto;
  font-family: var(--gft-shell-font);
}

.toolkit-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--gft-shell-line);
  padding: 0 12px;
  background: transparent;
  color: var(--gft-shell-text);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  list-style: none;
}

.toolkit-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--gft-shell-line);
  padding: 0 12px;
  background: transparent;
  color: var(--gft-shell-text);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.toolkit-menu-button svg {
  display: none;
}

.toolkit-menu summary::-webkit-details-marker {
  display: none;
}

.toolkit-menu summary::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--gft-shell-green);
  transition: transform 160ms ease;
}

.toolkit-menu-button::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--gft-shell-green);
  transition: transform 160ms ease;
}

.toolkit-menu[open] summary,
.toolkit-menu summary:hover,
.toolkit-menu summary:focus-visible,
.toolkit-menu-button:hover,
.toolkit-menu-button:focus-visible,
.toolkit-menu-button[aria-expanded="true"] {
  border-color: var(--gft-shell-green);
  color: var(--gft-shell-green);
  outline: none;
}

.toolkit-menu[open] summary::after {
  transform: rotate(180deg);
}

.toolkit-menu-button[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.toolkit-menu nav {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  display: grid;
  gap: 2px;
  width: 284px;
  max-width: calc(100vw - 20px);
  border: 1px solid var(--gft-shell-line);
  padding: 8px;
  background: rgba(5, 6, 6, 0.98);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.36);
}

.toolkit-menu nav[hidden] {
  display: none;
}

.toolkit-menu nav a {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  color: var(--gft-shell-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.toolkit-menu nav a:hover,
.toolkit-menu nav a:focus-visible,
.toolkit-menu nav a[aria-current="page"] {
  background: var(--gft-shell-panel-strong);
  color: var(--gft-shell-text);
  outline: none;
}

.toolkit-menu nav a[href*="duellysorted.com"] {
  gap: 8px;
}

.toolkit-menu nav a[href*="duellysorted.com"]::before {
  content: "";
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  opacity: 0.95;
  background:
    linear-gradient(45deg, transparent 43%, currentColor 44% 55%, transparent 56%),
    linear-gradient(-45deg, transparent 43%, currentColor 44% 55%, transparent 56%);
}

.game-pass-checkbox {
  font-family: var(--gft-shell-font);
}

.game-pass-page {
  padding-top: 0;
}

/* Compact public GFT pages: the page title already lives in the top bar. */
.tools-intro,
.milestones-intro,
.game-pass-hero,
.fh6-hero,
.overview-hero,
.learning-intro-section > .section-kicker,
.learning-intro-section > #learning-summary,
.search-heading,
.chart-heading > div,
.table-section > .section-heading,
.view-panel > .section-heading {
  display: none !important;
}

.front-tools,
.tools-home,
.milestones-app,
.prices-app,
.hardware-app,
.hardware-sales-app,
.index-app,
.game-pass-page,
.fh6-page,
.calendar-workspace,
.workspace,
.search-panel {
  padding-top: 10px;
}

.tools-home {
  padding-top: 12px;
}

.library-panel > .section-heading:first-child:has(h1),
.library-panel > .section-heading:first-child:has(h1) > div:first-child,
.library-panel > .section-heading:first-child:has(h1) h1,
.library-panel > .section-heading:first-child:has(h1) p {
  min-height: 0;
}

.library-panel > .section-heading:first-child:has(h1) > div:first-child {
  display: none !important;
}

.library-panel > .section-heading:first-child:has(h1) {
  justify-content: flex-end;
  margin-bottom: 8px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.library-panel > .section-heading:first-child:has(h1):not(:has(.view-actions, .platform-switcher)) {
  display: none !important;
}

.hardware-app .panel-heading,
.hardware-app .monitor-section > .section-heading {
  display: none !important;
}

.hardware-app .chart-panel {
  align-content: start;
}

.search-panel:has(.search-form) {
  gap: 8px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.sheet-meta {
  padding-top: 6px;
  padding-bottom: 6px;
}

@media (max-width: 780px) {
  .site-header,
  .topbar,
  .index-topbar,
  .prices-topbar,
  .hardware-topbar,
  .hardware-sales-topbar,
  .milestones-topbar,
  .game-pass-toolkit-row,
  .fh6-toolkit-row {
    min-height: 54px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .brand-copy strong {
    max-width: 210px;
    font-size: 0.8rem;
  }

  .toolkit-menu summary,
  .toolkit-menu-button {
    min-height: 34px;
    padding-inline: 10px;
    font-size: 0.68rem;
  }

  .toolkit-menu nav {
    top: calc(100% + 8px);
  }

  .front-tools,
  .tools-home,
  .milestones-app,
  .prices-app,
  .hardware-app,
  .hardware-sales-app,
  .index-app,
  .game-pass-page,
  .fh6-page,
  .calendar-workspace,
  .workspace,
  .search-panel {
    padding-top: 8px;
  }

  .library-panel > .section-heading:first-child:has(h1) {
    padding: 8px 10px;
  }

  .filter-controls {
    display: flex !important;
    grid-column: 1 / -1;
    gap: 6px;
    align-items: end;
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-inline: 0;
    padding-inline: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .filter-controls::-webkit-scrollbar {
    display: none;
  }

  .filter-control {
    flex: 0 0 128px;
    gap: 3px;
  }

  .filter-control select,
  .mode-toggle {
    min-height: 32px;
  }

  .mode-toggle {
    flex: 0 0 auto;
    width: auto;
  }

  .chart-controls,
  .calendar-actions {
    display: flex !important;
    grid-column: 1 / -1;
    gap: 6px;
    align-items: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .chart-controls::-webkit-scrollbar,
  .calendar-actions::-webkit-scrollbar {
    display: none;
  }

  .chart-controls .search-box {
    flex: 0 0 min(190px, 52vw);
    min-width: 0;
    height: 34px;
  }

  .chart-controls select,
  .calendar-actions .button,
  .view-switch .icon-button,
  .platform-switcher .icon-button {
    flex: 0 0 auto;
    min-height: 34px;
    white-space: nowrap;
  }

  .view-switch,
  .platform-switcher {
    flex: 1 1 100%;
    display: flex;
    gap: 6px;
    align-items: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .view-switch::-webkit-scrollbar,
  .platform-switcher::-webkit-scrollbar {
    display: none;
  }

  .platform-switcher-label {
    display: none;
  }
}

@media (max-width: 520px) {
  .brand-copy strong {
    max-width: 168px;
  }

  .game-pass-toolkit-row,
  .fh6-toolkit-row {
    gap: 12px;
  }

  .toolkit-menu nav {
    right: -6px;
  }

  body:has(.app-tabs) .topbar {
    display: grid;
    grid-template-columns: minmax(106px, auto) minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
    min-height: 54px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  body:has(.app-tabs) .brand {
    gap: 7px;
  }

  body:has(.app-tabs) .brand-copy strong {
    max-width: 112px;
    font-size: 0.74rem;
  }

  body:has(.app-tabs) .search-box {
    grid-column: auto;
    min-width: 0;
    height: 36px;
    padding: 0 8px;
  }

  body:has(.app-tabs) .search-box svg {
    display: none;
  }

  body:has(.app-tabs) .search-box input {
    font-size: 12px;
  }

  body:has(.app-tabs) .app-tabs {
    gap: 6px;
    margin-top: 6px;
  }

  body:has(.app-tabs) .app-tabs button {
    min-height: 34px;
    padding-inline: 9px;
    font-size: 11px;
  }

  body:has(.app-tabs) .library-panel {
    padding: 10px;
  }

  body:has(.app-tabs) .result-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
  }

  body:has(.app-tabs) .calendar-group h2 {
    display: none;
  }

  body:has(.app-tabs) .calendar-group {
    margin-bottom: 8px;
  }
}

@media (max-width: 390px) {
  .brand-copy strong {
    max-width: 142px;
  }

  .toolkit-menu summary {
    min-width: 72px;
    padding-inline: 10px;
  }

  body:has(.app-tabs) .topbar {
    grid-template-columns: minmax(96px, auto) minmax(0, 1fr) auto;
  }

  body:has(.app-tabs) .brand-copy strong {
    max-width: 98px;
  }
}
