/* SkillAngels demo - aligned with skillangels.com brand */
:root {
  --sa-ink: #2c3e50;
  --sa-ink-soft: #5a6a7a;
  --sa-paper: #fff8f5;
  --sa-white: #ffffff;
  --sa-orange: #f16101;
  --sa-orange-deep: #d95400;
  --sa-gold: #ffb703;
  --sa-gold-deep: #fb8500;
  --sa-sky: #4cc9f0;
  --sa-mint: #06d6a0;
  --sa-mem: #ef476f;
  --sa-vis: #ffd166;
  --sa-foc: #06d6a0;
  --sa-ps: #f77f00;
  --sa-lin: #118ab2;
  --sa-blue-soft: #e3f2fd;
  --sa-peach: #fff0eb;
  --sa-radius: 22px;
  --sa-shadow: 0 14px 32px rgba(44, 62, 80, 0.1);
  --sa-shadow-lg: 0 22px 44px rgba(44, 62, 80, 0.14);
  --sa-font-display: "Baloo 2", "Noto Sans JP", "Noto Sans Tamil", sans-serif;
  --sa-font-body: "Nunito", "Noto Sans JP", "Noto Sans Tamil", sans-serif;
  --sa-shell: min(1160px, calc(100% - 32px));
  --sa-gap: 18px;
  --sa-pad: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body.sa-demo {
  margin: 0;
  min-height: 100vh;
  color: var(--sa-ink);
  font-family: var(--sa-font-body);
  background: linear-gradient(135deg, var(--sa-peach) 0%, #ffffff 48%, var(--sa-blue-soft) 100%);
  overflow-x: hidden;
}
body.sa-demo img { max-width: 100%; height: auto; display: block; }

.sa-shell {
  width: var(--sa-shell);
  margin-left: auto;
  margin-right: auto;
}

.sa-skip {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 999px;
  background: #fff;
  color: var(--sa-ink);
  font-weight: 700;
  text-decoration: none;
}
.sa-skip:focus { left: 12px; }

/* Topbar */
.sa-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 76px;
  padding: 12px clamp(14px, 3.5vw, 36px);
  overflow: visible;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(44, 62, 80, 0.06);
  box-shadow: 0 8px 24px rgba(44, 62, 80, 0.05);
}
.sa-brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--sa-ink);
  text-decoration: none;
  font-family: var(--sa-font-display);
  font-weight: 700;
  font-size: 1.05rem;
  min-width: 0;
}
.sa-logo {
  height: auto;
  object-fit: contain;
  display: block;
}
.sa-logo--top {
  /* Full lockup must fit inside topbar (aspect ~2.41) */
  width: 120px;
  height: auto;
  flex-shrink: 0;
}
.sa-logo--hero {
  width: min(300px, 78%);
  margin: 0 0 12px;
  filter: drop-shadow(0 8px 18px rgba(241, 97, 1, 0.12));
}

/* Pass-through wrappers (no overflow crop) */
.sa-logo-crop {
  display: block;
  line-height: 0;
  overflow: visible;
}
.sa-logo-crop--top {
  flex-shrink: 0;
}
.sa-logo-crop--hero {
  margin: 0 0 12px;
}
.sa-logo-crop--hero .sa-logo--hero {
  margin: 0;
}
.sa-brand-mark #saBrandTop {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 12ch;
  font-size: 0.95rem;
}
@media (max-width: 720px) {
  .sa-brand-mark #saBrandTop { display: none; }
  .sa-logo--top { width: 112px; }
}
.sa-lang {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff3d6, #e7fbff);
  color: var(--sa-ink);
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
}
.sa-lang label { margin: 0; white-space: nowrap; }
.sa-lang select {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid rgba(20, 35, 58, 0.1);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2314233a' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") right 10px center / 12px no-repeat;
  color: var(--sa-ink);
  border-radius: 999px;
  padding: 8px 34px 8px 12px;
  font: inherit;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  min-width: 118px;
  max-width: 46vw;
}
.sa-lang select:focus {
  border-color: var(--sa-lin);
  box-shadow: 0 0 0 3px rgba(17, 138, 178, 0.2);
}

/* Hero - SkillAngels.com peach/blue atmosphere */
.sa-hero {
  position: relative;
  isolation: isolate;
  padding-bottom: 8px;
  background:
    radial-gradient(620px 280px at 8% 0%, rgba(241, 97, 1, 0.12), transparent 60%),
    radial-gradient(560px 260px at 92% 8%, rgba(33, 150, 243, 0.12), transparent 55%),
    radial-gradient(480px 220px at 50% 100%, rgba(255, 183, 3, 0.1), transparent 50%);
}

.sa-hero__panel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: 28px;
  padding: 28px 0 18px;
  animation: saRise 0.7s ease both;
}

.sa-hero__content {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 0;
  text-align: left;
  max-width: 560px;
}

.sa-sr-only {
  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;
}

.sa-hero__brand {
  /* Visually hidden - logo carries the brand; h1 kept for a11y */
  margin: 0;
}
.sa-hero__mission {
  margin: 0 0 10px;
  max-width: 36ch;
  font-family: var(--sa-font-display);
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
  font-weight: 600;
  line-height: 1.35;
  color: var(--sa-orange);
}
.sa-hero__support {
  margin: 0 0 18px;
  max-width: 40ch;
  font-size: 1.02rem;
  line-height: 1.5;
  color: var(--sa-ink-soft);
}
.sa-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.sa-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.sa-trust li {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(44, 62, 80, 0.08);
  box-shadow: 0 6px 14px rgba(44, 62, 80, 0.06);
  color: var(--sa-ink);
  font-family: var(--sa-font-display);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
}

.sa-hero__skills {
  position: relative;
  min-height: 280px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto auto;
  gap: 12px 16px;
  place-items: center;
  padding: 18px 12px;
  align-content: center;
  border-radius: 28px;
  background:
    radial-gradient(180px 140px at 50% 45%, rgba(255, 255, 255, 0.95), transparent 70%),
    linear-gradient(160deg, rgba(255, 240, 235, 0.55), rgba(227, 242, 253, 0.45));
}
.sa-orb {
  width: 102px;
  height: 102px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 14px 28px rgba(20, 35, 58, 0.12);
  animation: saFloat 4.2s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.25s);
  color: var(--sa-ink);
  padding: 12px 8px;
  text-decoration: none !important;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  box-sizing: border-box;
}
.sa-orb:hover,
.sa-orb:focus {
  animation-play-state: paused;
  transform: translateY(-6px) scale(1.04);
  box-shadow: 0 18px 34px rgba(20, 35, 58, 0.18);
  outline: none;
}
.sa-orb:focus-visible {
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px currentColor;
}
.sa-orb:active {
  transform: translateY(-2px) scale(0.98);
}
.sa-orb svg {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}
.sa-orb em {
  font-style: normal;
  font-family: var(--sa-font-display);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.15;
  text-align: center;
  color: inherit;
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
}
/* Cross layout: Visual centered between both rows */
.sa-orb--mem { color: #c9184a; background: linear-gradient(160deg, #ffe3ea, #fff); border: 3px solid rgba(239, 71, 111, 0.35); grid-column: 1; grid-row: 1; justify-self: end; }
.sa-orb--foc { color: #067a5c; background: linear-gradient(160deg, #d9fff3, #fff); border: 3px solid rgba(6, 214, 160, 0.4); grid-column: 3; grid-row: 1; justify-self: start; }
.sa-orb--vis { color: #9a6b00; background: linear-gradient(160deg, #fff4cc, #fff); border: 3px solid rgba(244, 180, 0, 0.4); grid-column: 2; grid-row: 2; justify-self: center; }
.sa-orb--ps { color: #b45309; background: linear-gradient(160deg, #ffe4cc, #fff); border: 3px solid rgba(247, 127, 0, 0.4); grid-column: 1; grid-row: 3; justify-self: end; }
.sa-orb--lin { color: #0b6b8a; background: linear-gradient(160deg, #d7f2fb, #fff); border: 3px solid rgba(17, 138, 178, 0.4); grid-column: 3; grid-row: 3; justify-self: start; }

.sa-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--sa-orange);
  color: #fff;
  text-decoration: none;
  font-family: var(--sa-font-display);
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(241, 97, 1, 0.32);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.sa-cta:hover, .sa-cta:focus {
  transform: translateY(-2px);
  color: #fff;
  text-decoration: none;
  background: var(--sa-orange-deep);
  box-shadow: 0 16px 34px rgba(241, 97, 1, 0.4);
}
.sa-cta:focus-visible {
  outline: 3px solid rgba(241, 97, 1, 0.45);
  outline-offset: 3px;
}
.sa-cta:active { transform: translateY(0) scale(0.98); }
.sa-cta svg { width: 18px; height: 18px; }
.sa-cta--ghost {
  background: #fff;
  color: var(--sa-ink);
  border: 1px solid rgba(44, 62, 80, 0.1);
  box-shadow: 0 8px 20px rgba(44, 62, 80, 0.08);
}
.sa-cta--ghost:hover, .sa-cta--ghost:focus {
  color: var(--sa-ink);
  background: #fff;
  border-color: rgba(241, 97, 1, 0.35);
}

/* Main */
.sa-main {
  margin-top: 12px;
  margin-bottom: 56px;
  position: relative;
  z-index: 3;
}
.sa-kicker {
  display: inline-block;
  margin-bottom: 8px;
  padding: 6px 14px;
  border-radius: 30px;
  background: linear-gradient(135deg, #2196f3, #118ab2);
  color: #fff;
  font-family: var(--sa-font-display);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 8px 18px rgba(17, 138, 178, 0.25);
}
.sa-section-head { margin: 0 0 14px; }
.sa-section-head h2 {
  margin: 0;
  font-family: var(--sa-font-display);
  font-size: clamp(1.4rem, 2.8vw, 1.95rem);
  font-weight: 750;
  color: var(--sa-ink);
  border: none;
  background: none;
}
.sa-section-head p {
  margin: 8px 0 0;
  color: var(--sa-ink-soft);
  font-size: 1rem;
  max-width: min(100%, 62rem);
  line-height: 1.45;
}
/* Tamil/Japanese glyphs are wider than Latin `ch`, so don't force early wraps. */
html[lang="ta"] .sa-section-head p,
html[lang="ja"] .sa-section-head p {
  max-width: none;
  white-space: nowrap;
}
@media (max-width: 820px) {
  html[lang="ta"] .sa-section-head p,
  html[lang="ja"] .sa-section-head p {
    white-space: normal;
  }
}

/* Skeleton */
#gamelist.is-loading .sa-skeleton {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--sa-gap);
}
.sa-skeleton { display: none; }
#gamelist.is-loading > .sa-skeleton { display: grid; }
#gamelist.is-loading > :not(.sa-skeleton) { display: none !important; }
.sa-skeleton span {
  min-height: 320px;
  border-radius: 18px;
  background: linear-gradient(90deg, rgba(232, 238, 248, 0.7), rgba(255, 255, 255, 0.9), rgba(232, 238, 248, 0.7));
  background-size: 200% 100%;
  animation: saShimmer 1.2s linear infinite;
}

/* Games - shared soft stage, light columns (not heavy cards) */
.sa-games {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px 12px;
  align-items: stretch;
  padding: 18px 14px 14px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 248, 245, 0.55));
  border: 1px solid rgba(44, 62, 80, 0.06);
}

.sa-game {
  --accent: var(--sa-mem);
  --accent-soft: #ffe3ea;
  --accent-ink: #fff;
  --enter-delay: 0.05s;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100%;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  opacity: 0;
  transform: translateY(14px);
  transition: transform 0.25s ease, opacity 0.45s ease, background 0.25s ease;
  scroll-margin-top: 96px;
  position: relative;
  padding: 8px 6px 10px;
}
.sa-game + .sa-game::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 18px;
  bottom: 18px;
  width: 1px;
  background: rgba(44, 62, 80, 0.08);
  pointer-events: none;
}
.sa-game.is-visible {
  opacity: 1;
  transform: translateY(0);
  animation: saRise 0.55s ease both;
  animation-delay: var(--enter-delay);
}
.sa-game--mem { --accent: var(--sa-mem); --accent-soft: #ffe3ea; }
.sa-game--vis { --accent: #f4b400; --accent-soft: #fff4cc; --accent-ink: #3a2c00; }
.sa-game--foc { --accent: var(--sa-foc); --accent-soft: #d9fff3; --accent-ink: #083b2e; }
.sa-game--ps { --accent: var(--sa-ps); --accent-soft: #ffe4cc; }
.sa-game--lin { --accent: var(--sa-lin); --accent-soft: #d7f2fb; }

.sa-game:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.45);
  border-radius: 18px;
}
.sa-game.is-visible:hover {
  transform: translateY(-3px);
}
.sa-game:focus-within {
  outline: 2px solid color-mix(in srgb, var(--accent) 40%, white);
  outline-offset: 2px;
  border-radius: 18px;
}
.sa-game--pulse {
  animation: saCardPulse 0.85s ease !important;
}

.sa-game__meta {
  padding: 6px 8px 10px;
  background: transparent;
  color: var(--sa-ink);
  min-height: 3.4rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 4px;
  text-align: center;
  border-top: 3px solid var(--accent);
  border-radius: 2px 2px 0 0;
}
.sa-game__skill {
  margin: 0;
  font-family: var(--sa-font-display);
  font-size: clamp(0.8rem, 0.95vw, 0.96rem);
  font-weight: 750;
  line-height: 1.2;
  min-height: 2.4em;
  max-width: 100%;
  color: var(--sa-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  text-wrap: balance;
}
.sa-game__grade {
  display: inline-flex;
  align-self: center;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: none;
  color: var(--sa-ink-soft);
}

.sa-game__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 8px 6px 4px;
  text-align: center;
  background: transparent;
}
.sa-game__art {
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.sa-game__art img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  transition: transform 0.25s ease;
}
.sa-game:hover .sa-game__art img { transform: translateY(-2px) scale(1.03); }
.sa-game__name {
  margin: 0;
  min-height: 2.4em;
  display: grid;
  place-items: center;
  font-family: var(--sa-font-display);
  font-size: 1.05rem;
  font-weight: 750;
  color: var(--sa-ink);
  line-height: 1.2;
}
.sa-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 148px;
  min-height: 42px;
  padding: 9px 14px;
  border-radius: 999px;
  border: none;
  background: var(--accent) !important;
  color: var(--accent-ink) !important;
  text-decoration: none !important;
  font-family: var(--sa-font-display) !important;
  font-size: 0.88rem !important;
  font-weight: 750 !important;
  text-transform: none !important;
  box-shadow: none;
  transition: transform 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.sa-play:hover, .sa-play:focus {
  filter: brightness(1.06);
  transform: scale(1.03);
  color: var(--accent-ink) !important;
  box-shadow: none;
}
.sa-play:active {
  transform: scale(0.98);
}
.sa-play--done,
.sa-play--done:hover,
.sa-play--done:focus,
.sa-play--done:active {
  background: #8b97a8 !important;
  color: #fff !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
  cursor: default !important;
  pointer-events: none;
  opacity: 0.9;
}

.sa-game__score {
  margin: 2px 4px 4px;
  padding: 10px 6px 8px !important;
  background: transparent !important;
  height: auto !important;
  width: auto !important;
  text-align: center;
  border: none !important;
  border-radius: 0 !important;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
}
.sa-score-disk {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto;
  flex-shrink: 0;
}
.sa-score-track {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.sa-score-track i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 17px;
  height: 22px;
  margin: -11px 0 0 -8.5px;
  border-radius: 5px;
  background: #c5ccd6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transform-origin: 50% 50%;
  transform: rotate(calc(var(--i, 0) * 36deg)) translateY(-52px);
}
.sa-score-track i:nth-child(1) { --i: 0; }
.sa-score-track i:nth-child(2) { --i: 1; }
.sa-score-track i:nth-child(3) { --i: 2; }
.sa-score-track i:nth-child(4) { --i: 3; }
.sa-score-track i:nth-child(5) { --i: 4; }
.sa-score-track i:nth-child(6) { --i: 5; }
.sa-score-track i:nth-child(7) { --i: 6; }
.sa-score-track i:nth-child(8) { --i: 7; }
.sa-score-track i:nth-child(9) { --i: 8; }
.sa-score-track i:nth-child(10) { --i: 9; }
.sa-score-track i.is-on {
  background: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.sa-game--vis .sa-score-track i.is-on { background: #f4b400; }
.sa-score-label {
  position: absolute !important;
  z-index: 2;
  left: 50%;
  top: 34%;
  transform: translate(-50%, -50%);
  display: block !important;
  width: max-content !important;
  max-width: 112px !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 4px !important;
  line-height: 1.15 !important;
  font-size: 0.62rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase;
  color: var(--sa-ink-soft) !important;
  text-shadow: none !important;
  box-shadow: none !important;
  background: none !important;
  border: none !important;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html[lang="ta"] .sa-score-label,
html[lang="ja"] .sa-score-label {
  font-size: 0.58rem !important;
  letter-spacing: 0.02em !important;
  max-width: 108px !important;
}
.sa-game__score span[id^="ulscore"] {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 140px !important;
  height: 140px !important;
  margin: 0 !important;
  padding: 22px 8px 0 !important;
  box-sizing: border-box !important;
  background: none !important;
  background-image: none !important;
  line-height: 1.1 !important;
  text-align: center !important;
  color: var(--sa-ink) !important;
  font-family: var(--sa-font-display);
  font-size: 1.05rem !important;
  font-weight: 800;
  letter-spacing: 0 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
  box-shadow: none !important;
  border-radius: 0 !important;
  border: none !important;
  transition: transform 0.25s ease;
}
.sa-game__score span[id^="ulscore"].sa-score-pop {
  animation: saScorePop 0.55s ease;
}

/* Kill legacy square score borders that clip on rounded cards */
body.sa-demo .gamePercentageMemory,
body.sa-demo .gamePercentageVP,
body.sa-demo .gamePercentageFG,
body.sa-demo .gamePercentagePS,
body.sa-demo .gamePercentageL,
body.sa-demo .sa-game__score.gamePercentageMemory,
body.sa-demo .sa-game__score.gamePercentageVP,
body.sa-demo .sa-game__score.gamePercentageFG,
body.sa-demo .sa-game__score.gamePercentagePS,
body.sa-demo .sa-game__score.gamePercentageL {
  background: #fff !important;
  height: auto !important;
  width: auto !important;
  border: 2px solid var(--accent) !important;
  border-radius: 16px !important;
  padding: 12px 10px 14px !important;
}

/* Progress */
.sa-progress {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sa-gap);
  align-items: stretch;
  scroll-margin-top: 88px;
}
.sa-calc-note {
  margin: 18px 0 0;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(20, 35, 58, 0.08);
  color: var(--sa-ink-soft);
  font-size: 0.92rem;
  line-height: 1.5;
  text-align: center;
}
.sa-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  background: #fff;
  border-radius: calc(var(--sa-radius) + 2px);
  box-shadow: var(--sa-shadow);
  padding: 20px 18px 18px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.25s ease;
}
.sa-panel.is-visible {
  opacity: 1;
  transform: translateY(0);
  animation: saRise 0.55s ease 0.12s both;
}
.sa-panel .contentbox,
.sa-panel .starRatingContainer {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.sa-panel .sa-stars-total,
.sa-panel [class^="starsCount"] {
  margin-top: auto !important;
}
.sa-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: linear-gradient(180deg, var(--sa-sky), var(--sa-lin));
}
.sa-skills::before {
  background: linear-gradient(180deg, var(--sa-gold), var(--sa-mem));
}
.sa-panel__chip {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(17, 138, 178, 0.12);
  color: var(--sa-lin);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.sa-panel__chip--stars {
  background: rgba(239, 71, 111, 0.12);
  color: var(--sa-mem);
}
.sa-panel__title {
  margin: 0 0 6px;
  font-family: var(--sa-font-display);
  font-size: 1.15rem;
  font-weight: 750;
  color: var(--sa-ink);
  border: none;
  background: none;
}
.sa-panel__hint {
  margin: 0 0 12px;
  color: var(--sa-ink-soft);
  font-size: 0.92rem;
}
.sa-bspi #chart-container { min-height: 200px; text-align: center; }
.sa-bspi-value, .bspivalue {
  margin-top: 6px;
  text-align: center;
  font-family: var(--sa-font-display);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--sa-ink);
  background: transparent !important;
}
.bspivalue #bspivalue, .sa-bspi-value #bspivalue {
  color: var(--sa-gold-deep);
  font-size: 1.6rem;
  font-weight: 800;
}

.sa-stars-list { list-style: none; margin: 0; padding: 0; width: 100%; }
.sa-stars-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: transparent !important;
  color: var(--sa-ink) !important;
  height: auto !important;
  line-height: 1.3 !important;
  min-height: 44px;
}
.sa-stars-list li:nth-child(odd) { background: #f3f8ff !important; }
.sa-stars-list li:nth-child(1) { border-left: 4px solid var(--sa-mem); }
.sa-stars-list li:nth-child(2) { border-left: 4px solid var(--sa-vis); }
.sa-stars-list li:nth-child(3) { border-left: 4px solid var(--sa-foc); }
.sa-stars-list li:nth-child(4) { border-left: 4px solid var(--sa-ps); }
.sa-stars-list li:nth-child(5) { border-left: 4px solid var(--sa-lin); }
.sa-stars-list p {
  margin: 0;
  width: auto !important;
  max-width: 48%;
  float: none !important;
  flex: 1 1 auto;
  font-weight: 700;
  font-size: 0.9rem;
  text-align: left;
  line-height: 1.25 !important;
}
.sa-stars-list .ratingStars {
  float: none !important;
  width: auto !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  gap: 3px;
  margin: 0 !important;
}
.sa-stars-list .ratingStars span {
  float: none !important;
  display: block !important;
  margin: 0 !important;
  margin-top: 0 !important;
}
.sa-stars-total {
  position: relative !important;
  clear: both !important;
  margin: 16px 0 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px !important;
  border-radius: 16px !important;
  background: linear-gradient(135deg, #ef476f, #fb8500 55%, #ffd166) !important;
  color: #1a1404 !important;
  font-family: var(--sa-font-display);
  font-weight: 750;
  text-shadow: none !important;
  float: none !important;
  height: auto !important;
  min-height: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  line-height: 1.2 !important;
  box-sizing: border-box !important;
}
.sa-stars-total #saStarsTotalLabel {
  font-size: 1rem !important;
  font-weight: 750;
}
.sa-stars-total #totalstars {
  font-size: 1.7rem !important;
  color: #1a1404 !important;
  line-height: 1 !important;
  margin: 0 !important;
}

/* Stars panel layout - kill legacy float overlap */
body.sa-demo .starRatingContainer {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 0;
  width: 100% !important;
  text-align: left !important;
  overflow: visible !important;
}
body.sa-demo .gameRating,
body.sa-demo ul.sa-stars-list {
  float: none !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 0 4px !important;
  padding: 0 !important;
  list-style: none !important;
}
body.sa-demo .gameRating li {
  float: none !important;
  height: auto !important;
  line-height: 1.3 !important;
  width: 100% !important;
  box-sizing: border-box;
}
body.sa-demo .skillHead {
  width: auto !important;
  float: none !important;
  display: inline !important;
}
body.sa-demo .sa-stars-total,
body.sa-demo .starsCount,
body.sa-demo .starsCount_EN,
body.sa-demo .starsCount_TN,
body.sa-demo .starsCount_JP,
body.sa-demo [class^="starsCount"] {
  background: linear-gradient(135deg, #ef476f, #fb8500 55%, #ffd166) !important;
  color: #1a1404 !important;
  text-shadow: none !important;
  float: none !important;
  clear: both !important;
  position: static !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin: 16px 0 0 !important;
  margin-top: 16px !important;
  margin-right: 0 !important;
  height: auto !important;
  min-height: 52px !important;
  width: 100% !important;
  max-width: 100% !important;
  font-size: inherit !important;
  line-height: 1.2 !important;
  text-align: left !important;
  padding: 14px 16px !important;
  border-radius: 16px !important;
  box-sizing: border-box !important;
}

/* Legacy overrides */
body.sa-demo .gamesInner,
body.sa-demo .contentbox,
body.sa-demo .playGames,
body.sa-demo .container.playGames {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  width: auto !important;
  max-width: none !important;
  float: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
body.sa-demo .sa-panel.gamesInner,
body.sa-demo .sa-panel.brainPower,
body.sa-demo .sa-panel.skills {
  background: #fff !important;
  width: auto !important;
  float: none !important;
  margin: 0 !important;
  padding: 20px 18px 18px !important;
  border-radius: calc(var(--sa-radius) + 2px) !important;
  box-shadow: var(--sa-shadow) !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column;
}
body.sa-demo .row { margin: 0; }
body.sa-demo h2 { color: var(--sa-ink); }
body.sa-demo .MemoryGame,
body.sa-demo .VisualProcessingGame,
body.sa-demo .FocusGame,
body.sa-demo .ProblemSolvingGame,
body.sa-demo .LinguisticsGame {
  border-radius: 28px !important;
  background: transparent !important;
  border: none !important;
}
body.sa-demo .gamePercentageMemory,
body.sa-demo .gamePercentageVP,
body.sa-demo .gamePercentageFG,
body.sa-demo .gamePercentagePS,
body.sa-demo .gamePercentageL {
  /* handled with .sa-game__score rules above */
}
body.sa-demo .sa-stars-total #totalstars,
body.sa-demo [class^="starsCount"] #totalstars {
  font-size: 1.7rem !important;
  line-height: 1 !important;
  color: #1a1404 !important;
  float: none !important;
  display: inline-block !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  text-shadow: none !important;
}
body.sa-demo .fusioncharts-container,
body.sa-demo #chart-container svg { background: transparent !important; }
body.sa-demo tspan { fill: var(--sa-ink-soft) !important; }
body.sa-demo .skillHead { width: auto !important; float: none !important; display: inline !important; }

body.sa-demo .memortStar,
body.sa-demo .VPStar,
body.sa-demo .FAStar,
body.sa-demo .PSStar,
body.sa-demo .linguisticsStar,
body.sa-demo .emptyStar {
  float: none !important;
  margin: 0 2px 0 0 !important;
  margin-top: 0 !important;
}

@keyframes saRise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes saFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes saPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.14); }
}
@keyframes saShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@keyframes saCardPulse {
  0% { transform: translateY(0) scale(1); box-shadow: var(--sa-shadow); }
  35% { transform: translateY(-4px) scale(1.035); box-shadow: var(--sa-shadow-lg); }
  70% { transform: translateY(-2px) scale(1.015); }
  100% { transform: translateY(0) scale(1); box-shadow: var(--sa-shadow); }
}
@keyframes saScorePop {
  0% { transform: scale(0.86); }
  55% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@media (max-width: 1100px) {
  .sa-games,
  #gamelist.is-loading .sa-skeleton { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sa-game + .sa-game::before { display: none; }
  .sa-hero__panel { gap: 18px; }
}
@media (max-width: 820px) {
  .sa-progress { grid-template-columns: 1fr; }
  .sa-games,
  #gamelist.is-loading .sa-skeleton { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sa-game__meta { min-height: 0; }
  .sa-hero__panel {
    grid-template-columns: 1fr;
    padding: 20px 0 8px;
  }
  .sa-hero__content {
    max-width: none;
    text-align: center;
  }
  .sa-hero__mission,
  .sa-hero__support { margin-left: auto; margin-right: auto; }
  .sa-trust { justify-content: center; }
  .sa-logo--hero { margin-left: auto; margin-right: auto; }
  .sa-hero__actions {
    justify-content: center;
    flex-wrap: wrap;
  }
  .sa-logo-crop--hero { margin-left: auto; margin-right: auto; }
  .sa-hero__skills {
    min-height: 220px;
    max-width: 360px;
    margin: 0 auto;
  }
  .sa-orb { width: 86px; height: 86px; border-radius: 22px; }
  .sa-orb svg { width: 28px; height: 28px; }
  .sa-orb em { font-size: 0.62rem; }
  .sa-section-head { text-align: center; }
  .sa-section-head p { margin-left: auto; margin-right: auto; }
  .sa-play { max-width: none; min-height: 48px; font-size: 0.95rem !important; }
  .sa-lang select {
    min-height: 42px;
    min-width: 132px;
    font-size: 1rem;
  }
}
@media (max-width: 640px) {
  :root { --sa-shell: calc(100% - 24px); --sa-gap: 14px; }
  .sa-topbar {
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    min-height: 56px;
  }
  .sa-brand-mark { font-size: 0.92rem; }
  .sa-logo--top { width: 96px; }
  .sa-logo--hero { width: min(220px, 68%); }
  .sa-hero__actions {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
  .sa-cta {
    width: 100%;
    max-width: 320px;
    min-height: 52px;
  }
  .sa-games,
  #gamelist.is-loading .sa-skeleton { grid-template-columns: 1fr; }
  .sa-main {
    margin-bottom: calc(108px + env(safe-area-inset-bottom, 0px));
    margin-top: 8px;
  }
  .sa-hero__skills {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto auto;
    gap: 8px 10px;
    min-height: 0;
    max-width: 300px;
    margin: 4px auto 0;
  }
  .sa-orb--mem,
  .sa-orb--vis,
  .sa-orb--foc,
  .sa-orb--ps,
  .sa-orb--lin {
    width: 84px;
    height: 84px;
    min-width: 84px;
    min-height: 84px;
    border-radius: 20px;
    padding: 8px 6px;
    margin: 0;
  }
  .sa-orb--mem { grid-column: 1; grid-row: 1; justify-self: end; }
  .sa-orb--foc { grid-column: 3; grid-row: 1; justify-self: start; }
  .sa-orb--vis { grid-column: 2; grid-row: 2; justify-self: center; }
  .sa-orb--ps { grid-column: 1; grid-row: 3; justify-self: end; }
  .sa-orb--lin { grid-column: 3; grid-row: 3; justify-self: start; }
  .sa-orb svg { width: 26px; height: 26px; }
  .sa-orb em { font-size: 0.62rem; }
  .sa-score-disk {
    width: 120px;
    height: 120px;
  }
  .sa-score-label {
    max-width: 96px !important;
    font-size: 0.55rem !important;
  }
  .sa-score-track i {
    width: 14px;
    height: 18px;
    margin: -9px 0 0 -7px;
    transform: rotate(calc(var(--i, 0) * 36deg)) translateY(-44px);
  }
  .sa-game__score span[id^="ulscore"] {
    width: 120px !important;
    height: 120px !important;
    background: none !important;
    line-height: 1.1 !important;
    padding-top: 18px !important;
  }
}
@media (max-width: 380px) {
  .sa-hero__skills {
    max-width: 260px;
    gap: 6px 8px;
  }
  .sa-orb--mem,
  .sa-orb--vis,
  .sa-orb--foc,
  .sa-orb--ps,
  .sa-orb--lin {
    width: 74px;
    height: 74px;
    min-width: 74px;
    min-height: 74px;
    border-radius: 18px;
  }
  .sa-lang label { display: none; }
  .sa-brand-mark #saBrandTop { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .sa-game,
  .sa-panel {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Fallback where color-mix unsupported */
@supports not (background: color-mix(in srgb, red 50%, white)) {
  .sa-game__meta { border-top-color: var(--accent); background: transparent; }
  .sa-game__score span[id^="ulscore"] { box-shadow: inset 0 0 0 3px rgba(20, 35, 58, 0.15); }
  .sa-game:focus-within { outline-color: rgba(17, 138, 178, 0.4); }
}
