@font-face {
  font-family: "WorksheetBody";
  src: url("/static/fonts/omyu-pretty.ttf") format("truetype");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-body: "WorksheetBody", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --game-blue: #0066cc;
  --game-blue-focus: #0071e3;
  --game-ink: #1d1d1f;
  --game-muted: #747478;
  --game-page: #f5f5f7;
  --game-canvas: #ffffff;
  --game-pearl: #fafafc;
  --game-line: #e0e0e0;
  --game-pill: 9999px;
  --accent: #df6f6f;
  --accent-soft: #fff0ed;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--game-ink);
  font-family: var(--font-body);
  background: var(--game-page);
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0 72px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.9fr);
  gap: 22px;
  margin-bottom: 24px;
}

.hero__copy,
.hero__status,
.panel,
.worksheet-page,
.empty-state {
  border: 1px solid var(--game-line);
  border-radius: 24px;
  background: var(--game-canvas);
}

.hero__copy {
  padding: 28px 30px;
}

.hero__copy h1,
.panel-heading h2,
.empty-state h3 {
  margin: 0;
  color: var(--game-ink);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero__copy h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.04;
}

.hero__copy > p {
  max-width: 58ch;
  margin: 16px 0 0;
  color: var(--game-muted);
  line-height: 1.72;
}

.seo-intro {
  margin-top: 14px;
}

.seo-intro h2 {
  margin: 0;
  color: var(--game-muted);
  font-size: 1.02rem;
  font-weight: 800;
}

.seo-intro p {
  margin: 6px 0 0;
  color: var(--game-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.eyebrow,
.step-label {
  margin: 0 0 10px;
  color: var(--game-muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.hero__actions,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero__actions {
  margin-top: 20px;
}

.hero__status {
  padding: 24px;
}

.hero__status strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
}

.hero__status span {
  display: block;
  margin-top: 8px;
  color: var(--game-muted);
  line-height: 1.6;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--game-line);
  border-radius: var(--game-pill);
  color: var(--game-ink);
  background: var(--game-canvas);
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.button:hover:not(:disabled) {
  color: var(--game-blue);
  border-color: var(--game-blue);
}

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

.button--primary {
  color: #ffffff;
  border-color: var(--game-blue);
  background: var(--game-blue);
}

.button--primary:hover:not(:disabled) {
  color: #ffffff;
  background: var(--game-blue-focus);
}

.layout {
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.panel {
  padding: 24px;
}

.panel-heading {
  margin-bottom: 16px;
}

.preview-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.summary {
  margin: 0;
  color: var(--game-muted);
  font-size: 0.95rem;
}

.maker-form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field > span {
  font-size: 0.95rem;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  padding: 12px 14px;
  border: 1px solid var(--game-line);
  border-radius: 14px;
  color: var(--game-ink);
  background: var(--game-pearl);
}

.field textarea {
  resize: vertical;
  line-height: 1.6;
}

#situation-input {
  min-height: 190px;
}

.field-hint {
  color: var(--game-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.option-card {
  margin: 0;
  padding: 14px 16px 16px;
  border: 1px solid var(--game-line);
  border-radius: 18px;
  background: var(--game-pearl);
}

.option-card legend {
  padding: 0 6px;
  font-size: 0.95rem;
  font-weight: 800;
}

.toggle-stack {
  display: grid;
  gap: 10px;
}

.toggle-stack label {
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.5;
}

.feedback {
  min-height: 1.4em;
  margin: 0;
  color: var(--game-muted);
  line-height: 1.55;
}

.feedback.is-success {
  color: #167044;
}

.feedback.is-error {
  color: #b3261e;
}

.empty-state {
  display: grid;
  place-content: center;
  gap: 8px;
  min-height: 260px;
  padding: 24px;
  text-align: center;
  background: var(--game-pearl);
}

.empty-state[hidden] {
  display: none !important;
}

.empty-state h3 {
  font-size: 1.25rem;
}

.empty-state p {
  margin: 0;
  color: var(--game-muted);
  line-height: 1.6;
}

.print-area {
  display: grid;
  gap: 22px;
}

.worksheet-page {
  padding: 26px 28px 30px;
}

.worksheet-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--game-ink);
}

.worksheet-title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.worksheet-name {
  color: var(--game-muted);
  white-space: nowrap;
}

.worksheet-guide {
  margin: 0 0 12px;
  color: var(--game-muted);
  line-height: 1.5;
}

.word-bank {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid #f0c7c2;
  border-radius: 14px;
  background: #fff8f6;
}

.word-bank strong {
  margin-right: 2px;
  color: #9f4f4f;
}

.emotion-chip {
  padding: 4px 9px;
  border: 1px solid #e8b5af;
  border-radius: var(--game-pill);
  background: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
}

.scenario-list {
  display: grid;
  gap: 14px;
}

.scenario-card {
  padding: 14px 16px 16px;
  border: 1px solid var(--game-line);
  border-radius: 18px;
  break-inside: avoid;
}

.scenario-head {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 9px;
  align-items: start;
  margin-bottom: 12px;
}

.scenario-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #ffffff;
  background: var(--accent);
  font-weight: 800;
}

.scenario-text {
  margin: 2px 0 0;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.45;
}

.response-fields {
  display: grid;
  gap: 10px;
}

.response-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: end;
}

.response-label {
  color: #8b4f4f;
  font-weight: 800;
  white-space: nowrap;
}

.write-line {
  min-height: 25px;
  border-bottom: 1.5px solid #9a9aa2;
}

.write-lines {
  display: grid;
  gap: 10px;
}

.intensity-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.intensity-label {
  margin-right: 2px;
  color: #8b4f4f;
  font-weight: 800;
}

.intensity-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
  border: 1.5px solid #dc9c95;
  border-radius: 50%;
  color: #9f5550;
  background: #ffffff;
  font-weight: 800;
}

.intensity-edge {
  color: var(--game-muted);
  font-size: 0.82rem;
}

.draw-layout {
  display: grid;
  grid-template-columns: 135px 1fr;
  gap: 16px;
}

.face-drawing {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 145px;
  border: 1.5px dashed #dda49e;
  border-radius: 16px;
  background: #fffaf8;
}

.face-outline {
  width: 82px;
  height: 82px;
  border: 2px solid #b9827c;
  border-radius: 50%;
}

.face-drawing span {
  margin-top: 7px;
  color: var(--game-muted);
  font-size: 0.82rem;
}

@media (max-width: 980px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1240px);
  }

  .hero__copy,
  .hero__status,
  .panel,
  .worksheet-page {
    padding: 20px;
  }

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

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

  .face-drawing {
    min-height: 120px;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 12mm;
  }

  body {
    margin: 0;
    background: #ffffff;
  }

  .hero,
  .controls-panel,
  .preview-heading,
  .empty-state {
    display: none !important;
  }

  .app-shell {
    width: 100%;
    padding: 0;
  }

  .layout {
    display: block;
  }

  .preview-panel {
    padding: 0;
    border: 0;
    background: transparent;
  }

  .print-area {
    gap: 0;
  }

  .worksheet-page {
    min-height: 270mm;
    padding: 0;
    border: 0;
    border-radius: 0;
    page-break-after: always;
  }

  .worksheet-page:last-child {
    page-break-after: auto;
  }

  .scenario-card {
    border-color: #c9c9cf;
  }
}
