:root {
  --sky: #66c8f1;
  --ice: #e6f8ff;
  --mint: #e6fff5;
  --paper: #fffdf8;
  --ink: #25324a;
  --muted: #627085;
  --line: #d8e4ee;
  --blue: #17aee8;
  --yellow: #ffd42c;
  --orange: #f59a16;
  --red: #ef604d;
  --green: #31a86f;
  --violet: #7669d9;
  --shadow: 0 18px 44px rgba(37, 50, 74, 0.16);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  background: #f2f8f7;
  color: var(--ink);
}

.text-underline {
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
  text-decoration-color: #e08b22;
  font-weight: 950;
}

.app {
  --mode-bg-start: #dff5ff;
  --mode-bg-end: #f4fbf8;
  --mode-hero-tint: rgba(102, 200, 241, 0.03);
}

.app[data-mode="teacher"] {
  --mode-bg-start: #fff0cf;
  --mode-bg-end: #fffaf0;
  --mode-hero-tint: rgba(245, 154, 22, 0.2);
}

.app[data-mode="student"] {
  --mode-bg-start: #dff8ff;
  --mode-bg-end: #f0fff8;
  --mode-hero-tint: rgba(23, 174, 232, 0.16);
}

.app[data-mode="screen"] {
  --mode-bg-start: #ecebff;
  --mode-bg-end: #f7fbff;
  --mode-hero-tint: rgba(118, 105, 217, 0.18);
}

button {
  font: inherit;
}

img {
  max-width: 100%;
}

.is-hidden {
  display: none !important;
}

.hero-screen {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;
  padding: max(22px, env(safe-area-inset-top)) clamp(16px, 5vw, 72px) 34px;
  isolation: isolate;
}

.hero-bg,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 45%;
  z-index: -2;
}

.hero-overlay {
  background: transparent;
  z-index: -1;
}

.home-grid {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 520px) minmax(320px, 560px);
  align-items: end;
  gap: clamp(20px, 5vw, 70px);
}

.brand-block {
  padding-bottom: clamp(16px, 6vh, 90px);
}

.brand-block img {
  width: min(520px, 88vw);
  filter: drop-shadow(0 8px 0 rgba(38, 151, 207, 0.28));
}

.brand-title {
  max-width: 600px;
  color: #fffdf8;
  font-size: clamp(42px, 7vw, 76px);
  font-weight: 950;
  line-height: 1.06;
  text-shadow:
    0 5px 0 rgba(34, 83, 112, 0.3),
    0 14px 28px rgba(37, 50, 74, 0.22);
}

.brand-block p {
  width: fit-content;
  margin: 16px 0 0;
  padding: 10px 16px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.9);
  color: #225370;
  font-size: clamp(17px, 2vw, 23px);
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(37, 50, 74, 0.12);
}

.setup-panel,
.content-card,
.teacher-guide,
.progress-panel > *,
.topbar {
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: var(--shadow);
}

.setup-panel {
  position: relative;
  padding: clamp(18px, 3vw, 30px);
}

.eyebrow {
  display: inline-block;
  color: #16728b;
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 7px 0 0;
  font-size: clamp(27px, 4vw, 42px);
  line-height: 1.12;
}

h2 {
  margin: 6px 0 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.16;
}

h3 {
  margin: 8px 0;
  font-size: 20px;
  line-height: 1.2;
}

p {
  line-height: 1.7;
}

.intro-copy {
  color: #4d5b70;
  font-size: 17px;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.role-card,
.phase-button,
.plain-button,
.choice-button,
.small-action,
.record-actions button,
.primary-action {
  min-height: 46px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease, background 150ms ease;
}

.role-card {
  padding: 16px;
  border: 2px solid var(--line);
  background: #ffffff;
  text-align: left;
}

.role-card-img,
.role-portrait-img {
  width: 100%;
  margin-bottom: 12px;
  border-radius: 8px;
  background: #fffdf8;
  object-fit: contain;
}

.role-card-img {
  aspect-ratio: 1 / 1;
  max-height: 150px;
}

.role-portrait-img {
  max-height: 180px;
}

.link-card {
  color: inherit;
  text-decoration: none;
}

.role-card strong,
.role-card span,
.role-card em {
  display: block;
}

.role-card strong {
  font-size: 19px;
}

.role-card span {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.role-card em {
  margin-top: 12px;
  color: #247a52;
  font-style: normal;
  font-weight: 900;
}

.role-card.is-selected {
  border-color: var(--green);
  background: #ebfff4;
}

.role-card.is-locked:not(.is-selected) {
  opacity: 0.58;
  background: #f5f7fb;
}

.role-card.is-locked:not(.is-selected) em {
  color: #7b8798;
}

.role-lock-card {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  padding: 16px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.role-lock-card strong {
  font-size: 20px;
}

.role-lock-card span {
  color: var(--muted);
  line-height: 1.55;
}

.role-lock-card .link-button {
  justify-content: center;
}

.role-card:hover,
.phase-button:hover,
.choice-button:hover,
.teacher-focus-selector button:hover,
.record-actions button:hover,
.small-action:hover {
  border-color: var(--blue);
}

.role-card:disabled:hover {
  border-color: var(--line);
}

button:active {
  transform: translateY(2px);
}

button:focus-visible {
  outline: 4px solid rgba(239, 96, 77, 0.32);
  outline-offset: 3px;
}

.offline-note {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
  padding: 12px;
  border-radius: 8px;
  background: #eaf8ef;
  color: #24794f;
  font-size: 14px;
}

.session-box {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.join-form {
  display: grid;
  gap: 10px;
}

.join-form label {
  color: #314158;
  font-weight: 900;
}

.join-form div {
  display: flex;
  gap: 10px;
}

.join-form input,
.join-form select {
  width: min(210px, 100%);
  min-height: 46px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0;
  padding: 0 12px;
}

.join-form select {
  width: 100%;
  font-size: 16px;
  font-weight: 800;
}

.session-code {
  margin: 6px 0 14px;
  color: #205271;
  font-size: 34px;
  font-weight: 950;
  line-height: 1;
}

.session-code.large {
  font-size: clamp(46px, 10vw, 76px);
}

.wide-action {
  width: fit-content;
  min-width: 180px;
}

.entry-divider {
  height: 1px;
  margin: 2px 0;
  background: var(--line);
}

.teacher-passcode {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fcff;
}

.passcode-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.passcode-head label {
  color: #314158;
  font-weight: 950;
}

.passcode-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.animal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.animal-button {
  position: relative;
  min-height: 70px;
  display: grid;
  place-items: center;
  gap: 3px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #314158;
  cursor: pointer;
  font-weight: 900;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.animal-button:hover {
  border-color: var(--blue);
}

.animal-button.is-selected {
  border-color: var(--orange);
  background: #fff8df;
}

.animal-button .animal-icon {
  font-size: 24px;
  line-height: 1;
}

.animal-button strong {
  font-size: 13px;
}

.animal-button em {
  position: absolute;
  top: 5px;
  right: 6px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--orange);
  color: #ffffff;
  font-size: 13px;
  font-style: normal;
  line-height: 1;
}

.debug-clear {
  display: none;
  margin-top: 12px;
}

.admin-entry {
  width: fit-content;
  min-height: 38px;
  margin-top: 12px;
  font-size: 14px;
}

.home-return {
  position: absolute;
  top: 16px;
  right: 16px;
  width: fit-content;
  min-height: 42px;
  margin-top: 0;
}

.sync-message {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #ffd39b;
  border-radius: 8px;
  background: #fff8eb;
  color: #8a5300;
  font-weight: 900;
}

.discussion-box + .sync-message {
  margin-top: 14px;
}

.choice-list + .sync-message,
.record-actions + .sync-message {
  margin-top: 14px;
}

.inline-message {
  margin: 0;
}

.screen-ended-message {
  margin-bottom: 0;
  padding-block: 10px;
  line-height: 1.35;
}

.passcode-error {
  margin: 0 0 14px;
}

.session-dialog {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(37, 50, 74, 0.42);
}

.session-dialog-card {
  position: relative;
  width: min(420px, 100%);
  padding: clamp(22px, 5vw, 34px);
  border: 2px solid rgba(255, 255, 255, 0.94);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  text-align: center;
}

.passcode-dialog-card {
  width: min(620px, 100%);
  text-align: left;
}

.session-dialog-card p {
  margin: 14px 0 20px;
  color: #4d5b70;
}

.session-dialog-card .wide-action {
  width: 100%;
}

.student-choice-dialog-card {
  width: min(520px, 100%);
  text-align: left;
}

.end-session-dialog-card {
  width: min(500px, 100%);
  text-align: left;
}

.end-session-note {
  display: grid;
  gap: 8px;
  margin: 4px 0 20px;
  color: #2d3b4f;
  font-weight: 800;
}

.end-session-note textarea {
  width: 100%;
  min-height: 118px;
  resize: vertical;
  border: 2px solid rgba(66, 101, 140, 0.16);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  line-height: 1.55;
}

.next-phase-dialog-card {
  width: min(540px, 100%);
  text-align: left;
}

.ended-leave-dialog-card {
  width: min(500px, 100%);
  text-align: left;
}

.teacher-location-dialog-card {
  width: min(720px, 100%);
  text-align: left;
}

.teacher-location-detail {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 14px;
}

.teacher-location-detail .thumb {
  max-height: 240px;
}

.teacher-location-detail p {
  margin: 0 0 12px;
  line-height: 1.6;
}

.danger-action {
  background: #d94b42;
  color: #ffffff;
}

.danger-action:hover {
  background: #bd392f;
}

.student-choice-preview {
  margin: 6px 0 18px;
  padding: 14px;
  border: 1px solid #b8dfc8;
  border-radius: 8px;
  background: #f2fff7;
  color: #24455d;
  font-weight: 950;
  line-height: 1.45;
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #314158;
  cursor: pointer;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.game-screen {
  min-height: 100vh;
  padding: clamp(12px, 3vw, 28px);
  background:
    linear-gradient(180deg, var(--mode-bg-start) 0, var(--mode-bg-end) 360px),
    var(--mode-bg-end);
}

.screen-display {
  height: 100svh;
  overflow: hidden;
  padding: clamp(12px, 2vw, 24px);
}

.topbar {
  width: min(1320px, 100%);
  margin: 0 auto 16px;
  padding: 16px clamp(16px, 3vw, 24px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-identity {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-identity > div {
  min-width: 0;
}

.topbar-identity h1 {
  margin: 0;
  font-size: clamp(24px, 2.5vw, 34px);
  line-height: 1.12;
}

.topbar-subtitle {
  display: block;
  margin-top: 5px;
  color: #476174;
  font-size: 12px;
}

.scenario-avatar {
  width: 78px;
  height: 78px;
  flex: 0 0 78px;
  border: 2px solid #ffffff;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(37, 50, 74, 0.14);
  object-fit: cover;
  object-position: center top;
}

.student-role-name {
  display: inline-block;
  margin-right: 12px;
  color: #155f78;
  font-size: 1.18em;
  font-weight: 950;
}

.student-role-definition {
  display: inline-block;
  color: #2f405a;
  font-size: 0.78em;
  font-weight: 850;
}

.plain-button {
  border: 2px solid #80b9d7;
  background: #ffffff;
  color: #21516d;
  font-weight: 900;
  padding: 0 18px;
  white-space: nowrap;
}

.topbar-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.topbar-timer {
  display: grid;
  gap: 3px;
  margin-left: auto;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  text-align: right;
  white-space: nowrap;
}

.topbar-timer span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.topbar-timer strong {
  color: #205271;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.screen-timer {
  margin-left: 0;
  min-width: 112px;
}

.link-button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.layout {
  width: min(1320px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.screen-topbar {
  margin-bottom: 12px;
}

.screen-layout {
  width: min(1500px, 100%);
  height: calc(100svh - 116px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 14px;
}

.screen-status-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.screen-status-panel > *,
.screen-card,
.screen-hero-card {
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: var(--shadow);
}

.screen-opening-card {
  min-height: 0;
  padding: 16px;
  overflow: auto;
}

.screen-opening-card h3 {
  margin: 8px 0 12px;
  color: #205271;
  font-size: clamp(22px, 2vw, 30px);
}

.screen-opening-card p {
  margin: 10px 0 0;
  color: #4d5b70;
  font-size: clamp(16px, 1.25vw, 19px);
  line-height: 1.75;
}

.screen-context-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.screen-context-img {
  aspect-ratio: 1 / 1;
  max-height: 120px;
  object-fit: contain;
}

.screen-context-images.is-single {
  grid-template-columns: 1fr;
  justify-items: center;
}

.screen-context-images.is-single .screen-context-img {
  width: 80%;
  max-height: 360px;
}

.screen-context-images .screen-context-img:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  justify-self: center;
  width: calc(50% - 4px);
}

.screen-main-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(86px, auto) minmax(0, 1fr);
  gap: 10px;
}

.screen-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
}

.screen-topic h2 {
  margin: 4px 0 0;
  font-size: clamp(24px, 2.6vw, 38px);
  line-height: 1.1;
}

.screen-topic p {
  margin: 6px 0 0;
  color: #4d5b70;
  font-size: clamp(14px, 1.1vw, 17px);
  line-height: 1.35;
}

.screen-scenario {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fcff;
}

.screen-scenario span,
.screen-scenario em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.screen-scenario em {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.screen-scenario b {
  color: #205271;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.screen-scenario strong {
  color: #205271;
  font-size: clamp(18px, 1.6vw, 24px);
  line-height: 1.15;
}

.screen-card {
  min-height: 0;
  padding: clamp(16px, 2vw, 24px);
  overflow: hidden;
}

.screen-progress-card {
  overflow: auto;
  scroll-behavior: smooth;
}

.screen-ending-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 36%);
  gap: clamp(18px, 2.4vw, 32px);
  align-items: center;
}

.screen-phase-discussion-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
  gap: clamp(18px, 2.4vw, 32px);
  align-items: center;
}

.screen-phase-discussion-img {
  max-height: min(52svh, 520px);
}

.screen-discussion-prompts {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.screen-discussion-prompts li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.screen-discussion-prompts strong {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e6f8ff;
  color: #16728b;
  font-weight: 950;
}

.screen-discussion-prompts span {
  color: #25324a;
  font-size: clamp(16px, 1.35vw, 22px);
  font-weight: 850;
  line-height: 1.55;
}

.screen-ending-card p {
  margin: 14px 0 0;
  color: #33425a;
  font-size: clamp(16px, 1.35vw, 22px);
  font-weight: 850;
  line-height: 1.65;
}

.screen-ending-card h3 {
  font-size: clamp(26px, 2.7vw, 40px);
}

.screen-ending-img {
  max-height: min(44svh, 430px);
}

.screen-ending-card.good-ending {
  background: #f1fff6;
}

.screen-ending-card.warning-ending {
  background: #fff9ed;
}

.screen-ending-card.bad-ending {
  background: #fff6f3;
}

.screen-card h3 {
  margin-top: 6px;
  color: #205271;
  font-size: clamp(30px, 3.2vw, 48px);
}

.screen-progress-list {
  min-height: 0;
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.screen-discussion-layout {
  display: grid;
  grid-template-columns: minmax(220px, 36%) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 14px;
}

.screen-discussion-layout .screen-progress-list {
  margin-top: 0;
}

.screen-progress-list li {
  display: grid;
  grid-template-columns: minmax(76px, 120px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.screen-progress-list li.is-done {
  border-color: #b7ead0;
  background: #f2fff7;
}

.screen-progress-list strong {
  color: #287995;
}

.screen-progress-list span {
  display: grid;
  gap: 5px;
  color: #33425a;
  font-weight: 850;
}

.screen-progress-list em,
.screen-progress-list small {
  font-style: normal;
}

.screen-progress-list em {
  color: #25324a;
  font-size: clamp(16px, 1.35vw, 21px);
  line-height: 1.45;
}

.screen-progress-list small {
  color: #5d6c80;
  font-size: clamp(13px, 1vw, 16px);
  font-weight: 900;
}

.screen-progress-list li.is-done small {
  color: #24794f;
}

.screen-status-meters {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.screen-status-card-with-image {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 32%);
  gap: clamp(18px, 3vw, 32px);
  align-items: center;
}

.screen-status-img {
  width: 100%;
  max-height: min(48svh, 420px);
  object-fit: contain;
}

.screen-score-detail-action {
  min-height: 48px;
  margin-top: 18px;
}

.screen-status-meter {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.screen-status-meter > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.screen-status-meter strong {
  color: #25324a;
  font-size: clamp(18px, 1.55vw, 26px);
  line-height: 1.25;
}

.screen-status-meter span {
  color: var(--metric-color);
  font-size: clamp(26px, 2.8vw, 42px);
  font-weight: 950;
  white-space: nowrap;
}

.screen-status-meter i {
  display: block;
  height: clamp(14px, 1.2vw, 20px);
  border-radius: 999px;
  background: #edf1f4;
  overflow: hidden;
}

.screen-status-meter b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--metric-color);
}

.screen-story-card p {
  margin-top: 12px;
  color: #4d5b70;
  font-size: clamp(16px, 1.4vw, 20px);
}

.screen-alert {
  display: grid;
  gap: 4px;
  margin-top: 18px;
  padding: 14px;
  border-radius: 8px;
  background: #eaf8ef;
  color: #24794f;
}

.screen-alert.is-warning {
  background: #fff3e7;
  color: #9a5200;
}

.progress-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  position: sticky;
  top: 16px;
  max-height: calc(100svh - 32px);
  overflow: visible;
}

.meter-card {
  padding: 16px;
}

.meter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.meter-details {
  margin-top: 16px;
}

.screen-meter-card.is-collapsed .meter-details {
  display: none;
}

.screen-meter-toggle {
  flex: 0 0 auto;
}

.meter-row + .meter-row {
  margin-top: 16px;
}

.meter-row.is-clickable {
  margin-inline: -6px;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 150ms ease, box-shadow 150ms ease;
}

.meter-row.is-clickable:hover,
.meter-row.is-clickable:focus-visible {
  background: #f2fbff;
  box-shadow: inset 0 0 0 2px #bce8fb;
  outline: 0;
}

.meter-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: #33425a;
  font-size: 14px;
}

.meter {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f4;
}

.meter span {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: var(--metric-color, var(--red));
}

.meter.blue span {
  background: var(--blue);
}

.meter-tip,
.small-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.phase-nav {
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: var(--shadow);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
}

.phase-button {
  flex: 0 0 auto;
  width: 100%;
  border: 2px solid transparent;
  background: #ffffff;
  padding: 12px;
  line-height: 1.25;
  text-align: left;
}

.phase-button span {
  color: #287995;
  font-size: 13px;
  font-weight: 950;
}

.phase-button strong {
  display: block;
  margin-top: 4px;
}

.phase-button em {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.phase-button.is-active {
  border-color: var(--orange);
  background: #fff8df;
}

.phase-button.is-current:not(.is-active) {
  border-color: #ffd58a;
}

.phase-button.is-complete:not(.is-active) {
  border-color: #b7ead0;
  background: #f2fff7;
}

.main-panel {
  min-width: 0;
}

.teacher-guide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 260px);
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
  padding: clamp(16px, 3vw, 24px);
}

.teacher-guide h2,
.teacher-guide p {
  margin-right: 0;
}

.guide-status {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fcff;
}

.guide-status strong {
  color: #23506a;
  font-size: 18px;
}

.guide-status span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
}

.guide-timer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.guide-timer b {
  color: #205271;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.guide-suggested-time b {
  color: #8a5b00;
  font-size: 18px;
}

.teacher-tip-preview {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #d6eadf;
  border-radius: 8px;
  background: #f4fbf6;
}

.teacher-tip-preview span,
.teacher-tip-item span {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #dff2e7;
  color: #24613e;
  font-size: 12px;
  font-weight: 900;
}

.teacher-tip-preview p,
.teacher-tip-item p {
  margin: 0;
  color: #244334;
  font-size: 14px;
  line-height: 1.55;
}

.teacher-tips-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  justify-content: flex-end;
  background: rgba(18, 37, 52, 0.28);
}

.teacher-tips-drawer {
  position: relative;
  width: min(460px, calc(100vw - 24px));
  height: 100%;
  padding: clamp(18px, 3vw, 28px);
  overflow-y: auto;
  background: #fffdf8;
  box-shadow: -18px 0 45px rgba(22, 35, 48, 0.18);
}

.teacher-tips-drawer h2 {
  margin: 4px 34px 8px 0;
  color: #263f4e;
  font-size: 24px;
}

.teacher-tips-drawer > p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.7;
}

.teacher-tips-list {
  display: grid;
  gap: 10px;
}

.teacher-tip-item {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid #e6dfcf;
  border-radius: 8px;
  background: #ffffff;
}

.content-card {
  padding: clamp(18px, 3vw, 30px);
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 380px);
  gap: clamp(18px, 4vw, 36px);
  align-items: center;
}

.story-img {
  width: 100%;
  border-radius: 8px;
  background: #ffffff;
  object-fit: contain;
}

.story-img.object {
  max-height: 420px;
}

.role-portrait-main {
  max-height: 430px;
}

.story-img-stack {
  display: grid;
  gap: 12px;
  align-self: stretch;
  align-content: center;
}

.story-img-stack.is-compact-pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-self: center;
}

.story-img-stack.is-compact-pair .story-img {
  aspect-ratio: 1 / 1;
  max-height: 210px;
}

.teacher-focus-main .story-img-stack {
  margin-bottom: 12px;
}

.teacher-focus-main .story-img-stack .story-img {
  max-height: 220px;
}

.teacher-focus-main .story-img-stack.is-compact-pair .story-img {
  max-height: 160px;
}

.round-lead-card {
  grid-template-columns: minmax(0, 1fr) minmax(120px, 190px);
  align-items: center;
  margin-bottom: 16px;
}

.round-lead-img {
  justify-self: center;
  width: 100%;
  max-height: 210px;
}

.round-shared-lead-card {
  grid-template-columns: minmax(0, 1fr) minmax(190px, 280px);
}

.lead-image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-self: center;
}

.lead-thumb {
  aspect-ratio: 1 / 1;
  max-height: 104px;
  object-fit: contain;
}

.lead-image-grid.is-single {
  grid-template-columns: 1fr;
  justify-items: center;
}

.lead-image-grid.is-single .lead-thumb {
  width: min(100%, 260px);
  max-height: 260px;
}

.lead-image-grid .lead-thumb:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  justify-self: center;
  width: calc(50% - 4px);
}

.round4-lead-card .lead-image-grid {
  grid-template-columns: 1fr;
  justify-items: center;
}

.round4-lead-card .lead-thumb {
  width: min(100%, 150px);
  max-height: 150px;
}

.discussion-img {
  max-height: 360px;
}

.phase-discussion-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(18px, 4vw, 36px);
  align-items: center;
}

.phase-discussion-img {
  width: 100%;
  max-height: 520px;
}

.discussion-prompt-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.discussion-prompt-item {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.discussion-prompt-item strong {
  color: #16728b;
  font-size: 14px;
}

.discussion-prompt-item p {
  margin: 0;
  color: #25324a;
  font-size: 18px;
  font-weight: 850;
  line-height: 1.6;
}

.discussion-review-card {
  align-self: stretch;
  min-width: 0;
  padding: 16px;
  border: 1px solid #c9dce7;
  border-radius: 8px;
  background: #f7fbfd;
}

.discussion-review-card h3 {
  margin: 6px 0 12px;
  color: #205271;
  font-size: 22px;
  line-height: 1.3;
}

.discussion-review-card > p {
  color: #3e4d62;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.6;
}

.discussion-review-choice {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.discussion-review-choice strong,
.discussion-review-choice span {
  display: block;
}

.discussion-review-choice strong {
  color: #287995;
  font-size: 13px;
}

.discussion-review-choice span {
  margin-top: 5px;
  color: #314158;
  font-weight: 950;
  line-height: 1.45;
}

.discussion-question-review-list {
  display: grid;
  gap: 10px;
}

.discussion-question-review {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.discussion-question-review > strong,
.discussion-question-review > span {
  display: block;
}

.discussion-question-review > strong {
  color: #287995;
  font-size: 13px;
}

.discussion-question-review > p {
  margin: 6px 0;
  color: #3e4d62;
  font-weight: 850;
  line-height: 1.45;
}

.discussion-question-review > span {
  color: #314158;
  font-weight: 950;
  line-height: 1.4;
}

.discussion-box {
  margin-top: 18px;
  padding: 18px;
  border: 2px dashed #9bcfe8;
  border-radius: 8px;
  background: #f2fbff;
  font-size: 19px;
  font-weight: 900;
  text-align: center;
}

.action-reminder {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: #f7fbff;
  color: #2f5168;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.6;
}

.initial-status-card {
  display: grid;
  gap: 16px;
}

.initial-status-card h2 {
  margin-bottom: 0;
}

.status-copy {
  display: grid;
  gap: clamp(16px, 2.5vw, 24px);
  align-content: center;
}

.status-copy h2 {
  margin-top: -8px;
}

.status-copy .initial-status-grid,
.status-copy .status-note,
.status-copy .discussion-box,
.status-copy .score-explain-card {
  margin-top: 0;
}

.initial-status-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 360px);
  gap: clamp(18px, 4vw, 34px);
  align-items: center;
}

.status-phase-img {
  align-self: center;
}

.initial-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.initial-metric {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.initial-metric strong {
  font-size: 17px;
}

.initial-metric span {
  color: var(--metric-color);
  font-size: 28px;
  font-weight: 950;
}

.initial-meter {
  height: 12px;
  border-radius: 999px;
  background: #edf1f4;
  overflow: hidden;
}

.initial-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--metric-color);
}

.status-note {
  margin: 0;
  padding: 14px 16px;
  border-left: 4px solid var(--orange);
  border-radius: 8px;
  background: #fff9e5;
  font-weight: 800;
}

.status-prompt {
  margin-top: 0;
}

.group-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.group-switch button {
  min-height: 42px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 0 14px;
  font-weight: 900;
}

.group-switch button.is-active {
  border-color: var(--blue);
  background: #eaf8ff;
}

.card-grid,
.teacher-grid,
.investigation-grid,
.mini-grid {
  display: grid;
  gap: 14px;
}

.card-grid,
.teacher-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.mini-grid {
  grid-template-columns: repeat(5, minmax(140px, 1fr));
}

.investigation-picker {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.investigation-choice-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.investigation-choice {
  position: relative;
  min-height: 92px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #314158;
  padding: 12px;
  text-align: left;
}

.investigation-choice strong,
.investigation-choice span,
.investigation-choice em {
  display: block;
}

.investigation-choice em {
  position: absolute;
  top: 8px;
  right: 8px;
  border-radius: 999px;
  background: #edf3f7;
  color: #526276;
  font-size: 12px;
  font-style: normal;
  font-weight: 950;
  padding: 4px 8px;
}

.investigation-choice strong {
  padding-right: 52px;
  color: #205271;
  font-size: 16px;
  line-height: 1.25;
}

.investigation-choice span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.investigation-choice:not(:disabled):hover {
  border-color: var(--orange);
  background: #fffaf0;
}

.investigation-choice.is-selected {
  border-color: var(--orange);
  background: #fff8df;
  box-shadow: inset 0 0 0 2px rgba(232, 148, 28, 0.18);
}

.investigation-choice.is-occupied {
  border-color: #f0b36b;
  background: #fff4e7;
}

.investigation-choice.is-selected em {
  background: #e8941c;
  color: #ffffff;
}

.investigation-choice.is-teacher-occupied:not(.is-selected) em {
  background: #c8681c;
  color: #ffffff;
}

.investigation-choice.is-teacher-occupied:not(.is-selected) span {
  color: #9a4a12;
}

.investigation-preview {
  display: grid;
  grid-template-columns: minmax(180px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 260px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.investigation-preview .thumb {
  max-height: 260px;
}

.investigation-preview h3 {
  margin: 6px 0 10px;
  color: #205271;
  font-size: clamp(22px, 2.2vw, 30px);
}

.investigation-preview p {
  margin: 0;
  color: #3e4d62;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.65;
}

.investigation-picker.is-selected .investigation-preview {
  border-color: var(--orange);
  background: #fffaf0;
}

.info-card,
.teacher-choice-card,
.question-card,
.teacher-group-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.info-card.is-selected {
  border-color: var(--orange);
  background: #fff9e5;
}

.info-card > span {
  color: #287995;
  font-weight: 950;
}

.thumb {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: 8px;
  background: #ffffff;
}

.choice-list,
.record-actions,
.ending-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.choice-button,
.record-actions button,
.small-action {
  border: 2px solid var(--line);
  background: #ffffff;
  color: #314158;
  font-weight: 900;
  padding: 10px 14px;
}

.choice-button.is-selected,
.small-action.is-selected {
  border-color: var(--green);
  background: #ebfff4;
}

.info-card.is-disabled {
  opacity: 0.62;
}

button:disabled {
  cursor: not-allowed;
}

.choice-button {
  flex: 1 1 180px;
}

.choice-impact {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #b8dfc8;
  border-radius: 8px;
  background: #f2fff7;
}

.choice-impact strong {
  display: block;
  color: #1f6a44;
  font-size: 14px;
}

.choice-impact div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.choice-impact span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #ffffff;
  color: #24455d;
  font-weight: 950;
  padding: 6px 10px;
}

.score-explain-card {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.score-explain-card.is-compact {
  padding: 12px;
}

.score-explain-card h3,
.screen-card .score-explain-card h3 {
  margin: 4px 0 12px;
  color: #205271;
  font-size: 18px;
  line-height: 1.25;
}

.score-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.score-breakdown-metric {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.score-breakdown-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #25324a;
  font-weight: 950;
}

.score-breakdown-head span {
  color: #205271;
}

.score-breakdown-metric ol {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.score-breakdown-metric li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding-top: 8px;
  border-top: 1px dashed #d9e5ed;
  color: #3e4d62;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.35;
}

.score-breakdown-metric li:first-child {
  border-top: 0;
  padding-top: 0;
}

.score-breakdown-metric small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.score-breakdown-metric li > strong {
  color: #205271;
  white-space: nowrap;
}

.score-breakdown-metric .is-plus {
  color: #b55c00;
}

.score-breakdown-metric .is-minus {
  color: #1b8d65;
}

.score-empty {
  color: var(--muted);
}

.score-dialog {
  z-index: 30;
}

.score-dialog-card {
  width: min(760px, 100%);
  max-height: min(82vh, 760px);
  overflow: auto;
  text-align: left;
}

.score-dialog-card h2 {
  margin: 6px 0 0;
  color: #205271;
}

.score-dialog-card .score-breakdown-metric {
  margin-top: 14px;
}

.score-dialog-card .score-explain-card {
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: transparent;
}

.summary-dialog {
  z-index: 32;
}

.summary-dialog-card {
  display: grid;
  grid-template-rows: auto auto auto minmax(220px, 1fr) auto;
  width: min(880px, 100%);
  max-height: min(86vh, 820px);
  overflow: hidden;
  text-align: left;
}

.summary-textarea {
  width: 100%;
  min-height: 220px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  color: var(--ink);
  font: 15px/1.7 "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  resize: vertical;
}

.summary-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.summary-copy-status {
  min-height: 22px;
  color: #2e7a57;
  font-size: 14px;
  font-weight: 800;
}

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

.record-actions button {
  text-align: left;
}

.record-actions button span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.record-actions button.is-selected {
  border-color: var(--green);
  background: #ebfff4;
}

.r2-public-actions {
  flex-direction: row;
}

.r2-public-actions button {
  flex: 1 1 180px;
  text-align: center;
}

.teacher-focus-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.teacher-focus-selector button {
  min-height: 92px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #314158;
  padding: 10px 12px;
  text-align: left;
}

.teacher-focus-selector button.is-active {
  border-color: var(--orange);
  background: #fff8df;
}

.teacher-focus-selector button.is-done:not(.is-active) {
  border-color: #b7ead0;
  background: #f2fff7;
}

.teacher-focus-selector strong,
.teacher-focus-selector span,
.teacher-focus-selector small,
.teacher-focus-selector em {
  display: block;
}

.teacher-focus-selector strong {
  font-size: 17px;
}

.teacher-focus-selector span {
  margin-top: 4px;
  color: #287995;
  font-size: 12px;
  font-weight: 950;
}

.teacher-focus-selector em {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
}

.teacher-focus-selector small {
  margin-top: 5px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
}

.teacher-focus-main {
  min-width: 0;
}

.teacher-focus-main.has-media {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(180px, 0.75fr);
  gap: clamp(18px, 3vw, 30px);
  align-items: start;
}

.teacher-focus-copy {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.teacher-focus-copy h3,
.teacher-focus-copy p {
  margin: 0;
}

.teacher-focus-media {
  min-width: 0;
  align-self: start;
}

.teacher-focus-media .thumb,
.teacher-focus-media .story-img {
  max-height: 260px;
}

.teacher-focus-media .story-img-stack {
  margin-bottom: 0;
  align-content: start;
}

.teacher-focus-main .record-actions {
  flex-direction: row;
}

.teacher-focus-main .record-actions button {
  flex: 1 1 190px;
}

.teacher-round2 {
  display: grid;
  gap: 18px;
}

.teacher-group-block.has-warning {
  border-color: #ffae42;
  background: #fff9ed;
}

.warning {
  margin: 8px 0;
  color: #a35c00;
  font-weight: 900;
}

.question-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.question-card {
  background: #f8fcff;
}

.ending-card.good-ending {
  background: #f1fff6;
}

.ending-card.warning-ending {
  background: #fff9ed;
}

.ending-card.bad-ending {
  background: #fff6f3;
}

.primary-action {
  border: 0;
  background: linear-gradient(180deg, var(--yellow), var(--orange));
  color: #56330c;
  font-weight: 950;
  padding: 0 20px;
  box-shadow: 0 7px 0 #d77b10;
}

.primary-action:disabled {
  cursor: not-allowed;
  background: #e8edf1;
  color: #7b8795;
  box-shadow: none;
}

@media (max-width: 1080px) {
  .home-grid,
  .layout,
  .two-col,
  .phase-discussion-card,
  .teacher-guide,
  .screen-layout,
  .screen-hero-card,
  .screen-phase-discussion-card {
    grid-template-columns: 1fr;
  }

  .initial-status-layout {
    grid-template-columns: 1fr;
  }

  .teacher-focus-main.has-media {
    grid-template-columns: 1fr;
  }

  .screen-status-card-with-image {
    grid-template-columns: 1fr;
  }

  .teacher-location-detail {
    grid-template-columns: 1fr;
  }

  .investigation-preview {
    grid-template-columns: 1fr;
  }

  .story-img-stack.is-compact-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .screen-display {
    height: auto;
    min-height: 100svh;
    overflow: visible;
  }

  .screen-layout,
  .screen-main-panel {
    height: auto;
  }

  .screen-discussion-layout {
    grid-template-columns: 1fr;
  }

  .screen-ending-card {
    grid-template-columns: 1fr;
  }

  .teacher-tip-preview {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .brand-block {
    padding-bottom: 0;
  }

  .progress-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .phase-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow-y: visible;
  }

  .card-grid,
  .teacher-grid,
  .teacher-focus-selector,
  .investigation-grid,
  .investigation-choice-grid,
  .mini-grid,
  .score-breakdown-grid,
  .role-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .hero-screen,
  .game-screen {
    padding-inline: 12px;
  }

  .role-grid,
  .phase-nav,
  .card-grid,
  .teacher-grid,
  .teacher-focus-selector,
  .investigation-grid,
  .investigation-choice-grid,
  .score-breakdown-grid,
  .mini-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .scenario-avatar {
    width: 64px;
    height: 64px;
    flex-basis: 64px;
  }

  .offline-note {
    align-items: flex-start;
    flex-direction: column;
  }

  .join-form div {
    align-items: stretch;
    flex-direction: column;
  }

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

  .investigation-picker-toolbar {
    grid-template-columns: 1fr;
  }

  .wide-action {
    width: 100%;
  }
}
