/* Badminton Plus One shared Web UI contract.
 * Source of truth: docs/01-authoritative/web-ui-spec.md
 * Page styles must not override Header, module heading or .module-tabs tokens.
 */
:root {
  --page-shell-width: 72rem;
  --page-shell-gutter: 1rem;
  --page-heading-top-space: 2rem;
  --page-heading-bottom-space: 1.5rem;
  --page-title-font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --page-latin-font: "Press Start 2P", "Noto Sans TC", monospace;
  --page-label-size: 16pt;
  --page-label-line-height: 1.35;
  --page-subtitle-size: 13pt;
  --page-subtitle-line-height: 1.6;
  --page-title-size: clamp(3.25rem, 5.4vw, 4.75rem);
  --page-title-line-height: 1.06;
  --ui-forest: #123f2b;
  --ui-green: #1f7149;
  --ui-muted: #627269;
  --ui-tab-bg: #ecefe7;
  --ui-tab-border: rgba(23, 53, 41, .18);
}

body,
body.play-screen,
body.create-screen,
body.ability-plus-one,
body.equipment-screen,
body.goo-classroom-page,
body.profile-screen,
body.goo-points-page {
  font-family: var(--page-title-font);
}

:is(body.play-screen, body.create-screen, body.ability-plus-one, body.equipment-screen, body.goo-classroom-page, body.profile-screen, body.goo-points-page) :is(button, input, select, textarea) {
  font-family: var(--page-title-font) !important;
}

/* Shared Header: 70px content + 2px rule = 72px total. */
[data-header] {
  box-sizing: border-box !important;
  height: 72px !important;
  min-height: 72px !important;
  border-bottom: 2px solid #3a4a3d !important;
}

[data-header] > div {
  box-sizing: border-box !important;
  width: min(var(--page-shell-width), calc(100% - (var(--page-shell-gutter) * 2))) !important;
  max-width: none !important;
  height: 70px !important;
  margin-inline: auto !important;
  padding-inline: 0 !important;
}

[data-header] .tab.active {
  background: #dcebd5 !important;
  color: var(--ui-forest) !important;
}

main.page-shell.page-shell.page-shell {
  box-sizing: border-box;
  width: min(var(--page-shell-width), calc(100% - (var(--page-shell-gutter) * 2)));
  max-width: none;
  margin-inline: auto;
  padding: var(--page-heading-top-space) 0 5rem !important;
}

main.page-shell > .page-heading {
  box-sizing: border-box;
  width: 100%;
  margin: 0 0 var(--page-heading-bottom-space) !important;
  padding: 0 !important;
  font-family: var(--page-title-font);
}

main.page-shell > .page-heading--with-actions {
  display: block !important;
}

.page-heading-copy {
  width: 100%;
  min-width: 0;
  max-width: 48rem;
}

.page-heading-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

main.page-shell > .page-heading[data-page-heading="standard"] .page-heading-label.page-heading-label {
  margin: 0 !important;
  color: var(--ui-green) !important;
  font-family: var(--page-latin-font) !important;
  font-size: var(--page-label-size) !important;
  font-weight: 400 !important;
  letter-spacing: .06em !important;
  line-height: var(--page-label-line-height) !important;
  text-transform: uppercase;
  white-space: nowrap;
}

main.page-shell > .page-heading .page-eyebrow.page-eyebrow {
  margin: 0 0 .7rem;
  color: var(--ui-green);
  font-family: var(--page-latin-font);
  font-size: .7rem;
  font-weight: 400;
  letter-spacing: .06em;
  line-height: 1.55;
  text-transform: uppercase;
}

main.page-shell > .page-heading .page-title.page-title {
  margin: 0;
  color: #173529;
  font-family: var(--page-title-font);
  font-size: var(--page-title-size);
  font-weight: 500;
  letter-spacing: -.055em;
  line-height: var(--page-title-line-height);
}

main.page-shell > .page-heading .page-subtitle.page-subtitle {
  max-width: 47.5rem;
  margin: 10px 0 0 !important;
  color: var(--ui-muted) !important;
  font-family: var(--page-title-font) !important;
  font-size: var(--page-subtitle-size) !important;
  font-weight: 400 !important;
  line-height: var(--page-subtitle-line-height) !important;
  white-space: normal;
}

main.page-shell > .page-heading[data-page-heading="illustrated"] {
  margin-bottom: var(--page-heading-bottom-space) !important;
}

main.page-shell > .page-heading--dark .page-eyebrow.page-eyebrow { color: #f5bd43; }
main.page-shell > .page-heading--dark .page-title.page-title { color: #fff; }
main.page-shell > .page-heading--dark .page-subtitle.page-subtitle { color: rgba(255, 255, 255, .82) !important; }

/* One primary tab component across Play, Create, Ability and Goo Classroom. */
.module-tabs.module-tabs {
  box-sizing: border-box !important;
  width: min(560px, 100%) !important;
  min-height: 52px !important;
  display: grid !important;
  grid-auto-flow: column !important;
  grid-auto-columns: minmax(0, 1fr) !important;
  gap: 4px !important;
  margin: 0 0 24px !important;
  padding: 5px !important;
  overflow: visible !important;
  border: 1px solid var(--ui-tab-border) !important;
  border-radius: 999px !important;
  background: var(--ui-tab-bg) !important;
  box-shadow: none !important;
}

/* Legacy Create styles used an ID-level 22px override; the shared contract is
 * intentionally equally specific and later in the cascade. */
#tabs.module-tabs {
  margin-bottom: 24px !important;
}

.page-heading .module-tabs.module-tabs {
  margin: 24px 0 0 !important;
}

.module-tabs.module-tabs > :is(a, button, span) {
  box-sizing: border-box !important;
  min-width: 0 !important;
  min-height: 40px !important;
  height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 8px 16px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: var(--ui-muted) !important;
  box-shadow: none !important;
  font-family: var(--page-title-font) !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 20px !important;
  text-align: center !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}

.module-tabs.module-tabs > [hidden] {
  display: none !important;
}

.module-tabs.module-tabs > :is(a, button, span):is(.on, .active, .is-active, [aria-selected="true"], [aria-current="page"]) {
  background: var(--ui-forest) !important;
  color: #fff !important;
  box-shadow: none !important;
}

.module-tabs.module-tabs > :is(a, button):not(.on):not(.active):not(.is-active):hover,
.module-tabs.module-tabs > :is(a, button):not(.on):not(.active):not(.is-active):focus-visible {
  background: #dcebd5 !important;
  color: var(--ui-forest) !important;
}

@media (max-width: 767px) {
  :root {
    --page-shell-gutter: .75rem;
    --page-heading-top-space: 1.25rem;
    --page-heading-bottom-space: 1rem;
    --page-label-size: 15pt;
    --page-subtitle-size: 11pt;
    --page-title-size: 2.4rem;
    --page-title-line-height: 1.1;
  }

  main.page-shell.page-shell.page-shell {
    padding-top: var(--page-heading-top-space) !important;
    padding-bottom: 4.75rem !important;
  }

  .page-heading-copy { max-width: none; }

  main.page-shell > .page-heading .page-eyebrow.page-eyebrow {
    margin-bottom: .45rem;
    font-size: .62rem;
    line-height: 1.5;
  }

  .module-tabs.module-tabs {
    width: 100% !important;
    margin-bottom: 16px !important;
  }

  #tabs.module-tabs {
    margin-bottom: 16px !important;
  }

  .page-heading .module-tabs.module-tabs {
    margin: 16px 0 0 !important;
  }

  .module-tabs.module-tabs > :is(a, button, span) {
    padding-inline: 8px !important;
  }
}
