/* Hallmark · component: special missions, collection and ranking · genre: playful · theme: existing cream/coral
 * states: default · hover · focus · active · disabled · loading · error · success
 * pre-emit critique: P4 H5 E4 S5 R5 V4
 */
#ranking-open { color: var(--color-ink); }
#ranking-open svg { width: 23px; height: 23px; }
#modal[data-view="ranking"] { width: min(580px, calc(100vw - 24px)); }
#modal[data-view="collection"] { width: min(640px, calc(100vw - 24px)); }
.chapter-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.chapter-tabs button { min-height: 44px; padding: 10px 5px; font-size: 11px; }
.notebook-links { display: flex; align-items: center; gap: 6px; justify-content: space-between; margin: 8px 0 2px; }
.notebook-links .text-link { min-height: 44px; margin: 0; padding: 10px 6px; font-size: 11px; color: var(--color-muted-strong); }
.notebook-links .text-link:first-child { color: var(--color-accent-dark); }
.special-contract { border-color: var(--color-bar-border); }
.contract-tool-tag { font-size: 10px; font-weight: 800; color: var(--color-green); line-height: 1.4; }
.contract-card.special-contract { min-height: 180px; }
.gimmick-brief { margin: 0 0 14px; padding: 14px; border: 1px solid var(--color-bar-border); border-radius: 12px; background: var(--color-green-soft); }
.gimmick-brief-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gimmick-brief-title b { font-size: 13px; }
.gimmick-brief-title > span { flex-shrink: 0; font-size: 10px; color: var(--color-muted-strong); }
.gimmick-brief ol { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.gimmick-brief li { display: flex; align-items: center; gap: 8px; padding: 9px; background: var(--color-surface); border-radius: 8px; }
.step-number { width: 22px; height: 22px; display: grid; place-items: center; flex-shrink: 0; background: var(--color-green-soft); border: 1px solid var(--color-line); border-radius: 6px; font-size: 11px; font-weight: 850; }
.gimmick-brief li > div { min-width: 0; flex: 1; }
.gimmick-brief li b { display: block; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.gimmick-brief li div > span { display: block; font-size: 10px; color: var(--color-muted-strong); line-height: 1.5; margin-top: 2px; }
.tool-chip { padding: 4px 6px; flex-shrink: 0; font-size: 10px; font-weight: 800; border-radius: 5px; color: var(--color-accent-dark); background: var(--color-accent-soft); white-space: nowrap; }
.gimmick-brief > p { font-size: 11px; line-height: 1.7; color: var(--color-muted-strong); margin-top: 10px; }
.loaned-equipment { padding: 10px 12px; margin-bottom: 10px; border-radius: 9px; background: var(--color-accent-soft); font-size: 11px; line-height: 1.7; color: var(--color-accent-dark); font-weight: 650; }
#gimmick-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; max-width: 350px; padding: 8px 10px; border: 1px solid var(--color-line); background: var(--color-surface); border-radius: 9px; box-shadow: 0 2px 10px var(--color-shadow); line-height: 1.4; pointer-events: none; }
.gimmick-hud-count { color: var(--color-accent-dark); font-size: 10px; font-weight: 750; white-space: nowrap; }
.gimmick-hud-count b { font-size: 14px; margin-left: 3px; font-variant-numeric: tabular-nums; }
.gimmick-hud-count.is-complete { color: var(--color-green); }
.gimmick-hud-next { color: var(--color-ink); font-size: 11px; font-weight: 800; }
.gimmick-hud-tip { display: block; width: 100%; color: var(--color-muted-strong); font-size: 10px; }
.gimmick-result { padding: 10px; border-radius: 9px; margin-bottom: 12px; font-size: 12px; font-weight: 750; line-height: 1.5; }
.gimmick-result.safe { color: var(--color-green); background: var(--color-green-soft); }
.gimmick-result.broken { color: var(--color-accent-dark); background: var(--color-accent-soft); }
.result-links { flex-wrap: wrap; }
.collection-heading { display: flex; align-items: center; justify-content: space-between; padding: 16px; background: var(--color-green-soft); border-radius: 13px; margin-bottom: 15px; }
.collection-heading > span { font-size: 13px; font-weight: 700; }
.collection-heading > b { font-size: 32px; line-height: 1; letter-spacing: -1px; }
.collection-heading small { font-size: 14px; color: var(--color-muted-strong); margin-left: 4px; }
.collection-grid { display: grid; gap: 8px; margin: 20px 0 18px; }
.collection-card { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 72px; padding: 13px; text-align: left; background: var(--color-surface); border: 1px solid var(--color-line); border-radius: 12px; white-space: normal; }
.collection-card.discovered { border-color: var(--color-bar-border); }
.collection-symbol { width: 32px; height: 32px; display: grid; place-items: center; flex-shrink: 0; border-radius: 9px; background: var(--color-paper); font-size: 19px; color: var(--color-muted-strong); }
.collection-card.discovered .collection-symbol { background: var(--color-green-soft); color: var(--color-green); }
.collection-card > div { min-width: 0; flex: 1; }
.collection-card b { display: block; font-size: 14px; line-height: 1.4; }
.collection-card div > span { display: block; font-size: 11px; color: var(--color-muted-strong); line-height: 1.5; margin-top: 3px; }
.collection-count { flex-shrink: 0; font-size: 14px; font-weight: 850; color: var(--color-green); }
.ranking-intro { font-size: 13px; line-height: 1.7; color: var(--color-muted-strong); margin-bottom: 18px; }
.ranking-local { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px; background: var(--color-green-soft); border: 1px solid var(--color-line); border-radius: 13px; }
.ranking-local > div > span { display: block; color: var(--color-muted-strong); font-size: 11px; font-weight: 650; }
.ranking-local b { display: block; font-size: 33px; line-height: 1.3; margin-top: 3px; letter-spacing: -.9px; }
.ranking-local small { font-size: 13px; margin-left: 4px; color: var(--color-muted-strong); letter-spacing: 0; }
.ranking-local > button { min-height: 44px; padding: 10px 14px; font-size: 12px; flex-shrink: 0; }
.ranking-periods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 18px 0 12px; }
.ranking-periods > button { min-height: 44px; padding: 10px; border: 1px solid var(--color-line); border-radius: 9px; background: var(--color-surface); color: var(--color-muted-strong); font-size: 12px; font-weight: 750; }
.ranking-periods > button[aria-pressed="true"] { background: var(--color-ink); color: var(--color-surface); border-color: var(--color-ink); }
.ranking-personal { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; padding: 13px 15px; border: 1px solid var(--color-bar-border); background: var(--color-green-soft); border-radius: 11px; margin-bottom: 12px; }
.ranking-personal > span { font-size: 11px; font-weight: 700; color: var(--color-muted-strong); }
.ranking-personal strong { font-size: 21px; font-weight: 900; }
.ranking-personal strong > span { font-size: 12px; font-weight: 750; }
.ranking-personal > small { width: 100%; font-size: 11px; color: var(--color-muted-strong); }
.ranking-state { min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; padding: 24px 14px; background: var(--color-surface); border: 1px solid var(--color-line); border-radius: 12px; font-size: 12px; color: var(--color-muted-strong); text-align: center; line-height: 1.7; }
.ranking-state b { font-size: 14px; color: var(--color-ink); }
.ranking-state .secondary-button { min-height: 44px; margin: 4px 0 0; font-size: 12px; }
.ranking-error { border-color: var(--color-accent); color: var(--color-accent-dark); background: var(--color-accent-soft); }
.ranking-table-wrap { overflow: hidden; border: 1px solid var(--color-line); border-radius: 12px; background: var(--color-surface); }
.ranking-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; text-align: left; }
.ranking-table th { padding: 11px 12px; font-size: 10px; font-weight: 700; color: var(--color-muted-strong); background: var(--color-paper); }
.ranking-table th:first-child { width: 17%; }
.ranking-table th:last-child { width: 24%; text-align: right; }
.ranking-table td { padding: 13px 12px; border-top: 1px solid var(--color-line); overflow-wrap: anywhere; }
.ranking-table td:first-child { font-weight: 850; }
.ranking-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.ranking-table td:last-child b { font-size: 15px; }
.ranking-table td:last-child > span { font-size: 10px; margin-left: 3px; color: var(--color-muted-strong); }
.ranking-table tr.is-me { background: var(--color-green-soft); }
.me-tag { display: inline-block; background: var(--color-green); color: var(--color-surface); font-size: 9px; padding: 1px 4px; margin-left: 5px; border-radius: 4px; white-space: nowrap; }
.ranking-disclosure { font-size: 11px; line-height: 1.8; color: var(--color-muted-strong); margin: 14px 2px 12px; }
.ranking-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: 8px; }
.ranking-actions .secondary-button { min-height: 44px; margin: 0; font-size: 12px; padding: 10px 8px; }
.ranking-actions .rank-delete { grid-column: 1 / -1; min-height: 44px; color: var(--color-accent-dark); margin: 0; font-size: 11px; }
.ranking-share-note { font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; user-select: text; background: var(--color-paper); border: 1px solid var(--color-line); padding: 10px; border-radius: 8px; margin-top: 12px; }
.ranking-share-note:empty { display: none; }
.music-volume { display: block; margin: 0 0 12px; padding: 14px 0 16px; border-bottom: 1px solid var(--color-line); }
.music-volume > span { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 700; }
.music-volume output { color: var(--color-muted-strong); font-size: 11px; font-weight: 600; }
.music-volume input { width: 100%; min-height: 44px; margin: 8px 0 0; accent-color: var(--color-green); cursor: pointer; }
.music-volume input:disabled { opacity: .5; cursor: not-allowed; }
.settings-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.settings-links .secondary-button { min-height: 44px; margin: 0; justify-content: center; font-size: 12px; padding: 10px 8px; }
@media (hover: hover) {
  .collection-card:hover:not(:disabled) { background: var(--color-green-soft); }
  .ranking-periods > button:hover:not(:disabled):not([aria-pressed="true"]) { background: var(--color-green-soft); }
}
@media (max-width: 767px) {
  .top-actions { gap: 5px; }
  .brand { font-size: 17px; }
  .wallet { font-size: 11px; }
  .chapter-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .chapter-tabs button { font-size: 10px; padding: 9px 4px; }
  .notebook-links { gap: 3px; }
  .notebook-links .text-link { font-size: 10px; padding: 9px 3px; }
  .gimmick-brief { padding: 11px; }
  .gimmick-brief-title b { font-size: 12px; }
  .gimmick-brief li { padding: 8px 7px; gap: 6px; }
  .gimmick-brief li b { font-size: 11px; }
  .gimmick-brief li div > span { font-size: 9px; }
  .tool-chip { font-size: 9px; }
  .loaned-equipment { font-size: 10px; }
  #gimmick-panel { max-width: 230px; padding: 6px 8px; gap: 3px 6px; }
  .gimmick-hud-count { font-size: 9px; }
  .gimmick-hud-count b { font-size: 12px; }
  .gimmick-hud-next { font-size: 10px; }
  .gimmick-hud-tip { font-size: 9px; }
  .result-links { gap: 1px; }
  .result-links .text-link { min-height: 44px; padding: 9px 5px; margin-top: 0; }
  .collection-card { padding: 11px; gap: 8px; }
  .collection-card b { font-size: 13px; }
  .collection-card div > span { font-size: 10px; }
  .ranking-local { padding: 13px; gap: 8px; }
  .ranking-local > div > span { font-size: 10px; }
  .ranking-local b { font-size: 29px; }
  .ranking-local > button { padding: 10px 11px; font-size: 11px; }
  .ranking-table { font-size: 11px; }
  .ranking-table th, .ranking-table td { padding: 11px 9px; }
  .ranking-table th:first-child { width: 16%; }
  .ranking-table th:last-child { width: 23%; }
  .ranking-table td:last-child b { font-size: 14px; }
  .ranking-intro { font-size: 12px; }
  .ranking-disclosure { font-size: 10px; }
  .ranking-personal strong { font-size: 19px; }
  .ranking-actions .secondary-button { font-size: 11px; }
}
@media (max-width: 350px) {
  .brand { font-size: 15px; gap: 6px; }
  .brand img { width: 27px; height: 27px; }
  .wallet { gap: 4px; font-size: 10px; }
  .coin-symbol { width: 19px; height: 19px; font-size: 10px; }
  .top-actions { gap: 3px; }
  .notebook-links .text-link { font-size: 9px; }
  .chapter-tabs button { font-size: 9px; }
  .collection-card { gap: 6px; }
  .collection-symbol { width: 27px; height: 27px; }
  .collection-card div > span { font-size: 9px; }
  .collection-count { font-size: 12px; }
  .ranking-local > div > span { font-size: 9px; }
  .ranking-local b { font-size: 27px; }
  .ranking-local > button { padding: 10px 8px; font-size: 10px; }
}
