.atlas-page {
  min-height: 100dvh; color: #292f53;
  background: radial-gradient(ellipse at 9% 19%, #e4f6ff, transparent 50%),
    radial-gradient(ellipse at 94% 27%, #f5e5ff, transparent 48%), #f9f8ff;
}
.atlas-main { padding-block: 16px 30px; }
.atlas-intro { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.atlas-intro h1 { margin-block: 3px; font-size: clamp(2rem, 5.5vw, 3.8rem); line-height: 1.03; letter-spacing: -.065em; }
.atlas-page .eyebrow { color: #504695; }
.atlas-layout { display: grid; grid-template-columns: minmax(182px, 214px) minmax(0, 1fr); align-items: start; gap: 13px; }
.atlas-settings, .atlas-cabinet {
  min-width: 0; padding: 11px; border: 1px solid #ded8f1; border-radius: 19px;
  background: #fff; box-shadow: 0 12px 32px #3b427b16;
}
.atlas-guide { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; padding: 6px; border-radius: 12px; background: linear-gradient(120deg, #ece7ff, #fff0d2); }
.atlas-guide img { width: 37px; height: 48px; object-fit: contain; }
.atlas-guide h2 { font-size: 1.04rem; line-height: 1.17; }
.atlas-guide .eyebrow, .atlas-scorebar .eyebrow { font-size: .62rem; }
.atlas-settings form { display: grid; gap: 5px; font-size: .77rem; }
.atlas-settings form > label, .atlas-settings legend { font-weight: 850; }
.atlas-settings select { width: 100%; min-height: 36px; padding: 4px 7px; border: 1px solid #d7cfee; border-radius: 8px; background: #f5f1ff; color: #40376d; font: inherit; font-weight: 750; }
.atlas-note { color: #586388; font-size: .69rem; line-height: 1.38; }
.atlas-best { margin-top: 7px; font-weight: 800; }
.atlas-settings fieldset { display: grid; gap: 4px; border: 0; padding: 0; margin-block: 4px; }
.atlas-settings legend { margin-bottom: 4px; }
.atlas-option { display: flex; align-items: center; gap: 6px; min-height: 42px; padding: 4px 6px; border: 1px solid #e0dcf2; border-radius: 9px; background: #f9f8ff; cursor: pointer; }
.atlas-option:has(:checked) { background: #eee8ff; border-color: #b6a8ed; }
.atlas-option input { accent-color: #6447b7; }
.atlas-option small { display: block; color: #555b81; font-size: .65rem; }
.atlas-relic-shelf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: 9px; }
.atlas-relic-shelf span { display: grid; min-height: 30px; place-items: center; border: 1px solid #dbd7f1; border-radius: 8px; background: #f6f4fe; color: #6a6693; }
.atlas-relic-shelf [data-earned] { color: #603497; background: #f4e3ff; border-color: #d5b3ef; }
.atlas-soft, .atlas-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 37px;
  padding: 5px 11px; border: 1px solid #cfc8ef; border-radius: 9px; white-space: nowrap;
  background: #f4f1ff; color: #433675; font-size: .78rem; font-weight: 850; line-height: 1.15;
}
.atlas-primary { border-color: #5940a9; background: linear-gradient(155deg, #7452c9, #5438a5); color: #fff; }
.atlas-soft:hover:not(:disabled) { background: #ebe4ff; }
.atlas-primary:hover { background: #5135a1; }
.atlas-soft:disabled { opacity: .68; cursor: default; }
.atlas-soft .icon { width: 17px; height: 17px; }
.atlas-cabinet { display: grid; gap: 7px; background: linear-gradient(140deg, #fff, #f3efff); }
.atlas-scorebar, .atlas-tools, .atlas-actions { display: flex; align-items: center; gap: 6px; }
.atlas-scorebar { justify-content: space-between; }
.atlas-scorebar h2 { font-size: clamp(1.19rem, 2.8vw, 1.9rem); line-height: 1.07; letter-spacing: -.045em; }
.atlas-muted, #atlas-sound[aria-pressed="true"] .atlas-waves, .atlas-shrink { display: none; }
#atlas-sound[aria-pressed="true"] .atlas-muted { display: block; }
.atlas-stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 5px; }
.atlas-stats > div {
  display: flex; justify-content: space-between; align-items: center; gap: 5px; min-width: 0; padding: 5px 7px;
  border: 1px solid #d7cff2; border-radius: 8px; background: #f0e9ff; color: #593e80; font-size: .72rem; font-weight: 850;
}
.atlas-stats > div:nth-child(2) { background: #fff3d5; border-color: #ecd7aa; color: #6a4820; }
.atlas-stats > div:nth-child(3) { background: #e3f8f0; border-color: #c6e8db; color: #295c4c; }
.atlas-stats > div:nth-child(4) { background: #e9f2ff; border-color: #c9dcf2; color: #37547c; }
.atlas-stats strong { font-variant-numeric: tabular-nums; font-size: .91rem; white-space: nowrap; }
#atlas-clock-box[data-low] { background: #ffede2; border-color: #ecc0a9; color: #863d29; }
.atlas-stage {
  --tint: #e5dcff; --accent: #a67cf1; --ink: #533881;
  display: grid; position: relative; isolation: isolate; overflow: hidden; min-height: clamp(398px, 55dvh, 525px);
  border: 1px solid #c5b9e9; border-radius: 16px; background: #bddef7;
}
.atlas-stage[data-subject="math"] { --tint: #e0f1ff; --accent: #57c6ff; --ink: #2b567f; }
.atlas-stage[data-subject="science"] { --tint: #dcfaeb; --accent: #4adba6; --ink: #285c4a; }
.atlas-stage[data-subject="language"] { --tint: #f5e2ff; --accent: #d391f6; --ink: #623b81; }
.atlas-stage[data-subject="world"] { --tint: #fff0c9; --accent: #ffbd59; --ink: #6f4d24; }
.atlas-scenery, .atlas-light { position: absolute; inset: 0; pointer-events: none; }
.atlas-scenery {
  z-index: -2; background: #a4d0f5 url("atlas-isles.webp") center 56% / cover no-repeat;
  transition: filter .4s ease, background-position .5s ease;
}
.atlas-light {
  z-index: -1; background: radial-gradient(ellipse at 49% 70%, var(--tint) 0, #fff0 62%), linear-gradient(0deg, #46337638, #fff0 42%);
  opacity: .57; animation: atlas-breathe 7s ease-in-out infinite alternate;
}
@keyframes atlas-breathe { to { opacity: .78; } }
.atlas-stage[data-phase="question"] .atlas-scenery, .atlas-stage[data-phase="feedback"] .atlas-scenery { filter: saturate(.78); }
.atlas-ready {
  display: grid; grid-template-columns: 1fr minmax(0, .95fr); align-items: center;
  gap: clamp(6px, 2.4vw, 25px); padding: clamp(9px, 4vw, 40px);
}
.atlas-team { display: flex; justify-content: center; align-items: end; max-height: 280px; }
.atlas-team img { width: 26%; height: auto; object-fit: contain; filter: drop-shadow(0 7px 4px #49387552); }
.atlas-team img:nth-child(2) { width: 50%; margin-inline: -2%; z-index: 1; transform: translateY(-7%); }
.atlas-overlay {
  display: grid; justify-items: start; gap: 7px; width: min(100%, 460px); padding: clamp(10px, 2.4vw, 25px);
  border: 1px solid #fff; border-radius: 15px; background: #ffffffe8;
  box-shadow: 0 10px 27px #382c6d45; backdrop-filter: blur(8px);
}
.atlas-overlay .eyebrow, .atlas-brief .eyebrow, .atlas-question-card .eyebrow { font-size: .61rem; }
.atlas-overlay h3 { color: #382970; font-size: clamp(1.52rem, 4.2vw, 3rem); line-height: 1.04; letter-spacing: -.055em; }
.atlas-overlay p:not(.eyebrow) { color: #43547c; font-size: .81rem; line-height: 1.35; }
.atlas-overlay-stage { display: grid; place-items: center; min-height: 0; overflow: auto; padding: 8px; }
.atlas-actions { flex-wrap: wrap; }
.atlas-map-view { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-width: 0; min-height: 0; padding: 8px; gap: 6px; }
.atlas-map { position: relative; justify-self: center; width: min(100%, 820px); }
.atlas-routes, .atlas-nodes { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.atlas-routes path { fill: none; stroke: #fffc; stroke-width: 5; stroke-dasharray: 8 9; stroke-linecap: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 2px 2px #4161828f); }
.atlas-node, .atlas-traveler { position: absolute; left: var(--x); top: var(--y); translate: -50% -50%; }
.atlas-node {
  display: grid; justify-items: center; align-content: center; gap: 3px; width: clamp(76px, 14vw, 130px); min-height: 72px;
  padding: 4px; border: 2px solid var(--node-rim, #9474cc); border-radius: 13px; color: #3c3264;
  background: linear-gradient(165deg, #fff, var(--node-light, #f1e6ff)); box-shadow: 0 4px 0 var(--node-rim, #9474cc), 0 8px 16px #2d43764d;
  font-size: .78rem; font-weight: 900; line-height: 1.1;
}
.atlas-node[data-station="math"] { --node-rim: #4f8bc1; --node-light: #e0f2ff; }
.atlas-node[data-station="science"] { --node-rim: #48a684; --node-light: #ddf9ec; }
.atlas-node[data-station="language"] { --node-rim: #a368c4; --node-light: #f5e2ff; }
.atlas-node[data-station="world"] { --node-rim: #bc8742; --node-light: #fff0cb; }
.atlas-node-symbol { display: grid; place-items: center; min-width: 29px; height: 27px; padding: 2px 4px; border-radius: 8px; background: var(--node-light, #eadcff); color: #4e3b83; font-size: 1rem; }
.atlas-node small { color: #514971; font-size: .63rem; }
.atlas-node:hover:not(:disabled), .atlas-node[aria-pressed="true"] { outline: 3px solid #fff9b0; outline-offset: 2px; }
.atlas-node:focus-visible { outline: 3px solid #3d2b7b; outline-offset: 2px; }
.atlas-node:disabled { cursor: default; filter: saturate(.68); }
.atlas-node[data-relic] .atlas-node-symbol { color: #8736ac; }
.atlas-traveler {
  z-index: 2; width: clamp(33px, 7vw, 68px); pointer-events: none; translate: -50% -19%;
  filter: drop-shadow(0 4px 3px #384e7770); transition: left .45s cubic-bezier(.2,.75,.35,1), top .45s cubic-bezier(.2,.75,.35,1);
}
.atlas-traveler img { display: block; width: 100%; height: auto; }
.atlas-brief {
  display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 7px 9px; min-width: 0;
  border: 1px solid #fff; border-radius: 11px; background: #fffffff0; color: #44386e;
}
.atlas-brief h3 { font-size: clamp(.98rem, 2.4vw, 1.35rem); line-height: 1.12; }
.atlas-brief p:not(.eyebrow) { font-size: .7rem; line-height: 1.24; color: #4e5a80; }
.atlas-brief .atlas-actions { justify-content: flex-end; flex: none; }
.atlas-quiz {
  position: relative; display: grid; align-content: center; gap: 7px; justify-self: center;
  width: min(100%, 765px); min-height: 0; padding: clamp(7px, 2vw, 17px); overflow: auto;
}
.atlas-question-card {
  display: grid; gap: 5px; padding: 8px 11px; border: 1px solid #fff; border-radius: 12px;
  background: #fffffff2; box-shadow: 0 4px 12px #2a417d2d;
}
.atlas-question-card h3 { font-size: clamp(1.1rem, 3vw, 1.88rem); line-height: 1.18; letter-spacing: -.025em; color: #312c62; }
.atlas-timer { height: 5px; width: min(100%, 220px); overflow: hidden; border-radius: 20px; background: #e3e4f5; }
.atlas-timer span { display: block; height: 100%; transform: scaleX(var(--time, 1)); transform-origin: left; transition: transform .1s linear; background: linear-gradient(90deg, var(--accent), #ffb755); }
.atlas-answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.atlas-choice {
  min-width: 0; min-height: 45px; display: flex; align-items: center; gap: 6px; padding: 5px 7px;
  border: 1px solid #b7caed; border-radius: 9px; color: #2a456e; background: #ecf6ff;
  text-align: left; font-size: clamp(.74rem, 1.8vw, .94rem); font-weight: 850; line-height: 1.18;
}
.atlas-choice:nth-child(2) { background: #f2e9ff; color: #4f3978; border-color: #d9c8f2; }
.atlas-choice:nth-child(3) { background: #e4f8ef; color: #305f4f; border-color: #bbe4d5; }
.atlas-choice:nth-child(4) { background: #fff1d6; color: #6e5029; border-color: #e8d19c; }
.atlas-choice:hover:not(:disabled) { filter: brightness(.95); }
.atlas-choice kbd { flex: none; min-width: 15px; text-align: center; border: 1px solid currentColor; border-radius: 4px; font: inherit; font-size: .61rem; line-height: 1.2; }
.atlas-choice[data-outcome="correct"] { color: #2d5839; background: #e3f9da; border: 2px solid #6e9c5d; }
.atlas-choice[data-outcome="wrong"] { color: #7e3d2e; background: #ffe6df; border: 2px solid #bc705f; }
.atlas-choice[data-filtered] { background: #f0eef8; color: #5d5375; border-color: #ded9ee; }
.atlas-explanation { display: grid; gap: 2px; padding: 5px 8px; border: 1px solid #ecd3a8; border-radius: 9px; background: #fff4dc; color: #634924; font-size: .76rem; line-height: 1.24; }
.atlas-quiz-actions { justify-content: center; }
.atlas-gem { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #be9fe8; border-radius: 11px; background: #f3e2ff; color: #7438ac; font-size: 1.28rem; animation: atlas-gem .55s ease-out; }
@keyframes atlas-gem { from { scale: .6; opacity: .3; rotate: -15deg; } }
.atlas-particles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.atlas-particles i { position: absolute; left: 50%; top: 45%; width: 9px; height: 9px; border-radius: 2px; background: var(--color); box-shadow: 0 0 8px #fff; animation: atlas-particle .55s ease-out both; }
@keyframes atlas-particle { to { transform: translate(var(--dx), var(--dy)) rotate(120deg); opacity: 0; } }
.atlas-record { font-weight: 850; }
.atlas-review { width: 100%; padding: 5px 7px; border: 1px solid #ded2f0; border-radius: 8px; background: #f8efff; color: #553f71; font-size: .73rem; }
.atlas-review summary { cursor: pointer; font-weight: 850; }
.atlas-review ul { max-height: 105px; overflow: auto; margin-block: 4px 0; padding-left: 17px; }
.atlas-review li { margin-block: 4px; }
.atlas-feedback {
  display: flex; align-items: center; min-height: 37px; gap: 7px; padding: 3px 7px;
  border-radius: 9px; background: #e9f2ff; color: #354f78; font-size: .74rem; font-weight: 850; line-height: 1.25;
}
.atlas-feedback img { width: 22px; height: 28px; object-fit: contain; flex: none; }
.atlas-feedback[data-tone="good"] { background: #e7f9df; color: #33593b; }
.atlas-feedback[data-tone="relic"] { background: #f2e5ff; color: #643b89; }
.atlas-feedback[data-tone="review"] { background: #fff0df; color: #754123; }
.atlas-local { margin-top: 7px; }

html:has(.atlas-layout.is-expanded) { overflow: hidden; }
.atlas-page:has(.atlas-layout:is(:fullscreen, .is-expanded)) :is(.site-header, .skip, .game-crumbs, .atlas-intro, .atlas-local, .game-reading, .games-footer) { visibility: hidden; }
.atlas-layout:is(:fullscreen, .is-expanded) {
  display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; position: fixed;
  inset: 0; z-index: 10; width: 100%; height: 100dvh; overflow: hidden; background: #eeeaff;
  padding: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
}
.atlas-layout:is(:fullscreen, .is-expanded) .atlas-settings { display: none; }
.atlas-layout:is(:fullscreen, .is-expanded) .atlas-cabinet { width: 100%; height: 100%; min-height: 0; grid-template-rows: auto auto minmax(0, 1fr) auto; }
.atlas-layout:is(:fullscreen, .is-expanded) .atlas-stage { min-height: 0; }
.atlas-layout:is(:fullscreen, .is-expanded) :is(.atlas-map, .atlas-quiz) { width: 100%; }
@media (min-width: 900px) and (min-height: 600px) {
  .atlas-layout:is(:fullscreen, .is-expanded) .atlas-node { width: clamp(130px, 11vw, 210px); min-height: clamp(72px, 11dvh, 120px); font-size: clamp(.85rem, 1.4vw, 1.4rem); }
  .atlas-layout:is(:fullscreen, .is-expanded) .atlas-quiz { gap: clamp(9px, 1.5dvh, 20px); padding: clamp(16px, 3vw, 55px); }
  .atlas-layout:is(:fullscreen, .is-expanded) .atlas-question-card { padding: clamp(14px, 2vw, 30px); }
  .atlas-layout:is(:fullscreen, .is-expanded) .atlas-question-card h3 { font-size: clamp(1.65rem, 2.6vw, 3rem); }
  .atlas-layout:is(:fullscreen, .is-expanded) .atlas-answers { gap: clamp(8px, 1vw, 18px); }
  .atlas-layout:is(:fullscreen, .is-expanded) .atlas-choice { min-height: clamp(58px, 11dvh, 118px); padding: 12px 18px; font-size: clamp(1rem, 1.7vw, 1.65rem); }
  .atlas-layout:is(:fullscreen, .is-expanded) .atlas-explanation { padding: 10px 15px; font-size: clamp(.9rem, 1.3vw, 1.2rem); }
}
.atlas-layout:is(:fullscreen, .is-expanded) .atlas-icon { width: 38px; min-height: 36px; padding: 3px; background: #ffffff85; }
.atlas-layout:is(:fullscreen, .is-expanded) :is(.atlas-icon span, .atlas-expand) { display: none; }
.atlas-layout:is(:fullscreen, .is-expanded) .atlas-shrink { display: block; }
@media (max-width: 850px) {
  .atlas-layout { grid-template-columns: minmax(0, 1fr); }
  .atlas-settings form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
  .atlas-settings fieldset, .atlas-settings form .atlas-note { grid-column: 1 / -1; }
  .atlas-settings fieldset { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .atlas-relic-shelf { max-width: 210px; }
}
@media (max-width: 570px) {
  .atlas-intro { align-items: start; flex-direction: column; }
  .atlas-cabinet { padding: 6px; gap: 5px; }
  .atlas-tools .atlas-icon { width: 35px; padding: 3px; }
  .atlas-tools .atlas-icon span { display: none; }
  .atlas-stats { gap: 3px; }
  .atlas-stats > div { display: grid; justify-content: center; gap: 1px; padding: 3px 1px; text-align: center; font-size: .61rem; }
  .atlas-stats strong { font-size: .76rem; }
  .atlas-ready { grid-template: auto auto / minmax(0, 1fr); justify-items: center; align-content: center; }
  .atlas-team { max-width: 225px; }
  .atlas-overlay { gap: 6px; }
  .atlas-map-view { padding: 5px; }
  .atlas-brief { display: grid; padding: 6px; gap: 5px; }
  .atlas-brief .atlas-actions { justify-content: start; }
  .atlas-node { min-height: 61px; gap: 2px; }
  .atlas-node-symbol { height: 23px; }
  .atlas-quiz { padding: 5px; gap: 5px; }
}
@media (max-height: 490px) {
  .atlas-layout:is(:fullscreen, .is-expanded) .atlas-cabinet { gap: 4px; padding: 5px; }
  .atlas-layout:is(:fullscreen, .is-expanded) .atlas-scorebar h2 { font-size: 1.13rem; }
  .atlas-layout:is(:fullscreen, .is-expanded) .atlas-feedback { min-height: 31px; padding-block: 2px; }
  .atlas-layout:is(:fullscreen, .is-expanded) .atlas-feedback img { height: 24px; }
  .atlas-layout:is(:fullscreen, .is-expanded) :is(.atlas-soft, .atlas-primary) { min-height: 32px; }
  .atlas-layout:is(:fullscreen, .is-expanded) .atlas-node { min-height: 52px; gap: 2px; }
  .atlas-layout:is(:fullscreen, .is-expanded) .atlas-node-symbol { height: 19px; font-size: .85rem; }
  .atlas-layout:is(:fullscreen, .is-expanded) .atlas-quiz { padding: 5px; gap: 5px; }
  .atlas-layout:is(:fullscreen, .is-expanded) .atlas-question-card h3 { font-size: clamp(1rem, 2.7vw, 1.35rem); }
}
@media (min-width: 571px) and (max-height: 490px) {
  .atlas-layout:is(:fullscreen, .is-expanded) .atlas-quiz { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: center; }
  .atlas-layout:is(:fullscreen, .is-expanded) :is(.atlas-explanation, .atlas-quiz-actions) { grid-column: 1 / -1; }
  .atlas-layout:is(:fullscreen, .is-expanded) .atlas-choice { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .atlas-light, .atlas-gem, .atlas-particles i { animation: none; }
  .atlas-scenery, .atlas-traveler, .atlas-timer span { transition: none; }
}
