/* The student shell keeps pictures close to their labels and controls easy to reach. */
body[data-role="student"] {
  --student-sky: #f8f9f5;
  --student-ink: #243d35;
  --student-muted: #66766d;
  --student-edge: #d2dcd3;
  --student-nav-height: 76px;
  --student-gap: 18px;
  background: var(--student-sky);
  color: var(--student-ink);
}

body[data-role="student"] .student-header {
  height: auto;
  min-height: 68px;
  padding: 9px max(20px, calc((100vw - 1040px) / 2));
  gap: 8px;
  background: #fff;
  border-bottom: 1px solid var(--student-edge);
}
body[data-role="student"] .student-header .brand {
  display: flex;
  flex: 0 0 auto;
  min-width: 48px;
  min-height: 48px;
  align-items: center;
}
body[data-role="student"] .student-header .brand img { width: 56px; height: 32px; }
body[data-role="student"] .student-header .student-identity {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  min-height: 48px;
  padding: 4px 8px;
  margin: 0;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
  justify-content: flex-start;
}
body[data-role="student"] .student-header .student-avatar {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 1px solid #243d3526;
  border-radius: 11px;
  background: #f9edb3;
  box-shadow: none;
  color: var(--student-ink);
  font-size: calc(18px * var(--reading-scale, 1));
  font-weight: 700;
}
body[data-role="student"] .student-identity b {
  max-width: 100%;
  color: var(--student-ink);
  font-size: calc(15px * var(--reading-scale, 1));
  font-weight: 700;
  line-height: 1.4;
}
body[data-role="student"] .student-identity small { color: var(--student-muted); font-size: 12px; }
body[data-role="student"] .student-header :is(.student-help-button, #feedback-settings, #fullscreen) {
  flex: 0 0 48px;
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding: 11px;
  border: 1px solid var(--student-edge);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 3px #243d3505;
  color: var(--student-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
body[data-role="student"] .student-header .student-help-button {
  background: #f4dce7;
  border-color: #ddc5d0;
  font-family: var(--classroom-display-font, "Ddanjit Jua", sans-serif);
  font-size: 26px;
  font-weight: 400;
}
body[data-role="student"] .student-header .ghost > svg { width: 22px; height: 22px; }
body[data-role="student"] .student-header .connection-pill { background: #eef5e5; color: #42553c; }
body[data-role="student"] .student-header .connection-pill.offline { background: #f9edb3; color: #654b24; }

/* Four main choices remain a compact two-by-two page, rather than stretching each picture. */
body[data-role="student"][data-student-view="menu"] .student-shell {
  grid-template-rows: auto minmax(0, 1fr) auto;
}
body[data-role="student"][data-student-view="menu"] .student-workspace { overflow-y: auto; overscroll-behavior-y: contain; }
body[data-role="student"][data-student-view="menu"] .student-main {
  height: auto;
  min-height: 100%;
  padding: 28px 24px 24px;
}
body[data-role="student"][data-student-view="menu"] .student-main #content { height: auto; }
body[data-role="student"] .workflow-home {
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  width: min(100%, 800px);
  height: auto;
  min-height: 0;
  margin: 0 auto;
  gap: 24px;
}
body[data-role="student"] :is(.workflow-home, .student-tool-menu) .student-block-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: none;
  grid-auto-rows: auto;
  height: auto;
  gap: 20px;
  padding-bottom: 6px;
}
body[data-role="student"] :is(.workflow-home, .student-tool-menu) .student-play-block {
  height: auto;
  min-height: 260px;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 18px 16px 16px;
  border: 1px solid #243d3530;
  border-radius: 25px;
  box-shadow: 0 6px 0 var(--block-base), 0 10px 16px #243d3509;
}
body[data-role="student"] :is(.workflow-home, .student-tool-menu) .block-picture {
  height: clamp(160px, 24vw, 210px);
  min-height: 160px;
  width: 100%;
}
body[data-role="student"] :is(.workflow-home, .student-tool-menu) .block-picture img {
  max-width: 260px;
  max-height: 210px;
  margin: auto;
  object-fit: contain;
}
body[data-role="student"] :is(.workflow-home, .student-tool-menu) .block-label {
  padding: 0;
  color: var(--student-ink);
  font-family: var(--classroom-display-font, "Ddanjit Jua", sans-serif);
  font-size: calc(28px * var(--reading-scale, 1));
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: 0;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
  text-shadow: none;
}
body[data-role="student"] .block--boardgames { --block-color: #daedf6; --block-base: #b9d2dd; }
body[data-role="student"] .block--tabletop { --block-color: #f4dce7; --block-base: #d8bdca; }
body[data-role="student"] .block--maker { --block-color: #f9edb3; --block-base: #dfd39c; }
body[data-role="student"] .workflow-home .block--maker { background: var(--block-color) !important; }
body[data-role="student"] :is(.workflow-home, .student-tool-menu) .student-play-block:is(:active, .is-pressed) {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--block-base), 0 4px 8px #243d3508;
}
body[data-role="student"] .student-more-play {
  display: inline-flex;
  justify-self: center;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  max-width: 100%;
  width: auto;
  padding: 10px 22px;
  border: 1px solid #cbd6cc;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 3px 0 #dce3d8;
  color: var(--student-ink);
  font-family: var(--classroom-display-font, "Ddanjit Jua", sans-serif);
  font-size: calc(18px * var(--reading-scale, 1));
  font-weight: 400;
  line-height: 1.35;
  touch-action: manipulation;
}
body[data-role="student"] .student-more-play > svg { width: 20px; height: 20px; flex: none; }
body[data-role="student"] .student-more-play:active { transform: translateY(2px); box-shadow: 0 1px 0 #dce3d8; }
body[data-role="student"] .student-tool-menu { width: min(100%, 800px); height: auto; margin: 0 auto; }
body[data-role="student"] .student-main .page-head { flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
body[data-role="student"] .student-main .page-head h1 {
  font-family: var(--classroom-display-font, "Ddanjit Jua", sans-serif);
  color: var(--student-ink);
  font-size: calc(28px * var(--reading-scale, 1));
  font-weight: 400;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

/* A quiet strip keeps the three familiar destinations visible. */
body[data-role="student"] .student-bottom-nav {
  bottom: 0;
  height: calc(var(--student-nav-height) + env(safe-area-inset-bottom));
  padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
  gap: 10px;
  border-top: 1px solid var(--student-edge);
  background: #fff;
}
body[data-role="student"] .student-nav-item {
  flex: 1 1 0;
  max-width: 240px;
  min-height: 48px;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
  color: var(--student-muted);
  font-family: var(--classroom-display-font, "Ddanjit Jua", sans-serif);
  font-size: calc(20px * var(--reading-scale, 1));
  font-weight: 400;
  line-height: 1.3;
}
body[data-role="student"] .student-nav-art { display: block; width: 30px; height: 30px; flex: 0 0 30px; }
body[data-role="student"] .student-nav-item > span { line-height: 1.3; }
body[data-role="student"] .student-nav-item.active {
  background: #d2eb67;
  border-color: #bdce76;
  color: var(--student-ink);
  box-shadow: none;
}
body[data-role="student"] .student-nav-item[data-nav="class"].active { background: #daedf6; border-color: #bdd4de; color: var(--student-ink); }
body[data-role="student"] .student-nav-item[data-nav="messages"].active { background: #f9edb3; border-color: #dfd39c; color: var(--student-ink); }
body[data-role="student"] .student-nav-item:active:not(:disabled) { transform: none; box-shadow: none; }
body[data-role="student"] .student-nav-item.is-locked { color: var(--student-muted); opacity: .75; }

/* Other game choices use the same soft paper colours and clear names. */
body[data-role="student"] .boardgame-category { max-width: 800px; gap: 20px; padding-bottom: 8px; }
body[data-role="student"] .boardgame-choice {
  --game-base: #dfd39c;
  min-width: 0;
  min-height: 220px;
  gap: 8px;
  padding: 16px;
  border: 1px solid #243d3530;
  border-radius: 24px;
  background: #f9edb3;
  box-shadow: 0 6px 0 var(--game-base), 0 10px 16px #243d3509;
  color: var(--student-ink);
  touch-action: manipulation;
}
body[data-role="student"] .boardgame-choice:nth-child(2) { --game-base: #d8bdca; background: #f4dce7; }
body[data-role="student"] .boardgame-choice:nth-child(3) { --game-base: #b9d2dd; background: #daedf6; }
body[data-role="student"] .boardgame-choice:nth-child(4) { --game-base: #b4cc5b; background: #d2eb67; }
body[data-role="student"] .boardgame-choice img { height: 160px; mix-blend-mode: normal; }
body[data-role="student"] .boardgame-choice strong {
  font-family: var(--classroom-display-font, "Ddanjit Jua", sans-serif);
  font-size: calc(24px * var(--reading-scale, 1));
  font-weight: 400;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
body[data-role="student"] .boardgame-choice span { color: var(--student-ink); font-size: calc(14px * var(--reading-scale, 1)); line-height: 1.5; }
body[data-role="student"] .boardgame-choice:is(:active, .is-pressed) { transform: translateY(4px); border-bottom-width: 1px; box-shadow: 0 2px 0 var(--game-base), 0 4px 8px #243d3508; }
body[data-role="student"] .native-library-group { border: 1px solid var(--student-edge); border-radius: 20px; margin-top: 24px; background: #fff; }
body[data-role="student"] .native-library-group > summary {
  min-height: 56px;
  padding: 15px 18px;
  background: #f0f3e9;
  color: var(--student-ink);
  font-family: var(--classroom-display-font, "Ddanjit Jua", sans-serif);
  font-size: calc(20px * var(--reading-scale, 1));
  font-weight: 400;
  line-height: 1.4;
  cursor: pointer;
}
body[data-role="student"] .native-library-group .boardgame-category { padding: 16px; }

@media (hover: hover) and (pointer: fine) {
  body[data-role="student"] :is(.workflow-home, .student-tool-menu) .student-play-block:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 7px 0 var(--block-base), 0 12px 18px #243d350c; }
  body[data-role="student"] :is(.workflow-home, .student-tool-menu) .student-play-block:hover:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--block-base), 0 4px 8px #243d3508; }
}

@media (max-width: 600px) {
  body[data-role="student"] { --student-nav-height: 72px; --student-gap: 16px; }
  body[data-role="student"] .student-header { min-height: 66px; padding: 8px 12px; gap: 6px !important; }
  body[data-role="student"] .student-header .brand img { width: 43px; height: 28px; }
  body[data-role="student"] .student-header .student-identity { padding: 3px 2px; gap: 6px; }
  body[data-role="student"] .student-header .student-avatar { flex-basis: 30px; width: 30px; height: 30px; font-size: calc(16px * var(--reading-scale, 1)); }
  body[data-role="student"] .student-identity b { font-size: calc(14px * var(--reading-scale, 1)); }
  body[data-role="student"] .student-header .connection-pill { display: none; }
  body[data-role="student"][data-student-view="menu"] .student-main { padding: 22px 16px 20px; }
  body[data-role="student"] .workflow-home { gap: 22px; }
  body[data-role="student"] :is(.workflow-home, .student-tool-menu) .student-block-grid { gap: 18px 16px; }
  body[data-role="student"] :is(.workflow-home, .student-tool-menu) .student-play-block { min-height: 228px; padding: 12px 9px 14px; gap: 8px; border-radius: 22px; }
  body[data-role="student"] :is(.workflow-home, .student-tool-menu) .block-picture { height: 160px; min-height: 160px; }
  body[data-role="student"] :is(.workflow-home, .student-tool-menu) .block-picture img { max-width: 190px; max-height: 170px; }
  body[data-role="student"] :is(.workflow-home, .student-tool-menu) .block-label { font-size: calc(26px * var(--reading-scale, 1)); }
  body[data-role="student"] .student-more-play { font-size: calc(18px * var(--reading-scale, 1)); padding: 10px 20px; }
  body[data-role="student"] .student-bottom-nav { padding: 9px 12px calc(9px + env(safe-area-inset-bottom)); gap: 7px; }
  body[data-role="student"] .student-nav-item { padding: 7px 6px; gap: 5px; font-size: calc(19px * var(--reading-scale, 1)); }
  body[data-role="student"] .student-nav-art { width: 27px; height: 27px; flex-basis: 27px; }
  body[data-role="student"] .boardgame-category { gap: 18px 14px; }
  body[data-role="student"] .boardgame-choice { min-height: 204px; padding: 12px 9px; border-radius: 21px; }
  body[data-role="student"] .boardgame-choice img { height: 130px; }
  body[data-role="student"] .boardgame-choice strong { font-size: calc(22px * var(--reading-scale, 1)); }
  body[data-role="student"] .native-library-group .boardgame-category { padding: 12px; }
}

@media (max-width: 360px) {
  body[data-role="student"] .student-header { padding-inline: 8px; gap: 4px !important; }
  body[data-role="student"] .student-header .brand { min-width: 42px; }
  body[data-role="student"] .student-header .brand img { width: 38px; }
  body[data-role="student"] .student-header .student-avatar { display: none; }
  body[data-role="student"] :is(.workflow-home, .student-tool-menu) .student-play-block { padding-inline: 7px; }
}

/* A short screen or larger letters can scroll; no choices are hidden to make them fit. */
@media (max-height: 720px) {
  body[data-role="student"][data-student-view="menu"] { overflow-y: auto; }
  body[data-role="student"][data-student-view="menu"] .student-shell { height: auto; min-height: 100dvh; }
  body[data-role="student"][data-student-view="menu"] .student-workspace,
  body[data-role="student"][data-student-view="menu"] .student-main { height: auto; min-height: 0; }
}
@media (orientation: landscape) and (max-height: 720px) {
  body[data-role="student"] .workflow-home .student-block-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body[data-role="student"] .workflow-home .student-play-block { min-height: 200px; padding: 12px 8px; gap: 8px; }
  body[data-role="student"] .workflow-home .block-picture { height: 130px; min-height: 130px; }
  body[data-role="student"] .workflow-home .block-picture img { max-height: 130px; }
  body[data-role="student"] .workflow-home .block-label { font-size: calc(24px * var(--reading-scale, 1)); }
  body[data-role="student"][data-student-view="menu"] .student-main { padding: 16px 18px 22px; }
  body[data-role="student"] .workflow-home { gap: 20px; }
}
html:not([data-text-size="100"]) body[data-role="student"][data-student-view="menu"] { overflow-y: auto; }
html:not([data-text-size="100"]) body[data-role="student"][data-student-view="menu"] .student-shell { height: auto; min-height: 100dvh; }
html:not([data-text-size="100"]) body[data-role="student"][data-student-view="menu"] :is(.student-workspace, .student-main, #content) { height: auto; min-height: 0; }
html:not([data-text-size="100"]) body[data-role="student"] .student-header { flex-wrap: wrap; }
html:not([data-text-size="100"]) body[data-role="student"] .student-header .student-identity { min-width: 90px; }
html:not([data-text-size="100"]) body[data-role="student"] :is(.workflow-home, .student-tool-menu) .student-play-block { min-height: 228px !important; height: auto; }
html:not([data-text-size="100"]) body[data-role="student"] :is(.workflow-home, .student-tool-menu) .block-label { font-size: calc(28px * var(--reading-scale, 1)) !important; }
html:not([data-text-size="100"]) body[data-role="student"] .student-more-play { font-size: calc(18px * var(--reading-scale, 1)) !important; }
html:not([data-text-size="100"]) body[data-role="student"] .student-nav-item { font-size: calc(20px * var(--reading-scale, 1)) !important; }
html:not([data-text-size="100"]) body[data-role="student"] .student-bottom-nav { height: auto; min-height: calc(76px + env(safe-area-inset-bottom)); }
html:not([data-text-size="100"]) body[data-role="student"] .student-shell { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
html:not([data-text-size="100"]) body[data-role="student"][data-student-view="menu"] .student-shell { padding-bottom: 0; }
html:not([data-text-size="100"]) body[data-role="student"] .boardgame-choice strong { font-size: calc(24px * var(--reading-scale, 1)) !important; }
html:not([data-text-size="100"]) body[data-role="student"] .boardgame-choice span { font-size: calc(14px * var(--reading-scale, 1)) !important; }
@media (max-width: 600px) {
  html:not([data-text-size="100"]) body[data-role="student"] :is(.workflow-home, .student-tool-menu) .block-label { font-size: calc(26px * var(--reading-scale, 1)) !important; }
  html:not([data-text-size="100"]) body[data-role="student"] .student-nav-item { font-size: calc(19px * var(--reading-scale, 1)) !important; }
}

/* Keep the user's colour and motion choices stronger than the decorative palette. */
html:not([data-color-mode="standard"]) body[data-role="student"] { --student-ink: var(--ink, #243d35); }
html:not([data-color-mode="standard"]) body[data-role="student"] :is(.student-nav-item.active, .boardgame-choice) { border: 3px solid #183343; }
html:not([data-color-mode="standard"]) body[data-role="student"] .boardgame-choice:nth-child(2n) { border-style: dashed; }
html:not([data-color-mode="standard"]) body[data-role="student"] .boardgame-choice:nth-child(3n) { border-style: double; border-width: 5px; }
html[data-color-mode="contrast"] body[data-role="student"] :is(.workflow-home, .student-tool-menu) .student-play-block { --block-base: #111; color: #111 !important; }
html[data-color-mode="contrast"] body[data-role="student"] :is(.workflow-home, .student-tool-menu) .block-label { color: #111 !important; }
html[data-color-mode="contrast"] body[data-role="student"] .workflow-home .block--maker { background: #fff !important; }
html[data-color-mode="contrast"] body[data-role="student"] :is(.student-more-play, .boardgame-choice, .native-library-group, .native-library-group > summary) { background: #fff !important; color: #111 !important; border: 3px solid #111 !important; }
html[data-color-mode="contrast"] body[data-role="student"] .boardgame-choice { --game-base: #111; }
html[data-color-mode="contrast"] body[data-role="student"] .boardgame-choice span { color: #111 !important; }
html[data-color-mode="contrast"] body[data-role="student"] .student-nav-item.active { background: #111 !important; color: #fff !important; border-color: #111 !important; }
html[data-color-mode="contrast"] body[data-role="student"] .student-nav-item:not(.active) { color: #111 !important; }
html[data-color-mode="contrast"] body[data-role="student"] .student-header :is(.student-help-button, #feedback-settings, #fullscreen, .student-avatar) { background: #fff !important; color: #111 !important; border: 3px solid #111 !important; }
html[data-color-mode="contrast"] body[data-entry-role="student"] .entry-shell :is(.join-card, .join-form .input, .join-tabs button.active) { background: #fff !important; color: #111 !important; border: 3px solid #111 !important; }
html[data-color-mode="contrast"] body[data-entry-role="student"] .entry-shell .join-form :is(h2, label) { color: #111 !important; }
html[data-reduced-motion="true"] body[data-entry-role="student"] .entry-shell .join-form .primary:active { transform: none !important; }
html[data-reduced-motion="true"] body[data-role="student"] :is(.student-play-block, .block-picture img, .student-more-play, .student-nav-item, .boardgame-choice),
html[data-reduced-motion="true"] body[data-role="student"] :is(.student-play-block, .student-more-play, .boardgame-choice):is(:hover, :active, .is-pressed) { transition: none !important; transform: none !important; }
@media (prefers-reduced-motion: reduce) {
  body[data-entry-role="student"] .entry-shell .join-form .primary:active { transform: none !important; }
  body[data-role="student"] :is(.student-play-block, .block-picture img, .student-more-play, .student-nav-item, .boardgame-choice),
  body[data-role="student"] :is(.student-play-block, .student-more-play, .boardgame-choice):is(:hover, :active, .is-pressed) { transition: none !important; transform: none !important; }
}

/* Activity controls stay recognisable after leaving the picture menu. */
body[data-role="student"] .student-main :is(.primary, .secondary) {
  font-family: var(--classroom-display-font, "Ddanjit Jua", sans-serif);
  font-weight: 400;
  line-height: 1.35;
}
body[data-role="student"] .student-main .science-topic-card {
  border: 1px solid #d2dcd3;
  background: #daedf6;
  color: #243d35;
  box-shadow: 0 3px 0 #bdd4de;
}
body[data-role="student"] .student-main .science-topic-card:is(.active, .is-active, [aria-pressed="true"]) {
  border-color: #b4cc5b;
  background: #d2eb67;
  box-shadow: 0 3px 0 #b4cc5b;
}
body[data-role="student"] .wait-block-action { border: 1px solid #b4cc5b; background: #fffdf7; color: #243d35; }
body[data-role="student"] .exploration-lab {
  --lab-ink: #243d35;
  --lab-accent: #6c8250;
  --lab-tint: #eef4e6;
}
body[data-role="student"] .exploration-card { border: 1px solid #d2dcd3; background: #fffdf7; box-shadow: 0 4px 0 #e2e8db; }
body[data-role="student"] .exploration-lab .exploration-main { border-color: #b4cc5b; background: #d2eb67; color: #243d35; }
body[data-role="student"] .exploration-lab .exploration-result { border: 1px solid #c8d6bf; background: #eef4e6; }
body[data-role="student"] .exploration-lab .exploration-note { background: #f9edb3; }
body[data-role="student"] .depth-empty { border: 1px dashed #becbb7; background: #f8f9f5; }
body[data-role="student"] .depth-empty-art { display: block; width: 140px; height: 140px; margin: 0 auto 12px; object-fit: contain; }
body[data-role="student"] .exploration-lab .exploration-field :is(select, input[type="file"]) { border: 1px solid #bdc9ba; background: #fff; }
body[data-role="student"] .exploration-lab details { border-color: #d2dcd3; }
html[data-color-mode="contrast"] body[data-role="student"] :is(.science-topic-card, .wait-block-action, .exploration-card, .exploration-result, .exploration-note, .depth-empty) { border-color: #111; background: #fff; color: #111; box-shadow: none; }
html[data-color-mode="contrast"] body[data-role="student"] .exploration-lab { --lab-ink: #111; --lab-accent: #111; --lab-tint: #fff; }
html[data-color-mode="contrast"] body[data-role="student"] .student-main .science-topic-card:is(.active, .is-active, [aria-pressed="true"]) { border: 3px solid #111; background: #fff; box-shadow: none; }

/* The welcome and finish illustrations keep the rabbits' original proportions. */
body[data-role="entry"][data-entry-role="student"] .entry-shell .student-entry-art {
  display: block;
  width: min(240px, 70vw);
  height: auto;
  max-height: none;
  margin: 0 auto 18px;
  object-fit: contain;
}
body[data-role="student"] .ended .student-finish-art {
  display: block;
  width: min(320px, 100%);
  height: auto;
  max-height: none;
  margin: 0 auto 24px;
  object-fit: contain;
}
body[data-role="entry"][data-entry-role="student"] .entry-shell .topbar .brand > span { white-space: nowrap; }
body[data-role="entry"][data-entry-role="student"] .entry-shell .topbar .brand .brand-name { display: none; }
