/* Lakeside UI — floats over the full-screen canvas.
   The overlay ignores pointer events except on its own controls, so
   drags on empty space still orbit the camera. */

:root {
  --ink: #fdfaf2;
  --dim: #cfe0e6;
  --panel: rgba(18, 52, 66, 0.78);
  --panel-solid: #15394a;
  --edge: rgba(255, 255, 255, 0.14);
  --gold: #ffd447;
  --leaf: #7fcf5a;
  --leaf-dark: #3f8f3a;
  --bad: #ff7a66;
  --r: 14px;
  --shadow: 0 8px 24px rgba(0, 20, 30, 0.35);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2c6f8f; }
body {
  font-family: ui-rounded, 'Nunito', 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#ui { position: fixed; inset: 0; pointer-events: none; }
/* Undo a phone's "Desktop site" shrink (set by src/viewport.js; 1 normally). */
#ui, body > .fakead { zoom: var(--page-zoom, 1); }
#ui button, .sheet, .modal, .pouch, .hud { pointer-events: auto; }

/* ---------- HUD ---------- */
.hud {
  position: absolute;
  top: calc(10px + var(--safe-t));
  left: 10px; right: 10px;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--r);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  max-width: 560px;
}
.hud__coins { display: flex; align-items: center; gap: 7px; font-size: 22px; font-variant-numeric: tabular-nums; color: var(--gold); min-width: 84px; }
.coin { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff2a8, var(--gold) 55%, #c08a10); box-shadow: 0 0 0 2px rgba(0,0,0,.15); }
.hud__level { flex: 1; min-width: 0; }
.hud__row { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; }
.dim { color: var(--dim); font-weight: 500; }
.xpbar { height: 8px; margin-top: 4px; border-radius: 99px; background: rgba(255,255,255,.14); overflow: hidden; }
.xpbar__fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--leaf-dark), var(--leaf)); transition: width .25s ease-out; }
.hud__boosts { display: flex; gap: 6px; }
.chip { font-size: 12px; padding: 3px 8px; border-radius: 99px; background: rgba(255, 212, 71, .2); border: 1px solid rgba(255, 212, 71, .5); white-space: nowrap; }

/* ---------- toasts ---------- */
.toasts {
  position: absolute;
  top: calc(72px + var(--safe-t));
  left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: min(92vw, 420px);
}
.toast {
  padding: 8px 14px; border-radius: 99px;
  font-size: 14px; font-weight: 700;
  background: var(--panel); border: 1px solid var(--edge);
  box-shadow: var(--shadow);
  animation: pop .22s ease-out;
  transition: opacity .35s, transform .35s;
}
.toast--good { color: #e2ffc9; border-color: rgba(127, 207, 90, .6); }
.toast--bad { color: #ffd9d2; border-color: rgba(255, 122, 102, .6); }
.toast--level { color: #2a1d00; background: var(--gold); }
.toast--out { opacity: 0; transform: translateY(-6px); }
@keyframes pop { from { opacity: 0; transform: scale(.85); } }

/* ---------- bottom dock ---------- */
.dock {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(10px + var(--safe-b));
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 0 10px;
}
.pouch {
  display: flex; gap: 6px;
  max-width: min(100%, 640px);
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
}
.pouch::-webkit-scrollbar { display: none; }
.pouch__empty { font-size: 13px; padding: 7px 12px; border-radius: 99px; background: var(--panel); }
.seed {
  display: flex; align-items: center; gap: 6px; flex: none;
  padding: 7px 11px;
  font: inherit; font-size: 13px; font-weight: 700; color: var(--ink);
  background: var(--panel); border: 2px solid transparent; border-radius: 99px;
  cursor: pointer;
}
.seed b { color: var(--dim); font-weight: 600; }
.seed--on { border-color: var(--gold); background: rgba(70, 60, 10, .75); }
.dot { width: 13px; height: 13px; border-radius: 50%; flex: none; box-shadow: inset 0 -2px 3px rgba(0,0,0,.3); }
.dock__row { display: flex; align-items: center; gap: 14px; }

.btn {
  font: inherit; font-weight: 800; color: var(--ink);
  border: 1px solid var(--edge); border-radius: 12px;
  background: rgba(255,255,255,.1);
  padding: 9px 14px; cursor: pointer;
  transition: transform .08s, background .15s, opacity .15s;
}
.btn:active:not(:disabled) { transform: scale(.95); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn--round { width: 54px; height: 54px; border-radius: 50%; font-size: 24px; padding: 0; background: var(--panel); box-shadow: var(--shadow); }
.views { position: absolute; top: 42%; right: 10px; transform: translateY(-50%); display: flex; flex-direction: column; gap: 8px; }
.btn--view { width: 42px; height: 42px; font-size: 20px; }
.btn--fish {
  min-width: 160px; height: 64px; border-radius: 32px;
  font-size: 22px; letter-spacing: .02em;
  background: linear-gradient(180deg, #4fb0d6, #2b7fa3);
  border: 2px solid rgba(255,255,255,.4);
  box-shadow: var(--shadow);
}
.btn--waiting { background: linear-gradient(180deg, #3b7d96, #285e73); color: var(--dim); }
.btn--bite { background: linear-gradient(180deg, #ffd447, #f08a24); color: #3a1d00; animation: shake .25s infinite; }
@keyframes shake { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-3deg) scale(1.06); } 75% { transform: rotate(3deg) scale(1.06); } }
.btn--buy { min-width: 54px; background: var(--leaf-dark); border-color: transparent; font-variant-numeric: tabular-nums; }
.btn--ghost { background: transparent; }
.btn--wide { display: block; width: 100%; margin-top: 10px; padding: 13px; font-size: 16px; background: var(--leaf-dark); }
.btn--wide.btn--ghost { background: transparent; }

/* ---------- shop sheet ---------- */
.sheet {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(5, 20, 28, .35);
}
.sheet[hidden], .modal[hidden] { display: none; }
.sheet__card {
  width: min(100%, 520px);
  max-height: 72vh;
  display: flex; flex-direction: column;
  background: var(--panel-solid);
  border: 1px solid var(--edge);
  border-radius: 20px 20px 0 0;
  padding: 12px 12px calc(12px + var(--safe-b));
  box-shadow: var(--shadow);
  animation: slideup .22s ease-out;
}
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } }
.sheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tabs { display: flex; gap: 4px; padding: 3px; background: rgba(0,0,0,.25); border-radius: 12px; }
.tab { font: inherit; font-weight: 700; font-size: 14px; color: var(--dim); background: none; border: 0; padding: 7px 12px; border-radius: 9px; cursor: pointer; }
.tab--on { background: rgba(255,255,255,.14); color: var(--ink); }
.sheet__body { overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-bottom: 4px; }
.account { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 10px; padding: 10px; border-radius: 12px; background: rgba(79, 159, 184, .18); border: 1px solid rgba(79, 159, 184, .35); }
.account__save { margin-top: 0; background: linear-gradient(180deg, #4fb0d6, #2b7fa3); }
.account__hint, .account__note { font-size: 13px; color: var(--dim); }
.account__note { flex: 1; color: var(--ink); }
.account__btn { font-size: 13px; padding: 6px 10px; }
.modal__card .btn--wide small { display: block; font-weight: 500; opacity: .8; font-size: 12px; margin-top: 2px; }
.row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.06); }
.row--locked { opacity: .55; }
.row--done { opacity: .7; background: rgba(255, 212, 71, .08); }
.note--looks { margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.12); color: var(--ink); }
.row__body .xpbar { margin-top: 5px; height: 6px; }
@media (max-width: 420px) { .tab { padding: 7px 8px; font-size: 13px; } }
.row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row__body small { color: var(--dim); font-size: 12px; }
.have { color: var(--gold); font-size: 12px; font-weight: 800; }
.lock { font-size: 12px; color: var(--dim); white-space: nowrap; }
.icon { font-size: 22px; width: 26px; text-align: center; }
.note { margin: 0 4px 6px; color: var(--dim); font-size: 13px; }

/* ---------- modal & fake ad ---------- */
.modal, .fakead {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background: rgba(5, 20, 28, .55);
  backdrop-filter: blur(3px);
  pointer-events: auto;
  z-index: 10;
}
.modal__card, .fakead__card {
  width: min(88vw, 380px);
  padding: 20px;
  background: var(--panel-solid);
  border: 1px solid var(--edge);
  border-radius: 18px;
  box-shadow: var(--shadow);
  text-align: center;
  color: var(--ink);
  font-family: inherit;
}
.modal__card h2 { margin: 0 0 8px; font-size: 22px; }
.modal__card p { margin: 6px 0; }
.fakead__tag { font-size: 11px; letter-spacing: .12em; color: var(--gold); font-weight: 800; }
.fakead__bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.15); overflow: hidden; margin: 14px 0 4px; }
.fakead__fill { width: 0; height: 100%; background: var(--gold); }
.fakead .btn { font-family: inherit; }

@media (max-width: 420px) {
  .hud { gap: 8px; padding: 7px 10px; }
  .hud__coins { font-size: 19px; min-width: 70px; }
  .hud__boosts { position: absolute; top: calc(100% + 6px); left: 0; }
  .btn--fish { min-width: 140px; height: 58px; font-size: 20px; }
}
