* { box-sizing: border-box; }
html, body { margin: 0; background: #14161f; color: #eceff4; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
body { min-height: 100vh; min-height: 100dvh; display: flex; justify-content: center; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
main, #hs-view { width: 100%; max-width: 680px; padding: 8px; }
[hidden] { display: none !important; }

.bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.stat { background: #1f2330; border-radius: 8px; padding: 4px 12px; text-align: center; min-width: 80px; }
.stat span { display: block; font-size: 11px; color: #8d94a8; text-transform: uppercase; letter-spacing: .05em; }
.stat b { font-size: 20px; font-variant-numeric: tabular-nums; }
.stat.sel { flex: 1; }
.stat.sel b { font-size: 16px; }

#boardwrap { position: relative; width: min(100%, calc(100vh - 230px), calc(100dvh - 230px)); min-width: 200px; margin: 0 auto; aspect-ratio: 1; }
#board { width: 100%; height: 100%; display: block; background: #0c0e14; border-radius: 10px; touch-action: none; }
#banner { position: absolute; left: 8%; right: 8%; top: 38%; background: rgba(20,22,31,.94); border: 2px solid #5b8cff; border-radius: 12px; padding: 14px; text-align: center; font-size: 18px; }
#banner button { margin: 8px 4px 0; }

.hint { text-align: center; font-size: 12px; color: #8d94a8; margin: 6px 0; }
.buttons { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
button { background: #2c3350; color: #eceff4; border: 0; border-radius: 8px; padding: 10px 14px; font-size: 15px; cursor: pointer; }
button:hover:not(:disabled) { background: #3a4570; }
button:disabled { opacity: .4; cursor: default; }
button.active { background: #5b8cff; }
button.small { padding: 6px 10px; font-size: 12px; background: #3a2c34; }

.settings { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: center; font-size: 14px; }
.settings input { -webkit-user-select: text; user-select: text; background: #1f2330; color: #eceff4; border: 1px solid #3a4570; border-radius: 6px; padding: 6px 8px; font-size: 16px; width: 150px; }
.local { color: #8d94a8; }

#ticker { position: fixed; top: 0; left: 0; right: 0; z-index: 10; background: #5b8cff; color: #fff; overflow: hidden; white-space: nowrap; padding: 6px 0; font-weight: 600; }
#ticker span { display: inline-block; padding-left: 100%; animation: tick 14s linear forwards; }
@keyframes tick { to { transform: translateX(-100%); } }
body { padding-top: 0; }
h2 { margin: 0; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tabs button { flex: 1; }
.tabs button.on { background: #5b8cff; }
#hs-table { width: 100%; border-collapse: collapse; }
#hs-table th, #hs-table td { padding: 8px 6px; text-align: left; border-bottom: 1px solid #262b3b; }
#hs-table td:nth-child(3), #hs-table th:nth-child(3) { text-align: right; font-variant-numeric: tabular-nums; }
#hs-table tr.me td { color: #ffd54a; font-weight: 600; }
#hs-result { background: #1f2a1f; border: 1px solid #4caf50; border-radius: 8px; padding: 10px; margin-bottom: 10px; text-align: center; }
button.blink { animation: blink 0.8s ease-in-out infinite; }
@keyframes blink { 50% { background: #ffd54a; color: #14161f; } }
