:root {
  --ink: #0c1c26;
  --paper: #f4efe3;
  --warm: #ffce8a;
  --accent: #4fbf72;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; height: 100%; width: 100%;
  overflow: hidden;
  background: #0c1c26;
  font-family: "Quicksand", system-ui, sans-serif;
  color: #eaf6ff;
  user-select: none;
  touch-action: manipulation;
}

#game {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  display: block;
  cursor: pointer;
}

/* ---------- toolbar ---------- */
#toolbar {
  position: fixed; top: 8px; left: 8px; right: 44px;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 8px; z-index: 50; pointer-events: none;
}
#locInfo {
  background: rgba(8, 22, 30, 0.5);
  backdrop-filter: blur(4px);
  border-radius: 10px; padding: 6px 12px;
  display: flex; flex-direction: column; line-height: 1.15;
  pointer-events: none;
}
#locName { font-family: "Pacifico", cursive; font-size: 19px; color: var(--warm); }
#stats { font-size: 11px; font-weight: 600; opacity: 0.8; }

#tools { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; pointer-events: auto; }
.tbtn {
  font-family: "Quicksand", sans-serif; font-weight: 600; font-size: 13px;
  color: #eaf6ff; background: rgba(8, 22, 30, 0.55); backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px; padding: 7px 11px; cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.tbtn:hover { background: rgba(8, 22, 30, 0.8); }
.tbtn:active { transform: scale(0.94); }

/* ---------- fullscreen ---------- */
#sg-fs-btn {
  position: fixed; top: 8px; right: 8px;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  padding: 0; border: 0; border-radius: 6px;
  background: rgba(0, 0, 0, .45); color: #fff; cursor: pointer; z-index: 9999;
}
#sg-fs-btn:hover { background: rgba(0, 0, 0, .7); }

/* ---------- modals ---------- */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: none; align-items: center; justify-content: center;
  background: rgba(4, 12, 18, 0.62); backdrop-filter: blur(3px);
  padding: 16px;
}
.modal.open { display: flex; }
.sheet {
  width: min(680px, 96vw); max-height: 88vh; overflow: hidden;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #15303d, #0e2330);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.sheet.narrow { width: min(440px, 96vw); }
.sheethead {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sheethead h2 { margin: 0; font-family: "Pacifico", cursive; font-weight: 400; font-size: 24px; color: var(--warm); }
.x {
  background: rgba(255, 255, 255, 0.08); border: 0; color: #fff;
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 15px;
}
.x:hover { background: rgba(255, 255, 255, 0.18); }
.sheetbody { padding: 16px 18px; overflow-y: auto; }
.sheetbody h3 { margin: 14px 0 8px; font-size: 16px; }
.lockmsg { margin: 0 0 8px; font-size: 13px; opacity: 0.7; font-style: italic; }

/* ---------- fishdex grid ---------- */
.dexgrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
}
.dexcell {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px; padding: 8px 6px; text-align: center;
}
.dexcell.seen { background: rgba(255, 255, 255, 0.08); }
.dexcell canvas { width: 96px; height: 60px; }
.dexname { font-weight: 700; font-size: 13px; margin-top: 2px; }
.dexmeta { font-size: 11px; font-weight: 600; margin-top: 2px; }

/* ---------- map ---------- */
.mapcard {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; text-align: left; cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px; padding: 14px 16px; margin-bottom: 10px;
  font-family: "Quicksand", sans-serif; color: #eaf6ff;
  transition: background 0.15s, transform 0.1s;
}
.mapcard:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); }
.mapcard:active:not(:disabled) { transform: scale(0.99); }
.mapcard.current { background: rgba(255, 206, 138, 0.14); }
.mapcard.locked { opacity: 0.55; cursor: not-allowed; }
.mapname { font-family: "Pacifico", cursive; font-size: 19px; }
.mapsub { font-size: 12px; font-weight: 600; opacity: 0.85; }

/* ---------- tutorial ---------- */
.tut { font-size: 14px; opacity: 0.85; margin: 0 0 12px; }
.steps { margin: 0 0 16px; padding-left: 20px; line-height: 1.55; font-size: 14px; }
.steps li { margin-bottom: 8px; }
.steps b { color: var(--warm); }
.bigbtn {
  width: 100%; padding: 13px; border: 0; border-radius: 12px; cursor: pointer;
  background: linear-gradient(180deg, #ffd479, #f0a83c);
  color: #2b1d0c; font-family: "Quicksand", sans-serif; font-weight: 800; font-size: 16px;
  transition: transform 0.1s, filter 0.15s;
}
.bigbtn:hover { filter: brightness(1.05); }
.bigbtn:active { transform: scale(0.98); }

@media (max-width: 480px) {
  #locName { font-size: 16px; }
  .tbtn { padding: 6px 8px; font-size: 12px; }
  .dexgrid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}
