:root {
  color-scheme: light;
  --atlas-bg: #f4ebdb;
  --atlas-paper: #fff9ee;
  --atlas-paper-soft: #f8f0e2;
  --atlas-linen: #eae1d3;
  --atlas-text: #253432;
  --atlas-ink-soft: #405b55;
  --atlas-muted: #66756b;
  --atlas-line: rgba(117, 143, 128, 0.38);
  --atlas-line-strong: rgba(96, 128, 111, 0.58);
  --atlas-sage: #77a17e;
  --atlas-sage-ink: #4b7159;
  --atlas-sage-soft: #d3e2cb;
  --atlas-sky: #87aeb8;
  --atlas-sky-soft: #d9e6e4;
  --atlas-honey: #e2a037;
  --atlas-honey-soft: #f4dfb7;
  --atlas-red: #e25d68;
  --atlas-blue: #5d9fe4;
  --atlas-purple: #aa52d7;
  --atlas-cyan: #71c8d6;
  --atlas-mint: #84dfb4;
  --atlas-shadow: rgba(67, 50, 30, 0.14);
  --atlas-shadow-strong: rgba(67, 50, 30, 0.22);
  --atlas-max: 1240px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(132, 176, 154, 0.11) 1px, transparent 1px) 0 0 / 188px 100%,
    radial-gradient(circle at 10% 8%, rgba(135, 174, 184, 0.22), transparent 24rem),
    radial-gradient(circle at 91% 38%, rgba(226, 160, 55, 0.13), transparent 26rem),
    linear-gradient(180deg, rgba(255, 249, 238, 0.9), rgba(234, 225, 211, 0.75)),
    var(--atlas-bg);
  color: var(--atlas-text);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  border: 2px solid var(--atlas-text);
  border-radius: 0.55rem;
  background: var(--atlas-paper);
  font-weight: 850;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.atlas-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 2rem, var(--atlas-max));
  min-height: 86px;
  margin: 0 auto;
  border-bottom: 1px solid var(--atlas-line);
}

.atlas-brand,
.back-link {
  display: inline-flex;
  align-items: center;
}

.atlas-brand {
  gap: 0.72rem;
  min-width: 0;
}

.atlas-brand img {
  display: block;
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(67, 50, 30, 0.14));
}

.atlas-brand strong,
.atlas-brand small {
  display: block;
}

.atlas-brand strong {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.atlas-brand small {
  margin-top: 0.12rem;
  color: var(--atlas-muted);
  font-size: 0.74rem;
  font-weight: 750;
  text-transform: uppercase;
}

.back-link {
  gap: 0.52rem;
  min-height: 42px;
  padding: 0.65rem 0.85rem;
  border-radius: 0.55rem;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.back-link span {
  color: var(--atlas-sage-ink);
  font-size: 1.15rem;
  line-height: 1;
}

.back-link:hover,
.back-link:focus-visible {
  background: rgba(119, 161, 126, 0.12);
  outline: 2px solid rgba(119, 161, 126, 0.32);
  outline-offset: 2px;
}

.atlas-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(360px, 0.88fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  width: min(100% - 2rem, var(--atlas-max));
  min-height: 0;
  margin: 0 auto;
  padding: clamp(1.65rem, 3vw, 2.6rem) 0 clamp(1.25rem, 2.5vw, 2rem);
}

.atlas-hero::before {
  content: "1  10  100  1,000  10,000  100,000";
  position: absolute;
  z-index: -1;
  top: 15%;
  right: 3%;
  color: rgba(96, 128, 111, 0.1);
  font-size: clamp(1rem, 2vw, 1.65rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  white-space: nowrap;
  transform: rotate(-4deg);
}

.eyebrow {
  margin: 0 0 0.7rem;
  color: var(--atlas-sage-ink);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(2.2rem, 3.4vw, 3.45rem);
  line-height: 0.9;
  letter-spacing: -0.065em;
  text-transform: uppercase;
  text-wrap: balance;
  text-shadow: 0 10px 0 rgba(255, 249, 238, 0.72), 0 25px 48px var(--atlas-shadow);
}

.hero-copy h1 span {
  color: var(--atlas-sage-ink);
}

.atlas-hero-intro {
  max-width: 610px;
  margin: 0.9rem 0 0;
  color: var(--atlas-ink-soft);
  font-size: clamp(0.92rem, 1.35vw, 1.06rem);
  line-height: 1.5;
}

.atlas-hero-challenge {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  width: fit-content;
  min-height: 58px;
  margin-top: 1.1rem;
  padding: 0.62rem 0.78rem;
  border: 2px solid #4e2861;
  border-radius: 0.8rem;
  background: linear-gradient(135deg, #f6e6aa, #edc8ef);
  color: #4e2861;
  font-size: 0.92rem;
  font-weight: 950;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  box-shadow: 0 6px 0 #4e2861, 0 14px 24px rgba(67, 50, 30, 0.12);
  transform: translateY(-2px);
  transition: transform 130ms ease, box-shadow 130ms ease, background 130ms ease;
}

.atlas-hero-challenge small {
  display: block;
  margin-bottom: 0.08rem;
  color: #875a85;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
}

.atlas-hero-challenge-star {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #7c4296;
  color: #ffd95a;
  font-size: 1rem;
  box-shadow: 0 3px 0 #4e2861;
}

.atlas-hero-challenge-arrow {
  font-size: 1.15rem;
}

.atlas-hero-challenge:hover,
.atlas-hero-challenge:focus-visible {
  background: linear-gradient(135deg, #ffd95a, #f3bbd2);
  box-shadow: 0 3px 0 #4e2861, 0 10px 18px rgba(67, 50, 30, 0.15);
  outline: 3px solid rgba(170, 82, 215, 0.22);
  outline-offset: 3px;
  transform: translateY(1px);
}

.number-search {
  position: relative;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--atlas-line-strong);
  border-radius: 0.85rem;
  background:
    linear-gradient(135deg, rgba(135, 174, 184, 0.15), transparent 42%),
    rgba(255, 249, 238, 0.94);
  box-shadow: 0 18px 0 rgba(67, 50, 30, 0.045), 0 28px 54px var(--atlas-shadow);
}

.number-search::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 18%;
  width: 64%;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.62);
  filter: blur(2px);
}

.number-search > label {
  display: block;
  margin-bottom: 0.65rem;
  font-size: 0.77rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.number-search-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.35rem;
  min-height: 68px;
  padding: 0.38rem;
  border: 1px solid var(--atlas-line);
  border-radius: 0.7rem;
  background: var(--atlas-paper);
  box-shadow: inset 0 2px 5px rgba(67, 50, 30, 0.07);
}

.search-mark {
  padding-left: 0.65rem;
  color: var(--atlas-sage-ink);
  font-size: 1.45rem;
  font-weight: 900;
}

.number-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--atlas-text);
  font-size: clamp(1.45rem, 4vw, 2.15rem);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.number-search-row:focus-within {
  border-color: var(--atlas-sage-ink);
  box-shadow: 0 0 0 3px rgba(119, 161, 126, 0.17), inset 0 2px 5px rgba(67, 50, 30, 0.07);
}

.atlas-button,
.share-actions button,
.number-stepper button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--atlas-line-strong);
  border-radius: 0.58rem;
  background: var(--atlas-paper);
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: 0 5px 0 rgba(67, 50, 30, 0.09);
  cursor: pointer;
  transition: transform 130ms ease, box-shadow 130ms ease, background-color 130ms ease;
}

.atlas-button {
  min-height: 48px;
  padding: 0.78rem 1.15rem;
  font-size: 0.78rem;
}

.atlas-button.primary {
  border-color: rgba(119, 161, 126, 0.58);
  background: var(--atlas-sage-soft);
}

.atlas-button.secondary {
  background: var(--atlas-sky-soft);
}

.atlas-button:hover,
.atlas-button:focus-visible,
.share-actions button:hover,
.share-actions button:focus-visible,
.number-stepper button:hover,
.number-stepper button:focus-visible {
  background: var(--atlas-honey-soft);
  outline: 2px solid rgba(226, 160, 55, 0.3);
  outline-offset: 2px;
  transform: translateY(-1px);
  box-shadow: 0 7px 0 rgba(67, 50, 30, 0.08);
}

.atlas-button:active,
.share-actions button:active,
.number-stepper button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(67, 50, 30, 0.08);
}

.search-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.8rem;
}

.search-meta p,
.form-error {
  margin: 0;
  color: var(--atlas-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.text-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 34px;
  padding: 0.25rem 0.15rem;
  border: 0;
  background: transparent;
  color: var(--atlas-sage-ink);
  font-size: 0.77rem;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.text-action:hover,
.text-action:focus-visible {
  color: var(--atlas-text);
  outline: 2px solid rgba(119, 161, 126, 0.3);
  outline-offset: 3px;
}

.form-error {
  margin-top: 0.7rem;
  padding: 0.65rem 0.75rem;
  border-left: 3px solid var(--atlas-red);
  background: rgba(226, 93, 104, 0.09);
  color: #963944;
  font-weight: 750;
}

.number-suggestions {
  position: absolute;
  right: 0;
  bottom: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  max-width: none;
  flex-wrap: wrap;
}

.number-suggestions > span {
  margin-right: 0.25rem;
  color: var(--atlas-muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.number-suggestions a {
  padding: 0.35rem 0.56rem;
  border: 1px solid var(--atlas-line);
  border-radius: 999px;
  background: rgba(255, 249, 238, 0.68);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.number-suggestions a:hover,
.number-suggestions a:focus-visible {
  border-color: var(--atlas-sage-ink);
  background: var(--atlas-paper);
  outline: 2px solid rgba(119, 161, 126, 0.24);
  outline-offset: 2px;
}

.atlas-workspace {
  padding: clamp(0.4rem, 1vw, 0.85rem) 0 clamp(4.5rem, 9vw, 7rem);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  width: min(100% - 2rem, var(--atlas-max));
  margin: 0 auto;
}

.visualization-card,
.profile-card,
.detail-card {
  border: 1px solid var(--atlas-line);
  border-radius: 0.85rem;
  background: rgba(255, 249, 238, 0.91);
  box-shadow: 0 25px 52px var(--atlas-shadow);
}

.visualization-card {
  min-width: 0;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(67, 50, 30, 0.18);
}

.number-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1rem, 2.6vw, 1.55rem);
  border-bottom: 1px solid var(--atlas-line);
}

.number-heading h2 {
  margin: 0;
  font-size: clamp(2.7rem, 4.7vw, 4.25rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.065em;
  line-height: 0.86;
}

.number-words {
  max-width: 690px;
  margin: 0.25rem 0 0;
  color: var(--atlas-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.number-form-label {
  display: block;
  margin-top: 0.9rem;
  color: var(--atlas-ink);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.number-stepper {
  display: flex;
  gap: 0.45rem;
}

.number-stepper button {
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 1.1rem;
}

.visualization-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1rem, 3.5vw, 2rem);
  border-top: 1px solid var(--atlas-line);
  background: rgba(234, 225, 211, 0.42);
}

.visualization-options {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.8rem;
  min-width: 0;
}

.layout-switcher,
.symbol-switcher,
.view-switcher,
.legend-switcher,
.plain-switcher {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.layout-switcher legend,
.symbol-switcher legend,
.view-switcher legend,
.legend-switcher legend,
.plain-switcher legend {
  margin-bottom: 0.4rem;
  color: var(--atlas-muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.layout-switcher > div,
.symbol-switcher > div,
.view-switcher > div {
  display: flex;
  padding: 0.25rem;
  border: 1px solid var(--atlas-line);
  border-radius: 0.62rem;
  background: rgba(255, 249, 238, 0.72);
}

.layout-switcher input,
.symbol-switcher input,
.view-switcher input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.layout-switcher label,
.symbol-switcher label,
.view-switcher label {
  min-height: 35px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.72rem;
  border-radius: 0.43rem;
  color: var(--atlas-muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.layout-switcher input:checked + label,
.symbol-switcher input:checked + label,
.view-switcher input:checked + label {
  background: var(--atlas-sage-soft);
  color: var(--atlas-text);
  box-shadow: 0 3px 7px rgba(67, 50, 30, 0.09);
}

.layout-switcher input:focus-visible + label,
.symbol-switcher input:focus-visible + label,
.view-switcher input:focus-visible + label {
  outline: 2px solid var(--atlas-sage-ink);
  outline-offset: 2px;
}

.legend-toggle,
.plain-toggle {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--atlas-line);
  border-radius: 0.62rem;
  background: rgba(255, 249, 238, 0.72);
  color: var(--atlas-text);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.legend-toggle input,
.plain-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--atlas-sage-ink);
  cursor: pointer;
}

.legend-toggle input:focus-visible,
.plain-toggle input:focus-visible {
  outline: 2px solid var(--atlas-sage-ink);
  outline-offset: 2px;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.share-actions button {
  gap: 0.35rem;
  min-height: 37px;
  padding: 0.52rem 0.68rem;
  font-size: 0.66rem;
}

.share-actions button span {
  color: var(--atlas-sage-ink);
  font-size: 0.94rem;
}

.atlas-license-note {
  margin: 0 clamp(0.65rem, 2vw, 1.25rem) clamp(0.85rem, 2vw, 1.15rem);
  padding: 0.75rem 0.9rem;
  border-left: 3px solid var(--atlas-honey);
  border-radius: 0 0.7rem 0.7rem 0;
  background: rgba(244, 223, 183, 0.32);
  color: var(--atlas-ink-soft);
  font-size: 0.76rem;
  line-height: 1.55;
}

.atlas-license-note p {
  margin: 0;
}

.atlas-license-note a {
  color: var(--atlas-sage-ink);
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.atlas-license-note-egyptian {
  display: none;
}

[data-number-atlas][data-symbol-family="egyptian"] .atlas-license-note-standard {
  display: none;
}

[data-number-atlas][data-symbol-family="egyptian"] .atlas-license-note-egyptian {
  display: block;
}

.atlas-challenge-strip {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem 1.5rem;
  align-items: center;
  margin: 0 clamp(0.65rem, 2vw, 1.25rem) clamp(0.85rem, 2vw, 1.25rem);
  padding: clamp(1.15rem, 2.8vw, 1.75rem);
  overflow: hidden;
  border: 2px solid rgba(126, 61, 161, 0.72);
  border-radius: 1rem;
  background:
    radial-gradient(circle at 8% 16%, rgba(255, 255, 255, 0.72) 0 7px, transparent 8px),
    radial-gradient(circle at 34% 86%, rgba(226, 93, 104, 0.18) 0 25px, transparent 26px),
    radial-gradient(circle at 91% 20%, rgba(170, 82, 215, 0.16) 0 46px, transparent 47px),
    linear-gradient(135deg, #f6e6aa 0%, #f7d7b5 48%, #e7d5f1 100%);
  box-shadow: 0 8px 0 rgba(94, 53, 112, 0.16), 0 18px 36px rgba(67, 50, 30, 0.12);
}

.atlas-challenge-strip::after {
  position: absolute;
  right: clamp(0.5rem, 2vw, 1.5rem);
  bottom: -2.1rem;
  color: rgba(96, 44, 120, 0.08);
  font-size: clamp(7rem, 15vw, 11rem);
  font-weight: 1000;
  line-height: 1;
  content: "?";
  transform: rotate(8deg);
  pointer-events: none;
}

.atlas-challenge-copy,
.atlas-challenge-actions {
  position: relative;
  z-index: 1;
}

.atlas-challenge-strip h3,
.atlas-challenge-strip p {
  margin: 0;
}

.atlas-challenge-strip h3 {
  max-width: 720px;
  margin-top: 0.45rem;
  color: #4e2861;
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.atlas-challenge-strip p:not(.eyebrow):not(.atlas-challenge-kicker) {
  max-width: 680px;
  margin-top: 0.55rem;
  color: #5c4b51;
  font-size: clamp(0.82rem, 1.5vw, 0.96rem);
  line-height: 1.5;
}

.atlas-challenge-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: fit-content;
  padding: 0.38rem 0.6rem;
  border-radius: 999px;
  background: #66367d;
  color: #fffdf8;
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 3px 0 rgba(55, 30, 66, 0.2);
}

.atlas-challenge-kicker span {
  color: #ffd95a;
  font-size: 0.85rem;
}

.atlas-challenge-actions {
  display: grid;
  gap: 0.55rem;
}

.atlas-challenge-button {
  width: 100%;
  min-height: 58px;
  border: 2px solid #4e2861 !important;
  background: #7c4296 !important;
  color: #fffdf8;
  font-size: 0.94rem;
  letter-spacing: 0.035em;
  box-shadow: 0 6px 0 #4e2861;
  transform: translateY(-2px);
}

.atlas-challenge-button:hover,
.atlas-challenge-button:focus-visible {
  background: #e25d68 !important;
  box-shadow: 0 3px 0 #873741;
  transform: translateY(1px);
}

.atlas-store-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.atlas-store-badges a {
  display: inline-flex;
  min-height: 40px;
}

.atlas-store-badges img {
  display: block;
  width: auto;
  height: 40px;
}

.visualization-stage {
  position: relative;
  min-height: 0;
  margin: clamp(0.65rem, 2vw, 1.25rem);
  overflow: hidden;
  border: 1px solid var(--atlas-line);
  border-radius: 0.75rem;
  background:
    radial-gradient(circle at 48% 45%, rgba(255, 249, 238, 0.88), transparent 50%),
    linear-gradient(135deg, rgba(135, 174, 184, 0.13), rgba(255, 249, 238, 0.34) 45%, rgba(226, 160, 55, 0.08)),
    #e5e7d7;
  box-shadow: inset 0 1px 18px rgba(67, 50, 30, 0.07);
}

.visualization-stage > .number-visual {
  display: block;
  width: 100%;
  min-height: 0;
  height: auto;
}

.visualization-stage[data-variant="mobile"] > .number-visual {
  max-width: var(--visual-natural-width);
  margin-inline: auto;
}

.visualization-stage[data-layout="shuffle"],
.visualization-stage[data-layout="scatter"],
.visualization-stage[data-layout="mix-up"],
.visualization-stage[data-layout="chaos"] {
  background: #e5e7d7;
}

.visualization-stage:focus-visible {
  outline: 3px solid var(--atlas-sage-ink);
  outline-offset: 3px;
}

.stage-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(119, 161, 126, 0.1) 1px, transparent 1px) 0 0 / calc(100% / 6) 100%,
    linear-gradient(rgba(119, 161, 126, 0.07) 1px, transparent 1px) 0 0 / 100% 54px;
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
}

.place-groups {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(6, minmax(88px, 1fr));
  min-width: 690px;
  min-height: 388px;
}

.place-group {
  display: grid;
  grid-template-rows: minmax(245px, 1fr) auto;
  padding: 1.35rem 0.8rem 1rem;
  border-right: 1px solid rgba(117, 143, 128, 0.2);
}

.place-group:last-child {
  border-right: 0;
}

.unit-field {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: clamp(0.34rem, 0.8vw, 0.58rem);
  padding: 0.45rem;
}

.place-unit,
.unit-key i,
.table-shape,
.cta-shapes i {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: clamp(25px, 3.1vw, 38px);
  height: clamp(25px, 3.1vw, 38px);
  filter: drop-shadow(0 4px 0 rgba(67, 50, 30, 0.17));
}

/* Canonical masks from EnemyToken.IsInsideGeneratedPlaceShape. */
.unit-hundred-thousands {
  background: var(--atlas-cyan);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect x='23.04' y='3.84' width='17.92' height='56.32'/%3E%3Crect x='3.84' y='23.04' width='56.32' height='17.92'/%3E%3Ccircle cx='32' cy='32' r='14.3108'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect x='23.04' y='3.84' width='17.92' height='56.32'/%3E%3Crect x='3.84' y='23.04' width='56.32' height='17.92'/%3E%3Ccircle cx='32' cy='32' r='14.3108'/%3E%3C/svg%3E") center / contain no-repeat;
}

.unit-ten-thousands {
  background: var(--atlas-purple);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M58.0757 13.0942 A29.5025 29.5025 0 1 0 58.0757 50.9058 A21.9381 21.9381 0 1 1 58.0757 13.0942 Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M58.0757 13.0942 A29.5025 29.5025 0 1 0 58.0757 50.9058 A21.9381 21.9381 0 1 1 58.0757 13.0942 Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.unit-thousands {
  background: var(--atlas-red);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpolygon points='32,5.9502 24.8525,24.9126 4.6096,25.8505 20.4352,38.5078 15.0718,58.0498 32,46.9102 48.9282,58.0498 43.5648,38.5078 59.3904,25.8505 39.1475,24.9126'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpolygon points='32,5.9502 24.8525,24.9126 4.6096,25.8505 20.4352,38.5078 15.0718,58.0498 32,46.9102 48.9282,58.0498 43.5648,38.5078 59.3904,25.8505 39.1475,24.9126'/%3E%3C/svg%3E") center / contain no-repeat;
}

.unit-hundreds {
  background: var(--atlas-blue);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect x='7.04' y='7.04' width='49.92' height='49.92'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect x='7.04' y='7.04' width='49.92' height='49.92'/%3E%3C/svg%3E") center / contain no-repeat;
}

.unit-tens {
  background: #f5b34f;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpolygon points='32,6.08 4.48,57.92 59.52,57.92'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpolygon points='32,6.08 4.48,57.92 59.52,57.92'/%3E%3C/svg%3E") center / contain no-repeat;
}

.unit-ones {
  background: var(--atlas-mint);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Ccircle cx='32' cy='32' r='28.2616'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Ccircle cx='32' cy='32' r='28.2616'/%3E%3C/svg%3E") center / contain no-repeat;
}

.stage-caption {
  margin: 0 clamp(1rem, 3.5vw, 2rem) clamp(1.15rem, 2.5vw, 1.5rem);
  color: var(--atlas-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.profile-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
  overflow: hidden;
}

.card-heading {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--atlas-line);
  background: linear-gradient(135deg, rgba(135, 174, 184, 0.16), transparent 60%);
}

.card-heading h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1;
  text-transform: uppercase;
}

.profile-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-column: 2;
  grid-row: 1 / span 2;
  margin: 0;
  padding: 0;
}

.profile-list > div {
  padding: 1rem;
  border-right: 1px solid rgba(117, 143, 128, 0.24);
  border-bottom: 1px solid rgba(117, 143, 128, 0.24);
}

.profile-list dt {
  margin-bottom: 0.4rem;
  color: var(--atlas-muted);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-list dd {
  margin: 0;
  font-size: 0.91rem;
  font-weight: 800;
  line-height: 1.48;
}

.profile-pair {
  display: block;
}

.profile-pair dd {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.profile-pair dd > span {
  display: block;
}

.profile-pair dd > span + span {
  padding-left: 1rem;
  border-left: 1px solid var(--atlas-line);
}

.profile-pair small,
.profile-pair strong {
  display: block;
}

.profile-pair small {
  margin-bottom: 0.28rem;
  color: var(--atlas-muted);
  font-size: 0.61rem;
  font-weight: 850;
  text-transform: uppercase;
}

.profile-note {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0;
  padding: 1.3rem 1.5rem 1.5rem;
  background: rgba(234, 225, 211, 0.48);
}

.unit-key {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.unit-key i {
  width: 18px;
  height: 18px;
  filter: drop-shadow(0 2px 0 rgba(67, 50, 30, 0.16));
}

.profile-note p {
  margin: 0.8rem 0 0;
  color: var(--atlas-muted);
  font-size: 0.75rem;
  font-weight: 750;
  line-height: 1.45;
}

.atlas-story {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
  gap: clamp(1rem, 4vw, 3.5rem);
  align-items: end;
  width: min(100% - 2rem, var(--atlas-max));
  margin: clamp(-3.5rem, -5vw, -2rem) auto clamp(3.5rem, 7vw, 5.5rem);
  padding: clamp(1.4rem, 3vw, 2.2rem);
  border: 1px solid var(--atlas-line);
  border-radius: 0.85rem;
  background: linear-gradient(135deg, rgba(211, 226, 203, 0.72), rgba(255, 249, 238, 0.9));
  box-shadow: 0 18px 42px rgba(67, 50, 30, 0.1);
}

.atlas-story .eyebrow {
  align-self: start;
}

.atlas-story h2 {
  grid-column: 1 / -1;
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 5.5rem);
  line-height: 0.88;
  letter-spacing: -0.055em;
  text-transform: uppercase;
}

.atlas-story > p:last-child {
  grid-column: 2;
  max-width: 720px;
  margin: 0;
  color: var(--atlas-ink-soft);
  font-size: 1rem;
  line-height: 1.6;
}

.atlas-egyptian-story {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(1.2rem, 4vw, 3rem);
  align-items: center;
  width: min(100% - 2rem, var(--atlas-max));
  margin: 0 auto clamp(3.5rem, 7vw, 5.5rem);
  padding: clamp(1rem, 2.7vw, 2rem);
  border: 1px solid var(--atlas-line);
  border-radius: 0.85rem;
  background:
    radial-gradient(circle at 12% 15%, rgba(53, 174, 186, 0.16), transparent 16rem),
    linear-gradient(135deg, rgba(255, 249, 238, 0.94), rgba(234, 225, 211, 0.72));
  box-shadow: 0 18px 42px rgba(67, 50, 30, 0.1);
}

.atlas-egyptian-story-visual {
  display: block;
  overflow: hidden;
  border: 1px solid rgba(117, 143, 128, 0.28);
  border-radius: 0.7rem;
  background: var(--atlas-paper);
  box-shadow: 0 12px 30px rgba(67, 50, 30, 0.1);
}

.atlas-egyptian-story-visual img {
  display: block;
  width: 100%;
  height: auto;
}

.atlas-egyptian-story h2 {
  margin: 0.35rem 0 0;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

.atlas-egyptian-story div > p:not(.eyebrow) {
  max-width: 58ch;
  margin: 1rem 0 0;
  color: var(--atlas-ink-soft);
  line-height: 1.62;
}

.atlas-egyptian-story-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.indexed-number-library {
  display: grid;
  grid-template-columns: minmax(240px, 0.58fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: start;
  width: min(100% - 2rem, var(--atlas-max));
  margin: 0 auto clamp(4.5rem, 9vw, 7rem);
  padding: clamp(1.4rem, 3vw, 2.2rem);
  border: 1px solid var(--atlas-line);
  border-radius: 0.85rem;
  background: rgba(255, 249, 238, 0.78);
  box-shadow: 0 18px 42px rgba(67, 50, 30, 0.09);
}

.indexed-number-library h2 {
  margin: 0;
  font-size: clamp(2rem, 4.3vw, 3.8rem);
  letter-spacing: -0.045em;
  line-height: 0.95;
  text-transform: uppercase;
}

.indexed-number-library > div > p:last-child {
  max-width: 560px;
  margin: 1rem 0 0;
  color: var(--atlas-muted);
  line-height: 1.6;
}

.indexed-number-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
}

.indexed-number-grid a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 46px;
  padding: 0.65rem 0.45rem;
  border: 1px solid var(--atlas-line);
  border-radius: 0.58rem;
  background: var(--atlas-paper);
  font-size: clamp(0.72rem, 1.4vw, 0.9rem);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  box-shadow: 0 4px 0 rgba(67, 50, 30, 0.07);
}

.indexed-number-grid a:hover,
.indexed-number-grid a:focus-visible {
  border-color: var(--atlas-sage-ink);
  background: var(--atlas-sage-soft);
  outline: 2px solid rgba(119, 161, 126, 0.24);
  outline-offset: 2px;
  transform: translateY(-1px);
}

.number-details {
  padding: clamp(4.5rem, 9vw, 7rem) 0;
  border-top: 1px solid var(--atlas-line);
  background:
    linear-gradient(180deg, rgba(255, 249, 238, 0.45), rgba(234, 225, 211, 0.22));
}

.section-heading,
.detail-grid,
.game-cta {
  width: min(100% - 2rem, var(--atlas-max));
  margin-right: auto;
  margin-left: auto;
}

.section-heading {
  margin-bottom: 2rem;
}

.section-heading h2,
.game-cta h2 {
  margin: 0;
  font-size: clamp(2.6rem, 6.4vw, 5.4rem);
  letter-spacing: -0.055em;
  line-height: 0.9;
  text-transform: uppercase;
}

.section-heading > p:last-child {
  max-width: 700px;
  margin: 1rem 0 0;
  color: var(--atlas-muted);
  line-height: 1.65;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 1.25rem;
}

.detail-card {
  min-width: 0;
  padding: clamp(1.25rem, 3vw, 1.8rem);
}

.detail-card header {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.detail-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid var(--atlas-line);
  border-radius: 50%;
  background: var(--atlas-sage-soft);
  font-size: 0.68rem;
  font-weight: 900;
}

.detail-card header .eyebrow {
  margin-bottom: 0.3rem;
}

.detail-card h3 {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  line-height: 1;
  text-transform: uppercase;
}

.place-value-card {
  grid-row: span 2;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 0.82rem 0.7rem;
  border-bottom: 1px solid rgba(117, 143, 128, 0.23);
  text-align: right;
}

thead th {
  color: var(--atlas-muted);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

th:first-child,
td:first-child {
  text-align: left;
}

tbody th {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.76rem;
  font-weight: 800;
}

tbody td {
  font-size: 0.86rem;
  font-weight: 750;
}

.table-shape {
  width: 18px;
  height: 18px;
  filter: drop-shadow(0 2px 0 rgba(67, 50, 30, 0.14));
}

.table-shape--egyptian {
  display: inline-block;
  object-fit: contain;
  object-position: center;
}

.factor-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.factor-summary > div {
  padding: 0.85rem;
  border: 1px solid rgba(117, 143, 128, 0.26);
  border-radius: 0.6rem;
  background: rgba(234, 225, 211, 0.34);
}

.factor-summary span,
.factor-summary strong {
  display: block;
}

.factor-summary span {
  color: var(--atlas-muted);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.factor-summary strong {
  margin-top: 0.3rem;
  font-size: 1.65rem;
}

.factor-list {
  margin: 0;
  color: var(--atlas-ink-soft);
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.7;
}

.property-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.property-list li {
  padding: 0.55rem 0.72rem;
  border: 1px solid rgba(119, 161, 126, 0.38);
  border-radius: 999px;
  background: var(--atlas-sage-soft);
  font-size: 0.71rem;
  font-weight: 850;
}

.property-note {
  margin: 1.15rem 0 0;
  color: var(--atlas-muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.game-cta {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(340px, 0.75fr);
  gap: clamp(2rem, 7vw, 6rem);
  align-items: center;
  margin-top: clamp(4.5rem, 10vw, 8rem);
  margin-bottom: clamp(4.5rem, 10vw, 8rem);
  padding: clamp(1.4rem, 4vw, 3.5rem);
  overflow: hidden;
  border: 1px solid var(--atlas-line-strong);
  border-radius: 0.9rem;
  background:
    radial-gradient(circle at 75% 35%, rgba(135, 174, 184, 0.25), transparent 20rem),
    linear-gradient(135deg, rgba(255, 249, 238, 0.97), rgba(234, 225, 211, 0.86));
  box-shadow: 0 28px 60px var(--atlas-shadow-strong);
}

.cta-copy {
  position: relative;
  z-index: 1;
}

.cta-copy > p:not(.eyebrow) {
  max-width: 580px;
  margin: 1.2rem 0 0;
  color: var(--atlas-ink-soft);
  line-height: 1.62;
}

.cta-copy .launch-note {
  color: var(--atlas-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.6rem;
}

.cta-visual {
  min-width: 0;
  padding: 2rem 1.35rem 1.35rem;
  border: 1px solid var(--atlas-line);
  border-radius: 0.78rem;
  background: rgba(229, 231, 215, 0.88);
  box-shadow: 18px 21px 0 rgba(67, 50, 30, 0.08);
  transform: rotate(2deg);
}

.cta-number {
  font-size: clamp(2.2rem, 5.4vw, 4.9rem);
  font-variant-numeric: tabular-nums;
  font-weight: 950;
  letter-spacing: -0.07em;
  line-height: 1;
}

.cta-shapes {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin: 2.2rem 0;
}

.cta-shapes i {
  width: clamp(24px, 3.6vw, 42px);
  height: clamp(24px, 3.6vw, 42px);
}

.cta-message {
  padding-top: 1rem;
  border-top: 1px solid var(--atlas-line);
  color: var(--atlas-muted);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.atlas-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
  width: min(100% - 2rem, var(--atlas-max));
  margin: 0 auto;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--atlas-line);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.footer-brand img {
  width: 38px;
  height: 38px;
}

.footer-brand p,
.footer-brand strong,
.footer-brand span {
  display: block;
  margin: 0;
}

.footer-brand strong {
  font-size: 0.83rem;
}

.footer-brand span,
.footer-note {
  margin-top: 0.12rem;
  color: var(--atlas-muted);
  font-size: 0.7rem;
}

.atlas-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.9rem;
}

.atlas-footer nav a {
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.atlas-footer nav a:hover,
.atlas-footer nav a:focus-visible {
  color: var(--atlas-sage-ink);
  outline: 2px solid rgba(119, 161, 126, 0.25);
  outline-offset: 3px;
}

.footer-note {
  grid-column: 1 / -1;
  margin: -0.4rem 0 0;
}

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

[hidden] {
  display: none !important;
}

@media (max-width: 1040px) {
  .atlas-hero {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 0.75fr);
    gap: 2.5rem;
  }

  .workspace-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-card {
    display: grid;
    grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
  }

  .card-heading,
  .profile-note {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .profile-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .profile-list > div {
    padding: 1rem;
    border-right: 1px solid rgba(117, 143, 128, 0.24);
  }

  .profile-pair dd {
    gap: 0.6rem;
  }

  .profile-note {
    margin: 0;
  }
}

@media (max-width: 820px) {
  .atlas-challenge-strip {
    grid-template-columns: 1fr;
  }

  .atlas-challenge-actions {
    justify-items: start;
  }

  .atlas-store-badges {
    justify-content: flex-start;
  }

  .atlas-hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    gap: 1.25rem;
    padding-top: 1.6rem;
  }

  .hero-copy {
    max-width: 700px;
  }

  .number-search {
    max-width: 680px;
  }

  .number-suggestions {
    position: static;
    grid-column: 1;
    justify-content: flex-start;
    max-width: none;
    margin-top: -0.55rem;
  }

  .visualization-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .visualization-options {
    width: 100%;
  }

  .share-actions {
    justify-content: flex-start;
  }

  .visualization-stage[data-view-mode="desktop"] {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .visualization-stage[data-view-mode="desktop"][data-rendered="true"] > .number-visual {
    width: var(--visual-natural-width);
    min-width: var(--visual-natural-width);
    max-width: none;
  }

  .profile-card {
    display: block;
  }

  .profile-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-list > div {
    padding: 1rem 0;
    border-right: 0;
  }

  .profile-list > div:nth-child(odd) {
    padding-right: 1rem;
    border-right: 1px solid rgba(117, 143, 128, 0.24);
  }

  .profile-list > div:nth-child(even) {
    padding-left: 1rem;
  }

  .profile-note {
    display: block;
  }

  .atlas-story {
    grid-template-columns: minmax(0, 1fr);
  }

  .atlas-story > p:last-child {
    grid-column: 1;
  }

  .atlas-egyptian-story {
    grid-template-columns: minmax(0, 1fr);
  }

  .indexed-number-library {
    grid-template-columns: minmax(0, 1fr);
  }

  .indexed-number-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .detail-grid,
  .game-cta {
    grid-template-columns: minmax(0, 1fr);
  }

  .place-value-card {
    grid-row: auto;
  }

  .cta-visual {
    width: min(100%, 520px);
  }
}

@media (max-width: 580px) {
  .atlas-header {
    min-height: 76px;
  }

  .atlas-brand img {
    width: 40px;
    height: 40px;
  }

  .atlas-brand strong {
    font-size: 0.85rem;
  }

  .atlas-brand small {
    font-size: 0.65rem;
  }

  .back-link {
    padding-right: 0.25rem;
    font-size: 0.68rem;
  }

  .hero-copy {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    border: 0;
  }

  .hero-copy > :not(.atlas-hero-challenge) {
    display: none;
  }

  .atlas-hero-challenge {
    justify-content: center;
    width: 100%;
    margin-top: 0;
  }

  .number-search-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .number-search-row .atlas-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .search-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }

  .number-heading {
    align-items: center;
    flex-direction: row;
    padding: 0.8rem 0.95rem;
  }

  .number-heading h2 {
    font-size: clamp(1.9rem, 10vw, 2.75rem);
    line-height: 1;
  }

  .number-heading .eyebrow,
  .number-heading .number-form-label,
  .number-heading .number-words {
    display: none;
  }

  .number-stepper {
    align-self: center;
    margin-left: auto;
  }

  .visualization-options {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.65rem;
  }

  .view-switcher,
  .symbol-switcher,
  .legend-switcher,
  .plain-switcher,
  .legend-toggle,
  .plain-toggle {
    width: 100%;
  }

  .layout-switcher > div,
  .symbol-switcher > div,
  .view-switcher > div {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .layout-switcher > div {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .layout-switcher label,
  .symbol-switcher label,
  .view-switcher label {
    padding-right: 0.45rem;
    padding-left: 0.45rem;
  }

  .share-actions {
    display: grid;
    grid-template-columns: 1.35fr 1fr 1fr;
  }

  .share-actions button {
    padding-right: 0.4rem;
    padding-left: 0.4rem;
  }

  .visualization-stage {
    min-height: 560px;
  }

  .visualization-stage[data-rendered="true"] {
    min-height: 0;
  }

  .place-groups {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    min-width: 0;
    min-height: 558px;
  }

  .place-group {
    grid-template-rows: minmax(118px, 1fr) auto;
    min-width: 0;
    padding: 0.75rem 0.65rem 0.7rem;
    border-right: 1px solid rgba(117, 143, 128, 0.2);
    border-bottom: 1px solid rgba(117, 143, 128, 0.2);
  }

  .place-group:nth-child(even) {
    border-right: 0;
  }

  .place-group:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .unit-field {
    gap: 0.3rem;
  }

  .place-unit {
    width: 27px;
    height: 27px;
  }

  .profile-list {
    display: block;
  }

  .indexed-number-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-list > div,
  .profile-list > div:nth-child(odd),
  .profile-list > div:nth-child(even) {
    padding: 1rem 0;
    border-right: 0;
  }

  .profile-pair dd {
    display: grid;
  }

  .detail-card {
    padding: 1.15rem;
  }

  th,
  td {
    padding: 0.72rem 0.45rem;
  }

  tbody th {
    min-width: 160px;
  }

  .game-cta {
    width: min(100% - 1.25rem, var(--atlas-max));
    padding: 1.2rem;
  }

  .cta-actions {
    flex-direction: column;
  }

  .cta-actions .atlas-button {
    width: 100%;
  }

  .cta-visual {
    padding: 1.5rem 1rem 1rem;
    box-shadow: 9px 11px 0 rgba(67, 50, 30, 0.08);
  }

  .atlas-footer {
    grid-template-columns: 1fr;
  }

  .atlas-footer nav {
    justify-content: flex-start;
  }

  .footer-note {
    grid-column: auto;
    margin-top: 0;
  }
}

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

.noscript-note {
  position: fixed;
  z-index: 80;
  right: 1rem;
  bottom: 1rem;
  max-width: 34rem;
  margin: 0;
  padding: 1rem 1.2rem;
  border: 2px solid var(--atlas-red);
  border-radius: 0.7rem;
  background: var(--atlas-paper);
  box-shadow: 0 16px 34px var(--atlas-shadow-strong);
  font-weight: 800;
  line-height: 1.5;
}

@media (forced-colors: active) {
  .place-unit,
  .unit-key i,
  .table-shape,
  .cta-shapes i {
    background: CanvasText;
    forced-color-adjust: none;
  }

  .layout-switcher input:checked + label,
  .symbol-switcher input:checked + label,
  .view-switcher input:checked + label {
    outline: 2px solid CanvasText;
  }
}
