:root {
  --ink: #eaf6ff;
  --deep: #04101c;
  --panel: #0d2233;
  --accent: #ffd23e;
  --green: #7be04a;
  --red: #ff5d5d;
  --blue: #4fa3d9;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--deep); }
body {
  font-family: "Courier New", Courier, monospace;
  color: var(--ink);
  letter-spacing: 1px;
  font-weight: 700;
  -webkit-font-smoothing: none;
}
#frame { max-width: 720px; margin: 0 auto; padding: 10px; position: relative; z-index: 1; }
.screen { padding: 8px 0; }
.hidden { display: none !important; }

/* ---- CRT scanline overlay ---- */
#crt {
  pointer-events: none; position: fixed; inset: 0; z-index: 9;
  background: repeating-linear-gradient(
    to bottom, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 2px,
    rgba(0,0,0,.18) 3px, rgba(0,0,0,0) 4px);
  mix-blend-mode: multiply;
}
#crt::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 58%, rgba(0,0,0,.42) 100%);
}

.logo {
  font-size: 46px; margin: 12px 0 0; text-align: center;
  color: var(--accent); letter-spacing: 4px;
  text-shadow: 3px 0 0 #e2542c, 0 3px 0 #e2542c, 3px 3px 0 #7a3b00, 6px 6px 0 #000;
  animation: bob 2.2s steps(2) infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.tagline { text-align: center; color: var(--green); margin: 8px 0 14px; letter-spacing: 3px; }

.panel {
  background: var(--panel);
  border: 4px solid var(--ink);
  box-shadow: 0 0 0 4px #000, 8px 8px 0 rgba(0,0,0,.5);
  padding: 14px; margin: 0 auto 14px; max-width: 660px;
}
h2 { font-size: 15px; margin: 0 0 8px; letter-spacing: 2px; }
label { display: block; margin-bottom: 8px; font-size: 12px; }
.crt { color: var(--green); }

.steps { margin: 0 0 10px; padding-left: 4px; list-style: none; font-size: 13px; line-height: 1.7; }
.steps b { color: var(--accent); }
.legend { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; }
.tag {
  font-size: 11px; padding: 3px 6px; border: 2px solid #000; background: #000;
  box-shadow: inset 0 0 0 1px currentColor;
}
.tag.blue { color: var(--blue); } .tag.green { color: var(--green); }
.tag.red { color: var(--red); } .tag.gold { color: var(--accent); }

textarea {
  width: 100%; background: #000; color: var(--green);
  border: 3px solid var(--blue); padding: 8px;
  font-family: inherit; font-size: 14px; font-weight: 700; resize: vertical;
}
.row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

.btn {
  font-family: inherit; font-size: 14px; font-weight: 700; letter-spacing: 1px;
  background: var(--blue); color: #04121e; border: 3px solid #000;
  box-shadow: inset -3px -3px 0 rgba(0,0,0,.35), inset 3px 3px 0 rgba(255,255,255,.4), 4px 4px 0 #000;
  padding: 8px 14px; cursor: pointer; text-transform: uppercase;
}
.btn:hover { filter: brightness(1.18); }
.btn:active { transform: translate(2px,2px); box-shadow: inset 3px 3px 0 rgba(0,0,0,.35), 2px 2px 0 #000; }
.btn.big { background: var(--accent); font-size: 18px; padding: 12px 20px; animation: pulse 1.4s steps(2) infinite; }
@keyframes pulse { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.22); } }
.btn.ghost { background: #16405e; color: var(--ink); }
.btn.tiny { font-size: 11px; padding: 3px 8px; background: #16405e; color: var(--green); border-width: 2px; }
.help { font-size: 12px; color: #9fc3d8; line-height: 1.5; }

/* ---------- play screen ---------- */
#hud {
  display: flex; gap: 14px; align-items: center; justify-content: center;
  font-size: 16px; margin-bottom: 6px; flex-wrap: wrap;
}
#hud-score { color: var(--accent); }
#hud-mult { color: var(--green); }
#hud-mult.hot { color: var(--red); text-shadow: 0 0 6px var(--red); }
#hud-lives { color: var(--red); }
#hud-card { color: var(--blue); }

#stage { position: relative; width: 100%; max-width: 640px; margin: 0 auto; line-height: 0; }
#stage.shake { animation: shake .35s steps(4); }
@keyframes shake {
  0% { transform: translate(0,0); } 25% { transform: translate(-6px,3px); }
  50% { transform: translate(5px,-4px); } 75% { transform: translate(-3px,2px); }
  100% { transform: translate(0,0); }
}
#game {
  width: 100%; aspect-ratio: 640 / 440; display: block;
  image-rendering: pixelated;
  border: 4px solid #000; box-shadow: 0 0 0 4px var(--panel);
  background: #0b5ea8;
}
#fish-layer { position: absolute; inset: 0; pointer-events: none; overflow: visible; line-height: 1; }
.fish-btn {
  position: absolute; pointer-events: auto; cursor: crosshair;
  background: transparent; border: none; padding: 0;
  transform: translate(-50%, -50%);
}
.fish-tag {
  display: inline-block; transform: translateY(-32px);
  font-family: inherit; font-size: 12px; font-weight: 700; letter-spacing: 0; line-height: 1.4;
  color: #fff; background: rgba(0,0,0,.55); border: 2px solid rgba(255,255,255,.85);
  padding: 2px 7px; text-shadow: 1px 1px 0 #000; white-space: nowrap;
}
.fish-btn:hover .fish-tag { border-color: var(--accent); color: var(--accent); }
.fish-btn.gold .fish-tag { color: var(--accent); }
.fish-btn.royal .fish-tag { color: #ff9d9d; }
.fish-btn.snapper .fish-tag { color: #b8f59a; }
.pop {
  position: absolute; pointer-events: none; z-index: 5;
  font-size: 15px; color: var(--accent); text-shadow: 2px 2px 0 #000;
  animation: rise .9s steps(6) forwards; white-space: nowrap; transform: translate(-50%,0);
}
.pop.bad { color: var(--red); }
@keyframes rise { from { opacity: 1; margin-top: 0; } to { opacity: 0; margin-top: -46px; } }

#timerbar {
  position: absolute; left: 6px; right: 6px; top: 4px; height: 8px;
  background: rgba(0,0,0,.5); border: 2px solid #000; pointer-events: none;
}
#timerfill { height: 100%; width: 100%; background: var(--green); }
#timerfill.low { background: var(--red); }

#banner {
  position: absolute; left: 0; right: 0; top: 38%; text-align: center;
  font-size: 26px; letter-spacing: 2px; color: var(--accent); text-shadow: 2px 2px 0 #000, -2px 0 0 #000;
  pointer-events: none; line-height: 1.4; z-index: 6;
  animation: bannerin .18s steps(3);
}
#banner.bad { color: var(--red); }
#banner.good { color: var(--green); }
@keyframes bannerin { from { transform: scale(.6); } to { transform: scale(1); } }

#question {
  max-width: 640px; margin: 10px auto 0; text-align: center;
  background: #000; border: 3px solid var(--accent); padding: 10px 12px;
  font-size: 18px; color: var(--ink); min-height: 46px; line-height: 1.4;
}
#play-help { text-align: center; }

/* ---------- results ---------- */
#over-title {
  text-align: center; color: var(--red); font-size: 38px; letter-spacing: 3px;
  text-shadow: 3px 3px 0 #000;
  animation: bob 1.6s steps(2) infinite;
}
#over-title.win { color: var(--green); }
#over-score { text-align: center; font-size: 26px; color: var(--accent); margin: 6px 0 0; }
#over-stats { text-align: center; font-size: 13px; margin: 4px 0 0; }
#over-rank { text-align: center; font-size: 15px; min-height: 20px; margin: 2px 0 8px; }
#entry { justify-content: center; align-items: stretch; }
#name {
  font-family: inherit; font-size: 16px; font-weight: 700; text-transform: uppercase;
  background: #000; color: var(--green); border: 3px solid var(--accent);
  padding: 8px; width: 180px; letter-spacing: 2px;
}
.boardhead { margin-top: 12px; }
.boardhead.warn { color: var(--red); }
#board { font-size: 15px; padding-left: 0; list-style: none; counter-reset: rank; margin: 4px 0; }
#board li { counter-increment: rank; padding: 4px 6px; border-bottom: 1px dashed #1c3a52; }
#board li::before { content: counter(rank) ". "; color: var(--blue); }
#board li.me { background: #143a52; color: var(--accent); }
#board li .pts { float: right; color: var(--accent); }
#board li.empty { color: #5f7f95; }
#study-wrap { margin-top: 10px; }
#study { font-size: 13px; padding-left: 0; list-style: none; margin: 4px 0; }
#study li { padding: 4px 6px; background: #081826; border-left: 4px solid var(--red); margin-bottom: 4px; }
#study li b { color: var(--green); }

/* ============ round-2 additions ============ */
.fish-btn.reveal {
  animation: revealPulse .45s infinite alternate;
  box-shadow: 0 0 0 3px #ffd23e, 0 0 20px 8px rgba(255,210,62,.85);
  z-index: 30;
}
@keyframes revealPulse { from { transform: scale(1); } to { transform: scale(1.12); } }
.fish-btn.dim { opacity: .35; filter: grayscale(.6); }
.fish-btn.caught { animation: flyUp .42s forwards; z-index: 40; }
@keyframes flyUp { to { transform: translateY(-130px) scale(1.4); opacity: 0; } }
.fish-btn.boss {
  border-color: #ffd23e;
  box-shadow: 0 0 0 3px #b8860b, 0 0 18px 5px rgba(255,210,62,.65);
}
#stage.flash::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,.55);
  animation: flashFade .35s forwards; pointer-events: none; z-index: 50;
}
@keyframes flashFade { from { opacity: 1; } to { opacity: 0; } }
#banner.combo {
  color: #ffd23e;
  text-shadow: 0 0 12px #ff7b00, 2px 2px 0 #000;
  font-size: 30px;
  animation: comboPop .3s;
}
@keyframes comboPop { 0% { transform: scale(.4); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }
