* { box-sizing: border-box; }
:root { --ink: #1a1a1a; --sub: #6b6b6b; --paper: #fff; --line: #ddd; --red: #d8392b; }
html, body { margin: 0; background: #f2f2f2; color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
html { touch-action: manipulation; }
html, body { overscroll-behavior: none; }
#play, #title { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button, .btn { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:focus:not(:focus-visible) { outline: none; }
#app { max-width: 440px; margin: 0 auto; height: 100dvh; background: var(--paper); position: relative; overflow: hidden; }
button { font: inherit; color: inherit; }
.btn { white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: 0 6px; width: 100%; min-height: 52px; margin: 10px 0 0; padding: 10px 14px; border: 2.5px solid var(--ink); border-radius: 12px; background: var(--paper); color: var(--ink); font-weight: 800; font-size: 17px; text-align: center; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.xpost { background: #0f1419; border-color: #0f1419; color: #fff; }
.btn.xpost svg { width: 18px; height: 18px; fill: #fff; }

#play { height: 100%; padding: 6px 12px 12px; display: flex; flex-direction: column; }
#hud { flex: none; display: flex; align-items: center; gap: 10px; min-height: 60px; }
#model { flex: none; width: 56px; height: 56px; border: 2px solid var(--ink); border-radius: 10px; }
#hud-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
#which { font-size: 20px; font-weight: 900; white-space: nowrap; }
#timer { height: 10px; border: 2px solid var(--ink); border-radius: 6px; overflow: hidden; }
#timer i { display: block; height: 100%; width: 100%; background: var(--ink); transform-origin: left; }
#score { flex: none; text-align: right; line-height: 1.1; }
#score small { display: block; font-size: 11px; font-weight: 800; color: var(--sub); }
#score b { font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; }
#stage { flex: 1 1 auto; min-height: 0; position: relative; }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#banner { position: absolute; left: 50%; top: 17%; width: max-content; max-width: 86%; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 22px 12px; border: 4px solid var(--ink); outline: 2px solid var(--ink); outline-offset: -10px; border-radius: 16px; background: var(--paper);
  text-align: center; pointer-events: none; transform: translate(-50%, -50%) rotate(-4deg); animation: stamp .28s cubic-bezier(.2, 1.6, .4, 1) both; }
#banner[hidden] { display: none; }
#banner small { font-size: 14px; font-weight: 900; letter-spacing: .25em; color: var(--sub); }
#banner b { font-size: min(34px, 9vw); font-weight: 900; line-height: 1.15; }
#banner span { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
#banner.red { border-color: var(--red); outline-color: var(--red); color: var(--red); }
#banner.red small { color: var(--red); }
@keyframes stamp { from { transform: translate(-50%, -50%) rotate(-4deg) scale(1.6); opacity: 0; } to { transform: translate(-50%, -50%) rotate(-4deg) scale(1); opacity: 1; } }
#bar { flex: none; }
#bar .btn { margin-top: 6px; }
#bar .btn:disabled { opacity: .35; }

#hint { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
#hint[hidden] { display: none; }
#hint span { position: absolute; left: 0; top: 0; animation: yose 1.3s ease-in-out infinite; }
#hint i { position: absolute; width: 30px; height: 38px; margin: -19px -15px; border-radius: 50% 50% 46% 46%; border: 3px solid var(--ink); background: rgba(255,255,255,.9); }
#hint b { position: absolute; left: 0; transform: translateX(-50%); top: 120px; text-align: center; font-size: 20px; white-space: nowrap; -webkit-text-stroke: 5px #fff; paint-order: stroke; }
@keyframes yose { 0% { transform: translate(150px, 0); opacity: 0; } 20% { opacity: 1; } 70% { transform: translate(78px, 0); opacity: 1; } 100% { transform: translate(78px, 0); opacity: 0; } }

.panel { position: absolute; inset: 0; background: var(--paper); overflow-y: auto; overscroll-behavior: contain; }
#title { padding: 18px 20px 24px; text-align: center; }
#hero { display: block; width: 100%; aspect-ratio: 1.5; margin: 8px auto 0; }
#title h1 { font-size: 50px; margin: 8px 0 0; font-weight: 900; letter-spacing: .04em; }
.catch { font-size: 19px; font-weight: 800; margin: 2px 0 14px; }
#title .btn.primary { font-size: 19px; min-height: 58px; }
.guide { margin-top: 14px; font-size: 13px; }
.catch, #banner b, #r-row, #r-after { word-break: auto-phrase; text-wrap: pretty; }

#result { padding: 14px 18px 0; }
#result.wait { pointer-events: none; }
.shot { display: block; width: 100%; height: auto; margin: 4px 0 0; border: 1px solid var(--line); border-radius: 10px; }
.shares { display: flex; gap: 8px; position: sticky; bottom: 0; z-index: 3; margin: 10px -18px 0; padding: 8px 18px calc(8px + env(safe-area-inset-bottom, 0px));
  background: var(--paper); box-shadow: 0 -8px 10px -8px rgba(26,26,26,.28); }
.shares .btn { flex: 1 1 0; min-width: 0; margin-top: 0; }
.rows { list-style: none; margin: 16px 0 0; padding: 0; border-top: 2px solid var(--ink); }
.rows li { display: flex; align-items: baseline; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 800; }
.rows li em { font-style: normal; color: var(--red); }
.rows li.ok em { color: var(--ink); }
.rows li span { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }

html.lang-wait #app { visibility: hidden; }
#t-lang { margin-top: 4px; }
.langsw { position: relative; display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; padding: 6px 12px; border: 1.5px solid var(--ink); border-radius: 99px; font-size: 14px; font-weight: 800; }
.langsw svg { width: 16px; height: 16px; }
.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) #title h1, :lang(es) #title h1, :lang(pt) #title h1, :lang(fr) #title h1, :lang(de) #title h1 { letter-spacing: .01em; }
