/* =========================================================
   Рыбалка — стили
   Мобильные (iPhone/Android) + планшет + десктоп
   ========================================================= */

:root {
  --sky-1: #38bdf8;
  --sky-2: #a5f3fc;
  --water-1: #0ea5e9;
  --water-2: #0369a1;
  --card: rgba(255, 255, 255, 0.92);
  --text: #0f2a44;
  --muted: #5b7089;
  --green: #22c55e;
  --green-dark: #15803d;
  --orange: #fb923c;
  --orange-dark: #c2410c;
  --blue: #3b82f6;
  --blue-dark: #1d4ed8;
  --purple: #a855f7;
  --purple-dark: #7e22ce;
  --red: #ef4444;
  --gold: #fbbf24;
  --radius: 22px;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0b4a7a;
  color: var(--text);
  font-family: var(--font);
  /* Запрет выделения текста, лупы и «долгого тапа» на iOS */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  /* Убирает двойной тап-зум */
  touch-action: manipulation;
  overscroll-behavior: none;
}

button {
  font-family: inherit;
  color: inherit;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.hidden { display: none !important; }

/* ---------------- Экраны ---------------- */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  padding: calc(10px + var(--safe-top)) calc(14px + var(--safe-right)) calc(10px + var(--safe-bottom)) calc(14px + var(--safe-left));
}
.screen.active { display: flex; animation: fadeIn .25s ease; }

@keyframes fadeIn { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }

.screen-bg {
  background:
    radial-gradient(circle at 85% 8%, rgba(255, 245, 157, .9) 0 42px, rgba(255, 245, 157, 0) 90px),
    linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 38%, var(--water-1) 38.2%, var(--water-2) 100%);
  overflow: hidden;
}
/* Пузырьки на фоне меню */
.screen-bg::before, .screen-bg::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -40px;
  height: 60%;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.35) 0 5px, transparent 6px),
    radial-gradient(circle, rgba(255,255,255,.25) 0 3px, transparent 4px);
  background-size: 120px 140px, 70px 90px;
  background-position: 10px 0, 40px 30px;
  animation: bubbles 9s linear infinite;
  pointer-events: none;
  z-index: 0;
}
.screen-bg::after { animation-duration: 14s; opacity: .6; background-position: 70px 40px, 0 0; }
@keyframes bubbles { from { transform: translateY(0); } to { transform: translateY(-140px); } }

.screen-bg > * { position: relative; z-index: 1; }

/* ---------------- Верхняя панель ---------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  flex-shrink: 0;
}
.top-actions { display: flex; gap: 8px; }
.screen-title {
  margin: 0;
  font-size: clamp(20px, 5vw, 28px);
  color: #fff;
  text-shadow: 0 2px 0 rgba(0,0,0,.18);
  flex: 1;
  text-align: center;
  white-space: nowrap;
}

.icon-btn {
  width: 48px; height: 48px;
  border-radius: 16px;
  background: rgba(255,255,255,.9);
  font-size: 24px;
  font-family: var(--emoji), var(--font);
  box-shadow: 0 4px 0 rgba(0,0,0,.15);
  display: grid; place-items: center;
  transition: transform .1s;
  flex-shrink: 0;
}
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.15); }
.icon-btn.off { opacity: .45; filter: grayscale(1); }

.coins-pill {
  background: linear-gradient(180deg, #fff7d1, #fde68a);
  border: 3px solid #f59e0b;
  color: #7c4a03;
  font-weight: 900;
  font-size: 20px;
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(0,0,0,.15);
  white-space: nowrap;
  transition: transform .2s;
}
.coins-pill.bump { animation: bump .5s ease; }
@keyframes bump { 0%{transform:scale(1)} 30%{transform:scale(1.3)} 100%{transform:scale(1)} }

/* ---------------- Главное меню ---------------- */
.menu-content {
  flex: 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  overflow-x: hidden;   /* «дышащая» кнопка не должна вызывать полосу прокрутки (на Windows меню прыгало) */
  overflow-y: auto;
  padding: 8px 10px 16px;
}

.logo { text-align: center; color: #fff; }
.logo-emoji {
  font-size: clamp(64px, 18vw, 96px);
  font-family: var(--emoji);
  line-height: 1;
  animation: wobble 2.4s ease-in-out infinite;
  display: inline-block;
  filter: drop-shadow(0 6px 0 rgba(0,0,0,.15));
}
@keyframes wobble { 0%,100%{transform:rotate(-8deg)} 50%{transform:rotate(8deg) translateY(-6px)} }
.logo h1 {
  margin: 4px 0 0;
  font-size: clamp(40px, 12vw, 64px);
  font-weight: 900;
  letter-spacing: 1px;
  background: linear-gradient(180deg, #fff 30%, #fef08a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 0 #0369a1);
}
.subtitle { margin: 4px 0 0; font-weight: 800; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.2); }

.setup { display: grid; gap: 10px; }
.setup-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  background: var(--card);
  border-radius: 18px;
  box-shadow: 0 5px 0 rgba(3, 60, 110, .25);
  text-align: left;
  transition: transform .1s;
}
.setup-card:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(3,60,110,.25); }
.setup-emoji {
  font-size: 34px;
  font-family: var(--emoji);
  width: 52px; height: 52px;
  display: grid; place-items: center;
  background: linear-gradient(180deg, #e0f2fe, #bae6fd);
  border-radius: 14px;
  flex-shrink: 0;
}
.setup-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.setup-text small { color: var(--muted); font-weight: 700; font-size: 13px; }
.setup-text b { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { font-size: 32px; color: #94a3b8; font-weight: 900; }

/* ---------------- Кнопки ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0,0,0,.2);
  background: linear-gradient(180deg, #60a5fa, var(--blue));
  box-shadow: 0 6px 0 var(--blue-dark), 0 10px 18px rgba(0,0,0,.15);
  transition: transform .1s, box-shadow .1s, filter .2s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--blue-dark); }
.btn:disabled { filter: grayscale(.9) opacity(.6); cursor: not-allowed; }
.btn-big { font-size: clamp(24px, 7vw, 32px); padding: 18px; }
.btn-go {
  background: linear-gradient(180deg, #4ade80, var(--green));
  box-shadow: 0 7px 0 var(--green-dark), 0 12px 22px rgba(0,0,0,.18);
  animation: pulse 1.8s ease-in-out infinite;
}
.btn-go:active { box-shadow: 0 2px 0 var(--green-dark); }
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.03)} }
.btn-shop { background: linear-gradient(180deg, #fdba74, var(--orange)); box-shadow: 0 6px 0 var(--orange-dark); }
.btn-shop:active { box-shadow: 0 2px 0 var(--orange-dark); }
.btn-album { background: linear-gradient(180deg, #d8b4fe, var(--purple)); box-shadow: 0 6px 0 var(--purple-dark); }
.btn-album:active { box-shadow: 0 2px 0 var(--purple-dark); }
.btn-install { background: linear-gradient(180deg, #5eead4, #14b8a6); box-shadow: 0 6px 0 #0f766e; }
.btn-danger { background: linear-gradient(180deg, #fca5a5, var(--red)); box-shadow: 0 5px 0 #b91c1c; }
.btn-small { font-size: 16px; padding: 10px 14px; }
.btn-green { background: linear-gradient(180deg, #4ade80, var(--green)); box-shadow: 0 5px 0 var(--green-dark); }
.btn-gold { background: linear-gradient(180deg, #fde68a, #f59e0b); box-shadow: 0 5px 0 #b45309; color: #fff; }
.btn-gray { background: linear-gradient(180deg, #cbd5e1, #94a3b8); box-shadow: 0 5px 0 #64748b; }

.menu-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.ios-tip {
  margin: 0;
  background: rgba(255,255,255,.9);
  border-radius: 16px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 15px;
  text-align: center;
}
.stats-line { margin: 0; text-align: center; color: #e0f2fe; font-weight: 800; font-size: 15px; }

/* ---------------- Списки (магазин / выбор) ---------------- */
.list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 760px;
  margin: 8px auto 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 6px 24px;
  touch-action: pan-y;
  overflow-x: hidden;
}

.item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: 0 5px 0 rgba(3, 60, 110, .22);
  border: 3px solid transparent;
}
.item.selected { border-color: var(--green); background: #f0fdf4; }
.item.locked { opacity: .92; }
.item-emoji {
  font-size: 40px;
  font-family: var(--emoji);
  width: 64px; height: 64px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 18px;
  background: linear-gradient(180deg, #e0f2fe, #bae6fd);
}
.item-body { flex: 1; min-width: 0; }
.item-title { font-size: 19px; font-weight: 900; margin: 0; }
.item-desc { margin: 2px 0 0; font-size: 14px; color: var(--muted); font-weight: 600; }
.item-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; flex-shrink: 0; }
.item-actions .btn { font-size: 16px; padding: 10px 12px; border-radius: 16px; white-space: nowrap; }
.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  margin-left: 4px;
  vertical-align: middle;
}
.tag.green { background: #dcfce7; color: #15803d; }

.stats { display: grid; gap: 3px; margin-top: 6px; }
.stat { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; font-weight: 800; color: var(--muted); }
.stat-bar { height: 8px; border-radius: 99px; background: #e2e8f0; overflow: hidden; }
.stat-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #34d399, #3b82f6); }

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 760px;
  margin: 6px auto 0;
  flex-shrink: 0;
}
.tab {
  padding: 10px 6px;
  border-radius: 16px;
  font-weight: 900;
  font-size: 16px;
  background: rgba(255,255,255,.55);
  color: #0c4a6e;
  box-shadow: 0 4px 0 rgba(0,0,0,.12);
}
.tab.active { background: #fff; color: var(--blue-dark); }

/* ---------------- Альбом ---------------- */
.album-stats {
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-weight: 800;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px 14px;
  box-shadow: 0 5px 0 rgba(3, 60, 110, .22);
}
.album-stats span { color: var(--muted); font-size: 13px; display: block; }
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 12px;
}
.fish-card {
  background: var(--card);
  border-radius: 20px;
  padding: 12px 8px;
  text-align: center;
  box-shadow: 0 5px 0 rgba(3, 60, 110, .22);
  border: 3px solid #e2e8f0;
  position: relative;
}
.fish-card.r-rare { border-color: #93c5fd; }
.fish-card.r-legendary { border-color: var(--gold); background: linear-gradient(180deg, #fffbeb, #fff); }
.fish-card.unknown { opacity: .7; }
.fish-card .fe { font-size: 46px; font-family: var(--emoji); line-height: 1.2; display: block; width: 100%; max-width: 150px; margin: 0 auto; min-height: 56px; }
.fish-art { display: block; width: 100%; height: auto; overflow: visible; }
.fish-card .fn { font-weight: 900; font-size: 16px; }
.fish-card .fi { font-size: 12px; color: var(--muted); font-weight: 700; }
.fish-card .fhint { font-size: 12px; line-height: 1.35; color: var(--muted); font-weight: 700; margin-top: 4px; }
.fish-card .fhint b { color: #334155; font-family: var(--emoji), inherit; white-space: nowrap; }
.fish-card .crown { position: absolute; top: 4px; right: 8px; font-size: 18px; font-family: var(--emoji); }

.rarity {
  display: inline-block;
  font-size: 12px;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 999px;
  color: #fff;
  margin: 4px 0;
}
.rarity.r-common { background: #64748b; }
.rarity.r-rare { background: linear-gradient(90deg, #3b82f6, #6366f1); }
.rarity.r-legendary { background: linear-gradient(90deg, #f59e0b, #ef4444, #a855f7); }

/* ---------------- Экран рыбалки ---------------- */
#screen-fish { padding: 0; background: #0b4a7a; }
#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none; /* полностью свои жесты на холсте */
}

.hud-top {
  position: absolute;
  top: calc(8px + var(--safe-top));
  left: calc(10px + var(--safe-left));
  right: calc(10px + var(--safe-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}
.hud-top > * { pointer-events: auto; }
.hud-chip {
  background: rgba(255,255,255,.88);
  border-radius: 999px;
  padding: 7px 14px;
  font-weight: 900;
  font-size: 17px;
  box-shadow: 0 4px 0 rgba(0,0,0,.15);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none !important;
}

.hud-message {
  position: absolute;
  left: 50%;
  top: calc(70px + var(--safe-top));
  transform: translateX(-50%);
  max-width: min(92vw, 560px);
  text-align: center;
  background: rgba(255,255,255,.9);
  padding: 10px 18px;
  border-radius: 18px;
  font-weight: 900;
  font-size: clamp(16px, 4.4vw, 22px);
  box-shadow: 0 5px 0 rgba(0,0,0,.15);
  pointer-events: none;
  transition: background .2s, color .2s;
}
.hud-message.alert {
  background: linear-gradient(180deg, #fde047, #f97316);
  color: #fff;
  text-shadow: 0 2px 0 rgba(0,0,0,.25);
  animation: shake .3s ease-in-out infinite;
}
.hud-message.bad { background: #fee2e2; color: #b91c1c; }
.hud-message.good { background: #dcfce7; color: #15803d; }
@keyframes shake { 0%,100%{transform:translateX(-50%) rotate(0)} 25%{transform:translateX(-50%) rotate(-2deg)} 75%{transform:translateX(-50%) rotate(2deg)} }

/* Мини-игра вытягивания: узкая вертикальная панель у правого края */
.reel-ui {
  position: absolute;
  right: calc(8px + var(--safe-right));
  top: 50%;
  transform: translateY(-62%);
  display: flex;
  gap: 6px;
  padding: 8px 7px;
  background: rgba(255,255,255,.72);
  border-radius: 18px;
  box-shadow: 0 4px 0 rgba(0,0,0,.15);
  pointer-events: none;
  --bar-h: min(36vh, 240px);
}
.reel-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.reel-ico { font-size: 22px; line-height: 1; font-family: var(--emoji); height: 24px; }
.reel-ico.small { font-size: 15px; height: 18px; display: grid; place-items: center; }

.tension {
  position: relative;
  width: 22px;
  height: var(--bar-h);
  border-radius: 999px;
  background: linear-gradient(0deg, #bfdbfe, #fde68a);
  overflow: hidden;
  box-shadow: inset 0 2px 0 rgba(0,0,0,.08);
}
.t-danger {
  position: absolute; left: 0; right: 0; top: 0;
  height: 12%;
  background: repeating-linear-gradient(45deg, #ef4444 0 6px, #dc2626 6px 12px);
}
.t-zone {
  position: absolute; left: 0; right: 0;
  background: linear-gradient(90deg, #4ade80, #16a34a);
  border-top: 2px solid #15803d;
  border-bottom: 2px solid #15803d;
}
.t-marker {
  position: absolute; left: -2px; right: -2px;
  height: 6px;
  margin-bottom: -3px;
  border-radius: 4px;
  background: #0f172a;
  box-shadow: 0 0 0 2px #fff;
}
.tension.danger { animation: dangerBlink .25s steps(2) infinite; }
@keyframes dangerBlink { 50% { box-shadow: 0 0 0 3px #ef4444; } }

.progress {
  position: relative;
  width: 14px;
  height: var(--bar-h);
  border-radius: 999px;
  background: linear-gradient(180deg, #1e3a8a, #0ea5e9);
}
.progress-fill {
  position: absolute; left: 0; right: 0; top: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #38bdf8, #a7f3d0);
}
.progress-fish {
  position: absolute; left: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  width: 40px;
}

/* Кнопка снастей в верхней панели */
#btn-gear { pointer-events: auto !important; cursor: pointer; transition: transform .1s; }
#btn-gear:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.15); }
.gear-ico { font-family: var(--emoji); }

/* Окно смены снастей */
.gear-title { text-align: left; font-weight: 900; color: var(--muted); margin: 12px 2px 6px; font-size: 15px; }
.gear-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.gear-opt {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px;
  border-radius: 16px;
  background: #f1f5f9;
  border: 3px solid transparent;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 3px 0 rgba(0,0,0,.1);
}
.gear-opt .ge { font-size: 30px; font-family: var(--emoji); line-height: 1.1; }
.gear-opt.selected { border-color: var(--green); background: #f0fdf4; }
.gear-opt:disabled { opacity: .45; }
.gear-opt small { color: var(--muted); font-weight: 800; }
.gear-cell { display: flex; flex-direction: column; gap: 4px; }
.gear-cell .gear-opt { width: 100%; }
.gear-buy {
  padding: 4px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(180deg, #fde68a, #f59e0b);
  box-shadow: 0 2px 0 #b45309;
}
.gear-buy:disabled { filter: grayscale(1); opacity: .6; }
.gear-note { font-size: 13px; color: var(--muted); font-weight: 700; margin: 10px 0 12px; }

/* Модальное окно улова */
.modal {
  position: absolute;
  inset: 0;
  background: rgba(3, 30, 60, .45);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 10;
  animation: fadeIn .2s ease;
}
.modal-card {
  width: min(92vw, 420px);
  max-height: 90%;
  overflow-y: auto;
  background: #fff;
  border-radius: 28px;
  padding: 18px 18px 20px;
  text-align: center;
  box-shadow: 0 10px 0 rgba(0,0,0,.2);
  animation: popIn .45s cubic-bezier(.2, 1.6, .4, 1);
}
.modal-card.legendary { background: linear-gradient(180deg, #fff7d6, #fff 60%); box-shadow: 0 10px 0 #f59e0b, 0 0 60px rgba(251,191,36,.7); }
.modal-card.rare { background: linear-gradient(180deg, #dbeafe, #fff 60%); }
@keyframes popIn { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-card h3 { margin: 0; font-size: 26px; font-weight: 900; }
.modal-fish {
  width: 230px;
  max-width: 82%;
  margin: 4px auto 0;
  animation: flop 1.2s ease-in-out infinite;
  filter: drop-shadow(0 6px 4px rgba(0,0,0,.15));
}
.modal-fish.lost { filter: grayscale(1) opacity(.5); animation: none; }
.mini-fish-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; align-items: center; }
.mini-fish { width: 46px; display: inline-grid; place-items: center; font-size: 18px; font-family: var(--emoji); }
.item-desc.bites { color: #0369a1; }
.no-bite { color: #dc2626 !important; font-size: 11px; }
.modal-emoji {
  font-size: 110px;
  font-family: var(--emoji);
  line-height: 1.15;
  display: inline-block;
  animation: flop 1.2s ease-in-out infinite;
}
@keyframes flop { 0%,100%{transform:rotate(-10deg)} 50%{transform:rotate(10deg) translateY(-6px)} }
.modal-weight { font-size: 24px; font-weight: 900; margin: 4px 0; }
.modal-coins { font-size: 26px; font-weight: 900; color: #b45309; margin: 6px 0 12px; }
.modal-record {
  display: inline-block;
  background: linear-gradient(90deg, #f472b6, #a855f7);
  color: #fff;
  font-weight: 900;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 8px;
  animation: pulse 1s ease-in-out infinite;
}
.modal-text { font-weight: 700; color: var(--muted); margin: 6px 0 14px; }
.modal-buttons { display: grid; gap: 10px; }

/* Всплывающее сообщение */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  transform: translate(-50%, 150%);
  background: #0f172a;
  color: #fff;
  font-weight: 800;
  padding: 12px 18px;
  border-radius: 16px;
  max-width: 90vw;
  text-align: center;
  z-index: 100;
  transition: transform .3s ease, opacity .3s ease, visibility .3s;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;   /* спрятанная подсказка не выглядывает из-под панели Safari */
}
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

/* ---------------- Адаптив ---------------- */
@media (min-width: 900px) {
  .menu-content { max-width: 560px; }
  .item-emoji { width: 72px; height: 72px; font-size: 46px; }
}

/* Телефон в горизонтальном положении: меньше вертикальных отступов */
@media (orientation: landscape) and (max-height: 520px) {
  .menu-content { justify-content: flex-start; max-width: 760px; display: grid; grid-template-columns: 1fr 1fr; align-content: start; gap: 10px 16px; }
  .logo { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 12px; }
  .logo-emoji { font-size: 48px; }
  .logo h1 { font-size: 40px; margin: 0; }
  .subtitle { display: none; }
  .setup { grid-row: span 3; }
  .btn-big { padding: 12px; font-size: 24px; }
  .hud-message { top: calc(64px + var(--safe-top)); font-size: 16px; }
  .reel-ui { --bar-h: 46vh; transform: translateY(-50%); }
  .modal-emoji { font-size: 70px; }
  .modal-fish { width: 170px !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Рисованные удочки в меню, магазине и окне снастей */
.rod-art { display: block; width: 100%; height: 100%; }
.item-emoji .rod-art { width: 56px; height: 56px; }
.setup-emoji .rod-art { width: 44px; height: 44px; }
.gear-opt .ge .rod-art { width: 42px; height: 42px; margin: 0 auto; }

/* ---------------- Телефон: компактные карточки в магазине и выборе ---------------- */
@media (max-width: 560px) {
  .list { gap: 10px; }
  .item {
    display: grid;
    grid-template-columns: 52px 1fr;
    column-gap: 12px;
    row-gap: 8px;
    align-items: start;
    padding: 10px 12px;
    border-radius: 18px;
  }
  .item-emoji { width: 52px; height: 52px; font-size: 30px; border-radius: 14px; grid-row: span 2; }
  .item-emoji .rod-art { width: 46px; height: 46px; }
  .item-body { grid-column: 2; }
  .item-title { font-size: 17px; line-height: 1.2; }
  .item-desc { font-size: 13px; line-height: 1.3; margin-top: 2px; }
  .item-desc.bites { font-size: 12px; }
  .stats { margin-top: 4px; }
  .stat { grid-template-columns: 88px 1fr; font-size: 11px; }
  .item-actions { grid-column: 2; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .item-actions .btn { flex: 1 1 auto; font-size: 14px; padding: 8px 12px; border-radius: 14px; }
  .mini-fish-row { gap: 2px; }
  .mini-fish { width: 30px; font-size: 13px; }
  .tabs .tab { font-size: 15px; padding: 9px 4px; }
}


/* ---------------- Профиль: вход и регистрация ---------------- */
.auth-card {
  width: 100%;
  max-width: 460px;
  margin: 8px auto 0;
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 18px 20px;
  box-shadow: 0 5px 0 rgba(3, 60, 110, .22);
  display: grid;
  gap: 12px;
  text-align: center;
}
.auth-card h3 { margin: 0; font-size: 22px; }
.auth-avatar { font-size: 56px; font-family: var(--emoji); line-height: 1; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.auth-tabs .tab { background: #e0f2fe; }
.auth-tabs .tab.active { background: #fff; box-shadow: 0 0 0 3px var(--blue) inset; }
#auth-form { display: grid; gap: 10px; text-align: left; }
#auth-form label { font-weight: 800; font-size: 14px; color: var(--muted); }
#auth-form input {
  display: block;
  width: 100%;
  margin-top: 4px;
  font: 700 18px var(--font);      /* 16px+ — iPhone не будет приближать поле */
  color: var(--text);
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid #bae6fd;
  background: #fff;
  -webkit-user-select: text;
  user-select: text;
  outline: none;
}
#auth-form input:focus { border-color: var(--blue); }
#auth-form .reg-only { display: none; }
#auth-form.mode-register .reg-only { display: block; }
.auth-error { margin: 0; min-height: 1.2em; color: #dc2626; font-weight: 800; font-size: 14px; text-align: center; }
.auth-hint { margin: 0; font-size: 13px; color: var(--muted); font-weight: 700; line-height: 1.35; }
.auth-status { margin: 0; font-weight: 800; font-size: 15px; }
.auth-status.ok { color: #15803d; }
.auth-status.warn { color: #b45309; }
.btn.is-busy { opacity: .7; pointer-events: none; }
#btn-account.is-guest { opacity: .9; }

/* Шкала удачи 🍀 (внизу слева на экране рыбалки) */
.hud-luck {
  position: absolute;
  left: calc(12px + var(--safe-left));
  bottom: calc(14px + var(--safe-bottom, 0px));
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 7px;
  background: rgba(255,255,255,.88);
  border: 0; border-radius: 999px;
  box-shadow: 0 3px 0 rgba(0,0,0,.15);
  font: inherit; cursor: pointer; z-index: 5;
}
.hud-luck.hidden { display: none; }
.hud-luck span { font-size: 18px; font-family: var(--emoji); line-height: 1; }
.hud-luck i { display: block; width: 74px; height: 10px; border-radius: 6px; background: #e5e7eb; overflow: hidden; }
.hud-luck b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #86efac, #22c55e); border-radius: 6px; transition: width .4s; }
.hud-luck.warm b { background: linear-gradient(90deg, #fde68a, #f59e0b); }
.hud-luck.full b { background: linear-gradient(90deg, #fbbf24, #f472b6, #a78bfa); }
.hud-luck.full { animation: luckGlow 1.2s ease-in-out infinite; }
@keyframes luckGlow { 50% { box-shadow: 0 3px 0 rgba(0,0,0,.15), 0 0 16px 4px rgba(251,191,36,.8); } }
