* { margin: 0; padding: 0; box-sizing: border-box; }
body { overflow: hidden; background: #87ceeb; font-family: "Segoe UI", Arial, sans-serif; color: #fff; user-select: none; }
canvas { display: block; }
#hud { position: fixed; inset: 0; pointer-events: none; padding: 16px; display: flex; justify-content: space-between; align-items: flex-start; }
.panel { background: rgba(8, 20, 30, .72); border: 1px solid rgba(255,255,255,.18); border-radius: 10px; padding: 12px 16px; font-size: 14px; line-height: 1.6; backdrop-filter: blur(4px); min-width: 190px; }
.panel .title { font-weight: 700; letter-spacing: 1.5px; margin-bottom: 6px; color: #ffd479; font-size: 13px; }
.panel .key { display: inline-block; min-width: 52px; color: #8fe3ff; font-weight: 700; }
.panel .score { margin-top: 6px; font-weight: 700; color: #ffd479; }
#crosshair { position: fixed; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border: 1px solid rgba(255,255,255,.9); border-radius: 50%; pointer-events: none; }
#auth { position: fixed; inset: 0; z-index: 60; background: radial-gradient(circle at 50% 30%, #123047, #050b12 70%); display: flex; justify-content: center; align-items: center; }
#auth.hidden { display: none; }
.auth-card { width: 360px; max-width: 92vw; background: rgba(8,20,30,.94); border: 1px solid #ffd479; border-radius: 16px; padding: 26px; text-align: center; box-shadow: 0 20px 70px #000; }
.auth-title { font-size: 30px; font-weight: 900; letter-spacing: 3px; color: #ffd479; }
.auth-sub { font-size: 12px; color: #9fd8ef; margin: 6px 0 18px; }
.auth-card input { width: 100%; padding: 11px; margin-bottom: 9px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.22); border-radius: 8px; color: #fff; font: inherit; outline: none; }
.auth-card input:focus { border-color: #ffd479; }
.auth-btns { display: flex; gap: 8px; margin-top: 6px; }
.auth-btns .big-btn { flex: 1; }
.auth-err { min-height: 18px; margin-top: 10px; color: #ff6b57; font-size: 12px; }
.auth-user { color: #7de0a0; font-size: 12px; }
#hint { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); background: rgba(8,20,30,.8); border: 1px solid rgba(255,255,255,.2); border-radius: 20px; padding: 9px 20px; font-size: 15px; pointer-events: none; white-space: nowrap; }
#fight { position: fixed; left: 50%; top: 62%; transform: translate(-50%,-50%); width: 380px; text-align: center; pointer-events: none; }
#fight.hidden, #result.hidden, #start.hidden, #casino.hidden, #admin.hidden, #alarm.hidden, #leaderboard.hidden { display: none; }
#hitFlash { position: fixed; inset: 0; z-index: 40; pointer-events: none; background: radial-gradient(circle, transparent 30%, rgba(180,0,0,.85) 100%); opacity: 0; transition: opacity .12s; }
#mobilized { position: fixed; inset: 0; z-index: 55; display: flex; flex-direction: column; justify-content: center; align-items: center; background: rgba(8,4,4,.92); pointer-events: none; }
#mobilized.hidden { display: none; }
.mobil-title { font-size: 58px; font-weight: 900; letter-spacing: 8px; color: #ffe14d; text-shadow: 0 0 30px #ff9b00, 0 6px 0 #7a2a00; }
.mobil-sub { margin-top: 12px; font-size: 16px; color: #ddd; }
.mobil-timer { margin-top: 22px; font-size: 40px; font-weight: 800; color: #fff; }
#alarm { position: fixed; left: 50%; top: 9%; transform: translateX(-50%); z-index: 25; padding: 12px 26px; border: 2px solid #ff4b4b; border-radius: 8px; background: rgba(60,0,0,.82); color: #fff; font-size: 20px; font-weight: 900; letter-spacing: 3px; text-shadow: 0 0 12px #ff0000; animation: alarmflash .55s steps(2) infinite; pointer-events: none; }
@keyframes alarmflash { 50% { background: rgba(160,0,0,.9); color: #ffd9d9; } }
.jump-stat { margin-top: 6px; font-size: 11px; color: #7de0a0; letter-spacing: 1px; }
.fight-title { font-size: 14px; font-weight: 800; letter-spacing: 1px; color: #ffd479; text-shadow: 0 2px 6px #000; }
.fight-duel { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 6px 0 2px; }
.duel-side { display: flex; flex-direction: column; align-items: center; min-width: 120px; }
.duel-label { font-size: 10px; letter-spacing: 1.5px; color: #9fd8ef; }
.dash-arrow { font-size: 62px; line-height: 1; font-weight: 800; color: #ff6b57; text-shadow: 0 2px 14px #000; transition: transform .08s linear, color .1s; }
.pull-arrow { font-size: 62px; line-height: 1; font-weight: 800; color: #7de0a0; text-shadow: 0 2px 14px #000; }
.dash-arrow.dash { color: #fff; transform: scale(1.25); text-shadow: 0 0 22px #ff4a3a, 0 2px 12px #000; }
.duel-vs { font-size: 24px; color: rgba(255,255,255,.5); }
.fight-beat { position: absolute; left: 50%; top: -26px; transform: translateX(-50%) scale(.7); font-size: 18px; font-weight: 900; letter-spacing: 3px; color: #fff; text-shadow: 0 0 18px #ff3b30; opacity: 0; transition: opacity .1s, transform .1s; }
.fight-beat.active { opacity: 1; transform: translateX(-50%) scale(1); }
.fight-dir { font-size: 12px; color: #ddd; margin-bottom: 8px; }
.bar { height: 16px; background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.35); border-radius: 10px; overflow: hidden; }
.bar > div { height: 100%; width: 0%; border-radius: 10px; transition: width .08s linear; }
#progress { background: linear-gradient(90deg,#4dd07a,#b6f36a); }
.bar.tension { height: 10px; margin-top: 5px; }
#tensionBar { background: linear-gradient(90deg,#f0b83c,#e0483c); }
.fight-labels { display: flex; justify-content: space-between; font-size: 11px; color: #ccc; margin-top: 5px; }
#result { position: fixed; inset: 0; display: flex; justify-content: center; align-items: center; pointer-events: none; }
.result-card { background: rgba(6, 18, 28, .9); border: 1px solid rgba(255,255,255,.25); border-radius: 16px; padding: 26px 40px; text-align: center; min-width: 320px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.result-label { font-size: 12px; letter-spacing: 3px; color: #8fe3ff; }
.result-name { font-size: 32px; font-weight: 800; margin: 6px 0; }
.result-detail { font-size: 16px; color: #ddd; }
.result-desc { margin: 8px auto 4px; max-width: 340px; font-size: 12px; line-height: 1.45; color: #ffcf8a; font-style: italic; }
.result-points { font-size: 22px; font-weight: 700; color: #ffd479; margin-top: 8px; }
.result-hint { font-size: 13px; color: #aaa; margin-top: 14px; }
#start { position: fixed; inset: 0; background: rgba(4,14,22,.78); display: flex; justify-content: center; align-items: center; cursor: pointer; }
.start-card { text-align: center; }
.start-title { font-size: 46px; font-weight: 900; letter-spacing: 3px; color: #ffd479; text-shadow: 0 4px 20px #000; }
.start-sub { font-size: 16px; color: #bfe6ff; margin: 6px 0 26px; }
.start-btn { display: inline-block; padding: 14px 32px; border: 1px solid #ffd479; border-radius: 30px; font-weight: 800; letter-spacing: 1px; }
.start-small { margin-top: 20px; font-size: 12px; color: #aaa; }

#casino { position: fixed; inset: 0; background: rgba(4,10,16,.86); display: flex; justify-content: center; align-items: center; z-index: 20; }
.casino-card { width: 560px; max-width: 94vw; background: linear-gradient(180deg,#101a26,#0a121c); border: 1px solid #ffce63; border-radius: 18px; padding: 22px 26px; box-shadow: 0 16px 60px #000, 0 0 40px rgba(255,190,60,.12); }
.casino-title { font-size: 27px; font-weight: 900; letter-spacing: 3px; color: #ffd479; text-align: center; text-shadow: 0 0 18px rgba(255,180,40,.5); }
.casino-sub { text-align: center; font-size: 12px; color: #9fd8ef; margin: 4px 0 16px; }
.casino-head, .casino-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; align-items: center; gap: 8px; padding: 7px 10px; font-size: 13px; }
.casino-head { color: #8fa6b8; font-size: 10px; letter-spacing: 1.5px; border-bottom: 1px solid rgba(255,255,255,.15); }
.casino-row { border-bottom: 1px solid rgba(255,255,255,.07); }
.casino-row.active { background: rgba(255,206,99,.09); }
.casino-row span { text-align: center; }
.fish-sel { background: none; border: none; color: #fff; font: inherit; text-align: left; cursor: pointer; padding: 0; }
.casino-row.active .fish-sel { color: #ffd479; font-weight: 700; }
.casino-line { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 11px; color: #9fd8ef; letter-spacing: 1px; }
.casino-line > span { width: 115px; }
.chip-btn, .bet-btn, .big-btn { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.22); color: #fff; border-radius: 8px; padding: 7px 12px; font: inherit; font-size: 12px; cursor: pointer; }
.chip-btn.active, .bet-btn.active { background: rgba(255,206,99,.22); border-color: #ffd479; color: #ffd479; }
.bet-btn { flex: 1; }
.casino-bottom { display: flex; align-items: center; gap: 22px; margin-top: 16px; }
.casino-wheel { font-size: 58px; color: #ffd479; width: 76px; text-align: center; transition: color .2s; }
.casino-wheel.spinning { animation: spin .35s linear infinite; color: #ff6b57; }
@keyframes spin { to { transform: rotate(360deg); } }
.casino-actions { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.big-btn { font-weight: 800; letter-spacing: 1px; padding: 11px; }
.big-btn.gold { background: #c8912c; border-color: #ffd479; color: #1a1206; }
.big-btn.ghost { font-size: 11px; padding: 6px; opacity: .75; }
.casino-msg { margin-top: 14px; min-height: 36px; text-align: center; font-size: 13px; color: #7de0a0; border-top: 1px solid rgba(255,255,255,.12); padding-top: 12px; }

.money { margin-top: 3px; font-weight: 700; color: #7de0a0; }
#achievements { position: fixed; left: 16px; bottom: 16px; pointer-events: auto; max-width: 340px; min-width: 320px; max-height: calc(100vh - 190px); overflow-y: auto; }
#achCount { float: right; color: #7de0a0; }
.ach-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; max-height: none; overflow: visible; }
.ach { display: flex; align-items: center; gap: 3px; font-size: 9px; padding: 2px 3px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.07); border-radius: 5px; color: #8d9aa5; }
.ach.got { color: #fff; background: rgba(125,224,160,.12); border-color: rgba(125,224,160,.4); }
.ach-icon { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; flex-shrink: 0; font-size: 12px; font-weight: 800; border-radius: 50%; background: rgba(255,255,255,.1); }
.ach.got .ach-icon { background: rgba(125,224,160,.25); }
.ach-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#leaderboard { position: fixed; right: 16px; bottom: 16px; pointer-events: none; min-width: 260px; max-width: 300px; font-size: 11px; }
.lb-hint { float: right; color: #8fa6b8; font-size: 10px; }
.lb-row { display: grid; grid-template-columns: 18px 1fr 28px 56px; gap: 4px; padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.lb-place { color: #ffd479; font-weight: 800; }
.lb-user { display: grid; grid-template-columns: 18px 1fr 62px; gap: 4px; padding: 3px 0 0; border-bottom: none; }
.lb-user b { color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-user span:last-child { color: #ffd479; text-align: right; }
.lb-catch { font-size: 9px; color: #9fd8ef; padding: 0 0 4px 22px; line-height: 1.3; border-bottom: 1px solid rgba(255,255,255,.08); }
.lb-row span:nth-child(3) { color: #8fe3ff; }
.lb-row span:nth-child(4) { color: #9fd8ef; text-align: right; }
.lb-total { margin-top: 6px; color: #7de0a0; font-weight: 700; }
.slot-machine { background: linear-gradient(180deg,#2a1726,#160d16); border: 3px solid #d5a33c; border-radius: 14px; padding: 12px; margin: 4px 0 12px; box-shadow: inset 0 0 30px #000, 0 0 18px rgba(255,180,50,.25); }
.slot-top { text-align: center; font-size: 13px; font-weight: 900; letter-spacing: 4px; color: #ffd479; text-shadow: 0 0 12px #ff8c2b; }
.reels { display: flex; justify-content: center; gap: 10px; margin: 10px 0; }
.reel { width: 92px; height: 92px; background: linear-gradient(180deg,#fdfbf3,#d8d4c8); border: 3px solid #b99236; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 52px; box-shadow: inset 0 8px 16px rgba(0,0,0,.25); }
.reel.spinning { animation: reelspin .12s linear infinite; filter: blur(1px); }
@keyframes reelspin { to { transform: translateY(6px); } }
.slot-paytable { text-align: center; font-size: 10px; color: #d9c7a5; letter-spacing: .3px; }
.casino-balance { text-align: center; font-size: 15px; margin: 10px 0; color: #cfe9f5; }
.casino-balance b { color: #ffd479; font-size: 19px; }
.shop-title { font-size: 11px; letter-spacing: 2px; color: #ffd479; margin: 10px 0 6px; text-align: center; }
.rod-shop { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.rod-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.15); border-radius: 7px; padding: 6px 4px; color: #dfe9ef; cursor: pointer; font-family: inherit; }
.rod-btn b { font-size: 10px; }
.rod-btn span { font-size: 9px; color: #ffd479; }
.rod-btn.owned { border-color: rgba(125,224,160,.5); }
.rod-btn.active { background: rgba(255,206,99,.18); border-color: #ffd479; }
.rod-btn.active span { color: #7de0a0; }
#admin { position: fixed; inset: 0; background: rgba(2,8,14,.9); display: flex; justify-content: center; align-items: center; z-index: 30; }
.admin-card { width: 380px; max-width: 92vw; background: linear-gradient(180deg,#101b26,#080f18); border: 1px solid #7de0a0; border-radius: 14px; padding: 22px; box-shadow: 0 16px 60px #000, 0 0 28px rgba(125,224,160,.14); text-align: center; }
.admin-title { font-size: 22px; font-weight: 900; letter-spacing: 3px; color: #7de0a0; margin-bottom: 14px; }
.admin-sub { font-size: 12px; color: #9fd8ef; margin-bottom: 10px; }
.admin-card input { width: 100%; padding: 10px; margin-bottom: 10px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.22); border-radius: 8px; color: #fff; font: inherit; outline: none; }
.admin-card input:focus { border-color: #7de0a0; }
.admin-err { min-height: 18px; margin-top: 8px; font-size: 12px; color: #ff6b57; }
.admin-balance { font-size: 16px; color: #cfe9f5; margin-bottom: 12px; }
.admin-balance b { color: #ffd479; font-size: 22px; }
.admin-give { display: flex; gap: 8px; }
.admin-give input { margin-bottom: 0; flex: 1; }
.admin-give .big-btn { width: 110px; }
.admin-quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 10px 0; }
.admin-quick button { padding: 8px; border: 1px solid rgba(125,224,160,.4); border-radius: 7px; background: rgba(125,224,160,.1); color: #7de0a0; font: inherit; font-weight: 700; cursor: pointer; }
#adminClose { width: 100%; margin-top: 4px; }
.casino-line > span:first-child { width: 92px; flex-shrink: 0; }
.fish-sel { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.2); border-radius: 7px; padding: 6px 8px; font-size: 11px; cursor: pointer; }
.fish-sel.active { border-color: #ffd479; color: #ffd479; background: rgba(255,206,99,.15); }
.bet-btn { padding: 6px 10px; }
.bag-hint { font-size: 11px; color: #9fd8ef; margin-left: 4px; }
.casino-actions.row { flex-direction: row; margin-top: 12px; }
.casino-actions.row .big-btn { flex: 1; font-size: 11px; padding: 10px 4px; }
