* { box-sizing: border-box; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #f4f1ea; color: #222; font-family: system-ui, -apple-system, "Hiragino Sans", sans-serif; -webkit-user-select: none; user-select: none; overscroll-behavior: none; touch-action: manipulation; word-break: auto-phrase; text-wrap: pretty; }
#app { height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: max(10px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); gap: 10px; touch-action: none; }
#top { width: 100%; max-width: 560px; text-align: center; }
#odai { font-size: 20px; font-weight: 700; min-height: 1.8em; }
#odai b { font-size: 36px; font-weight: 800; letter-spacing: .04em; margin-right: .1em; }
#timer { flex: none; width: 100%; max-width: 560px; height: 8px; background: #ddd6c8; border-radius: 4px; overflow: hidden; }
#timer i { display: block; height: 100%; width: 100%; background: #222; transform-origin: left; }
#timer.low i { background: #d33; }
#c { background: #fff; border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.12); touch-action: none; }
#bar { width: 100%; max-width: 560px; display: flex; justify-content: center; min-height: 52px; }
#done { min-width: 50%; }
button, .button { font: inherit; font-size: 17px; border: 0; border-radius: 10px; padding: 10px 18px; min-height: 48px; background: #e6e0d3; color: #222; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; }
button.primary { background: #222; color: #fff; }
button.big { font-size: 20px; padding: 14px 28px; width: 100%; }
.button.x { background: #000; color: #fff; width: 100%; font-size: 18px; }
.button.x svg { width: 20px; height: 20px; }
.row { display: flex; gap: 8px; width: 100%; }
.row button { flex: 1; }
.panel { position: fixed; inset: 0; background: #f4f1ea; display: flex; align-items: flex-start; justify-content: center; padding: max(16px, env(safe-area-inset-top)) 16px 24px; overflow-y: auto; overscroll-behavior: contain; }
.panel[hidden], .veil[hidden] { display: none; }
#title { align-items: center; }
.box { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
h1 { font-size: 44px; margin: 0; letter-spacing: .08em; }
#tcv { width: 100%; height: auto; }
#hero { width: min(100%, 360px, calc((100dvh - 190px) / 1.36)); height: auto; display: block; }
#r-after { width: 100%; }
.veil { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(244,241,234,.6); }
.dots { display: flex; gap: 10px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; background: #222; animation: bob .9s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bob { 0%, 100% { transform: translateY(0); opacity: .4; } 50% { transform: translateY(-8px); opacity: 1; } }
.fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
#hero.win { animation: win .35s cubic-bezier(.3,1.6,.5,1); }
@keyframes win { from { transform: scale(.96); } }
html.lang-wait #app, html.lang-wait .panel { visibility: hidden; }
.langsw { position: relative; display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 6px 12px; border: 2px solid #222; border-radius: 10px; background: #fff; 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; }
