/* Name generator page, in the AltSports.org forum style.
   Colors, fonts and shapes match the forum's AHS stylesheet (styles/ahs/theme/ahs.css). */
:root {
  --ahs-navy: #112039;
  --ahs-navy-deep: #0a1426;
  --ahs-navy-hover: #23407f;
  --ahs-page: #eceef2;
  --ahs-card: #ffffff;
  --ahs-line: #dfe3ea;
  --ahs-row-hover: #f5f7fb;
  --ahs-subtle: #f6f7fa;
  --ahs-text: #1e2532;
  --ahs-muted: #5d6e82;
  --ahs-link: #1a4a9c;
  --ahs-on-navy: #ffffff;
  --ahs-on-navy-muted: #8295aa;
  --ahs-secondary: #8295aa;
  --ahs-radius: 6px;
  --ng-slate: #8194a9;       /* the Name Generator banner's background */
  --ahs-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--ahs-page); }
body {
  margin: 0; color: var(--ahs-text); font-family: var(--ahs-font);
  font-size: 15px; line-height: 1.45; overflow-x: clip;
}
a { color: var(--ahs-link); text-decoration: none; }
a:hover { color: var(--ahs-navy); text-decoration: underline; }

.wrap { max-width: 1300px; margin: 0 auto; padding: 0 5px; }

/* Full-width navy bands, like the forum */
.band { position: relative; }
.band::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 100vw;
  transform: translateX(-50%); background: var(--bleed); z-index: -1;
}
/* The Name Generator has its own banner on a slate band (the forum uses its navy banner) */
.headerbar { --bleed: var(--ng-slate); background: var(--ng-slate); padding: 14px 10px 12px; text-align: center; }
.site-logo {
  display: inline-block; width: 600px; height: 200px; max-width: 100%;
  background: url("namegen_banner.png?v=2") center / contain no-repeat;
}
.site-logo span { position: absolute; left: -9999px; }
.navbar {
  --bleed: var(--ahs-navy-deep); background: var(--ahs-navy-deep); padding: 9px 10px;
  color: var(--ahs-on-navy); font-size: 14px;
}
.navbar a { color: var(--ahs-on-navy); font-weight: 600; }
.navbar a:hover { color: var(--ahs-on-navy-muted); text-decoration: none; }
.navbar .crumb-sep { color: var(--ahs-on-navy-muted); margin: 0 6px; }
.navbar .here { color: var(--ahs-on-navy); font-weight: 600; }

/* Inside the forum's own page (embedded), the forum already shows its header */
body.embedded .headerbar, body.embedded .navbar, body.embedded .footer { display: none; }
body.embedded .page-title { margin-top: 4px; }

.page-title { font-size: 33px; font-weight: 700; margin: 16px 0 2px; }
.page-lead { color: var(--ahs-muted); margin: 0 0 14px; font-size: 15px; }

/* Tabs: grey when selected, so they don't look like the navy Generate button */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.tab {
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; line-height: 1.3;
  background: #fff; border: 1px solid var(--ahs-line); color: var(--ahs-muted);
  border-radius: var(--ahs-radius); padding: 6px 14px;
}
.tab:hover { background: var(--ahs-subtle); color: var(--ahs-navy); }
.tab[aria-pressed="true"] { background: #d9dee6; border-color: #c4cbd6; color: var(--ahs-navy); }

/* Buttons, like the forum's */
.button {
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  background: var(--ahs-navy); border: 1px solid var(--ahs-navy); color: var(--ahs-on-navy);
  border-radius: var(--ahs-radius); padding: 6px 14px; line-height: 1.3;
}
.button:hover, .button:focus-visible { background: var(--ahs-navy-hover); border-color: var(--ahs-navy-hover); }
.button.secondary { background: #fff; border-color: var(--ahs-line); color: var(--ahs-muted); }
.button.secondary:hover { background: var(--ahs-subtle); color: var(--ahs-navy); }
.button.secondary.quick[aria-pressed="true"] { background: #d9dee6; border-color: #c4cbd6; color: var(--ahs-navy); }
.button.big { font-size: 17px; padding: 9px 26px; }
.button[aria-pressed="true"], .button.active { background: var(--ahs-navy); border-color: var(--ahs-navy); color: var(--ahs-on-navy); }
.button:disabled { opacity: .5; cursor: default; }

/* Segmented choices (Men / Women / Mixed ...) */
/* Each choice is as wide as its text plus the same extra space, and together they fill the row */
.seg {
  display: flex; width: 100%; max-width: 560px;
  border: 1px solid var(--ahs-line); border-radius: var(--ahs-radius); overflow: hidden; background: #fff;
}
.seg button {
  font: inherit; font-size: 15px; font-weight: 600; border: 0; border-left: 1px solid var(--ahs-line);
  background: #fff; color: var(--ahs-muted); padding: 6px 8px; cursor: pointer;
  text-align: center; line-height: 1.25; flex: 1 1 auto;
}
.seg button:first-child { border-left: 0; }
.seg button:hover { background: var(--ahs-subtle); color: var(--ahs-navy); }
.seg button[aria-pressed="true"] { background: var(--ahs-navy); color: var(--ahs-on-navy); }

/* Cards: a navy header bar over a white body, like the forum's category blocks */
.card {
  background: var(--ahs-navy); border-radius: var(--ahs-radius); overflow: hidden;
  margin-bottom: 14px; box-shadow: 0 1px 2px rgba(10, 32, 82, .06);
}
.card-head {
  color: var(--ahs-on-navy); font-size: 17px; font-weight: 600; padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.card-head .sub { color: var(--ahs-on-navy-muted); font-weight: 400; font-size: 14px; }
.card-body { background: var(--ahs-card); padding: 14px; }

/* Settings form */
.field { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--ahs-line); }
.field:first-child { border-top: 0; padding-top: 0; }
.field > label, .field > .label { font-weight: 600; }
.field .hint { color: var(--ahs-muted); font-size: 13px; }
.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
input[type=number], input[type=text], select {
  font: inherit; font-size: 15px; color: var(--ahs-text); background: #fff;
  border: 1px solid var(--ahs-line); border-radius: var(--ahs-radius); padding: 6px 8px;
}
input[type=number] { width: 90px; }
input:focus, select:focus { outline: 2px solid var(--ahs-secondary); outline-offset: 0; }
.field.off { opacity: .4; pointer-events: none; }
details.more { border-top: 1px solid var(--ahs-line); padding-top: 9px; margin-top: 12px; }
details.more summary { cursor: pointer; font-weight: 600; color: var(--ahs-link); padding: 2px 0 6px; }
details.more .field:first-of-type { border-top: 0; }
.split input { width: 64px; }
.split span { color: var(--ahs-muted); }
.actions { padding-top: 12px; border-top: 1px solid var(--ahs-line); margin-top: 4px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* English / French slider */
.slider { width: 100%; max-width: 560px; }
.slider input[type=range] { width: 100%; accent-color: var(--ahs-navy); margin: 4px 0 2px; }
.slider-ends { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--ahs-muted); }
.slider-ends #french-label { color: var(--ahs-navy); font-weight: 600; }
.layout-side .slider { max-width: none; }
.nordic-row { display: grid; grid-template-columns: 64px 1fr 44px; align-items: center; gap: 8px; font-size: 14px; }
.nordic-row b { text-align: right; color: var(--ahs-navy); font-weight: 600; }
.slider-note { margin: 4px 0 0; }

/* Results */
.result-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.card-head .button.secondary { font-size: 14px; padding: 4px 10px; }
.names { list-style: none; margin: 0; padding: 0; columns: 3 260px; column-gap: 24px; }
.names li {
  break-inside: avoid; display: flex; align-items: baseline; gap: 8px;
  padding: 5px 6px; border-bottom: 1px solid var(--ahs-line); border-radius: 4px;
}
.names li:hover { background: var(--ahs-row-hover); }
.names input[type=checkbox] { accent-color: var(--ahs-navy); transform: translateY(1px); }
.names .nm { font-size: 17px; font-weight: 600; }
.names .nm a { color: var(--ahs-text); }
.names .nm a:hover { color: var(--ahs-link); }
.names .info { margin-left: auto; color: var(--ahs-muted); font-size: 12px; white-space: nowrap; }
.names li.kept { background: var(--ahs-subtle); }
.empty { color: var(--ahs-muted); margin: 0; }
.notice { color: var(--ahs-muted); font-size: 14px; margin: 10px 0 0; }

/* Browse */
.letters { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.letters button {
  font: inherit; font-weight: 600; width: 34px; height: 32px; cursor: pointer;
  border: 1px solid var(--ahs-line); background: #fff; color: var(--ahs-link); border-radius: 4px;
}
.letters button:hover { background: var(--ahs-subtle); color: var(--ahs-navy); }
.letters button[aria-pressed="true"] { background: var(--ahs-navy); border-color: var(--ahs-navy); color: #fff; }
.browse-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.browse-bar input { flex: 1 1 200px; max-width: 320px; }
.browse-bar .seg { flex: 1 1 320px; max-width: 460px; }
table.az { width: 100%; border-collapse: collapse; }
table.az th { text-align: left; background: var(--ahs-subtle); color: var(--ahs-muted); font-weight: 600; font-size: 13px; padding: 6px 8px; border-bottom: 1px solid var(--ahs-line); }
table.az td { padding: 6px 8px; border-bottom: 1px solid var(--ahs-line); }
table.az tr:hover td { background: var(--ahs-row-hover); }
table.az td.n { font-size: 16px; font-weight: 600; }
table.az td.r, table.az th.r { text-align: right; font-variant-numeric: tabular-nums; color: var(--ahs-muted); }
table.az tr.target td { background: #fff3b0; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; color: var(--ahs-muted); font-size: 14px; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 0 7px; border-radius: 999px; border: 1px solid var(--ahs-line); background: var(--ahs-subtle); color: var(--ahs-muted); }
.tag.Common { background: #e7f1fb; color: #1a4a9c; border-color: #cfe0f4; }
.tag.Rare { background: #f9eeda; color: #7a5410; border-color: #efdcb8; }

.footer { --bleed: var(--ahs-navy-deep); background: var(--ahs-navy-deep); padding: 9px 10px; margin-top: 10px; }
.footer a { color: var(--ahs-on-navy); font-weight: 600; font-size: 14px; }
.credits { color: var(--ahs-muted); font-size: 12px; text-align: center; padding: 10px; }

[hidden] { display: none !important; }

/* ---------- Layout 2: settings on the left, names on the right ---------- */
.layout-side #view-gen { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 14px; align-items: start; }
.layout-side #view-gen > .card:first-child { position: sticky; top: 10px; }
.layout-side .field { grid-template-columns: 1fr; gap: 6px; }
.layout-side .seg { max-width: none; }
.layout-side .seg button { padding: 6px 4px; font-size: 14px; }
.layout-side .split { gap: 4px 6px; }
.layout-side .actions .button.big { width: 100%; }
.layout-side .actions .hint:empty { display: none; }
.layout-side .names { columns: 3 210px; }
.layout-side .names .nm { font-size: 16px; }
.layout-side .names .info { display: none; }
.layout-side .names.with-info li { flex-wrap: wrap; }
.layout-side .names.with-info .info { display: block; width: 100%; margin-left: 22px; }
@media (max-width: 900px) {
  .layout-side #view-gen { grid-template-columns: 1fr; }
  .layout-side #view-gen > .card:first-child { position: static; }
}

@media (max-width: 700px) {
  .site-logo { width: 270px; height: 90px; }
  .headerbar { padding: 10px 6px; }
  .field { grid-template-columns: 1fr; gap: 6px; }
  .page-title { font-size: 26px; }
  .names .info { display: none; }
  table.az .hide-sm { display: none; }
}
