/* 자체 동봉 픽셀 폰트 (제목 전용) — OFL-1.1, 라이선스: fonts/LICENSE-OFL.md */
@font-face {
  font-family: Galmuri14;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local("Galmuri14"), url("./fonts/Galmuri14.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --ink: #07111f;
  --muted: #334155;
  --paper: #eef8f0;
  --panel: #fffef7;
  --line: #6b7a63;
  --blue: #004fc4;
  --green: #087443;
  --yellow: #ffcf33;
  --coral: #c51f1a;
  --navy: #061a36;
  --focus: #111827;
  --shadow: 0 10px 0 rgba(26, 46, 20, 0.14), 0 18px 40px rgba(12, 23, 45, 0.12);
  /* 블록 놀이 톤 (자체 디자인, 외부 게임 명칭·텍스처 없음) */
  --sky: #9fd3ff;
  --sky-soft: #d6efff;
  --grass: #6abe30;
  --grass-deep: #4e8c22;
  --dirt: #a67c2a;
  --dirt-light: #e8d5a3;
  --block-edge: #2d3a24;
  --block-face: #f4f0e1;
  --voxel-hi: rgba(255, 255, 255, 0.55);
  --voxel-lo: rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Arial, "Noto Sans KR", sans-serif;
  /* 하늘 → 잔디 층: CSS만 (외부 텍스처 없음) */
  background-color: var(--sky-soft);
  background-image:
    linear-gradient(
      180deg,
      var(--sky) 0%,
      var(--sky-soft) 36%,
      transparent 36%
    ),
    repeating-linear-gradient(
      90deg,
      var(--grass) 0 32px,
      var(--grass-deep) 32px 64px
    ),
    linear-gradient(
      180deg,
      transparent 0 68%,
      var(--grass) 68%,
      var(--grass-deep) 100%
    );
  background-size: 100% 100%, 100% 22%, 100% 100%;
  background-position: 0 0, 0 100%, 0 0;
  background-repeat: no-repeat, repeat-x, no-repeat;
  color: var(--ink);
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 5px solid var(--focus);
  outline-offset: 4px;
}

.routine-btn:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 4px var(--focus);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 20px 8px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  color: var(--blue);
  font-family: Galmuri14, sans-serif;
  font-size: 15px;
  font-weight: 700;
}

.play-block {
  display: inline-block;
  flex: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--block-edge);
  border-radius: 2px;
  background: conic-gradient(
    from 90deg,
    var(--yellow) 0 25%,
    var(--blue) 0 50%,
    var(--grass) 0 75%,
    #ffffff 0 100%
  );
  box-shadow:
    inset 2px 2px 0 var(--voxel-hi),
    inset -2px -2px 0 var(--voxel-lo),
    2px 2px 0 var(--block-edge);
}

h1,
h2,
p {
  word-break: keep-all;
}

h1 {
  margin: 0;
  font-family: Galmuri14, sans-serif;
  font-size: 28px;
  line-height: 1.4;
}

h1::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  vertical-align: middle;
  background: #4fd1e3;
  clip-path: polygon(50% 0%, 100% 35%, 82% 100%, 18% 100%, 0% 35%);
  box-shadow:
    inset -2px -2px 0 rgba(0, 0, 0, 0.25),
    inset 2px 2px 0 rgba(255, 255, 255, 0.55);
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.status-strip span,
.sound-toggle {
  border: 3px solid var(--block-edge);
  border-radius: 3px;
  padding: 8px 11px;
  background: var(--block-face);
  color: #172033;
  font-size: 14px;
  font-weight: 900;
  box-shadow:
    inset 2px 2px 0 var(--voxel-hi),
    inset -2px -2px 0 var(--voxel-lo),
    0 3px 0 rgba(0, 0, 0, 0.2);
}

.sound-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 44px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1.1;
}

.sound-toggle.active {
  border-color: #052e1d;
  background: #dff7ec;
  color: #064e2f;
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 20px 28px;
}

.error-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.info-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

.error-panel {
  width: min(640px, 100%);
  padding: 28px;
  border: 3px solid #53657d;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  text-align: center;
}

.info-panel {
  padding: 28px;
  border: 3px solid #53657d;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.info-panel h1 {
  font-size: 34px;
}

.info-panel h2 {
  margin: 28px 0 0;
  color: #061a36;
  font-size: 24px;
  line-height: 1.25;
}

.error-panel p:not(.eyebrow) {
  margin: 14px 0 0;
  color: #172033;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.6;
}

.info-panel p:not(.eyebrow) {
  margin: 12px 0 0;
  color: #172033;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.65;
}

.home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  margin-top: 22px;
  padding: 12px 22px;
  border: 4px solid #061a36;
  border-radius: 8px;
  background: #004fc4;
  color: #ffffff;
  font-size: 22px;
  font-weight: 900;
  text-decoration: none;
}

.home-link:focus-visible {
  outline: 5px solid var(--focus);
  outline-offset: 4px;
}

.daily-routine {
  width: min(720px, 100%);
  margin: 0 auto 8px;
  padding: 6px;
  border: 3px solid var(--block-edge);
  border-top: 8px solid var(--grass);
  border-radius: 3px;
  background: var(--block-face);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.45),
    0 6px 0 rgba(45, 58, 36, 0.18);
}

.routine-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  gap: 6px;
}

.routine-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 52px;
  padding: 10px 14px;
  border: 3px solid var(--block-edge);
  border-radius: 3px;
  background: #ffffff;
  color: #07111f;
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.routine-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
}

.routine-number {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  border: 2px solid var(--block-edge);
  border-radius: 3px;
  background: #e8f1ff;
  color: #004fc4;
  font-size: 13px;
  font-weight: 900;
  box-shadow: inset 1px 1px 0 var(--voxel-hi);
}

.routine-btn strong {
  min-width: 0;
  color: inherit;
  font-size: inherit;
  line-height: 1.05;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.routine-state {
  display: none;
}

.routine-meta {
  min-width: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.routine-btn.active {
  border-color: #061a36;
  background: #dff7ec;
  color: #052e1d;
}

.routine-btn.active .routine-number {
  background: #087443;
  color: #ffffff;
}

.routine-btn.active .routine-state {
  background: #087443;
  color: #ffffff;
}

.routine-btn.active .routine-meta {
  color: #064e2f;
}

.routine-btn.done {
  border-color: #064e2f;
  background: #eefbf4;
  color: #052e1d;
}

.routine-btn.done .routine-number,
.routine-btn.done .routine-state {
  background: #064e2f;
  color: #ffffff;
}

.routine-btn.started:not(.active):not(.done) {
  border-color: #9a5b00;
  background: #fff4cc;
  color: #2f1b00;
}

.routine-btn.started:not(.active):not(.done) .routine-number,
.routine-btn.started:not(.active):not(.done) .routine-state {
  background: #9a5b00;
  color: #ffffff;
}

.routine-btn.started:not(.active):not(.done) .routine-meta {
  color: #5a3600;
}

.learning-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  height: calc(100svh - 150px);
  min-height: 560px;
  max-height: 720px;
  border: 4px solid var(--block-edge);
  border-top: 10px solid var(--grass);
  border-radius: 3px;
  background: var(--panel);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.35),
    var(--shadow);
  overflow: hidden;
}

.learning-stage[hidden] {
  display: none;
}

.game-header {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto minmax(130px, 1fr);
  align-items: center;
  gap: 16px;
  padding: 12px 18px 10px;
  background: linear-gradient(180deg, #f7efd8 0%, var(--dirt-light) 100%);
  border-bottom: 4px solid var(--dirt);
  flex: none;
}

.stage-label {
  display: inline-block;
  margin: 0;
  padding: 6px 10px;
  border: 3px solid var(--block-edge);
  border-radius: 3px;
  background: #e8f1ff;
  color: var(--blue);
  font-weight: 900;
  font-size: 18px;
  box-shadow:
    inset 2px 2px 0 var(--voxel-hi),
    inset -2px -2px 0 var(--voxel-lo),
    0 3px 0 rgba(0, 0, 0, 0.18);
}

.stage-label[data-stage="mix"] {
  border-color: #9b5b00;
  background: #fff1c7;
  color: #744000;
}

.stage-label[data-stage="fast"] {
  border-color: #087443;
  background: #dff7ec;
  color: #064e2f;
}

.stage-label[data-stage="talk"] {
  border-color: #8a3b12;
  background: #fff1d6;
  color: #6b2408;
}

.stage-label[data-stage="social"] {
  border-color: #0f5f73;
  background: #dff7ff;
  color: #074456;
}

.round-label {
  justify-self: center;
  margin: 0;
  padding: 8px 16px;
  border: 3px solid var(--block-edge);
  border-radius: 3px;
  background: #e8f1ff;
  color: #061a36;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
  box-shadow:
    inset 2px 2px 0 var(--voxel-hi),
    0 3px 0 rgba(0, 0, 0, 0.15);
}

.mode-hint {
  margin: 4px 0 0;
  color: #334155;
  font-size: 14px;
  font-weight: 800;
}

.timer-box {
  min-width: 128px;
  text-align: right;
  justify-self: end;
}

.timer-box span {
  display: block;
  color: #172033;
  font-size: 15px;
  font-weight: 900;
}

.timer-box strong {
  display: block;
  margin-top: 2px;
  color: var(--navy);
  font-size: 32px;
  line-height: 1;
}

/* 에너지(남은 시간) 바 — 게임 HUD 느낌, 기능은 기존 타이머와 동일 */
.meter {
  height: 18px;
  padding: 3px;
  background: #3a4636;
  border-top: 3px solid var(--block-edge);
  border-bottom: 3px solid var(--block-edge);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  flex: none;
}

.meter[data-energy="mid"] {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 0 0 2px rgba(217, 138, 22, 0.25);
}

.meter[data-energy="low"] {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 0 0 2px rgba(231, 95, 81, 0.35);
}

#timeFill {
  width: 100%;
  height: 100%;
  border-radius: 1px;
  background: linear-gradient(180deg, #7ed957 0%, var(--grass) 55%, var(--grass-deep) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: width 0.3s ease, background 0.3s ease;
}

#sentenceProgressFill {
  width: 33.333%;
  height: 100%;
  background: #c95f16;
  transition: width 0.25s ease;
}

#socialProgressFill {
  width: 33.333%;
  height: 100%;
  background: #0f7c95;
  transition: width 0.25s ease;
}

.screen {
  display: none;
  flex: 1;
  min-height: 0;
  padding: clamp(12px, 2.2vh, 22px);
  overflow: hidden;
}

.screen.active {
  display: flex;
}

#introScreen,
#resultScreen {
  align-items: center;
  justify-content: center;
}

#resultScreen {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: auto;
}

#introScreen {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: clamp(8px, 1.4vh, 12px);
  padding-bottom: clamp(8px, 1.4vh, 12px);
}

.concept,
.result-panel {
  width: min(640px, 100%);
  text-align: center;
}

.result-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.concept {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: min(820px, 100%);
  height: 100%;
  margin: 0 auto;
}

.concept-kicker,
.result-kicker {
  margin: 0 0 8px;
  color: var(--green);
  font-size: clamp(13px, 1.8vh, 16px);
  font-weight: 900;
}

/* 시작 화면: 스테이지 준비 뱃지 */
.concept-kicker {
  display: inline-block;
  padding: 6px 12px;
  border: 3px solid var(--block-edge);
  border-radius: 3px;
  background: #fff4cc;
  color: #2f1b00;
  box-shadow:
    inset 1px 1px 0 var(--voxel-hi),
    0 3px 0 rgba(0, 0, 0, 0.18);
}

/* 시작 버튼: 준비 완료 시 은은한 강조 (움직임 줄이기면 끔) */
#introScreen.active #startBtn {
  animation: start-ready-glow 1.5s ease-in-out infinite;
}

/* 구구단 배움 길: 단 선택을 스테이지 맵처럼 표시 (자체 CSS만) */
.dan-map-label {
  width: min(760px, 100%);
  margin: 0 auto 5px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 900;
  color: #4a2f10;
}

.dan-map-label::before {
  content: "";
  width: 13px;
  height: 13px;
  border: 3px solid var(--block-edge);
  border-radius: 3px;
  background: linear-gradient(180deg, #8ec63f 0%, #4e8c22 100%);
}

.dan-picker {
  display: grid;
  grid-template-columns: repeat(8, minmax(58px, 1fr));
  gap: 7px;
  width: min(760px, 100%);
  margin: 0 auto 8px;
  position: relative;
  padding: 11px 9px;
  border: 3px solid var(--block-edge);
  border-radius: 4px;
  background: linear-gradient(180deg, #eaf6d3 0%, #ddefc1 100%);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.7),
    0 3px 0 rgba(0, 0, 0, 0.15);
}

/* 스테이지를 잇는 흙길(점선) */
.dan-picker::before,
.dan-picker::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 50%;
  border-top: 4px dashed rgba(102, 71, 27, 0.4);
  transform: translateY(-2px);
  pointer-events: none;
}

.dan-picker::after {
  display: none; /* 한 줄 배치에서는 길 하나만 */
}

.dan-btn {
  min-height: 44px;
  border: 3px solid var(--block-edge);
  border-radius: 3px;
  background: #ffffff;
  color: #07111f;
  cursor: pointer;
  font-size: clamp(17px, 2.4vh, 21px);
  font-weight: 900;
  position: relative;
  z-index: 1;
}

.dan-btn.active {
  border-color: var(--block-edge);
  background: linear-gradient(180deg, #1a6fe0 0%, #004fc4 100%);
  color: #ffffff;
}

/* 지금 고른 단: 노란 깃발 */
.dan-btn.active::after {
  content: "⚑";
  position: absolute;
  top: -13px;
  right: -5px;
  font-size: 15px;
  line-height: 1;
  color: #ffcf33;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.55);
  animation: dan-flag-pop 0.45s ease;
}

/* 오늘 한 바퀴 완성한 단: 금색 별 */
.dan-btn.cleared:not(.active) {
  background: linear-gradient(180deg, #fff8dc 0%, #ffefad 100%);
}

.dan-btn.cleared::before {
  content: "★";
  position: absolute;
  top: -11px;
  left: -6px;
  font-size: 14px;
  line-height: 1;
  color: #ffb700;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.45);
  animation: dan-star-pop 0.5s ease;
}

@keyframes dan-flag-pop {
  0% { transform: translateY(6px) scale(0.4); opacity: 0; }
  60% { transform: translateY(-2px) scale(1.15); opacity: 1; }
  100% { transform: translateY(0) scale(1); }
}

@keyframes dan-star-pop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.35); opacity: 1; }
  100% { transform: scale(1); }
}

.practice-row {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 3fr);
  gap: 8px;
  width: min(760px, 100%);
  margin: 0 auto 8px;
}

.picker-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.picker-group + .picker-group {
  padding-left: 12px;
  border-left: 2px dashed var(--line);
}

.picker-label {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.mode-picker,
.time-picker {
  display: grid;
  gap: 7px;
  width: 100%;
  margin: 0;
}

.mode-picker {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.time-picker {
  grid-template-columns: repeat(3, minmax(52px, 1fr));
}

.mode-btn,
.time-btn {
  min-height: 44px;
  border: 3px solid var(--block-edge);
  border-radius: 3px;
  background: #ffffff;
  color: #07111f;
  cursor: pointer;
  font-size: clamp(14px, 2.1vh, 20px);
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
  padding: 0 4px;
}

.mode-btn {
  position: relative;
}

.lv-badge {
  position: absolute;
  top: 2px;
  left: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 13px;
  height: 13px;
  padding: 0 2px;
  border: 2px solid #061a36;
  border-radius: 3px;
  background: #ffd43b;
  color: #061a36;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.mode-btn.active .lv-badge {
  background: #ffffff;
}

.mode-btn.active {
  border-color: #052e1d;
  background: #087443;
  color: #ffffff;
}

.time-btn.active {
  border-color: #000000;
  background: #061a36;
  color: #ffffff;
}

.concept h2,
.result-panel h2 {
  margin: 0;
  line-height: 1.25;
  word-break: keep-all;
}

.concept h2 {
  font-size: clamp(30px, 4.8vh, 44px);
}

/* 결과 제목: 아래 카드·버튼과 균형 맞게 */
.result-panel h2 {
  font-size: 28px;
}

#introScreen .concept h2 {
  font-size: clamp(26px, 4.2vh, 38px);
}

.group-row,
.visual-model {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.group-row {
  margin: clamp(8px, 1.5vh, 12px) 0 clamp(6px, 1.2vh, 10px);
}

.dot-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: clamp(6px, 1.2vh, 9px);
  border: 3px solid var(--block-edge);
  border-radius: 3px;
  background: #e8f1ff;
  box-shadow:
    inset 2px 2px 0 var(--voxel-hi),
    inset -2px -2px 0 var(--voxel-lo),
    0 4px 0 rgba(0, 0, 0, 0.18);
  line-height: 0;
}

.dot-group i {
  display: block;
  width: clamp(20px, 3.2vh, 28px);
  height: clamp(20px, 3.2vh, 28px);
  border-radius: 3px;
  background: var(--yellow);
  border: 3px solid #5b4300;
  box-shadow:
    inset -3px -3px 0 rgba(0, 0, 0, 0.2),
    inset 3px 3px 0 rgba(255, 255, 255, 0.5);
}

.group-row[data-dan="3"] .dot-group,
.visual-model[data-dan="3"] .dot-group {
  gap: 4px;
  padding: 5px 6px;
}

.group-row[data-dan="3"] .dot-group i,
.visual-model[data-dan="3"] .dot-group i {
  width: clamp(16px, 2.4vh, 20px);
  height: clamp(16px, 2.4vh, 20px);
}

.dot-group[data-size="4"],
.dot-group[data-size="5"],
.dot-group[data-size="6"],
.dot-group[data-size="7"],
.dot-group[data-size="8"],
.dot-group[data-size="9"] {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 4px;
  padding: 6px;
}

.dot-group[data-size="4"] {
  grid-template-columns: repeat(2, auto);
}

.dot-group[data-size="4"] i,
.dot-group[data-size="5"] i,
.dot-group[data-size="6"] i,
.dot-group[data-size="7"] i,
.dot-group[data-size="8"] i,
.dot-group[data-size="9"] i {
  width: clamp(14px, 2.2vh, 18px);
  height: clamp(14px, 2.2vh, 18px);
}

.bundle-group {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  gap: 8px;
  padding: 8px 10px;
  line-height: 1;
}

.visual-model[data-mode="bundle"] {
  gap: 8px;
}

.bundle-dot {
  display: block;
  width: clamp(18px, 2.7vh, 24px);
  height: clamp(18px, 2.7vh, 24px);
  border: 3px solid #5b4300;
  border-radius: 3px;
  background: var(--yellow);
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.45),
    inset -2px -2px 0 rgba(0, 0, 0, 0.18);
}

.bundle-group strong {
  color: #061a36;
  font-size: clamp(18px, 2.8vh, 23px);
  font-weight: 900;
}

.equation {
  margin: 0;
  font-size: clamp(38px, 6.2vh, 56px);
  font-weight: 900;
  color: var(--navy);
}

.concept-note {
  margin: 8px 0 0;
  color: #172033;
  font-size: clamp(17px, 2.5vh, 22px);
  font-weight: 900;
}

.primary-btn,
.secondary-btn {
  min-height: 56px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
  transition: transform 0.08s ease, filter 0.15s ease;
}

.primary-btn {
  align-self: center;
  width: min(420px, 100%);
  margin-top: clamp(8px, 1.5vh, 12px);
  padding: 10px 18px;
  background: linear-gradient(180deg, #1a6fe0 0%, #004fc4 55%, #003a94 100%);
  color: #fff;
  font-size: clamp(22px, 3.2vh, 28px);
  border: 4px solid var(--block-edge);
}

.secondary-btn {
  align-self: center;
  width: min(320px, 100%);
  margin-top: 10px;
  padding: 10px 18px;
  border: 3px solid var(--block-edge);
  background: linear-gradient(180deg, #ffffff 0%, var(--block-face) 100%);
  color: #172033;
  font-size: 18px;
}

.primary-btn:disabled,
.secondary-btn:disabled {
  border-color: #94a3b8;
  background: #e2e8f0;
  color: #53657d;
  cursor: not-allowed;
  filter: none;
}
.action-icon::before {
  display: inline-block;
  min-width: 1.1em;
  margin-right: 0.34em;
  font-family: "Segoe UI Symbol", "Apple Symbols", sans-serif;
  font-size: 0.9em;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  vertical-align: -0.04em;
}

/* 소리 아이콘: 고대비 기호 박스 (잘 보이면서 블록 톤 유지) */
.icon-sound::before {
  content: "×♪";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.55em;
  height: 1.45em;
  margin-right: 0.38em;
  padding: 0 0.12em;
  border: 2px solid #061a36;
  border-radius: 3px;
  background: #fff4cc;
  color: #2f1b00;
  font-family: Arial, "Segoe UI Symbol", "Noto Sans KR", sans-serif;
  font-size: 1.05em;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.06em;
  vertical-align: middle;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.55);
  opacity: 1;
}

.icon-sound[aria-pressed="true"]::before {
  content: "♪";
  background: #dff7ec;
  border-color: #052e1d;
  color: #064e2f;
  letter-spacing: 0;
}

.icon-start::before,
.icon-listen::before {
  content: "▶";
}

.icon-finish::before {
  content: "✓";
}

.icon-restart::before {
  content: "↻";
}

.icon-settings::before {
  content: "⚙";
}

.icon-copy::before {
  content: "📋";
  font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
}

.icon-next::before {
  content: "→";
}

.icon-next.is-restart::before {
  content: "↻";
}

.read-question-btn.icon-listen::before,
.secondary-btn.icon-copy::before,
.secondary-btn.icon-settings::before {
  color: #004fc4;
}

.secondary-btn.icon-finish::before {
  color: #064e2f;
}

.action-icon:disabled::before {
  opacity: 0.6;
}

.primary-btn:active,
.secondary-btn:active,
.dan-btn:active,
.mode-btn:active,
.time-btn:active,
.read-question-btn:active,
.answer-btn:active,
.routine-btn:active,
.sentence-category-btn:active,
.sentence-choice-btn:active,
.social-category-btn:active,
.social-mind-choice-btn:active,
.social-choice-btn:active {
  transform: scale(0.98);
}

/* 블록 버튼: 복셀 베벨 + 누르면 눌리는 효과 */
.primary-btn,
.secondary-btn,
.dan-btn,
.mode-btn,
.time-btn,
.read-question-btn,
.answer-btn,
.routine-btn,
.sentence-category-btn,
.sentence-choice-btn,
.social-category-btn,
.social-mind-choice-btn,
.social-choice-btn {
  border-radius: 3px;
  box-shadow:
    inset 2px 2px 0 var(--voxel-hi),
    inset -2px -2px 0 var(--voxel-lo),
    0 6px 0 rgba(0, 0, 0, 0.28);
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.12s ease, filter 0.15s ease;
}

.primary-btn:active,
.secondary-btn:active,
.dan-btn:active,
.mode-btn:active,
.time-btn:active,
.read-question-btn:active,
.answer-btn:active,
.routine-btn:active,
.sentence-category-btn:active,
.sentence-choice-btn:active,
.social-category-btn:active,
.social-mind-choice-btn:active,
.social-choice-btn:active {
  box-shadow:
    inset 1px 1px 0 var(--voxel-hi),
    inset -1px -1px 0 var(--voxel-lo),
    0 2px 0 rgba(0, 0, 0, 0.28);
  transform: translateY(4px) scale(0.98);
}

.primary-btn:disabled,
.secondary-btn:disabled {
  box-shadow: none;
}

@media (hover: hover) {
  .primary-btn:hover,
  .secondary-btn:hover,
  .dan-btn:hover,
  .mode-btn:hover,
  .time-btn:hover,
  .read-question-btn:hover,
  .answer-btn:hover,
  .routine-btn:hover,
  .sentence-category-btn:hover,
  .sentence-choice-btn:hover,
  .social-category-btn:hover,
  .social-mind-choice-btn:hover,
  .social-choice-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 9px 0 rgba(0, 0, 0, 0.25);
  }
}

#gameScreen {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: clamp(20px, 3vh, 32px);
  overflow: auto;
}

.visual-model {
  width: min(760px, 100%);
  /* flex 축소로 그림이 세로로 눌리지 않게 항상 내용 크기 유지 */
  flex: none;
  max-height: 150px;
  margin-bottom: clamp(10px, 1.8vh, 18px);
  align-content: center;
  overflow: hidden;
  border-radius: 8px;
}

.visual-model.hint {
  background: #fff7d6;
  box-shadow: 0 0 0 5px #c51f1a;
  /* 힌트가 켜지면 세로 공간이 부족해도 그림이 찌그러지지 않게 고정 */
  flex: none;
  min-height: fit-content;
}

.visual-model.strong-hint {
  background: #fff0b8;
  box-shadow: 0 0 0 6px #a51414;
}

.visual-model.hint .dot-group {
  border-color: #c51f1a;
  background: #fff1c7;
  box-shadow: 0 0 0 3px rgba(197, 31, 26, 0.16);
}

.visual-model.hint .dot-group i,
.visual-model.hint .bundle-dot {
  border-color: #4d0707;
}

.visual-model[data-count="7"],
.visual-model[data-count="8"],
.visual-model[data-count="9"] {
  gap: 6px;
}

.visual-model[data-count="7"] .dot-group,
.visual-model[data-count="8"] .dot-group,
.visual-model[data-count="9"] .dot-group {
  gap: 4px;
  padding: 5px;
  border-width: 3px;
}

.visual-model[data-count="7"] .dot-group i,
.visual-model[data-count="8"] .dot-group i,
.visual-model[data-count="9"] .dot-group i {
  width: clamp(17px, 2.7vh, 23px);
  height: clamp(17px, 2.7vh, 23px);
  border-width: 3px;
}

.question {
  min-height: clamp(64px, 10vh, 90px);
  margin: 0 0 clamp(8px, 1.4vh, 12px);
  text-align: center;
  font-size: clamp(54px, 9vh, 78px);
  line-height: 1.1;
  font-weight: 900;
  color: #000000;
}

.read-question-btn {
  min-height: 44px;
  min-width: 168px;
  margin: 0 0 clamp(10px, 1.6vh, 14px);
  padding: 8px 18px;
  border: 3px solid #53657d;
  border-radius: 999px;
  background: #ffffff;
  color: #07111f;
  cursor: pointer;
  font-size: clamp(17px, 2.5vh, 21px);
  font-weight: 900;
}

.read-question-btn.speaking {
  border-color: #052e1d;
  background: #dff7ec;
  color: #064e2f;
}

.progress-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(9, minmax(24px, 1fr));
  gap: 5px;
  width: min(520px, 100%);
  margin: 0 0 clamp(10px, 1.4vh, 14px);
  padding-block: 3px;
  isolation: isolate;
}

.progress-board::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 50%;
  right: 14px;
  left: 14px;
  height: 5px;
  border: 1px solid #9aa9bc;
  background: #d7e0ec;
  transform: translateY(-50%);
}

.progress-step {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 3px solid #53657d;
  border-radius: 6px;
  background: #ffffff;
  color: #07111f;
  font-size: clamp(15px, 2.2vh, 19px);
  font-weight: 900;
  line-height: 1;
}

.progress-step[data-state="current"] {
  border-color: #004fc4;
  background: #dbeafe;
  color: #00367f;
  box-shadow:
    0 0 0 3px rgba(0, 79, 196, 0.18),
    0 4px 0 #86b7f4;
  animation: progress-step-pop 0.34s ease-out;
}

.progress-step[data-state="done"] {
  border-color: #064e2f;
  background: #bdf2d6;
  color: #052e1d;
  box-shadow: inset 0 -4px 0 #8edbb2;
}

.progress-step[data-state="review"] {
  border-color: #9b5b00;
  background: #fff1c7;
  color: #4a2a00;
  box-shadow: inset 0 -4px 0 #f0d27a;
}

/* 배움별: 배움 조각 수와 함께 표시하는 자체 디자인 보상 배지 */
.mascot {
  flex: none;
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  overflow: hidden;
  border: 2px solid #17365d;
  border-radius: 50%;
  background: #fff3ad;
  box-shadow: 0 1px 0 rgba(23, 54, 93, 0.18);
}

.mascot::before {
  content: "★";
  color: #0057b8;
  font-family: Arial, sans-serif;
  font-size: 15px;
  line-height: 1;
}

.mascot.jump {
  animation: mascot-jump 0.55s ease;
}

.mascot.cheer {
  animation: mascot-cheer 0.85s ease;
}

@keyframes mascot-jump {
  0% { transform: scale(1) rotate(0); }
  45% { transform: scale(1.1) rotate(-5deg); }
  100% { transform: scale(1) rotate(0); }
}

@keyframes mascot-cheer {
  0% { transform: scale(1) rotate(0); }
  30% { transform: scale(1.12) rotate(-7deg); }
  60% { transform: scale(1.08) rotate(7deg); }
  100% { transform: scale(1) rotate(0); }
}

.streak-reward {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  row-gap: 4px;
  width: min(520px, 100%);
  min-height: 42px;
  margin: -2px 0 clamp(10px, 1.4vh, 14px);
  padding: 6px 12px;
  border: 3px solid var(--block-edge);
  border-top: 6px solid var(--grass);
  border-radius: 3px;
  background:
    repeating-linear-gradient(
      90deg,
      #f0ebe0 0 22px,
      #e6dfd0 22px 44px
    );
  color: #07111f;
  font-size: clamp(15px, 2.2vh, 18px);
  font-weight: 900;
  line-height: 1;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.4),
    0 4px 0 rgba(45, 58, 36, 0.2);
}

.streak-label,
.shard-count {
  white-space: nowrap;
}

.shard-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.streak-label strong {
  color: #004fc4;
  font-size: 1.2em;
}

.learning-shards {
  display: flex;
  gap: 5px;
}

.learning-shard {
  width: 20px;
  height: 20px;
  border: 3px solid var(--block-edge);
  border-radius: 2px;
  background: #ffffff;
  box-shadow:
    inset 2px 2px 0 #ffffff,
    inset -2px -2px 0 #c8c2b4;
  transform: none;
}

.learning-shard.filled {
  border-color: var(--block-edge);
  background: linear-gradient(180deg, #ffe066 0%, #ffcf33 55%, #e29b00 100%);
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.55),
    inset -2px -2px 0 rgba(0, 0, 0, 0.22),
    0 0 0 2px rgba(255, 212, 59, 0.28);
  animation: learning-shard-pop 0.42s ease-out;
}

.streak-reward.complete {
  border-color: var(--block-edge);
  border-top-color: var(--grass-deep);
  background:
    repeating-linear-gradient(
      90deg,
      #e7f8ef 0 22px,
      #d4f0e2 22px 44px
    );
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.45),
    0 4px 0 #93d8b4,
    0 0 0 4px rgba(6, 78, 47, 0.1);
  animation:
    reward-complete-pop 0.46s ease-out,
    reward-glow-pulse 1.1s ease-in-out 0.2s 2;
}

.streak-reward.complete .streak-label strong,
.streak-reward.complete .shard-count {
  color: #064e2f;
}

.hint-panel {
  width: min(620px, 100%);
  margin: 0 0 clamp(10px, 1.4vh, 14px);
  padding: 8px 14px;
  border: 4px solid #a51414;
  border-radius: 3px;
  background: #fff7c2;
  color: #000000;
  font-size: clamp(18px, 2.6vh, 24px);
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.answers {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: clamp(10px, 1.8vh, 16px);
  width: min(620px, 100%);
}

.answers.two-choice {
  width: min(520px, 100%);
  grid-template-columns: repeat(2, minmax(120px, 1fr));
}

.answer-btn {
  position: relative;
  min-height: clamp(82px, 13.5vh, 112px);
  border: 5px solid #004fc4;
  border-radius: 4px;
  background: #ffffff;
  color: #000000;
  cursor: pointer;
  font-size: clamp(42px, 6.5vh, 54px);
  font-weight: 900;
  box-shadow: 0 6px 0 #b9c9df;
}

.answers.two-choice .answer-btn {
  min-height: clamp(90px, 15vh, 124px);
  font-size: clamp(46px, 7vh, 60px);
}

.answer-btn.correct {
  border-color: #064e2f;
  background: #bdf2d6;
  color: #052e1d;
  box-shadow:
    0 6px 0 #087443,
    0 0 0 4px rgba(6, 126, 67, 0.22);
  animation: correct-answer-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.answer-btn.correct::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #064e2f;
  color: #ffffff;
  box-shadow: 0 3px 0 #052e1d;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  animation: correct-check-pop 0.34s ease-out;
}

.answer-btn.wrong {
  border-color: #7f1010;
  background: #ffd2cf;
  color: #4d0707;
  box-shadow: 0 6px 0 #c51f1a;
}

.answer-btn.hint-answer {
  border-color: #064e2f;
  background: #e8fff2;
  box-shadow:
    0 6px 0 #087443,
    0 0 0 6px #fff0b8;
}

.feedback {
  min-height: 40px;
  margin-top: clamp(10px, 1.8vh, 16px);
  color: #000000;
  font-size: clamp(20px, 3.2vh, 26px);
  line-height: 1.25;
  font-weight: 900;
  text-align: center;
  word-break: keep-all;
  overflow-wrap: break-word;
}

#sentenceScreen {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
}

.sentence-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(820px, 100%);
  margin: 0 auto;
  text-align: center;
}

.sentence-category-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(74px, 1fr));
  gap: 8px;
  width: min(720px, 100%);
  margin: 0 auto 8px;
}

.sentence-category-btn {
  min-height: 44px;
  border: 4px solid #53657d;
  border-radius: 8px;
  background: #ffffff;
  color: #07111f;
  cursor: pointer;
  font-size: clamp(17px, 2.4vh, 21px);
  font-weight: 900;
}

.sentence-category-btn.active {
  border-color: #6b2408;
  background: #c95f16;
  color: #ffffff;
}

.sentence-panel h2 {
  width: min(760px, 100%);
  margin: 0;
  color: #000000;
  font-size: clamp(28px, 5vh, 42px);
  font-weight: 900;
  line-height: 1.22;
}

.sentence-target {
  width: min(760px, 100%);
  min-height: clamp(52px, 8vh, 70px);
  margin: 8px auto 0;
  padding: 10px 14px;
  border: 4px solid #53657d;
  border-radius: 8px;
  background: #f8fafc;
  color: #172033;
  font-size: clamp(23px, 4vh, 34px);
  font-weight: 900;
  line-height: 1.2;
}

.sentence-target[data-state="answered"] {
  border-color: #064e2f;
  background: #dff7ec;
  color: #052e1d;
}

.sentence-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 8px;
  width: min(820px, 100%);
  margin: 10px auto 0;
}

.sentence-choice-btn {
  min-height: clamp(72px, 11vh, 92px);
  padding: 10px;
  border: 5px solid #004fc4;
  border-radius: 8px;
  background: #ffffff;
  color: #000000;
  cursor: pointer;
  font-size: clamp(21px, 3.1vh, 28px);
  font-weight: 900;
  line-height: 1.18;
  overflow-wrap: break-word;
  word-break: keep-all;
  box-shadow: 0 6px 0 #b9c9df;
}

.sentence-choice-btn.correct {
  border-color: #064e2f;
  background: #bdf2d6;
  color: #052e1d;
  box-shadow: 0 6px 0 #087443;
}

.sentence-choice-btn.wrong {
  border-color: #7f1010;
  background: #ffd2cf;
  color: #4d0707;
  box-shadow: 0 6px 0 #c51f1a;
}

.sentence-practice-actions,
.sentence-bottom-actions {
  display: grid;
  gap: 8px;
  margin: 10px auto 0;
}

.sentence-practice-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  width: min(760px, 100%);
}

.sentence-bottom-actions {
  display: none;
}

#copySentencePlanBtn,
#copySocialPlanBtn {
  display: none;
}

.sentence-panel .feedback {
  width: min(620px, 100%);
  min-height: 0;
  margin-top: 8px;
  font-size: clamp(18px, 2.8vh, 23px);
}

.sentence-panel .feedback:empty {
  display: none;
}

.sentence-hint {
  width: min(720px, 100%);
  margin: 8px auto 0;
  padding: 10px 12px;
  border: 3px solid #9a5b00;
  border-left-width: 8px;
  border-radius: 8px;
  background: #fff4cc;
  color: #2f1b00;
  font-size: clamp(16px, 2.3vh, 20px);
  font-weight: 900;
  line-height: 1.45;
  text-align: left;
}

.sentence-hint[hidden] {
  display: none;
}

.sentence-practice-actions .primary-btn,
.sentence-practice-actions .secondary-btn,
.sentence-bottom-actions .primary-btn,
.sentence-bottom-actions .secondary-btn {
  width: 100%;
  min-height: 50px;
  margin-top: 0;
  padding: 8px 12px;
  font-size: clamp(18px, 2.6vh, 23px);
}

.sentence-practice-actions .primary-btn,
.sentence-practice-actions .secondary-btn {
  flex: 1 1 220px;
  width: auto;
  max-width: 320px;
}

.listen-btn.speaking {
  border-color: #052e1d;
  background: #087443;
}

.said-btn.done {
  border-color: #064e2f;
  background: #dff7ec;
  color: #052e1d;
}

.said-btn:disabled {
  display: none;
  border-color: #94a3b8;
  background: #eef2f7;
  color: #53657d;
  cursor: not-allowed;
}

.next-sentence-btn {
  border-color: #061a36;
  background: #004fc4;
}

#socialScreen {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
}

.social-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(820px, 100%);
  margin: 0 auto;
  text-align: center;
}

.social-category-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(74px, 1fr));
  gap: 8px;
  width: min(720px, 100%);
  margin: 0 auto 8px;
}

.social-category-btn {
  min-height: 44px;
  border: 4px solid #53657d;
  border-radius: 8px;
  background: #ffffff;
  color: #07111f;
  cursor: pointer;
  font-size: clamp(17px, 2.4vh, 21px);
  font-weight: 900;
}

.social-category-btn.active {
  border-color: #074456;
  background: #0f7c95;
  color: #ffffff;
}

.social-panel h2 {
  width: min(760px, 100%);
  margin: 0;
  color: #000000;
  font-size: clamp(28px, 5vh, 42px);
  font-weight: 900;
  line-height: 1.22;
}

.social-mind {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  width: min(760px, 100%);
  min-height: 52px;
  margin: 8px auto 0;
  padding: 8px 12px;
  border: 4px solid #53657d;
  border-radius: 8px;
  background: #f8fafc;
  color: #172033;
  text-align: left;
}

.social-mind span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #dff7ff;
  color: #074456;
  font-size: clamp(15px, 2.1vh, 18px);
  font-weight: 900;
  white-space: nowrap;
}

.social-mind strong {
  color: #061a36;
  font-size: clamp(20px, 3.2vh, 28px);
  font-weight: 900;
  line-height: 1.2;
}

.social-mind[data-state="answered"] {
  border-color: #064e2f;
  background: #eefbf4;
}

.social-mind-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 8px;
  width: min(820px, 100%);
  margin: 10px auto 0;
}

.social-mind-choices[hidden],
.social-choices[hidden] {
  display: none;
}

.social-mind-choice-btn {
  min-height: clamp(68px, 10vh, 86px);
  padding: 10px;
  border: 5px solid #0f7c95;
  border-radius: 8px;
  background: #ffffff;
  color: #000000;
  cursor: pointer;
  font-size: clamp(18px, 2.7vh, 24px);
  font-weight: 900;
  line-height: 1.18;
  overflow-wrap: break-word;
  word-break: keep-all;
  box-shadow: 0 6px 0 #b9c9df;
}

.social-mind-choice-btn.correct {
  border-color: #064e2f;
  background: #bdf2d6;
  color: #052e1d;
  box-shadow: 0 6px 0 #087443;
}

.social-mind-choice-btn.wrong {
  border-color: #7f1010;
  background: #ffd2cf;
  color: #4d0707;
  box-shadow: 0 6px 0 #c51f1a;
}

.social-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 8px;
  width: min(820px, 100%);
  margin: 10px auto 0;
}

.social-choice-btn {
  min-height: clamp(76px, 11.5vh, 96px);
  padding: 10px;
  border: 5px solid #004fc4;
  border-radius: 8px;
  background: #ffffff;
  color: #000000;
  cursor: pointer;
  font-size: clamp(20px, 2.9vh, 26px);
  font-weight: 900;
  line-height: 1.18;
  overflow-wrap: break-word;
  word-break: keep-all;
  box-shadow: 0 6px 0 #b9c9df;
}

.social-choice-btn.correct {
  border-color: #064e2f;
  background: #bdf2d6;
  color: #052e1d;
  box-shadow: 0 6px 0 #087443;
}

.social-choice-btn.wrong {
  border-color: #7f1010;
  background: #ffd2cf;
  color: #4d0707;
  box-shadow: 0 6px 0 #c51f1a;
}

.social-practice-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 8px;
  width: min(620px, 100%);
  margin: 10px auto 0;
}

.social-practice-actions .primary-btn {
  width: 100%;
  min-height: 50px;
  margin-top: 0;
  padding: 8px 12px;
  font-size: clamp(18px, 2.6vh, 23px);
}

.social-panel .feedback {
  width: min(620px, 100%);
  min-height: 0;
  margin-top: 8px;
  font-size: clamp(18px, 2.8vh, 23px);
}

.social-panel .feedback:empty {
  display: none;
}

.social-reason {
  width: min(720px, 100%);
  margin: 8px auto 0;
  padding: 10px 12px;
  border: 3px solid #0f7c95;
  border-left-width: 8px;
  border-radius: 8px;
  background: #eefbff;
  color: #063746;
  font-size: clamp(16px, 2.3vh, 20px);
  font-weight: 900;
  line-height: 1.45;
  text-align: left;
}

.social-reason.is-hint {
  border-color: #9a5b00;
  background: #fff4cc;
  color: #2f1b00;
}

.social-reason[hidden] {
  display: none;
}

.social-bottom-actions {
  display: none;
}

.social-bottom-actions .secondary-btn {
  width: 100%;
  margin-top: 0;
}

.next-social-btn {
  border-color: #061a36;
  background: #004fc4;
}

.celebration {
  position: absolute;
  z-index: 10;
  top: 50%;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12em;
  width: min(420px, calc(100% - 40px));
  min-height: 0;
  max-width: calc(100% - 40px);
  padding: 22px 28px 20px;
  border: 5px solid var(--block-edge);
  border-top: 10px solid var(--grass);
  border-radius: 3px;
  background: #fff7c2;
  color: #061a36;
  box-shadow:
    0 0 0 9999px rgba(255, 255, 255, 0.62),
    inset 3px 3px 0 var(--voxel-hi),
    inset -3px -3px 0 var(--voxel-lo),
    0 12px 0 rgba(45, 58, 36, 0.22),
    0 18px 42px rgba(5, 46, 29, 0.28);
  /* 글자 가독성 유지 (너무 큰 글자·깨짐 방지) */
  font-size: clamp(26px, 4.6vh, 40px);
  font-weight: 900;
  line-height: 1.28;
  letter-spacing: -0.01em;
  text-align: center;
  white-space: pre-line;
  word-break: keep-all;
  overflow-wrap: break-word;
  text-wrap: balance;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.6) rotate(-6deg);
  transition: opacity 0.2s ease, transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.celebration::before,
.celebration::after {
  content: "";
  display: block;
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid #061a36;
  opacity: 0;
}

.celebration::before {
  top: 20px;
  left: 28px;
  background: #004fc4;
  box-shadow:
    32px -8px 0 #ffd43b,
    9px 34px 0 #35a866;
}

.celebration::after {
  right: 28px;
  bottom: 20px;
  background: #35a866;
  box-shadow:
    -32px 8px 0 #ffd43b,
    -9px -34px 0 #004fc4;
}

.celebration.show::before,
.celebration.show::after {
  animation: celebration-block-pop 0.52s 0.08s ease-out both;
}

.celebration.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
}

.confetti-bit {
  position: absolute;
  z-index: 11;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  opacity: 0;
  pointer-events: none;
}

.confetti-bit.c1 { background: #ffd43b; }
.confetti-bit.c2 { background: #004fc4; }
.confetti-bit.c3 { background: #35a866; }
.confetti-bit.c4 { background: #c51f1a; }
.confetti-bit.c5 { background: #6abe30; }
.confetti-bit.c6 { background: #45c4e0; }

#celebration.show ~ .confetti-bit.c1 { animation: confetti-fly 0.6s 0.05s ease-out both; --tx: -74px; --ty: -58px; --rot: -80deg; }
#celebration.show ~ .confetti-bit.c2 { animation: confetti-fly 0.6s 0.09s ease-out both; --tx: 74px; --ty: -58px; --rot: 90deg; }
#celebration.show ~ .confetti-bit.c3 { animation: confetti-fly 0.6s 0.02s ease-out both; --tx: -92px; --ty: 22px; --rot: -120deg; }
#celebration.show ~ .confetti-bit.c4 { animation: confetti-fly 0.6s 0.11s ease-out both; --tx: 92px; --ty: 22px; --rot: 130deg; }
#celebration.show ~ .confetti-bit.c5 { animation: confetti-fly 0.6s 0.04s ease-out both; --tx: -32px; --ty: 82px; --rot: 60deg; }
#celebration.show ~ .confetti-bit.c6 { animation: confetti-fly 0.6s 0.07s ease-out both; --tx: 32px; --ty: 82px; --rot: -60deg; }

.result-stats {
  margin: clamp(10px, 1.6vh, 14px) 0 0;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.35;
  color: var(--navy);
  word-break: keep-all;
}

.result-student-note {
  box-sizing: border-box;
  width: min(560px, 100%);
  min-height: 0;
  margin: clamp(10px, 1.6vh, 14px) auto 0;
  padding: 12px 16px;
  border: 3px solid #0057d8;
  border-radius: 6px;
  background: #eaf3ff;
  color: #061a36;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.35;
  word-break: keep-all;
  overflow-wrap: break-word;
  text-align: center;
}

.result-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
  margin: clamp(12px, 1.8vh, 14px) auto 0;
  width: min(620px, 100%);
}

.result-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 72px;
  padding: 10px 8px;
  border: 3px solid #53657d;
  border-radius: 6px;
  background: #ffffff;
  text-align: center;
}

.result-card span {
  display: block;
  color: #334155;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  word-break: keep-all;
}

.result-card strong {
  display: block;
  margin-top: 0;
  color: #061a36;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 900;
  word-break: keep-all;
}

.result-message {
  margin: clamp(12px, 1.8vh, 14px) auto 0;
  max-width: 560px;
  color: #172033;
  font-size: 17px;
  line-height: 1.45;
  font-weight: 800;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.result-teacher-tip {
  width: min(620px, 100%);
  margin: clamp(10px, 1.6vh, 12px) auto 0;
  padding: 10px 14px;
  border: 3px solid #087443;
  border-left-width: 8px;
  border-radius: 6px;
  background: #eefbf4;
  color: #052e1d;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
  text-align: left;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* 결과 버튼: 칸마다 같은 글자 크기·줄간격, 긴 문구도 칸 안에 맞춤 */
.result-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: min(620px, 100%);
  margin: clamp(14px, 2vh, 16px) auto 0;
}

.result-actions .primary-btn,
.result-actions .secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.2em 0.35em;
  width: 100%;
  min-height: 52px;
  max-width: 100%;
  margin-top: 0;
  padding: 10px 12px;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.25;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
  text-align: center;
  box-sizing: border-box;
}

.result-actions .primary-btn::before,
.result-actions .secondary-btn::before {
  flex: none;
  margin-right: 0.15em;
}

.result-actions .recommended-action {
  order: -1;
  grid-column: 1 / -1;
  min-height: 56px;
  border-width: 4px;
  box-shadow:
    inset 2px 2px 0 var(--voxel-hi),
    inset -2px -2px 0 var(--voxel-lo),
    0 4px 0 rgba(0, 0, 0, 0.22),
    0 0 0 3px #ffcf33;
  font-size: 18px;
}

/* 추천 배지: 글자 옆 고정 크기, 버튼 텍스트와 줄 맞춤 */
.result-actions .recommended-action::after {
  content: "추천";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  margin-left: 0;
  padding: 2px 8px;
  border: 2px solid #061a36;
  border-radius: 4px;
  background: #ffcf33;
  color: #061a36;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  vertical-align: middle;
  white-space: nowrap;
}

.next-dan-btn {
  border-color: #052e1d;
  background: #087443;
}

.next-mode-btn {
  border-color: #061a36;
  background: #004fc4;
}

.copy-preview {
  width: min(620px, 100%);
  max-height: clamp(92px, 18vh, 132px);
  margin: 10px auto 0;
  padding: 10px 12px;
  overflow: auto;
  border: 3px solid #53657d;
  border-radius: 8px;
  background: #f8fafc;
  color: #07111f;
  font-family: Arial, "Noto Sans KR", sans-serif;
  font-size: clamp(13px, 1.9vh, 15px);
  font-weight: 800;
  line-height: 1.45;
  text-align: left;
  white-space: pre-wrap;
}

.copy-preview[hidden] {
  display: none;
}

.copy-fallback {
  display: block;
  width: min(620px, 100%);
  min-height: 118px;
  margin: 10px auto 0;
  padding: 10px;
  border: 3px solid #53657d;
  border-radius: 8px;
  background: #ffffff;
  color: #07111f;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
  resize: none;
}

.copy-fallback[hidden] {
  display: none;
}

.teacher-tools {
  margin-top: 18px;
  border: 2px solid #53657d;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.teacher-tools-summary {
  display: grid;
  grid-template-columns: 82px minmax(160px, 0.8fr) minmax(240px, 1fr) 70px;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  background: #f8fafc;
}

.teacher-tools-summary::-webkit-details-marker {
  display: none;
}

.teacher-tools-summary::after {
  content: "열기";
  justify-self: end;
  min-width: 52px;
  padding: 7px 9px;
  border: 2px solid #53657d;
  border-radius: 999px;
  color: #061a36;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.teacher-tools[open] .teacher-tools-summary {
  border-bottom: 2px solid #53657d;
}

.teacher-tools[open] .teacher-tools-summary::after {
  content: "닫기";
  border-color: #004fc4;
  background: #eaf2ff;
  color: #004fc4;
}

.teacher-tools-summary:focus-visible {
  outline: 5px solid var(--focus);
  outline-offset: -6px;
}

.teacher-tools-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 2px solid #004fc4;
  border-radius: 999px;
  background: #eaf2ff;
  color: #004fc4;
  font-size: 15px;
  font-weight: 900;
}

.teacher-tools-summary strong {
  color: #061a36;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.25;
}

.teacher-tools-summary small {
  color: #334155;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
}

.teacher-tools-panel {
  padding: 14px;
  background: #ffffff;
}

.teacher-record {
  margin-top: 0;
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.record-heading {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: start;
  gap: 14px;
}

.record-heading h2 {
  margin: 0;
  color: #07111f;
  font-size: 26px;
  line-height: 1.25;
}

.record-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.record-actions .secondary-btn {
  width: auto;
  min-height: 44px;
  margin-top: 0;
  padding: 8px 12px;
  font-size: 15px;
}

.record-actions .secondary-btn.is-warning {
  border-color: #8a3b00;
  background: #fff1d6;
  color: #4a1f00;
}

.record-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.record-card {
  min-height: 94px;
  padding: 12px;
  border: 3px solid #53657d;
  border-radius: 8px;
  background: #f8fafc;
}

.record-card[data-state="done"] {
  border-color: #087443;
  background: #eefbf4;
}

.record-card span {
  display: block;
  color: #334155;
  font-size: 15px;
  font-weight: 900;
}

.record-card strong {
  display: block;
  margin-top: 8px;
  color: #061a36;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.35;
  word-break: keep-all;
}

.record-tip {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 3px solid #0f7c95;
  border-left-width: 8px;
  border-radius: 8px;
  background: #eefbff;
  color: #063746;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.45;
}

.record-preview {
  width: 100%;
  max-height: 300px;
  margin: 12px 0 0;
  padding: 12px;
  overflow: auto;
  border: 3px solid #53657d;
  border-radius: 8px;
  background: #f8fafc;
  color: #07111f;
  font-family: Arial, "Noto Sans KR", sans-serif;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: keep-all;
}

.teacher-note {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1.2fr);
  gap: 20px;
  margin-top: 18px;
  padding: 20px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.field-test-note {
  margin-top: 18px;
  padding: 20px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.teacher-note h2,
.field-test-note h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
}

.teacher-note p,
.field-test-note p {
  margin: 0;
  color: #172033;
  line-height: 1.7;
  font-size: 18px;
  font-weight: 800;
}

.teacher-checklist {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.teacher-checklist li {
  min-height: 104px;
  padding: 12px;
  border: 2px solid #9aa8bb;
  border-left: 8px solid #004fc4;
  border-radius: 8px;
  background: #f8fafc;
}

.teacher-checklist strong {
  display: block;
  margin-bottom: 6px;
  color: #061a36;
  font-size: 17px;
  font-weight: 900;
}

.teacher-checklist span {
  display: block;
  color: #172033;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
}

.field-test-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: field-test;
}

.field-test-list li {
  min-height: 122px;
  padding: 12px;
  border: 2px solid #9aa8bb;
  border-top: 8px solid #0f7c95;
  border-radius: 8px;
  background: #f8fafc;
  counter-increment: field-test;
}

.field-test-list strong {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  color: #061a36;
  font-size: 17px;
  font-weight: 900;
}

.field-test-list strong::before {
  content: counter(field-test);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #0f7c95;
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
}

.field-test-list span {
  display: block;
  color: #172033;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
}

.teacher-safe-note {
  grid-column: 1 / -1;
  padding: 12px 14px;
  border: 2px solid #087443;
  border-left-width: 8px;
  border-radius: 8px;
  background: #eefbf4;
  color: #052e1d;
  font-size: 16px;
  font-weight: 900;
}

.field-test-safe-note {
  margin-top: 14px;
  padding: 12px 14px;
  border: 2px solid #087443;
  border-left-width: 8px;
  border-radius: 8px;
  background: #eefbf4;
  color: #052e1d;
  font-size: 16px;
  font-weight: 900;
}

.teacher-board {
  margin-top: 18px;
  border: 2px solid #53657d;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.board-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 2px solid #53657d;
  background: #f8fafc;
}

.board-heading h2 {
  margin: 0;
  color: #061a36;
  font-size: 24px;
  line-height: 1.25;
}

.board-list {
  display: grid;
}

.board-row {
  border-bottom: 2px solid #d7dee8;
  background: #ffffff;
}

.board-row:last-child {
  border-bottom: 0;
}

.board-row summary {
  display: grid;
  grid-template-columns: 82px minmax(150px, 0.75fr) minmax(220px, 1fr) 60px;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
}

.board-row summary::-webkit-details-marker {
  display: none;
}

.board-row summary::after {
  content: "열기";
  justify-self: end;
  min-width: 48px;
  padding: 6px 8px;
  border: 2px solid #53657d;
  border-radius: 999px;
  color: #061a36;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.board-row[open] summary::after {
  content: "닫기";
  border-color: #004fc4;
  background: #eaf2ff;
  color: #004fc4;
}

.board-row summary:focus-visible {
  outline: 5px solid var(--focus);
  outline-offset: -6px;
}

.board-kind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 2px solid #087443;
  border-radius: 999px;
  background: #eefbf4;
  color: #052e1d;
  font-size: 15px;
  font-weight: 900;
}

.board-row strong {
  color: #061a36;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.25;
}

.board-row small {
  color: #334155;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
}

.board-content-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 18px 16px 110px;
  color: #172033;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.5;
}

.board-content-list a {
  color: #004fc4;
  font-weight: 900;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 1120px;
  margin: 0 auto 28px;
  padding: 12px 20px;
  color: #334155;
  font-size: 14px;
  font-weight: 800;
}

.site-footer strong {
  color: #061a36;
  font-weight: 900;
}

.site-footer span,
.site-footer a {
  padding: 6px 10px;
  border: 2px solid #d7dee8;
  border-radius: 999px;
  background: #ffffff;
  color: #172033;
  text-decoration: none;
}

.site-footer a {
  color: #004fc4;
  font-weight: 900;
}

.site-footer a:focus-visible,
.board-content-list a:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 4px;
}

.service-footer {
  max-width: 1120px;
  margin: 0 auto 36px;
  padding: 20px;
  border: 2px solid #9aa8bb;
  border-radius: 8px;
  background: #ffffff;
}

.service-footer-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.service-footer h2 {
  margin: 0;
  color: #061a36;
  font-size: 26px;
  line-height: 1.25;
}

.service-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.service-info-card {
  min-height: 150px;
  padding: 14px;
  border: 2px solid #9aa8bb;
  border-left: 8px solid #004fc4;
  border-radius: 8px;
  background: #f8fafc;
}

.service-info-card h3 {
  margin: 0 0 8px;
  color: #061a36;
  font-size: 18px;
  line-height: 1.25;
}

.service-info-card p {
  margin: 0;
  color: #172033;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.55;
}

.service-info-card a {
  color: #004fc4;
  font-weight: 900;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.service-info-card a:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 4px;
}

@media (min-width: 721px) and (max-width: 980px) {
  .concept {
    width: min(720px, 100%);
  }

  .teacher-checklist,
  .field-test-list,
  .service-info-grid {
    grid-template-columns: 1fr;
  }

  .board-row summary {
    grid-template-columns: 76px minmax(140px, 0.7fr) minmax(180px, 1fr) 58px;
  }

  .teacher-tools-summary {
    grid-template-columns: 76px minmax(140px, 0.7fr) minmax(180px, 1fr) 58px;
  }

  .board-content-list {
    padding-left: 102px;
  }

  .dan-picker {
    grid-template-columns: repeat(4, minmax(80px, 1fr));
    width: min(620px, 100%);
  }

  .practice-row {
    width: min(620px, 100%);
  }
}

@media (min-width: 721px) and (max-width: 900px) {
  .practice-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .picker-group + .picker-group {
    padding-left: 0;
    border-left: 0;
  }
}
@media (max-width: 720px) {
  .topbar,
  .teacher-tools,
  .teacher-tools-summary,
  .teacher-record,
  .record-heading,
  .teacher-note,
  .field-test-note,
  .teacher-board,
  .board-heading,
  .service-footer,
  .service-footer-heading {
    display: block;
  }

  .topbar {
    padding: 12px 12px 6px;
  }

  h1 {
    font-size: 24px;
  }

  .status-strip {
    justify-content: flex-start;
    margin-top: 14px;
  }

  main {
    padding: 6px 10px 24px;
  }

  .info-page {
    padding: 12px 10px 28px;
  }

  .info-panel {
    padding: 18px;
  }

  .info-panel h1 {
    font-size: 28px;
  }

  .info-panel h2 {
    font-size: 21px;
  }

  .info-panel p:not(.eyebrow) {
    font-size: 16px;
  }

  .daily-routine {
    margin-bottom: 6px;
    padding: 6px;
  }

  .routine-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .routine-btn {
    min-height: 44px;
    gap: 4px 5px;
    font-size: 13px;
  }

  .routine-number {
    min-width: 24px;
    height: 24px;
    font-size: 13px;
  }

  .routine-state {
    min-height: 16px;
    padding: 2px 6px;
    font-size: 10px;
  }

  .learning-stage {
    height: calc(100svh - 168px);
    min-height: 0;
  }

  .learning-stage,
  .teacher-note,
  .field-test-note {
    border-radius: 8px;
  }

  .game-header {
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    padding: 10px 12px;
  }

  .timer-box {
    min-width: 88px;
    margin-top: 0;
    text-align: left;
  }

  .timer-box strong {
    font-size: 28px;
  }

  .screen {
    min-height: 0;
    padding: 10px 12px;
  }

  #sentenceScreen,
  #socialScreen {
    overflow: auto;
  }

  .concept h2 {
    font-size: 25px;
  }

  .result-panel h2 {
    font-size: 24px;
  }

  .dan-picker {
    grid-template-columns: repeat(4, minmax(54px, 1fr));
    gap: 8px;
    margin-bottom: 8px;
  }

  /* 두 줄 배치: 줄마다 길 하나씩 */
  .dan-picker::before {
    top: 27%;
  }

  .dan-picker::after {
    display: block;
    top: 74%;
  }

  .dan-btn {
    min-height: 44px;
    font-size: 18px;
  }

  .practice-row {
    grid-template-columns: 1fr;
    gap: 6px;
    margin-bottom: 8px;
  }

  .picker-group + .picker-group {
    padding-left: 0;
    border-left: 0;
  }

  .mode-picker,
  .time-picker {
    gap: 6px;
    margin: 0;
  }

  .mode-picker {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mode-btn,
  .time-btn {
    min-height: 44px;
    border-width: 3px;
    font-size: 15px;
  }

  .equation {
    font-size: 36px;
  }

  .concept-note {
    margin-top: 8px;
    font-size: 16px;
  }

  .group-row {
    margin-top: 10px;
    margin-bottom: 8px;
  }

  .primary-btn {
    min-height: 54px;
    margin-top: 8px;
    padding: 10px 16px;
    font-size: 22px;
  }

  .visual-model {
    max-height: 132px;
    min-height: 0;
    margin-bottom: 8px;
  }

  .question {
    min-height: 58px;
    margin-bottom: 6px;
    font-size: 48px;
  }

  .read-question-btn {
    min-height: 44px;
    margin-bottom: 8px;
    padding: 6px 16px;
    font-size: 16px;
  }

  .answer-btn {
    min-height: 76px;
    border-width: 4px;
    font-size: 38px;
  }

  .feedback {
    min-height: 44px;
    margin-top: 8px;
    font-size: 19px;
  }

  .sentence-category-picker {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 8px;
  }

  .sentence-category-btn {
    min-height: 44px;
    border-width: 3px;
    font-size: 15px;
  }

  .sentence-panel h2 {
    font-size: 28px;
  }

  .sentence-target {
    min-height: 56px;
    padding: 9px 10px;
    font-size: 23px;
  }

  .sentence-choices {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 10px;
  }

  .sentence-choice-btn {
    min-height: 64px;
    border-width: 4px;
    font-size: 22px;
  }

  .sentence-practice-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
  }

  .sentence-bottom-actions {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 10px;
  }

  .sentence-hint {
    margin-top: 6px;
    padding: 6px 9px;
    border-left-width: 6px;
    font-size: 13px;
  }

  .social-category-picker {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 8px;
  }

  .social-category-btn {
    min-height: 44px;
    border-width: 3px;
    font-size: 15px;
  }

  .social-panel h2 {
    font-size: 27px;
  }

  .social-mind {
    min-height: 48px;
    margin-top: 6px;
    padding: 6px 9px;
    gap: 6px;
  }

  .social-mind span {
    min-height: 30px;
    padding: 4px 8px;
    font-size: 13px;
  }

  .social-mind strong {
    font-size: 19px;
  }

  .social-mind-choices {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 10px;
  }

  .social-mind-choice-btn {
    min-height: 56px;
    border-width: 4px;
    font-size: 18px;
  }

  .social-choices {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 10px;
  }

  .social-choice-btn {
    min-height: 58px;
    border-width: 4px;
    font-size: 19px;
  }

  .social-practice-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
  }

  .social-reason {
    margin-top: 6px;
    padding: 6px 9px;
    border-left-width: 6px;
    font-size: 13px;
  }

  .social-bottom-actions {
    margin-top: 8px;
  }

  #copySentencePlanBtn,
  #copySocialPlanBtn {
    display: none;
  }

  .celebration {
    width: calc(100% - 28px);
    max-width: calc(100% - 28px);
    min-height: 0;
    padding: 18px 20px 16px;
    border-width: 5px;
    font-size: clamp(24px, 6.2vw, 34px);
    line-height: 1.28;
    word-break: keep-all;
    overflow-wrap: break-word;
  }

  .secondary-btn {
    min-height: 46px;
    margin-top: 8px;
    padding: 7px 14px;
    font-size: 16px;
  }

  .result-details {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 8px;
  }

  .result-card {
    min-height: 76px;
    padding: 10px 6px;
  }

  .result-card span {
    font-size: 13px;
  }

  .result-card strong {
    font-size: 24px;
  }

  .result-student-note {
    min-height: 0;
    padding: 10px 12px;
    font-size: 18px;
    line-height: 1.35;
  }

  .result-stats {
    font-size: 16px;
  }

  .result-message {
    margin-top: 10px;
    font-size: 16px;
  }

  .result-teacher-tip {
    margin-top: 8px;
    padding: 8px 10px;
    border-left-width: 6px;
    font-size: 14px;
  }

  .result-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .result-actions .primary-btn,
  .result-actions .secondary-btn {
    min-height: 50px;
    padding: 10px 12px;
    font-size: 16px;
  }

  .result-actions .recommended-action {
    min-height: 52px;
    font-size: 16px;
    box-shadow:
      inset 2px 2px 0 var(--voxel-hi),
      inset -2px -2px 0 var(--voxel-lo),
      0 3px 0 rgba(0, 0, 0, 0.2),
      0 0 0 3px #ffcf33;
  }

  .result-actions .recommended-action::after {
    font-size: 11px;
    padding: 2px 6px;
  }

  .copy-preview {
    max-height: 86px;
    font-size: 12px;
  }

  .teacher-checklist,
  .teacher-safe-note,
  .field-test-list,
  .field-test-safe-note,
  .service-info-grid {
    margin-top: 14px;
  }

  .teacher-checklist,
  .field-test-list,
  .service-info-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .teacher-checklist li,
  .field-test-list li,
  .service-info-card {
    min-height: 0;
    padding: 10px;
    border-left-width: 6px;
  }

  .teacher-checklist strong,
  .field-test-list strong {
    font-size: 16px;
  }

  .teacher-checklist span,
  .teacher-safe-note,
  .field-test-list span,
  .field-test-safe-note,
  .service-info-card p {
    font-size: 14px;
  }

  .service-footer {
    margin: 0 10px 28px;
    padding: 14px;
  }

  .service-footer h2 {
    font-size: 22px;
  }

  .service-info-card h3 {
    font-size: 17px;
  }

  .teacher-tools {
    margin-top: 14px;
  }

  .teacher-tools-summary {
    grid-template-columns: 68px minmax(0, 1fr) 50px;
    gap: 8px;
    min-height: 72px;
    padding: 10px 12px;
  }

  .teacher-tools-summary::after {
    min-width: 46px;
    padding: 5px 7px;
    font-size: 12px;
  }

  .teacher-tools-badge {
    min-height: 30px;
    padding: 5px 8px;
    font-size: 13px;
  }

  .teacher-tools-summary strong {
    font-size: 17px;
  }

  .teacher-tools-summary small {
    grid-column: 2 / -1;
    font-size: 13px;
  }

  .teacher-tools-panel {
    padding: 10px;
  }

  .teacher-board {
    margin-top: 14px;
  }

  .board-heading {
    padding: 12px 14px;
  }

  .board-heading h2 {
    font-size: 21px;
  }

  .board-row summary {
    grid-template-columns: 68px minmax(0, 1fr) 50px;
    gap: 8px;
    min-height: 72px;
    padding: 10px 12px;
  }

  .board-row summary::after {
    min-width: 46px;
    padding: 5px 7px;
    font-size: 12px;
  }

  .board-kind {
    min-height: 30px;
    padding: 5px 8px;
    font-size: 13px;
  }

  .board-row strong {
    font-size: 17px;
  }

  .board-row small {
    grid-column: 2 / -1;
    font-size: 13px;
  }

  .board-content-list {
    gap: 7px;
    padding: 0 14px 14px 34px;
    font-size: 14px;
  }

  .site-footer {
    justify-content: flex-start;
    margin: 0 10px 24px;
    padding: 8px 0;
    font-size: 13px;
  }

  .record-heading h2 {
    font-size: 22px;
  }

  .record-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 12px;
  }

  .record-actions .secondary-btn {
    width: 100%;
  }

  .record-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .record-card {
    min-height: 78px;
    padding: 10px;
  }

  .record-card strong {
    font-size: 16px;
  }

  .record-tip {
    font-size: 15px;
  }

  .stage-label {
    font-size: 14px;
  }

  .round-label {
    padding: 6px 10px;
    font-size: 14px;
  }
}

/* 태블릿 가로 화면에서 학습 종료 버튼까지 한 화면에 보이도록 간격만 줄인다. */
@media (min-width: 721px) and (max-width: 1100px) and (max-height: 800px) {
  #gameScreen {
    padding-top: 12px;
    padding-bottom: 8px;
  }

  .visual-model {
    margin-bottom: 6px;
  }

  .question {
    min-height: 60px;
    margin-bottom: 4px;
    font-size: 54px;
  }

  .read-question-btn,
  .progress-board {
    margin-bottom: 6px;
  }

  .streak-reward {
    margin-bottom: 7px;
  }

  .answers.two-choice .answer-btn {
    min-height: 92px;
  }

  .feedback {
    min-height: 30px;
    margin-top: 6px;
  }

  #finishBtn {
    min-height: 48px;
    margin-top: 6px;
    padding-block: 7px;
  }
}

@media (max-height: 680px) {
  .topbar {
    padding-top: 8px;
    padding-bottom: 4px;
  }

  .eyebrow {
    margin-bottom: 2px;
    font-size: 13px;
  }

  h1 {
    font-size: 26px;
  }

  .status-strip {
    display: none;
  }

  main {
    padding-top: 4px;
  }

  .daily-routine {
    margin-bottom: 6px;
    padding: 5px;
  }

  .routine-btn {
    min-height: 44px;
    gap: 3px 4px;
    font-size: 12px;
  }

  .routine-number {
    min-width: 22px;
    height: 22px;
    font-size: 12px;
  }

  .routine-state {
    min-height: 15px;
    padding: 2px 5px;
    font-size: 9px;
  }

  .learning-stage {
    height: calc(100svh - 150px);
    /* 세로가 짧아도 시작 버튼이 게임판 밖으로 잘리지 않게 한다. */
    min-height: 560px;
  }

  .stage-label,
  .round-label,
  .mode-hint {
    font-size: 15px;
  }

  .timer-box span {
    font-size: 13px;
  }

  .timer-box strong {
    font-size: 26px;
  }

  .meter {
    height: 10px;
  }

  .screen {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .visual-model {
    max-height: 104px;
    min-height: 0;
    margin-bottom: 6px;
  }

  .dot-group {
    gap: 4px;
    padding: 5px;
  }

  .concept-kicker {
    display: none;
  }

  .dan-picker {
    gap: 6px;
    margin-bottom: 6px;
  }

  .dan-btn {
    min-height: 44px;
    border-width: 3px;
    font-size: 16px;
  }

  .practice-row {
    gap: 6px;
    margin-bottom: 6px;
  }

  .mode-picker,
  .time-picker {
    gap: 5px;
  }

  .mode-btn,
  .time-btn {
    min-height: 44px;
    font-size: 14px;
  }

  .dot-group i {
    width: 18px;
    height: 18px;
  }

  .group-row[data-dan="3"] .dot-group i,
  .visual-model[data-dan="3"] .dot-group i {
    width: 15px;
    height: 15px;
  }

  .dot-group[data-size="4"] i,
  .dot-group[data-size="5"] i,
  .dot-group[data-size="6"] i,
  .dot-group[data-size="7"] i,
  .dot-group[data-size="8"] i,
  .dot-group[data-size="9"] i {
    width: 13px;
    height: 13px;
  }

  .bundle-group {
    min-width: 68px;
    padding: 6px 8px;
  }

  .bundle-dot {
    width: 16px;
    height: 16px;
  }

  .question {
    min-height: 50px;
    font-size: 44px;
    margin-bottom: 5px;
  }

  .read-question-btn {
    min-height: 44px;
    margin-bottom: 6px;
    padding: 5px 14px;
    font-size: 14px;
  }

  .progress-board {
    gap: 4px;
    margin-bottom: 6px;
  }

  .progress-step {
    min-height: 26px;
    border-width: 2px;
    font-size: 13px;
  }

  .answer-btn {
    min-height: 66px;
    font-size: 34px;
  }

  .feedback {
    min-height: 42px;
    font-size: 18px;
  }

  .sentence-category-btn {
    min-height: 44px;
    font-size: 14px;
  }

  .sentence-panel h2 {
    font-size: 25px;
  }

  .sentence-target {
    min-height: 48px;
    margin-top: 8px;
    padding: 8px 10px;
    font-size: 21px;
  }

  .sentence-choice-btn {
    min-height: 54px;
    padding: 8px 10px;
    font-size: 20px;
  }

  .sentence-practice-actions,
  .sentence-bottom-actions {
    margin-top: 8px;
  }

  .sentence-hint {
    margin-top: 8px;
    padding: 7px 9px;
    font-size: 13px;
  }

  .social-category-btn {
    min-height: 44px;
    font-size: 14px;
  }

  .social-panel h2 {
    font-size: 24px;
  }

  .social-mind {
    min-height: 46px;
    margin-top: 8px;
    padding: 7px 9px;
  }

  .social-mind strong {
    font-size: 18px;
  }

  .social-mind-choice-btn {
    min-height: 54px;
    padding: 8px 10px;
    font-size: 17px;
  }

  .social-choice-btn {
    min-height: 54px;
    padding: 8px 10px;
    font-size: 18px;
  }

  .social-practice-actions,
  .social-bottom-actions,
  .social-reason {
    margin-top: 8px;
  }

  .social-reason {
    font-size: 13px;
  }

  .result-student-note {
    min-height: 44px;
    margin-top: 8px;
    padding: 7px 10px;
    font-size: 21px;
  }

  .result-stats {
    margin-top: 8px;
    font-size: 20px;
  }

  .result-details {
    gap: 6px;
    margin-top: 8px;
  }

  .result-card {
    min-height: 64px;
    padding: 8px 6px;
  }

  .result-card span {
    font-size: 12px;
  }

  .result-card strong {
    font-size: 20px;
  }

  .result-message,
  .result-teacher-tip,
  .result-actions,
  .copy-preview {
    margin-top: 8px;
  }

  .result-actions .primary-btn,
  .result-actions .secondary-btn {
    min-height: 48px;
    font-size: 15px;
  }

  .result-actions .recommended-action {
    min-height: 50px;
    font-size: 15px;
  }

  .celebration {
    min-height: 0;
    font-size: clamp(24px, 5.8vw, 32px);
    line-height: 1.28;
  }
}


/* 학생용 태블릿 가로 화면: 교사용 영역 전까지 스크롤 없이 선택하고 답한다. */
@media (min-width: 721px) and (max-height: 860px) and (orientation: landscape) {
  .topbar {
    display: none;
  }

  main {
    padding-top: 3px;
    padding-bottom: 18px;
  }

  .daily-routine {
    margin-bottom: 4px;
    padding: 4px;
    border-top-width: 6px;
    box-shadow: none;
  }

  .routine-btn {
    min-height: 44px;
    padding: 4px 8px;
    gap: 0;
    font-size: 15px;
  }

  .routine-number,
  .routine-meta,
  .routine-state {
    display: none;
  }

  .learning-stage {
    height: calc(100svh - 72px);
    min-height: 0;
    max-height: none;
  }

  .game-header {
    gap: 6px;
    padding: 5px 8px 4px;
  }

  .stage-label,
  .round-label {
    padding: 4px 6px;
    border-width: 2px;
    font-size: 13px;
  }

  .mode-hint,
  .timer-box span {
    display: none;
  }

  .timer-box {
    min-width: 70px;
  }

  .timer-box strong {
    margin-top: 0;
    font-size: 22px;
  }

  .meter {
    height: 7px;
    padding: 1px;
    border-top-width: 2px;
    border-bottom-width: 2px;
  }

  .screen {
    padding: 5px 8px;
  }

  .dan-btn,
  .mode-btn,
  .time-btn {
    min-height: 44px;
  }

  #introScreen .concept {
    height: auto;
  }

  #introScreen .concept h2,
  #introVisual,
  #conceptEquation,
  #conceptNote {
    display: none;
  }

  #introScreen .practice-row {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
    gap: 8px;
  }

  #introScreen .picker-group + .picker-group {
    padding-left: 8px;
    border-left: 2px dashed #53657d;
  }

  #introScreen .primary-btn {
    min-height: 48px;
    margin-top: 7px;
    padding: 8px 16px;
    font-size: 20px;
  }

  #gameScreen {
    padding: 5px 8px;
    overflow: hidden;
  }

  #progressBoard,
  #streakReward {
    display: none;
  }

  #gameScreen .visual-model {
    max-height: 82px;
    margin-bottom: 4px;
  }

  #gameScreen .question {
    min-height: 44px;
    margin-bottom: 2px;
    font-size: 42px;
  }

  #gameScreen .read-question-btn {
    min-height: 44px;
    margin-bottom: 5px;
    padding: 5px 14px;
    font-size: 14px;
  }

  #gameScreen .answers {
    gap: 8px;
  }

  #gameScreen .answers:not(.two-choice) {
    grid-template-columns: repeat(4, minmax(100px, 1fr));
    width: min(900px, 100%);
  }

  #gameScreen .answer-btn,
  #gameScreen .answers.two-choice .answer-btn {
    min-height: 64px;
    font-size: 34px;
  }

  #gameScreen .feedback {
    min-height: 34px;
    margin-top: 5px;
    font-size: 16px;
  }

  #finishBtn {
    min-height: 44px;
    margin-top: 4px;
    padding-block: 6px;
  }

  #sentenceScreen,
  #socialScreen {
    overflow: hidden;
  }
}

@keyframes progress-step-pop {
  0% { transform: translateY(3px) scale(0.88); }
  70% { transform: translateY(-2px) scale(1.06); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes learning-shard-pop {
  0% { transform: scale(0.25) translateY(6px); }
  55% { transform: scale(1.22) translateY(-3px); }
  100% { transform: scale(1) translateY(0); }
}

@keyframes reward-complete-pop {
  0% { transform: scale(0.94); }
  55% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes start-ready-glow {
  0%, 100% {
    box-shadow:
      inset 2px 2px 0 var(--voxel-hi),
      inset -2px -2px 0 var(--voxel-lo),
      0 6px 0 rgba(0, 0, 0, 0.28),
      0 0 0 0 rgba(255, 207, 51, 0);
  }
  50% {
    box-shadow:
      inset 2px 2px 0 var(--voxel-hi),
      inset -2px -2px 0 var(--voxel-lo),
      0 6px 0 rgba(0, 0, 0, 0.28),
      0 0 0 6px rgba(255, 207, 51, 0.5);
  }
}

@keyframes reward-glow-pulse {
  0%, 100% {
    box-shadow:
      0 4px 0 #93d8b4,
      0 0 0 4px rgba(6, 78, 47, 0.1);
  }
  50% {
    box-shadow:
      0 4px 0 #93d8b4,
      0 0 0 9px rgba(255, 212, 59, 0.35);
  }
}

@keyframes correct-answer-pop {
  0% { transform: translateY(4px) scale(0.9); }
  45% { transform: translateY(-8px) scale(1.06); }
  70% { transform: translateY(-2px) scale(1.02); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes correct-check-pop {
  0% { opacity: 0; transform: scale(0.25) rotate(-25deg); }
  55% { opacity: 1; transform: scale(1.2) rotate(6deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes celebration-block-pop {
  0% { opacity: 0; transform: scale(0.4) rotate(0); }
  70% { opacity: 1; transform: scale(1.18) rotate(50deg); }
  100% { opacity: 1; transform: scale(1) rotate(45deg); }
}

@keyframes confetti-fly {
  0% { opacity: 0; transform: translate(0, 0) rotate(0deg) scale(0.6); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) rotate(var(--rot)) scale(1); }
}

@media (max-width: 480px) {
  /* 작은 화면에서도 시작 버튼까지 한눈에 보이도록 세로 공간만 압축 */
  .topbar {
    padding: 7px 10px 4px;
  }

  .eyebrow {
    margin-bottom: 2px;
    font-size: 12px;
  }

  h1 {
    font-size: 21px;
    line-height: 1.25;
  }

  h1::after {
    width: 12px;
    height: 12px;
    margin-left: 5px;
  }

  .status-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    margin-top: 6px;
  }

  .status-strip span,
  .sound-toggle {
    min-width: 0;
    min-height: 36px;
    padding: 4px 2px;
    font-size: 11px;
    line-height: 1.15;
    text-align: center;
  }

  /* 소리 버튼은 터치 대상이라 44px 유지 (안내 배지는 표시용이라 그대로) */
  .sound-toggle {
    min-height: 44px;
  }

  .sound-toggle {
    width: 100%;
  }

  .icon-sound::before {
    min-width: 1.35em;
    height: 1.3em;
    margin-right: 0.2em;
    border-width: 1px;
  }

  main {
    padding-top: 3px;
  }

  .daily-routine {
    margin-bottom: 4px;
    padding: 4px;
  }

  .routine-actions {
    gap: 4px;
  }

  .routine-btn {
    min-height: 44px;
    padding: 5px 3px;
    gap: 2px 4px;
    font-size: 12px;
  }

  .routine-number {
    min-width: 21px;
    height: 21px;
    font-size: 11px;
  }

  .routine-meta {
    font-size: 10px;
  }

  .game-header {
    padding: 7px 8px 6px;
  }

  .stage-label,
  .round-label {
    padding: 5px 7px;
    font-size: 12px;
  }

  .timer-box {
    min-width: 70px;
  }

  .timer-box span {
    font-size: 11px;
  }

  .timer-box strong {
    font-size: 24px;
  }

  .meter {
    height: 14px;
    padding: 2px;
  }

  #introScreen {
    padding: 5px 8px 7px;
  }

  .concept-kicker {
    margin-bottom: 4px;
    padding: 4px 7px;
    border-width: 2px;
    font-size: 12px;
  }

  .dan-picker {
    gap: 4px;
    margin-bottom: 4px;
  }

  .dan-btn {
    min-height: 44px;
    font-size: 16px;
  }

  .practice-row {
    gap: 3px;
    margin-bottom: 4px;
  }

  .picker-group {
    gap: 2px;
  }

  .picker-label {
    font-size: 11px;
  }

  .mode-picker,
  .time-picker {
    gap: 4px;
  }

  .mode-btn,
  .time-btn {
    min-height: 44px;
    font-size: 13px;
  }

  #introScreen .concept h2 {
    font-size: 22px;
    line-height: 1.2;
  }

  .group-row {
    gap: 6px;
    margin: 5px 0 4px;
  }

  /* 압축은 시작 화면 그림에만 적용 — 게임 중 그림 힌트는 원래 크기 유지 */
  #introScreen .dot-group {
    gap: 4px;
    padding: 5px;
  }

  #introScreen .dot-group i {
    width: 18px;
    height: 18px;
  }

  .equation {
    font-size: 32px;
  }

  .concept-note {
    margin-top: 3px;
    font-size: 14px;
  }

  #introScreen .primary-btn {
    min-height: 48px;
    margin-top: 5px;
    padding: 8px 14px;
    font-size: 19px;
  }

  .celebration {
    padding: 16px 18px 14px;
    font-size: clamp(22px, 6.5vw, 30px);
    line-height: 1.3;
    word-break: keep-all;
    overflow-wrap: break-word;
  }

  .streak-reward {
    gap: 7px;
    min-height: 38px;
    padding-inline: 8px;
    font-size: 14px;
  }

  .learning-shards {
    gap: 3px;
  }

  .learning-shard {
    width: 15px;
    height: 15px;
    border-width: 2px;
  }

  .answer-btn.correct::after {
    top: 6px;
    right: 7px;
    width: 28px;
    height: 28px;
    border-width: 2px;
    font-size: 18px;
  }

  .celebration::before {
    top: 14px;
    left: 18px;
  }

  .celebration::after {
    right: 18px;
    bottom: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .celebration {
    transition: none;
  }

  .progress-step[data-state="current"],
  .learning-shard.filled,
  .streak-reward.complete,
  .answer-btn.correct,
  .answer-btn.correct::after,
  .celebration.show::before,
  .celebration.show::after,
  .confetti-bit,
  #introScreen.active #startBtn,
  .dan-btn.active::after,
  .dan-btn.cleared::before,
  .mascot.jump,
  .mascot.cheer {
    animation: none;
  }
}

/* 자바스크립트 꺼짐 안내 (JS 켜져 있으면 렌더되지 않음) */
.noscript-note {
  max-width: 640px;
  margin: 16px auto;
  padding: 12px 16px;
  background: #fff4cc;
  border: 3px solid #5b4300;
  border-radius: 6px;
  font-weight: 700;
  text-align: center;
}

/* PWA 설치형(standalone)·노치 기기 안전 영역 — 일반 기기에서는 모두 0이라 영향 없음 */
body {
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
}
