﻿@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;
  --success-soft: #edf8f1;
  --warning-soft: #fff5e8;
  --chip-border: #d6d6db;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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,
.score-page,
.empty-state {
  border: 1px solid var(--game-line);
  border-radius: 24px;
  background: var(--game-canvas);
  box-shadow: none;
}

.hero__copy {
  padding: 28px 30px;
}

.hero__copy h1,
.panel-heading h2,
.empty-state h3,
.worksheet-title,
.score-title {
  margin: 0;
  color: var(--game-ink);
  font-family: var(--font-body);
  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);
  font-size: 1rem;
  line-height: 1.72;
}

.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;
}

.status-list {
  display: grid;
  gap: 14px;
  margin: 18px 0 0;
}

.status-list div {
  padding: 14px 16px;
  border: 1px solid var(--game-line);
  border-radius: 18px;
  background: var(--game-pearl);
}

.status-list dt {
  color: var(--game-muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.status-list dd {
  margin: 6px 0 0;
  color: var(--game-ink);
  font-size: 1rem;
  font-weight: 800;
}

.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);
  box-shadow: none;
  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(380px, 460px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.panel,
.preview-panel {
  padding: 28px;
}

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

.panel-heading h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.preview-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.summary,
.empty-state p,
.helper-copy,
.sheet-subcopy,
.sheet-note {
  color: var(--game-muted);
}

.summary {
  max-width: 32ch;
  margin: 4px 0 0;
  font-size: 0.95rem;
  text-align: right;
}

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

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

.field span,
.option-card legend {
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--game-line);
  border-radius: 18px;
  background: var(--game-pearl);
  color: var(--game-ink);
  outline: none;
}

.field input,
.field select {
  min-height: 52px;
  padding: 0 16px;
}

.field textarea {
  min-height: 120px;
  padding: 14px 16px;
  resize: vertical;
  line-height: 1.65;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--game-blue);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.12);
}

.field-hint {
  color: var(--game-muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.field-grid {
  display: grid;
  gap: 12px;
}

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

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

.option-card {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--game-line);
  border-radius: 24px;
  background: var(--game-pearl);
}

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

.chip-grid--vowels {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.chip-option,
.toggle-stack label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--chip-border);
  border-radius: var(--game-pill);
  background: var(--game-canvas);
  color: var(--game-muted);
  font-weight: 700;
}

.chip-option input,
.toggle-stack input {
  width: 18px;
  height: 18px;
  accent-color: var(--game-blue);
}

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

.helper-copy,
.feedback {
  margin: 0;
  font-size: 0.95rem;
}

.feedback {
  min-height: 24px;
  font-weight: 800;
}

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

.feedback.is-success {
  color: var(--game-blue);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 420px;
  padding: 36px;
  border-style: dashed;
  text-align: center;
}

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

.empty-state p {
  max-width: 44ch;
  margin: 12px 0 0;
  line-height: 1.65;
}

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

.worksheet-page,
.score-page {
  padding: 28px;
}

.sheet-header {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--game-line);
}

.sheet-header--inline {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.worksheet-title,
.score-title {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
}

.sheet-meta,
.sheet-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sheet-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--game-line);
  border-radius: 999px;
  background: var(--game-pearl);
  color: var(--game-ink);
  font-size: 0.88rem;
  font-weight: 800;
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.sheet-table th,
.sheet-table td {
  padding: 10px 8px;
  border: 1px solid var(--game-line);
  text-align: center;
  vertical-align: middle;
}

.sheet-table th {
  background: var(--game-pearl);
  font-size: 0.92rem;
  font-weight: 800;
}

.sheet-table td {
  font-size: 0.95rem;
}

.sheet-table td.word-cell {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.sheet-table td.align-left,
.sheet-table th.align-left {
  text-align: left;
}

.score-note {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--game-line);
  border-radius: 18px;
  background: var(--game-pearl);
  color: var(--game-muted);
  line-height: 1.65;
}

.score-cell {
  min-height: 42px;
}

.status-good {
  color: #197149;
}

.status-warn {
  color: #8b5d12;
}

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

  .summary {
    text-align: left;
  }
}

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

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

  .field-grid--double,
  .field-grid--triple,
  .chip-grid,
  .chip-grid--vowels,
  .sheet-header--inline,
  .preview-heading {
    grid-template-columns: 1fr;
    display: grid;
  }

  .sheet-table {
    font-size: 0.88rem;
  }
}

@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,
  .score-page {
    page-break-after: always;
    width: 184mm;
    min-height: 260mm;
    margin: 0 auto;
    padding: 6mm 5mm;
    box-sizing: border-box;
    border: 0;
    border-radius: 0;
  }

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

  .sheet-table th,
  .sheet-table td {
    padding: 7px 6px;
    font-size: 10.5pt;
  }

  .sheet-table td.word-cell {
    font-size: 12pt;
  }
}

.option-card.is-disabled {
  opacity: 0.58;
}

.sheet-subcopy {
  margin: 0;
  line-height: 1.65;
}

