* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #6b4a2b; font-family: system-ui, sans-serif; touch-action: none; user-select: none; -webkit-user-select: none; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

#hud { position: fixed; top: max(10px, env(safe-area-inset-top)); left: 14px; right: 14px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; color: #fff; font-weight: 800; text-shadow: 0 2px 0 rgba(0,0,0,.45); }
#stats { font-size: 28px; }
#stats .small { font-size: 14px; font-weight: 700; opacity: .9; }
#tideWrap { width: 160px; height: 9px; border-radius: 6px; background: rgba(0,0,0,.35); margin-top: 4px; overflow: hidden; }
#tide { height: 100%; width: 0; background: #4cb4d6; transition: width .15s; }
#comboBox { font-size: 36px; color: #ffe27a; min-width: 80px; text-align: right; }
#combo.pop { display: inline-block; animation: pop .25s; }
@keyframes pop { 0% { transform: scale(1.7); } 100% { transform: scale(1); } }

.overlay { overflow-y: auto; position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 24px; text-align: center; color: #33240f; background: rgba(238, 228, 202, .86); backdrop-filter: blur(3px); }
[hidden] { display: none !important; }
h1 { font-size: clamp(34px, 8vw, 60px); margin: 0 0 6px; }
h2 { font-size: clamp(28px, 6vw, 46px); margin: 0; }
p { margin: 4px 0; font-size: 18px; line-height: 1.4; max-width: 560px; }
.big { font-size: 56px; font-weight: 800; }
.hint { font-size: 14px; opacity: .8; }
button { margin-top: 16px; padding: 14px 40px; font-size: 22px; font-weight: 800; color: #fff; background: #2f7a8a; border: 0; border-radius: 14px; box-shadow: 0 5px 0 #1b4a55; cursor: pointer; }
button:active { transform: translateY(3px); box-shadow: 0 2px 0 #1b4a55; }
button:disabled { opacity: .6; }
.row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
button.ghost { background: transparent; color: #2f7a8a; border: 3px solid #2f7a8a; box-shadow: none; padding: 11px 26px; font-size: 18px; }
button.small { margin-top: 0; padding: 10px 18px; font-size: 15px; }
#submitRow { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
#nameInput { font: inherit; font-size: 18px; padding: 10px 14px; width: 180px; border-radius: 12px; border: 3px solid #2f7a8a; background: #fffaf0; color: #33240f; text-align: center; user-select: text; -webkit-user-select: text; }
#rankMsg { font-weight: 800; font-size: 20px; margin-top: 8px; }
#rankList { list-style: none; margin: 8px 0 0; padding: 0; width: min(420px, 92vw); text-align: left; counter-reset: pos; }
#rankList li { display: flex; gap: 10px; padding: 7px 12px; border-radius: 10px; font-size: 18px; counter-increment: pos; }
#rankList li::before { content: counter(pos) "º"; width: 2.2em; font-weight: 800; opacity: .6; }
#rankList li:nth-child(odd) { background: rgba(47, 122, 138, .12); }
#rankList li.me { background: #2f7a8a; color: #fff; }
#rankList .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#rankList .s { font-weight: 800; }
a { color: #2f7a8a; font-weight: 700; }
