/* style.css に無い、ゲーム固有の小物 */

.hud__max { font-size: 12px; color: var(--c-ink-sub); font-weight: 700; }

/* 選ばなかったカード: 薄く沈めて人口を小さく見せる（PdM §1） */
.pcard.is-passed { opacity: 0.55; transform: translateY(6px) scale(0.92) rotate(var(--tilt, 0deg)); pointer-events: none; }
.pcard.is-passed .pcard__face--back { background-color: #a89a86; }
.pcard.is-passed .pcard__pop { font-size: clamp(13px, 3.8vw, 17px); }
.pcard.is-waiting { opacity: 0.6; transform: scale(0.95); pointer-events: none; }
.pcard:disabled { cursor: default; }

/* へぇ ひとこと（地図の下端） */
.hee {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  margin: 0;
  padding: 6px 12px;
  border: 2px solid var(--c-ink);
  border-radius: 12px;
  background: rgba(255, 253, 247, 0.96);
  box-shadow: 0 3px 0 var(--c-ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  animation: pop-in 0.4s var(--ease-pop) both;
  pointer-events: none;
}
.hee b { color: var(--c-beni); margin-right: 6px; }
.hee small { display: block; font-size: 11px; color: var(--c-felt-deep); }

.title__next { margin: -4px 0 0; font-size: 12px; text-align: center; color: var(--c-ink-sub); }
.title__collected { margin: 0; font-size: 12px; text-align: center; color: var(--c-ink-sub); font-weight: 700; }

.result__near {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 700;
  color: inherit;
  opacity: 0.95;
}
.rank__sub {
  margin-top: 6px;
  padding: 2px 10px;
  border: 2px solid var(--c-ink);
  border-radius: 999px;
  background: var(--c-paper);
  font-size: 12px;
  font-weight: 800;
}

.history__list { list-style: none; margin: 0; padding: 0 12px 4px; font-size: 13px; }
.history__list li {
  display: grid;
  grid-template-columns: 4.5em 1fr auto;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 2px dashed var(--c-line);
}
.history__list li:last-child { border-bottom: 0; }
.history__list .h-mode { color: var(--c-ink-sub); font-size: 11px; font-weight: 800; }
.history__list .h-score { font-family: var(--font-num); font-weight: 900; color: var(--c-beni); }
.history__list .is-bust .h-score { color: var(--c-ink-sub); }

@media (max-height: 680px) {
  .hee { font-size: 12px; padding: 4px 10px; bottom: 6px; }
}

/* 結果画面はスクロールするので、子要素を縮めない（地図が潰れるのを防ぐ） */
.screen--result > * { flex-shrink: 0; }

/* 「+52,031」が大きな合計の数字に重ならないよう、ラベルの行へ上げる */
.scoreboard__added { top: 6px; }

/* 金の盤では墨フチ付きの墨文字が潰れて読みにくいので白抜きにする */
.result--gold .result__total .num { color: var(--c-paper); }

/* 出典はタイトル下の緑の丘の上に白で置く（中身と重ならないように） */
.screen--title .title__source {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(10px + var(--safe-bottom));
  color: rgba(255, 255, 255, 0.88);
}

/* 終盤（残り10万人以下）だけ出す規模の目安。小さい画面で ？？？ を隠す規則より優先する */
.pcard__q.is-hint {
  display: block !important;
  padding: 2px 6px;
  border: 2px solid var(--c-ink);
  border-radius: 999px;
  background: var(--c-gold-soft);
  color: var(--c-ink);
  font-family: var(--font-base);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

/* バースト時「止めていれば」・デイリーの理論値 */
.result__ifstop, .result__theory {
  margin: 0;
  padding: 8px 12px;
  border: 2px dashed var(--c-beni);
  border-radius: 12px;
  background: var(--c-paper);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}
.result__ifstop .num { color: var(--c-beni); font-size: 18px; }
.result__ifstop em { display: block; font-style: normal; color: var(--c-beni); }
.result__theory { border-color: var(--c-gunjo); }
.result__theory small { display: block; font-size: 11px; font-weight: 700; color: var(--c-ink-sub); }

/* 結果画面の下に固定する「もう一回！」とシェア */
.result__dock {
  position: sticky;
  bottom: calc(-16px - var(--safe-bottom));
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr 34%;
  gap: 10px;
  margin: 0 -16px calc(-16px - var(--safe-bottom));
  padding: 14px 16px calc(12px + var(--safe-bottom));
  background: linear-gradient(rgba(255, 244, 224, 0), var(--c-bg) 28%);
  opacity: 0;
  pointer-events: none;
}
.result__dock.is-in { animation: fade-in 0.35s ease 0.8s both; pointer-events: auto; }
.result__dock .share-done {
  position: absolute;
  left: 50%;
  top: -18px;
  transform: translateX(-50%);
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--c-paper);
  white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  .result__dock.is-in { opacity: 1; }
}

/* 長い名前: 最後の「市」だけが次の行に落ちないよう、末尾2文字はつなげる。7文字以上は少し小さく */
.pcard__name .nb { white-space: nowrap; }
.pcard__face--front .pcard__name.is-xlong { font-size: clamp(11px, 3.3vw, 15px); white-space: nowrap; letter-spacing: -0.02em; }

/* 横向きのスマホは縦長レイアウトが入りきらないので、縦向きを案内する */
.rotate-hint { display: none; }
@media (orientation: landscape) and (max-height: 500px) {
  .rotate-hint {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    background: var(--c-felt);
    color: #fff;
  }
  .rotate-hint p {
    margin: 0;
    padding: 14px 24px;
    border: var(--border);
    border-radius: var(--radius-m);
    background: var(--c-paper);
    color: var(--c-ink);
    font-size: 20px;
    font-weight: 900;
    box-shadow: var(--shadow-hard);
  }
  .rotate-hint span { margin-right: 8px; }
}
.result__dock .btn { padding-inline: 12px; white-space: nowrap; }
