* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; background: #0e3a52; }
body {
  font-family: "Comic Sans MS", "Chalkboard SE", "Segoe Print", sans-serif;
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
}
#app { position: fixed; inset: 0; }
.screen { position: absolute; inset: 0; }
.hidden { display: none !important; }

/* ---------- Title ---------- */
#title-screen { display: flex; align-items: flex-end; justify-content: center; }
.title-art {
  position: absolute; inset: 0;
  background: linear-gradient(#7ec8e3, #2e86ab);
  background-size: cover; background-position: center;
}
.title-content {
  position: relative; text-align: center; padding: 24px 16px 48px;
  width: 100%; max-width: 480px;
  background: linear-gradient(transparent, rgba(10, 40, 60, .75) 30%);
  border-radius: 24px 24px 0 0;
}
h1 {
  font-size: clamp(42px, 9vw, 72px);
  color: #ffe9a8;
  text-shadow: 0 3px 0 #7a4a12, 0 6px 12px rgba(0,0,0,.5);
  letter-spacing: 2px;
}
.tagline { margin: 6px 0 22px; font-size: 16px; color: #d9f1ff; font-style: italic; }
.hint { margin-top: 14px; font-size: 13px; color: #a8d8f0; min-height: 18px; }

.big-btn {
  display: inline-block; margin: 6px; padding: 14px 34px;
  font-family: inherit; font-size: 22px; font-weight: bold; color: #5a3a10;
  background: linear-gradient(#ffd97a, #f5a623); border: 3px solid #8a5a18;
  border-radius: 18px; box-shadow: 0 5px 0 #8a5a18; cursor: pointer;
  transition: transform .06s;
}
.big-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #8a5a18; }
.big-btn.green { background: linear-gradient(#a8e063, #56ab2f); border-color: #2e6b17; box-shadow: 0 5px 0 #2e6b17; color: #16400a; }
.big-btn.green:active { box-shadow: 0 1px 0 #2e6b17; }
.ghost-btn {
  display: block; margin: 10px auto 0; padding: 8px 20px; font-family: inherit; font-size: 15px;
  color: #d9f1ff; background: rgba(255,255,255,.12); border: 2px solid rgba(255,255,255,.35);
  border-radius: 12px; cursor: pointer;
}
.ghost-btn.danger { color: #ffb3a7; border-color: #ff8a75; }

/* ---------- HUD ---------- */
#lake-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
#hud-top {
  position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between;
  padding: 10px 14px; pointer-events: none; font-size: 15px;
  text-shadow: 0 2px 3px rgba(0,0,0,.6);
}
#hud-top > div { background: rgba(8, 40, 60, .55); padding: 6px 12px; border-radius: 14px; }
#hud-bottom {
  position: absolute; bottom: 0; left: 0; right: 0; display: flex; gap: 10px;
  justify-content: center; align-items: center; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
}
.hud-btn {
  font-family: inherit; font-size: 22px; padding: 10px 14px; border-radius: 16px;
  background: rgba(8, 40, 60, .7); color: #fff; border: 2px solid rgba(255,255,255,.3); cursor: pointer;
}
.reel-btn {
  font-size: 20px; font-weight: bold; padding: 16px 30px; border-radius: 50px;
  background: linear-gradient(#ffd97a, #f5a623); color: #5a3a10; border: 3px solid #8a5a18;
  box-shadow: 0 4px 0 #8a5a18; letter-spacing: 1px;
}
.reel-btn:active, .reel-btn.down { transform: translateY(3px); box-shadow: 0 1px 0 #8a5a18; }
.cast-btn {
  font-size: 20px; font-weight: bold; padding: 16px 26px; border-radius: 50px;
  background: linear-gradient(#a8e063, #56ab2f); color: #16400a; border: 3px solid #2e6b17;
  box-shadow: 0 4px 0 #2e6b17; letter-spacing: 1px;
}
.cast-btn:active, .cast-btn.down { transform: translateY(3px); box-shadow: 0 1px 0 #2e6b17; }
#lure-current {
  background: rgba(8,40,60,.7); border: 2px solid rgba(255,255,255,.3); border-radius: 16px;
  padding: 8px 12px; font-size: 14px; max-width: 130px; text-align: center; cursor: pointer;
}

/* ---------- Toast ---------- */
#toast {
  position: absolute; top: 64px; left: 50%; transform: translateX(-50%);
  background: rgba(8, 40, 60, .85); padding: 10px 22px; border-radius: 16px;
  font-size: 16px; text-align: center; max-width: 86%;
  opacity: 0; transition: opacity .4s; pointer-events: none;
  border: 2px solid rgba(255, 255, 255, .25);
}
#toast.show { opacity: 1; }

/* ---------- Cast card ---------- */
#cast-card {
  position: absolute; top: 70px; right: 14px; background: rgba(8, 40, 60, .85);
  border: 2px solid rgba(255,255,255,.3); border-radius: 14px; padding: 10px 16px;
  font-size: 14px; line-height: 1.6; pointer-events: none;
}
#cast-card b { color: #ffd97a; }

/* ---------- Fight ---------- */
#fight-hud { position: absolute; top: 56px; left: 0; right: 0; display: flex; justify-content: center; pointer-events: none; }
.tension-wrap { background: rgba(8,40,60,.8); border-radius: 16px; padding: 10px 18px; width: min(420px, 88%); text-align: center; }
.tension-label { font-size: 12px; letter-spacing: 2px; color: #a8d8f0; }
.tension-bar { position: relative; height: 20px; background: #16414f; border-radius: 10px; margin: 6px 0; overflow: hidden; border: 2px solid rgba(255,255,255,.25); }
#tension-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #56ab2f, #ffd97a 60%, #ff5c42 90%); transition: width .08s linear; }
#tension-danger { position: absolute; right: 0; top: 0; bottom: 0; width: 12%; background: repeating-linear-gradient(45deg, rgba(255,60,40,.5) 0 6px, transparent 6px 12px); }
#fight-hint { font-size: 14px; min-height: 20px; color: #ffe9a8; }

#hookset-flash {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: clamp(48px, 12vw, 96px); font-weight: bold; color: #ffe9a8;
  text-shadow: 0 4px 0 #7a4a12, 0 8px 24px rgba(0,0,0,.6); pointer-events: none;
  animation: pop .5s ease-out;
}
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }

/* ---------- Cards ---------- */
#catch-screen, #journal-screen, #tackle-screen, #menu-screen, #shop-screen {
  display: flex; align-items: center; justify-content: center; background: rgba(5, 25, 40, .7);
  backdrop-filter: blur(3px); z-index: 20;
}
.card {
  background: linear-gradient(#f7ecd7, #ecd9b0); color: #4a3418; border-radius: 22px;
  border: 4px solid #8a5a18; box-shadow: 0 12px 40px rgba(0,0,0,.5);
  width: min(440px, 92%); max-height: 88%; overflow-y: auto; padding: 18px;
}
.card h2 { color: #6b4212; }
.catch-card { text-align: center; }
#catch-banner { font-size: 26px; font-weight: bold; color: #2e6b17; margin-bottom: 4px; }
#catch-banner.legendary { color: #b8860b; }
#catch-img { width: min(240px, 60%); border-radius: 16px; border: 3px solid #8a5a18; background: #fff8ea; margin: 8px 0; }
#catch-stats { display: flex; justify-content: center; gap: 22px; margin: 8px 0; font-size: 18px; }
#catch-stats b { display: block; font-size: 22px; }
.legend-name { font-size: 20px; color: #b8860b; font-weight: bold; min-height: 8px; }
.note { font-size: 14px; font-style: italic; color: #7a5c30; margin: 8px 0; }
.row { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }

.journal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.close-x { font-size: 20px; background: none; border: none; color: #8a5a18; cursor: pointer; padding: 4px 10px; }
#journal-summary { font-size: 15px; margin-bottom: 10px; line-height: 1.5; }
#journal-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.jtab {
  font-family: inherit; padding: 6px 14px; border-radius: 12px; border: 2px solid #8a5a18;
  background: transparent; color: #6b4212; cursor: pointer; font-size: 14px;
}
.jtab.active { background: #8a5a18; color: #ffe9a8; }
.jentry { display: flex; gap: 12px; align-items: center; padding: 8px; border-bottom: 2px dashed #d4b98a; }
.jentry img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; border: 2px solid #8a5a18; background: #fff8ea; }
.jentry .mystery { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; font-size: 30px; background: #d8c9a8; border-radius: 10px; border: 2px dashed #8a5a18; }
.jentry-info { flex: 1; font-size: 14px; line-height: 1.4; }
.jentry-info b { font-size: 16px; }
.obs-block { margin-bottom: 14px; font-size: 14px; line-height: 1.5; }
.obs-block h3 { color: #6b4212; margin-bottom: 2px; }
.rumor { padding: 8px 4px; border-bottom: 2px dashed #d4b98a; font-size: 14px; font-style: italic; }

/* ---------- Tackle ---------- */
.tackle-section h3 { margin: 10px 0 4px; color: #6b4212; }
.titem {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 10px; margin: 4px 0; border-radius: 12px; border: 2px solid #d4b98a;
  cursor: pointer; font-size: 14px; background: rgba(255,255,255,.35);
}
.titem.selected { border-color: #2e6b17; background: #dcedc8; }
.titem.locked { opacity: .55; cursor: default; }
.titem .tname { font-weight: bold; }
.titem .tdesc { font-size: 12px; color: #7a5c30; }
.buy-btn {
  font-family: inherit; padding: 6px 12px; border-radius: 10px; border: 2px solid #2e6b17;
  background: #a8e063; color: #16400a; font-weight: bold; cursor: pointer; white-space: nowrap;
}
.buy-btn:disabled { opacity: .45; cursor: default; }

.menu-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 4px; font-size: 16px; }
.menu-row input { width: 22px; height: 22px; }

@media (max-width: 500px) {
  #hud-top { font-size: 13px; }
  .hud-btn { font-size: 18px; padding: 8px 11px; }
  .reel-btn { padding: 14px 22px; font-size: 17px; }
}
