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

@font-face {
  font-family: "BingoBody";
  src: url("/static/fonts/omyu-pretty.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "BingoBody";
  src: url("/static/fonts/omyu-pretty.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
}

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

@font-face {
  font-family: "BingoUi";
  src: url("/static/fonts/Griun_Mongtori-Rg.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

:root {
  --font-ui: "BingoUi", "BingoBody", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-body: "BingoBody", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --bg-main: #f7f8fa;
  --bg-panel: rgba(255, 255, 255, 0.92);
  --bg-panel-strong: #ffffff;
  --ink-main: #15231e;
  --ink-soft: #5c655f;
  --accent: #c64f2d;
  --accent-strong: #9f3417;
  --accent-soft: #f0c8b8;
  --olive: #7b8b4a;
  --olive-soft: #dfe6c8;
  --line: rgba(21, 35, 30, 0.08);
  --line-strong: rgba(21, 35, 30, 0.16);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink-main);
  background:
    radial-gradient(circle at top left, rgba(243, 246, 250, 0.75), transparent 22%),
    radial-gradient(circle at top right, rgba(246, 248, 251, 0.72), transparent 20%),
    linear-gradient(180deg, #ffffff 0%, var(--bg-main) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(21, 35, 30, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 35, 30, 0.015) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.12), transparent 88%);
}

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

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

.hero-copy,
.status-card,
.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(210, 218, 226, 0.7);
  border-radius: var(--radius-xl);
  background: var(--bg-panel);
  backdrop-filter: none;
  box-shadow: none;
}

.hero-copy {
  padding: 38px 40px;
}

.hero-copy::after,
.status-card::after,
.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.28),
    transparent 36%,
    rgba(214, 220, 228, 0.05)
  );
}

.eyebrow,
.panel-step,
.status-label {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.hero h1,
.panel h2,
.empty-state h3 {
  margin: 0;
  font-family: var(--font-ui);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 4.4rem);
  line-height: 1.02;
}

.hero-description {
  max-width: 52ch;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

.status-card {
  padding: 28px;
}

.status-grid {
  display: grid;
  gap: 16px;
  margin: 0;
}

.status-grid div {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(21, 35, 30, 0.08);
}

.status-grid dt {
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.92rem;
}

.status-grid dd {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
}

.layout {
  display: grid;
  gap: 24px;
}

.panel {
  padding: 28px;
}

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

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

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

.field,
.mode-picker {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field span,
.mode-picker legend {
  font-family: var(--font-body);
  font-weight: 700;
}

.field input[type="text"],
.field input[type="number"],
.field input[type="file"] {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  font: inherit;
  color: inherit;
  background: rgba(255, 255, 255, 0.9);
}

.field input:focus,
.mode-option:has(input:focus-visible) {
  outline: 2px solid rgba(198, 79, 45, 0.35);
  outline-offset: 2px;
}

.mode-picker {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.52);
}

.mode-picker legend {
  padding: 0 8px;
}

.mode-option {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  font-family: var(--font-body);
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.58);
}

.mode-option:has(input:checked) {
  border-color: rgba(198, 79, 45, 0.28);
  background: rgba(240, 200, 184, 0.36);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}

button {
  font: inherit;
  cursor: pointer;
}

.primary-button,
.secondary-button,
.remove-button,
.ghost-button {
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.primary-button {
  color: #fffaf5;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: none;
}

.secondary-button {
  color: var(--ink-main);
  background: linear-gradient(135deg, #edf0dc, #d2dfaf);
  box-shadow: none;
}

.remove-button {
  min-height: 40px;
  padding: 0 16px;
  color: var(--accent-strong);
  background: rgba(198, 79, 45, 0.12);
}

.ghost-button {
  min-height: 40px;
  padding: 0 16px;
  color: var(--ink-main);
  background: rgba(226, 232, 218, 0.72);
}

.primary-button:hover,
.secondary-button:hover,
.remove-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled,
.remove-button:disabled,
.ghost-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.helper-text,
.feedback,
.generation-summary {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-family: var(--font-body);
  line-height: 1.6;
}

.feedback[data-tone="error"] {
  color: var(--accent-strong);
  font-weight: 700;
}

.feedback[data-tone="success"] {
  color: #44612e;
  font-weight: 700;
}

.entry-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.entry-file-field {
  margin-bottom: 0;
}

.draft-section,
.entries-block {
  margin-top: 18px;
}

.entries-scroll {
  max-height: 430px;
  overflow: auto;
  padding-right: 6px;
}

.entries-scroll::-webkit-scrollbar {
  width: 10px;
}

.entries-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(21, 35, 30, 0.14);
}

.list-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
  margin-bottom: 12px;
}

.list-heading h3 {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 800;
}

.list-heading p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-family: var(--font-body);
  line-height: 1.6;
}

.draft-actions {
  margin-top: 0;
}

.entries-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.entry-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.entry-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(21, 35, 30, 0.08);
}

.entry-word-preview {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(21, 35, 30, 0.08);
  color: #302016;
  background: #fff8eb;
  font-size: clamp(1.6rem, 6vw, 2.5rem);
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  word-break: keep-all;
}

.entry-card h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.entry-card p {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.92rem;
}

.card-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-action-row .ghost-button,
.card-action-row .remove-button {
  flex: 1 1 0;
}

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

.card-field span {
  font-weight: 700;
}

.card-input {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  font: inherit;
  color: inherit;
  background: rgba(255, 255, 255, 0.96);
}

.card-input:focus {
  outline: 2px solid rgba(198, 79, 45, 0.35);
  outline-offset: 2px;
}

.image-editor {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
}

.image-editor[hidden] {
  display: none;
}

.image-editor-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(247, 249, 252, 0.78);
  backdrop-filter: blur(3px);
}

.image-editor-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
  padding: 24px;
  border: 1px solid rgba(210, 218, 226, 0.88);
  border-radius: 28px;
  background: #ffffff;
}

.image-editor-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.image-editor-viewport {
  position: relative;
  overflow: hidden;
  width: min(100%, 420px);
  aspect-ratio: 1 / 1;
  margin: 18px auto 0;
  border: 2px solid rgba(79, 104, 91, 0.34);
  border-radius: 28px;
  background:
    linear-gradient(rgba(21, 35, 30, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 35, 30, 0.06) 1px, transparent 1px),
    #f6f8fa;
  background-size: 24px 24px, 24px 24px, auto;
  touch-action: none;
  cursor: grab;
}

.image-editor-viewport:active {
  cursor: grabbing;
}

.image-editor-image {
  position: absolute;
  top: 0;
  left: 0;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.image-editor-actions {
  justify-content: end;
  margin-top: 18px;
}

body.editor-open {
  overflow: hidden;
}

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

.empty-state {
  padding: 26px;
  border-radius: 24px;
  border: 1px dashed rgba(21, 35, 30, 0.2);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.8)),
    repeating-linear-gradient(
      -45deg,
      rgba(198, 79, 45, 0.03),
      rgba(198, 79, 45, 0.03) 14px,
      transparent 14px,
      transparent 28px
    );
}

.empty-state p {
  margin: 12px 0 0;
  line-height: 1.7;
  color: var(--ink-soft);
  font-family: var(--font-body);
}

.worksheets {
  display: grid;
  gap: 26px;
  margin-top: 18px;
}

.worksheet {
  --board-size: 4;
  position: relative;
  overflow: hidden;
  width: min(100%, 860px);
  min-height: 1180px;
  margin: 0 auto;
  padding: 42px;
  border-radius: 32px;
  border: 1px solid rgba(21, 35, 30, 0.12);
  background: var(--bg-panel-strong);
  box-shadow: none;
}

.worksheet-content {
  position: relative;
  z-index: 1;
}

.worksheet-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 26px;
}

.worksheet-title-group h3 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
}

.worksheet-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 14px;
}

.meta-chip {
  min-width: 180px;
  padding: 10px 14px;
  border-bottom: 2px solid rgba(21, 35, 30, 0.3);
  font-family: var(--font-body);
  font-weight: 700;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(var(--board-size), minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 760px);
  margin: 0 auto;
  aspect-ratio: 1 / 1;
}

.bingo-cell {
  display: flex;
  flex-direction: column;
  aspect-ratio: 1 / 1;
  min-height: 0;
  overflow: hidden;
  border: 4px solid #4f685b;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 244, 236, 0.98));
  box-shadow: none;
}

.bingo-cell.image-only .cell-media {
  height: 100%;
}

.bingo-cell.image-word .cell-media {
  padding: 6px 6px 0;
}

.bingo-cell.word-only {
  justify-content: center;
}

.cell-media {
  flex: 1 1 auto;
  min-height: 0;
}

.cell-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bingo-cell.image-word .cell-media img {
  border-radius: 10px 10px 0 0;
  object-fit: contain;
  background: #ffffff;
}

.cell-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 10px 8px;
  text-align: center;
  border-top: 3px solid #556d60;
  background: rgba(255, 255, 255, 0.84);
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  font-weight: 800;
  line-height: 1.35;
  word-break: keep-all;
}

.bingo-cell.word-only .cell-label {
  flex: 1 1 auto;
  min-height: 0;
  border-top: 0;
  background: transparent;
  font-size: clamp(1.2rem, 3vw, 2.1rem);
}

.worksheet-footer {
  margin-top: 18px;
  color: var(--ink-soft);
  text-align: right;
  font-size: 0.92rem;
}

code {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(21, 35, 30, 0.08);
  font-family: var(--font-body);
}

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

  .output-heading,
  .list-heading,
  .worksheet-top {
    flex-direction: column;
    align-items: start;
  }

  .worksheet-meta {
    justify-content: start;
  }

  .worksheet {
    padding: 28px;
    min-height: auto;
  }
}

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

  .hero-copy,
  .status-card,
  .panel {
    border-radius: 24px;
  }

  .panel,
  .hero-copy,
  .status-card {
    padding: 22px;
  }

  .field-grid,
  .entry-form {
    grid-template-columns: 1fr;
  }

  .image-editor {
    padding: 14px;
  }

  .image-editor-panel {
    padding: 20px;
    border-radius: 24px;
  }

  .image-editor-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .board-grid {
    gap: 6px;
  }

  .bingo-cell {
    border-width: 3px;
    border-radius: 12px;
  }

  .cell-label {
    min-height: 44px;
    font-size: 0.88rem;
  }

  .bingo-cell.image-word .cell-media {
    padding: 4px 4px 0;
  }

  .meta-chip {
    min-width: min(100%, 220px);
  }
}

@page {
  size: A4 portrait;
  margin: 9mm;
}

body {
  color: #322418;
  background:
    radial-gradient(circle at 18px 18px, rgba(198, 79, 45, 0.07) 0 2px, transparent 3px),
    radial-gradient(circle at 44px 42px, rgba(80, 150, 97, 0.055) 0 2px, transparent 3px),
    linear-gradient(180deg, #fbf0dc 0%, #fffaf1 48%, #f7f1e8 100%);
  background-size: 68px 68px, 68px 68px, auto;
}

.hero-copy,
.status-card,
.panel {
  border-color: rgba(117, 78, 42, 0.14);
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 7px 0 rgba(117, 78, 42, 0.025), 0 12px 26px rgba(83, 56, 22, 0.055);
}

.hero-copy::after,
.status-card::after,
.panel::after {
  display: none;
}

.hero h1,
.panel h2,
.empty-state h3 {
  color: #302016;
  font-family: var(--font-body);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.eyebrow,
.panel-step,
.status-label {
  color: #d45f23;
}

.hero-description,
.helper-text,
.feedback,
.generation-summary,
.list-heading p,
.entry-card p,
.status-grid dt {
  color: #6f5b48;
}

.field input[type="text"],
.field input[type="number"],
.field input[type="file"],
.card-input {
  border-color: rgba(117, 78, 42, 0.16);
  background: #fffaf2;
}

.mode-picker,
.mode-option,
.entry-card,
.empty-state,
.image-editor-panel {
  border-color: rgba(117, 78, 42, 0.13);
  background: rgba(255, 253, 248, 0.9);
}

.mode-option:has(input:checked) {
  border-color: rgba(80, 150, 97, 0.26);
  background: #edf8f1;
}

.primary-button,
.secondary-button,
.remove-button,
.ghost-button {
  border: 1px solid rgba(117, 78, 42, 0.16);
  box-shadow: 0 4px 0 rgba(117, 78, 42, 0.035);
}

.primary-button {
  background: linear-gradient(180deg, #ff9d5f 0%, #ed7432 100%);
  box-shadow: 0 5px 0 rgba(207, 91, 37, 0.1), 0 10px 18px rgba(217, 104, 42, 0.1);
}

.secondary-button,
.ghost-button {
  background: #fffdf8;
}

.remove-button {
  background: #ffe7de;
}

.status-grid div {
  border-color: rgba(117, 78, 42, 0.12);
  background: #fffaf2;
}

/* Premium minimal layer shared with the portal. */
:root {
  --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;
  --bg-main: var(--game-page);
  --bg-panel: var(--game-canvas);
  --bg-panel-strong: var(--game-canvas);
  --ink-main: var(--game-ink);
  --ink-soft: var(--game-muted);
  --accent: var(--game-blue);
  --accent-strong: var(--game-blue);
  --line: var(--game-line);
  --line-strong: var(--game-line);
}

body {
  color: var(--game-ink);
  background: var(--game-page);
  background-size: auto;
}

body::before {
  display: none;
}

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

.hero {
  display: block;
  margin-bottom: 24px;
}

.hero-copy {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 68px;
  padding: 12px 18px;
  border: 1px solid var(--game-line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: none;
}

.hero-copy::after,
.status-card,
.eyebrow,
.hero-description {
  display: none;
}

.hero h1 {
  flex: 1 1 auto;
  color: var(--game-ink);
  font-family: var(--font-body);
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero-actions {
  flex: 0 0 auto;
  margin: 0;
}

.panel,
.entry-card,
.mode-picker,
.mode-option,
.image-editor-panel,
.worksheet {
  border-color: var(--game-line);
  background: var(--game-canvas);
  box-shadow: none;
}

.panel::after {
  display: none;
}

.panel {
  border-radius: 24px;
}

.panel-step {
  color: var(--game-muted);
}

.panel h2,
.empty-state h3,
.worksheet-title-group h3,
.entry-card h3 {
  color: var(--game-ink);
  font-family: var(--font-body);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.field input[type="text"],
.field input[type="number"],
.field input[type="file"],
.card-input {
  border-color: var(--game-line);
  background: var(--game-pearl);
}

.field input:focus,
.mode-option:has(input:focus-visible),
.card-input:focus {
  outline: 2px solid var(--game-blue-focus);
  outline-offset: 2px;
  box-shadow: none;
}

.mode-picker,
.mode-option,
.empty-state,
.entry-word-preview {
  border-color: var(--game-line);
  background: var(--game-pearl);
}

.mode-option:has(input:checked) {
  border-color: var(--game-blue);
  background: #f5f9ff;
}

.primary-button,
.secondary-button,
.remove-button,
.ghost-button {
  border: 1px solid var(--game-line);
  border-radius: var(--game-pill);
  box-shadow: none;
}

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

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

.secondary-button,
.ghost-button {
  color: var(--game-ink);
  background: var(--game-canvas);
}

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

.remove-button {
  color: #b42318;
  background: #fff5f5;
}

.helper-text,
.feedback,
.generation-summary,
.list-heading p,
.entry-card p,
.worksheet-footer {
  color: var(--game-muted);
}

.entry-card img {
  border-color: var(--game-line);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.image-editor-backdrop {
  background: rgba(245, 245, 247, 0.78);
}

.image-editor-viewport {
  border-color: var(--game-line);
  background: var(--game-pearl);
  background-image: none;
}

.worksheet {
  border-radius: 24px;
}

.bingo-cell {
  border-color: #d2d2d7;
  background: #ffffff;
}

.cell-label {
  border-top-color: #d2d2d7;
  background: var(--game-pearl);
}

/* Desktop split layout: controls on the left, worksheet preview on the right. */
.layout {
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  grid-template-areas:
    "controls output"
    "entries entries";
  align-items: start;
}

.controls-panel {
  grid-area: controls;
}

.entries-panel {
  grid-area: entries;
}

.entries-panel {
  display: grid;
  gap: 18px;
  align-content: start;
  grid-template-columns: minmax(0, 1fr);
}

.entries-panel > .panel-heading,
.entries-panel > .entry-form,
.entries-panel > .helper-text,
.entries-panel > .feedback {
  grid-column: 1 / -1;
}

.entries-panel[data-layout="single"] {
  grid-template-columns: minmax(0, 1fr);
}

.entries-panel[data-layout="single"] .draft-section,
.entries-panel[data-layout="single"] .entries-block {
  margin-top: 0;
}

.output-panel {
  grid-area: output;
  align-self: start;
}

.empty-state {
  min-height: 240px;
  padding: 24px;
  place-items: center;
}

@media (max-width: 980px) {
  /* 생성 결과가 세트 목록에 밀려 화면 밖으로 사라지지 않도록
     결과를 컨트롤 바로 아래에 두고, 세트 목록은 내부 스크롤로 접는다. */
  .layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "controls"
      "output"
      "entries";
  }

  .entries-panel[data-layout="single"] {
    grid-template-columns: 1fr;
  }

  .entries-scroll {
    max-height: min(62vh, 520px);
  }

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

  .entry-card {
    padding: 10px;
    gap: 8px;
  }

  .entry-card h3 {
    font-size: 0.98rem;
  }
}

@media print {
  body {
    background: #ffffff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body::before,
  .hero,
  .controls-panel,
  .entries-panel,
  .output-heading,
  .generation-summary,
  .empty-state {
    display: none !important;
  }

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

  .layout,
  .output-panel,
  .worksheets {
    display: block;
    gap: 0;
    margin: 0;
    padding: 0;
    box-shadow: none;
    border: 0;
    background: transparent;
  }

  .output-panel::after {
    display: none;
  }

  .output-panel {
    padding: 0;
  }

  .worksheet {
    width: 184mm;
    min-height: 260mm;
    margin: 0 auto;
    padding: 7mm;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    break-after: page;
    page-break-after: always;
  }

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

  .worksheet-footer {
    color: #59615b;
  }

  .board-grid {
    gap: 2.5mm;
    width: min(100%, 158mm);
  }

  .bingo-cell {
    border-width: 1.1mm;
    border-radius: 4.5mm;
    box-shadow: none;
  }

  .cell-label {
    min-height: 10mm;
    padding: 1.8mm 1.4mm;
    font-size: 8.5pt;
    border-top-width: 0.9mm;
  }

  .worksheet-top {
    margin-bottom: 5mm;
  }

  .meta-chip {
    min-width: 50mm;
    padding: 2.2mm 3mm;
    font-size: 9.5pt;
  }
}
