/* Grade and subject navigation, with the full question as the reading surface. */
:root {
  --leaf: #2f8659;
  --ink: #403c32;
  --paper: #fffdf8;
  --line: #e5e5d8;
}
body {
  color: var(--ink);
  background: #f7f4e9;
}
main {
  max-width: 760px;
}
header {
  gap: 6px;
}
.brand {
  font-size: 16px;
  cursor: pointer;
}
header button {
  padding: 6px 9px;
  font-size: 13px;
}
#home {
  background: #eaf1e6;
  color: #41654e;
}
#stars {
  font-size: 16px;
  white-space: nowrap;
}
body[data-screen='menu'] .progress,
body[data-screen='menu'] #feedback,
body[data-screen='menu'] footer {
  display: none;
}
body[data-screen='menu'] #step {
  font-size: 12px;
  color: #807d6c;
  padding: 3px 0 6px;
}
#scene.learning-menu {
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--paper);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 18px;
  box-shadow: none;
  border: 1px solid var(--line);
  border-radius: 24px;
}
.learning-menu h1 {
  font-size: 26px;
  line-height: 1.35;
  text-align: left;
  letter-spacing: 0.02em;
}
.learning-menu h2 {
  font-size: 19px;
  text-align: left;
}
.menu-lead {
  font-size: 16px;
  line-height: 1.8;
  color: #787666;
}
.grade-grid,
.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.grade-card,
.mode-card {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: #eef4e7;
  border: 1px solid #dfe8d4;
  border-radius: 20px;
  padding: 22px 16px;
  min-height: 170px;
}
.grade-card:nth-child(2),
.mode-card:nth-child(2) {
  background: #fff2d6;
  border-color: #f0e2bd;
}
.grade-card > span {
  font-size: 44px;
}
.grade-card b {
  font-size: 26px;
}
.grade-card small,
.mode-card small {
  font-size: 13px;
  line-height: 1.6;
  color: #737461;
}
.mode-card {
  min-height: 135px;
  padding: 16px;
}
.mode-card > span {
  font-size: 27px;
}
.mode-card b {
  font-size: 19px;
}
.mode-card:nth-child(3) {
  background: #eaf0f6;
  border-color: #dde6ee;
}
.mode-card:nth-child(4) {
  background: #f1edf6;
  border-color: #e7def0;
}
.resume-card {
  background: #327953;
  color: white;
  text-align: left;
  font-size: 19px;
  font-weight: 700;
  border-radius: 17px;
  padding: 18px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}
.resume-card small {
  font-size: 13px;
  font-weight: 400;
  opacity: 0.9;
}
.course-secondary {
  background: #f3f2e9;
  min-height: 48px;
  padding: 12px;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid #e6e4d6;
  border-radius: 13px;
}
.menu-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.legacy-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.record-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  font-size: 13px;
  color: #787666;
}
.record-summary b {
  color: var(--leaf);
  font-size: 18px;
  margin: 0 3px;
}
.list-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.list-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  text-align: left;
  background: #f5f6ee;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 16px;
  min-height: 70px;
}
.list-card b {
  font-size: 17px;
  line-height: 1.5;
}
.list-card span {
  font-size: 12px;
  color: #7a7c69;
  flex-shrink: 0;
}
.menu-note {
  font-size: 13px;
  line-height: 1.8;
  color: #838070;
}
.legacy-select {
  font-size: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.legacy-select select {
  font: inherit;
  min-height: 48px;
  border: 1px solid var(--line);
  background: white;
  padding: 8px;
  border-radius: 10px;
  width: 100%;
}
.history-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.history-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.history-list small {
  font-size: 11px;
  flex-shrink: 0;
  color: #7c816b;
}
.lesson-notes {
  font-size: 17px;
  line-height: 1.85;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.finish-stars {
  font-size: 50px;
  text-align: center;
  padding: 15px;
}
.storage-notice {
  display: none;
  color: #9a6a23;
  font-size: 13px;
}
.storage-unavailable .storage-notice {
  display: block;
}
#scene.question-scene.course-question {
  gap: 18px;
}
#scene.course-question h2 {
  font-size: 18px;
  display: block;
  color: #78816b;
  text-align: left;
}
#scene.course-question .prompt {
  font-size: 20px;
  line-height: 1.8;
  text-align: left;
  max-width: none;
}
#scene.question-scene.course-question .visual:not(:empty) {
  flex: 0 0 auto;
  min-height: 0;
  max-height: none;
  height: auto;
  display: block;
  overflow: visible;
}
#scene.course-question .visual:empty {
  display: none;
}
.course-emoji {
  font-size: 70px;
  text-align: center;
}
.stroke-words {
  font-size: 74px;
  text-align: center;
  font-family: 'Kaiti SC', STKaiti, KaiTi, serif;
}
.reading-material {
  padding: 18px;
  background: #f8f6ee;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}
.reading-material h3 {
  font-size: 22px;
  margin: 0;
}
.reading-material p {
  font-size: 19px;
  line-height: 1.9;
  text-indent: 2em;
  white-space: pre-wrap;
}
.material-listen {
  align-self: flex-start;
  background: #e7eeda;
  border-radius: 12px;
  padding: 10px 15px;
  font-size: 15px;
}
.course-choices {
  grid-template-columns: 1fr;
  gap: 11px;
  flex-shrink: 0;
}
.course-option {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.course-choice {
  width: 100%;
  text-align: left;
  justify-content: flex-start;
  min-height: 60px;
  font-size: 22px;
  font-weight: 600;
  padding: 14px 16px;
  line-height: 1.65;
  background: #f3f4e9;
}
.course-option .option-listen {
  flex: 0 0 44px;
}
.course-choice.selected {
  border-color: #448961;
  background: #e9f2dc;
}
.course-controls {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-shrink: 0;
}
.course-controls button {
  padding: 12px 18px;
  min-height: 52px;
  font-size: 17px;
  background: #ecf0e1;
}
.course-controls .course-submit {
  background: #327953;
  color: white;
  font-weight: 700;
}
.course-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}
.course-fields label {
  font-size: 17px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f5f6ee;
  padding: 12px;
  border-radius: 12px;
}
.course-fields input,
.course-fields select {
  width: 100px;
  max-width: 45%;
  min-height: 48px;
  flex-shrink: 0;
  border: 2px solid #cad8b9;
  border-radius: 10px;
  background: white;
  font: inherit;
  font-size: 23px;
  padding: 6px;
  text-align: center;
  color: var(--ink);
}
.course-order {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  flex-shrink: 0;
}
.order-item {
  padding: 10px;
  background: #f4f4e8;
  min-height: 85px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 18px;
  border: 2px solid transparent;
}
.order-item img {
  width: 100%;
  height: auto;
}
.order-number {
  font-size: 16px;
  line-height: 1.7;
  padding: 2px 10px;
  background: white;
  border-radius: 8px;
}
.order-item[aria-pressed='true'] {
  border-color: #448961;
  background: #e7efd9;
}
.order-result {
  font-size: 15px;
  line-height: 1.7;
  color: #727d63;
}
.course-cells,
.course-route {
  display: grid;
  grid-template-columns: repeat(var(--size), 1fr);
  gap: 3px;
  width: 100%;
  max-width: 420px;
  margin: auto;
  flex-shrink: 0;
}
.course-cell,
.route-cell {
  aspect-ratio: 1;
  min-height: 0;
  min-width: 0;
  padding: 3px;
  border-radius: 4px;
  border: 2px solid #a2b08e;
  background: #fffef8;
  font-size: 28px;
}
.course-cell.yellow {
  background: #ffe187;
}
.course-cell[aria-pressed='true'] {
  border-color: #d44949;
  color: #b83535;
  font-size: 34px;
}
.route-cell {
  font-size: 21px;
  word-break: break-all;
  line-height: 1.1;
  background: #faf8e7;
}
.route-cell.visited {
  background: #d9ebc8;
}
.route-cell.current {
  border: 3px solid #3b8860;
}
@media (max-width: 350px) {
  #scene.learning-menu {
    padding: 20px 14px;
    gap: 15px;
  }
  .learning-menu h1 {
    font-size: 23px;
  }
  .grade-card {
    padding: 17px 12px;
  }
  .grade-card small {
    font-size: 12px;
  }
  .mode-grid {
    gap: 10px;
  }
  .mode-card {
    padding: 13px;
    min-height: 128px;
  }
  .mode-card b {
    font-size: 17px;
  }
  .mode-card small {
    font-size: 12px;
  }
  .list-card {
    padding: 13px;
    gap: 8px;
  }
  .list-card b {
    font-size: 16px;
  }
  .list-card span {
    font-size: 11px;
  }
  .brand {
    font-size: 14px;
  }
  header button {
    font-size: 11px;
    padding: 6px;
  }
  #scene.course-question .prompt {
    font-size: 18px;
  }
  .course-choice {
    font-size: 19px;
  }
  .reading-material {
    padding: 14px;
  }
  .reading-material p {
    font-size: 18px;
  }
  .route-cell {
    font-size: 17px;
  }
  .course-fields label {
    font-size: 16px;
  }
}
.transition-prices {
  display: flex;
  gap: 20px;
  justify-content: center;
  padding: 18px;
  font-size: 20px;
  flex-wrap: wrap;
}
.transition-shapes,
.transition-frames {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  text-align: center;
}
.transition-shapes svg,
.transition-frames svg {
  width: 100%;
  height: auto;
}
.transition-shapes p,
.transition-frames p {
  font-size: 15px;
}
.course-choice-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.course-choice-grid .course-choice {
  padding: 8px;
  display: block;
}
.course-choice-grid svg {
  height: auto;
  width: 100%;
  max-height: 160px;
}
.question-source {
  font-size: 12px;
  line-height: 1.5;
  color: #88907b;
  flex-shrink: 0;
}
.answer-explanation {
  display: block;
  background: #eef7ea;
  border: 1px solid #a9c997;
  border-radius: 16px;
  padding: 14px 16px;
  margin: 12px 0;
  font-size: 19px;
  line-height: 1.65;
  color: #334c30;
  text-align: left;
  white-space: normal;
}
.paper-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.paper-actions button {
  min-height: 46px;
  padding: 10px 20px;
  border: 1px solid #b7c9a5;
  border-radius: 12px;
  background: #edf4df;
  color: #354b30;
  font: inherit;
  font-weight: 700;
}
body[data-mode='exam'] .choice.correct,
body[data-mode='exam'] .choice.wrong {
  background: #fff3d6;
  border-color: transparent;
  color: inherit;
}
/* Picture choices carry the answer meaning; names remain accessible to screen readers. */
.course-choices:has(.picture-choice) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.course-option {
  min-width: 0;
}
.picture-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 150px;
  padding: 14px;
  width: 100%;
  height: 100%;
}
.picture-choice img,
.picture-choice svg {
  display: block;
  max-width: 100%;
  width: 100%;
  height: 140px;
  object-fit: contain;
}
.picture-choice:has(.visual-number) img {
  width: 60%;
}
.visual-number {
  font-size: 32px;
  white-space: nowrap;
}
.field-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.palette-option {
  background: white;
  border: 3px solid #d4dacc;
  border-radius: 16px;
  padding: 4px;
  width: 76px;
  height: 76px;
}
.palette-option svg {
  width: 100%;
  height: 100%;
}
.palette-option[aria-pressed='true'] {
  border-color: #277c50;
  box-shadow: 0 0 0 3px #a7d6b5;
}
.course-fields label {
  min-width: 0;
}
.order-item img {
  object-fit: contain;
}
@media (max-width: 480px) {
  .picture-choice {
    min-height: 125px;
    padding: 10px;
  }
  .picture-choice img,
  .picture-choice svg {
    height: 110px;
  }
  .palette-option {
    width: 64px;
    height: 64px;
  }
}
.picture-choice img.piece-pair {
  width: 45%;
}
.picture-choice img.rope-option {
  height: 45px;
  object-fit: fill;
}
.picture-choice:has(.picture-caption) {
  flex-direction: column;
}
.picture-caption {
  font-size: 20px;
}
/* Each isolated SVG is clipped to its own viewport, including Safari/iPad. */
.course-question svg,
.course-question .picture-choice svg {
  overflow: hidden;
}
.field-palette img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.picture-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
  width: 100%;
}
.picture-field {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 2px solid transparent;
  border-radius: 16px;
  background: #f4f5ec;
  padding: 10px;
  min-height: 76px;
}
.picture-field.active {
  border-color: #7f9c78;
}
.field-condition {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}
.field-condition svg {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}
.field-condition .sign-target {
  width: 130px;
  height: 64px;
  object-fit: contain;
}
.field-operator,
.mix-plus {
  font-size: 28px;
  color: #526358;
}
.field-result {
  width: 58px;
  height: 58px;
  min-width: 58px;
  min-height: 58px;
  border: 3px dashed #80967c;
  border-radius: 50%;
  background: #fff;
  font-size: 30px;
  padding: 0;
}
.field-result svg,
.field-result img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.field-result.filled {
  border-style: solid;
}
.shared-palette {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 8px;
  border-radius: 14px;
  background: #edf2e6;
}
.shared-palette[hidden] {
  display: none;
}
.shared-palette .palette-option {
  width: 48px;
  height: 48px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
}
.sequence-target {
  font-size: 23px;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .picture-field {
    gap: 8px;
    padding: 8px;
  }
  .field-condition svg {
    width: 43px;
    height: 48px;
  }
  .field-result {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
  }
  .shared-palette {
    gap: 5px;
    display: grid;
    grid-template-columns: repeat(3, 48px);
  }
  .field-condition .sign-target {
    width: 112px;
  }
}
.field-condition > svg:only-child {
  width: 100px;
  height: 76px;
}

.xes-option-picture {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
}
.xes-option-picture svg {
  display: block;
  width: 100%;
  max-height: 190px;
  height: auto;
}
.xes-option-picture img {
  object-fit: contain;
  max-width: 100%;
  height: auto;
}
.shared-palette.detailed-palette {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  gap: 6px;
}
.shared-palette.detailed-palette .palette-option {
  width: 72px;
  height: 72px;
}
.detailed-palette svg {
  width: 100%;
  height: 100%;
}
.field-condition .xes-field-image {
  width: 76px;
  height: 76px;
  object-fit: contain;
}
.field-condition .xes-workflow {
  width: 160px;
  height: auto;
  max-width: 100%;
}
.field-condition .xes-workflow svg {
  width: 160px;
  height: 65px;
}
.field-condition:has(.xes-workflow) {
  min-width: 0;
}
.field-condition .xes-workflow img {
  width: 100%;
  height: auto;
}

.shared-palette.detailed-palette[hidden] {
  display: none;
}

/* A missing answer is an instruction, not a wrong attempt. */
.answer-required {
  margin: 0;
  color: #685222;
  text-align: center;
  font-size: 17px;
}
.answer-required:empty {
  display: none;
}
#scene.course-question .course-option .option-listen {
  min-width: 44px;
  min-height: 44px;
}

.exam-choice-mode .course-choice.selected {
  border-color: #316792;
  background: #e5eff8;
}

.source-challenge {
  display: inline-block;
  margin-inline-start: 0.5em;
  padding: 1px 0.55em;
  border-radius: 999px;
  background: #ffead6;
  color: #824316;
  font-weight: 750;
  white-space: nowrap;
}
.school-sequence {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-wrap: nowrap;
}
.school-sequence > span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.school-sequence img,
.school-sequence svg {
  display: block;
  width: 100%;
  max-width: 65px;
  height: auto;
  object-fit: contain;
}
.school-empty-circle {
  display: block;
  width: 32px;
  height: 32px;
  border: 2px solid #717e78;
  border-radius: 50%;
}
.school-groups,
.school-peach-box {
  display: grid;
  gap: 6px;
}
.school-plate {
  display: flex;
  border-radius: 50%;
  background: #dcebf6;
}
.school-peaches {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.school-peaches > span {
  white-space: nowrap;
}
.school-peach-box {
  padding: 5px;
  background: #eddbbe;
  border-radius: 6px;
}
.school-board-panel {
  display: grid;
  gap: 9px;
}
.school-palette {
  justify-content: center;
  margin: 5px 0;
}
.school-palette .palette-option {
  width: 55px;
  height: 55px;
}
.school-palette .palette-option img,
.route-cell img,
.school-chart-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.school-palette .palette-option.placed {
  opacity: 0.65;
}
.school-region-grid {
  max-width: 265px;
}
.school-region {
  padding: 3px;
  background: #fff8e7;
}
.school-region img {
  width: 70%;
  height: 70%;
  object-fit: contain;
}
.school-region[data-color='0'] {
  background: #f2a5ac;
}
.school-region[data-color='1'] {
  background: #f6db82;
}
.school-region[data-color='2'] {
  background: #a8d6b2;
}
.school-region[data-color='3'] {
  background: #a6c9ef;
}
.school-tangram {
  display: block;
  width: 100%;
  max-height: 270px;
}
.school-tangram polygon {
  stroke: #5f594d;
  stroke-width: 1.5;
  stroke-linejoin: round;
}
.school-tangram polygon[role='button'] {
  cursor: pointer;
}
.school-tangram polygon[aria-pressed='true'],
.school-tangram polygon:focus-visible {
  stroke: #114f78;
  stroke-width: 4;
  outline: none;
}
.school-board-status {
  text-align: center;
  font-size: 0.9rem;
  margin: 0;
}
.school-chart {
  display: grid;
  grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
  gap: 8px;
  max-width: 290px;
  width: 100%;
  margin: auto;
}
.school-chart-column,
.school-chart-cells {
  display: grid;
  justify-items: stretch;
  gap: 2px;
}
.school-chart-cells {
  touch-action: manipulation;
}
.school-chart-column {
  text-align: center;
  font-size: 20px;
  font-weight: 750;
}
.school-chart-cell {
  min-height: 25px;
  padding: 0;
  border: 1px solid #7f927b;
  border-radius: 2px;
  background: #fff7ea;
}
.school-chart-cell.colored {
  background: #599eb8;
}
.school-chart-column:nth-child(2) .school-chart-cell.colored {
  background: #c87554;
}
.school-chart-column:nth-child(3) .school-chart-cell.colored {
  background: #708ccb;
}
.school-chart-column:nth-child(4) .school-chart-cell.colored {
  background: #72a66d;
}
.school-chart-icon {
  height: 38px;
  margin: 3px auto 0;
  min-width: 29px;
}
.school-pin-board {
  position: relative;
  width: min(100%, 350px);
  margin: auto;
}
.school-pin-board > svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
}
.school-pin {
  position: absolute;
  width: 8.2%;
  min-width: 22px;
  aspect-ratio: 1;
  min-height: 0;
  transform: translate(-50%, -50%);
  padding: 0;
  border: 1px solid #79756e;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff8ed;
  font-size: 14px;
  font-weight: 750;
}
.school-pin:active {
  transform: translate(-50%, -50%);
}
.school-pin[aria-pressed='true'] {
  border-color: #226d61;
  box-shadow: 0 0 0 2px #76bdab;
}
.school-pin svg,
.school-pin img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.photo-route {
  position: relative;
  width: min(100%, 410px);
  margin: auto;
}
.photo-route > img,
.photo-route > svg {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  pointer-events: none;
}
.photo-route > svg path {
  stroke: #5a33ad;
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.photo-route-node {
  position: absolute;
  width: 12%;
  aspect-ratio: 1;
  min-height: 0;
  padding: 0;
  transform: translate(-50%, -50%);
  border: 2px solid transparent;
  border-radius: 50%;
  background: transparent;
  touch-action: manipulation;
}
.photo-route-node:active {
  transform: translate(-50%, -50%);
}
.photo-route-node[aria-current='true'] {
  border-color: #572ca8;
  background: #723dcc21;
}
.photo-route-node.visited:not([aria-current='true']) {
  border-color: #572ca858;
}
.photo-route-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 5px;
  font-size: 13px;
}
.photo-route-footer button {
  min-height: 40px;
  padding: 5px 12px;
}
.school-pin-board > img {
  display: block;
  width: 100%;
  height: auto;
}
.pirate-pin-color {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

/* Round rewards: badge shelf on Today, earned badge on the result page,
   a midpoint cheer overlay and a one-time rest prompt. */
.badge {
  width: 34px;
  height: 34px;
  flex: none;
}
.badge-shelf {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 10px 0 0;
  font-size: 14px;
  color: #6b4a2f;
}
.badge-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.result-badge {
  width: 84px;
  height: 84px;
}
.rest-icons {
  font-size: 34px;
  letter-spacing: 6px;
}
.badge-earned {
  margin: 6px 0 14px;
  font-size: 15px;
  color: #8a5a16;
}
.mid-cheer {
  position: fixed;
  inset: max(72px, env(safe-area-inset-top)) 8px auto;
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 60;
}
.mid-cheer-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 20px;
  border-radius: 8px;
  background: #fff7e8f0;
  box-shadow: 0 4px 16px #8a5a1624;
  font-size: 16px;
  color: #7a4a12;
  animation: mid-cheer-pop 1.6s ease both;
}
.mid-cheer-stars {
  font-size: 22px;
  color: #f4a300;
  letter-spacing: 0;
}
@keyframes mid-cheer-pop {
  0% {
    opacity: 0;
    transform: scale(0.6) translateY(20px);
  }
  15% {
    opacity: 1;
    transform: translateY(0);
  }
  25% {
    transform: translateY(0);
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-8px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .mid-cheer-card {
    animation: none;
    opacity: 0;
  }
}
.rest-banner {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: #1d27304d;
  z-index: 70;
}
.rest-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(340px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 20px;
  border-radius: 8px;
  background: #fff;
  text-align: center;
  color: #25313b;
}
.rest-card b {
  font-size: 20px;
}
.rest-actions {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}
.rest-card button {
  min-height: 48px;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  background: #246b59;
  color: #fff;
  font-size: 16px;
}
.rest-card .rest-stop {
  border: 1px solid #c8d0d5;
  background: #fff;
  color: #25313b;
}
