:root {
  --bg: #10272f;
  --panel: #18363e;
  --panel2: #20434b;
  --ink: #fff6e5;
  --muted: #bfd0cf;
  --gold: #f2c779;
  --line: rgba(232, 219, 181, 0.18);
  --size: 1;
  --spacing: 0em;
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
  font-size: calc(16px * var(--size));
  letter-spacing: var(--spacing);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: radial-gradient(ellipse at 75% 15%, #28565055, transparent 55%), var(--bg);
  color: var(--ink);
  min-height: 100dvh;
}
button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: inherit;
}
button {
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  min-height: 46px;
  touch-action: manipulation;
}
button:disabled {
  cursor: default;
  opacity: 0.48;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}
button:hover {
  filter: brightness(1.1);
}
a {
  color: var(--gold);
}
.skip {
  position: absolute;
  top: -100px;
  z-index: 99;
}
.skip:focus {
  top: 12px;
  background: var(--bg);
  padding: 12px;
}
.topbar {
  max-width: 1280px;
  margin: auto;
  padding: 24px 42px;
  display: flex;
  gap: 30px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  font-size: 0.65rem;
  font-weight: bold;
  letter-spacing: 0.16em;
  line-height: 1.6;
}
.brand small {
  font: inherit;
  font-size: 0.85em;
}
.brand-mark {
  color: var(--gold);
  font-size: 2.5rem;
  line-height: 1;
}
nav {
  display: flex;
  gap: 8px;
  margin: auto;
}
.navbtn {
  font-size: 0.9rem;
  padding: 10px 18px;
  color: var(--muted);
  border-radius: 24px;
}
.navbtn.active {
  color: var(--gold);
  background: #f2c77912;
}
.icon-button {
  width: 48px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 1.35rem;
  color: var(--muted);
}
main {
  max-width: 1280px;
  margin: auto;
  padding: 0 42px 20px;
}
.hero {
  display: grid;
  grid-template-columns: 1fr 1.22fr;
  align-items: center;
  min-height: 405px;
  gap: 10px;
}
.eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 18px;
}
.hero h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(2.5rem, 4.1vw, 4.1rem);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.025em;
  margin: 0 0 22px;
}
.hero h1 em {
  color: var(--gold);
  font-weight: normal;
}
.hero p {
  color: var(--muted);
  line-height: 1.7;
  max-width: 370px;
  font-size: 1rem;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.next-step-card {
  max-width: 430px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff07;
}
.next-step-card span,
.next-step-card strong,
.next-step-card small {
  display: block;
}
.next-step-card span {
  color: var(--gold);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.next-step-card strong {
  margin: 7px 0;
  font:
    normal 1.18rem/1.35 Georgia,
    serif;
}
.next-step-card small {
  color: var(--muted);
  line-height: 1.5;
}
.home-shortcuts,
.training-categories {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.home-shortcuts {
  max-width: 820px;
  margin: 8px auto 4px;
}
.shortcut-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  padding: 20px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}
.shortcut-card strong {
  font:
    normal 1.15rem Georgia,
    serif;
}
.shortcut-card span {
  color: var(--muted);
  font-size: 0.8rem;
}
.progress-head {
  justify-content: space-between;
}
.progress-list {
  display: grid;
  gap: 14px;
  max-width: 900px;
  margin: 0 auto 35px;
}
.progress-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}
.progress-card .eyebrow {
  margin-bottom: 7px;
}
.progress-card h2,
.skill-start-card h2 {
  margin: 0 0 7px;
  font:
    normal 1.25rem/1.4 Georgia,
    serif;
}
.progress-card p,
.skill-start-card p {
  margin: 0 0 7px;
  color: var(--muted);
  line-height: 1.55;
}
.progress-card small {
  color: var(--gold);
}
.stage-dots {
  display: flex;
  gap: 6px;
  margin: 9px 0;
}
.stage-dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid #78908d;
}
.stage-dots span.done {
  background: #78908d;
}
.stage-dots span.current {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px #f2c77925;
}
.training-section {
  margin: 12px 0 30px;
}
.training-section h2 {
  font:
    normal 1.35rem Georgia,
    serif;
}
.resume-list,
.skill-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.story-drawer {
  margin: 30px 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.story-drawer summary {
  cursor: pointer;
  color: var(--muted);
}
.story-drawer .story-buttons {
  margin-top: 14px;
}
.compact-stages {
  max-width: 720px;
}
.skill-start-card {
  max-width: 720px;
  margin: 18px 0 40px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}
.primary {
  background: var(--gold);
  color: #21373c;
  border-radius: 12px;
  padding: 14px 24px;
  font-size: 0.93rem;
  font-weight: 700;
  box-shadow: 0 5px 20px #0002;
}
.secondary {
  border: 1px solid var(--line);
  padding: 12px 18px;
  border-radius: 12px;
  background: #ffffff05;
}
.quiet {
  color: var(--muted);
  font-size: 0.84rem;
  padding: 8px 12px;
}
.castle-art {
  width: 100%;
  height: auto;
  max-height: 410px;
  overflow: visible;
}
.hero-picture {
  position: relative;
}
.picture-label {
  position: absolute;
  right: 12%;
  bottom: 8%;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 0.88rem;
  color: #d0e4db;
  transform: rotate(-5deg);
}
.section-top {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  justify-content: space-between;
  margin: 12px 0 22px;
}
.section-top h2 {
  font:
    normal 1.65rem Georgia,
    serif;
  margin: 0 0 6px;
}
.subtle {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}
.room-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 15px;
}
.room-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  transition:
    transform 0.2s,
    background 0.2s;
  position: relative;
}
.room-card:hover {
  transform: translateY(-4px);
  background: var(--panel2);
}
.room-art {
  aspect-ratio: 1.45;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.room-art:before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 15%, #ffffff15, transparent 60%);
}
.room-art svg {
  height: 95%;
  width: 95%;
  position: relative;
}
.room-copy {
  padding: 17px 17px 19px;
  width: 100%;
}
.room-index {
  font-size: 0.6rem;
  letter-spacing: 0.17em;
  color: var(--gold);
  text-transform: uppercase;
}
.room-copy h3 {
  font:
    normal 1.08rem Georgia,
    serif;
  line-height: 1.25;
  margin: 7px 0 12px;
  min-height: 2.5em;
}
.room-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.7rem;
}
.dots {
  display: flex;
  gap: 4px;
}
.dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffffff25;
}
.dots i.on {
  background: var(--gold);
}
.smallnote {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0 8px;
  font-size: 0.8rem;
  color: var(--muted);
}
.smallnote b {
  font-size: 1.25rem;
  color: var(--gold);
  font-weight: normal;
}
.page-head {
  padding: 38px 0 23px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.page-head h1 {
  font:
    normal clamp(1.8rem, 4vw, 2.5rem) Georgia,
    serif;
  margin: 8px 0;
}
.back {
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 46px;
  flex-shrink: 0;
}
.wide-copy {
  max-width: 650px;
  line-height: 1.75;
  color: var(--muted);
}
.levels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px;
  margin: 20px 0 36px;
}
.level {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 18px;
  padding: 24px;
  text-align: left;
  position: relative;
  min-height: 155px;
}
.level .type-icon {
  color: var(--gold);
  display: block;
  font-size: 2rem;
  margin: 0 0 16px;
}
.level strong {
  display: block;
  font:
    normal 1.2rem Georgia,
    serif;
}
.level small {
  display: block;
  color: var(--muted);
  margin-top: 9px;
  font-size: 0.8rem;
}
.done-badge {
  position: absolute;
  top: 13px;
  right: 15px;
  color: var(--gold);
}
.play-layout {
  display: grid;
  grid-template-columns: minmax(220px, 310px) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  max-width: 1000px;
  margin: 16px auto 25px;
}
.play-info {
  padding: 26px 0;
}
.play-info h1 {
  font:
    normal 2.35rem Georgia,
    serif;
  margin: 8px 0 20px;
  line-height: 1.15;
}
.play-info p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--muted);
}
.guide-line {
  padding: 18px 0;
  border-top: 1px solid var(--line);
  margin-top: 25px;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.7;
}
.board-wrap {
  background: radial-gradient(ellipse at center, #315f5a33, transparent 80%), var(--panel);
  border: 1px solid var(--line);
  border-radius: 25px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 440px;
}
.board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.8rem;
}
.board-toolbar button {
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.board-area {
  width: min(100%, 440px);
  position: relative;
}
.flow-board,
.circuit-board {
  width: 100%;
  aspect-ratio: 1;
  position: relative;
  touch-action: none;
  background: #102a31;
  border-radius: 15px;
  overflow: hidden;
}
.flow-grid {
  display: grid;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}
.flow-cell {
  border: 1px solid #ffffff09;
  min-width: 0;
  min-height: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.gem {
  width: 55%;
  height: 55%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c);
  box-shadow: 0 0 18px color-mix(in srgb, var(--c), transparent 70%);
  color: #142c32;
  font-size: clamp(13px, 2vw, 22px);
  font-weight: bold;
  z-index: 2;
  pointer-events: none;
}
.flow-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.flow-svg path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.board-tools {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 22px;
}
.board-tools button {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 15px;
  font-size: 0.83rem;
}
.game-message {
  width: 100%;
  min-height: 3em;
  text-align: center;
  margin: 15px 0 0;
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.5;
}
.potion-board {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 22px 20px;
  padding: 20px 0;
  min-height: 280px;
}
.tube {
  width: 65px;
  min-height: 165px;
  position: relative;
  padding: 14px 5px 0;
  transition: transform 0.2s;
  display: flex;
  align-items: center;
  flex-direction: column;
}
.tube.selected {
  transform: translateY(-12px);
}
.tube.hint {
  outline: 2px dashed var(--gold);
  outline-offset: 5px;
  border-radius: 12px;
}
.tube-glass {
  height: 132px;
  width: 52px;
  position: relative;
  border: 2px solid #cbe7e486;
  border-top: 4px solid #e0f1efac;
  border-radius: 5px 5px 23px 23px;
  background: #ffffff04;
  overflow: hidden;
  display: flex;
  flex-direction: column-reverse;
  box-shadow: inset -7px 0 0 #ffffff07;
}
.liquid {
  height: 25%;
  width: 100%;
  background: var(--c);
  color: #143039;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  box-shadow: inset -7px 0 0 #ffffff12;
}
.tube-num {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 9px;
}
.circuit-board {
  display: grid;
  gap: 3px;
  padding: 4px;
}
.circuit-tile {
  min-height: 0;
  min-width: 0;
  padding: 0;
  background: #21434a;
  border-radius: 7px;
  position: relative;
}
.circuit-tile svg {
  width: 100%;
  height: 100%;
  display: block;
}
.circuit-tile.hint {
  box-shadow: inset 0 0 0 3px var(--gold);
}
.circuit-tile.lit {
  background: #2f544d;
}
.circuit-tile .pipe {
  stroke: #749492;
}
.circuit-tile.lit .pipe {
  stroke: var(--gold);
}
.friend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin: 25px 0;
}
.friend {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  text-align: center;
  padding: 25px;
}
.friend.locked {
  opacity: 0.5;
}
.friend svg {
  height: 130px;
  width: 140px;
}
.friend h2 {
  font:
    normal 1.3rem Georgia,
    serif;
}
.friend p {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--muted);
}
.library-card {
  padding: 25px 30px;
  max-width: 650px;
  margin: 15px 0 30px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
}
.library-card h2 {
  font:
    normal 1.4rem Georgia,
    serif;
}
.library-card p {
  line-height: 1.8;
  color: var(--muted);
}
.story-text {
  font:
    normal 1.16rem/1.9 Georgia,
    serif;
  color: var(--ink) !important;
}
.pause-screen {
  text-align: center;
  max-width: 600px;
  margin: 70px auto;
  padding: 40px 15px;
}
.pause-screen h1 {
  font:
    normal 2.7rem Georgia,
    serif;
}
.pause-screen p {
  color: var(--muted);
  line-height: 1.8;
}
.pause-symbol {
  color: var(--gold);
  font-size: 3.5rem;
}
footer {
  max-width: 1280px;
  margin: auto;
  padding: 20px 42px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--muted);
}
footer button {
  color: var(--muted);
  font-size: 0.75rem;
}
footer button:first-letter {
  color: var(--gold);
}
dialog {
  border: 1px solid #536e6b;
  background: #18363e;
  color: var(--ink);
  border-radius: 23px;
  padding: 30px;
  max-width: min(94vw, 620px);
  max-height: 90dvh;
  overflow: auto;
  box-shadow: 0 30px 150px #0008;
}
dialog::backdrop {
  background: #071b24bb;
  backdrop-filter: blur(5px);
}
dialog h2 {
  font:
    normal 1.8rem Georgia,
    serif;
  margin: 0 0 18px;
}
dialog p {
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.9rem;
}
.dialog-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
}
.close {
  font-size: 1.5rem;
  padding: 0 5px;
  margin-top: -8px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 20px 0;
  font-size: 0.9rem;
}
.field input,
.field textarea,
.field select {
  border: 1px solid #5f7d7c;
  background: #102c34;
  color: var(--ink);
  border-radius: 10px;
  padding: 12px;
  width: 100%;
  min-height: 48px;
}
.field textarea {
  min-height: 85px;
  resize: vertical;
}
.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--line);
}
.toggle input {
  width: 23px;
  height: 23px;
  accent-color: var(--gold);
  flex-shrink: 0;
}
.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 25px 0;
}
.parent-section {
  font-size: 1rem;
  color: var(--gold);
  margin: 28px 0 10px;
}
.note {
  padding: 12px;
  background: #102c34;
  border-radius: 10px;
  margin: 9px 0;
  line-height: 1.6;
  font-size: 0.85rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.note time {
  display: block;
  color: var(--gold);
  font-size: 0.7rem;
  margin-bottom: 5px;
}
.door-frame {
  position: relative;
  margin: 25px auto;
  width: 100px;
  height: 135px;
  border: 5px solid #d5b178;
  border-bottom: 0;
  border-radius: 60px 60px 0 0;
  background: radial-gradient(ellipse, #f6dba0, #8aaf96);
  overflow: hidden;
}
.door-panel {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #294d50, #39706a);
  border: 2px solid #d5b178;
  border-radius: 60px 60px 0 0;
  transform-origin: left;
  animation: open-door 0.8s ease forwards;
  pointer-events: none;
}
.door-panel:after {
  content: '✦';
  position: absolute;
  right: 13px;
  top: 75px;
  color: var(--gold);
}
@keyframes open-door {
  to {
    transform: perspective(300px) rotateY(-105deg);
  }
}
.success {
  text-align: center;
  padding: 10px;
}
.success h2 {
  margin: 15px 0;
}
.success .primary {
  width: 100%;
  margin: 15px 0 8px;
}
.fade-star {
  font-size: 4rem;
  color: var(--gold);
  margin: 20px;
}
.status-line {
  font-size: 0.8rem;
  color: var(--muted);
  min-height: 1.5em;
  margin-top: 10px;
}
#toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 13px 20px;
  border: 1px solid #53746d;
  border-radius: 12px;
  background: #254b49;
  box-shadow: 0 10px 40px #0004;
  max-width: 90vw;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  font-size: 0.85rem;
  z-index: 100;
}
#toast.show {
  opacity: 1;
}
/* Phrase après une réponse : félicitation, ou « ce n'est pas juste » avec encouragement */
.answer-banner {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  transform: translate(-50%, -16px);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(92vw, 560px);
  padding: 14px 20px;
  border-radius: 16px;
  border: 2px solid var(--gold);
  background: #254b49;
  color: var(--ink);
  box-shadow: 0 12px 44px #0006;
  font-size: 1.05rem;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.25s,
    transform 0.25s;
  z-index: 120;
}
.answer-banner.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.answer-banner.right {
  border-color: #8fd9a8;
  background: #1f5a48;
}
.answer-banner.wrong {
  border-color: #f2c779;
  background: #4a3d2c;
}
.answer-banner-icon {
  font-size: 1.5rem;
  color: var(--gold);
  flex: none;
}
.answer-banner.right .answer-banner-icon {
  color: #b9f0c9;
}
.high-contrast .answer-banner {
  background: #000;
  border-color: #fff;
}
.no-motion * {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
.high-contrast {
  --bg: #081a21;
  --panel: #0c252e;
  --muted: #e5edeb;
  --line: #809794;
}
body.no-motion .door-panel {
  transform: perspective(300px) rotateY(-105deg);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 25px;
  padding: 7px 12px;
  font-size: 0.7rem;
  color: var(--muted);
}
@media (min-width: 1350px) {
  .hero {
    min-height: 455px;
  }
  .hero h1 {
    font-size: 4.1rem;
  }
  .castle-art {
    max-height: 450px;
  }
}
@media (max-width: 1000px) {
  .topbar,
  main,
  footer {
    padding-left: 24px;
    padding-right: 24px;
  }
  .hero {
    grid-template-columns: 1fr 1fr;
    min-height: 350px;
  }
  .room-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .room-copy h3 {
    min-height: 0;
  }
  .room-art {
    aspect-ratio: 1.8;
  }
  .play-layout {
    gap: 24px;
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .board-wrap {
    padding: 18px;
  }
  .topbar {
    gap: 10px;
  }
  nav {
    gap: 0;
  }
  .navbtn {
    padding: 10px 12px;
  }
}
@media (max-width: 700px) {
  .topbar {
    padding: 16px 18px;
    flex-wrap: wrap;
  }
  .brand {
    font-size: 0.58rem;
  }
  .brand-mark {
    font-size: 2rem;
  }
  .topbar > nav {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: 6px;
  }
  .icon-button {
    margin-left: auto;
  }
  .hero {
    grid-template-columns: 1fr;
    padding-top: 30px;
    gap: 0;
  }
  .hero-copy {
    position: relative;
    z-index: 1;
  }
  .hero h1 {
    font-size: 2.7rem;
    max-width: 350px;
  }
  .hero p {
    font-size: 0.92rem;
    margin: 0;
    max-width: 320px;
  }
  .hero-actions {
    margin-top: 20px;
  }
  .hero-picture {
    margin: -25px -10px -8px 75px;
  }
  .home-shortcuts,
  .training-categories,
  .resume-list,
  .skill-list {
    grid-template-columns: 1fr;
  }
  .progress-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .progress-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .progress-card .secondary {
    width: 100%;
  }
  .stage-dots span {
    width: 13px;
    height: 13px;
  }
  .castle-art {
    height: 240px;
  }
  .picture-label {
    display: none;
  }
  main {
    padding: 0 18px 20px;
  }
  .section-top {
    margin-top: 10px;
  }
  .section-top h2 {
    font-size: 1.5rem;
  }
  .section-top > .badge {
    display: none;
  }
  .room-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .room-grid > .room-card:last-child {
    grid-column: 1/-1;
    flex-direction: row;
  }
  .room-grid > .room-card:last-child .room-art {
    width: 45%;
    aspect-ratio: auto;
    max-height: 160px;
  }
  .room-grid > .room-card:last-child .room-copy {
    width: 55%;
    align-self: center;
  }
  .room-copy {
    padding: 13px;
  }
  .room-copy h3 {
    font-size: 1.02rem;
  }
  .room-foot {
    font-size: 0.65rem;
  }
  .room-art {
    aspect-ratio: 1.4;
  }
  .play-layout {
    grid-template-columns: 1fr;
    gap: 0;
    margin-top: 0;
  }
  .play-info {
    padding: 12px 0;
  }
  .play-info h1 {
    font-size: 1.8rem;
    margin: 5px 0 9px;
  }
  .play-info p {
    margin: 5px 0;
    font-size: 0.87rem;
  }
  .guide-line {
    display: none;
  }
  .board-wrap {
    padding: 17px 14px;
    min-height: 0;
  }
  .board-area {
    max-width: 420px;
  }
  .board-toolbar {
    margin-bottom: 13px;
  }
  .board-tools {
    gap: 6px;
    margin-top: 15px;
  }
  .board-tools button {
    font-size: 0.78rem;
    padding: 9px 12px;
  }
  .game-message {
    font-size: 0.8rem;
  }
  .page-head {
    padding-top: 24px;
  }
  .page-head h1 {
    font-size: 1.9rem;
  }
  .levels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .level {
    padding: 18px;
    min-height: 140px;
  }
  .level strong {
    font-size: 1.05rem;
  }
  .level small {
    font-size: 0.72rem;
  }
  .level .type-icon {
    font-size: 1.7rem;
    margin: 0 0 12px;
  }
  footer {
    padding: 15px 18px;
    gap: 6px;
    flex-wrap: wrap;
  }
  footer > span:last-child {
    width: 100%;
    font-size: 0.62rem;
  }
  footer button {
    margin-left: auto;
  }
  .tube {
    width: 55px;
  }
  .potion-board {
    gap: 15px 12px;
  }
  .tube-glass {
    width: 48px;
  }
  .friend-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .friend {
    padding: 15px;
  }
  .friend svg {
    width: 100px;
    height: 105px;
  }
  .gem {
    font-size: 16px;
  }
  dialog {
    padding: 22px;
  }
  .navbtn {
    font-size: 0.85rem;
  }
  .library-card {
    padding: 20px;
  }
  .game-top {
    padding-top: 20px;
  }
  .play-info .eyebrow {
    margin: 10px 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
  .door-panel {
    transform: perspective(300px) rotateY(-105deg);
  }
}
/* Version 2: stable square circuits, deliberate level selection and learning workshops. */
.circuit-board {
  grid-auto-rows: minmax(0, 1fr);
  touch-action: manipulation;
}
.circuit-tile {
  aspect-ratio: 1;
  overflow: hidden;
  position: relative;
}
.circuit-tile svg {
  position: absolute;
  inset: 0;
}
.circuit-tile.locked {
  opacity: 1;
  cursor: default;
  background: #294b51;
}
.circuit-tile.locked.lit {
  background: #4b6451;
}
.circuit-tile .pipe {
  transition: stroke 0.18s;
}
.circuit-progress {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  margin: 12px 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.circuit-progress .on {
  color: var(--gold);
}
.circuit-progress .off {
  color: #adc4ca;
}
.difficulty {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin: 12px 0 20px;
}
.difficulty-label {
  color: var(--muted);
  font-size: 0.78rem;
  margin-right: 5px;
}
.difficulty button {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 9px 18px;
  min-height: 43px;
  color: var(--muted);
  font-size: 0.82rem;
}
.difficulty button.selected {
  background: var(--gold);
  color: #18363e;
  border-color: var(--gold);
}
.companion-whisper {
  border-left: 2px solid #f2c77966;
  padding: 8px 0 8px 14px;
  margin: 0 0 20px;
  max-width: 680px;
  color: #e8d4ac;
  font:
    italic 1rem/1.6 Georgia,
    serif;
}
.companion-whisper small {
  display: block;
  font:
    normal 0.65rem/1.5 Arial,
    sans-serif;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}
.workshop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 20px 0 30px;
}
.workshop-card {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, var(--workshop), var(--panel) 80%);
  border-radius: 20px;
  padding: 25px;
  text-align: left;
}
.workshop-icon {
  display: block;
  color: var(--gold);
  font-size: 2.1rem;
  margin-bottom: 12px;
}
.workshop-card h2 {
  font:
    normal 1.4rem Georgia,
    serif;
  margin: 10px 0;
}
.workshop-card p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--muted);
}
.workshop-card .quiet {
  padding: 0;
  font-size: 0.73rem;
}
.story-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.activity-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 35px;
}
.activity-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 15px;
  text-align: left;
  padding: 18px;
}
.activity-number {
  color: var(--gold);
  font:
    normal 1.7rem Georgia,
    serif;
}
.activity-card strong {
  font-weight: normal;
  line-height: 1.5;
}
.activity-card small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 7px;
  line-height: 1.6;
}
.activity-card > span:last-child {
  margin-left: auto;
  color: var(--gold);
}
.learning-board {
  max-width: 800px;
  margin: 10px auto 35px;
  padding: 30px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 23px;
}
.learning-board h2 {
  font:
    normal 1.45rem/1.6 Georgia,
    serif;
  margin: 12px 0 24px;
}
.reading-passage {
  font-size: 1.13rem;
  line-height: 1.95;
  background: #ffffff05;
  padding: 22px;
  border-radius: 15px;
}
.learning-controls {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.answer-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 22px 0;
}
.answer {
  border: 1px solid #6c8884;
  border-radius: 13px;
  background: #20464b;
  padding: 18px 15px;
  min-height: 70px;
  font-size: 1.05rem;
  line-height: 1.6;
}
.answer.correct {
  border: 2px solid var(--gold);
  background: #3c5b4e;
  opacity: 1;
}
.answer:disabled {
  opacity: 0.65;
}
.learning-hint {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--muted);
}
.explanation {
  padding: 20px;
  background: #244c48;
  border-radius: 13px;
  margin: 18px 0;
  line-height: 1.8;
}
.explanation strong {
  color: var(--gold);
  font-weight: normal;
  font-size: 1.1rem;
}
.explanation p {
  margin: 10px 0;
}
.learning-bottom {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-top: 25px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.fraction-band {
  display: flex;
  gap: 3px;
  width: 100%;
  height: 70px;
  margin: 30px 0;
}
.fraction-band span {
  flex: 1;
  background: #102b33;
  border: 1px solid #7b9992;
  border-radius: 4px;
}
.fraction-band .filled {
  background: var(--gold);
  border-color: #f4d8a0;
}
.number-line {
  width: 100%;
  height: auto;
  max-height: 160px;
}
.fact-art {
  text-align: center;
  color: var(--gold);
  font-size: 4rem;
  margin: 20px;
}
.fact-source {
  font-size: 0.75rem;
  line-height: 1.7;
  color: var(--muted);
  margin-top: 22px;
}
.parent-details {
  padding: 15px 0;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  line-height: 1.7;
}
.parent-details summary {
  cursor: pointer;
  color: var(--gold);
  padding: 8px 0;
}
.parent-details ul {
  padding-left: 20px;
}
.parent-details li {
  margin: 12px 0;
  color: var(--muted);
}
@media (max-width: 900px) {
  .workshop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .workshop-grid {
    gap: 12px;
  }
  .workshop-card {
    padding: 18px;
  }
  .workshop-card h2 {
    font-size: 1.15rem;
  }
  .activity-list {
    grid-template-columns: 1fr;
  }
  .learning-board {
    padding: 20px 16px;
  }
  .learning-board h2 {
    font-size: 1.25rem;
  }
  .reading-passage {
    font-size: 1.04rem;
    padding: 15px;
  }
  .answer-choices {
    grid-template-columns: 1fr;
  }
  .difficulty button {
    padding: 8px 12px;
  }
  .companion-whisper {
    font-size: 0.95rem;
    margin-bottom: 10px;
  }
  .page-head #activity-stop {
    font-size: 0.7rem;
    padding: 5px;
    max-width: 95px;
  }
  .fraction-band {
    height: 55px;
  }
}
.fraction-part {
  flex: 1;
  min-width: 0;
  background: #102b33;
  border: 1px solid #7b9992;
  border-radius: 5px;
}
.fraction-part.filled {
  background: var(--gold);
}
.number-builder {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 15px 0;
}
.number-builder > div {
  background: #102e36;
  border-radius: 15px;
  padding: 18px;
  text-align: center;
}
.number-builder h3 {
  font-weight: normal;
  font-size: 1rem;
  color: var(--muted);
}
.stepper {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: center;
}
.stepper button {
  width: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 1.4rem;
}
.stepper strong {
  font-size: 1.8rem;
  font-weight: normal;
  color: var(--gold);
}
.quantity-blocks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 7px;
  min-height: 50px;
  margin: 20px 0 0;
}
.quantity-blocks i.tens {
  display: block;
  width: 14px;
  height: 65px;
  background: repeating-linear-gradient(
    to bottom,
    #f2c779 0,
    #f2c779 5px,
    #957e52 5px,
    #957e52 6.5px
  );
  border-radius: 2px;
}
.quantity-blocks i.ones {
  display: block;
  width: 14px;
  height: 14px;
  background: #62d6ca;
  border-radius: 2px;
}
@media (max-width: 500px) {
  .number-builder {
    gap: 10px;
  }
  .number-builder > div {
    padding: 12px 6px;
  }
  .stepper {
    gap: 8px;
  }
}
/* Version 3: mixed short itinerary, original logic games and coverage map. */
.extra-rooms {
  margin: 32px 0 18px;
}
.extra-rooms h2 {
  font:
    normal 1.65rem Georgia,
    serif;
}
.extra-menu {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.journey-controls {
  margin: 20px auto 30px;
  max-width: 900px;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.78rem;
}
.journey-controls > span {
  margin-right: auto;
  padding: 8px;
}
.journey-controls button {
  font-size: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  min-height: 42px;
}
.extra-layout {
  max-width: 680px;
  margin: 0 auto 35px;
  text-align: center;
}
.extra-layout .wide-copy {
  text-align: left;
}
.extra-board {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  margin-top: 18px;
}
.cross-grid {
  display: grid;
  gap: 8px;
  align-items: center;
  margin: 10px auto 25px;
  max-width: 520px;
}
.cross-cell {
  min-height: 55px;
  background: #315752;
  border: 1px solid #809e8b;
  border-radius: 10px;
  font-size: 1.5rem;
  padding: 5px;
}
.cross-cell.fixed {
  background: #17313c;
  color: var(--muted);
  opacity: 1;
  border-style: dashed;
}
.cross-cell.selected {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.cross-op {
  font-size: 1.3rem;
  color: var(--muted);
}
.cross-target {
  font-size: 1.3rem;
  color: var(--gold);
  font-weight: bold;
}
.cross-total {
  color: var(--gold);
  font-size: 0.9rem;
  padding: 10px 0;
}
.number-pool {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 22px 0 0;
}
.number-pool button {
  background: #f2c779;
  color: #17313c;
  width: 50px;
  border-radius: 10px;
  font-size: 1.3rem;
}
.number-pool button.used {
  background: #35544e;
  color: var(--muted);
}
.number-pool button:disabled {
  display: none;
}
.maze-grid {
  display: grid;
  gap: 3px;
  width: min(100%, 440px);
  aspect-ratio: 1;
  margin: auto;
  touch-action: none;
  background: #102730;
  border-radius: 10px;
  overflow: hidden;
  padding: 4px;
}
.maze-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  border-radius: 4px;
  background: #49665f;
}
.maze-cell.wall {
  background: #0b202b;
}
.maze-cell.painted {
  background: #d3b671;
}
.maze-cell.ball {
  background: #f2d696;
  color: #2a5960;
  box-shadow: inset 0 0 0 3px #fff0c3;
}
.maze-cell.ball > span {
  font-size: 1.5rem;
}
.maze-arrows {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px auto;
}
.maze-arrows button {
  width: 54px;
  border-radius: 50%;
  border: 1px solid #698b7e;
  background: #25473e;
  font-size: 1.5rem;
}
.pattern-sequence {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.pattern-sequence > span,
.pattern-matrix > span {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border: 1px solid #648777;
  border-radius: 12px;
  background: #264c43;
  font-size: 2rem;
  color: var(--gold);
  padding: 8px;
}
.pattern-matrix {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 340px;
  margin: auto;
}
.pattern-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  justify-content: center;
  max-width: 100%;
}
.pattern-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  display: block;
}
.school-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  text-align: left;
  font-size: 1rem;
}
.school-table td,
.school-table th {
  border: 1px solid #5f8077;
  padding: 13px;
}
.school-table th {
  background: #24483f;
  color: var(--gold);
}
.table-scroll {
  overflow: auto;
}
.geometry-picture {
  width: 100%;
  max-height: 210px;
}
.mission-note {
  padding: 15px;
  border: 1px solid #718674;
  border-radius: 12px;
  background: #2b4e40;
  line-height: 1.8;
  font-size: 0.88rem;
  margin: 15px 0 22px;
}
.learning-bottom .primary {
  min-width: 200px;
}
.coverage-note {
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--muted);
}
@media (max-width: 700px) {
  .extra-menu {
    grid-template-columns: 1fr;
  }
  .extra-menu .level {
    min-height: 100px;
    padding: 20px;
    display: grid;
    grid-template-columns: 45px 1fr;
    gap: 5px 12px;
    align-items: center;
  }
  .extra-menu .level .type-icon {
    grid-row: 1/3;
    margin: 0;
  }
  .extra-menu .level small {
    margin: 0;
  }
  .extra-board {
    padding: 18px 12px;
  }
  .cross-grid {
    gap: 5px;
  }
  .cross-cell {
    font-size: 1.2rem;
    min-height: 46px;
  }
  .cross-target {
    font-size: 1rem;
  }
  .cross-total {
    font-size: 0.75rem;
  }
  .pattern-sequence {
    gap: 5px;
  }
  .pattern-sequence > span {
    padding: 4px;
  }
  .pattern-dots i {
    width: 7px;
    height: 7px;
  }
  .journey-controls > span {
    width: 100%;
    text-align: center;
    margin: 0;
  }
  .journey-controls button {
    flex: 1;
  }
  .maze-arrows {
    gap: 9px;
  }
  .school-table td,
  .school-table th {
    padding: 10px;
  }
  .number-pool {
    gap: 8px;
  }
}
.discovery-stamp {
  font-size: 2.2rem;
  line-height: 1;
  text-align: center;
  color: var(--gold);
  margin: 22px 0 14px;
  text-shadow: 0 0 20px #e8c77955;
}
.extra-layout #extra-feedback {
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.8;
}
.school-table + * {
  margin-top: 16px;
}
/* Guided short lessons and original logic puzzles */
footer {
  flex-wrap: wrap;
  gap: 12px;
}
#cloud-status {
  font-size: 0.78rem;
}
.guided-board {
  max-width: 850px;
  margin: auto;
}
.method-box {
  margin: 20px 0;
  padding: 18px 22px;
  border: 1px solid #a8c7b766;
  background: #183d40;
  border-radius: 16px;
}
.method-box[hidden] {
  display: none;
}
.place-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.place-grid section {
  background: #102b32;
  border: 1px solid #90b8a755;
  border-radius: 14px;
  padding: 12px;
  text-align: center;
}
.place-grid h3 {
  font-size: 1rem;
}
.place-grid strong {
  font-size: 1.8rem;
  color: var(--gold, #f2c779);
}
.place-grid .quantity-blocks {
  min-height: 90px;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  gap: 5px;
  justify-content: center;
}
.place-grid .quantity-blocks .hundreds {
  display: inline-block;
  width: 32px;
  height: 32px;
  background: repeating-linear-gradient(0deg, #e9c272 0 2px, #b48b49 2px 3px);
  border: 1px solid #f2d391;
}
.exchange-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}
.exchange-actions button,
.place-grid button {
  background: #234951;
  border: 1px solid #829e9277;
  border-radius: 10px;
  color: #fff6e5;
  padding: 12px;
  min-height: 46px;
}
.strategy-steps {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}
.strategy-steps input {
  max-width: 220px;
  font-variant-numeric: tabular-nums;
}
.fraction-line {
  display: flex;
  align-items: stretch;
  border-bottom: 3px solid #e0c787;
  margin: 42px 10px 28px;
  min-height: 100px;
}
.fraction-line button {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #e5f0df;
  font-size: 1.3rem;
  padding: 12px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}
.fraction-line button.selected {
  background: #3d6155;
  color: #ffda88;
}
.pearl-groups {
  display: grid;
  margin: 20px 0;
  gap: 12px;
}
.pearl-groups.grouped {
  grid-template-columns: repeat(4, 1fr);
}
.pearl-groups > span {
  padding: 12px;
  border: 1px solid #b2c2a999;
  border-radius: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: start;
}
.pearl {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e5c17c;
}
.assembled-word {
  font-size: 2rem;
  min-height: 60px;
  text-align: center;
  letter-spacing: 0.06em;
}
.answer.selected {
  border-color: #f2c779;
  background: #36594f;
  box-shadow: 0 0 0 2px #f2c77944;
}
.motif {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  width: clamp(42px, 10vw, 74px);
  aspect-ratio: 1;
  padding: 7px;
  border: 1px solid #9cb5a544;
  border-radius: 9px;
}
.motif i {
  display: block;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #91a29922;
}
.motif i.on {
  background: #f2c779;
}
.logic-symbol,
.missing-piece {
  font-size: 2.6rem;
  line-height: 1.4;
  color: #f1d79a;
}
.balance-equations {
  text-align: center;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-variant-numeric: tabular-nums;
}
.answer-choices .answer {
  display: flex;
  align-items: center;
  justify-content: center;
}
.guided-board .answer-choices .answer {
  text-align: left;
  justify-content: flex-start;
}
.guided-board table {
  margin: 18px 0;
}
.guided-board h2 {
  line-height: 1.5;
}
.guided-board button:disabled {
  opacity: 0.65;
}
.guided-board .fraction-band {
  margin: 14px 0;
}
.guided-board .fraction-part {
  min-height: 70px;
}
#travel-code-copy,
#travel-code {
  font-family: ui-monospace, monospace;
  letter-spacing: 0.08em;
}
@media (max-width: 560px) {
  .place-grid {
    gap: 6px;
  }
  .place-grid section {
    padding: 8px 3px;
  }
  .place-grid h3 {
    font-size: 0.8rem;
  }
  .place-grid button {
    font-size: 0.78rem;
    padding: 8px 3px;
  }
  .exchange-actions button {
    font-size: 0.85rem;
    flex: 1 1 42%;
  }
  .pearl-groups.grouped {
    grid-template-columns: repeat(2, 1fr);
  }
  .pattern-sequence {
    flex-wrap: wrap;
  }
  .guided-board {
    padding: 16px;
  }
  .fraction-line {
    margin-left: 0;
    margin-right: 0;
  }
  #travel-code-copy,
  #travel-code {
    letter-spacing: 0;
    font-size: 1rem;
  }
}
/* A quiet entrance; optional tools stay together. */
[hidden] {
  display: none !important;
}
.guided-welcome {
  margin: 16px 0 32px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
}
.sequence-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px 24px;
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
}
.sequence-overview li {
  display: flex;
  gap: 12px;
  align-items: baseline;
}
.sequence-overview li span {
  color: var(--gold);
}
.free-explore,
.activity-options {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 20px;
  margin: 22px 0;
}
.free-explore > summary,
.activity-options > summary {
  cursor: pointer;
  min-height: 36px;
  align-content: center;
  color: var(--gold);
}
.free-explore > h2 {
  margin-top: 28px;
}
.option-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}
.activity-options .journey-controls {
  border: 0;
  margin: 10px 0 0;
  padding: 0;
  justify-content: flex-start;
}
.activity-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
}
.activity-head > #activity-stop {
  justify-self: end;
  white-space: nowrap;
}
.partition-choices {
  display: grid;
  gap: 15px;
  margin: 24px 0;
}
.partition-choice {
  display: grid;
  gap: 14px;
  text-align: left;
  padding: 16px;
  border: 2px solid var(--line);
  border-radius: 14px;
  min-height: 96px;
}
.partition-choice.selected {
  border-color: var(--gold);
  background: #36594f;
}
.partition-band {
  display: flex;
  width: 100%;
  height: 42px;
  border: 1px solid var(--gold);
}
.partition-band i {
  background: #315752;
  border-right: 2px solid var(--gold);
}
.partition-band i:last-child {
  border: 0;
}
.pattern-dots {
  display: grid;
  gap: 7px;
  justify-items: center;
}
.five-frame {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  max-width: 105px;
  min-width: 90px;
}
.five-frame i {
  width: 100%;
  max-width: 15px;
  min-width: 14px;
  height: auto;
  aspect-ratio: 1;
}
.five-frame i.empty {
  background: transparent;
  box-shadow: inset 0 0 0 1px #a7b9a344;
}
.save-status {
  display: flex;
  gap: 8px 14px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  align-items: center;
}
.save-status span:empty {
  display: none;
}
footer {
  align-items: center;
  gap: 12px 18px;
}
.save-status #offline-status {
  font-size: inherit;
}
@media (max-width: 600px) {
  .sequence-overview {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .guided-welcome {
    padding: 20px;
  }
  .activity-head {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 8px;
  }
  .activity-head h1 {
    font-size: 1.6rem;
  }
  .activity-head > #activity-stop {
    font-size: 0.8rem;
    padding: 8px;
  }
  .save-status {
    flex-basis: 100%;
    justify-content: center;
  }
  footer > span:first-child {
    display: none;
  }
  .five-frame {
    gap: 2px;
  }
  .pattern-sequence > span {
    aspect-ratio: auto;
    min-height: 105px;
  }
  .free-explore {
    padding: 14px;
  }
}

/* V7: daily route, reading and notebook. No performance metrics in child screens. */
[hidden] {
  display: none !important;
}
.daily-plan {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 4px 0 26px;
}
.day-step {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  background: var(--panel);
}
.day-step.current {
  border-color: var(--gold);
  background: #26483f;
}
.day-step.done {
  border-color: #8ab6a2;
}
.day-step.skipped {
  border-style: dashed;
}
.day-step-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--gold);
  font-size: 1.2rem;
}
.day-step strong,
.day-step small {
  display: block;
}
.day-step strong {
  font:
    normal 1.12rem/1.45 Georgia,
    serif;
}
.day-step small {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
  margin-top: 5px;
}
.reading-work,
.word-work {
  max-width: 790px;
}
.reading-work p,
.word-work p {
  line-height: 1.8;
}
.measured-passage {
  font-size: 1.15rem;
  line-height: 2;
}
.reading-explanation {
  border-left: 2px solid var(--gold);
  padding-left: 15px;
}
.flash-window {
  min-height: 140px;
  display: grid;
  place-items: center;
  font-size: clamp(1.5rem, 5vw, 2.7rem);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin: 20px 0;
  background: #10272f;
}
.word-model {
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  text-align: center;
  overflow-wrap: anywhere;
  padding: 14px 0;
}
.syllable-model {
  text-align: center;
  color: var(--muted);
  font-size: 1.25rem;
}
mark.grapheme {
  background: #f2c7792e;
  color: var(--gold);
  border-radius: 5px;
  padding: 0 2px;
}
.judgment-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.letter-keyboard {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 7px;
  margin: 20px 0;
}
.letter-keyboard button {
  background: #244c48;
  border: 1px solid #6b8a80;
  border-radius: 9px;
  min-width: 0;
  min-height: 48px;
  padding: 5px;
  font-size: 1.1rem;
}
#dictation-input {
  font-size: 1.6rem;
  min-height: 60px;
}
.voice-note {
  color: var(--muted);
  border-left: 2px solid var(--gold);
  padding: 15px;
}
.word-book {
  padding: 10px 0 30px;
  max-width: 850px;
}
.word-book h2 {
  font:
    normal 1.6rem Georgia,
    serif;
  margin-top: 25px;
}
.word-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.word-won {
  background: #2b5147;
  border: 1px solid #81aa92;
  border-radius: 12px;
  padding: 12px 18px;
}
.progress-notebook {
  margin-bottom: 22px;
}
.parent-actions {
  display: grid;
  gap: 12px;
  margin: 18px 0 25px;
}
.parent-report {
  line-height: 1.65;
}
.report-counters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.report-counters > div {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.report-counters strong,
.report-counters span {
  display: block;
}
.report-counters strong {
  font-size: 1.8rem;
  color: var(--gold);
}
.report-counters span {
  font-size: 0.8rem;
  color: var(--muted);
}
.report-chart {
  margin: 24px 0;
  padding: 15px 0;
}
.report-chart svg {
  width: 100%;
  height: auto;
}
.report-chart figcaption {
  font-weight: bold;
  margin-bottom: 12px;
}
.report-empty {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 20px;
}
.practice-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.practice-calendar span {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 35px;
  color: var(--muted);
}
.practice-calendar span.practised {
  background: #3b6552;
  border-color: #c4c889;
  color: var(--ink);
}
@media (max-width: 700px) {
  .daily-plan {
    grid-template-columns: 1fr;
  }
  .day-step {
    padding: 15px;
  }
  .letter-keyboard {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .workshop-grid {
    grid-template-columns: 1fr;
  }
  .report-counters {
    grid-template-columns: 1fr;
  }
  .reading-work,
  .word-work {
    padding: 20px 16px;
  }
}

@media (max-width: 800px) {
  .pattern-sequence {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 430px) {
  .pattern-sequence,
  .pattern-matrix {
    gap: 6px;
  }
  .pattern-sequence > span,
  .pattern-matrix > span {
    padding: 3px;
  }
  .five-frame {
    min-width: 78px;
    gap: 2px;
  }
}

/* The Fil d’Or academy: original illustrations, quiet school atmosphere. */
:root {
  --bg: #171b32;
  --panel: #232c46;
  --panel2: #303b58;
  --muted: #c8cbdc;
  --gold: #f1cf91;
  --line: rgba(226, 211, 188, 0.2);
}
body {
  background: radial-gradient(ellipse at 80% 7%, #66517c38, transparent 50%), var(--bg);
}
.topbar {
  background: #191c34ee;
}
.hero {
  gap: 24px;
}
.academy-scene {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 620px;
  aspect-ratio: 620 / 470;
  margin: 12px 0 20px;
}
.school-art {
  display: block;
  width: 100%;
  height: auto;
}
.scene-apprentice {
  position: absolute;
  width: 40%;
  bottom: 7%;
  left: 30%;
  filter: drop-shadow(0 8px 12px #11152c66);
}
.apprentice-art {
  width: 100%;
  height: auto;
  display: block;
}
.wizard-nameplate {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 225px;
  max-width: 95%;
  padding: 13px 22px;
  border: 1px solid #cfac7666;
  border-radius: 14px;
  background: #252a42f5;
  box-shadow: 0 8px 22px #0b102533;
}
.wizard-nameplate span {
  font-size: 0.72rem;
  color: var(--muted);
}
.wizard-nameplate strong {
  font-family: Georgia, serif;
  font-size: 1.08rem;
  color: var(--gold);
  font-weight: 400;
}
.wizard-nameplate small {
  font-size: 0.72rem;
}
.wizard-profile {
  display: grid;
  grid-template-columns: minmax(180px, 270px) 1fr;
  gap: 36px;
  align-items: center;
  padding: 28px 40px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: radial-gradient(ellipse at 20% 45%, #8572a133, transparent 50%), #252b45;
  margin-bottom: 20px;
}
.wizard-portrait {
  max-width: 250px;
  width: 100%;
  margin: auto;
}
.wizard-profile h2 {
  font:
    400 clamp(1.6rem, 3vw, 2.2rem) / 1.2 Georgia,
    serif;
  margin: 0 0 14px;
  color: var(--gold);
}
.wizard-profile p {
  line-height: 1.6;
}
.wizard-profile .eyebrow {
  font-size: 0.7rem;
  margin-bottom: 12px;
}
.wizard-profile-copy {
  min-width: 0;
}
.wizard-ranks {
  display: flex;
  gap: 12px;
  margin: 22px 0;
  font-size: 1.5rem;
  color: #8990ad;
}
.wizard-ranks .earned {
  color: var(--gold);
}
.next-gift {
  border-left: 2px solid #d4b579;
  padding-left: 16px;
}
.next-gift small {
  color: var(--muted);
}
.wizard-explainer summary {
  min-height: 46px;
  padding: 12px 0;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
}
.wizard-explainer summary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}
.wizard-explainer p {
  font-size: 0.9rem;
  max-width: 540px;
  color: var(--muted);
}
.spell-shelf {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 26px;
}
.spell-card {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 6px 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #20263e;
}
.spell-card > span {
  grid-row: span 2;
  color: #9b9db5;
  font-size: 1.6rem;
}
.spell-card strong {
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.4;
}
.spell-card small {
  color: var(--muted);
  font-size: 0.72rem;
}
.spell-card.earned {
  border-color: #d3b77b66;
  background: #332f46;
}
.spell-card.earned > span {
  color: var(--gold);
}
.academy-map {
  margin: 26px 0 34px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: radial-gradient(ellipse at 50% 0%, #5a4d7144, transparent 70%), #20263e;
}
.academy-map-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.academy-map-head h2 {
  margin: 0;
  font:
    400 clamp(1.35rem, 2.7vw, 1.9rem)/1.2 Georgia,
    serif;
  color: var(--gold);
}
.academy-map-head p:last-child {
  max-width: 320px;
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}
.academy-room-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.academy-room {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  min-height: 118px;
  padding: 14px;
  border: 1px solid #73718a70;
  border-radius: 16px;
  color: #f5eee4;
  text-align: left;
  background: linear-gradient(145deg, #303651, #24283f);
  cursor: pointer;
  transition:
    transform 0.2s,
    border-color 0.2s,
    background 0.2s;
}
.academy-room:hover {
  transform: translateY(-2px);
  border-color: #e1c792aa;
}
.academy-room:focus-visible {
  outline: 3px solid #f1cf91;
  outline-offset: 2px;
}
.room-window {
  display: grid;
  place-items: center;
  flex: none;
  width: 58px;
  height: 78px;
  border: 4px solid #a69a93;
  border-bottom-width: 6px;
  border-radius: 30px 30px 4px 4px;
  background: #171d35;
  box-shadow: inset 0 5px 18px #101629;
  color: #9ea9c8;
  font-size: 1.75rem;
  transition:
    background 0.45s,
    box-shadow 0.45s,
    color 0.45s;
}
.room-window span {
  display: block;
}
.academy-room.warming .room-window {
  color: #e6ca9d;
  background: linear-gradient(#746074, #585273);
  box-shadow:
    inset 0 0 16px #f3c88650,
    0 0 10px #f0c38918;
}
.academy-room.lit {
  border-color: #e9cd8cbb;
  background: linear-gradient(145deg, #4b4558, #3b3652);
}
.academy-room.lit .room-window {
  color: #583d4d;
  border-color: #e2c491;
  background: radial-gradient(circle at 50% 35%, #fff4c7, #e8ba73 65%, #b87477);
  box-shadow:
    0 0 21px #f2ce82aa,
    inset 0 0 10px #fff2bb;
}
.room-detail {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 4px;
}
.room-detail strong {
  font-size: 0.94rem;
  line-height: 1.2;
}
.room-detail small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}
.room-detail em {
  color: #d8c49f;
  font-size: 0.73rem;
  font-style: normal;
}
.academy-room.lit .room-detail em {
  color: #f6db9c;
}
@media (max-width: 1000px) {
  .hero {
    gap: 14px;
  }
  .wizard-nameplate {
    padding: 10px 14px;
    min-width: 210px;
  }
  .academy-room-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .hero h1 {
    max-width: none;
    font-size: 2.6rem;
  }
  .academy-scene {
    width: min(100%, 430px);
    margin: 0 auto 24px;
  }
  .wizard-profile {
    grid-template-columns: 1fr;
    padding: 22px;
    gap: 12px;
  }
  .wizard-portrait {
    max-width: 185px;
  }
  .wizard-ranks {
    margin: 16px 0;
  }
  .spell-shelf {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .spell-card {
    padding: 12px;
    grid-template-columns: 19px 1fr;
    gap: 6px;
  }
  .academy-map {
    padding: 18px;
  }
  .academy-map-head {
    display: block;
  }
  .academy-map-head p:last-child {
    max-width: none;
    margin-top: 8px;
  }
  .academy-room-grid {
    gap: 8px;
  }
  .academy-room {
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
    min-height: 148px;
    padding: 12px;
  }
  .room-window {
    width: 43px;
    height: 54px;
    border-width: 3px;
    border-bottom-width: 4px;
    font-size: 1.35rem;
  }
  .room-detail strong {
    font-size: 0.82rem;
  }
  .room-detail small {
    font-size: 0.68rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .academy-scene *,
  .wizard-profile *,
  .academy-room * {
    animation: none;
    transition: none;
  }
}

/* Touch-friendly, short mathematics blocks. */
.math-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.math-module-grid .progress-card {
  display: block;
}
.math-work {
  max-width: 850px;
  margin: 24px auto;
}
.math-work h2 {
  font-size: 1.45rem;
  line-height: 1.5;
}
.math-work p {
  line-height: 1.7;
}
.math-work form {
  display: grid;
  gap: 18px;
  justify-items: start;
}
.math-answer-label {
  width: min(100%, 320px);
}
.math-answer-label input {
  width: 100%;
  font-size: 1.45rem;
  padding: 14px;
  min-height: 54px;
}
.math-number-words {
  font-size: 1.35rem;
  padding: 20px;
  border-left: 3px solid var(--gold);
}
.math-choice-list {
  display: grid;
  gap: 14px;
  margin: 20px 0;
}
.math-choice-list button {
  text-align: left;
  line-height: 1.6;
  padding: 17px;
  white-space: normal;
}
.math-choice-list [aria-pressed='true'] {
  outline: 2px solid var(--gold);
}
.math-numberline {
  position: relative;
  max-width: 680px;
  margin: 24px auto;
}
.math-numberline svg {
  display: block;
  width: 100%;
  height: auto;
}
.line-slider {
  position: absolute;
  left: 5.77%;
  top: 24%;
  width: 88.46%;
  height: 51%;
  opacity: 0.01;
  cursor: crosshair;
  touch-action: pan-y;
}
.line-slider:focus-visible {
  opacity: 0.6;
}
.exchange-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 12px;
  margin: 26px 0;
}
.exchange-columns > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: var(--panel2);
  padding: 16px 10px;
  border-radius: 12px;
  text-align: center;
}
.exchange-count {
  font-size: 2rem;
  color: var(--gold);
}
.exchange-columns strong {
  font-size: 0.9rem;
}
.exchange-columns button {
  font-size: 0.85rem;
  padding: 9px;
}
.exchange-columns .subtle {
  font-size: 0.8rem;
}
.math-story {
  font-size: 1.2rem;
  background: var(--panel2);
  padding: 20px;
  border-radius: 16px;
}
.bar-models {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}
.bar-model {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
  line-height: 1.5;
}
.bar-model[aria-pressed='true'],
.bar-tokens [aria-pressed='true'] {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.bar-drawing {
  display: grid;
  position: relative;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  width: 100%;
  height: 64px;
}
.bar-drawing i {
  background: #8fa7bd;
  border: 1px solid #c2d0dd;
}
.bar-drawing b {
  background: #c7a66e;
  grid-column: 1/-1;
  border: 1px solid #ebd095;
}
.bar-drawing.compare {
  grid-template-columns: repeat(3, 1fr);
  height: 64px;
}
.bar-drawing.compare i:first-child {
  grid-column: 1/-1;
}
.bar-drawing.compare i:nth-child(2) {
  grid-column: 1/3;
}
.bar-drawing.compare b {
  grid-column: 3;
}
.bar-drawing.equal {
  grid-template-columns: repeat(3, 1fr);
}
.bar-built-diagram {
  max-width: 460px;
  margin: 20px auto;
}
.bar-tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 24px 0;
}
.bar-tokens button {
  min-width: 72px;
  font-size: 1.25rem;
}
.bar-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.bar-slot {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border: 2px dashed #9cabc3;
  border-radius: 10px;
  background: #35415c;
  padding: 15px;
  line-height: 1.4;
}
.bar-slot span {
  font-size: 0.88rem;
}
.bar-slot strong {
  color: var(--gold);
  font-size: 1.45rem;
}
.math-result {
  margin-top: 24px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}
.fact-grid {
  display: grid;
  gap: 7px;
  font-size: 0.75rem;
}
.fact-grid > div {
  display: grid;
  grid-template-columns: 75px repeat(9, minmax(0, 1fr));
  gap: 4px;
  align-items: center;
}
.fact-grid span {
  padding: 8px 2px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.fact-grid .practised {
  background: #615379;
}
.fact-grid .mastered {
  background: #e0bd7a;
  color: #172435;
}
@media (max-width: 700px) {
  .math-module-grid {
    grid-template-columns: 1fr;
  }
  .math-work {
    padding: 20px 16px;
  }
  .bar-models {
    gap: 8px;
  }
  .bar-model {
    padding: 9px;
    font-size: 0.75rem;
  }
  .bar-drawing {
    height: 48px;
  }
  .bar-slots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fact-grid {
    overflow-x: auto;
  }
  .fact-grid > div {
    min-width: 580px;
  }
  .line-slider {
    min-height: 44px;
    top: 20%;
  }
}

/* A navigable castle, with a list alternative for smaller screens. */
.castle-map {
  margin: 28px 0 32px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: radial-gradient(ellipse at 50% 0, #66507838, transparent 75%), #20263e;
}
.castle-map-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.castle-map-heading h2 {
  margin: 0;
  font:
    400 clamp(1.5rem, 3vw, 2rem)/1.2 Georgia,
    serif;
  color: var(--gold);
}
.castle-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  color: var(--muted);
  font-size: 0.76rem;
  margin: 18px 0 10px;
}
.castle-map-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border-radius: 18px;
}
.castle-map-scroll[hidden],
.castle-room-list[hidden] {
  display: none;
}
.castle-plan {
  position: relative;
  width: 100%;
  min-width: 640px;
  aspect-ratio: 900/780;
}
.castle-plan-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.map-room {
  position: absolute;
  width: 24%;
  height: 15.2%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px;
  border: 2px solid #8b8499;
  border-radius: 26px 26px 8px 8px;
  background: linear-gradient(145deg, #414763, #292f49);
  box-shadow:
    0 4px 8px #12162788,
    inset 0 0 25px #10182f55;
  color: #f5eddd;
  cursor: pointer;
  transition:
    background 0.4s,
    box-shadow 0.4s,
    transform 0.2s;
}
.map-room:hover {
  transform: translateY(-2px);
  border-color: #f1cf91;
}
.map-room:focus-visible,
.map-courtyard:focus-visible {
  outline: 3px solid #fff1bc;
  outline-offset: 4px;
}
.map-room strong {
  max-width: 95%;
  font-size: clamp(0.75rem, 1.5vw, 1rem);
  line-height: 1.2;
  font-weight: 500;
}
.map-room small {
  font-size: 0.67rem;
  color: #d0cadb;
}
.map-room-symbol {
  font-size: 1.4rem;
  color: #d0c4a8;
  line-height: 1;
}
.map-room.warming {
  background: radial-gradient(ellipse at 50% 25%, #8c6e6f, #3b3655 80%);
  border-color: #b99b88;
}
.map-room.lit {
  color: #fff5d7;
  border-color: #f2d19b;
  background: radial-gradient(ellipse at 50% 22%, #be9666, #635066 70%, #4b405f);
  box-shadow:
    0 0 25px #f0bf7040,
    inset 0 0 22px #f8d28d40;
}
.map-room.lit .map-room-symbol {
  color: #ffe8ad;
  text-shadow: 0 0 15px #ffe5ad;
}
.map-room.lit small {
  color: #ffe8ad;
}
.map-room.sealed {
  border-style: dashed;
  background: repeating-linear-gradient(135deg, #30364d, #30364d 12px, #343950 12px, #343950 24px);
}
.map-room.sealed .map-room-symbol {
  color: #bbb0c1;
}
.map-room.here {
  outline: 2px solid #e4d7a8;
  outline-offset: 4px;
}
.map-here {
  position: absolute;
  bottom: -13px;
  padding: 3px 12px;
  border-radius: 12px;
  background: #e8d2a2;
  color: #2d2945;
  font-size: 0.65rem;
  white-space: nowrap;
}
.map-courtyard {
  position: absolute;
  left: 38%;
  top: 37%;
  width: 24%;
  height: 17%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  border-radius: 100%;
  background: transparent;
  color: #f2e5b9;
  font-size: 0.82rem;
  cursor: pointer;
}
.map-courtyard > span {
  font-size: 1.7rem;
}
.map-courtyard small {
  color: #d4decc;
  font-size: 0.65rem;
}
.map-traveler {
  position: absolute;
  transform: translate(-50%, -50%);
  color: #fff0ae;
  font-size: 1.6rem;
  filter: drop-shadow(0 0 6px #f4c673);
  pointer-events: none;
  transition:
    top 0.5s,
    left 0.5s;
}
.castle-map-caption {
  color: var(--muted);
  max-width: 600px;
  font-size: 0.8rem;
  line-height: 1.5;
  margin: 8px auto 0;
  text-align: center;
}
.castle-room-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.hall-interior,
.hall-door {
  max-width: 760px;
  margin: 20px auto 32px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: radial-gradient(ellipse at 50% 0, #6f5b7b44, transparent 70%), var(--panel);
}
.hall-interior.lit {
  border-color: #d5b779;
}
.hall-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 0 18px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.hall-banner > span {
  display: grid;
  place-items: center;
  width: 65px;
  height: 78px;
  flex: none;
  border: 2px solid #c4ab88;
  border-radius: 35px 35px 6px 6px;
  color: var(--gold);
  background: #2d304e;
  font-size: 2rem;
}
.hall-interior.lit .hall-banner > span {
  background: radial-gradient(#c9a26b, #655072);
  box-shadow: 0 0 25px #f0bf7050;
}
.hall-banner p {
  color: var(--muted);
  font-size: 0.9rem;
}
.hall-stage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.8rem;
}
.hall-stage > span {
  display: flex;
  gap: 5px;
}
.hall-stage i {
  display: block;
  width: 10px;
  height: 10px;
  border: 1px solid #bfb3c4;
  border-radius: 50%;
}
.hall-stage i.current {
  background: var(--gold);
  border-color: var(--gold);
}
.hall-course {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.hall-course summary {
  padding: 14px 0;
  cursor: pointer;
  color: var(--gold);
  min-height: 46px;
}
.hall-course h2 {
  font-size: 1.15rem;
}
.hall-course p {
  line-height: 1.7;
}
.hall-example {
  padding: 16px;
  border-left: 3px solid #ceaf78;
  background: #38334e;
  border-radius: 0 12px 12px 0;
  margin: 18px 0;
}
.hall-example p {
  margin-bottom: 0;
}
.hall-course small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.75rem;
}
.lesson-video {
  display: inline-flex;
  text-decoration: none;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  line-height: 1.5;
}
.hall-door {
  text-align: center;
}
.hall-door-symbol {
  font-size: 4rem;
  color: #d8bb92;
}
.hall-door button {
  display: block;
  margin: 15px auto;
}
.school-account {
  max-width: 460px;
  margin: auto;
}
.school-account > p {
  line-height: 1.6;
}
.school-account h3 {
  font:
    400 1.8rem Georgia,
    serif;
  color: var(--gold);
}
.account-emblem {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 5px 0 20px;
  border: 1px solid #c6ab7c;
  border-radius: 50%;
  color: var(--gold);
  font-size: 2rem;
  background: radial-gradient(#655071, #2c2d49);
}
.school-account form .primary {
  width: 100%;
}
.account-reminder {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #252a42;
}
.account-reminder dt {
  color: var(--muted);
}
.account-reminder dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
#school-account-status:empty {
  display: none;
}
#school-account-status {
  line-height: 1.5;
  color: var(--gold);
}
@media (max-width: 700px) {
  .castle-map {
    padding: 14px;
  }
  .castle-map-heading {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }
  .castle-map-legend {
    gap: 7px 14px;
    font-size: 0.68rem;
  }
  .map-room strong {
    font-size: 0.8rem;
  }
  .castle-map-caption {
    text-align: left;
  }
  .hall-interior,
  .hall-door {
    padding: 20px;
  }
  .hall-banner {
    gap: 14px;
  }
  .hall-banner > span {
    width: 50px;
    height: 63px;
  }
}
.no-motion .map-room,
.no-motion .map-traveler {
  transition: none;
}
@media (prefers-reduced-motion: reduce) {
  .map-room,
  .map-traveler {
    transition: none;
  }
}
.map-traveler {
  width: 42px;
}
@media (max-width: 700px) {
  .map-traveler {
    width: 34px;
  }
}
.school-home .academy-scene {
  max-width: 400px;
  margin: 0 auto 14px;
}
.school-home h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
}
.school-home .hero-actions {
  flex-wrap: wrap;
}
@media (max-width: 700px) {
  .school-home .academy-scene {
    max-width: 290px;
  }
  .school-home h1 {
    font-size: 2.2rem;
  }
}

/* Small permanent treasures, without another reward screen. */
.treasure-collection {
  margin: 1.5rem 0;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #242840;
}
.treasure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.8rem;
  max-height: 460px;
  overflow-y: auto;
}
.treasure-card {
  display: flex;
  align-items: center;
  flex-direction: column;
  text-align: center;
  padding: 0.8rem;
  border: 1px solid color-mix(in srgb, var(--treasure-color) 35%, transparent);
  border-radius: 16px;
  background: #1c2136;
}
.treasure-card svg {
  width: 72px;
  height: 80px;
}
.treasure-card strong {
  font-size: 0.92rem;
}
.treasure-card small {
  color: var(--treasure-color);
  margin-top: 0.3rem;
}
.treasure-earned {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem auto 0;
  padding: 0.7rem 1rem;
  border: 1px solid #77718d;
  border-radius: 18px;
  text-align: left;
  width: fit-content;
}
.treasure-earned svg {
  width: 48px;
  height: 54px;
  flex-shrink: 0;
}
.treasure-earned small {
  display: block;
  margin-top: 0.2rem;
  color: #d4c7e1;
}

.written-accents {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: -0.3rem 0 0.8rem;
}
.written-accents button {
  min-width: 42px;
  min-height: 44px;
  border: 1px solid var(--line);
}
.posed-operation {
  margin: 1.2rem auto;
  width: min(100%, 240px);
  font-variant-numeric: tabular-nums;
  font-family: monospace;
  font-size: 2rem;
  text-align: right;
  letter-spacing: 0.15em;
  padding: 0.7rem 1rem;
  border-radius: 16px;
  background: var(--bg);
}
.posed-operation span {
  float: left;
}
.operation-steps {
  display: grid;
  gap: 0.7rem;
}
.operation-steps input {
  max-width: 240px;
}
#written-form input {
  max-width: 100%;
}

/* ===== v9 : carte du monde, univers, flammes, histoire ===== */
.world-map {
  margin: 28px 0 32px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: radial-gradient(ellipse at 50% 50%, #3b3a6a55, transparent 70%), #171b33;
}
.world-plan {
  position: relative;
  width: 100%;
  min-width: 720px;
  aspect-ratio: 1000/900;
}
.world-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.world-art .edge {
  fill: none;
  stroke: #8b86a8;
  stroke-opacity: 0.28;
  stroke-width: 4;
  stroke-dasharray: 2 12;
  stroke-linecap: round;
}
.world-art .edge.req {
  stroke-dasharray: none;
  stroke-width: 3;
}
.world-art .edge.garden {
  stroke-dasharray: 1 9;
}
.world-art .edge.on {
  stroke: #9fd0ff;
  stroke-opacity: 0.7;
}
.world-art .edge.gold {
  stroke: var(--gold);
  stroke-opacity: 0.95;
  stroke-dasharray: none;
  stroke-width: 5;
  filter: drop-shadow(0 0 6px #f2c77999);
}
.world-art .ring {
  fill: none;
  stroke: #ffffff22;
  stroke-width: 9;
  stroke-linecap: round;
}
.world-art .ring.on {
  stroke: var(--gold);
  filter: drop-shadow(0 0 5px #f2c779);
}
.world-art .tower path {
  fill: #2a2f55;
  stroke: #d9c79c;
  stroke-width: 2;
}
.world-art .tower .tw {
  fill: #f2c77955;
  stroke: none;
}
.world-art .u-full {
  filter: drop-shadow(0 0 18px currentColor);
}
.wm-universe {
  position: absolute;
  transform: translate(-50%, 0);
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
}
.wm-universe.bottom {
  transform: translate(-50%, -100%);
}
.wm-universe strong {
  display: block;
  color: var(--uc);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}
.wm-universe small {
  color: var(--muted);
  font-size: 0.72rem;
}
.wm-spot,
.wm-hub {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 112px;
  padding: 0;
  min-height: 0;
  color: var(--ink);
  z-index: 2;
}
.wm-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  font-size: 1.55rem;
  background: #262a48;
  border: 2px solid #ffffff2a;
  transition:
    transform 0.2s,
    box-shadow 0.3s;
}
.wm-spot.game .wm-icon {
  width: 48px;
  height: 48px;
  font-size: 1.25rem;
  border-radius: 16px;
}
.wm-spot:hover .wm-icon,
.wm-spot:focus-visible .wm-icon {
  transform: scale(1.08);
}
.wm-spot.l1 .wm-icon {
  border-color: #8cc8ff;
  box-shadow: 0 0 12px #6fb8ff88;
  background: #263a5c;
}
.wm-spot.l2 .wm-icon {
  border-color: var(--gold);
  box-shadow: 0 0 20px #f2c779aa;
  background: #4d4127;
}
.wm-spot.l3 .wm-icon {
  border-color: #fff3c4;
  box-shadow:
    0 0 26px #f2c779,
    0 0 6px #fff inset;
  background: radial-gradient(circle, #8a6d2f, #4d4127);
}
.wm-spot.sealed .wm-icon {
  border-style: dashed;
  opacity: 0.7;
  font-size: 1.2rem;
}
.wm-label {
  font-size: 0.74rem;
  line-height: 1.15;
  text-align: center;
  text-shadow: 0 1px 3px #000;
}
.wm-flames {
  display: flex;
  gap: 3px;
}
.wm-flames i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ffffff1f;
}
.wm-flames i.f1 {
  background: #8cc8ff;
}
.wm-flames i.f2 {
  background: var(--gold);
}
.wm-flames i.f3 {
  background: #fff3c4;
  box-shadow: 0 0 6px #fff3c4;
}
.wm-hub {
  width: 150px;
  height: 150px;
  justify-content: flex-end;
  border-radius: 50%;
  z-index: 1;
}
.wm-hub-badge {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 9px;
  border-radius: 99px;
  background: #00000066;
  font-size: 0.74rem;
  white-space: nowrap;
}
.wm-hub.ready .wm-hub-badge {
  background: var(--gold);
  color: #2a2006;
  font-weight: 700;
  animation: wm-pulse 1.4s ease-in-out infinite;
}
@keyframes wm-pulse {
  50% {
    transform: translateX(-50%) scale(1.12);
  }
}
.wm-traveler {
  position: absolute;
  width: 44px;
  transform: translate(-50%, -105%);
  pointer-events: none;
  z-index: 3;
  transition:
    left 0.7s ease-in-out,
    top 0.7s ease-in-out;
  filter: drop-shadow(0 3px 4px #0008);
}
.wm-traveler svg {
  width: 100%;
  height: auto;
}
.wm-traveler.walking {
  animation: wm-hop 0.35s ease-in-out 2;
}
@keyframes wm-hop {
  50% {
    margin-top: -6px;
  }
}
.wm-pistache {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 16px;
  background: #ffffff0d;
  border: 1px solid var(--line);
}
.wm-pistache > span {
  font-size: 1.8rem;
}
.wm-pistache p {
  margin: 0;
  font-size: 0.92rem;
}
.wm-list-head {
  margin: 14px 0 4px;
  color: var(--gold);
  font-weight: 700;
}
.room-flames {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 14px;
  font-size: 0.9rem;
  color: var(--muted);
}
.room-flames b {
  font-size: 1.3rem;
}
.mastery-challenge {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #f2c77966;
  background: linear-gradient(135deg, #f2c7791f, #b48cff1a);
}
.mastery-challenge p {
  margin: 0 0 10px;
}
/* histoire */
.story-thread {
  display: flex;
  gap: 4px;
  margin: 8px 0 18px;
}
.story-thread i {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #ffffff1c;
}
.story-thread i.on {
  background: var(--gold);
  box-shadow: 0 0 6px #f2c779;
}
.story-thread i.ready {
  background: #fff3c4;
  animation: wm-blink 1.2s infinite;
}
@keyframes wm-blink {
  50% {
    opacity: 0.4;
  }
}
.story-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.story-card {
  display: flex;
  gap: 14px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.story-card small {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}
.story-card strong {
  display: block;
  font-size: 1.05rem;
}
.story-scene {
  font-size: 2rem;
  width: 48px;
  text-align: center;
}
.story-card.ready {
  border-color: var(--gold);
  box-shadow: 0 0 16px #f2c77966;
}
.story-card.locked,
.story-card.far {
  opacity: 0.6;
}
.chapter {
  max-width: 680px;
  margin: 0 auto;
  font-size: 1.1rem;
  line-height: 1.65;
}
.chapter-scene {
  font-size: 3.6rem;
  text-align: center;
  margin: 4px 0 8px;
}
.chapter-question {
  margin-top: 22px;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.chapter-question h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
  color: var(--gold);
}
.chapter-choices {
  display: grid;
  gap: 8px;
}
.chapter-choices .chosen {
  border-color: var(--gold);
  background: #f2c77933;
}
@media (max-width: 700px) {
  .world-map {
    padding: 14px;
  }
  .world-plan {
    min-width: 600px;
  }
  .wm-spot {
    width: 88px;
  }
  .wm-icon {
    width: 46px;
    height: 46px;
    font-size: 1.25rem;
  }
  .wm-spot.game .wm-icon {
    width: 40px;
    height: 40px;
  }
  .wm-label {
    font-size: 0.66rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .wm-traveler {
    transition: none;
  }
  .wm-hub.ready .wm-hub-badge,
  .story-thread i.ready {
    animation: none;
  }
}

/* ===== v10 : accueil simple (4 mondes → lieux → exercice) ===== */
.navbtn span {
  margin-right: 6px;
}
#nav-story.ready {
  color: var(--gold);
  box-shadow: 0 0 0 2px #f2c77966, 0 0 18px #f2c77955;
  animation: sw-pulse 2s ease-in-out infinite;
}
@keyframes sw-pulse {
  50% {
    box-shadow: 0 0 0 2px #f2c779aa, 0 0 26px #f2c77999;
  }
}
@media (max-width: 700px) {
  .navbtn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 0.7rem;
    padding: 6px 8px;
  }
  .navbtn span {
    margin: 0;
    font-size: 1.35rem;
  }
}
.sw-home,
.sw-worldpage,
.sw-welcome {
  padding: 28px 0 10px;
}
.sw-hello {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.sw-avatar {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--line);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.sw-avatar svg {
  width: 96%;
  height: 96%;
}
.sw-hello h1 {
  font: normal clamp(1.9rem, 4.5vw, 2.8rem) Georgia, serif;
  margin: 0;
}
.sw-hello p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 1.15rem;
}
.sw-story-chip {
  margin-left: auto;
  padding: 12px 18px;
  border-radius: 999px;
  background: #f2c7791f;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-weight: bold;
  animation: sw-pulse 2s ease-in-out infinite;
}
.sw-worlds {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.sw-world {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 210px;
  padding: 24px;
  border-radius: 26px;
  text-align: left;
  color: var(--ink);
  background: var(--panel);
  border: 2px solid var(--uc);
  background:
    radial-gradient(circle at 85% 20%, color-mix(in srgb, var(--uc) 45%, transparent), transparent 60%),
    linear-gradient(160deg, color-mix(in srgb, var(--uc) 28%, var(--panel)), var(--panel));
  border: 2px solid color-mix(in srgb, var(--uc) 55%, transparent);
  transition: transform 0.15s ease;
}
.sw-world:hover,
.sw-world:focus-visible {
  transform: translateY(-3px);
}
.sw-world-icon {
  font-size: 3.4rem;
  line-height: 1;
}
.sw-world strong {
  font: normal clamp(1.35rem, 2.6vw, 1.9rem) Georgia, serif;
}
.sw-world small {
  color: var(--muted);
  font-size: 0.95rem;
}
.sw-dots {
  margin-top: auto;
  display: flex;
  gap: 6px;
}
.sw-dots i,
.sw-flames i,
.sw-legend i {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff22;
  border: 1px solid #ffffff33;
}
.sw-dots i.l1,
.sw-flames i.f1,
.sw-legend i.f1 {
  background: #8cc8ff;
}
.sw-dots i.l2,
.sw-flames i.f2,
.sw-legend i.f2 {
  background: var(--gold);
}
.sw-dots i.l3,
.sw-flames i.f3,
.sw-legend i.f3 {
  background: #fff3c4;
  box-shadow: 0 0 8px #fff3c4;
}
.sw-worldhead {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.sw-worldhead h1 {
  font: normal clamp(1.7rem, 4vw, 2.5rem) Georgia, serif;
  margin: 0;
}
.sw-worldhead .sw-world-icon {
  font-size: 2.6rem;
}
.sw-places {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}
.sw-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 16px 18px;
  border-radius: 22px;
  min-height: 190px;
  text-align: center;
  color: var(--ink);
  background: var(--panel);
  border: 2px solid var(--uc);
  background: linear-gradient(170deg, color-mix(in srgb, var(--uc) 18%, var(--panel)), var(--panel));
  border: 2px solid color-mix(in srgb, var(--uc) 40%, transparent);
}
.sw-place.l2,
.sw-place.l3 {
  border-color: var(--gold);
  box-shadow: 0 0 22px #f2c77933;
}
.sw-place.sealed {
  opacity: 0.6;
  border-style: dashed;
}
.sw-place-icon {
  font-size: 2.6rem;
  line-height: 1.1;
  color: var(--uc, var(--gold));
}
.sw-place strong {
  font-size: 1.12rem;
}
.sw-place small {
  color: var(--muted);
  font-size: 0.85rem;
}
.sw-flames {
  display: flex;
  gap: 6px;
  margin-top: auto;
}
.sw-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 22px;
}
.sw-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sw-roomhead .sw-place-icon {
  color: var(--gold);
}
.sw-room {
  max-width: 640px;
}
.sw-room-go {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  margin: 10px 0 16px;
  text-align: center;
}
.sw-room-now {
  margin: 0 0 14px;
  font-size: 1.1rem;
}
.sw-room-now span {
  color: var(--muted);
}
.sw-big {
  font-size: 1.25rem;
  padding: 16px 34px;
  min-width: 240px;
}
.sw-more {
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 18px;
}
.sw-more summary {
  cursor: pointer;
  color: var(--gold);
  font-weight: bold;
}
.sw-notions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.sw-notion {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--ink);
  text-align: left;
}
.sw-notion.current {
  border-color: var(--gold);
}
.sw-welcome {
  max-width: 460px;
  margin: auto;
  text-align: center;
}
.sw-welcome-art {
  width: 130px;
  height: 130px;
  margin: 0 auto 10px;
}
.sw-welcome-art svg {
  width: 100%;
  height: 100%;
}
.sw-welcome h1 {
  font: normal clamp(2rem, 6vw, 2.8rem) Georgia, serif;
  margin: 0 0 22px;
}
.sw-welcome h1 em {
  color: var(--gold);
}
.sw-welcome-form {
  text-align: left;
  display: grid;
  gap: 6px;
}
.sw-welcome-form .sw-big {
  width: 100%;
  margin-top: 6px;
}
#welcome-status:empty {
  display: none;
}
#welcome-guest {
  margin-top: 16px;
}
@media (max-width: 600px) {
  .sw-worlds {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .sw-world {
    min-height: 0;
    display: grid;
    grid-template-columns: 3.6rem 1fr;
    grid-template-areas: 'i n' 'i s' 'i d';
    column-gap: 16px;
    row-gap: 4px;
    padding: 18px;
  }
  .sw-world .sw-world-icon {
    grid-area: i;
    font-size: 2.8rem;
    align-self: center;
  }
  .sw-world strong {
    grid-area: n;
  }
  .sw-world small {
    grid-area: s;
  }
  .sw-world .sw-dots {
    grid-area: d;
    margin-top: 4px;
  }
  .sw-places {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .sw-place {
    min-height: 160px;
    padding: 16px 10px 14px;
  }
  .sw-avatar {
    width: 56px;
    height: 56px;
  }
}

.sw-entry .topbar > nav {
  display: none;
}

.home-shortcuts {
  max-width: none;
  margin: 16px 0 4px;
}
