* { 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; }

/* 真円度 on the left, the ten layers on the right */
#hud { flex: none; height: 60px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 16px; }
#hud.off { visibility: hidden; }
#score small { font-size: 12px; font-weight: 700; color: #45433e; margin-right: 6px; }
#score b { font-size: 26px; font-variant-numeric: tabular-nums; }
#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 going round the cake */
#hint { position: absolute; left: 50%; top: 54%; width: 0; height: 0; pointer-events: none; }
#hint[hidden] { display: none; }
#hint span { position: absolute; left: 0; top: 0; animation: round 1.4s linear infinite; }
#hint i { position: absolute; left: 100px; width: 30px; height: 38px; margin: -19px -15px; border-radius: 50% 50% 46% 46%; border: 3px solid #1b1b1d; background: rgba(255,255,255,.9); }
#hint b { position: absolute; left: -48px; top: 150px; font-size: 22px; letter-spacing: 2px; white-space: nowrap; -webkit-text-stroke: 5px #fff; paint-order: stroke; }
@keyframes round { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.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: 100%; height: clamp(130px, 26vh, 200px); display: block; margin: 0 auto 6px; }
h1 { font-size: 60px; letter-spacing: 8px; 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%; aspect-ratio: 1 / 0.92; max-height: 62vh; display: block; margin: 0 auto; }
#r-best { margin: 0; font-weight: 900; color: #d23a2c; }
#r-best[hidden] { display: none; }
.row { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
#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; }
html.lang-wait #app, html.lang-wait .panel { visibility: hidden; }
.langsw { position: relative; display: inline-flex; align-items: center; gap: 4px; margin-top: 14px; padding: 5px 10px; border: 1.5px solid #1b1b1d; border-radius: 99px; font-size: 13px; font-weight: 800; }
.langsw svg { width: 15px; height: 15px; }
.langsw select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; cursor: pointer; }
:lang(ko) body { font-family: "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans CJK KR", "Malgun Gothic", sans-serif; }
:lang(zh-Hans) body { font-family: "PingFang SC", "Noto Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif; }
:lang(zh-Hant) body { font-family: "PingFang TC", "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei", sans-serif; }
:lang(en) body, :lang(es) body, :lang(pt) body, :lang(fr) body, :lang(de) body { font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, "Noto Sans", sans-serif; }
:lang(en) h1, :lang(es) h1, :lang(pt) h1, :lang(fr) h1, :lang(de) h1, :lang(ko) h1 { font-size: 50px; letter-spacing: 2px; }
