* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0e1a2b; overflow: hidden; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #fff; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
#app { position: relative; width: 100%; height: 100%; max-width: 560px; margin: 0 auto; }
canvas { display: block; width: 100%; height: 100%; cursor: pointer; }
.hidden { display: none !important; }

#hud { position: absolute; top: 14px; left: 0; right: 0; text-align: center; pointer-events: none; text-shadow: 0 2px 6px rgba(0,0,0,.5); }
#hudScore { font-size: 44px; font-weight: 800; line-height: 1; }
#hudCombo { font-size: 16px; font-weight: 700; color: #ffd166; min-height: 20px; margin-top: 4px; }

.topbtns { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; z-index: 5; }
.topbtns button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(0,0,0,.35); color: #fff; font-size: 17px; cursor: pointer; }
.topbtns button.off { opacity: .45; }

.screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; background: rgba(8,16,30,.72); backdrop-filter: blur(3px); z-index: 4; }
h1 { font-size: 40px; margin: 0 0 8px; letter-spacing: .5px; }
h1::after { content: ""; display: block; height: 6px; width: 120px; margin: 10px auto 0; background: repeating-linear-gradient(90deg, #d62a2a 0 20px, #fff 20px 40px); border-radius: 3px; }
h2 { font-size: 30px; margin: 0 0 10px; }
.sub { font-size: 16px; opacity: .9; max-width: 340px; margin: 6px 0 18px; }
.hint { font-size: 13px; opacity: .75; margin-top: 18px; }
.login { font-size: 14px; margin: 10px 0 4px; }
.login a { color: #ffd166; }
.info { font-size: 15px; min-height: 20px; color: #ffd166; margin: 4px 0 14px; }
.result { font-size: 64px; font-weight: 800; line-height: 1; }
.result small { display: block; font-size: 14px; font-weight: 400; opacity: .8; }

button.big { background: #d62a2a; color: #fff; border: 0; border-radius: 30px; padding: 14px 42px; font-size: 20px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 0 #8f1717; }
button.big:active { transform: translateY(3px); box-shadow: 0 1px 0 #8f1717; }
button.link { background: none; border: 0; color: #fff; text-decoration: underline; font-size: 15px; margin-top: 14px; cursor: pointer; opacity: .9; }

.tabs { display: flex; gap: 4px; margin-bottom: 12px; background: rgba(255,255,255,.1); padding: 4px; border-radius: 20px; }
.tabs button { border: 0; background: none; color: #fff; padding: 7px 12px; border-radius: 16px; font-size: 14px; cursor: pointer; }
.tabs button.active { background: #fff; color: #0e1a2b; font-weight: 700; }

.board { list-style: none; padding: 0; margin: 0 0 8px; width: 100%; max-width: 380px; max-height: 52vh; overflow-y: auto; text-align: left; }
.board li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; }
.board li:nth-child(odd) { background: rgba(255,255,255,.06); }
.board li.me { background: rgba(255,209,102,.25); }
.board .rk { width: 26px; font-weight: 800; text-align: right; }
.board li:nth-child(1) .rk { color: #ffd166; }
.board li:nth-child(2) .rk { color: #d9d9d9; }
.board li:nth-child(3) .rk { color: #e0a370; }
.board .av { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: #33475f; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: none; }
.board .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .nm a { color: #fff; text-decoration: none; }
.board .sc { font-weight: 800; }
.board .empty { justify-content: center; opacity: .75; background: none; }
