.page-hero { padding: 18px 20px 6px; text-align: center; }
.page-hero h1 { font-size: 2rem; margin: 0 0 8px; }
.page-hero p { color: var(--text-muted); margin: 0; max-width: 480px; margin: 0 auto; }

.screen { padding: 18px 0 28px; }
.hero-block { text-align: center; margin-bottom: 16px; }
.hero-block h1 { font-size: 2.2rem; margin: 0 0 8px; }
.hero-block p { color: var(--text-muted); }
.title-block { padding-top: 18px; }
.title-icon { font-size: 3rem; line-height: 1; margin-bottom: 8px; }
.title-credit { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 18px; }

/* This is a fixed-layout game screen that never needs to scroll — locked
   permanently (not just mid-interaction) so mobile browsers can't
   rubber-band/pull-to-refresh while dragging across the canvas. */
body.no-scroll {
  overflow: hidden;
  height: 100vh;
  overscroll-behavior: none;
  touch-action: none;
}

/* --- difficulty tabs --- */
.difficulty-tabs {
  max-width: 420px; margin: 0 auto 4px; padding: 0 20px;
  display: flex; gap: 8px;
}
.difficulty-tab {
  flex: 1; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text-muted);
  font-weight: 600; font-size: 0.88rem; cursor: pointer;
}
.difficulty-tab.active { background: var(--accent-grad); color: #fff; border-color: transparent; }

/* --- gallery --- */
.gallery-grid {
  max-width: 720px; margin: 0 auto; padding: 16px 20px 20px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px;
}
.gallery-card {
  padding: 12px 12px 14px; text-align: center; cursor: pointer; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: var(--bg-elevated); border-radius: var(--radius-sm);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.gallery-card:active { transform: scale(0.96); }
.gallery-card-preview {
  width: 100%; max-width: 120px; aspect-ratio: 1 / 1; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border);
}
.gallery-card h3 { margin: 0; font-size: 0.9rem; }
.gallery-card .meta { font-size: 0.7rem; color: var(--text-muted); }
.gallery-card .done-badge {
  position: absolute; top: 8px; right: 8px; font-size: 0.9rem;
  background: var(--accent-grad); color: #fff; border-radius: 50%;
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
}

/* --- coloring screen --- */
.color-topbar {
  max-width: 640px; margin: 0 auto 10px; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.color-title { font-weight: 700; font-size: 0.95rem; flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.color-progress { font-size: 0.78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }

.canvas-wrap {
  display: flex; justify-content: center; align-items: center;
  padding: 0 8px; touch-action: none;
}
#board { touch-action: none; border-radius: 8px; }

.palette-bar {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 8px;
  max-width: 640px; margin: 14px auto 0; padding: 0 12px;
}
.palette-swatch {
  position: relative; width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid transparent; cursor: pointer; flex-shrink: 0;
  box-shadow: var(--shadow);
}
.palette-swatch.active { border-color: var(--text); transform: scale(1.1); }
.palette-swatch.done { opacity: 0.35; }
.palette-swatch .count {
  position: absolute; bottom: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 3px;
  border-radius: 9px; background: var(--bg); border: 1px solid var(--border);
  font-size: 0.62rem; font-weight: 700; color: var(--text);
  display: flex; align-items: center; justify-content: center;
}

/* --- completion overlay --- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10, 10, 16, 0.55);
  display: flex; align-items: center; justify-content: center; z-index: 250; padding: 24px;
}
.modal { max-width: 380px; width: 100%; padding: 28px; text-align: center; }
.modal h2 { margin: 0 0 8px; }
.done-icon { font-size: 3rem; margin-bottom: 4px; }
.modal-score { color: var(--text-muted); font-size: 0.92rem; margin: 0 0 20px; }
.modal .btn { width: 100%; justify-content: center; }

@media (max-width: 380px) {
  .color-title { font-size: 0.85rem; }
  .palette-swatch { width: 38px; height: 38px; }
}
