:root {
  --bg-parchment: #fbf7ee;
  --bg-card: #fffdf7;
  --bg-warm: #f2ead9;
  --ink-forest: #1b3a2d;
  --ink-muted: #52685b;
  --accent-amber: #d9732e;
  --accent-amber-hover: #c35f1d;
  --accent-moss: #2b624b;
  --accent-moss-hover: #214e3b;
  --border-warm: #e4d8c0;
  --shadow-soft: 0 10px 28px rgba(31, 51, 38, 0.08);
  --radius-lg: 18px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top center, #fffdf7 0%, var(--bg-parchment) 60%, #efe5d1 100%);
  color: var(--ink-forest);
  font-family: "Noto Sans", "DejaVu Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

.page-shell {
  max-width: 1220px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

.hero-header {
  background: var(--bg-card);
  border: 1.5px solid var(--border-warm);
  border-radius: 24px;
  padding: 28px 30px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 28px;
}

.hero-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.print-locale-select {
  appearance: auto;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--border-warm);
  background: var(--bg-parchment);
  color: var(--ink-forest);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #e8f3ec;
  color: var(--accent-moss);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
}

.hero-header h1 {
  margin: 14px 0 4px;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1.18;
  color: var(--ink-forest);
}

.print-world-subtitle {
  margin: 0 0 10px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent-moss);
}

.hero-sub {
  margin: 0;
  max-width: 78ch;
  color: var(--ink-muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.world-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.world-tab {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border-warm);
  background: var(--bg-parchment);
  color: var(--ink-forest);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
}

.world-tab.active {
  background: var(--accent-moss);
  border-color: var(--accent-moss);
  color: #fffdf7;
}

.sheet-card[hidden],
.print-page.is-filtered-out {
  display: none !important;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-md);
  font-size: 0.96rem;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform 0.14s ease, background-color 0.14s ease, box-shadow 0.14s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent-amber);
  color: #fffdf7;
  box-shadow: 0 6px 16px rgba(217, 115, 46, 0.28);
}

.btn-primary:hover {
  background: var(--accent-amber-hover);
}

.btn-secondary {
  background: var(--accent-moss);
  color: #fffdf7;
  box-shadow: 0 6px 16px rgba(43, 98, 75, 0.22);
}

.btn-secondary:hover {
  background: var(--accent-moss-hover);
}

.btn-ghost {
  background: var(--bg-warm);
  color: var(--ink-forest);
  border-color: var(--border-warm);
}

.btn-ghost:hover {
  background: #eae0cb;
}

.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.tips-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--border-warm);
}

.tip-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--ink-muted);
}

.tip-icon {
  color: var(--accent-moss);
  margin-top: 2px;
}

.sheets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 22px;
}

.sheet-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-warm);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.sheet-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(31, 51, 38, 0.12);
}

.sheet-preview-wrap {
  background: #ffffff;
  border: 1px solid #e7dfd0;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 210 / 297;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sheet-preview-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.sheet-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.sheet-meta h2 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--ink-forest);
}

.sheet-tag {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-warm);
  color: var(--ink-muted);
  white-space: nowrap;
}

.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.sheet-actions .btn-print-one {
  flex: 1;
  background: var(--accent-moss);
  color: #fffdf7;
}

.sheet-actions .btn-print-one:hover {
  background: var(--accent-moss-hover);
}

.print-sheets {
  display: none;
}

@page {
  size: A4 portrait;
  margin: 0;
}

@media print {
  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    width: 210mm;
    background: #ffffff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .no-print {
    display: none !important;
  }

  .print-sheets {
    display: block !important;
  }

  .print-page {
    width: 210mm;
    height: 297mm;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    page-break-after: always;
    break-after: page;
  }

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

  body:not(.print-single) .print-page.is-filtered-out,
  body.print-single .print-page {
    display: none !important;
    page-break-after: auto;
    break-after: auto;
  }

  body.print-single .print-page.is-target {
    display: flex !important;
    page-break-after: auto;
    break-after: auto;
  }

  .print-page img {
    width: 210mm;
    height: 297mm;
    object-fit: contain;
    display: block;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 14px 12px 36px;
  }

  .hero-header {
    padding: 18px 16px;
    border-radius: 18px;
    margin-bottom: 18px;
  }

  .hero-sub {
    font-size: 0.94rem;
  }

  .world-tabs {
    gap: 6px;
  }

  .world-tab {
    padding: 8px 12px;
    font-size: 0.84rem;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar .btn {
    width: 100%;
    text-align: center;
  }

  .nav-links {
    margin-left: 0;
    width: 100%;
    flex-direction: column;
  }

  .tips-box {
    grid-template-columns: 1fr;
  }

  .sheets-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 380px) {
  .page-shell {
    padding: 10px 8px 28px;
  }

  .hero-header {
    padding: 14px 12px;
    border-radius: 16px;
    margin-bottom: 14px;
  }

  .hero-top-row {
    gap: 8px;
  }

  .hero-badge,
  .print-locale-select {
    max-width: 100%;
    font-size: 0.78rem;
  }

  .world-tabs {
    gap: 6px;
  }

  .world-tab {
    padding: 7px 10px;
    font-size: 0.78rem;
  }

  .btn {
    padding: 10px 12px;
    font-size: 0.86rem;
    max-width: 100%;
    white-space: normal;
  }

  .sheet-card {
    padding: 12px;
    gap: 10px;
  }

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

  .sheet-tag {
    max-width: 100%;
    white-space: normal;
  }

  .sheet-actions .btn {
    flex: 1 1 100%;
    width: 100%;
  }
}
