.auditorium-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45em;
  color: #f5f7ff;
  font: 800 clamp(22px, 2.2vw, 34px)/1 Nunito, sans-serif;
}
.auditorium-mark svg { inline-size: 1.28em; block-size: 1.28em; }

.practice-redesign .arrival-gate {
  display: block;
  padding: 0;
  background: radial-gradient(ellipse at 50% 36%, #293b70, #101b35 66%, #080f20);
  backdrop-filter: none;
  overflow: hidden auto;
}
.practice-redesign .arrival-card {
  width: min(100%, 1800px);
  min-height: 100%;
  margin: auto;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: clamp(18px, 3.5dvh, 40px) 0 max(14px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.practice-redesign .arrival-card h1 {
  margin: .2em 0 .12em;
  font: 900 clamp(44px, min(6.3vw, 10dvh), 104px)/1.12 Nunito, sans-serif;
  letter-spacing: -.035em;
  color: #f5f7ff;
}
.arrival-stage {
  position: relative;
  isolation: isolate;
  width: min(100%, 134dvh);
  aspect-ratio: 5 / 2;
  margin: clamp(8px, 1.4dvh, 18px) 0 6px;
}
.arrival-stage picture {
  position: absolute;
  inset: 0;
  display: block;
  clip-path: polygon(10% 0, 90% 0, 98% 100%, 2% 100%);
  background: #151f34;
}
.arrival-stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.arrival-stage::before, .arrival-stage::after {
  content: '';
  position: absolute;
  z-index: 1;
  inset: -4px auto -4px 0;
  width: 12%;
  background: linear-gradient(108deg, #14234000 14%, #172643 48%, #2d4265 72%, #ac8756 73%, #3a2d26 75%, #0d192e 76%);
  clip-path: polygon(0 0, 86% 0, 20% 100%, 0 100%);
  pointer-events: none;
}
.arrival-stage::after {
  inset-inline: auto 0;
  transform: scaleX(-1);
}
.arrival-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1fr);
  grid-template-areas: "skip enter silent";
  align-items: center;
  gap: clamp(8px, 1.2vw, 18px);
  width: min(86%, 1310px);
  margin-top: clamp(6px, 1.1dvh, 14px);
}
.practice-redesign .arrival-actions button {
  width: 100%;
  margin: 0;
  justify-content: center;
  min-width: 0;
  min-height: 48px;
  padding: .7em .85em;
  border: 1px solid #61789e;
  border-radius: 12px;
  text-decoration: none;
  color: #f5f7ff;
  background: #101e35;
  font: 800 clamp(14px, 1.45vw, 21px)/1.25 Nunito, sans-serif;
}
.practice-redesign .arrival-actions #enterWithSound {
  grid-area: enter;
  min-height: 61px;
  background: #414dc4;
  border-color: #8792ed;
  font-size: clamp(19px, 2.15vw, 32px);
}
.practice-redesign .arrival-actions #skipWelcome { grid-area: skip; background: #101e35; min-width: 0; }
.arrival-actions #enterSilent { grid-area: silent; }
.practice-redesign .arrival-actions button:hover { background: #253b61; }
.practice-redesign .arrival-actions #enterWithSound:hover { background: #4d5ad7; }
.arrival-sponsors {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  list-style: none;
  width: min(630px, 85%);
  padding: 11px 0 0;
  margin: 14px 0 0;
  border-top: 1px solid #577097;
}
.arrival-sponsors img { width: 80%; height: clamp(32px, 5.4dvh, 54px); object-fit: contain; }

body:has(#welcome:not(.hidden)) .topbar,
body:has(#welcome:not(.hidden)) .hint { display: none; }
.practice-redesign #welcome {
  display: block;
  padding: clamp(22px, 4.1vh, 44px) clamp(16px, 4vw, 70px) 24px;
  background: linear-gradient(#0b1426ec, #101c31dd 52%, #0d172bea),
    url('./assets/vestibulo/auditorio.webp') center / cover fixed;
  backdrop-filter: none;
}
.practice-library {
  max-width: 1480px;
  margin: auto;
  color: #f5f7ff;
}
.library-heading {
  display: flex;
  justify-content: center;
  margin: clamp(18px, 3.1dvh, 39px) 0 clamp(24px, 4.8dvh, 52px);
  padding: 0;
  border: none;
  text-align: center;
}
.practice-redesign .library-heading h1 {
  margin: 0;
  color: #f5f7ff;
  font: 900 clamp(37px, 4.65vw, 75px)/1.06 Nunito, sans-serif;
  letter-spacing: -.025em;
}
.library-heading h1:focus { outline: none; }
.library-categories {
  --category-gap: clamp(10px, 1.5vw, 23px);
  --category-columns: 4;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--category-gap);
  border: 0;
  background: none;
  padding: 0;
  overflow: visible;
}
.library-categories .library-category {
  flex: 0 0 calc((100% - (var(--category-columns) - 1) * var(--category-gap)) / var(--category-columns));
  display: grid;
  grid-template-rows: auto 1fr;
  place-items: center;
  gap: clamp(8px, 1.2vw, 18px);
  margin: 0;
  min-width: 0;
  padding: clamp(5px, .52vw, 9px);
  border: 1px solid #536f9a;
  border-radius: 15px;
  background: #162c47;
  color: #f5f7ff;
  font: 800 clamp(14px, 1.48vw, 25px)/1.15 Nunito, sans-serif;
  text-align: center;
}
.library-category img, .library-preview {
  display: block;
  width: 100%;
  border-radius: 9px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #12253c;
}
.library-category span {
  display: grid;
  place-items: center;
  min-height: 2.5em;
  padding-block: .15em;
  text-wrap: balance;
}
.library-exercises > .auditorium-mark {
  justify-content: flex-start;
  padding-bottom: 13px;
  border-bottom: 1px solid #506586;
}
.library-exercises .library-heading {
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-block: 17px 24px;
  text-align: left;
}
.practice-redesign .library-exercises h1 { font-size: clamp(34px, 4vw, 58px); }
.library-heading .library-current-category { margin: 6px 0 0; color: #c6d3e8; }
.library-back {
  width: max-content;
  padding: 10px 16px;
  border: 1px solid #536f9a;
  border-radius: 10px;
  background: #172d48;
  color: #f5f7ff;
  font: 800 16px/1.25 Nunito, sans-serif;
}
.practice-library #exerciseChoices { display: block; padding: 0; margin: 0; }
.practice-library .catalogue-group { margin: 0; }
.practice-library .catalogue-grid {
  --exercise-gap: clamp(12px, 1.65vw, 24px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--exercise-gap);
}
.practice-library .catalogue-grid .exercise-choice {
  display: grid !important;
  grid-template-columns: minmax(0, 43%) minmax(0, 1fr);
  align-items: center;
  gap: clamp(9px, 1.1vw, 20px);
  flex: 0 0 calc((100% - var(--exercise-gap)) / 2);
  min-height: 0 !important;
  padding: clamp(8px, .9vw, 14px) !important;
  border: 1px solid #536f9a !important;
  border-radius: 14px;
  background: #162c47 !important;
  text-align: center;
}
.practice-library .library-preview { aspect-ratio: 16 / 9; }
.practice-library .exercise-choice:not(:has(.library-preview)) .library-exercise-copy { grid-column: 1 / -1; }
.library-exercise-copy { display: grid; align-content: center; gap: .55em; padding: .4em; }
.practice-library .library-exercise-copy strong {
  color: #f5f7ff;
  font: 800 clamp(19px, 2vw, 29px)/1.15 Nunito, sans-serif;
  text-wrap: balance;
}
.practice-library .library-exercise-copy small { margin: 0; color: #c6d3e8; font-size: clamp(13px, 1.4vw, 17px); }
.practice-library .choice-meta, .practice-library .choice-meta b,
.practice-library .warmup-duration { color: #bccfed; }
.library-arrow { color: #b4c6ff; text-align: center; font-size: 23px; line-height: 1; }
.library-categories .library-category:hover, .library-back:hover,
.practice-library .exercise-choice:hover { background: #223d60 !important; border-color: #91ace3 !important; }
.arrival-actions button:focus-visible, .library-category:focus-visible,
.library-back:focus-visible, .practice-library .exercise-choice:focus-visible {
  outline: 3px solid #b4c5ff;
  outline-offset: 3px;
}
.library-footer { margin-top: 25px; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 20px; }
#welcome .library-footer .explore { margin: 0; padding: 8px 0; color: #cfdbf2; }
.library-footer .privacy { flex-basis: 100%; text-align: center; margin: 0; color: #bccae2; }

.practice-redesign #instructions .learning-sheet {
  background: #17273d;
  border-color: #536f9a;
  color: #f5f7ff;
  scrollbar-color: #6f88ad #111f35;
}
#instructions .learning-sheet .lesson-header, #instructions .learning-sheet .lesson-tabs,
#instructions .learning-sheet .lesson-footer {
  background: #111f35;
  border-color: #40597b;
}
#instructions .learning-sheet .lesson-kicker,
#instructions .learning-sheet .lesson-back,
#instructions .learning-sheet p,
#instructions .learning-sheet .lesson-tabs button { color: #ccd9ed; }
#instructions .learning-sheet .lesson-tabs button[aria-selected="true"] { color: #c7d1ff; }
#instructions .learning-sheet .concise-hero h2,
#instructions .learning-sheet .concise-body > section > h3 { color: #f5f7ff; }
#instructions .learning-sheet :is(.instruction-flow, .instruction-example, .visual-rules > li,
  .learning-goals > div, .lesson-example, .guide-references > section, .lesson-details) {
  background: var(--reading-bg);
  color: var(--reading-title);
  border-color: var(--reading-border);
}
#instructions .learning-sheet :is(.instruction-example, .visual-rules > li, .learning-goals > div,
  .lesson-example, .guide-references > section, .lesson-details) p { color: var(--reading-text); }
#instructions .learning-sheet :is(.visual-rules h3, .learning-goals strong, .guide-references h4,
  .lesson-details summary) { color: var(--reading-title); }
#instructions .learning-sheet :is(.instruction-example > span, .lesson-example > span, .guide-ref-meta,
  .guide-ref-meta span, .guide-references a) { color: var(--reading-accent); }
#instructions .learning-sheet .lesson-start { background: #414dc4; }
.lesson-close { display: inline-grid !important; place-items: center; flex: none; padding: 0 !important; line-height: 1; }

.practice-redesign #session {
  background: #162a45f2;
  border-color: #546d93;
  border-radius: 13px;
}
.practice-redesign #sessionLabel { font-size: clamp(10px, 1.05vw, 16px); letter-spacing: .03em; }
.practice-redesign #session .session-actions button {
  background: #243e63;
  border-radius: 8px;
  border-color: #6580a8;
  min-height: 36px;
}
.practice-redesign #session .session-actions button:hover { background: #335381; }
.practice-redesign #timer:empty { display: none; }

/* Give each visible countdown its own surface, inside the existing controls. */
.practice-redesign :is(#session #timer, .classroom-practice .classroom-hud .classroom-clock,
  .arcade-overlay .arcade-controls strong, .hen-game .hen-clock, .warmup-dialog .warmup-clock) {
  --clock-font: clamp(2.65rem, 4.1vw, 3.7rem);
  --clock-height: 54px;
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: 2ch;
  min-height: var(--clock-height);
  padding: 2px 13px 3px;
  border: 1px solid #9cb6f1;
  border-radius: 11px;
  background: linear-gradient(155deg, #f1f5ff, #cbdafa);
  box-shadow: inset 0 1px #fff, 0 3px 0 #617cbb, 0 5px 11px #091a3659;
  color: #162f62;
  font: 900 var(--clock-font)/1 Nunito, sans-serif;
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
}
.practice-redesign :is(#session #timer, .classroom-practice .classroom-hud .classroom-clock,
  .arcade-overlay .arcade-controls strong):is(:empty, [hidden]) { display: none; }
.practice-redesign .hen-game .hen-clock { --clock-font: clamp(1.65rem, 3vw, 2.4rem); }
.practice-redesign .warmup-dialog .warmup-clock { margin-block: 5px 12px; }
.practice-redesign .preparation-skip-card,
.practice-redesign .early-finish-card { padding: 10px; }
.practice-redesign .preparation-skip-card > span { margin: 2px 9px 7px; }
.practice-redesign .early-finish-card button,
.practice-redesign .preparation-skip-card button.skip-preparation {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid #7996c7;
  border-radius: 9px;
  background: #304c78;
  color: #f7f9ff;
  font: 800 clamp(.92rem, 1.4vw, 1.06rem)/1.3 Nunito, sans-serif;
  text-align: center;
}
.practice-redesign :is(.early-finish-card, .preparation-skip-card) button:hover { background: #426292; }
.practice-redesign :is(.classroom-actions button, .hypothesis-practice-actions button,
  .prototype-speaking > button, .genie-task > button, .phase-gate > button) {
  min-height: 44px;
  font-size: clamp(.94rem, 1.35vw, 1.05rem);
}
.practice-redesign .arcade-overlay .arcade-controls:has(strong:not(:empty)) ~ .arcade-prompt { top: 168px; }
@media (max-width: 760px), (max-height: 565px) {
  .practice-redesign :is(#session #timer, .classroom-practice .classroom-hud .classroom-clock,
    .arcade-overlay .arcade-controls strong, .hen-game .hen-clock, .warmup-dialog .warmup-clock) {
    --clock-font: 1.95rem;
    --clock-height: 37px;
    padding-inline: 9px;
  }
  .practice-redesign .hen-game .hen-clock { --clock-font: 1.33rem; }
  .practice-redesign .arcade-overlay .arcade-controls:has(strong:not(:empty)) ~ .arcade-prompt { top: 143px; }
  .practice-redesign #session:has(#timer:not(:empty)) { gap: 9px; padding-inline: 10px; }
}
@media (max-height: 540px) {
  .practice-redesign .arcade-overlay .arcade-controls:has(strong:not(:empty)) ~ .arcade-prompt { top: 119px; }
  .practice-redesign.arcade-keyboard-open .arcade-overlay .arcade-controls:has(strong:not(:empty)) ~ .arcade-prompt { top: 128px; }
}
@media (max-height: 540px) and (min-width: 560px) {
  .practice-redesign.dragon-mode .arcade-overlay:has(.arcade-answer:not(.hidden))
    .arcade-controls:has(strong:not(:empty)) ~ .arcade-prompt { top: auto; }
}
@media (min-width: 1101px) {
  .practice-redesign #session { left: 50%; right: auto; bottom: auto; transform: translateX(-50%); }
  .practice-redesign #session, .practice-redesign.prototype-playing #session { top: 18px; z-index: 6; }
}
@media (max-width: 800px) {
  .library-categories { --category-columns: 2; }
}
@media (max-width: 650px) {
  .arrival-stage { width: 100%; aspect-ratio: 8 / 5; }
  .arrival-stage picture { clip-path: polygon(5% 0, 95% 0, 100% 100%, 0 100%); }
  .arrival-stage::before, .arrival-stage::after { width: 6%; }
  .arrival-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "enter enter" "skip silent";
    width: min(92%, 460px);
  }
  .practice-redesign .arrival-actions #enterWithSound { min-height: 54px; }
  .library-exercises .library-heading { align-items: flex-start; flex-direction: column; }
  .practice-library .catalogue-grid .exercise-choice { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .library-category, .library-back, .practice-library .exercise-choice { transition: none; }
}
/* Exercise proposals share the navy palette and card hierarchy of the catalogue. */
dialog.modal.chooser-dialog {
  padding: clamp(12px, 4vw, 44px);
  color: #f5f7ff;
}
dialog.modal.chooser-dialog:not([open]) { display: none; }
dialog.chooser-dialog::backdrop { background: #080f20bb; backdrop-filter: blur(9px); }
.chooser-dialog article.learning-sheet {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(100%, 1000px);
  height: auto;
  max-height: calc(100dvh - clamp(24px, 8vw, 88px));
  padding: 0;
  overflow: hidden;
  color: #f5f7ff;
  background: radial-gradient(ellipse at top center, #1d3458, #111f35 65%);
  border: 1px solid #536f9a;
  border-radius: 22px;
}
.chooser-dialog .lesson-header {
  align-items: flex-start;
  padding: clamp(17px, 3vw, 32px);
  border: 0;
}
.chooser-dialog .chooser-identity .lesson-kicker { color: #c0cff3; }
.chooser-dialog .chooser-identity h2 {
  margin: .26em 0 0;
  color: #f5f7ff;
  font: 900 clamp(24px, 4vw, 44px)/1.12 Nunito, sans-serif;
  letter-spacing: -.025em;
}
.chooser-dialog .lesson-close {
  border-color: #607ca6;
  background: #132641;
  color: #f5f7ff;
}
.chooser-body {
  padding: clamp(16px, 3vw, 32px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #6f88ad #111f35;
}
.chooser-dialog .chooser-body .chooser-intro {
  max-width: 70ch;
  margin: 0 0 18px;
  color: #c6d4ea;
  font: 400 clamp(14px, 1.7vw, 17px)/1.55 Inter, sans-serif;
}
.chooser-levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.chooser-level-card {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  min-height: clamp(76px, 11vw, 132px);
  padding: 12px;
  border: 1px solid #5c7ba6;
  border-radius: 14px;
  background: linear-gradient(142deg, #27456d, #162c47);
  text-align: center;
}
.chooser-level-card strong { font: 900 clamp(19px, 3.2vw, 31px)/1.12 Nunito, sans-serif; }
.chooser-level-card small { color: #c6d4ea; font: 400 14px/1.35 Inter, sans-serif; }
.chooser-level-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 13px;
}
.chooser-level-heading h3 { margin: 0; color: #f5f7ff; font: 900 25px/1.15 Nunito, sans-serif; }
.chooser-level-heading h3:focus, .chooser-identity h2:focus { outline: none; }
.chooser-back-level {
  min-height: 40px;
  padding: 7px 11px;
  border: 1px solid #5c7ba6;
  border-radius: 8px;
  background: #172d48;
  font: 800 14px Nunito, sans-serif;
}
.chooser-proposals > div, .chooser-level-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.chooser-dialog .chooser-proposals button {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 11px 15px;
  margin: 0;
  border: 1px solid #54739c;
  border-radius: 11px;
  background: #172d48;
  color: #f5f7ff;
  text-align: left;
  font: 800 clamp(15px, 1.7vw, 19px)/1.3 Nunito, sans-serif;
}
.chooser-dialog .chooser-proposals button strong { display: block; color: inherit; font: inherit; }
.chooser-dialog .chooser-proposals button small {
  display: block;
  margin-top: 3px;
  color: #c6d4ea;
  font: 400 13px/1.4 Inter, sans-serif;
}
.chooser-dialog .chooser-proposals button[aria-pressed="true"] {
  background: #2c4678;
  border-color: #b5c7ff;
  box-shadow: inset 3px 0 #a6baff;
}
.chooser-level-options > :is(section, div) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
  padding: 12px;
  border: 1px solid #486485;
  border-radius: 12px;
  background: #142740;
}
.chooser-proposals details h3 {
  grid-column: 1 / -1;
  margin: 0;
  color: #f5f7ff;
  font: 800 17px/1.3 Nunito, sans-serif;
}
.chooser-level-options > :is(section, div) button { min-height: 44px; font-size: 14px; padding: 8px; text-align: center; }
.chooser-dialog .lesson-footer {
  padding: 12px clamp(16px, 3vw, 32px);
  background: #101e33;
  border-color: #425c82;
}
.chooser-dialog .lesson-footer .lesson-back { color: #c6d4ea; min-height: 44px; text-align: left; }
.chooser-dialog .lesson-footer .lesson-start { background: #414dc4; min-height: 44px; }
.chooser-dialog .lesson-footer .lesson-start:disabled { opacity: .62; }
.chooser-dialog :is(.chooser-level-card, .chooser-back-level, .chooser-proposals button):hover {
  background: #2b4870;
  border-color: #a2b9e3;
}
.chooser-dialog button:focus-visible { outline: 2px solid #c6d6ff; outline-offset: 2px; }
@media (max-width: 620px) {
  .chooser-proposals > div, .chooser-level-options { grid-template-columns: 1fr; }
  .chooser-levels { gap: 6px; }
  .chooser-level-card { padding: 8px 4px; }
  .chooser-level-card small { font-size: 11px; }
}
.chooser-dialog .chooser-topic {
  align-content: space-between;
  gap: 12px 8px;
  padding: 14px;
  background: #192e4b;
  border-color: #526e95;
}
.chooser-dialog .chooser-topic:nth-child(4n + 2),
.chooser-dialog .chooser-topic:nth-child(4n + 3) {
  background: #243450;
  border-color: #62769f;
}
.chooser-dialog .chooser-topic button {
  background: #14253c;
  border-color: #6c87b0;
}
.chooser-dialog .chooser-topic button + button { background: #283d65; }
.chooser-dialog .chooser-topic button:hover { background: #34537c; }
.chooser-dialog .chooser-topic button[aria-pressed="true"] {
  background: #414dc4;
  border-color: #b5c7ff;
  box-shadow: inset 0 0 0 1px #b5c7ff;
}
#instructions .lesson-close,
.practice-redesign dialog.practice-shell > .lesson-header .lesson-close {
  background: #132641;
  border-color: #607ca6;
  color: #f5f7ff;
}
#instructions .concise-hero { padding-block: clamp(16px, 2.4vw, 25px); }
#instructions .concise-body { padding-block: clamp(16px, 2.4vw, 28px); }
#instructions .visual-rules { gap: 11px !important; }
#instructions .visual-rules li { padding: 14px 17px !important; }
#instructions .visual-rules h3 { font-size: 21px !important; }
#instructions .visual-rules p { font-size: 16px !important; line-height: 1.5 !important; }
#instructions .visual-rules .rule-number {
  width: 36px;
  height: 36px;
  font-size: 20px;
  background: #d5e0fb;
  color: var(--reading-accent);
}
#instructions .instruction-flow { margin-bottom: 16px; padding: 10px 13px; }
#instructions .learning-goals { gap: 14px; margin-bottom: 20px; }
#instructions .learning-goals > div {
  min-width: 0;
  padding: clamp(15px, 2vw, 21px);
  border: 1px solid var(--reading-border);
  border-radius: 13px;
}
#instructions .learning-goals svg { position: static; width: 24px; height: 24px; color: var(--reading-accent); }
#instructions .learning-goals p { margin-block: 6px 0; }
#instructions .lesson-details {
  border: 1px solid var(--reading-border);
  border-radius: 12px;
  padding: 12px 16px;
}
#instructions .learning-sheet .lesson-tabs button:not([aria-selected="true"]):hover { color: white; }
.practice-redesign {
  --card-bg: #17273d;
  --card-deep: #111f35;
  --card-raised: #213853;
  --card-border: #536f9a;
  --card-title: #f5f7ff;
  --card-text: #ccd9ed;
  --reading-bg: #e7edff;
  --reading-border: #b8c8eb;
  --reading-title: #142e53;
  --reading-text: #233f63;
  --reading-accent: #2d4b99;
}
.practice-redesign :is(dialog.practice-shell, dialog.guided, dialog.warmup-dialog, #phaseGate, #result > article,
  .prototype-panel,
  .arcade-prompt, .arcade-answer, .early-finish-card, .preparation-skip-card,
  .court-dialogue, .message-panel:not(.message-letter), .lock-panel, .train-reading, .rebuilt-paper,
  .genie-dialogue, .genie-choice, .genie-task, .invention-drawer, .invention-bubble,
  .director-briefing) {
  color-scheme: dark;
  color: var(--card-title);
  background: var(--card-bg);
  border-color: var(--card-border);
}
.practice-redesign :is(dialog.practice-shell, dialog.guided, dialog.warmup-dialog, #phaseGate, #result > article,
  .prototype-panel, .arcade-prompt, .arcade-answer, .early-finish-card,
  .court-dialogue, .message-panel:not(.message-letter), .lock-panel, .train-reading, .rebuilt-paper,
  .genie-dialogue, .genie-choice, .genie-task, .invention-drawer, .invention-bubble,
  .director-briefing) :is(p, legend, label, summary, .lesson-kicker, .arcade-case-note, .director-briefing-kicker) {
  color: var(--card-text, #ccd9ed);
}
.practice-redesign :is(dialog.practice-shell, dialog.guided, dialog.warmup-dialog, #phaseGate,
  .prototype-panel, .arcade-prompt, .arcade-answer,
  .court-dialogue, .message-panel:not(.message-letter), .lock-panel, .train-reading, .rebuilt-paper,
  .genie-dialogue, .genie-choice, .genie-task, .invention-drawer, .invention-bubble,
  .director-briefing) :is(h2, h3, .arcade-case-question) {
  color: var(--card-title, #f5f7ff);
}
.practice-redesign :is(dialog.practice-shell, dialog.guided, dialog.warmup-dialog) > header,
.practice-redesign :is(dialog.warmup-dialog footer, .invention-drawer footer, .prototype-choice-footer) {
  background: var(--card-deep);
  border-color: var(--card-border);
}
.practice-redesign :is(dialog.practice-shell, dialog.guided, dialog.warmup-dialog) > header :is(span, button) { color: var(--card-text); }
.practice-redesign :is(dialog.guided, dialog.warmup-dialog) > header button {
  background: var(--card-deep);
  border-color: var(--card-border);
}
.practice-redesign :is(dialog.practice-shell, dialog.guided, dialog.warmup-dialog, #phaseGate,
  .prototype-panel, .arcade-answer, .invention-drawer, .rebuilt-paper, .train-reading,
  .message-panel, .court-dialogue, .lock-panel, .director-briefing, #result) .primary,
.practice-redesign .preparation-skip-card .skip-preparation {
  background: #414dc4;
  color: #fff;
}
.practice-redesign :is(.prototype-panel, .arcade-dialog) .prototype-secondary {
  background: #223c5c;
  border-color: #6c87b0;
  color: #f5f7ff;
}
.practice-redesign :is(.prototype-panel, .arcade-dialog) .prototype-secondary[aria-pressed="true"] {
  background: #414dc4;
  border-color: #b5c7ff;
}
.practice-redesign :is(.prototype-islands > li, .prototype-outcomes > li, .prototype-inspiration,
  .prototype-panel .visual-rules > li, .prototype-panel .prototype-feedback, .guided-steps section,
  .arcade-dialog-body, .genie-task .are-cards > div, .rebuilt-feedback, #result .reflection-item) {
  --card-title: var(--reading-title);
  --card-text: var(--reading-text);
  background: var(--reading-bg);
  color: var(--card-title);
  border-color: var(--reading-border);
}
.practice-redesign :is(.prototype-inspiration a, .genie-task .are-cards b) { color: var(--reading-accent); }
.practice-redesign .prototype-comparison-terms { color: #b9caff; }
.practice-redesign .arcade-answer input { background: #111f35; color: #f5f7ff; border-color: #6c87b0; }
.practice-redesign .arcade-feedback { color: #ffadb8 !important; }
.practice-redesign #phaseGate > span,
.practice-redesign .preparation-skip-card > span,
.practice-redesign .early-finish-card button { color: #ccd9ed; }
.practice-redesign .invention-bubble.side-left::after,
.practice-redesign .invention-bubble.side-right::after { background: #17273d; }
.practice-redesign .invention-bubble::after { border-top-color: var(--card-bg); }
.practice-redesign .invention-bubble :is(.invention-question-number, .invention-question-time span),
.practice-redesign .invention-drawer :is(header > span, .deck-label, .deck-action),
.practice-redesign .train-reading small { color: var(--card-text); }
.practice-redesign .invention-question-time strong { color: #b8cbff; }
.practice-redesign .invention-bubble.answer-time .invention-question-time strong { color: #a7e7d1; }
.practice-redesign .genie-choice input { background: var(--card-deep); color: var(--card-title); }
.practice-redesign :is(.genie-power-name, .genie-dialogue > strong) { color: #b9caff; }
.practice-redesign .director-briefing-poses figure { background: var(--card-raised); }
.practice-redesign .director-briefing-poses svg { stroke: #ccd9ed; }
.practice-redesign .director-briefing-poses svg .director-arm { stroke: #a6bcff; }
.practice-redesign :is(.train-repeat, .rebuilt-choice:not(.correct, .wrong)) {
  color: var(--card-title);
  background: var(--card-raised);
  border-color: var(--card-border);
}

/* Give the status text and its actions independent room in the rehearsal bar. */
.practice-redesign #session .live {min-width:0;white-space:normal;}
.practice-redesign #session .live > span:first-child {flex:none;}
.practice-redesign #session #sessionLabel {max-width:23ch;line-height:1.2;overflow-wrap:anywhere;}
.practice-redesign #session .session-actions {flex:none;align-items:center;}
.practice-redesign #session .session-actions button {white-space:nowrap;}

@media (min-width: 900px) {
 .practice-redesign {--practice-action-bottom:clamp(15px,2.3dvh,26px);}
 .practice-redesign #session .session-actions button {min-height:40px;}
 .practice-redesign :is(.preparation-skip-card,.early-finish-card) {
  top:auto;
  left:50%;
  right:auto;
  bottom:var(--practice-action-bottom);
  transform:translateX(-50%);
  width:min(510px,calc(100vw - 36px));
  padding:9px;
  border-radius:17px;
  text-align:center;
  box-shadow:0 12px 38px #06122266;
 }
 .practice-redesign .preparation-skip-card > span {
  margin:1px 8px 6px;
  font-size:11px;
 }
 .practice-redesign :is(.preparation-skip-card,.early-finish-card) button {
  padding:11px 20px;
  min-height:47px;
  font-size:clamp(16px,1.35vw,20px);
 }
 .practice-redesign .early-finish-card button {color:#f5f7ff;}
 .practice-redesign.has-animation-timeline .preparation-skip-card {bottom:82px;}
 .practice-redesign:has(.maze-panel:not(.hidden)) .early-finish-card {bottom:auto;top:185px;}
 .practice-redesign:not(.hen-briefing) #phaseGate {
  left:50%;
  right:auto;
  bottom:auto;
  top:50%;
  transform:translate(-50%,-50%);
  width:min(650px,calc(100vw - 40px));
  max-height:calc(100dvh - 115px);
  padding:clamp(20px,3.1vw,37px);
  text-align:center;
  box-shadow:0 20px 70px #07162d99;
 }
 .practice-redesign:not(.hen-briefing) #phaseGate h2 {
  font-size:clamp(29px,3vw,43px);
  margin-block:10px 12px;
 }
 .practice-redesign:not(.hen-briefing) #phaseGate p {font-size:clamp(16px,1.55vw,20px);}
 .practice-redesign:not(.hen-briefing) #phaseGate .primary {
  width:auto;
  margin-inline:auto;
  padding:12px 27px;
  min-height:49px;
  font-size:clamp(17px,1.4vw,20px);
 }
}

/* Keep the clown, the platform and the cue in the central stage area. */
.practice-redesign.emotion-stage #phaseGate {
 left:50%;
 right:auto;
 top:auto;
 bottom:clamp(13px,2dvh,24px);
 transform:translateX(-50%);
 width:min(650px,calc(100vw - 32px));
 max-height:calc(100dvh - 120px);
 padding:14px 22px;
 text-align:center;
}
.practice-redesign.emotion-stage #phaseGate h2 {font-size:clamp(22px,2.35vw,32px);margin:5px 0 6px;}
.practice-redesign.emotion-stage #phaseGate p {font-size:clamp(14px,1.34vw,18px);margin:0 0 10px;}
.practice-redesign.emotion-stage #phaseGate .primary {width:auto;min-height:44px;margin-inline:auto;padding-block:8px;}
@media (min-width:900px) {
 .practice-redesign.emotion-stage.has-animation-timeline #session {top:18px!important;}
}
@media (max-width:899px) {
 .practice-redesign.emotion-stage #session {left:50%;right:auto;top:78px;bottom:auto;transform:translateX(-50%);}
 .practice-redesign.emotion-stage.has-animation-timeline #session {top:78px!important;}
 .practice-redesign.emotion-stage.has-animation-timeline .preparation-skip-card {bottom:112px;}
}

/* Closing cards share spacing and readable, separately raised reflection items. */
.practice-redesign #result > article {
  --result-glow: transparent;
  width: min(620px, 100%);
  max-height: min(90dvh, calc(100dvh - 40px));
  padding: clamp(20px, 4vw, 37px);
  border: 1px solid var(--card-border);
  background: linear-gradient(150deg, #203552, var(--card-bg) 56%);
  box-shadow: inset 0 1px #edf4ff24, 0 0 0 4px var(--result-glow),
    0 0 34px var(--result-glow), 0 22px 68px #051221a8;
  overscroll-behavior: contain;
}
.practice-redesign.time-miss #result > article { --result-glow: #ed4355; }
.practice-redesign:is(.time-good, .time-excellent) #result > article { --result-glow: #65e29a; }
.practice-redesign #result .eyebrow {
  color: #b6c8fd;
  font-size: 11px;
}
.practice-redesign #result h2 {
  margin: 10px 0 13px;
  font: 900 clamp(27px, 4vw, 39px)/1.11 Nunito, sans-serif;
  overflow-wrap: anywhere;
}
.practice-redesign #result #summary {
  margin: 0;
  line-height: 1.6;
}
.practice-redesign #reflection:not(:empty) {
  display: grid;
  gap: 11px;
  margin-block: 18px;
}
.practice-redesign :is(#reflection > .reflection-item, #reflection > details,
  .prototype-dialog .prototype-panel .visual-rules > li, .lock-panel.lock-report > article) {
  min-width: 0;
  padding: clamp(12px, 2vw, 16px) clamp(14px, 2.3vw, 19px);
  border: 1px solid var(--reading-border);
  border-radius: 13px;
  color: var(--reading-title);
  background: linear-gradient(145deg, #f1f5ff, var(--reading-bg));
  box-shadow: inset 0 1px #fff, 0 3px 0 #627db660, 0 5px 12px #0b183749;
  overflow-wrap: anywhere;
}
.practice-redesign #reflection > .reflection-item {
  font: 750 clamp(.9rem, 1.45vw, 1.02rem)/1.45 Nunito, sans-serif;
}
.practice-redesign #reflection > details {
  color-scheme: light;
}
.practice-redesign #reflection > details summary {
  color: var(--reading-accent);
  font: 850 clamp(.9rem, 1.45vw, 1.02rem)/1.4 Nunito, sans-serif;
  cursor: pointer;
}
.practice-redesign :is(#reflection > details, .prototype-dialog .prototype-panel .visual-rules > li,
  .lock-panel.lock-report > article) p {
  color: var(--reading-text);
}
.practice-redesign #reflection > details p { margin: .65em 0 0; }
.practice-redesign #result .result-note {
  margin: 15px 0 0;
  font-size: .82rem;
  line-height: 1.6;
}
.practice-redesign #result .primary {
  min-height: 48px;
  margin-top: 19px;
  padding: 12px 20px;
  font: 850 .95rem/1.3 Nunito, sans-serif;
}
.practice-redesign #result .primary:hover { background: #5461d5; }
.practice-redesign #result .prototype-actions { gap: 9px; }
.practice-redesign .lock-panel.lock-report > article::before { content: none; }
.practice-redesign .lock-panel.lock-report > article h3 { margin-top: 0; color: var(--reading-accent); }
.practice-redesign .end-celebration {
  border-color: var(--card-border);
  background: linear-gradient(150deg, #213957, var(--card-bg));
  box-shadow: inset 0 1px #edf4ff26, 0 16px 48px #0512218c;
}
.practice-redesign #phaseGate p { white-space: pre-line; }

/* Keep the painting visible while the speaker decides when to begin. */
.practice-redesign #phaseGate.painting-preview {
  top: auto;
  right: auto;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: min(760px, calc(100vw - 32px));
  padding: 13px 20px 15px;
  border-radius: 17px;
  text-align: center;
}
.practice-redesign #phaseGate.painting-preview h2 {
  margin: 3px 0 4px;
  font-size: clamp(21px, 2.3vw, 30px);
}
.practice-redesign #phaseGate.painting-preview p {
  margin: 0;
  font-size: clamp(14px, 1.3vw, 16px);
  line-height: 1.45;
}
.practice-redesign #phaseGate.painting-preview .primary {
  margin: 10px auto 0;
  width: auto;
  min-height: 44px;
  padding: 9px 16px;
  font-size: 16px;
}
@media (min-width: 740px) {
  .practice-redesign #phaseGate.painting-preview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 20px;
    text-align: left;
  }
  .practice-redesign #phaseGate.painting-preview > :is(span, h2, p) { grid-column: 1; }
  .practice-redesign #phaseGate.painting-preview .primary {
    grid-column: 2;
    grid-row: 1 / 4;
    margin: 0;
  }
}
