/* Dashboard v2 and Nigate dictionary. Loaded after styles.css so this layer can
   safely own the progression dialogs without touching the game screens. */
:root {
  --dashboard-ink: #302851;
  --dashboard-muted: #6e6483;
  --dashboard-pink: #ed7e9f;
  --dashboard-deep-pink: #b83261;
  --dashboard-lavender: #a79add;
  --dashboard-mint: #8fd8c4;
  --dashboard-gold: #f3c85b;
  --dashboard-cream: #fff9f0;
  --dashboard-surface: #fffdfb;
  --dashboard-border: #eadbea;
  --dashboard-shadow: 0 12px 30px rgb(93 61 103 / 12%);
  --dashboard-radius: 18px;
  --dash-good: #237a62;
  --dash-good-bg: #e3f6ef;
  --dash-bad: #b83261;
  --dash-bad-bg: #fde8ef;
}

/* ---------- start screen entry buttons ---------- */
.dashboard-entry-button {
  display: inline-flex !important;
  position: relative;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 156px;
  padding: 9px 18px !important;
  border: 0 !important;
  border-radius: 14px !important;
  color: #fff !important;
  background: var(--dashboard-deep-pink) !important;
  box-shadow: 0 7px 16px rgb(184 50 97 / 24%);
  font-weight: 950;
  text-decoration: none;
}
.dashboard-entry-button .dashboard-entry-icon { color: var(--dashboard-gold); font-size: 1.1rem; line-height: 1; }
.dashboard-entry-button .button-label,
.has-generated-art .dashboard-entry-button .button-label { position: static !important; width: auto !important; height: auto !important; overflow: visible !important; clip: auto !important; color: inherit; font-size: .88rem; white-space: nowrap; }
.dashboard-entry-button:hover { background: #9f2b54 !important; }
.dashboard-entry-button:focus-visible { outline: 3px solid var(--dashboard-gold); outline-offset: 3px; }
.livehouse-entry-button,
.livehouse-entry-button .button-label,
.livehouse-entry-button .dashboard-entry-icon { color: #fff !important; }
.livehouse-entry-button { background: #423069 !important; }
.livehouse-entry-button:hover { background: #2f214f !important; }
.nigate-entry-button { background: #5b4a9e !important; }
.nigate-entry-button:hover { background: #47398a !important; }

.start-entry-row { display: flex; gap: 8px; justify-content: center; width: 100%; margin: 3px auto 0; }
.start-entry-row > button { flex: 1 1 0; min-width: 0 !important; max-width: 210px; height: 44px !important; margin: 0 !important; padding-inline: 8px !important; transform: none !important; }
.entry-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 99px;
  color: #302851;
  background: var(--dashboard-gold);
  font-size: .72rem;
  font-weight: 950;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.entry-badge[hidden] { display: none; }

/* ---------- dialogs ---------- */
.dashboard-dialog {
  width: min(1180px, calc(100vw - 32px));
  max-width: 1180px;
  height: min(92dvh, 920px);
  max-height: min(92dvh, 920px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 26px;
  color: var(--dashboard-ink);
  background: var(--dashboard-cream);
  box-shadow: 0 24px 70px rgb(48 40 81 / 28%);
}
.dashboard-dialog.nigate-dialog { width: min(1040px, calc(100vw - 32px)); }
.dashboard-dialog::backdrop { background: rgb(48 40 81 / 55%); backdrop-filter: blur(4px); }
.dashboard-dialog .progression-panel-card {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  max-height: none;
  padding: 20px 22px 14px;
  overflow: hidden;
  border: 0;
  border-radius: inherit;
  background: var(--dashboard-cream);
}
.dashboard-dialog.nigate-dialog .progression-panel-card { grid-template-rows: auto minmax(0, 1fr); }
.dashboard-dialog .progression-panel-head { min-height: 48px; gap: 10px; padding-bottom: 10px; }
.dashboard-dialog .progression-panel-head h2 { flex: 1 1 auto; min-width: 0; margin: 0; color: var(--dashboard-ink); font-size: clamp(1.2rem, 2vw, 1.55rem); letter-spacing: .02em; }
.dashboard-dialog .progression-panel-head .icon-button {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--dashboard-border);
  border-radius: 14px;
  color: var(--dashboard-ink);
  background: var(--dashboard-surface);
  box-shadow: 0 3px 10px rgb(48 40 81 / 9%);
}
.dash-header-link {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 6px 14px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: #423069;
  font: inherit;
  font-size: .82rem;
  font-weight: 950;
  white-space: nowrap;
  cursor: pointer;
}
.dash-header-link:hover { background: #2f214f; }
.dashboard-dialog .progression-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; }
.dashboard-dialog .progression-tabs button {
  min-width: 0;
  min-height: 46px;
  padding: 8px 6px;
  border: 1px solid var(--dashboard-border);
  border-radius: 14px;
  color: var(--dashboard-muted);
  background: var(--dashboard-surface);
  font-size: .86rem;
  font-weight: 900;
  white-space: nowrap;
}
.dashboard-dialog .progression-tabs button[aria-selected="true"] { color: #fff; border-color: transparent; background: var(--dashboard-deep-pink); box-shadow: 0 5px 12px rgb(216 77 124 / 22%); }
.dashboard-dialog .progression-panel-content {
  display: block;
  align-content: start;
  min-height: 0;
  overflow: auto;
  padding: 2px 2px 10px;
  color: var(--dashboard-ink);
  font-size: .9rem;
  font-weight: 700;
  scrollbar-width: thin;
}
.dashboard-dialog :is(button, input, select, summary, [tabindex]):focus-visible { outline: 3px solid var(--dashboard-gold); outline-offset: 2px; }

/* ---------- shared primitives ---------- */
.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: start; }
.dash-home { align-items: stretch; }
.dash-span-12 { grid-column: span 12; }
.dash-span-6 { grid-column: span 6; }
.dash-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--dashboard-border);
  border-radius: var(--dashboard-radius);
  background: #fff;
  box-shadow: var(--dashboard-shadow);
}
.dash-card h3, .dash-section-head h3 { margin: 0; color: var(--dashboard-ink); font-size: 1.02rem; font-weight: 900; }
.dash-card h4 { margin: 0; font-size: .95rem; font-weight: 900; }
.dash-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.dash-card-head small, .dash-muted, .dash-note, .dash-meta { color: var(--dashboard-muted); font-size: .74rem; font-weight: 700; }
.dash-note { margin: 10px 0 0; line-height: 1.55; }
.dash-section-head { margin: 4px 0 8px; }
.dash-card-foot { margin-top: 12px; text-align: right; }
.dash-empty-line { margin: 4px 0 8px; padding: 14px 10px; border: 1px dashed #d9c9df; border-radius: 14px; color: var(--dashboard-muted); background: #fffdfd; font-size: .84rem; text-align: center; line-height: 1.55; }
.dash-eyebrow { color: var(--dashboard-deep-pink); font-size: .74rem; font-weight: 900; letter-spacing: .06em; }
.dash-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dash-notice { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; color: #6a4b00; background: #fff3c4; font-size: .84rem; font-weight: 800; }
.dash-content { min-width: 0; }

.dash-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 14px;
  border: 1px solid #c4b8e8;
  border-radius: 13px;
  color: var(--dashboard-ink);
  background: #f3f0ff;
  font: inherit;
  font-size: .86rem;
  font-weight: 900;
  line-height: 1.25;
  cursor: pointer;
}
.dash-btn:hover:not(:disabled) { background: #e8e2ff; }
.dash-btn--primary { border-color: var(--dashboard-deep-pink); color: #fff; background: var(--dashboard-deep-pink); }
.dash-btn--primary:hover:not(:disabled) { background: #9f2b54; }
.dash-btn:disabled { border-color: #d9d2d9; color: #8d8790; background: #eee9ed; box-shadow: none; cursor: not-allowed; }
.dash-btn[aria-pressed="true"] { border-color: #7f72bd; background: #d5cff5; box-shadow: inset 0 -3px #7f72bd; }
.dash-btn.is-equipped { border-color: #a3dece; color: #246e5b; background: #dff5ee; }
.dash-link { min-height: 44px; padding: 6px 4px; border: 0; color: var(--dashboard-deep-pink); background: none; font: inherit; font-size: .84rem; font-weight: 900; text-decoration: underline; cursor: pointer; }
.dash-row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.dash-bar { display: block; width: 100%; height: 10px; overflow: hidden; border: 0; border-radius: 99px; background: #f0e9ef; appearance: none; -webkit-appearance: none; }
.dash-bar::-webkit-progress-bar { background: #f0e9ef; border-radius: 99px; }
.dash-bar::-webkit-progress-value { border-radius: 99px; background: linear-gradient(90deg, var(--dashboard-pink), var(--dashboard-deep-pink)); transition: width .6s ease; }
.dash-bar::-moz-progress-bar { border-radius: 99px; background: linear-gradient(90deg, var(--dashboard-pink), var(--dashboard-deep-pink)); }
.dash-bar.is-done::-webkit-progress-value, .dash-bar.is-mint::-webkit-progress-value { background: var(--dashboard-mint); }
.dash-bar.is-done::-moz-progress-bar { background: var(--dashboard-mint); }

.dash-chip { display: inline-flex; align-items: center; gap: 3px; max-width: 100%; padding: 3px 9px; border-radius: 99px; font-size: .72rem; font-weight: 900; line-height: 1.3; }
.dash-chip.is-good { color: var(--dash-good); background: var(--dash-good-bg); }
.dash-chip.is-bad { color: var(--dash-bad); background: var(--dash-bad-bg); }
.dash-chip.is-muted { color: var(--dashboard-muted); background: #f3eef4; }

.dash-symbol { display: inline-grid; flex: 0 0 auto; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--sym-color); background: var(--sym-bg); font-size: 1.1rem; font-weight: 950; }
.dash-symbol.is-locked { filter: saturate(.2); opacity: .7; }

.dash-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 8px 0 0; color: var(--dashboard-muted); font-size: .72rem; font-weight: 800; }
.dash-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.dash-swatch { display: inline-block; width: 11px; height: 11px; margin-right: 3px; border-radius: 3px; vertical-align: -1px; }
.dash-swatch.is-hatch { background: repeating-linear-gradient(45deg, #f6f0f7 0 3px, #d9cfe0 3px 5px); }
.dash-chart-box { min-width: 0; }
.dash-chart-box svg { display: block; width: 100%; height: auto; overflow: visible; }
.dash-chart-empty { display: grid; min-height: 120px; place-items: center; margin: 0; border: 1px dashed #d9c9df; border-radius: 14px; color: var(--dashboard-muted); font-size: .84rem; text-align: center; padding: 12px; }

/* ---------- home ---------- */
.dash-hero {
  position: relative;
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-areas: "mascot greet rank streak" "mascot greet rank cta";
  align-items: center;
  gap: 6px 18px;
  min-height: 150px;
  padding: 14px 20px 14px 10px;
  overflow: hidden;
  border: 1px solid #f2cadc;
  border-radius: 22px;
  background: linear-gradient(115deg, #ffe3ee 0%, #f1e2fa 60%, #e0f6ef 100%);
  box-shadow: var(--dashboard-shadow);
}
.dash-hero-mascot { grid-area: mascot; align-self: end; justify-self: center; width: auto; max-width: 100%; height: 140px; max-height: 140px; margin-bottom: -14px; object-fit: contain; object-position: bottom center; }
.dash-hero-greet { grid-area: greet; min-width: 0; }
.dash-hello { margin: 0; color: var(--dashboard-ink); font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 950; line-height: 1.1; }
.dash-hero-sub { margin: 8px 0 0; color: var(--dashboard-ink); font-size: .92rem; font-weight: 800; line-height: 1.45; }
.dash-hero-rank { grid-area: rank; display: grid; gap: 5px; min-width: 0; padding: 12px 14px; border-radius: 16px; background: rgb(255 255 255 / 62%); }
.dash-rank-name { color: var(--dashboard-ink); font-size: clamp(1.25rem, 2.2vw, 1.7rem); font-weight: 950; line-height: 1.15; overflow-wrap: anywhere; }
.dash-hero-rank small { color: var(--dashboard-muted); font-size: .76rem; font-weight: 800; line-height: 1.4; }
.dash-hero-streak { grid-area: streak; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; }
.dash-streak-num { color: var(--dashboard-deep-pink); font-size: 2.1rem; font-weight: 950; line-height: 1; font-variant-numeric: tabular-nums; }
.dash-streak-num small { margin-left: 2px; font-size: 1rem; }
.dash-streak-label { color: var(--dashboard-ink); font-size: .84rem; font-weight: 900; }
.dash-streak-label.is-warn { color: #8a4b00; }
.dash-streak-start { margin: 0; color: var(--dashboard-ink); font-size: .92rem; font-weight: 900; line-height: 1.4; }
.dash-hero-streak > small { flex-basis: 100%; color: var(--dashboard-muted); font-size: .72rem; font-weight: 800; }
.dash-hero-cta { grid-area: cta; display: flex; justify-content: flex-start; }
.dash-hero-cta .dash-btn { width: 100%; max-width: 280px; }

.dash-kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.dash-kpi { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 16px; }
.dash-kpi-label { margin: 0; color: var(--dashboard-muted); font-size: .76rem; font-weight: 900; }
.dash-kpi-value { margin: 0; color: var(--dashboard-ink); font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 950; line-height: 1.05; font-variant-numeric: tabular-nums; }
.dash-kpi-value small { margin-left: 2px; font-size: .55em; font-weight: 900; color: var(--dashboard-muted); }
.dash-kpi-value.is-empty { color: #a79fb5; }
.dash-kpi-spark { width: 100%; margin-top: auto; }
.dash-kpi-spark svg { display: block; width: 100%; max-width: 160px; height: 32px; }

.dash-goal-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.dash-goal { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.dash-goal-mark { display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid #d4c8dc; border-radius: 50%; color: transparent; font-size: .8rem; font-weight: 950; }
.dash-goal.is-done .dash-goal-mark { border-color: var(--dashboard-mint); color: #fff; background: #3fae8f; }
.dash-goal-body p { margin: 0 0 6px; font-size: .88rem; font-weight: 800; line-height: 1.35; }
.dash-goal-count { color: var(--dashboard-muted); font-size: .8rem; font-weight: 900; font-variant-numeric: tabular-nums; }

.dash-compare-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 2px 10px; padding: 8px 0; border-top: 1px solid #f1e6f1; }
.dash-compare-label { color: var(--dashboard-muted); font-size: .78rem; font-weight: 800; }
.dash-compare-row strong { font-size: 1rem; font-variant-numeric: tabular-nums; text-align: right; }
.dash-compare-row .dash-chip { justify-self: end; }

.dash-action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.dash-action { display: flex; flex-direction: column; gap: 8px; }
.dash-action p { margin: 0; color: var(--dashboard-muted); font-size: .82rem; line-height: 1.5; }
.dash-action .dash-btn { margin-top: auto; align-self: flex-start; }
.dash-action.is-first { border-color: #f0b4cb; background: #fff7fa; }

.dash-near-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.dash-near-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.dash-near-body { display: grid; gap: 4px; min-width: 0; }
.dash-near-body strong { font-size: .92rem; }
.dash-near-body small { color: var(--dashboard-muted); font-size: .72rem; font-weight: 700; line-height: 1.4; }
.dash-near-remaining { color: var(--dashboard-deep-pink); font-size: .8rem; font-weight: 950; white-space: nowrap; }

.dash-nigate-count { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 0 0 10px; font-size: .92rem; font-weight: 800; }
.dash-nigate-count strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.dash-sep { color: #cbbfd2; }
.dash-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dash-word-chip { padding: 4px 10px; border-radius: 99px; color: #55468b; background: #ece6ff; font-size: .82rem; font-weight: 800; }
.dash-word-chip b { margin-left: 3px; color: var(--dashboard-deep-pink); font-weight: 950; }

/* ---------- growth ---------- */
.dash-period { display: flex; }
.dash-segment { display: inline-flex; gap: 0; padding: 3px; border-radius: 14px; background: #f1ebf6; }
.dash-segment button { min-width: 72px; min-height: 44px; padding: 6px 16px; border: 0; border-radius: 11px; color: var(--dashboard-muted); background: transparent; font: inherit; font-weight: 900; cursor: pointer; }
.dash-segment button[aria-pressed="true"] { color: var(--dashboard-ink); background: #fff; box-shadow: 0 2px 8px rgb(48 40 81 / 14%); }
.dash-summary-chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.dash-summary-chip { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--dashboard-border); border-radius: 14px; background: #fff; }
.dash-summary-chip span { color: var(--dashboard-muted); font-size: .72rem; font-weight: 800; }
.dash-summary-chip strong { font-size: 1.15rem; font-weight: 950; font-variant-numeric: tabular-nums; }
.dash-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dash-data-details { margin-top: 8px; color: var(--dashboard-muted); font-size: .8rem; font-weight: 800; }
.dash-data-details summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; }
.dash-data-table { width: 100%; margin-top: 4px; border-collapse: collapse; color: var(--dashboard-ink); font-size: .76rem; font-variant-numeric: tabular-nums; }
.dash-data-table caption { margin-bottom: 4px; text-align: left; color: var(--dashboard-muted); font-weight: 900; }
.dash-data-table th, .dash-data-table td { padding: 5px 8px; border-bottom: 1px solid var(--dashboard-border); text-align: right; font-weight: 700; }
.dash-data-table th:first-child, .dash-data-table td:first-child { text-align: left; }

.dash-heat-card { display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); grid-template-areas: "head head" "heat note" "heat legend"; grid-template-rows: auto auto 1fr; gap: 6px 28px; align-items: start; }
.dash-heat-card .dash-card-head { grid-area: head; margin-bottom: 4px; }
.dash-heat { grid-area: heat; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.dash-heat-card > .dash-note { grid-area: note; align-self: start; margin: 0; font-size: .82rem; }
.dash-heat-legend { grid-area: legend; align-self: end; margin: 0; }
.dash-heat-dow { text-align: center; color: var(--dashboard-muted); font-size: .72rem; font-weight: 900; }
.dash-heat-cell { position: relative; display: grid; place-items: center; box-sizing: border-box; aspect-ratio: 1; min-height: 28px; border: 2px solid transparent; border-radius: 8px; color: var(--dashboard-ink); background: #f5eff6; font-size: .7rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.dash-legend .dash-heat-cell { display: inline-block; width: 16px; min-height: 16px; height: 16px; aspect-ratio: auto; border-radius: 4px; }
.dash-heat-cell.l1 { background: #fbd9e5; }
.dash-heat-cell.l2 { background: #f4a9c1; }
.dash-heat-cell.l3 { color: #fff; background: #e0678f; }
.dash-heat-cell.l4 { color: #fff; background: #b83261; }
.dash-heat-cell.is-unknown { color: #b0a6ba; background: repeating-linear-gradient(45deg, #f7f2f8 0 4px, #e6dded 4px 6px); }
.dash-heat-cell.is-protected { border-color: var(--dashboard-gold); }
.dash-heat-cell.is-today { outline: 2px solid var(--dashboard-gold); outline-offset: 1px; }
.dash-heat-cell.is-future { visibility: hidden; }
.dash-heat-cell.has-login::after { position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border: 1px solid #fff; border-radius: 50%; background: #3fcfa6; content: ""; }
.dash-legend .dash-heat-cell.has-login::after { top: 1px; right: 1px; width: 6px; height: 6px; }

.dash-dir-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dash-dir { padding: 12px 14px; border-radius: 14px; background: #faf6fb; }
.dash-dir dl { display: grid; gap: 6px; margin: 8px 0 0; }
.dash-dir dl > div { display: flex; justify-content: space-between; gap: 10px; font-size: .84rem; }
.dash-dir dt { color: var(--dashboard-muted); font-weight: 800; }
.dash-dir dd { margin: 0; font-weight: 950; font-variant-numeric: tabular-nums; }
.dash-insight { margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; color: #4a3a8c; background: #ece6ff; font-size: .86rem; font-weight: 800; line-height: 1.5; }
.dash-highlight-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.dash-highlight-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 10px 12px; border-radius: 12px; background: #f1fbf7; font-size: .84rem; }

/* ---------- trophies ---------- */
.dash-title-summary { display: flex; align-items: center; gap: 16px; }
.dash-ring svg { display: block; }
.dash-title-summary h3 { font-size: 1.25rem; }
.dash-title-summary p { margin: 4px 0 0; }
.dash-steps { display: flex; gap: 6px; margin: 0; padding: 4px 2px 8px; overflow-x: auto; list-style: none; scrollbar-width: thin; }
.dash-step { position: relative; display: grid; flex: 1 0 96px; justify-items: center; gap: 4px; padding: 10px 6px; border-radius: 14px; color: #a79fb5; background: #f6f1f7; text-align: center; }
.dash-step-character { width: 72px; height: 72px; object-fit: contain; }
.dash-step strong { font-size: .8rem; font-weight: 900; line-height: 1.25; }
.dash-step small { font-size: .7rem; font-weight: 800; }
.dash-step-dot { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; background: #d9d0df; font-size: .72rem; font-weight: 950; }
.dash-step.is-past { color: var(--dashboard-ink); background: #e3f6ef; }
.dash-step.is-past .dash-step-dot { background: #3fae8f; }
.dash-step.is-current { color: #fff; background: var(--dashboard-deep-pink); box-shadow: 0 6px 14px rgb(184 50 97 / 28%); }
.dash-step.is-current .dash-step-dot { color: var(--dashboard-deep-pink); background: #fff; }
.dash-filter-row { display: flex; gap: 8px; }
.dash-filter { min-width: 84px; min-height: 44px; padding: 6px 14px; border: 1px solid var(--dashboard-border); border-radius: 99px; color: var(--dashboard-muted); background: #fff; font: inherit; font-size: .84rem; font-weight: 900; cursor: pointer; }
.dash-filter[aria-pressed="true"] { color: #fff; border-color: transparent; background: #5b4a9e; }
.dash-near-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.dash-near-card { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; align-items: start; }
.dash-near-card > div { display: grid; gap: 4px; min-width: 0; }
.dash-near-card small { color: var(--dashboard-muted); font-size: .72rem; line-height: 1.4; }
.dash-title-progress { color: var(--dashboard-deep-pink); font-size: .76rem; font-weight: 900; }
.dash-series-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.dash-series-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dash-series-head h3 { flex: 1 1 auto; }
.dash-series-count { color: var(--dashboard-muted); font-size: .84rem; font-weight: 950; font-variant-numeric: tabular-nums; }
.dash-title-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.dash-title-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; align-items: start; gap: 8px; padding: 9px 10px; border-radius: 12px; background: #faf7fb; }
.dash-title-mark { display: grid; place-items: center; height: 22px; font-size: .9rem; font-weight: 950; }
.dash-title-body { display: grid; gap: 4px; min-width: 0; }
.dash-title-body strong { font-size: .9rem; overflow-wrap: anywhere; }
.dash-title-cond, .dash-title-hint { color: var(--dashboard-muted); font-size: .72rem; font-weight: 700; line-height: 1.45; }
.dash-title-reward { color: #7a5b00; font-size: .74rem; font-weight: 900; }
.dash-title-date { padding-top: 2px; color: var(--dashboard-muted); font-size: .72rem; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dash-title-row.is-earned { background: #fff7de; }
.dash-title-row.is-earned .dash-title-mark { color: #b88400; }
.dash-title-row.is-next { grid-template-columns: 22px minmax(0, 1fr); background: #fff; border: 1px solid #f0c3d4; }
.dash-title-mark.is-next { color: var(--dashboard-deep-pink); font-size: .72rem; }
.dash-title-row.is-locked { opacity: .72; filter: saturate(.3); }
.dash-new-pill { align-self: start; padding: 2px 8px; border-radius: 99px; color: #fff; background: var(--dashboard-deep-pink); font-size: .66rem; font-weight: 950; letter-spacing: .04em; animation: dash-pulse 2.4s ease-in-out infinite; }
@keyframes dash-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .62; } }

.dash-slot-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.dashboard-dialog .progression-tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.dashboard-dialog .progression-tabs button { white-space: normal; overflow-wrap: anywhere; line-height: 1.15; }
.dash-slot-select { display: none; }
.dash-reward-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dash-reward { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 12px; border: 1px solid var(--dashboard-border); border-radius: 15px; background: #fff; }
.dash-reward p { margin: 0; color: var(--dashboard-muted); font-size: .74rem; line-height: 1.45; }
.dash-reward .dash-btn { margin-top: auto; }
.dash-reward.is-owned { border-color: #f0c65d; background: #fff9df; }
.dash-reward.is-locked { opacity: .78; }
.dash-reward-art { display: block; width: 100%; height: 72px; object-fit: contain; }

/* ---------- books ---------- */
.dash-book-list { display: grid; gap: 14px; }
.dash-book-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 240px; align-items: center; gap: 6px 16px; }
.dash-book-name { display: grid; gap: 2px; }
.dash-clear { color: #246e5b; font-size: .76rem; font-weight: 950; }
.dash-stack { display: flex; height: 16px; overflow: hidden; border-radius: 99px; background: #eee6f0; }
.dash-seg { display: block; min-width: 3px; }
.dash-seg.is-mastered, .dash-seg-swatch.is-mastered { background: #5cc4a6; }
.dash-seg.is-learning, .dash-seg-swatch.is-learning { background: #f3c85b; }
.dash-seg.is-review, .dash-seg-swatch.is-review { background: #a79add; }
.dash-seg.is-unseen, .dash-seg-swatch.is-unseen { background: #eee6f0; }
.dash-seg-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.dash-book-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .8rem; font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-word-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.dash-word-controls input, .dash-word-controls select { min-height: 44px; min-width: 0; padding: 8px 12px; border: 1px solid var(--dashboard-border); border-radius: 12px; color: var(--dashboard-ink); background: #fff; font: inherit; font-weight: 700; }
.dash-word-controls input { flex: 1 1 200px; }
.dash-word-list ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.dash-word-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; min-width: 0; padding: 10px 12px; border: 1px solid var(--dashboard-border); border-radius: 12px; background: #fff; }
.dash-word-main { display: grid; gap: 1px; min-width: 0; overflow-wrap: anywhere; }
.dash-word-main strong { font-size: 1rem; font-weight: 900; }
.dash-word-ja { font-size: .88rem; font-weight: 700; }
.dash-word-main small { color: var(--dashboard-muted); font-size: .7rem; font-weight: 700; }
.dash-status { padding: 4px 9px; border-radius: 99px; font-size: .7rem; font-weight: 950; white-space: nowrap; }
.dash-status[data-status="unseen"] { color: #5f5870; background: #eee6f0; }
.dash-status[data-status="learning"] { color: #705b16; background: #fff0b5; }
.dash-status[data-status="mastered"] { color: #246e5b; background: #c9f1e4; }
.dash-status[data-status="review"] { color: #55468b; background: #e4ddff; }
.dash-pagination { margin-top: 10px; }

/* ---------- nigate dictionary ---------- */
.nigate { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.nigate-lead { margin: 0; color: var(--dashboard-muted); font-size: .88rem; font-weight: 800; line-height: 1.55; }
.nigate-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.nigate-chip { padding: 6px 14px; border-radius: 99px; color: var(--dashboard-ink); background: #f1ebf6; font-size: .84rem; font-weight: 800; }
.nigate-chip strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.nigate-chip.is-review { color: #55468b; background: #e4ddff; }
.nigate-chip.is-overcome { color: #246e5b; background: #c9f1e4; }
.nigate-celebrate { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-radius: 16px; background: #eaf8f3; }
.nigate-celebrate img { width: auto; height: 72px; }
.nigate-celebrate p { margin: 0; color: #246e5b; font-weight: 900; }
.nigate-controls { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 -2px; padding: 8px 2px; background: var(--dashboard-cream); }
.nigate-search { flex: 1 1 220px; min-width: 0; min-height: 44px; padding: 8px 12px; border: 1px solid var(--dashboard-border); border-radius: 12px; color: var(--dashboard-ink); background: #fff; font: inherit; font-weight: 700; }
.nigate-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.nigate-filter { min-height: 44px; padding: 6px 12px; border: 1px solid var(--dashboard-border); border-radius: 99px; color: var(--dashboard-muted); background: #fff; font: inherit; font-size: .8rem; font-weight: 900; white-space: nowrap; cursor: pointer; }
.nigate-filter[aria-pressed="true"] { color: #fff; border-color: transparent; background: #5b4a9e; }
.nigate-sort { min-height: 44px; padding: 6px 10px; border: 1px solid var(--dashboard-border); border-radius: 12px; color: var(--dashboard-ink); background: #fff; font: inherit; font-weight: 800; }
.nigate-practice { width: 100%; }
.nigate-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.nigate-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; min-width: 0; padding: 12px 14px; border: 1px solid var(--dashboard-border); border-radius: 14px; background: #fff; box-shadow: 0 4px 12px rgb(93 61 103 / 7%); }
.nigate-row-main { display: grid; gap: 5px; min-width: 0; }
.nigate-row-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.nigate-en { font-size: 1.15rem; font-weight: 900; overflow-wrap: anywhere; }
.nigate-badge { padding: 3px 10px; border-radius: 99px; font-size: .7rem; font-weight: 950; white-space: nowrap; }
.nigate-badge[data-status="review"] { color: #55468b; background: #e4ddff; }
.nigate-badge[data-status="overcome"] { color: #246e5b; background: #c9f1e4; }
.nigate-row-sub { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.nigate-ja { font-size: .9rem; font-weight: 700; overflow-wrap: anywhere; }
.nigate-meta, .nigate-stat, .nigate-row-dir { color: var(--dashboard-muted); font-size: .72rem; font-weight: 700; }
.nigate-row-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.nigate-pill { padding: 2px 9px; border-radius: 99px; font-size: .74rem; font-weight: 900; white-space: nowrap; }
.nigate-pill.is-wrong { color: var(--dashboard-deep-pink); background: #fde8ef; }
.nigate-pill.is-slow { color: #7a5b00; background: #fff0b5; }
.nigate-pill.is-zero { opacity: .5; }
.nigate-row-practice { align-self: center; }
.nigate-empty { display: grid; justify-items: center; gap: 8px; padding: 22px 12px; text-align: center; }
.nigate-empty img { width: auto; height: 120px; }
.nigate-empty-title { margin: 0; font-size: 1.05rem; font-weight: 900; }
.nigate-empty-sub { margin: 0; color: var(--dashboard-muted); font-size: .84rem; line-height: 1.55; }
.nigate-empty-filter { padding: 16px 12px; }
.nigate-more { margin-top: 10px; }

/* ---------- tablet ---------- */
@media (max-width: 899px) {
  .dashboard-dialog, .dashboard-dialog.nigate-dialog { width: min(100vw - 16px, 760px); height: calc(100dvh - 16px); max-height: calc(100dvh - 16px); border-radius: 20px; }
  .dashboard-dialog .progression-panel-card { padding: 14px 14px 10px; }
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .dash-span-12 { grid-column: 1 / -1; }
  .dash-span-6 { grid-column: span 1; }
  .dash-hero { order: 0; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "mascot greet greet" "rank rank rank" "streak streak cta"; padding: 14px 16px; }
  .dash-hero-mascot { height: 100px; margin-bottom: 0; }
  .dash-hero-cta { justify-content: flex-end; }
  .dash-kpi-row { order: 1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .dash-actions { order: 2; }
  .dash-goals { order: 3; }
  .dash-week { order: 4; }
  .dash-near { order: 5; }
  .dash-nigate { order: 6; }
  .dash-action-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .dash-summary-chips { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-heat-card { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "heat" "note" "legend"; grid-template-rows: auto; }
  .dash-heat-card > .dash-note { margin-top: 6px; }
  .dash-heat { max-width: 480px; }
  .dash-heat-legend { align-self: start; }
  .dash-near-grid, .dash-series-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-reward-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-book-row { grid-template-columns: 120px minmax(0, 1fr); }
  .dash-book-meta { grid-column: 1 / -1; justify-content: space-between; }
}

/* ---------- mobile ---------- */
@media (max-width: 700px) {
  .dash-chart-grid, .dash-dir-grid, .dash-word-list ul, .nigate-rows { grid-template-columns: minmax(0, 1fr); }
  .dash-action-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .dashboard-dialog, .dashboard-dialog.nigate-dialog { width: calc(100vw - 12px); height: calc(100dvh - 12px); max-height: calc(100dvh - 12px); border-radius: 17px; }
  .dashboard-dialog .progression-panel-card { padding: 10px 10px 8px; }
  .dashboard-dialog .progression-panel-head { gap: 8px; padding-bottom: 6px; }
  .dashboard-dialog .progression-panel-head h2 { font-size: 1.1rem; }
  .dash-header-link { padding-inline: 10px; font-size: .76rem; }
  .dashboard-dialog .progression-tabs { gap: 5px; margin-bottom: 10px; }
  .dashboard-dialog .progression-tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .dashboard-dialog .progression-tabs button { min-height: 44px; min-width: 0; padding-inline: 2px; font-size: .72rem; white-space: normal; overflow-wrap: anywhere; }
  .dashboard-dialog .dash-slot-tabs { display: none; }
  .dashboard-dialog .dash-slot-select { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
  .dashboard-dialog .dash-slot-select select { min-width: 0; flex: 1; }
  .dash-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .dash-span-12, .dash-span-6 { grid-column: auto; }
  .dash-card { padding: 14px; }
  .dash-hero { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "greet greet" "rank rank" "streak cta"; gap: 8px 10px; min-height: 0; padding: 14px; }
  .dash-hero-mascot { display: none; }
  .dash-hero-cta .dash-btn { width: auto; min-width: 120px; }
  .dash-hero-streak { align-items: center; }
  .dash-kpi-row { gap: 8px; }
  .dash-kpi { padding: 12px 10px; }
  .dash-kpi-value { font-size: 1.5rem; }
  .dash-kpi-spark svg { max-width: 100%; }
  .dash-chip { font-size: .68rem; padding: 3px 7px; }
  .dash-summary-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-summary-chips > :last-child { grid-column: 1 / -1; }
  .dash-near-grid, .dash-series-grid { grid-template-columns: minmax(0, 1fr); }
  .dash-reward-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-near-item { grid-template-columns: 40px minmax(0, 1fr); }
  .dash-near-remaining { grid-column: 2; }
  .dash-book-row { grid-template-columns: minmax(0, 1fr); }
  .dash-book-name { grid-template-columns: auto auto; justify-content: space-between; align-items: baseline; }
  .dash-word-row { grid-template-columns: minmax(0, 1fr) auto; }
  .dash-word-row .dash-status { grid-row: 1; grid-column: 2; }
  .dash-word-row .dash-btn { grid-column: 1 / -1; justify-self: stretch; }
  .nigate-row { grid-template-columns: minmax(0, 1fr); }
  .nigate-row-practice { justify-self: stretch; }
  .nigate-filters { flex-wrap: nowrap; width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .nigate-sort { flex: 1 1 100%; }
  .dash-row-actions .dash-btn { flex: 1 1 100%; }
  .dash-title-row { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .dash-title-row .dash-new-pill { grid-column: 3; }
}
@media (max-width: 380px) {
  .dash-kpi-label { font-size: .7rem; }
  .dash-kpi-value { font-size: 1.35rem; }
  .dash-heat { gap: 3px; }
  .dash-steps .dash-step { flex-basis: 88px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .dashboard-dialog, .dashboard-dialog.nigate-dialog { height: calc(100dvh - 8px); max-height: calc(100dvh - 8px); }
  .dashboard-dialog .progression-panel-card { padding: 8px 12px 6px; }
  .dashboard-dialog .progression-panel-head { min-height: 44px; padding-bottom: 4px; }
  .dashboard-dialog .progression-tabs { margin-bottom: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-dialog *, .dashboard-dialog *::before, .dashboard-dialog *::after { animation: none !important; scroll-behavior: auto !important; transition: none !important; }
}
.manual-reduced-motion .dashboard-dialog *, .manual-reduced-motion .dashboard-dialog *::before, .manual-reduced-motion .dashboard-dialog *::after { animation: none !important; scroll-behavior: auto !important; transition: none !important; }
.manual-reduced-motion .dash-bar::-webkit-progress-value { transition: none !important; }

/* ---------- start screen: ONE fluid layout (final layer) ----------
   Every start-screen size is driven by the viewport small height (svh) and the
   button width, not by per-device bands:
     --start-btn-h  height of the primary CTA (82px .. 108px)
     --start-btn-w  = height x 1782/604 (the tight art aspect), capped by the viewport
     --start-row-w  = the available start-card width for the equal action row
   Flexible rows (logo / tagline / mascot) absorb whatever height is left; every
   control row has a fixed, known height so nothing can overflow the card. */
.start-stage .start-content {
  --g: clamp(2px, .3svh, 3px);
  --ctl: clamp(44px, 6svh, 50px);
  --node: clamp(36px, 7.2svh, 52px);
  --auto-h: clamp(44px, 5.5svh, 48px);
  --rail-h: calc(var(--node) + 18px);
  --pick-h: calc(var(--rail-h) + 3px + var(--auto-h));
  --start-btn-h: clamp(64px, 10.5svh, 78px);
  --start-btn-w: min(calc(var(--start-btn-h) * 1782 / 604), calc(100vw - 24px));
  --start-row-w: 100%;
  display: grid !important;
  box-sizing: border-box;
  height: 100% !important;
  max-height: 100% !important;
  width: min(100%, 430px);
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(50px, .45fr) minmax(218px, 1.45fr) var(--ctl) var(--pick-h) 44px auto !important;
  grid-template-areas: "logo" "mascot" "mode" "pick" "row" "cta" !important;
  align-content: stretch !important;
  align-items: center !important;
  justify-items: center;
  gap: var(--g) !important;
  padding: clamp(4px, 1.2svh, 12px) 16px calc(18px + env(safe-area-inset-bottom)) !important;
}
@media (min-height: 640px) {
  .start-stage .start-content { padding-bottom: calc(24px + env(safe-area-inset-bottom)) !important; }
}
.start-stage .start-content > * { min-width: 0; min-height: 0; }

/* the stage owns a definite single row so the content can fill it */
.start-stage { grid-template-rows: minmax(0, 1fr) auto !important; }
.start-stage > .legal-footer { grid-row: 2; display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:4px 10px; width:min(100%, 430px); padding:4px 12px calc(5px + env(safe-area-inset-bottom)); color:#725f82; font-size:11px; line-height:1.3; }
.legal-footer a { color:inherit; text-underline-offset:2px; }
.legal-footer span { flex-basis:100%; text-align:center; }

/* flexible art */
.start-stage .start-content > .logo-start { grid-area: logo; width: 100%; height: 100%; max-width: 260px; max-height: 76px; margin: 0; object-fit: contain; }
.start-stage .start-content > .start-character-group {
  grid-area: mascot;
  width: min(100%, 240px);
  height: 100%;
  max-height: 225px;
  min-height: 0;
  align-self: center;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 44px;
  gap: 6px;
  justify-items: center;
  align-items: center;
}
.start-stage .start-content > .start-character-group > .sankichi-start {
  grid-row: 1;
  width: 100%;
  height: 100%;
  max-width: 220px;
  max-height: 175px;
  margin: 0;
  object-fit: contain;
}
.start-stage .start-content > .start-character-group > .start-rank-title { grid-row: 2; width: 100%; max-width: 240px; height: 44px; }
.start-stage .start-content > .start-character-group:has(#character-carousel) {
  width: min(100%, 430px);
  max-width: 430px;
  max-height: 225px;
  grid-template-rows: minmax(0, 1fr) 44px;
}
.start-stage .start-content > .start-character-group:has(#character-carousel) #character-carousel { width: 100%; max-width: 430px; height: 100%; max-height: 170px; min-width: 0; min-height: 0; }

/* fixed-height controls */
.start-stage .start-content > .settings-row { grid-area: settings; width: 100%; height: var(--ctl); margin: 0 !important; flex-wrap: nowrap; gap: 6px; align-items: stretch; }
.start-stage .start-content > .settings-row .small-button { height: var(--ctl) !important; min-height: 44px !important; }
.start-stage .start-content > .mode-picker { grid-area: mode; width: 100% !important; height: var(--ctl); min-height: 0 !important; margin: 0 !important; gap: 4px; }
.start-stage .start-content > .mode-picker .mode-button,
.start-stage .start-content > .mode-picker .mode-button.has-generated-art { height: var(--ctl); min-height: 44px; }
.start-stage .start-content > .mode-picker .mode-button .button-art { height: 100% !important; max-height: none !important; }

.start-stage .start-content > .difficulty-picker { grid-area: pick; width: 100% !important; height: var(--pick-h); margin: 0 !important; }
.start-stage .difficulty-grid { grid-template-rows: var(--rail-h) var(--auto-h) !important; gap: 3px 2px !important; }
.start-stage .difficulty-grid .difficulty-button { height: var(--rail-h); }
.start-stage .difficulty-grid .difficulty-button[data-difficulty="auto"] { height: var(--auto-h); margin-top: 0; }
.start-stage .difficulty-grid .roadmap-node-art { width: var(--node); height: var(--node); }
.start-stage .difficulty-grid .difficulty-button[data-difficulty="auto"] .roadmap-node-art { width: 100%; height: 100%; }
.start-stage .difficulty-picker::before { top: calc(var(--node) / 2 - 6px); height: 20px; }
/* transient "locked" hint floats under the picker instead of reserving a row */
.start-stage .difficulty-lock-message {
  position: absolute; left: 0; right: 0; top: calc(100% + 1px); z-index: 6; min-height: 0; margin: 0; padding: 3px 8px;
  border-radius: 10px; background: #fffaf6f2; box-shadow: 0 2px 8px #5a347b30; font-size: .7rem; line-height: 1.25; pointer-events: none;
}
.start-stage .difficulty-lock-message:empty { display: none; }

/* secondary row: use the full start-card width so three equal columns leave
   room for the labels and ニガテ badge ("99+") on compact screens. */
.start-stage .start-content > .start-entry-row {
  grid-area: row;
  container-type: inline-size;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: var(--start-row-w);
  max-width: none;
  height: 44px;
  margin: 0 !important;
  transform: none !important;
}
.start-stage .start-content > .start-entry-row > button,
.start-stage .start-content > .start-entry-row > #progression-open {
  display: flex !important; align-items: center; justify-content: center; line-height: 1.2;
  box-sizing: border-box; width: 100%; max-width: none; min-width: 0 !important;
  height: 44px !important; min-height: 44px !important; margin: 0 !important; padding: 0 4px !important;
  gap: 3px; overflow: hidden; border-radius: 12px !important; transform: none !important;
}
.start-entry-row > button .button-label { font-size: clamp(12px, 5.4cqw, 13.5px) !important; letter-spacing: 0; white-space: nowrap; }
.start-entry-row > button .dashboard-entry-icon { font-size: clamp(11px, 4cqw, 14px); flex: none; }
.start-entry-row .entry-badge { flex: none; min-width: 18px; height: 18px; padding: 0 4px; font-size: .66rem; }
@container (max-width: 359.98px) {
  .start-entry-row > button .dashboard-entry-icon { display: none; }
  .start-entry-row > button .button-label { font-size: 12px !important; }
  .start-stage .start-content > .start-entry-row > button,
  .start-stage .start-content > .start-entry-row > #progression-open {
    gap: 2px;
    padding-inline: 2px !important;
  }
  .start-entry-row .entry-badge { padding-inline: 2px; }
}

/* primary CTA: the tight 1782x604 art is the hit area, wider than the row above */
.start-stage .start-content > #start-button,
.start-stage .start-content > #start-button.has-generated-art {
  grid-area: cta;
  display: flex !important;
  align-items: center;
  justify-content: center;
  justify-self: center;
  width: var(--start-btn-w) !important;
  max-width: none;
  aspect-ratio: 1782 / 604;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none;
}
.start-stage .start-content > #start-button .button-art { width: 100%; height: 100% !important; max-height: none !important; object-fit: contain; transform: none !important; }
.start-stage .start-content > #start-button .button-label { font-size: 1.5rem; }

/* short portrait: drop the tagline row, let logo/mascot absorb what is left */
@media (max-height: 520px) and (orientation: portrait), (max-width: 559px) and (max-height: 520px) {
  .start-stage .start-content {
    grid-template-rows: minmax(0, 100fr) minmax(0, 70fr) var(--ctl) var(--ctl) var(--pick-h) 44px auto !important;
    grid-template-areas: "logo" "mascot" "settings" "mode" "pick" "row" "cta" !important;
  }
}

/* wide + short (landscape phones / small windows): logo+mascot on the left,
   controls on the right, row + CTA as one full-width band underneath */
@media (orientation: landscape) and (max-height: 520px) and (min-width: 560px) {
  .start-stage .start-content {
    --ctl: 44px;
    --node: clamp(40px, 11svh, 48px);
    --start-btn-h: clamp(82px, calc(100svh - 296px), 104px);
    width: min(720px, 100%);
    grid-template-columns: minmax(0, .62fr) minmax(0, 1.38fr) !important;
    grid-template-rows: var(--ctl) var(--ctl) var(--pick-h) 44px auto !important;
    grid-template-areas: "logo settings" "logo mode" "mascot pick" "row row" "cta cta" !important;
    column-gap: 12px !important;
    padding: 4px 14px calc(18px + env(safe-area-inset-bottom)) !important;
  }
  .start-stage .start-content > .start-character-group { grid-area: mascot; min-height: 0; height: 100%; grid-template-rows: minmax(0, 1fr) 36px; gap: 2px; }
  .start-stage .start-content > .start-character-group > .sankichi-start { max-width: 150px; max-height: 120px; }
  .start-stage .start-content > .start-character-group > .start-rank-title { height: 36px; font-size: .78rem; }
  .start-stage .start-content > .logo-start { max-width: 180px; max-height: 88px; }
}

/* extremely short windows: squeeze the remaining slack so the CTA keeps its bottom gap */
@media (max-height: 400px) {
  .start-stage .start-content { --g: 2px; --node: 34px; padding-top: 0 !important; }
}

/* The home settings live in a modal now, freeing a full control row for the
   character art. Keep a real art-height floor so the carousel never scroll-
   clips its selected character at compact desktop heights. */
.start-screen {
  height: auto !important;
  min-height: 100dvh !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}
.start-stage {
  height: auto !important;
  min-height: min(760px, calc(100svh - 16px)) !important;
  overflow: visible !important;
}
.start-stage .start-content > .start-character-group:has(#character-carousel) {
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) 40px;
  gap: 2px;
}
.start-stage .start-content > .start-character-group:has(#character-carousel) #character-carousel {
  height: min(100%, 176px);
  max-height: 176px;
  min-height: 0;
  grid-template-rows: minmax(126px, 1fr) 26px;
}
.start-stage .start-content > .start-character-group:has(#character-carousel) .character-carousel-track {
  align-items: center;
  padding-block: 0;
}
.character-carousel-art-wrap { overflow: visible; }
.character-carousel-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.character-carousel-card[aria-pressed="true"] .character-carousel-art { position: absolute; }

@media (orientation: landscape) and (max-height: 520px) and (min-width: 560px) {
  .start-stage .start-content {
    width: min(720px, 100%) !important;
    max-width: none;
    grid-template-rows: var(--ctl) minmax(188px, 1fr) 44px auto !important;
    grid-template-areas: "logo mode" "mascot pick" "row row" "cta cta" !important;
  }
  .start-stage .start-content > .start-character-group { grid-template-rows: minmax(0, 1fr) 36px; gap: 2px; }
  .start-stage .start-content > .start-character-group:has(#character-carousel) #character-carousel { height: 150px; max-height: 150px; grid-template-rows: minmax(124px, 1fr) 26px; }
  .character-carousel-art-wrap { width: 100px; height: 100px; }
  .character-carousel-card { flex-basis: 106px; min-height: 100px; }
  .start-stage { min-height: max(360px, calc(100svh - 16px)) !important; }
}

.home-settings-trigger {
  position: absolute;
  z-index: 5;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 82px;
  min-height: 48px;
  padding: 4px 9px 4px 5px;
  border: 1px solid #e3bb79;
  border-radius: 999px;
  background: linear-gradient(115deg, #fff8f4, #f7eaff);
  box-shadow: 0 3px 8px #8b4b852e, inset 0 1px #fff;
  color: #70447b;
  font-size: .9rem;
  font-weight: 800;
}
.home-settings-trigger img { width: 36px; height: 36px; object-fit: contain; }
.home-settings-trigger:hover { filter: brightness(1.04); transform: translateY(-1px); }
.home-settings-trigger:focus-visible,
.home-settings-close:focus-visible,
.home-settings-dialog .small-button:focus-visible { outline: 3px solid #7f72bd; outline-offset: 3px; }

.home-settings-dialog {
  width: min(400px, calc(100vw - 32px));
  max-width: none;
  padding: 0;
  overflow: visible;
  border: 2px solid #f3ce83;
  border-radius: 24px;
  background: linear-gradient(145deg, #fffaf4 0%, #fff3f7 48%, #f4eaff 100%);
  box-shadow: 0 18px 54px #633d663d, inset 0 0 0 3px #fff7e8;
  color: #593b70;
}
.home-settings-dialog::backdrop { background: #38254472; backdrop-filter: blur(3px); }
.home-settings-panel { padding: 20px 22px 24px; }
.home-settings-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.home-settings-header h2 { margin: 0; color: #76417f; font-size: 1.3rem; letter-spacing: .08em; }
.home-settings-close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid #dfbb78;
  border-radius: 50%;
  background: #fff8f1;
  color: #825374;
  font-size: 1.6rem;
  line-height: 1;
}
.home-settings-description { margin: 8px 0 18px; color: #886c91; font-size: .84rem; text-align: center; }
.home-settings-dialog .settings-row { display: grid; gap: 10px; margin: 0; }
.home-settings-dialog .settings-row { grid-template-columns: minmax(0, 1fr) !important; }
.home-settings-dialog .settings-row .small-button {
  width: 100%;
  min-height: 52px;
  border: 1px solid #e8c878;
  border-radius: 15px;
  background: linear-gradient(100deg, #fffdf8, #f7eafd);
  box-shadow: inset 0 1px #fff, 0 3px 8px #8b4b851b;
  color: #613f76;
  font-weight: 850;
  font-size: 1rem !important;
}
.home-settings-dialog .settings-row .small-button[aria-pressed="true"] {
  border-color: #e5ad68;
  background: linear-gradient(100deg, #ffe2ed, #f0dfff);
}
.home-settings-dialog .settings-row #start-timer {
  background-image: none !important;
  padding: 0 8px !important;
}
@media (max-width: 520px) {
  .start-stage .start-content > .logo-start { max-width: 210px; }
  .home-settings-trigger { top: 8px; right: 8px; min-width: 68px; min-height: 44px; padding: 3px 6px 3px 3px; gap: 1px; font-size: .78rem; }
  .home-settings-trigger img { width: 28px; height: 28px; }
  .home-settings-panel { padding: 17px 16px 20px; }
}
@media (min-width: 761px) {
  .start-stage { min-height: min(760px, calc(100svh - 48px)) !important; }
}
@media (prefers-reduced-motion: reduce) {
  .home-settings-trigger { transition: none; }
}
@media (max-height: 520px) {
  .start-screen { min-height: 100dvh !important; overflow-y: auto !important; }
}

/* ---------- result screen: 記録 button styled as a candy pill like the art buttons ----------
   The button keeps the grid cell (>=44px tap target) but is visually transparent;
   the pill is drawn on the label so it matches the size of the art pills. */
.result-screen .result-actions button.result-progression-open {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #fff !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.result-screen .result-actions button.result-progression-open .button-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-sizing: border-box;
  min-width: 94px !important;
  height: 28px !important;
  overflow: visible !important;
  padding: 0 14px;
  border: 2px solid #fff6dc;
  border-radius: 999px;
  background: linear-gradient(100deg, #ff5fa6 0%, #f06ac0 55%, #b57be8 100%);
  box-shadow: 0 0 0 1.5px #f0b43c, 0 3px 7px rgb(184 50 97 / 32%), inset 0 5px 5px rgb(255 255 255 / 38%);
  color: #fff;
  font-size: .86rem !important;
  font-weight: 950;
  letter-spacing: .06em;
  line-height: 1;
  white-space: nowrap;
  text-shadow: -1px -1px 0 #c12a73, 1px -1px 0 #c12a73, -1px 1px 0 #c12a73, 1px 1px 0 #c12a73, 0 2px 2px rgb(160 30 90 / 45%);
  transition: transform .12s ease, filter .12s ease;
}
.result-screen .result-actions button.result-progression-open .dashboard-entry-icon { display: none; }
.result-screen .result-actions button.result-progression-open .button-label::before {
  content: "✦";
  content: "✦" / ""; /* decorative: keep the accessible name 「記録」 (older engines use the line above) */
  color: #ffe58a;
  font-size: .8rem;
  letter-spacing: 0;
  text-shadow: 0 0 3px rgb(255 255 255 / 80%), 0 1px 1px #c12a73;
}
.result-screen .result-actions button.result-progression-open:hover .button-label { transform: translateY(-1px); filter: brightness(1.06) saturate(1.08); }
.result-screen .result-actions button.result-progression-open:active .button-label { transform: translateY(1px) scale(.97); filter: brightness(.96); }
.result-screen .result-actions button.result-progression-open:focus-visible { outline: none; }
.result-screen .result-actions button.result-progression-open:focus-visible .button-label { outline: 3px solid #7a4fd0; outline-offset: 3px; }
/* the art pills sit a few px above the cell centre on wide layouts */
@media (min-width: 700px) {
  .result-screen .result-actions button.result-progression-open .button-label { margin-top: -10px; }
}
@media (prefers-reduced-motion: reduce) {
  .result-screen .result-actions button.result-progression-open .button-label { transition: none; }
}

/* Keep the collection shortcut in the same glossy jewel style as the result CTAs. */
.result-screen:not([hidden]) .result-actions button.result-gifts-link {
  box-sizing: border-box;
  min-width: 0;
  width: min(100%, 190px) !important;
  max-width: 190px !important;
  min-height: 44px !important;
  height: 48px !important;
  justify-self: center;
  padding: 4px 8px;
  border: 0;
  border-radius: 999px;
  color: #fff9ff;
  background-color: transparent;
  background-image: url("assets/brand/button-gifts-surface.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  font: inherit;
  font-size: clamp(.72rem, 1.6vw, .9rem) !important;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  text-shadow: 0 2px 0 #76236f, 0 0 5px #521270;
  white-space: normal;
  box-shadow: none;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease;
}
.result-screen:not([hidden]) .result-actions button.result-gifts-link:hover:not(:disabled) {
  background-color: transparent;
  background-image: url("assets/brand/button-gifts-surface.png");
  filter: brightness(1.08) drop-shadow(0 2px 4px #d94ca866);
  transform: translateY(-1px);
}
@media (max-width: 520px) {
  .result-screen:not([hidden]) .result-actions button.result-gifts-link {
    width: min(100%, 184px) !important;
    max-width: 184px !important;
    height: 44px !important;
    font-size: clamp(.68rem, 3.2vw, .82rem) !important;
  }
}
.result-screen:not([hidden]) .result-actions button.result-gifts-link:active:not(:disabled) {
  transform: translateY(1px);
  filter: brightness(.96);
}
.result-screen:not([hidden]) .result-actions button.result-gifts-link:focus-visible {
  outline: 3px solid #7046a8;
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  .result-screen:not([hidden]) .result-actions button.result-gifts-link { transition: none; }
}
