* { 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; overflow: hidden; }
#app { touch-action: none; position: fixed; inset: 0; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }
#stage { position: relative; flex: 1; min-height: 0; }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* the first time: a finger pressing the chopsticks and letting go */
#hint { position: absolute; left: 50%; top: 44%; width: 0; height: 0; pointer-events: none; }
#hint[hidden] { display: none; }
#hint span { position: absolute; left: 0; top: 0; animation: press 1.6s ease-in-out infinite; }
#hint i { position: absolute; left: -15px; top: 40px; width: 30px; height: 38px; border-radius: 50% 50% 46% 46%; border: 3px solid #1b1b1d; background: rgba(255,255,255,.9); }
#hint b { position: absolute; left: -110px; top: 110px; width: 220px; text-align: center; font-size: 22px; letter-spacing: 2px; white-space: nowrap; -webkit-text-stroke: 5px #fff; paint-order: stroke; }
@keyframes press { 0% { transform: translateY(0) scale(1); opacity: 1; } 12% { transform: translateY(0) scale(.88); } 40% { transform: translateY(-70px) scale(.88); } 65% { transform: translateY(30px) scale(.88); } 82% { transform: translateY(-20px) scale(.88); opacity: 1; } 92% { transform: translateY(-20px) scale(1.05); opacity: 1; } 100% { transform: translateY(-20px) scale(1.1); opacity: 0; } }

/* the order, for a moment at the start of each round */
#order { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); background: #fffdf6; border: 3px solid #1b1b1d; padding: 10px 26px 12px; text-align: center; pointer-events: none; white-space: nowrap; }
#order[hidden] { display: none; }
#order small { display: block; font-size: 13px; font-weight: 800; color: #45433e; }
#order b { display: block; font-size: 40px; font-weight: 900; letter-spacing: 4px; }
#order.go { animation: pop .25s ease-out; }
@keyframes pop { from { transform: translateX(-50%) scale(.7); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }

/* after each drop: what it came out as */
#pop { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); width: min(80%, 300px); background: rgba(255,253,246,.96); border: 2px solid #1b1b1d; padding: 12px 14px 14px; text-align: center; }
#pop[hidden] { display: none; }
#pop-body b { display: block; font-size: 28px; font-weight: 900; }
#pop-body b.bad { color: #c8321f; }
#pop-body .pct { display: block; font-size: 18px; font-weight: 800; margin-top: 2px; }
#pop-body small { display: block; font-size: 14px; font-weight: 700; color: #45433e; margin-top: 4px; }
#next { margin-top: 10px; width: 100%; }

.panel { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(245,243,238,.86); overflow-y: auto; overscroll-behavior: contain; padding: 16px; z-index: 10; }
.panel[hidden] { display: none; }
#title { background: rgba(245,243,238,.97); }
#result { background: #f5f3ee; align-items: flex-start; }
.box { width: 100%; max-width: 360px; text-align: center; margin: auto; }
.box.wide { max-width: 520px; margin-top: 0; }
#tart { width: clamp(110px, 24vh, 170px); height: auto; display: block; margin: 0 auto 10px; }
h1 { font-size: 50px; letter-spacing: 4px; margin: 0 0 4px; }
.sub { margin: 0 0 26px; 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: 12px; }
#hero { width: 100%; display: block; margin: 0 auto; }
#r-best { margin: 0; font-weight: 900; color: #c8321f; }
.sub, #pop-body small, #r-best { word-break: auto-phrase; text-wrap: pretty; }
#r-best[hidden] { display: none; }
.row { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
#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; box-shadow: 0 -8px 10px -8px rgba(27,27,29,.28); }
#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; box-shadow: 0 -8px 10px -8px rgba(27,27,29,.28); }
#r-row { margin-top: 8px; }

/* while it fries: the live 一致度 and the time left to fix it with the chopsticks */
#live { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); text-align: center; pointer-events: none; }
#live[hidden] { display: none; }
#live small { display: block; font-size: 12px; font-weight: 800; color: #45433e; white-space: nowrap; }
#live small.red { color: #c8321f; }
#live b { display: block; font-size: 32px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.1; }
#live i { display: block; width: 120px; height: 6px; border: 1.5px solid #1b1b1d; margin: 4px auto 3px; }
#live i span { display: block; height: 100%; background: #c8321f; }
#pop-body > small:first-child { font-size: 13px; margin: 0 0 2px; }
