* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #f5f3ee; color: #1b1b1d; touch-action: manipulation;
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic", sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
#app { touch-action: none; position: fixed; inset: 0; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }

/* where the run has got to, and the total */
#hud { flex: none; height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 14px 0; }
#hud.off { visibility: hidden; }
#lvbox { display: flex; align-items: center; gap: 8px; min-width: 0; }
#lvl { margin: 0; display: flex; flex-direction: column; gap: 3px; }
#lv { font-size: 17px; font-weight: 900; line-height: 1; color: #c8961e; -webkit-text-stroke: 0.4px #1b1b1d; }
#lv.pop { animation: pop .35s cubic-bezier(.2,1.6,.4,1); transform-origin: left; }
#xp { display: block; width: 64px; height: 7px; border: 1.5px solid #1b1b1d; background: #fff; }
#xp i { display: block; height: 100%; background: #c8961e; transform-origin: left; transform: scaleX(0); transition: transform .12s; }
#zone { font-size: 20px; font-weight: 900; border: 2px solid #1b1b1d; background: #fff; padding: 2px 10px; white-space: nowrap; }
#zone.pop { animation: pop .35s cubic-bezier(.2,1.6,.4,1); }
#sum { margin: 0; text-align: right; line-height: 1; min-width: 0; }
#sum small { display: block; font-size: 11px; font-weight: 800; margin-bottom: 2px; }
#total { font-size: 28px; font-weight: 900; color: #c8392b; font-variant-numeric: tabular-nums; white-space: nowrap; }
@keyframes pop { from { transform: scale(1.6); } }
#timer { flex: none; height: 6px; margin: 4px 14px 0; border: 1.5px solid #1b1b1d; background: #fff; }
#timer i { display: block; height: 100%; background: #1b1b1d; transform-origin: left; }
#timer.low i { background: #c8392b; }
#stage { position: relative; flex: 1; min-height: 0; margin-top: 6px; }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* the first time: a thumb going round */
#hint { position: absolute; left: 50%; bottom: 22%; width: 0; height: 0; pointer-events: none; }
#hint[hidden] { display: none; }
#hint i { position: absolute; width: 30px; height: 38px; margin: -19px -15px; border-radius: 50% 50% 46% 46%; border: 3px solid #1b1b1d; background: rgba(255,255,255,.88);
  animation: round 0.9s linear infinite; }
#hint b { position: absolute; white-space: nowrap; left: 54px; top: -16px; font-size: 22px; letter-spacing: 2px; -webkit-text-stroke: 5px #fff; paint-order: stroke; }
@keyframes round {
  0% { transform: rotate(0deg) translateX(34px) rotate(0deg); }
  100% { transform: rotate(360deg) translateX(34px) rotate(-360deg); }
}

.panel { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(245,243,238,.9); overflow-y: auto; overscroll-behavior: contain; padding: 16px; z-index: 10; }
.panel[hidden] { display: none; }
#title { background: #f5f3ee; }
.box { width: 100%; max-width: 360px; text-align: center; margin: auto; }
.box.wide { max-width: 480px; }
#tart { width: 100%; height: clamp(150px, 34vh, 280px); display: block; margin: 0 auto 10px; }
h1 { font-size: 48px; letter-spacing: 4px; margin: 0 0 4px; font-weight: 900; }
.sub { margin: 0 0 22px; font-size: 16px; font-weight: 700; }
button, .button { font: inherit; font-size: 16px; font-weight: 700; color: #1b1b1d; background: #fff; border: 2px solid #1b1b1d; border-radius: 0;
  padding: 10px 18px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
button.primary, .button.primary { background: #1b1b1d; color: #fff; }
button.big { width: 100%; padding: 14px; font-size: 18px; margin-top: 8px; }
.row { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.row > * { flex: 1; }
#r-post { flex: 1.7; background: #1b1b1d; color: #fff; font-size: 18px; padding: 13px 8px; white-space: nowrap; }
#r-post svg { width: 18px; height: 18px; }
#again { flex: 1; font-size: 15px; padding: 10px 4px; white-space: nowrap; }
#r-after { margin-top: 18px; }
#r-share { gap: 6px; position: sticky; bottom: 0; z-index: 3; margin: 14px -12px 0; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  background: #f5f3ee; border-top: 2px solid #1b1b1d; }

/* the bill */
#result { align-items: flex-start; padding-bottom: 0; }
#sheet { background: #fffdf7; border: 2.5px solid #1b1b1d; padding: 10px 12px 8px; text-align: left; position: relative; }
.r-head { display: flex; align-items: baseline; gap: 8px; border-bottom: 2px solid #1b1b1d; padding-bottom: 4px; }
.r-head b { font-size: 20px; letter-spacing: 8px; font-weight: 900; }
.r-head small { font-size: 11px; font-weight: 700; color: #6b6e73; }
#r-best { margin-left: auto; color: #c8392b; border: 2px solid #c8392b; padding: 0 6px; font-style: normal; font-weight: 900; font-size: 12px; transform: rotate(-3deg); }
#r-best[hidden] { display: none; }
.r-total { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 0; }
.r-total p { margin: 0; min-width: 0; }
.r-total small { display: block; font-size: 12px; font-weight: 800; }
#r-total { display: block; font-size: 40px; line-height: 1.05; font-weight: 900; color: #c8392b; font-variant-numeric: tabular-nums; word-break: keep-all; }
#r-lv { font-style: normal; color: #c8961e; font-weight: 900; margin-left: 8px; font-size: 14px; }
#r-rank { display: inline-block; margin-top: 2px; font-style: normal; font-weight: 900; font-size: 13px; background: #1b1b1d; color: #fff; padding: 1px 6px; }
#r-rank[hidden] { display: none; }
#r-stamp { flex: none; width: 88px; height: 88px; animation: hanko .35s cubic-bezier(.2,1.6,.4,1) .3s both; }
@keyframes hanko { from { transform: scale(2.2); opacity: 0; } }
#r-path { margin: 2px 0 6px; font-size: 12px; font-weight: 800; line-height: 1.6; color: #c9c6bd; }
#r-path span.on { color: #1b1b1d; }
#r-path i { font-style: normal; margin: 0 1px; }
#r-scene { width: 100%; height: 132px; display: block; }
#r-list { list-style: none; margin: 6px 0 0; padding: 0; font-size: 14px; font-weight: 800; }
#r-list li { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dashed #c9c6bd; padding: 2px 0; }
#r-list li.rare span { color: #c8961e; }
#r-list li.more { color: #6b6e73; border-bottom: 0; }
#r-list small { font-size: 11px; margin-left: 3px; color: #6b6e73; }
#r-list b { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-height: 600px) {
  #r-scene { height: 96px; }
  #r-total { font-size: 34px; }
  #r-stamp { width: 74px; height: 74px; }
}

/* the 図鑑: the rare ones, place by place; the ones not found yet are a question mark */
.zk { margin: 10px 0 0; display: flex; gap: 8px; justify-content: center; align-items: center; }
.zk[hidden], .zk [hidden] { display: none; }
button.link { background: none; border: 0; padding: 4px 6px; font-size: 15px; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; color: #1b1b1d; }
.new { font-size: 12px; font-weight: 900; color: #fff; background: #c8961e; padding: 1px 7px; animation: pop .35s cubic-bezier(.2,1.6,.4,1); }
#zukan { z-index: 20; align-items: flex-start; background: #f5f3ee; }
.zk-title { font-size: 22px; font-weight: 900; margin: 4px 0 10px; }
#z-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; }
#z-list li { border: 2px solid #1b1b1d; background: #fffdf7; padding: 4px 2px 5px; min-width: 0; }
#z-list li.zone { grid-column: 1 / -1; border: 0; background: none; padding: 6px 0 0; text-align: left; font-size: 13px; font-weight: 900; color: #6b6e73; }
#z-list li.got { border-color: #c8961e; }
#z-list canvas { width: 64px; height: 64px; display: block; margin: 0 auto; }
#z-list li.no canvas { opacity: 0; }
#z-list li.no::before { content: "？"; display: block; height: 64px; line-height: 64px; font-size: 30px; font-weight: 900; color: #c9c6bd; margin-bottom: -64px; }
#z-list b { display: block; font-size: 12px; line-height: 1.25; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#z-list small { display: block; font-size: 11px; color: #c8961e; font-weight: 800; }
#z-list li.fresh b::after { content: " NEW"; color: #c8961e; }
