* { box-sizing: border-box; }
:root { color-scheme: light; --accent: #FF8A3D; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: #174d54; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif; color: #fff; letter-spacing: 0; }
button { font: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; cursor: pointer; }
[hidden] { display: none !important; }
.game { position: relative; isolation: isolate; width: 100%; height: 100%; height: 100dvh; overflow: hidden; }
.scenery { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; user-select: none; pointer-events: none; z-index: -3; }
.shade { position: absolute; inset: 0; z-index: -2; background: linear-gradient(180deg, rgba(12,48,48,.22), transparent 30%, transparent 60%, rgba(9,46,51,.86)); pointer-events: none; }
.scoreboard { position: absolute; top: max(18px, env(safe-area-inset-top)); left: 20px; right: 20px; display: flex; justify-content: space-between; gap: 12px; pointer-events: none; }
.scoreboard span { display: flex; align-items: center; gap: 7px; background: rgba(20,61,65,.8); border: 1px solid rgba(255,255,255,.35); border-radius: 8px; padding: 10px 14px; font-size: 14px; }
.scoreboard b { color: #fff2be; font-size: 21px; font-variant-numeric: tabular-nums; }
.water { position: absolute; top: 47%; left: 0; width: 100%; height: 23%; touch-action: manipulation; }
.bobber { position: absolute; top: 35%; left: calc(50% - 9px); width: 18px; height: 48px; opacity: 0; transform-origin: center bottom; filter: drop-shadow(0 3px 2px #163d5666); }
.float-body { width: 16px; height: 35px; border: 2px solid #fff; border-radius: 50% 50% 45% 45%; background: linear-gradient(#ff5b48 0 49%, #fff 50% 75%, #ff5b48 76%); position: relative; }
.float-body::before { content: ''; position: absolute; bottom: 100%; left: 5px; height: 13px; width: 2px; background: #fff6dc; }
.float-body::after { content: ''; position: absolute; top: 100%; left: 5px; height: 10px; width: 2px; background: #c7d5d1; }
.ripple { position: absolute; top: calc(35% + 31px); left: calc(50% - 35px); width: 70px; height: 18px; border: 2px solid #e9ffffb3; border-radius: 50%; opacity: 0; pointer-events: none; }
.game[data-state="casting"] .bobber { opacity: 1; animation: cast .65s ease-out both; }
.game[data-state="waiting"] .bobber { opacity: 1; animation: float 2s ease-in-out infinite; }
.game[data-state="waiting"] .ripple { animation: ripple 2.4s ease-out infinite; }
.game[data-state="waiting"] .ripple-two { animation-delay: 1.2s; }
.game[data-state="bite"] .bobber { opacity: 1; animation: bite .3s ease-in-out infinite; }
.game[data-state="bite"] .ripple { animation: ripple .65s ease-out infinite; }
.game[data-state="success"] .bobber { animation: lift .45s ease-in both; }
.game[data-state="miss"] .bobber { animation: miss .45s ease-out both; }
.game[data-state="miss"] .ripple { animation: ripple .6s ease-out both; }
.bite-label { display: none; position: absolute; top: -12px; width: 100%; text-align: center; color: #fff4c2; text-shadow: 0 3px 0 #713b20, 0 0 12px #713b20; font-size: 30px; font-weight: 900; }
.game[data-state="bite"] .bite-label { display: block; }
.controls { position: absolute; bottom: 0; left: 0; right: 0; padding: 14px 24px max(26px, env(safe-area-inset-bottom)); text-align: center; }
.status { font-size: 17px; font-weight: 600; line-height: 1.5; margin: 0 0 15px; text-shadow: 0 2px 6px #12373b; min-height: 26px; }
.action-slot { height: 64px; max-width: 360px; margin: auto; }
.action { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 60px; border: 2px solid #ffbd79; border-radius: 8px; background: var(--accent); color: #43220d; box-shadow: 0 4px 0 #a84b20; font-size: 22px; font-weight: 800; }
.action:active { transform: translateY(3px); box-shadow: 0 1px 0 #a84b20; }
.action:focus-visible { outline: 3px solid white; outline-offset: 4px; }
.waiting { height: 60px; display: flex; align-items: center; justify-content: center; background: #163f48c9; border: 1px solid #a7d6d488; border-radius: 8px; color: #dff7f5; font-size: 19px; }
.timing { height: 6px; max-width: 360px; margin: 0 auto 12px; background: #ffffff38; border-radius: 8px; visibility: hidden; overflow: hidden; }
.timing span { display: block; height: 100%; background: #ffba68; transform-origin: left; }
.game[data-state="bite"] .timing { visibility: visible; }
.game[data-state="bite"] .timing span { animation: countdown 1.5s linear forwards; }
.modal-backdrop { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(9,39,44,.64); z-index: 5; }
.result { width: min(100%, 340px); max-height: 90dvh; overflow-y: auto; padding: 28px 24px; border: 2px solid #fff6dd; border-radius: 8px; background: rgba(255,251,237,.97); color: #254c4d; text-align: center; box-shadow: 0 12px 48px #082f4944; animation: result-in .3s ease-out both; }
.result-symbol { color: #e37b32; font-size: 52px; min-height: 60px; }
.result h1 { margin: 8px 0; font-size: 27px; }
.result p { line-height: 1.6; }
#resultMessage { color: #5d7373; font-size: 15px; margin: 8px 0 18px; }
.catch-result { padding: 16px 0; border-top: 1px solid #d8e1d7; border-bottom: 1px solid #d8e1d7; font-size: 21px; font-weight: 700; }
.catch-result small { display: block; font-size: 14px; font-weight: 400; margin-top: 7px; color: #65817b; }
.result-score { font-size: 15px; }
.result-score strong { color: #c05d22; font-size: 30px; margin-left: 10px; font-variant-numeric: tabular-nums; }
@keyframes cast { 0% { transform: translate(150px,-300px) rotate(45deg); opacity: 0; } 40% { transform: translate(70px,-180px) rotate(20deg); opacity: 1; } 100% { transform: translate(0,0); opacity: 1; } }
@keyframes float { 0%,100% { transform: translateY(-4px); } 50% { transform: translateY(4px); } }
@keyframes bite { 0%,100% { transform: translate(0,0); } 50% { transform: translate(4px,10px) rotate(8deg); } }
@keyframes ripple { from { opacity: .8; transform: scale(.6); } to { opacity: 0; transform: scale(2.3); } }
@keyframes lift { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translate(50px,-220px) rotate(25deg); } }
@keyframes miss { 0% { opacity: 1; transform: translateX(-6px); } 40% { opacity: 1; transform: translateX(6px); } 100% { opacity: 0; transform: translateY(16px); } }
@keyframes countdown { to { transform: scaleX(0); } }
@keyframes result-in { from { opacity: 0; transform: translateY(45px) scale(.8); } to { opacity: 1; transform: none; } }
@media (min-width: 700px) { .game { max-width: 540px; margin: auto; } }
@media (max-height: 530px) { .controls { padding-bottom: 12px; } .status { margin-bottom: 6px; font-size: 15px; } .result { padding: 16px 20px; } .result-symbol { display: none; } }
