:root {
  color-scheme: dark;
  --ink: #f4f7fb;
  --muted: #8d98a9;
  --blue: #76a8ff;
  --cyan: #62e0e2;
  --gold: #f4cb78;
  --night: #070b14;
  --panel: #101725;
  --line: rgba(200, 218, 242, 0.12);
  --pointer-x: 75vw;
  --pointer-y: 32vh;
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }

html { min-width: 320px; overflow-x: clip; background: var(--night); scroll-behavior: smooth; }

html.league-modal-open { overflow: hidden; overscroll-behavior: none; }
body.league-modal-open { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; overscroll-behavior: none; }

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 76% 27%, rgba(30, 72, 128, 0.16), transparent 31%),
    radial-gradient(ellipse at 5% 100%, rgba(14, 50, 73, 0.15), transparent 35%),
    linear-gradient(128deg, #070b14 0%, #09111e 54%, #080c15 100%);
}

body::before {
  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  content: '';
  opacity: 0.62;
  background: radial-gradient(560px circle at var(--pointer-x) var(--pointer-y), rgba(67, 127, 218, 0.09), transparent 70%);
}

body::after {
  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  content: '';
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

button, a { font: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 5px; }

.app-shell { position: relative; z-index: 1; display: flex; min-height: 100vh; min-height: 100svh; }

.side-rail {
  position: fixed;
  z-index: 2;
  inset: 0 auto 0 0;
  width: 72px;
  height: 100vh;
  height: 100svh;
  border-right: 1px solid rgba(183, 205, 232, 0.08);
  background: rgba(5, 9, 16, 0.24);
  backdrop-filter: blur(14px);
}

.side-navigation { display: flex; height: 100%; flex-direction: column; align-items: center; gap: 13px; padding: 25px 0; }
.nav-item { position: relative; display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border: 1px solid transparent; border-radius: 10px; color: #758399; background: transparent; cursor: pointer; text-decoration: none; transition: color 180ms ease, border-color 180ms ease, background 180ms ease; }
.nav-item svg { width: 19px; height: 19px; }
.nav-item[aria-disabled="true"]:not(.is-active) { opacity: 0.68; }
.nav-item.is-active { color: #b9d3ff; border-color: rgba(117, 168, 255, 0.2); background: linear-gradient(145deg, rgba(67, 111, 180, 0.25), rgba(30, 53, 88, 0.18)); box-shadow: inset 0 1px 0 rgba(205, 226, 255, 0.08), 0 5px 18px rgba(18, 51, 99, 0.17); }
.nav-item.is-active::before { position: absolute; top: 10px; bottom: 10px; left: -16px; width: 2px; border-radius: 2px; background: var(--cyan); box-shadow: 0 0 10px rgba(98, 224, 226, 0.75); content: ''; }
.nav-settings { margin-top: auto; }

.main-column { width: calc(100% - 72px); margin-left: 72px; padding: 0 5.2vw; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 91px;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand-mark { display: block; width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 0 12px rgba(244, 203, 120, 0.24)); }
.brand-name { display: flex; align-items: center; gap: 9px; font-family: 'Space Grotesk', sans-serif; font-size: 15px; font-weight: 700; letter-spacing: 0.11em; }

.hero { display: grid; grid-template-columns: minmax(390px, 0.94fr) minmax(460px, 1.06fr); align-items: center; gap: 2vw; min-height: calc(100svh - 170px); padding: 27px 0 30px; }
.hero-copy { position: relative; z-index: 2; padding: 24px 0 10px; animation: rise-in 0.8s cubic-bezier(.2,.75,.25,1) both; }
h1 { max-width: 710px; margin: 0; font-family: 'Space Grotesk', 'DM Sans', sans-serif; font-size: clamp(58px, 7vw, 96px); font-weight: 500; letter-spacing: -0.075em; line-height: 0.99; }
h1 span { color: var(--blue); background: linear-gradient(100deg, #9ac3ff 4%, #6e9cf5 54%, #91dbe7 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-description { max-width: 440px; margin: 24px 0 0; color: #9ba7b9; font-size: 14px; line-height: 1.85; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 31px; }
.button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 22px; min-height: 52px; padding: 0 20px; border: 1px solid transparent; border-radius: 4px; cursor: pointer; font-size: 12px; font-weight: 700; letter-spacing: 0.015em; text-decoration: none; transition: transform 220ms ease, background 220ms ease, border-color 220ms ease, box-shadow 220ms ease; }
.button:hover { transform: translateY(-2px); }
.button:disabled { opacity: 0.42; cursor: not-allowed; transform: none; }
.button:disabled:hover { transform: none; }
.button svg { width: 18px; height: 18px; }
.button-primary { min-width: 164px; color: #08111d; background: linear-gradient(112deg, #b4d6ff 0%, #7eabff 52%, #89c9f3 100%); box-shadow: 0 7px 24px rgba(94, 147, 239, 0.17), inset 0 1px 0 rgba(255, 255, 255, 0.48); }
.button-primary:hover { box-shadow: 0 10px 32px rgba(94, 147, 239, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.58); }
.button-primary svg { transition: transform 220ms ease; }
.button-primary:hover svg { transform: translateX(3px); }
.button-secondary { min-width: 153px; gap: 10px; color: #d6dfec; border-color: rgba(198, 216, 241, 0.19); background: rgba(18, 27, 42, 0.62); }
.button-secondary:hover { border-color: rgba(125, 171, 255, 0.56); background: rgba(33, 49, 74, 0.7); }
.button-secondary svg { color: var(--cyan); }
.season-callout { display: inline-flex; align-items: center; gap: 9px; width: fit-content; margin: 0; padding: 9px 13px; border: 1px solid rgba(183, 205, 232, 0.15); border-radius: 999px; color: #95a3b7; background: rgba(16, 23, 37, 0.62); font-family: 'Space Grotesk', sans-serif; font-size: 12px; font-weight: 600; letter-spacing: 0.1em; line-height: 1; }
.season-callout strong { color: #e8eef8; font: inherit; letter-spacing: inherit; }

.hero-art { position: relative; display: flex; min-width: 0; height: 580px; flex-direction: column; align-items: center; justify-content: center; isolation: isolate; animation: art-arrive 1.1s cubic-bezier(.2,.75,.25,1) 0.12s both; }
.hero-art::before { position: absolute; z-index: -1; width: min(95%, 570px); aspect-ratio: 1; border: 1px solid rgba(117, 156, 211, 0.075); border-radius: 50%; content: ''; box-shadow: 0 0 0 24px rgba(87, 126, 180, 0.018), 0 0 0 48px rgba(87, 126, 180, 0.014), 0 0 80px rgba(28, 79, 146, 0.12); }
.orbit-scene { position: absolute; top: 55px; left: 50%; width: min(88%, 515px); aspect-ratio: 1; transform: translateX(-50%); }
.orbit { position: absolute; top: 50%; left: 50%; border: 1px solid rgba(143, 182, 240, 0.2); border-radius: 50%; transform: translate(-50%, -50%); }
.orbit-outer { width: 94%; height: 42%; transform: translate(-50%, -50%) rotate(-31deg); border-color: rgba(141, 183, 241, 0.22); animation: orbit-drift 32s linear infinite; }
.orbit-middle { width: 83%; height: 61%; transform: translate(-50%, -50%) rotate(52deg); border-style: dashed; border-color: rgba(112, 166, 237, 0.17); animation: orbit-drift 48s linear infinite reverse; }
.orbit-inner { width: 64%; height: 76%; transform: translate(-50%, -50%) rotate(-65deg); border-color: rgba(103, 216, 224, 0.17); }
.orbit-node { position: absolute; z-index: 2; width: 8px; height: 8px; border: 1px solid rgba(255, 255, 255, 0.8); border-radius: 50%; background: #84b6ff; box-shadow: 0 0 13px 3px rgba(102, 159, 246, 0.72); }
.node-one { top: 16%; left: 27%; }
.node-two { top: 33%; right: 7%; width: 5px; height: 5px; background: var(--gold); box-shadow: 0 0 12px 3px rgba(244, 203, 120, 0.58); }
.node-three { bottom: 15%; left: 19%; width: 6px; height: 6px; background: var(--cyan); box-shadow: 0 0 12px 3px rgba(98, 224, 226, 0.54); }
.node-four { right: 21%; bottom: 12%; width: 4px; height: 4px; }
.globe-halo { position: absolute; top: 50%; left: 50%; width: 51%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(63, 130, 217, 0.2), rgba(32, 71, 134, 0.08) 49%, transparent 72%); transform: translate(-50%, -50%); filter: blur(11px); animation: halo-breathe 5s ease-in-out infinite; }
.globe { position: absolute; top: 50%; left: 50%; display: grid; width: 37%; aspect-ratio: 1; place-items: center; overflow: hidden; border: 1px solid rgba(165, 205, 255, 0.6); border-radius: 50%; background: radial-gradient(circle at 32% 27%, #6c91ca 0, #31568d 21%, #182e52 52%, #0d1b33 80%); box-shadow: inset -19px -14px 38px rgba(0, 0, 0, 0.58), inset 8px 7px 21px rgba(193, 222, 255, 0.3), 0 0 35px rgba(78, 148, 235, 0.3), 0 0 95px rgba(37, 106, 194, 0.22); transform: translate(-50%, -50%); animation: globe-float 6s ease-in-out infinite; }
.globe::before, .globe::after { position: absolute; inset: -10%; border: 1px solid rgba(151, 208, 252, 0.29); border-radius: 50%; content: ''; transform: scaleX(0.45); }
.globe::after { transform: scaleX(0.76); }
.globe-shine { position: absolute; top: 4%; left: 14%; width: 60%; height: 36%; border-radius: 50%; background: rgba(190, 226, 255, 0.18); filter: blur(12px); transform: rotate(-32deg); }
.globe-grid { position: absolute; inset: 10% -18%; border: 1px solid rgba(151, 208, 252, 0.18); border-radius: 50%; }
.globe-grid-one { transform: rotate(33deg) scaleY(0.48); }
.globe-grid-two { transform: rotate(-34deg) scaleY(0.48); }
.trophy-mark { margin-top: -21px; position: relative; z-index: 1; width: 88%; height: 74%; object-fit: contain; filter: drop-shadow(0 0 15px rgba(244, 203, 120, 0.56)); }
.scene-star { position: absolute; color: #d7e5ff; text-shadow: 0 0 15px rgba(136, 187, 255, 0.85); }
.star-a { top: 20%; right: 23%; font-size: 15px; animation: twinkle 3.8s ease-in-out infinite; }
.star-b { top: 24%; left: 16%; color: var(--gold); font-size: 19px; animation: twinkle 4.6s ease-in-out 1s infinite; }
.star-c { right: 15%; bottom: 26%; color: var(--cyan); font-size: 11px; animation: twinkle 3.3s ease-in-out 0.4s infinite; }
.star-d { bottom: 19%; left: 32%; font-size: 12px; animation: twinkle 4.2s ease-in-out 0.7s infinite; }

.match-stack { position: absolute; z-index: 3; inset: 0; pointer-events: none; }
.match-card { position: absolute; width: min(300px, 82%); padding: 12px 14px 10px; border: 1px solid rgba(195, 216, 243, 0.16); border-radius: 7px; background: linear-gradient(135deg, rgba(24, 36, 54, 0.94), rgba(11, 18, 29, 0.97)); box-shadow: 0 18px 55px rgba(0, 0, 0, 0.43), inset 0 1px 0 rgba(255, 255, 255, 0.045); backdrop-filter: blur(18px); animation: card-float 5.5s ease-in-out infinite; }
.match-card-secondary { top: 55px; left: -16px; width: min(260px, 72%); opacity: 0.94; animation-delay: -1.7s; }
.match-card-primary { right: -5px; bottom: 25px; }
.match-card-heading, .match-card-footer { display: flex; align-items: center; justify-content: space-between; color: #8795a9; font-size: 7px; font-weight: 700; letter-spacing: 0.13em; }
.match-card-heading { padding-bottom: 9px; border-bottom: 1px solid rgba(196, 215, 239, 0.1); }
.matchday-label { color: var(--gold); }
.match-card-footer { padding-top: 8px; border-top: 1px solid rgba(196, 215, 239, 0.1); font-size: 6px; }
.fixture-status { color: #7f9dc7; }
.fixture { display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 11px 0; }
.club { display: grid; min-width: 0; flex: 1 1 0; justify-items: center; gap: 6px; color: #e0e8f4; font-size: 7px; font-weight: 700; letter-spacing: 0.075em; text-align: center; }
.club span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.club-crest { display: block; width: 37px; height: 37px; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35)); }
.fixture-versus { color: #647287; font-family: 'Space Grotesk', sans-serif; font-size: 8px; font-weight: 700; letter-spacing: 0.12em; }
.competition-strip { display: flex; min-height: 62px; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); color: #8794a8; }
.format-label { color: #68778d; font-size: 7px; font-weight: 700; letter-spacing: 0.16em; }
.format-item { color: #9ba8b9; font-size: 9px; white-space: nowrap; }
.format-item strong { color: #e1e9f5; font-family: 'Space Grotesk', sans-serif; font-size: 11px; font-weight: 600; }
.format-separator { width: 1px; height: 18px; background: rgba(184, 205, 231, 0.16); }
.ambient { position: fixed; z-index: -1; width: 300px; height: 300px; border-radius: 50%; pointer-events: none; filter: blur(100px); opacity: 0.1; }
.ambient-one { top: 20%; right: 5%; background: #286ed8; }

@keyframes rise-in { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@keyframes art-arrive { from { opacity: 0; transform: translateY(12px) scale(0.975); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes globe-float { 0%, 100% { margin-top: 0; } 50% { margin-top: -13px; } }
@keyframes card-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes orbit-drift { from { rotate: 0deg; } to { rotate: 360deg; } }
@keyframes halo-breathe { 0%, 100% { opacity: 0.72; scale: 0.94; } 50% { opacity: 1; scale: 1.07; } }
@keyframes twinkle { 0%, 100% { opacity: 0.4; scale: 0.8; } 50% { opacity: 1; scale: 1.15; } }
@media (max-width: 1100px) {
  .main-column { padding-right: 4vw; padding-left: 4vw; }
  .hero { grid-template-columns: minmax(340px, 0.95fr) minmax(380px, 1.05fr); gap: 0; }
  .hero-art { height: 530px; }
}

@media (max-width: 900px) {
  .side-rail { width: 54px; }
  .side-navigation { padding-top: 20px; }
  .nav-item { width: 38px; height: 38px; }
  .nav-item.is-active::before { left: -9px; }
  .main-column { width: calc(100% - 54px); margin-left: 54px; padding: 0 28px; }
  .topbar { height: 76px; }
  .hero { grid-template-columns: 1fr; gap: 0; min-height: auto; padding: 56px 0 30px; }
  .hero-copy { padding-top: 0; }
  .hero-art { width: min(100%, 590px); height: 530px; margin: 5px auto 0; }
  .competition-strip { justify-content: flex-start; gap: 11px 15px; padding: 17px 0 21px; }
  .format-label { flex-basis: 100%; }
  .format-separator { height: 14px; }
}

@media (max-width: 560px) {
  .side-rail { width: 50px; }
  .side-navigation { gap: 10px; padding-top: 17px; }
  .nav-item { width: 36px; height: 36px; border-radius: 9px; }
  .nav-item svg { width: 18px; height: 18px; }
  .nav-item.is-active::before { left: -7px; }
  .main-column { width: calc(100% - 50px); margin-left: 50px; padding: 0 14px; }
  .topbar { height: 69px; }
  .brand-mark { width: 25px; height: 25px; }
  .brand { gap: 8px; }
  .brand-name { gap: 6px; font-size: 10px; letter-spacing: 0.07em; }
  .hero { padding-top: 45px; }
  h1 { font-size: clamp(50px, 13vw, 68px); }
  .hero-description { max-width: 360px; margin-top: 18px; font-size: 13px; }
  .hero-actions { gap: 9px; margin-top: 25px; }
  .button { min-height: 48px; padding: 0 14px; font-size: 11px; }
  .button-primary { min-width: 145px; }
  .button-secondary { min-width: 135px; }
  .season-callout { padding: 8px 10px; font-size: 9px; }
  .hero-art { height: clamp(300px, 95vw, 390px); margin-top: 2px; }
  .orbit-scene { top: 0; width: 100%; }
  .match-card { width: min(276px, 88%); padding: 10px 11px 9px; }
  .match-card-secondary { top: 20px; left: -7px; width: min(230px, 78%); }
  .match-card-primary { right: -3px; bottom: 20px; }
  .club-crest { width: 32px; height: 32px; }
  .club { font-size: 6px; }
  .competition-strip { gap: 10px 11px; }
  .format-item { font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Home page: keep the feature art and format panel inside a deliberate viewport layout. */
.home-page main { display: grid; height: max(calc(100svh - 91px), 500px); grid-template-rows: minmax(0, 1fr) auto; }
.home-page .hero { height: 100%; min-height: 0; align-items: center; padding: 14px 0 18px; }
.home-page .hero-art { height: clamp(350px, min(580px, calc(100svh - 320px)), 580px); }
.home-page .competition-strip { min-height: 112px; grid-template-columns: minmax(175px, .75fr) minmax(0, 3fr); gap: 26px; padding: 14px 0 19px; border-top-color: rgba(167, 193, 225, .16); }
.home-page .format-heading { display: grid; align-content: center; gap: 8px; }
.home-page .format-label { color: #7d91ab; font-size: 9px; letter-spacing: .19em; }
.home-page .format-heading > strong { color: #f0f5fc; font-family: 'Space Grotesk', sans-serif; font-size: clamp(17px, 1.65vw, 23px); font-weight: 500; letter-spacing: -.045em; line-height: 1.22; }
.home-page .format-heading > strong span { color: #91baff; }
.home-page .format-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.home-page .format-item { position: relative; display: grid; min-height: 78px; align-content: center; justify-items: start; gap: 2px; padding: 5px 16px; border-left: 1px solid rgba(167, 193, 225, .12); white-space: normal; }
.home-page .format-item:first-child { border-left: 0; }
.home-page .format-index { position: absolute; top: 3px; right: 12px; color: #60728a; font-family: 'Space Grotesk', sans-serif; font-size: 9px; font-weight: 700; }
.home-page .format-item > strong { color: #aab6c8; font-family: 'Space Grotesk', sans-serif; font-size: clamp(17px, 1.4vw, 20px); font-weight: 600; letter-spacing: -.04em; line-height: 1.05; }
.home-page .format-item.is-final > strong { color: #f4cb78; }
.home-page .format-name { margin-top: 3px; color: #9eb4d1; font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.home-page .format-item small { color: #76869d; font-size: 9px; line-height: 1.35; }
.nav-item { width: 44px; height: 44px; }
.nav-item svg { width: 22px; height: 22px; }
.home-page main, .home-page .hero-art { overflow-anchor: none; }
.home-page .orbit-scene { overflow: clip; contain: paint; }
@media (max-width: 900px) {
  .home-page main { height: max(calc(100svh - 76px), 480px); }
  .home-page .hero { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 10px; padding: 12px 0 16px; }
  .home-page .hero-art { width: 100%; height: clamp(340px, min(510px, calc(100svh - 280px)), 510px); margin: 0; }
  .home-page .competition-strip { grid-template-columns: minmax(145px, .7fr) minmax(0, 3fr); gap: 13px; }
  .home-page .format-item { padding-inline: 10px; }
  .side-rail .nav-item { width: 40px; height: 40px; }
  .side-rail .nav-item svg { width: 21px; height: 21px; }
}
@media (max-width: 760px) {
  .home-page main { display: block; height: auto; min-height: 0; }
  .home-page .hero { display: grid; height: auto; min-height: 0; grid-template-columns: 1fr; gap: 0; padding: 45px 0 18px; }
  .home-page .hero-art { width: min(100%, 520px); height: clamp(280px, 76vw, 410px); margin: 0 auto; }
  .home-page .competition-strip { grid-template-columns: 1fr; gap: 14px; padding: 18px 0 24px; }
  .home-page .format-heading { grid-template-columns: 1fr auto; align-items: end; }
  .home-page .format-label { grid-column: 1 / -1; }
  .home-page .format-heading > strong { font-size: 21px; }
  .home-page .format-item { min-height: 77px; padding-inline: 12px; }
  .side-rail .nav-item { width: 38px; height: 38px; }
  .side-rail .nav-item svg { width: 20px; height: 20px; }
}
@media (max-width: 420px) {
  .home-page .format-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-page .format-item:nth-child(odd) { border-left: 0; }
  .home-page .format-item:nth-child(n + 3) { border-top: 1px solid rgba(167, 193, 225, .12); }
  .home-page .format-index { right: 8px; }
}

.nav-settings { margin-top: auto; }
.nav-settings svg { width: 21px; height: 21px; }
.settings-topbar-trigger { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; margin-left: auto; margin-right: 11px; border: 1px solid rgba(183, 205, 232, 0.14); border-radius: 50%; color: #a6b5c9; background: rgba(16, 23, 37, 0.62); cursor: pointer; transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease; }
.settings-topbar-trigger:hover { border-color: rgba(98, 224, 226, 0.42); color: var(--cyan); background: rgba(31, 56, 70, 0.6); transform: rotate(18deg); }
.settings-topbar-trigger svg { display: block; width: 19px; height: 19px; }
.nav-settings:hover:not(.is-active) { border-color: rgba(98, 224, 226, 0.3); color: var(--cyan); background: rgba(31, 56, 70, 0.3); }
.nav-settings:hover:not(.is-active) svg { transform: rotate(24deg); }
.nav-item svg { transform-origin: center; transition: transform 220ms ease; }
.nav-item:hover { color: var(--cyan); }
.nav-item:not(.is-active):hover { border-color: rgba(98, 224, 226, 0.3); background: rgba(31, 56, 70, 0.3); }
.nav-item:not(.nav-settings):hover svg { transform: rotate(24deg); }

html.app-settings-open { overflow: hidden; }
.app-settings-dialog { width: min(590px, calc(100% - 28px)); max-width: 590px; max-height: min(88vh, 760px); padding: 0; overflow: hidden; overscroll-behavior: contain; border: 1px solid rgba(188, 208, 237, 0.18); border-radius: 16px; color: var(--ink); background: linear-gradient(145deg, #121d2c, #080f1b); box-shadow: 0 28px 90px rgba(0, 0, 0, 0.65); }
.app-settings-dialog::backdrop { background: rgba(2, 5, 10, 0.78); backdrop-filter: blur(8px); }
.app-settings-shell { display: grid; max-height: min(88vh, 760px); grid-template-rows: auto minmax(0, 1fr) auto; }
.app-settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 24px 17px; border-bottom: 1px solid rgba(188, 208, 237, 0.1); }
.app-settings-heading h2 { margin: 0; color: #edf4fc; font-family: 'Space Grotesk', sans-serif; font-size: 26px; font-weight: 500; letter-spacing: -0.045em; }
.app-settings-kicker { margin: 0 0 5px; color: #7d91ab; font-size: 9px; font-weight: 700; letter-spacing: 0.16em; }
.app-settings-close { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid rgba(188, 208, 237, 0.14); border-radius: 10px; color: #afbed1; background: rgba(255, 255, 255, 0.03); font-size: 25px; line-height: 1; cursor: pointer; }
.app-settings-close:hover { border-color: rgba(98, 224, 226, 0.4); color: var(--cyan); }
.app-settings-content { overflow-y: auto; overscroll-behavior-y: contain; padding: 4px 24px 10px; scrollbar-color: rgba(123, 150, 185, 0.35) transparent; scrollbar-width: thin; }
.app-settings-section { padding: 18px 0 9px; border-bottom: 1px solid rgba(188, 208, 237, 0.09); }
.app-settings-section:last-child { border-bottom: 0; }
.app-settings-section-title { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
.app-settings-section-title > span { display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(98, 224, 226, 0.24); border-radius: 50%; color: var(--cyan); font-family: 'Space Grotesk', sans-serif; font-size: 9px; }
.app-settings-section-title h3 { margin: 1px 0 4px; color: #e3edf8; font-family: 'Space Grotesk', sans-serif; font-size: 15px; font-weight: 600; }
.app-settings-section-title p { margin: 0; color: #8493a8; font-size: 10px; line-height: 1.55; }
.app-setting-row { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 18px; margin-left: 37px; padding: 13px 0; border-top: 1px solid rgba(188, 208, 237, 0.06); }
.app-setting-copy { display: grid; min-width: 0; gap: 4px; }
.app-setting-copy strong { color: #dce6f2; font-size: 13px; font-weight: 600; }
.app-setting-copy > span { color: #8493a8; font-size: 11px; line-height: 1.55; }
.settings-choice-group { display: flex; flex: 0 0 auto; gap: 3px; padding: 3px; border: 1px solid rgba(188, 208, 237, 0.12); border-radius: 9px; background: rgba(4, 9, 17, 0.45); }
.settings-choice-group button { min-width: 54px; padding: 7px 9px; border: 1px solid transparent; border-radius: 6px; color: #8493a8; background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; transition: color 150ms ease, background 150ms ease, border-color 150ms ease; }
.settings-choice-group button:hover { color: #dbe8f7; }
.settings-choice-group button[aria-pressed="true"] { border-color: rgba(98, 224, 226, 0.2); color: #b7ffff; background: rgba(52, 126, 134, 0.25); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04); }
.app-setting-speed { align-items: flex-start; }
.settings-speed-control { display: grid; width: min(190px, 42%); flex: 0 0 auto; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; }
.settings-speed-control input { width: 100%; margin: 0; accent-color: var(--cyan); cursor: pointer; }
.settings-speed-control output { min-width: 34px; color: #c9eced; font-family: 'Space Grotesk', sans-serif; font-size: 13px; font-weight: 700; text-align: right; }
.settings-speed-labels { display: flex; grid-column: 1 / -1; justify-content: space-between; color: #748399; font-size: 9px; }
.app-setting-toggle { position: relative; padding-right: 55px; cursor: pointer; }
.app-setting-toggle input { position: absolute; z-index: 1; top: 50%; right: 0; width: 44px; height: 26px; margin: 0; opacity: 0; cursor: pointer; transform: translateY(-50%); }
.settings-switch { position: absolute; top: 50%; right: 0; width: 42px; height: 24px; border: 1px solid rgba(188, 208, 237, 0.2); border-radius: 99px; background: rgba(255, 255, 255, 0.07); pointer-events: none; transform: translateY(-50%); transition: border-color 160ms ease, background 160ms ease; }
.settings-switch::after { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #8998ad; content: ''; transition: background 160ms ease, transform 160ms ease; }
.app-setting-toggle input:checked + .settings-switch { border-color: rgba(98, 224, 226, 0.5); background: rgba(50, 151, 156, 0.32); }
.app-setting-toggle input:checked + .settings-switch::after { background: #8cf0ec; transform: translateX(18px); }
.app-setting-toggle input:focus-visible + .settings-switch { outline: 2px solid var(--cyan); outline-offset: 3px; }
.app-settings-footer { display: flex; min-height: 46px; align-items: center; justify-content: flex-start; padding: 10px 24px; border-top: 1px solid rgba(188, 208, 237, 0.1); }
.app-settings-reset { padding: 8px 12px; border: 1px solid rgba(188, 208, 237, 0.16); border-radius: 8px; color: #aab8ca; background: rgba(255, 255, 255, 0.035); font-size: 11px; font-weight: 600; cursor: pointer; transition: color 150ms ease, border-color 150ms ease, background 150ms ease; }
.app-settings-reset:hover { border-color: rgba(98, 224, 226, 0.38); color: #b7ffff; background: rgba(52, 126, 134, 0.18); }
.app-settings-reset:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
@media (max-width: 560px) {
  .app-settings-heading { padding: 17px 18px 14px; }
  .app-settings-content { padding-right: 18px; padding-left: 18px; }
  .app-settings-footer { padding-right: 18px; padding-left: 18px; }
  .app-setting-row { align-items: flex-start; flex-direction: column; gap: 10px; margin-left: 0; }
  .app-setting-goals { align-items: stretch; }
  .settings-choice-group { width: 100%; }
  .settings-choice-group button { flex: 1; }
  .settings-speed-control { width: 100%; }
  .app-setting-toggle { align-items: center; flex-direction: row; padding-right: 54px; }
}
