[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #f1c39b; overscroll-behavior: none; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif, "Noto Color Emoji"; color: #3b2a1e; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#trail { pointer-events: none; z-index: 20; }
button { font: inherit; color: inherit; cursor: pointer; }

#hud { position: fixed; left: 0; right: 0; top: 0; padding: calc(env(safe-area-inset-top) + 10px) 12px 0; display: flex; align-items: flex-start; gap: 10px; pointer-events: none; }
.hud-left { display: flex; flex-direction: column; gap: 2px; min-width: 70px; }
.name { font-weight: 800; letter-spacing: 0.04em; font-size: 15px; color: #fff8ec; text-shadow: 0 1px 6px rgba(80,40,10,.45); }
#shells { font-size: 14px; color: #fff8ec; text-shadow: 0 1px 5px rgba(80,40,10,.5); }
#track { flex: 1; position: relative; height: 6px; margin-top: 12px; border-radius: 3px; background: rgba(255,248,236,.35); }
#track i { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; left: 0; }
#trackStone { background: #fff; box-shadow: 0 0 6px rgba(255,255,255,.8); }
#trackBest { background: transparent; border: 2px solid #fff3d6; opacity: .8; display: none; }
#track .shore { position: absolute; right: 0; top: 10px; white-space: nowrap; font-size: 11px; color: #fff8ec; text-shadow: 0 1px 4px rgba(80,40,10,.5); }
#track::after { content: ""; position: absolute; right: -3px; top: -4px; width: 4px; height: 14px; border-radius: 2px; background: #f2dcae; }
.hud-right { pointer-events: auto; }
#bMute { width: 44px; height: 44px; border: 0; border-radius: 22px; background: rgba(255,248,236,.28); font-size: 20px; backdrop-filter: blur(4px); }

#skips { position: fixed; top: calc(env(safe-area-inset-top) + 64px); left: 0; right: 0; text-align: center; color: #fff; text-shadow: 0 2px 12px rgba(90,40,10,.5); pointer-events: none; }
#skips b { display: block; font-size: 64px; line-height: 1; font-weight: 800; }
#skips span { font-size: 14px; letter-spacing: .2em; text-transform: uppercase; }
#skips.pop b { animation: pop .25s ease-out; }
@keyframes pop { from { transform: scale(1.35); } to { transform: scale(1); } }
#readout { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 26%); transform: translateX(-50%); padding: 6px 12px; border-radius: 14px; background: rgba(60,35,20,.35); color: #fff8ec; font-size: 14px; white-space: nowrap; pointer-events: none; }
#hint { position: fixed; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 28px); text-align: center; color: #fff8ec; font-size: 16px; line-height: 1.4; text-shadow: 0 1px 8px rgba(70,35,10,.6); pointer-events: none; padding: 0 20px; transition: opacity .4s; }
#hint small { display: block; font-size: 13px; opacity: .85; }
#toast { position: fixed; top: 38%; left: 0; right: 0; text-align: center; font-size: 26px; font-weight: 800; color: #fff; text-shadow: 0 2px 14px rgba(90,40,10,.6); pointer-events: none; }
#paused { position: fixed; inset: 0; display: grid; place-content: center; text-align: center; font-size: 30px; font-weight: 800; color: #fff; background: rgba(60,30,15,.35); }
#paused small { display: block; font-size: 14px; font-weight: 400; }
#title { position: fixed; top: 23%; left: 0; right: 0; text-align: center; color: #fff8ec; pointer-events: none; transition: opacity .6s; text-shadow: 0 1px 3px rgba(40,30,40,.45), 0 2px 16px rgba(60,40,30,.55); }
#title h1 { margin: 6px 0 2px; font-size: 44px; letter-spacing: .06em; font-weight: 800; }
#title .credit { margin: 0; font-size: 13px; opacity: .95; text-shadow: 0 1px 2px rgba(30,25,35,.7), 0 0 10px rgba(40,30,40,.5); }
#title [data-wefav-mark] { pointer-events: auto; }
body.playing #title { opacity: 0; }

#card { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 10px); transform: translateX(-50%); width: min(380px, calc(100% - 20px)); max-height: calc(100% - 90px); overflow-y: auto; padding: 16px 16px 12px; border-radius: 20px; background: rgba(255,247,234,.94); box-shadow: 0 10px 40px rgba(80,40,10,.3); text-align: center; animation: up .3s ease-out; }
@keyframes up { from { transform: translate(-50%, 20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
#card h2 { margin: 0 0 2px; font-size: 22px; }
#card .big { font-size: 15px; color: #6b4b33; margin-bottom: 8px; }
#card .stats { display: flex; justify-content: center; gap: 14px; font-size: 13px; color: #6b4b33; margin: 6px 0 10px; flex-wrap: wrap; }
#card .stats b { display: block; font-size: 20px; color: #3b2a1e; }
#card .tip { font-size: 13px; color: #8a5a33; margin: 0 0 10px; }
#card .btn { min-height: 44px; padding: 0 22px; border: 0; border-radius: 22px; background: #e8834a; color: #fff; font-weight: 700; font-size: 16px; }
#card .btn:focus-visible, #card button.focus { outline: 3px solid #3b6fb0; outline-offset: 2px; }
#card .row2 { display: flex; gap: 8px; justify-content: center; margin-bottom: 8px; }
#card .ghost { background: #f1dcc2; color: #5a3b22; }
.vote { margin: 10px -16px 0; padding: 8px 16px 0; border-top: 1px solid #ecd9bf; }
.vote p { margin: 0 0 6px; font-size: 13px; font-weight: 600; }
.vote .opts { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.vote .opts button { flex: none; min-height: 44px; padding: 0 12px; border: 0; border-radius: 22px; background: #f1dcc2; font-size: 13px; white-space: nowrap; }
.shop { display: flex; gap: 6px; margin: 2px 0 4px; }
.shop button { flex: 1; min-height: 56px; padding: 5px 4px 4px; border: 0; border-radius: 14px; background: #f1dcc2; color: #5a3b22; line-height: 1.15; display: grid; justify-items: center; gap: 1px; opacity: .72; }
.shop button.can { opacity: 1; background: #ffd9a8; box-shadow: inset 0 0 0 2px #e8834a; }
.shop button:disabled { cursor: default; opacity: .55; }
.shop b { font-size: 14px; }
.shop small { font-size: 12px; font-weight: 700; }
.shop em { font-size: 10.5px; font-style: normal; opacity: .8; }
.pips { display: flex; gap: 2px; }
.pips i { width: 6px; height: 6px; border-radius: 50%; background: #d9bc98; }
.pips i.on { background: #e8834a; }
.door { margin-top: 8px; min-height: 44px; width: 100%; border: 1px dashed #d9b48c; border-radius: 14px; background: transparent; font-size: 13px; padding: 6px 10px; }
.noted { font-size: 13px; margin: 6px 0 0; }
.noted a { color: #3b6fb0; }
[data-wefav-row] { margin: 10px -16px 0; }
[data-wefav-row] > a { font-size: 12px; color: #8a5a33; }

body:not(.touch) .touch-only { display: none; }
body.touch .mouse-only { display: none; }
body:not(.pad) .pad-only { display: none; }
body.pad .not-pad { display: none; }

@media (min-aspect-ratio: 5/4) {
  #card { left: auto; right: 24px; bottom: 24px; transform: none; width: 380px; animation: none; }
  #hud { padding: 16px 24px 0; }
  #track { max-width: 520px; margin-left: auto; margin-right: auto; }
}
/* round 3: wind, the bag (stones and waters), unlock news */
#wind { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 64px); transform: translateX(-50%); padding: 5px 12px; border-radius: 14px; background: rgba(40,40,70,.32); color: #fff8ec; font-size: 14px; white-space: nowrap; pointer-events: none; text-shadow: 0 1px 4px rgba(30,20,40,.4); }
#wind b { font-size: 16px; }
body.playing #wind { opacity: .75; }
#card .news { margin: 0 0 8px; padding: 6px 10px; border-radius: 12px; background: #fff0c9; color: #6b4210; font-size: 13px; font-weight: 600; }
.bag { margin: 8px -16px 0; padding: 8px 16px 0; border-top: 1px solid #ecd9bf; }
.bag .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.bag button { flex: 1; min-height: 44px; padding: 0 6px; border: 0; border-radius: 22px; background: #f1dcc2; color: #5a3b22; font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; }
.bag button.on { background: #ffd9a8; box-shadow: inset 0 0 0 2px #e8834a; }
.bag button:disabled { opacity: .5; cursor: default; }
.bag .what { margin: 0; font-size: 12px; color: #8a5a33; }
.st { display: inline-block; width: 14px; height: 8px; border-radius: 50%; flex: none; }
.st-slate { background: #7d8186; }
.st-glass { background: #9fe0cf; box-shadow: inset 0 0 0 1px #4fa894; }
.st-disc { background: #5b4636; height: 10px; }
.st-shell { background: radial-gradient(circle at 40% 35%, #fff3ea, #f3d2c4 55%, #c98f86); }
#title #badge { display: inline-block; margin: 14px 0 0; padding: 6px 14px; border-radius: 999px; background: rgba(60,28,10,.38); color: #ffe7b0; font-size: 14px; font-weight: 700; letter-spacing: .02em; }
#title #badge::before { content: '🏁 '; }
.st-flint { background: linear-gradient(135deg, #f4fbff, #b9d4e4 50%, #7d98ad); height: 6px; }
.st-seaglass { background: radial-gradient(circle at 35% 35%, #e6f6fb, #a9d8e8 60%, #6aa6bb); opacity: .9; }
.st-obsidian { background: linear-gradient(135deg, #6a5f7a, #26222b 45%, #0e0c12); height: 6px; }
.st-ammonite { background: repeating-radial-gradient(circle at 45% 50%, #d8bf98 0 1.5px, #9a7a52 1.5px 3px); }
.st-moonstone { background: radial-gradient(circle at 35% 35%, #ffffff, #dfe6f6 50%, #9fb0dc); box-shadow: 0 0 4px #b8c8ff; }
.st-pebble { background: radial-gradient(circle at 40% 35%, #eadbc6, #c8b49a 60%, #8f7a60); height: 10px; }
/* round 17: shells earned, the upgrade nudge, and the new-water banner */
#card .earn { margin: 2px 0 8px; font-size: 18px; font-weight: 700; color: #8a4a12; }
#card .earn .plus b { font-size: 34px; color: #e8834a; font-variant-numeric: tabular-nums; display: inline-block; min-width: 1.2em; }
#card .earn.done .plus b { animation: pop .35s ease-out; }
#card .earn small { font-size: 12px; font-weight: 600; color: #8a5a33; }
#card .earn.none { display: none; }
.fly { position: fixed; z-index: 20; font-size: 22px; pointer-events: none; margin: -11px 0 0 -11px; filter: drop-shadow(0 2px 4px rgba(80,40,10,.4)); }
#shells.bump b { display: inline-block; animation: pop .3s ease-out; }
#shells.bump { color: #ffe7b0; }
.upnudge { margin: 0 0 6px; padding: 7px 10px; border-radius: 12px; background: #ffe2b8; color: #8a3f0e; font-size: 14px; font-weight: 800; opacity: .55; }
.upnudge.on { opacity: 1; animation: nudge 1.2s ease-in-out 2; }
@keyframes nudge { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); background: #ffcf8f; } }
.shop.ready button.can { position: relative; animation: glow 1.1s ease-in-out infinite; }
.shop.ready button.can::after { content: '▲ tap'; position: absolute; top: -9px; right: 4px; padding: 1px 6px; border-radius: 8px; background: #e8834a; color: #fff; font-size: 10px; font-weight: 800; animation: bob .7s ease-in-out infinite alternate; }
@keyframes glow { 0%, 100% { box-shadow: inset 0 0 0 2px #e8834a, 0 0 0 0 rgba(232,131,74,.0); } 50% { box-shadow: inset 0 0 0 2px #e8834a, 0 0 0 5px rgba(232,131,74,.35); } }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-3px); } }
.goal { margin: 0 0 8px; }
.goal .bar { height: 8px; border-radius: 4px; background: #f1dcc2; overflow: hidden; }
.goal .bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #f3a86a, #e8834a); }
.goal small { display: block; margin-top: 4px; font-size: 12px; color: #8a5a33; }
#card .next { width: 100%; margin: 6px 0 0; }
.unlock { position: relative; margin: -4px -4px 12px; padding: 12px 10px 12px; border-radius: 16px; background: linear-gradient(160deg, #3d6fa8, #5b9bd0 60%, #9fd0e8); color: #fff; overflow: hidden; animation: unlockIn .5s cubic-bezier(.2,1.4,.4,1); }
@keyframes unlockIn { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.unlock p { margin: 0; position: relative; }
.unlock .kicker { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #ffe7b0; }
.unlock .wname { font-size: 24px; font-weight: 800; margin: 2px 0; text-shadow: 0 2px 8px rgba(20,40,80,.4); }
.unlock .wwhat { font-size: 13px; opacity: .92; margin-bottom: 10px; }
#card .unlock .go { position: relative; background: #ffd45a; color: #5a3200; font-size: 17px; padding: 0 26px; box-shadow: 0 3px 0 #c9962a; animation: nudge 1.3s ease-in-out infinite; }
.unlock .burst { position: absolute; inset: 0; pointer-events: none; }
.unlock .burst i { position: absolute; left: 50%; top: 40%; width: 7px; height: 7px; border-radius: 2px; background: #ffe7b0; opacity: 0; animation: confetti 1.4s ease-out forwards; }
.unlock .burst i:nth-child(3n) { background: #ffd45a; } .unlock .burst i:nth-child(3n+1) { background: #fff; } .unlock .burst i:nth-child(4n) { background: #ff9a6a; }
@keyframes confetti { 0% { opacity: 1; transform: translate(0,0) rotate(0); } 100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(400deg); } }
.unlock .burst i:nth-child(1) { --x: 144px; --y: 0px; animation-delay: 0.0s; }
.unlock .burst i:nth-child(2) { --x: 173px; --y: 36px; animation-delay: 0.04s; }
.unlock .burst i:nth-child(3) { --x: 150px; --y: 82px; animation-delay: 0.08s; }
.unlock .burst i:nth-child(4) { --x: 32px; --y: 61px; animation-delay: 0.12s; }
.unlock .burst i:nth-child(5) { --x: -43px; --y: 82px; animation-delay: 0.0s; }
.unlock .burst i:nth-child(6) { --x: -150px; --y: 82px; animation-delay: 0.04s; }
.unlock .burst i:nth-child(7) { --x: -130px; --y: 27px; animation-delay: 0.08s; }
.unlock .burst i:nth-child(8) { --x: -192px; --y: 0px; animation-delay: 0.12s; }
.unlock .burst i:nth-child(9) { --x: -216px; --y: -46px; animation-delay: 0.0s; }
.unlock .burst i:nth-child(10) { --x: -90px; --y: -49px; animation-delay: 0.04s; }
.unlock .burst i:nth-child(11) { --x: -43px; --y: -82px; animation-delay: 0.08s; }
.unlock .burst i:nth-child(12) { --x: 53px; --y: -102px; animation-delay: 0.12s; }
.unlock .burst i:nth-child(13) { --x: 90px; --y: -49px; animation-delay: 0.0s; }
.unlock .burst i:nth-child(14) { --x: 173px; --y: -36px; animation-delay: 0.04s; }
/* round 21: the pause menu, the tutorial, and the slim result card at the top (the lake stays open to swipe) */
.hud-right { display: flex; gap: 8px; }
#bPause { width: 44px; height: 44px; border: 0; border-radius: 22px; background: rgba(255,248,236,.28); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; gap: 4px; }
#bPause i { width: 4px; height: 14px; border-radius: 2px; background: #fff8ec; box-shadow: 0 1px 3px rgba(80,40,10,.4); }
#paused { z-index: 30; }
#paused .menu { display: grid; gap: 10px; justify-items: center; }
#paused .btn { min-width: 200px; min-height: 48px; border: 0; border-radius: 24px; background: #e8834a; color: #fff; font-weight: 700; font-size: 17px; }
#paused .btn.ghost { background: #fff7ea; color: #5a3b22; }
#paused .btn small { display: inline; font-size: 13px; opacity: .8; }
#lesson { position: fixed; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 18px); text-align: center; color: #fff8ec; text-shadow: 0 1px 8px rgba(70,35,10,.65); pointer-events: none; padding: 0 18px; }
#lesson .say b { display: block; font-size: 21px; line-height: 1.2; font-weight: 800; }
#lesson .say small { display: block; margin-top: 3px; font-size: 14px; opacity: .92; }
#lesson .steps { display: flex; justify-content: center; gap: 6px; margin: 8px 0 2px; }
#lesson .steps i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,248,236,.35); }
#lesson .steps i.on { background: #fff8ec; }
#lesson .steps i.now { background: #ffd45a; box-shadow: 0 0 6px #ffd45a; }
#tutSkip { pointer-events: auto; margin-top: 4px; min-height: 36px; padding: 0 16px; border: 0; border-radius: 18px; background: rgba(60,35,20,.28); color: #fff8ec; font-size: 13px; }
#readout.sweet { background: rgba(70,140,60,.75); box-shadow: 0 0 0 2px #c8f0a0, 0 0 14px rgba(200,240,160,.8); font-weight: 700; }
#readout.sweet::after { content: ' · sweet spot ✓'; }
#hint.nudge { animation: nudge .5s ease-in-out 2; }
body.carded #wind { display: none; }

#card { top: calc(env(safe-area-inset-top) + 56px); bottom: auto; padding: 10px 14px 8px; max-height: calc(100% - 200px); }
#card.open { max-height: calc(100% - 120px); }
#card.slim .more { display: none; }
#card .sum { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; column-gap: 14px; }
#card .sum .n { font-size: 14px; font-weight: 700; color: #6b4b33; white-space: nowrap; }
#card .sum .n b { font-size: 30px; line-height: 1.05; color: #3b2a1e; margin-right: 3px; font-variant-numeric: tabular-nums; }
#card .sum em { font-style: normal; margin-left: 5px; padding: 1px 7px; border-radius: 8px; background: #ffd45a; color: #5a3200; font-size: 12px; vertical-align: 3px; }
#card .sum .earn { margin: 0; font-size: 20px; }
#card .sum .earn b { color: #e8834a; }
#card .sum .earn.done b { display: inline-block; animation: pop .35s ease-out; }
#card .big { margin: 0 0 4px; font-size: 14px; }
#card .tip { margin: 0 0 6px; font-size: 12.5px; }
#card .news { margin: 0 0 6px; }
#card .cta { margin: 2px 0 6px; }
#card .cta .goal { margin: 0; }
#card .upbtn { width: 100%; min-height: 46px; background: linear-gradient(180deg, #f59a5c, #e8834a); box-shadow: 0 3px 0 #b85a26; font-size: 17px; }
#card .upbtn small { font-size: 13px; opacity: .92; margin-left: 4px; }
#card .upbtn.on { animation: upPulse 1.1s ease-in-out infinite; }
@keyframes upPulse { 0%, 100% { transform: scale(1); box-shadow: 0 3px 0 #b85a26, 0 0 0 0 rgba(232,131,74,0); } 50% { transform: scale(1.03); box-shadow: 0 3px 0 #b85a26, 0 0 0 6px rgba(232,131,74,.35); } }
#card .nextwind { margin: 0 0 6px; font-size: 12.5px; color: #4a4a6a; }
#card .row2 { margin-bottom: 2px; }
#card .btn.sm { min-height: 36px; padding: 0 16px; font-size: 14px; }
#card .more { padding-top: 6px; border-top: 1px solid #ecd9bf; margin-top: 6px; }
#card .unlock { margin: -2px -4px 8px; padding: 10px 10px; }
#card .unlock .stay { margin: 6px 0 0; font-size: 12px; opacity: .9; }
#card .unlock .go small { display: inline; }
@media (min-aspect-ratio: 5/4) {
  #card { top: 70px; bottom: auto; right: 24px; max-height: calc(100% - 100px); }
}
