:root {
  --paper: #fffaf0;
  --ink: #171717;
  --muted: #66615a;
  --line: #242424;
  --yellow: #ffe36e;
  --blue: #93c5fd;
  --green: #a7f3d0;
  --red: #fca5a5;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f5f0e6;
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "Trebuchet MS", Arial, sans-serif;
}

button,
select,
textarea {
  color: inherit;
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 14px;
}

.stage {
  position: relative;
  min-height: calc(100vh - 28px);
  overflow: hidden;
  border: 4px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.doodle-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(transparent 94%, rgba(0, 0, 0, 0.05) 95%),
    linear-gradient(90deg, transparent 94%, rgba(0, 0, 0, 0.04) 95%);
  background-size: 44px 44px;
  opacity: 0.95;
}

.teacher-panel {
  position: absolute;
  right: 22px;
  top: 22px;
  z-index: 2;
  width: min(330px, 28vw);
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border: 4px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 250, 240, 0.9);
  padding: 18px;
}

.teacher-avatar {
  position: relative;
  height: 260px;
  flex: 0 0 auto;
}

.teacher-head {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 2;
  width: 156px;
  height: 156px;
  transform: translateX(-50%);
}

.teacher-head-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.teacher-body,
.teacher-arm,
.teacher-leg {
  position: absolute;
  left: 50%;
  background: var(--line);
  transform-origin: top center;
}

.teacher-body {
  top: 132px;
  z-index: 1;
  width: 58px;
  height: 62px;
  border-radius: 24px 24px 12px 12px;
  transform: translateX(-50%);
}

.teacher-arm {
  top: 154px;
  z-index: 0;
  width: 48px;
  height: 9px;
  border-radius: 999px;
}

.arm-left {
  transform: translateX(-72px) rotate(-24deg);
}

.arm-right {
  transform: translateX(24px) rotate(24deg);
}

.teacher-leg {
  top: 190px;
  width: 9px;
  height: 58px;
  border-radius: 999px;
}

.leg-left {
  transform: translateX(-18px) rotate(2deg);
}

.leg-right {
  transform: translateX(10px) rotate(-2deg);
}

.teacher-avatar.idle .teacher-head {
  transform: translateX(-50%) rotate(-3deg);
}

.teacher-avatar.thinking .teacher-head {
  transform: translateX(-50%) rotate(2deg);
}

.teacher-avatar.correcting .teacher-head,
.teacher-avatar.confused .teacher-head {
  transform: translateX(-50%) rotate(-1deg);
}

.teacher-avatar.almost .teacher-head,
.teacher-avatar.natural .teacher-head,
.teacher-avatar.done .teacher-head {
  transform: translateX(-50%) rotate(1deg);
}

.teacher-avatar.retry .teacher-head {
  transform: translateX(-50%) rotate(-4deg);
}

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

.teacher-copy h1 {
  font-size: clamp(28px, 4vw, 46px);
  line-height: 0.95;
}

.teacher-copy p:last-child {
  margin-top: 12px;
  font-size: clamp(18px, 2.1vw, 25px);
  line-height: 1.16;
}

.speech-bubble {
  position: relative;
  border: 3px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.speech-bubble::before {
  content: "";
  position: absolute;
  left: 26px;
  top: -13px;
  width: 22px;
  height: 22px;
  border-left: 3px solid var(--line);
  border-top: 3px solid var(--line);
  background: #fff;
  transform: rotate(45deg);
}

.eyebrow {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.screen-card {
  position: relative;
  z-index: 1;
  width: calc(100% - min(390px, 32vw));
  min-height: calc(100vh - 28px);
  padding: clamp(18px, 3vw, 42px);
}

.stage.activity-mode .teacher-panel {
  display: none;
}

.stage.activity-mode .screen-card {
  width: 100%;
}

.stage.phone-room-mode .teacher-panel,
.stage.phone-join-mode .teacher-panel {
  display: none;
}

.stage.phone-room-mode .screen-card,
.stage.phone-join-mode .screen-card {
  width: 100%;
  min-height: calc(100vh - 28px);
}

.stage.situation-mode {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 255px);
  gap: 18px;
  align-items: start;
  padding: 18px;
}

.stage.situation-mode .screen-card {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  min-width: 0;
  min-height: calc(100vh - 72px);
  padding: clamp(18px, 3vw, 34px);
}

.stage.situation-mode .teacher-panel {
  position: relative;
  inset: auto;
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  min-width: 0;
  gap: 10px;
  padding: 12px;
}

.stage.situation-mode .teacher-avatar {
  height: 168px;
}

.stage.situation-mode .teacher-head {
  width: 104px;
  height: 104px;
}

.stage.situation-mode .teacher-body {
  top: 88px;
  width: 40px;
  height: 44px;
}

.stage.situation-mode .teacher-arm {
  top: 104px;
  width: 34px;
  height: 7px;
}

.stage.situation-mode .arm-left {
  transform: translateX(-50px) rotate(-24deg);
}

.stage.situation-mode .arm-right {
  transform: translateX(16px) rotate(24deg);
}

.stage.situation-mode .teacher-leg {
  top: 130px;
  width: 7px;
  height: 38px;
}

.stage.situation-mode .leg-left {
  transform: translateX(-13px) rotate(2deg);
}

.stage.situation-mode .leg-right {
  transform: translateX(7px) rotate(-2deg);
}

.stage.situation-mode .teacher-copy h1 {
  font-size: clamp(26px, 2.6vw, 34px);
}

.stage.situation-mode .teacher-copy p:last-child {
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.12;
}

.stage.situation-mode .speech-bubble {
  padding: 10px;
}

.view {
  min-height: calc(100vh - 112px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}

.topline {
  width: fit-content;
  border-left: 8px solid var(--line);
  padding: 4px 0 4px 12px;
  font-weight: 900;
}

.topline.label {
  border-left-width: 0;
  padding-left: 0;
  color: var(--muted);
  font-size: 16px;
}

.title {
  max-width: 820px;
  margin: 0;
  font-size: clamp(44px, 7vw, 92px);
  line-height: 0.94;
}

.subtitle {
  max-width: 760px;
  margin: 0;
  color: #2d2a26;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.12;
}

.actions,
.activity-actions,
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  min-height: 58px;
  border: 4px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 5px 5px 0 var(--line);
  cursor: pointer;
  font-size: 22px;
  font-weight: 900;
  padding: 13px 22px;
}

.button:active {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 var(--line);
}

.button:focus-visible {
  outline: 4px solid var(--blue);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .button:hover {
    transform: translate(2px, 2px);
    box-shadow: 3px 3px 0 var(--line);
  }
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
  transform: none;
  box-shadow: 5px 5px 0 var(--line);
}

.button.primary {
  background: var(--yellow);
}

.button.danger {
  background: var(--red);
}

.button.ghost {
  background: var(--paper);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 850px;
}

.phone-lobby {
  justify-content: flex-start;
}

.phone-seat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 18px;
  max-width: 980px;
}

.phone-qr-card {
  display: grid;
  gap: 14px;
  border: 4px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  padding: 18px;
}

.phone-qr-card > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.phone-qr-card span {
  font-size: 26px;
  font-weight: 900;
}

.phone-qr-card strong {
  border: 3px solid var(--line);
  border-radius: 999px;
  background: var(--yellow);
  padding: 5px 10px;
  font-size: 14px;
}

.phone-qr-card img {
  width: min(100%, 280px);
  aspect-ratio: 1;
  justify-self: center;
  border: 3px solid var(--line);
  background: #fff;
  padding: 10px;
}

.phone-qr-card p {
  overflow-wrap: anywhere;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.choice {
  min-height: 126px;
  border: 4px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  padding: 16px;
  text-align: left;
}

.choice.custom-choice {
  cursor: default;
  grid-column: 1 / -1;
  background: rgba(255, 250, 240, 0.94);
}

.choice.selected {
  background: var(--green);
  box-shadow: inset 0 0 0 5px #fff;
}

.choice strong {
  display: block;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1;
}

.choice span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 18px;
}

.situation-view {
  justify-content: flex-start;
  gap: 12px;
}

.situation-view .title {
  font-size: clamp(34px, 4.4vw, 58px);
}

.situation-view .subtitle {
  max-width: 760px;
  font-size: clamp(19px, 2vw, 26px);
}

.situation-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.situation-picker {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: none;
}

.stage.situation-mode .situation-picker,
.stage.situation-mode .situation-subject-grid,
.stage.situation-mode .situation-theme-grid {
  max-width: 820px;
}

.stage.situation-mode .situation-subject-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.situation-subject-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 1220px;
}

.situation-subject-card,
.situation-theme-card,
.situation-option-card {
  border: 4px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  text-align: left;
}

.situation-subject-card {
  display: flex;
  min-height: 260px;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}

.situation-subject-card:hover,
.situation-subject-card:focus-visible,
.situation-theme-card:hover,
.situation-theme-card:focus-visible,
.situation-option-card:hover,
.situation-option-card:focus-visible {
  background: rgba(147, 197, 253, 0.24);
  outline: none;
}

.situation-subject-card span,
.situation-theme-card span,
.situation-option-card span {
  width: fit-content;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: var(--yellow);
  padding: 4px 10px;
  color: var(--ink);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.situation-subject-card strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(32px, 3.4vw, 48px);
  line-height: 0.95;
}

.situation-subject-card p,
.situation-subject-card em,
.situation-theme-card p,
.situation-theme-card em,
.situation-option-card p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.16;
}

.situation-subject-card em {
  margin-top: auto;
}

.situation-theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  max-width: 820px;
}

.situation-theme-card {
  display: flex;
  min-height: 148px;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
}

.situation-theme-card strong,
.situation-option-card strong {
  display: block;
  color: var(--ink);
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1;
}

.situation-theme-card em {
  margin-top: auto;
  font-size: 15px;
}

.situation-tabs,
.situation-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.situation-tab,
.situation-chip {
  border: 3px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-weight: 900;
}

.situation-tab {
  min-height: 40px;
  padding: 6px 14px;
  font-size: 18px;
}

.situation-chip {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  color: var(--ink);
  font-size: 14px;
}

.situation-chip b {
  min-width: 22px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  line-height: 1;
  padding: 3px 5px;
  text-align: center;
}

.situation-tab.selected,
.situation-chip.selected {
  background: var(--yellow);
  box-shadow: inset 0 0 0 3px #fff;
}

.situation-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 520px) auto;
  gap: 12px;
  align-items: end;
}

.situation-search {
  display: grid;
  gap: 6px;
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
}

.situation-search input {
  min-height: 42px;
  border: 3px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  padding: 7px 12px;
}

.situation-count {
  color: var(--muted);
  padding: 7px 0;
  font-size: 16px;
  font-weight: 900;
}

.situation-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  max-width: 820px;
}

.situation-results-shell {
  min-width: 0;
}

.situation-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.situation-results-header strong {
  font-size: 20px;
}

.situation-results-header span {
  color: var(--muted);
  font-size: 15px;
  font-weight: 900;
}

.situation-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.situation-workspace .situation-option-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.situation-selection-slot {
  width: 100%;
  max-width: 820px;
}

.situation-option-card {
  display: grid;
  gap: 8px;
  min-height: 120px;
  padding: 14px;
}

.situation-option-card.selected {
  background: var(--green);
  box-shadow: inset 0 0 0 4px #fff;
}

.situation-option-card p {
  font-size: 16px;
}

.situation-list {
  display: grid;
  gap: 10px;
  max-width: none;
}

.situation-list.grouped {
  display: block;
  column-gap: 10px;
  columns: 220px 4;
}

.situation-section {
  overflow: hidden;
  border: 3px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
}

.situation-list.grouped .situation-section {
  break-inside: avoid;
  margin-bottom: 10px;
}

.situation-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 2px solid var(--line);
  background: rgba(255, 227, 110, 0.45);
  padding: 7px 10px;
}

.situation-section-title strong {
  font-size: 16px;
}

.situation-section-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.situation-section-list,
.situation-list.focused {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.situation-list.focused {
  overflow: hidden;
  border: 3px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
}

.situation-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-bottom: 2px solid rgba(36, 36, 36, 0.28);
  background: transparent;
  cursor: pointer;
  padding: 8px 10px;
  text-align: left;
}

.situation-row:last-child {
  border-bottom: 0;
}

.situation-row:hover,
.situation-row:focus-visible {
  background: rgba(147, 197, 253, 0.26);
  outline: none;
}

.situation-row.selected {
  background: var(--green);
  box-shadow: inset 0 0 0 4px #fff;
}

.situation-radio {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: #fff;
}

.situation-row.selected .situation-radio {
  box-shadow: inset 0 0 0 4px #fff;
  background: var(--line);
}

.situation-row-copy {
  display: grid;
  min-width: 0;
}

.situation-row-copy strong {
  overflow-wrap: anywhere;
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.05;
}

.selected-situation-actions {
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: 420px;
  margin-top: 0;
}

.selected-situation-actions .button {
  min-height: 46px;
  border-width: 3px;
  border-radius: 10px;
  box-shadow: 4px 4px 0 var(--line);
  font-size: 18px;
  padding: 9px 12px;
}

.selected-situation-actions .button:disabled {
  background: rgba(255, 255, 255, 0.64);
  color: var(--muted);
  cursor: not-allowed;
}

.empty-situation-results {
  grid-column: 1 / -1;
  border: 3px dashed var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.64);
  padding: 18px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 900;
}

.custom-input {
  width: 100%;
  min-height: 92px;
  margin-top: 12px;
  border: 3px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 22px;
  padding: 12px;
  resize: vertical;
}

.notice {
  width: fit-content;
  max-width: 760px;
  border: 4px solid var(--line);
  border-radius: 12px;
  background: var(--red);
  padding: 12px 16px;
  font-size: 22px;
  font-weight: 900;
}

.avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mini-avatar,
.student-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid var(--line);
  border-radius: 50%;
  background: #fff;
  font-weight: 900;
}

.participant-avatar-image,
.participant-avatar-video {
  background: #fff;
  display: block;
  object-fit: cover;
  padding: 0;
}

.participant-avatar-video {
  pointer-events: none;
}

.mini-avatar {
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  font-size: 24px;
  line-height: 1;
}

.student-avatar {
  width: clamp(86px, 10vw, 130px);
  height: clamp(86px, 10vw, 130px);
  font-size: clamp(30px, 4vw, 52px);
}

.activity {
  min-height: calc(100vh - 86px);
  display: grid;
  grid-template-columns: minmax(170px, 230px) minmax(0, 1fr) minmax(170px, 230px);
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 16px;
}

.phone-room-activity {
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr) minmax(180px, 260px);
}

.activity-header,
.student-card,
.turn-board,
.summary-box,
.activity-teacher {
  border: 4px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 250, 240, 0.9);
  padding: 16px;
}

.activity-header {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 12px 16px;
}

.activity-header h2,
.activity-header p {
  margin: 0;
}

.room-code-pill {
  border: 4px solid var(--line);
  border-radius: 12px;
  background: var(--yellow);
  box-shadow: 5px 5px 0 var(--line);
  font-size: 22px;
  font-weight: 900;
  padding: 12px 16px;
}

.activity-header h2 {
  font-size: clamp(25px, 3vw, 42px);
}

.activity-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 20px;
  font-weight: 900;
}

.student-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.phone-video-card {
  align-self: stretch;
}

.phone-video-card:not(.active) {
  border-color: rgba(36, 36, 36, 0.55);
  background: rgba(255, 250, 240, 0.74);
}

.phone-video-card:not(.active) h2,
.phone-video-card:not(.active) p {
  color: rgba(102, 97, 90, 0.7);
}

.phone-video-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 3 / 4;
  border: 4px solid var(--line);
  border-radius: 14px;
  background: #111;
}

.phone-video-frame video,
.phone-local-video video,
.phone-seat-photo,
.phone-photo-preview,
.phone-seat-emoji {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.phone-seat-photo,
.phone-photo-preview {
  display: block;
}

.phone-seat-emoji {
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 38%, #fff7cf 0, #fef3c7 42%, #111 43%);
  font-size: clamp(92px, 14vw, 180px);
  line-height: 1;
  z-index: 1;
}

.phone-local-emoji {
  font-size: clamp(76px, 28vw, 132px);
}

.phone-video-placeholder,
.phone-local-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  text-align: center;
  z-index: 2;
}

.phone-video-placeholder {
  align-content: center;
  gap: 10px;
}

.phone-inline-qr {
  width: min(78%, 220px);
  aspect-ratio: 1;
  border: 3px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 8px;
}

.phone-inline-qr-label,
.phone-inline-qr-hint {
  display: block;
  color: #fff;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.05;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.36);
}

.phone-inline-qr-hint {
  font-size: 15px;
}

.phone-video-frame.has-video .phone-video-placeholder,
.phone-video-frame.has-avatar .phone-video-placeholder,
.phone-video-frame.has-photo .phone-video-placeholder,
.phone-local-video.has-avatar .phone-local-placeholder,
.phone-local-video.has-video .phone-local-placeholder,
.phone-local-video.has-photo .phone-local-placeholder {
  display: none;
}

.phone-turn-board {
  min-height: 0;
}

.phone-turn-board .mission {
  border: 4px solid var(--line);
  background: var(--yellow);
  box-shadow: 5px 5px 0 var(--line);
}

.phone-turn-board .mission h2 {
  font-size: clamp(20px, 2.1vw, 28px);
}

.phone-turn-board .mission p {
  font-weight: 900;
}

.phone-join-screen {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: calc(100dvh - 56px);
  align-content: start;
  gap: 6px;
}

.phone-host-screen {
  width: min(100%, 520px);
  margin: 0 auto;
}

.phone-join-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 900;
}

.phone-join-header span,
.phone-turn-card span {
  border: 3px solid var(--line);
  border-radius: 999px;
  background: var(--yellow);
  padding: 4px 10px;
}

.phone-join-header strong {
  font-size: clamp(22px, 7vw, 34px);
  line-height: 1;
}

.phone-local-video {
  position: relative;
  overflow: hidden;
  height: clamp(130px, 24dvh, 190px);
  min-height: 0;
  border: 4px solid var(--line);
  border-radius: 14px;
  background: #111;
}

.phone-photo-capture {
  height: clamp(250px, 44dvh, 390px);
}

.phone-photo-instructions h2 {
  font-size: clamp(22px, 6vw, 30px);
}

.phone-photo-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.phone-photo-actions .button:only-child {
  grid-column: 1 / -1;
}

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

.phone-emoji-option {
  display: grid;
  place-items: center;
  min-height: 64px;
  border: 4px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 4px 4px 0 var(--line);
  cursor: pointer;
  font-size: 34px;
  line-height: 1;
  touch-action: manipulation;
}

.phone-emoji-option.selected {
  background: var(--yellow);
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--line);
}

.phone-turn-card {
  display: grid;
  gap: 5px;
  border: 4px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  padding: 8px 10px;
}

.phone-turn-card h2,
.phone-turn-card p {
  margin: 0;
}

.phone-turn-card h2 {
  font-size: clamp(22px, 6.5vw, 30px);
  line-height: 1;
}

.phone-turn-card p {
  font-size: 15px;
  font-weight: 900;
  line-height: 1.18;
}

.phone-suggestion-card,
.phone-correction-card {
  display: grid;
  gap: 3px;
  border: 4px solid var(--line);
  border-radius: 14px;
  padding: 7px 10px;
}

.phone-suggestion-card {
  background: rgba(147, 197, 253, 0.86);
}

.phone-correction-card {
  background: rgba(167, 243, 208, 0.88);
}

.phone-ended-card {
  display: grid;
  gap: 8px;
  border: 4px solid var(--line);
  border-radius: 14px;
  background: rgba(167, 243, 208, 0.9);
  padding: 14px;
}

.phone-suggestion-card strong,
.phone-correction-card strong,
.phone-ended-card strong {
  margin: 0;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.phone-suggestion-card .hint-line,
.phone-correction-card p {
  margin: 0;
  font-size: clamp(14px, 4.1vw, 17px);
  font-weight: 800;
  line-height: 1.06;
}

.phone-correction-card .phone-transcript,
.phone-correction-card .phone-feedback {
  color: var(--muted);
}

.phone-ended-card p {
  margin: 0;
  font-size: clamp(18px, 5vw, 22px);
  font-weight: 900;
  line-height: 1.12;
}

.phone-host-guest-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(96px, 118px);
  gap: 10px;
  align-items: center;
  border: 4px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  padding: 8px 10px;
}

.phone-host-guest-card.is-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.phone-host-guest-card > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.phone-host-guest-card strong,
.phone-host-guest-card span,
.phone-host-guest-card p {
  margin: 0;
}

.phone-host-guest-card strong {
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.phone-host-guest-card span {
  width: max-content;
  max-width: 100%;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: var(--yellow);
  padding: 3px 9px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.phone-host-guest-card p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.08;
}

.phone-host-guest-card img {
  width: 100%;
  aspect-ratio: 1;
  border: 3px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 6px;
}

.phone-waiting-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 4px;
}

.phone-waiting-actions .button {
  min-height: 40px;
  padding: 7px 8px;
  font-size: 13px;
  line-height: 1.05;
}

.phone-invite-panel {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.phone-invite-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.phone-invite-actions .button {
  display: grid;
  place-items: center;
  min-height: 40px;
  padding: 7px 8px;
  font-size: 13px;
  line-height: 1;
  text-align: center;
  text-decoration: none;
}

.phone-invite-actions a[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.48;
}

.phone-invite-qr {
  display: block;
  width: min(100%, 160px) !important;
  aspect-ratio: 1;
  justify-self: center;
  border: 3px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 6px;
}

.phone-invite-feedback {
  overflow-wrap: anywhere;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
}

.phone-solo-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 7px 12px;
  border: 4px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  padding: 8px 10px;
}

.phone-solo-strip > strong {
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
}

.phone-inline-action {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  touch-action: manipulation;
}

.phone-solo-strip .phone-invite-panel {
  flex-basis: 100%;
}

.phone-solo-strip .phone-invite-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.phone-host-palito-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 4px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  padding: 8px 10px;
}

.phone-host-palito-card.has-correction {
  background: rgba(255, 255, 255, 0.94);
}

.phone-host-palito-head {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.phone-host-palito-card div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.phone-host-palito-card strong,
.phone-host-palito-card span,
.phone-host-palito-card p,
.phone-host-palito-card small {
  margin: 0;
}

.phone-host-palito-card strong {
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.phone-host-palito-card span {
  width: max-content;
  max-width: 100%;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: var(--yellow);
  padding: 3px 9px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.phone-host-palito-card p,
.phone-host-palito-card small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.08;
}

.phone-host-palito-card small {
  overflow-wrap: anywhere;
}

.phone-join-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.phone-join-actions .button {
  min-height: 52px;
  font-size: clamp(20px, 6vw, 28px);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.phone-host-primary-actions .button {
  min-height: 58px;
}

.phone-input-mode-toggle {
  min-height: 42px;
  padding: 7px 12px;
  font-size: 15px;
  touch-action: manipulation;
}

.phone-write-mode {
  display: grid;
  gap: 7px;
  border: 4px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  padding: 9px 10px;
}

.phone-write-mode label {
  font-size: 15px;
  font-weight: 900;
}

.phone-write-mode textarea {
  width: 100%;
  min-height: 82px;
  resize: vertical;
  border: 3px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
}

.phone-write-mode textarea::placeholder {
  color: #4c4a45;
  opacity: 1;
}

.phone-write-mode .button {
  min-height: 46px;
  font-size: 17px;
}

.phone-takeover-note {
  border: 3px solid var(--line);
  border-radius: 10px;
  background: var(--yellow);
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.1;
}

.phone-host-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.phone-host-controls .button {
  min-height: 44px;
  padding: 8px 10px;
  font-size: 15px;
  line-height: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.phone-operation-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 8px;
  align-items: center;
  border: 4px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  padding: 8px 10px;
}

.phone-operation-status strong,
.phone-operation-status p {
  margin: 0;
}

.phone-operation-status strong {
  font-size: 17px;
  line-height: 1;
}

.phone-operation-status p {
  grid-column: 2;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.05;
}

.phone-operation-status.ready p,
.phone-operation-status.done p,
.phone-operation-status.waiting p {
  display: none;
}

.phone-operation-status.ready .phone-status-dot,
.phone-operation-status.done .phone-status-dot,
.phone-operation-status.waiting .phone-status-dot {
  grid-row: 1;
}

.phone-status-dot {
  grid-row: 1 / span 2;
  width: 16px;
  height: 16px;
  border: 3px solid var(--line);
  border-radius: 50%;
  background: var(--green);
}

.phone-operation-status.recording .phone-status-dot,
.phone-operation-status.busy .phone-status-dot {
  animation: pulse-dot 0.8s ease-in-out infinite alternate;
}

.phone-operation-status.recording .phone-status-dot {
  background: var(--red);
}

.phone-operation-status.busy .phone-status-dot {
  background: var(--yellow);
}

@keyframes pulse-dot {
  from {
    transform: scale(0.82);
  }
  to {
    transform: scale(1.15);
  }
}

.teacher-feedback {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  border-top: 3px solid rgba(0, 0, 0, 0.18);
  padding-top: 10px;
}

.teacher-feedback strong {
  margin: 0;
  font-size: 16px;
}

.student-card.active {
  background: #fff;
  box-shadow: 0 0 0 7px var(--yellow);
}

.student-card h2 {
  max-width: 100%;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(24px, 2.6vw, 36px);
  line-height: 1.02;
}

.student-card p {
  margin: 0;
  color: var(--muted);
  font-size: 20px;
  font-weight: 900;
}

.turn-board {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.mission {
  border: 3px dashed var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 16px;
}

.mission h2,
.mission p {
  margin: 0;
}

.mission h2 {
  font-size: 18px;
  line-height: 1.1;
  text-transform: uppercase;
}

.mission p {
  margin-top: 10px;
  font-size: clamp(21px, 2.3vw, 28px);
  line-height: 1.13;
}

.suggestion,
.correction,
.speech-review {
  border: 4px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}

.suggestion {
  background: rgba(147, 197, 253, 0.85);
}

.correction {
  background: rgba(167, 243, 208, 0.85);
}

.speech-review {
  background: rgba(255, 255, 255, 0.9);
}

.suggestion strong,
.correction strong,
.speech-review strong {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
  text-transform: uppercase;
}

.suggestion p,
.correction p,
.speech-review p {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 30px);
  line-height: 1.15;
}

.correction .teacher-feedback strong {
  margin: 0;
  font-size: 16px;
}

.correction .teacher-feedback p {
  font-size: clamp(18px, 2vw, 24px);
}

.speech-review p {
  color: var(--muted);
}

.hint-line {
  display: block;
  margin: 0;
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 400;
  line-height: 1.12;
}

.hint-text {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  font: inherit;
  font-weight: 400;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.tooltip-term {
  position: relative;
}

.tooltip-term::after {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 20;
  max-width: min(280px, 70vw);
  transform: translateX(-50%) translateY(4px);
  border: 3px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--line);
  color: var(--ink);
  content: attr(data-translation);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.15;
  opacity: 0;
  padding: 8px 10px;
  pointer-events: none;
  text-align: center;
  text-transform: none;
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: normal;
  width: max-content;
}

.tooltip-term:hover::after,
.tooltip-term:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.english-term {
  font-weight: 900;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.hint-text:hover,
.hint-text:focus-visible {
  color: #0f4f8f;
}

.hint-separator {
  color: var(--muted);
}

.translation-popover {
  margin-top: 10px;
  border: 3px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  padding: 12px;
}

.translation-popover strong,
.translation-popover span {
  display: block;
}

.translation-popover strong {
  margin-bottom: 4px;
  font-size: 20px;
  text-transform: none;
}

.translation-popover span {
  color: #2d2a26;
  font-size: clamp(18px, 2vw, 25px);
  font-weight: 900;
  line-height: 1.12;
}

.summary-lines {
  margin: 0;
  padding-left: 24px;
}

.summary-lines li + li {
  margin-top: 6px;
}

.vocabulary-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.vocabulary-list div {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 10px;
}

.vocabulary-list dt,
.vocabulary-list dd {
  margin: 0;
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.1;
}

.vocabulary-list dt {
  font-weight: 900;
}

.correction-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  font-size: clamp(19px, 2.1vw, 28px);
  line-height: 1.14;
}

.correction-line + .correction-line {
  margin-top: 10px;
}

.correction-line-note {
  grid-template-columns: minmax(0, 1fr);
}

.correction-phrase {
  display: inline;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: help;
  font: inherit;
  font-weight: inherit;
  padding: 0;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.correction-phrase.tooltip-term::after {
  max-width: min(420px, 82vw);
  text-align: left;
}

.write-mode {
  display: grid;
  gap: 10px;
  border: 4px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  padding: 14px;
}

.write-mode label {
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
}

.write-mode textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border: 3px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  font-size: clamp(20px, 2.2vw, 30px);
  line-height: 1.16;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 3px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.icon-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.mic-area {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.mic-button {
  min-height: 82px;
  background: var(--yellow);
  font-size: clamp(28px, 3.8vw, 48px);
}

.mic-button:hover,
.mic-button:focus-visible {
  transform: none;
  box-shadow: 5px 5px 0 var(--line);
  filter: brightness(0.98);
}

.audio-status {
  min-height: 46px;
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 8px 14px;
  font-size: 18px;
  font-weight: 900;
}

.audio-status:not(.recording) {
  grid-template-columns: 1fr;
}

.audio-status.recording {
  background: rgba(252, 165, 165, 0.56);
}

.volume-meter {
  height: 20px;
  overflow: hidden;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.volume-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--yellow);
  transition: width 0.12s linear;
}

.activity-actions .button {
  min-height: 52px;
  font-size: 19px;
  padding: 10px 14px;
}

.activity-teacher {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.activity-teacher .teacher-avatar {
  height: 190px;
}

.activity-teacher .teacher-head {
  width: 124px;
  height: 124px;
}

.activity-teacher .teacher-body {
  top: 100px;
  width: 48px;
  height: 50px;
}

.activity-teacher .teacher-arm {
  top: 118px;
  width: 40px;
  height: 8px;
}

.activity-teacher .teacher-leg {
  top: 148px;
  height: 34px;
}

.activity-teacher .arm-left {
  transform: translateX(-60px) rotate(-24deg);
}

.activity-teacher .arm-right {
  transform: translateX(20px) rotate(24deg);
}

.activity-teacher .leg-left {
  transform: translateX(-16px) rotate(2deg);
}

.activity-teacher .leg-right {
  transform: translateX(8px) rotate(-2deg);
}

.activity-speech h3,
.activity-speech p {
  margin: 0;
}

.activity-speech h3 {
  font-size: 24px;
}

.activity-speech p {
  margin-top: 8px;
  font-size: clamp(22px, 2.6vw, 34px);
  line-height: 1.12;
}

.summary-list {
  display: grid;
  gap: 12px;
  max-width: 850px;
}

.study-summary,
.phone-room-ended {
  justify-content: flex-start;
}

.notebook-library {
  justify-content: flex-start;
}

.notebook-mode .teacher-panel {
  width: min(300px, 26vw);
}

.notebook-grid {
  max-width: 980px;
}

.notebook-situation-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 980px;
}

.notebook-situation-card {
  min-height: 0;
  padding: 16px;
}

.notebook-viewer {
  max-width: 1080px;
}

.study-notebook-heading {
  display: grid;
  gap: 8px;
}

.study-notebook-heading .title {
  font-size: clamp(42px, 5.2vw, 72px);
}

.notebook-meta {
  width: fit-content;
  max-width: 100%;
  margin: 0;
  border: 4px solid var(--line);
  border-radius: 12px;
  background: var(--yellow);
  padding: 8px 12px;
  color: var(--ink);
  font-size: clamp(16px, 1.7vw, 22px);
  font-weight: 900;
  line-height: 1.15;
}

.notebook-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  max-width: 760px;
}

.notebook-controls label {
  display: grid;
  min-width: min(100%, 240px);
  gap: 6px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
}

.notebook-controls select {
  min-height: 52px;
  border: 4px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-size: 22px;
  font-weight: 900;
  padding: 8px 12px;
}

.inline-loading {
  width: min(100%, 560px);
  position: static;
}

.study-notebook {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 980px;
}

.phone-join-screen .study-notebook {
  grid-template-columns: 1fr;
}

.study-section {
  min-width: 0;
  border: 4px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  padding: 18px;
}

.study-section:nth-child(1) {
  background: rgba(147, 197, 253, 0.82);
}

.study-section:nth-child(2) {
  background: rgba(167, 243, 208, 0.84);
}

.study-section:nth-child(3) {
  background: rgba(255, 227, 110, 0.76);
}

.study-section:nth-child(4) {
  background: rgba(255, 255, 255, 0.92);
}

.study-section h3 {
  margin: 0 0 14px;
  border-left: 8px solid var(--line);
  padding-left: 10px;
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 1000;
  line-height: 0.95;
}

.study-section p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  font-weight: 900;
}

.study-vocabulary-list,
.study-list {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.study-vocabulary-list div,
.study-list li {
  display: grid;
  gap: 6px;
  min-width: 0;
  border-top: 2px solid rgba(35, 33, 29, 0.18);
  padding-top: 12px;
}

.study-vocabulary-list div:first-child,
.study-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.study-vocabulary-list dt,
.study-vocabulary-list dd {
  margin: 0;
}

.study-vocabulary-list dt,
.study-list b {
  color: var(--ink);
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 900;
  line-height: 1.12;
}

.study-vocabulary-list dt span {
  color: #2d2a26;
}

.study-vocabulary-list dd,
.study-list span {
  color: #2d2a26;
  font-size: clamp(18px, 1.7vw, 24px);
  font-weight: 800;
  line-height: 1.22;
}

.study-vocabulary-list dd {
  display: grid;
  gap: 4px;
}

.study-phrase {
  color: var(--ink) !important;
  font-weight: 900 !important;
}

.study-translation {
  color: var(--muted) !important;
  font-weight: 850 !important;
}

.summary-box h3,
.summary-box p {
  margin: 0;
}

.summary-box h3 {
  font-size: 28px;
}

.summary-box p {
  margin-top: 8px;
  font-size: 22px;
}

.difficulty-picker {
  max-width: 850px;
  border: 4px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 250, 240, 0.9);
  padding: 14px;
}

.confirm-view {
  justify-content: flex-start;
  gap: 12px;
}

.confirm-view .title {
  font-size: clamp(42px, 5.4vw, 70px);
}

.confirm-view .summary-list,
.confirm-view .difficulty-picker {
  max-width: 920px;
}

.confirm-view .summary-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.confirm-view .summary-box {
  padding: 12px;
}

.confirm-view .summary-box h3 {
  font-size: 22px;
}

.confirm-view .summary-box p {
  margin-top: 4px;
  font-size: 18px;
}

.difficulty-picker h3 {
  margin: 0 0 10px;
  font-size: 26px;
}

.difficulty-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.role-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.role-preview-item {
  border: 3px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px;
}

.role-preview-item strong,
.role-preview-item span {
  display: block;
}

.role-preview-item strong {
  font-size: 22px;
}

.role-preview-item span {
  color: var(--muted);
  font-size: 18px;
  font-weight: 900;
  margin-top: 2px;
}

.role-swap-button {
  margin-top: 10px;
}

.difficulty-options.level-options {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.difficulty-option {
  min-height: 92px;
  border: 3px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  padding: 12px;
  text-align: left;
}

.difficulty-option.selected {
  background: var(--green);
  box-shadow: inset 0 0 0 4px #fff;
}

.difficulty-option.joke {
  background: rgba(252, 165, 165, 0.32);
}

.difficulty-option strong,
.difficulty-option span {
  display: block;
}

.difficulty-option strong {
  font-size: 22px;
  line-height: 1.02;
}

.difficulty-option span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.12;
}

.loading-backdrop {
  position: fixed;
  inset: 0;
  z-index: 18;
  display: grid;
  place-items: center;
  background: rgba(255, 252, 244, 0.72);
  backdrop-filter: blur(2px);
  padding: 20px;
}

.loading-card {
  width: min(460px, 92vw);
  border: 5px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 8px 8px 0 var(--line);
  padding: 24px;
  text-align: center;
}

.loading-card h3 {
  margin: 10px 0 6px;
  font-size: clamp(30px, 4vw, 46px);
}

.loading-card p {
  margin: 0;
  color: var(--muted);
  font-size: 20px;
  font-weight: 800;
}

.loading-spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border: 5px solid rgba(35, 48, 68, 0.18);
  border-top-color: var(--line);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.38);
  padding: 20px;
}

.modal-card {
  width: min(560px, 92vw);
  border: 5px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 8px 8px 0 var(--line);
  padding: 24px;
}

.modal-card h2,
.modal-card p {
  margin: 0;
}

.modal-card h2 {
  font-size: clamp(34px, 4vw, 54px);
  line-height: 0.95;
}

.modal-card p {
  margin-top: 12px;
  color: #2d2a26;
  font-size: 24px;
  line-height: 1.18;
}

.modal-card .modal-detail {
  border: 3px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
  font-size: 21px;
  font-weight: 800;
  white-space: pre-line;
}

.modal-card .modal-copy-ok {
  display: inline-block;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: var(--green);
  padding: 8px 12px;
  font-size: 18px;
  font-weight: 900;
}

@media (max-width: 1180px) {
  .stage {
    min-height: auto;
  }

  .stage.situation-mode {
    display: block;
    padding: 0;
  }

  .teacher-panel {
    position: relative;
    inset: auto;
    width: auto;
    min-width: 0;
    margin: 14px;
    flex-direction: row;
    align-items: center;
  }

  .teacher-avatar {
    width: 160px;
    height: 260px;
  }

  .screen-card {
    width: 100%;
    min-height: auto;
    padding-top: 0;
  }

  .stage.situation-mode .teacher-panel {
    position: relative;
    inset: auto;
    width: auto;
    min-width: 0;
    margin: 14px;
    flex-direction: row;
    align-items: center;
  }

  .stage.situation-mode .teacher-avatar {
    width: 120px;
    height: 168px;
  }

  .stage.situation-mode .screen-card {
    width: 100%;
    padding-top: 0;
  }

  .stage.activity-mode .screen-card {
    padding-top: 10px;
  }

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

  .situation-subject-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .situation-workspace {
    grid-template-columns: 1fr;
  }

  .selected-situation-actions {
    min-width: 0;
  }
}

@media (max-width: 940px) {
  .activity {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .activity-header {
    order: 1;
  }

  .activity-teacher {
    order: 2;
  }

  .student-card {
    order: 3;
    min-height: 220px;
  }

  .turn-board {
    order: 4;
    grid-column: 1 / -1;
  }

  .difficulty-options {
    grid-template-columns: 1fr;
  }

  .difficulty-options.level-options,
  .confirm-view .summary-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .app-shell {
    padding: 8px;
  }

  .stage {
    min-height: calc(100vh - 16px);
    border-radius: 14px;
  }

  .teacher-panel {
    margin: 10px;
    padding: 12px;
  }

  .teacher-avatar {
    display: none;
  }

  .screen-card {
    padding: 10px;
  }

  .stage.phone-room-mode,
  .stage.phone-join-mode {
    min-height: calc(100dvh - 16px);
    overflow-y: auto;
  }

  .stage.phone-room-mode .screen-card,
  .stage.phone-join-mode .screen-card {
    min-height: calc(100dvh - 16px);
    padding: 8px;
  }

  .stage.phone-room-mode .phone-join-screen,
  .stage.phone-join-mode .phone-join-screen {
    min-height: calc(100dvh - 32px);
  }

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

  .activity-teacher .teacher-avatar {
    display: none;
  }

  .activity {
    gap: 10px;
  }

  .situation-view .title {
    font-size: 34px;
  }

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

  .situation-subject-grid,
  .situation-theme-grid,
  .situation-option-grid {
    grid-template-columns: 1fr;
  }

  .situation-list.grouped,
  .situation-list.focused,
  .selected-situation-actions {
    grid-template-columns: 1fr;
  }

  .situation-list.grouped {
    columns: 1;
  }

  .activity-header,
  .student-card,
  .turn-board,
  .summary-box,
  .activity-teacher {
    border-width: 3px;
    padding: 12px;
  }

  .student-card {
    min-height: 168px;
    gap: 8px;
  }

  .student-avatar {
    width: 76px;
    height: 76px;
    font-size: 30px;
  }

  .student-card h2 {
    font-size: 22px;
  }

  .student-card p {
    font-size: 16px;
  }

  .turn-board {
    gap: 12px;
  }

  .study-section,
  .notebook-controls select {
    border-width: 3px;
  }

  .study-section {
    padding: 14px;
  }

  .study-notebook {
    grid-template-columns: 1fr;
  }

  .suggestion p,
  .correction p,
  .speech-review p {
    font-size: 22px;
  }

  .mic-button {
    min-height: 72px;
    font-size: 30px;
  }
}
