/* Balıkçı — Şirin Pastel arayüz
   Tüm ölçüler oyunun 180x320 mantıksal pikseline göre: calc(var(--px) * N) */

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

html, body {
  margin: 0; padding: 0; overflow: hidden;
  height: 100vh; height: 100dvh;
  background: #1c2438;
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Courier New", monospace;
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}

/* 100vh masaüstünde ve çoğu tarayıcıda görünür alanla eşleşir; ancak mobilde
   adres çubuğu görünüp kaybolduğunda yanlış (çok büyük) ölçülür ve içerik
   üstten/alttan browser çerçevesinin arkasında kesilir. 100dvh ("dynamic
   viewport height") gerçek görünür alanı takip eder — destekleyen tarayıcılarda
   ikinci bildirim öncekini geçersiz kılar, desteklemeyende geçersiz sayılıp
   yok sayılır ve 100vh olduğu gibi kalır. */
#app {
  position: fixed; top: 0; left: 0;
  width: 100vw; width: 100dvw;
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  background: #1c2438;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  --chrome-h: 34px;
}

/* ---------- üst şerit: imza + dil seçici (piksel ızgarasının dışında, sabit boyut) ---------- */
#topchrome {
  flex: 0 0 var(--chrome-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 10px;
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Courier New", monospace;
}
#credit {
  display: flex; align-items: center; gap: 6px;
  text-decoration: none; color: #cbd3e6; opacity: .82;
}
#credit:active { opacity: 1; }
#credit img { width: 18px; height: 18px; border-radius: 50%; display: block; image-rendering: pixelated; }
#credit span { font-size: 11px; font-weight: 700; letter-spacing: .01em; }

.langsw { display: flex; border-radius: 6px; overflow: hidden; border: 1px solid #384467; }
.langsw button {
  background: #232c47; color: #8b96b8; border: 0; cursor: pointer;
  font: 700 10px/1 inherit; padding: 5px 8px; letter-spacing: .04em;
}
.langsw button.on { background: #f4978e; color: #4a2c27; }

#stageWrap {
  flex: 1 1 auto; min-height: 0;
  display: flex; align-items: center; justify-content: center;
}

#stage {
  position: relative;
  width: min(100vw, calc((100vh - var(--chrome-h)) * 0.5625));
  height: min(calc(100vw * 1.77778), calc(100vh - var(--chrome-h)));
  --px: 2px;
  box-shadow: 0 0 0 calc(var(--px) * 1) #0f1526, 0 calc(var(--px) * 4) calc(var(--px) * 14) rgba(0,0,0,.45);
  overflow: hidden;
}

#game {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

#ui { position: absolute; inset: 0; }
.screen { position: absolute; inset: 0; }
.hidden { display: none !important; }

/* ---------- ortak parçalar ---------- */
.chip {
  background: #fff4e6; color: #7a5a52;
  border: calc(var(--px) * 2) solid #e6c9b4;
  border-radius: calc(var(--px) * 7);
  padding: calc(var(--px) * 2.5) calc(var(--px) * 4);
  font: 700 calc(var(--px) * 7.5)/1 inherit;
  letter-spacing: .02em; white-space: nowrap;
  font-family: inherit;
}
button.chip { cursor: pointer; }
button.chip:active { transform: translateY(calc(var(--px) * 1)); background: #ffe8d1; }
.chip.ico { padding: calc(var(--px) * 2.5) calc(var(--px) * 3); }
.chip.btn { flex: 1; text-align: center; }
.chip.wide { flex: 0 0 auto; }

.topbar {
  position: absolute; top: calc(var(--px) * 5); left: calc(var(--px) * 5); right: calc(var(--px) * 5);
  display: flex; gap: calc(var(--px) * 3); justify-content: space-between; align-items: center;
}

.botbar {
  position: absolute; left: calc(var(--px) * 5); right: calc(var(--px) * 5); bottom: calc(var(--px) * 5);
  display: flex; flex-direction: column; gap: calc(var(--px) * 3);
}
.botbar .row { display: flex; gap: calc(var(--px) * 3); }

.cta {
  background: #f4978e; color: #5a3a34;
  border: calc(var(--px) * 2) solid #d9736a;
  border-radius: calc(var(--px) * 7);
  padding: calc(var(--px) * 6) calc(var(--px) * 4);
  font: 700 calc(var(--px) * 11)/1 inherit;
  letter-spacing: .08em; cursor: pointer; width: 100%;
  font-family: inherit;
  box-shadow: 0 calc(var(--px) * 2) 0 #c9645c;
}
.cta:active { transform: translateY(calc(var(--px) * 2)); box-shadow: none; }
.cta.busy { background: #e6c9b4; border-color: #cbab93; color: #8a7466; box-shadow: none; }

.hintline {
  position: absolute; left: calc(var(--px) * 34); bottom: calc(var(--px) * 56);
  color: #fff8ef; font: 700 calc(var(--px) * 7)/1 inherit;
  text-shadow: 0 calc(var(--px) * 1) 0 rgba(40,60,80,.55);
  pointer-events: none;
}

/* ---------- derinlik seçici ---------- */
.depth {
  position: absolute; left: calc(var(--px) * 4); top: calc(var(--px) * 120);
  width: calc(var(--px) * 26);
  display: flex; flex-direction: column; gap: calc(var(--px) * 2.5);
}
.dbtn {
  background: rgba(255,244,230,.72); color: #6f5348;
  border: calc(var(--px) * 2) solid rgba(230,201,180,.85);
  border-radius: calc(var(--px) * 6);
  padding: calc(var(--px) * 3) 0;
  font: 700 calc(var(--px) * 9)/1 inherit; text-align: center; cursor: pointer;
  font-family: inherit;
}
.dbtn small { display: block; font-size: calc(var(--px) * 4.6); margin-top: calc(var(--px) * 1.5); letter-spacing: 0; }
.dbtn.on { background: #f4978e; border-color: #d9736a; color: #fff6f2; }
.dbtn.lock { opacity: .48; }

/* ---------- basılı tut alanı ---------- */
.holdpad {
  position: absolute; left: calc(var(--px) * 5); right: calc(var(--px) * 5); bottom: calc(var(--px) * 5);
  height: calc(var(--px) * 40);
  background: rgba(255,244,230,.88);
  border: calc(var(--px) * 2) solid #e6c9b4;
  border-radius: calc(var(--px) * 7);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: calc(var(--px) * 2); color: #7a5a52; text-align: center;
}
.holdtxt { font: 700 calc(var(--px) * 10)/1 inherit; letter-spacing: .08em; }
.holdsub { font: 700 calc(var(--px) * 5.5)/1.3 inherit; color: #a08376; padding: 0 calc(var(--px) * 4); }
.holdpad.down { background: #ffd9c9; border-color: #f4978e; }

/* ---------- dükkan ---------- */
.shopwrap {
  position: absolute; left: calc(var(--px) * 5); right: calc(var(--px) * 5);
  top: calc(var(--px) * 140); bottom: calc(var(--px) * 5);
  background: #fff4e6;
  border: calc(var(--px) * 2) solid #e6c9b4;
  border-radius: calc(var(--px) * 8);
  display: flex; flex-direction: column; overflow: hidden;
}
.tabs { display: flex; gap: calc(var(--px) * 1); padding: calc(var(--px) * 3); border-bottom: calc(var(--px) * 2) solid #efd9c4; }
.tab {
  flex: 1; background: #ffe8d1; color: #9b7d6e; border: 0;
  border-radius: calc(var(--px) * 5);
  padding: calc(var(--px) * 3.5) 0;
  font: 700 calc(var(--px) * 6)/1 inherit; cursor: pointer; font-family: inherit;
}
.tab.on { background: #f4978e; color: #fff6f2; }

.list { flex: 1; overflow-y: auto; padding: calc(var(--px) * 3); display: flex; flex-direction: column; gap: calc(var(--px) * 3); }
.list::-webkit-scrollbar { width: calc(var(--px) * 3); }
.list::-webkit-scrollbar-thumb { background: #e6c9b4; border-radius: calc(var(--px) * 3); }

.item {
  display: flex; align-items: center; gap: calc(var(--px) * 3);
  background: #fffaf2; border: calc(var(--px) * 1.5) solid #f0dcc8;
  border-radius: calc(var(--px) * 6); padding: calc(var(--px) * 3);
}
.item .ic { width: calc(var(--px) * 22); height: calc(var(--px) * 18); flex: 0 0 auto; image-rendering: pixelated; }
.item .tx { flex: 1; min-width: 0; }
.item .nm { font: 700 calc(var(--px) * 7)/1.15 inherit; color: #6f5348; }
.item .ds { font: 700 calc(var(--px) * 5.4)/1.3 inherit; color: #a5897a; margin-top: calc(var(--px) * 1.5); }
.item .ds b { color: #d9736a; }
.act {
  background: #8fd9c0; color: #2f5f52; border: calc(var(--px) * 1.5) solid #6fc0a6;
  border-radius: calc(var(--px) * 5); padding: calc(var(--px) * 3) calc(var(--px) * 3.5);
  font: 700 calc(var(--px) * 6.2)/1 inherit; cursor: pointer; white-space: nowrap; font-family: inherit;
}
.act.buy { background: #ffd166; border-color: #e8b23f; color: #6b4f1e; }
.act.off { background: #ece2d6; border-color: #ddcdbd; color: #a08c7c; }
.act.on { background: #f4978e; border-color: #d9736a; color: #fff6f2; }
.act:active { transform: translateY(calc(var(--px) * 1)); }

.shopfoot { padding: calc(var(--px) * 3); border-top: calc(var(--px) * 2) solid #efd9c4; display: flex; gap: calc(var(--px) * 3); }
.shopfoot .cta { font-size: calc(var(--px) * 8); padding: calc(var(--px) * 4); }
.empty { text-align: center; color: #a5897a; font: 700 calc(var(--px) * 6.5)/1.5 inherit; padding: calc(var(--px) * 10) calc(var(--px) * 4); }

/* ---------- modal ---------- */
.modal {
  position: absolute; inset: 0; background: rgba(28,36,56,.55);
  display: flex; align-items: center; justify-content: center; padding: calc(var(--px) * 10);
}
.card {
  background: #fff4e6; border: calc(var(--px) * 2) solid #e6c9b4;
  border-radius: calc(var(--px) * 9); padding: calc(var(--px) * 6);
  width: 100%; text-align: center; color: #6f5348;
  box-shadow: 0 calc(var(--px) * 4) 0 rgba(0,0,0,.18);
}
.card h3 { margin: 0 0 calc(var(--px) * 3); font: 700 calc(var(--px) * 10)/1.2 inherit; }
.card .sub { font: 700 calc(var(--px) * 6.2)/1.4 inherit; color: #a5897a; }
.card .big { font: 700 calc(var(--px) * 13)/1 inherit; color: #d9736a; margin: calc(var(--px) * 3) 0; }
.card canvas { width: calc(var(--px) * 60); height: calc(var(--px) * 34); image-rendering: pixelated; margin: calc(var(--px) * 2) 0; }
.card .tagrow { display: flex; gap: calc(var(--px) * 2); justify-content: center; flex-wrap: wrap; margin-top: calc(var(--px) * 2); }
.tag { border-radius: calc(var(--px) * 5); padding: calc(var(--px) * 2) calc(var(--px) * 3.5); font: 700 calc(var(--px) * 5.6)/1 inherit; color: #fff; }

/* ---------- toast ---------- */
.toast {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--px) * 62);
  background: rgba(58,42,38,.9); color: #ffeedd;
  border-radius: calc(var(--px) * 6);
  padding: calc(var(--px) * 3.5) calc(var(--px) * 6);
  font: 700 calc(var(--px) * 6.5)/1.3 inherit;
  max-width: 82%; text-align: center; pointer-events: none;
}
