/*
 * ALIGN visual polish layer
 * Shared contrast, utility placement, mobile clarity, and accessibility repairs.
 */

:root {
  --align-polish-ink: #10261c;
  --align-polish-deep: #002e20;
  --align-polish-text: #f6fff8;
  --align-polish-muted: #d7eadf;
  --align-polish-mint: #9fffc0;
  --align-polish-orange: #ff7a1a;
  --align-polish-focus: #ffd166;
}

html[data-align-route="landing"] .splash-intro,
html[data-align-route="landing"] .splash-intro h1,
html[data-align-route="landing"] .splash-intro .splash-kicker,
html[data-align-route="landing"] .splash-intro .splash-summary,
html[data-align-route="landing"] .splash-intro .splash-use strong,
html[data-align-route="landing"] .splash-intro .splash-use span,
html[data-align-route="landing"] .splash-intro .splash-method,
html[data-align-route="landing"] .splash-intro .splash-patent {
  color: var(--align-polish-text) !important;
}

html[data-align-route="landing"] .splash-intro {
  background:
    radial-gradient(circle at 92% 12%, rgba(255, 122, 26, 0.18), transparent 28%),
    linear-gradient(145deg, rgba(0, 49, 33, 0.97), rgba(0, 30, 21, 0.96)) !important;
  box-shadow: 0 28px 80px rgba(0, 28, 18, 0.25);
}

html[data-align-route="landing"] .splash-intro h1 {
  font-size: clamp(3.25rem, 6.2vw, 5.5rem) !important;
  line-height: 0.94 !important;
  letter-spacing: -0.055em;
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.22);
}

html[data-align-route="landing"] .splash-intro .splash-kicker {
  color: var(--align-polish-mint) !important;
}

html[data-align-route="landing"] .splash-intro .splash-summary,
html[data-align-route="landing"] .splash-intro .splash-use span,
html[data-align-route="landing"] .splash-intro .splash-method,
html[data-align-route="landing"] .splash-intro .splash-patent {
  color: var(--align-polish-muted) !important;
}

html[data-align-route="landing"] .splash-intro .splash-use strong {
  color: #ffb46c !important;
}

html[data-align-route="coach"] .launch-copy > p:not(.eyebrow):not(.secure-note) {
  color: #214a36 !important;
  font-weight: 650;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.42);
}

html[data-align-route="admin"] .admin-operations h2,
html[data-align-route="admin"] .admin-operations h3,
html[data-align-route="admin"] .admin-operations-heading h2,
html[data-align-route="admin"] main > section:not(:first-child) h2 {
  color: var(--align-polish-text) !important;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.26);
}

html[data-align-route="admin"] .admin-operations p,
html[data-align-route="admin"] .admin-operations li {
  color: var(--align-polish-muted) !important;
}

.align-experience-button {
  display: none !important;
}

.align-access-launcher {
  top: 14px !important;
  right: 14px !important;
  z-index: 2147482000 !important;
}

.align-share-launch {
  top: 14px !important;
  right: 142px !important;
  z-index: 2147481999 !important;
}

.align-reflect-launch {
  right: 18px !important;
  bottom: 18px !important;
  z-index: 2147481998 !important;
}

body:has(.bottom-nav) {
  padding-bottom: 118px !important;
}

.bottom-nav {
  bottom: 10px !important;
}

.map-pin {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 0.55rem !important;
  min-height: 46px;
}

.map-pin-badge {
  display: inline-grid;
  place-items: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  color: #061d14;
  background: linear-gradient(145deg, #9fffc0, #40d779);
  border: 1px solid rgba(255, 255, 255, 0.65);
  font-size: 0.75rem;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 5px 16px rgba(54, 255, 136, 0.18);
}

.friendly-service-note {
  color: #fff1df !important;
  background: rgba(123, 47, 0, 0.62);
  border: 1px solid rgba(255, 139, 55, 0.7);
  border-radius: 14px;
  padding: 0.8rem 1rem;
  font-weight: 750;
}

:where(button, a, input, select, textarea):focus-visible {
  outline: 3px solid var(--align-polish-focus) !important;
  outline-offset: 3px !important;
}

@media (max-width: 720px) {
  html[data-align-route="landing"] .splash-intro {
    padding: 1.45rem !important;
    border-radius: 26px !important;
  }

  html[data-align-route="landing"] .splash-intro h1 {
    font-size: clamp(2.9rem, 14vw, 4rem) !important;
    line-height: 0.96 !important;
  }

  html[data-align-route="landing"] .splash-uses {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0.65rem !important;
  }

  .voice-reopen {
    top: 10px !important;
    left: 10px !important;
    right: auto !important;
    width: auto !important;
    max-width: min(222px, calc(100vw - 124px)) !important;
    min-height: 48px !important;
    padding: 0.42rem 0.75rem 0.42rem 0.48rem !important;
  }

  .voice-reopen .voice-mic-orb {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
  }

  .voice-reopen strong {
    font-size: 0.87rem !important;
  }

  .voice-reopen small {
    font-size: 0.61rem !important;
  }

  .align-access-launcher {
    top: 10px !important;
    right: 10px !important;
    width: 48px !important;
    min-width: 48px !important;
    height: 48px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    justify-content: center !important;
  }

  .align-access-launcher > span:last-child {
    display: none !important;
  }

  .align-share-launch {
    top: 66px !important;
    right: 10px !important;
    width: 48px !important;
    min-width: 48px !important;
    height: 48px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    justify-content: center !important;
  }

  .align-share-launch span {
    display: none !important;
  }

  .align-share-launch svg {
    width: 21px !important;
    height: 21px !important;
    margin: 0 !important;
  }

  .align-reflect-launch {
    right: 10px !important;
    bottom: calc(96px + env(safe-area-inset-bottom)) !important;
    width: 48px !important;
    min-width: 48px !important;
    height: 48px !important;
    padding: 0 !important;
    overflow: hidden !important;
    border-radius: 50% !important;
    font-size: 0 !important;
    box-shadow: 0 12px 28px rgba(0, 29, 20, 0.38) !important;
  }

  .align-reflect-launch::before {
    content: "+";
    display: block;
    font-size: 1.55rem;
    font-weight: 950;
    line-height: 1;
  }

  .bottom-nav {
    left: 8px !important;
    right: auto !important;
    bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    width: calc(100vw - 16px) !important;
    max-width: none !important;
    transform: none !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 0 !important;
    padding: 0.35rem !important;
    border-radius: 24px !important;
  }

  .bottom-nav a {
    min-width: 0 !important;
    padding: 0.5rem 0.18rem !important;
  }

  .bottom-nav small {
    font-size: 0.67rem !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body:has(.bottom-nav) {
    padding-bottom: calc(112px + env(safe-area-inset-bottom)) !important;
  }

  .map-pin {
    width: 100% !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
/* Final phone-width and admin network contrast corrections. */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

html[data-align-route="admin"] .home-course-entry strong {
  color: var(--align-polish-text) !important;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.26);
}

@media (max-width: 720px) {
  .bottom-nav {
    width: calc(100% - 16px) !important;
  }
}
@media (max-width: 720px) {
  html[data-align-route="watch"] .align-reflect-launch {
    bottom: 180px !important;
  }
}
/* Premium landing composition: quiet hierarchy, readable contrast, signature value. */
body[data-page="home"] main.splash-home {
  color: #f7fff9;
}

body[data-page="home"] .splash-experience {
  min-height: 100svh;
  padding: clamp(1rem, 3vw, 2.5rem);
}

body[data-page="home"] .splash-logo {
  filter: drop-shadow(0 1.25rem 2.5rem rgba(0, 12, 8, 0.48));
}

body[data-page="home"] .splash-intro {
  max-width: 46rem;
  padding: clamp(1.35rem, 3vw, 2.6rem);
  border: 1px solid rgba(255, 142, 31, 0.42);
  border-radius: 2rem;
  background:
    radial-gradient(circle at 92% 8%, rgba(255, 137, 31, 0.16), transparent 32%),
    linear-gradient(145deg, rgba(0, 38, 25, 0.97), rgba(0, 21, 15, 0.985));
  box-shadow:
    0 2rem 5rem rgba(0, 14, 9, 0.42),
    inset 0 1px rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(18px);
}

body[data-page="home"] .splash-eyebrow,
body[data-page="home"] .splash-summary,
body[data-page="home"] .splash-use span,
body[data-page="home"] .splash-access-promise {
  color: rgba(228, 244, 234, 0.82);
}

body[data-page="home"] .splash-title {
  max-width: 12ch;
  color: #ffffff;
  text-wrap: balance;
  text-shadow: 0 0.25rem 1.5rem rgba(0, 0, 0, 0.28);
}

body[data-page="home"] .splash-summary {
  max-width: 38rem;
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.62;
}

body[data-page="home"] .splash-uses {
  gap: 0.75rem;
}

body[data-page="home"] .splash-use {
  min-height: 7rem;
  border-color: rgba(140, 224, 163, 0.25);
  background: linear-gradient(155deg, rgba(7, 58, 38, 0.76), rgba(11, 30, 23, 0.82));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.045);
}

body[data-page="home"] .splash-use strong {
  color: #ffffff;
}

.splash-signature {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.1rem;
}

.splash-signature span {
  padding: 0.48rem 0.72rem;
  border: 1px solid rgba(130, 220, 153, 0.22);
  border-radius: 999px;
  color: rgba(239, 252, 243, 0.9);
  background: rgba(0, 22, 15, 0.6);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.splash-signature .splash-signature-label {
  border-color: rgba(255, 142, 31, 0.55);
  color: #ffc27f;
  background: rgba(105, 35, 4, 0.34);
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.splash-access-promise {
  margin: 0.85rem 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  text-align: center;
}

.splash-access-promise span {
  padding-inline: 0.25rem;
  color: #ff9b36;
}

@media (max-width: 720px) {
  body[data-page="home"] .splash-experience {
    display: grid;
    align-content: start;
    gap: 0.85rem;
    padding: 0.9rem 0.9rem calc(6.5rem + env(safe-area-inset-bottom));
  }

  body[data-page="home"] .splash-brand {
    min-height: auto;
  }

  body[data-page="home"] .splash-logo {
    width: min(58vw, 14rem);
    margin-inline: auto;
  }

  body[data-page="home"] .splash-intro {
    padding: 1.15rem;
    border-radius: 1.5rem;
  }

  body[data-page="home"] .splash-eyebrow {
    margin-bottom: 0.4rem;
  }

  body[data-page="home"] .splash-title {
    max-width: none;
    font-size: clamp(2rem, 11vw, 3rem);
    line-height: 0.94;
  }

  body[data-page="home"] .splash-summary {
    margin-top: 0.75rem;
    font-size: 0.92rem;
    line-height: 1.5;
  }

  body[data-page="home"] .splash-uses {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 0.9rem;
  }

  body[data-page="home"] .splash-use {
    min-height: 5.25rem;
    padding: 0.72rem 0.58rem;
  }

  body[data-page="home"] .splash-use span {
    display: none;
  }

  body[data-page="home"] .splash-use strong {
    font-size: 0.86rem;
  }

  .splash-signature {
    gap: 0.4rem;
    margin-top: 0.85rem;
  }

  .splash-signature span {
    padding: 0.4rem 0.58rem;
    font-size: 0.68rem;
  }

  body[data-page="home"] .splash-actions {
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin-top: 0.9rem;
  }

  body[data-page="home"] .splash-actions .button {
    min-height: 3.25rem;
    padding-inline: 0.8rem;
  }

  .splash-access-promise {
    font-size: 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-page="home"] .splash-logo,
  body[data-page="home"] .splash-intro {
    animation: none !important;
    transition: none !important;
  }
}

/* Scene-first interior UX: artwork leads, information floats, actions stay obvious. */
:root {
  --align-glass-light: rgba(255, 255, 247, 0.42);
  --align-glass-light-strong: rgba(255, 255, 247, 0.62);
  --align-glass-dark: rgba(0, 39, 25, 0.48);
  --align-glass-line: rgba(22, 119, 72, 0.26);
  --align-glass-shadow: 0 18px 48px rgba(18, 62, 40, 0.13);
}

html[data-theme="day"] body :is(.location-hero, .flow-card, .pin-panel, .leaderboard-card, .course-map) {
  color: #0c2d1e !important;
  border-color: var(--align-glass-line) !important;
  background:
    linear-gradient(145deg, rgba(255, 255, 250, 0.5), rgba(239, 255, 244, 0.28)) !important;
  box-shadow: var(--align-glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.58) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.08) !important;
  backdrop-filter: blur(16px) saturate(1.08) !important;
}

html:not([data-theme="day"]) body :is(.location-hero, .flow-card, .pin-panel, .leaderboard-card, .course-map) {
  border-color: rgba(132, 255, 176, 0.22) !important;
  background:
    linear-gradient(145deg, rgba(0, 43, 27, 0.55), rgba(0, 23, 16, 0.34)) !important;
  box-shadow: 0 18px 48px rgba(0, 20, 13, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.08) !important;
  backdrop-filter: blur(16px) saturate(1.08) !important;
}

html[data-theme="day"] body :is(.flow-card, .pin-panel, .leaderboard-card) :is(h2, h3, strong, label, legend),
html[data-theme="day"] body .location-hero :is(h1, .eyebrow) {
  color: #0a2a1c !important;
  text-shadow: none !important;
}

html[data-theme="day"] body :is(.flow-card, .pin-panel, .leaderboard-card) :is(p, small, span),
html[data-theme="day"] body .location-hero p {
  color: #315e47 !important;
}

body .location-hero {
  min-height: 0 !important;
  padding-block: clamp(1.1rem, 2.6vw, 2rem) !important;
  overflow: visible !important;
}

body .location-hero::after {
  opacity: 0.24 !important;
}

body .flow-grid,
body .player-map-grid,
body .roster-workspace {
  gap: clamp(12px, 1.7vw, 22px) !important;
}

body :is(.flow-card, .pin-panel, .leaderboard-card) {
  padding: clamp(1.15rem, 2.5vw, 2rem) !important;
}

html[data-theme="day"] body main :is(input, select, textarea) {
  color: #0b2b1c !important;
  border-color: rgba(20, 112, 67, 0.27) !important;
  background: rgba(255, 255, 249, 0.58) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  backdrop-filter: blur(10px) !important;
}

html[data-theme="day"] body main :is(input, select, textarea):focus {
  border-color: rgba(255, 105, 24, 0.82) !important;
  background: rgba(255, 255, 249, 0.8) !important;
  box-shadow: 0 0 0 4px rgba(255, 115, 24, 0.12) !important;
}

body[data-page="playermap"] .course-map {
  min-height: clamp(290px, 42vw, 470px) !important;
  background:
    radial-gradient(circle at 50% 52%, rgba(68, 233, 129, 0.16), transparent 6%),
    repeating-radial-gradient(circle at 50% 52%, transparent 0 13%, rgba(29, 139, 82, 0.16) 13.3% 13.7%, transparent 14% 24%),
    linear-gradient(145deg, rgba(0, 55, 34, 0.25), rgba(246, 255, 245, 0.12)) !important;
}

body[data-page="playermap"] .map-pin {
  min-height: 48px !important;
  padding: 7px 13px 7px 8px !important;
  border: 1px solid rgba(255, 139, 34, 0.72) !important;
  border-radius: 999px !important;
  color: #f8fff9 !important;
  background: rgba(0, 47, 29, 0.76) !important;
  box-shadow: 0 10px 25px rgba(0, 37, 23, 0.18), inset 0 1px rgba(255, 255, 255, 0.08) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  backdrop-filter: blur(12px) !important;
}

body[data-page="playermap"] .map-pin :is(span, strong) {
  color: #f8fff9 !important;
}

body[data-page="playermap"] .map-pin strong {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #082619 !important;
  background: linear-gradient(145deg, #a5ffc3, #38d979);
}

body[data-page="playermap"] .map-pin:hover,
body[data-page="playermap"] .map-pin:focus-visible {
  border-color: #ffd166 !important;
  background: linear-gradient(135deg, rgba(110, 24, 5, 0.92), rgba(255, 102, 18, 0.9)) !important;
  transform: translateY(-2px);
}

body[data-page="playermap"] .leaderboard-card:has(.leaderboard:empty) {
  min-height: 0 !important;
  padding-block: 1rem !important;
  background: rgba(255, 255, 248, 0.2) !important;
  box-shadow: none !important;
}

body[data-page="playermap"] .leaderboard:empty {
  display: none !important;
}

html[data-theme="day"] body .bottom-nav {
  border-color: rgba(18, 109, 65, 0.28) !important;
  background: rgba(251, 255, 247, 0.64) !important;
  box-shadow: 0 14px 42px rgba(16, 64, 41, 0.16), inset 0 1px rgba(255, 255, 255, 0.7) !important;
  -webkit-backdrop-filter: blur(20px) saturate(1.15) !important;
  backdrop-filter: blur(20px) saturate(1.15) !important;
}

html[data-theme="day"] body .bottom-nav a[aria-current="page"],
html[data-theme="day"] body .bottom-nav a.active {
  color: #fff !important;
  background: linear-gradient(145deg, rgba(95, 24, 6, 0.92), rgba(17, 42, 27, 0.9)) !important;
}

.align-reflect-launch {
  display: grid !important;
  place-items: center !important;
  width: 52px !important;
  min-width: 52px !important;
  height: 52px !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid rgba(255, 132, 29, 0.76) !important;
  border-radius: 50% !important;
  color: #fff !important;
  background: rgba(0, 45, 28, 0.78) !important;
  box-shadow: 0 12px 30px rgba(0, 35, 22, 0.24) !important;
  -webkit-backdrop-filter: blur(15px) !important;
  backdrop-filter: blur(15px) !important;
  font-size: 0 !important;
}

.align-reflect-launch::before {
  content: "+";
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1;
}

@media (max-width: 720px) {
  html[data-theme="day"] body :is(.location-hero, .flow-card, .pin-panel, .leaderboard-card, .course-map) {
    background: linear-gradient(145deg, rgba(255, 255, 250, 0.44), rgba(239, 255, 244, 0.24)) !important;
    -webkit-backdrop-filter: blur(13px) saturate(1.06) !important;
    backdrop-filter: blur(13px) saturate(1.06) !important;
  }

  body[data-page="playermap"] .course-map {
    min-height: 330px !important;
  }

  body[data-page="playermap"] .map-pin {
    width: auto !important;
    max-width: calc(100% - 20px) !important;
  }

  body .bottom-nav {
    background: rgba(250, 255, 247, 0.7) !important;
  }
}
