@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0b0e16; overflow: hidden; font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; color: #f3f0e6; }
#game { position: absolute; left: 50%; top: 50%; width: 960px; height: 540px; transform-origin: 0 0; image-rendering: pixelated; }
#c { position: absolute; left: 0; top: 0; width: 960px; height: 540px; image-rendering: pixelated; cursor: crosshair; background: #87ceeb; }
#hud { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; display: none; }
#hud .bar { display: flex; gap: 8px; padding: 8px 10px; align-items: center; flex-wrap: wrap; }
#hud .chip { background: rgba(10,14,25,0.78); border: 2px solid #3b4a6b; border-radius: 6px; padding: 5px 9px; font-size: 13px; font-weight: 700; pointer-events: auto; white-space: nowrap; }
#hud .chip.money { color: #ffd84d; border-color: #b8901f; }
#hud .chip.luck { color: #9ef29e; border-color: #3f8f3f; }
#hud .chip button, #hud button.chip { cursor: pointer; font: inherit; color: inherit; background: #223055; border: 2px solid #4a63a0; border-radius: 6px; padding: 4px 9px; }
#hud button.chip:hover { background: #2f4478; }
#hud .hint { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font-size: 12px; color: #e9e4d0; text-shadow: 0 1px 2px #000, 0 0 6px #000; }
#ui { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: none; }
#toasts { position: absolute; left: 50%; transform: translateX(-50%); top: 70px; width: 440px; display: flex; flex-direction: column; gap: 6px; pointer-events: none; align-items: center; }
.toast { background: rgba(20,24,40,0.92); border: 2px solid #4a63a0; border-left: 6px solid #4a63a0; padding: 8px 12px; border-radius: 6px; font-size: 13px; max-width: 440px; opacity: 0; transform: translateY(-12px); transition: transform .3s, opacity .3s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ach { border-color: #f1c40f; border-left-color: #f1c40f; }
.toast.bad { border-color: #c0392b; border-left-color: #c0392b; }
.toast.good { border-color: #27ae60; border-left-color: #27ae60; }
.pxfont { font-family: 'Press Start 2P', monospace; }

.dialog { position: absolute; left: 20px; right: 20px; bottom: 16px; min-height: 150px; background: rgba(12,16,28,0.94); border: 3px solid #5d6f99; border-radius: 10px; display: flex; gap: 14px; padding: 12px; cursor: pointer; box-shadow: 0 8px 30px rgba(0,0,0,.6); }
.dialog.narr .dlg-left { display: none; }
.dialog.narr .dlg-text { font-style: italic; color: #d9d4c4; }
.dlg-left { flex: 0 0 112px; }
.portrait { width: 112px; height: 112px; border: 3px solid #5d6f99; border-radius: 8px; background: #1b2238; image-rendering: pixelated; }
.dlg-right { flex: 1; display: flex; flex-direction: column; }
.dlg-name { font-family: 'Press Start 2P', monospace; font-size: 12px; color: #ffd84d; margin-bottom: 8px; }
.dlg-text { font-size: 17px; line-height: 1.4; flex: 1; }
.dlg-hint { font-size: 11px; color: #8d99b8; text-align: right; margin-top: 6px; }
.dlg-opts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.btn { cursor: pointer; font: 700 14px 'Segoe UI', Roboto, sans-serif; color: #fff; background: #2a5bd7; border: 2px solid #6b93ff; border-radius: 6px; padding: 8px 14px; }
.btn:hover { background: #3a6ef0; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sec { background: #3a3f52; border-color: #6a7190; }
.btn.danger { background: #a93226; border-color: #e06050; }
.btn.good { background: #1e8449; border-color: #4fcf7a; }
.btn.big { font-size: 18px; padding: 12px 24px; }

.panel { position: absolute; left: 30px; top: 24px; right: 30px; bottom: 24px; background: rgba(12,16,28,0.96); border: 3px solid #5d6f99; border-radius: 12px; padding: 16px 20px; overflow: auto; box-shadow: 0 10px 40px rgba(0,0,0,.7); }
.panel h2 { font-family: 'Press Start 2P', monospace; font-size: 16px; color: #ffd84d; margin: 0 0 6px 0; }
.panel h3 { margin: 14px 0 6px; color: #9fc0ff; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; }
.panel .sub { color: #b9b3a0; font-size: 13px; margin-bottom: 10px; }
.panel .close { position: absolute; right: 12px; top: 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; }
.card { background: #171d30; border: 2px solid #34405f; border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.card.locked { opacity: .55; }
.card.owned { border-color: #2e8b57; }
.card.current { border-color: #ffd84d; box-shadow: 0 0 0 1px #ffd84d inset; }
.card .t { font-weight: 800; font-size: 14px; }
.card .d { font-size: 12px; color: #c9c3b1; flex: 1; }
.card .p { font-size: 13px; color: #ffd84d; font-weight: 700; }
.card .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.card .stat { font-size: 11px; color: #8fd3ff; }
.ach .card { flex-direction: row; align-items: center; gap: 10px; }
.ach .ic { font-size: 28px; width: 40px; text-align: center; }
.ach .card.locked .ic { filter: grayscale(1); }
.fishlist { display: flex; flex-wrap: wrap; gap: 6px; }
.fishlist .f { background: #1f2a44; border: 1px solid #3f5078; border-radius: 6px; padding: 4px 8px; font-size: 12px; }
.title { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 36px; gap: 12px; background: linear-gradient(to bottom, rgba(0,0,0,0) 40%, rgba(0,0,0,.75)); }
.title h1 { font-family: 'Press Start 2P', monospace; font-size: 30px; color: #ffd84d; text-shadow: 4px 4px 0 #7a1f1f, 0 0 20px #000; margin: 0; text-align: center; line-height: 1.5; }
.title .tag { font-size: 15px; color: #e9e4d0; text-shadow: 0 2px 4px #000; text-align: center; max-width: 720px; }
.title .btns { display: flex; gap: 12px; }
.catch { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 520px; background: rgba(12,16,28,0.96); border: 3px solid #ffd84d; border-radius: 12px; padding: 16px 20px; text-align: center; box-shadow: 0 10px 40px #000; }
.catch .ic { font-size: 56px; }
.catch .n { font-family: 'Press Start 2P', monospace; font-size: 14px; color: #ffd84d; margin: 8px 0; line-height: 1.5; }
.catch .d { font-size: 14px; color: #d9d4c4; margin-bottom: 10px; font-style: italic; }
.catch .kg { font-size: 20px; font-weight: 800; }
.catch .q { font-size: 15px; color: #9ef29e; margin: 8px 0 12px; }
.badge { display: inline-block; font-size: 10px; padding: 2px 6px; border-radius: 4px; background: #34405f; color: #fff; margin-left: 6px; vertical-align: middle; }
.badge.boss { background: #8e44ad; } .badge.junk { background: #7f8c8d; } .badge.rare { background: #d35400; }
.progress { height: 18px; background: #0d1120; border: 2px solid #4a63a0; border-radius: 6px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, #27ae60, #9ef29e); transition: width .3s; }
.ctrls { font-size: 12px; color: #b9b3a0; margin-top: 8px; }
kbd { background: #2a3350; border: 1px solid #58699a; border-bottom-width: 3px; border-radius: 4px; padding: 1px 6px; font-family: monospace; font-size: 12px; color: #fff; }

.casrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 10px; }
.casrow .chip { background: rgba(10,14,25,0.78); border: 2px solid #3b4a6b; border-radius: 6px; padding: 6px 10px; font-size: 14px; font-weight: 700; }
.casrow .chip.money { color: #ffd84d; border-color: #b8901f; } .casrow .chip.dep { color: #ff9ef2; border-color: #a33f9a; }
.spin { position: relative; height: 112px; overflow: hidden; border: 3px solid #a33f9a; border-radius: 10px; background: #120a1a; margin: 6px 0; }
.spin .marker { position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; background: #ffd84d; z-index: 2; box-shadow: 0 0 10px #ffd84d; }
.spin .strip { display: flex; gap: 6px; padding: 6px 0 6px 6px; will-change: transform; }
.tile { flex: 0 0 110px; height: 94px; background: #241433; border: 2px solid #5a2f6e; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.tile .ti { font-size: 34px; } .tile .tn { font-size: 10px; color: #e9d9f5; text-align: center; padding: 0 4px; line-height: 1.2; }
.tile.jp { border-color: #ffd84d; background: #3a2a0a; } .tile.junk { opacity: .6; }
.spinres { font-size: 15px; margin: 6px 0 10px; color: #ffe9a8; min-height: 22px; }

.mgwrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
#mgc { background: linear-gradient(#2b3a55, #1a2238); border: 3px solid #5d6f99; border-radius: 10px; image-rendering: pixelated; }
.armbar { position: relative; width: 560px; height: 26px; background: #5a1e1e; border: 2px solid #fff; border-radius: 6px; overflow: hidden; }
.armfill { height: 100%; background: linear-gradient(90deg, #c0392b, #27ae60); transition: width .05s linear; }
.armmid { position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; background: #ffd84d; }
.armbar span { position: absolute; top: 3px; font-size: 12px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000; } .armbar .al { left: 8px; } .armbar .ar { right: 8px; }

.callwrap { display: flex; gap: 14px; align-items: flex-start; margin: 6px 0; }
#callc { border: 3px solid #5865f2; border-radius: 10px; image-rendering: pixelated; background: #1b1e26; }
.callbtns { display: flex; flex-direction: column; gap: 8px; }


#hud .bar .gap { width: 10px; }
#hud .side.bl { position: absolute; left: 8px; bottom: 30px; display: flex; flex-direction: column; gap: 5px; pointer-events: none; }
#hud .side.bl .chip { pointer-events: auto; text-align: left; min-width: 160px; font-size: 13px; padding: 6px 10px; }

#preloader { position: fixed; inset: 0; background: #0b0e16; display: flex; align-items: center; justify-content: center; z-index: 100; transition: opacity .5s; }
#preloader.hide { opacity: 0; pointer-events: none; }
.pl-box { width: min(420px, 86vw); text-align: center; }
.pl-title { font-family: 'Press Start 2P', monospace; font-size: 22px; color: #ffd84d; text-shadow: 3px 3px 0 #7a1f1f; margin-bottom: 8px; }
.pl-sub { font-family: 'Press Start 2P', monospace; font-size: 11px; color: #9ef29e; margin-bottom: 22px; }
.pl-bar { height: 22px; border: 3px solid #5d6f99; border-radius: 6px; background: #121728; overflow: hidden; }
#plfill { height: 100%; width: 0; background: linear-gradient(90deg, #27ae60, #9ef29e); transition: width .25s; }
.pl-row { display: flex; justify-content: space-between; margin-top: 10px; font-size: 14px; color: #d9d4c4; }
