:root {
  --bg: #0f1115;
  --card: #171a21;
  --text: #e8e9ee;
  --muted: #9aa3b2;
  --btn: #2b6cff;
  --btnText: #ffffff;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial; }

.wrap {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 14px;
  gap: 12px;

  /* “Вертикальность”: ограничиваем ширину как у телефона */
  max-width: 480px;
  margin: 0 auto;
}

.top .title { font-size: 20px; font-weight: 700; }
.top .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.row:last-child { border-bottom: none; }
.label { color: var(--muted); font-size: 13px; }
.value { font-weight: 600; }

.btn {
  margin-top: 8px;
  border: none;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 700;
  background: var(--btn);
  color: var(--btnText);
  cursor: pointer;
}

.foot { margin-top: auto; color: var(--muted); font-size: 12px; text-align: center; padding: 6px 0; }
.tabs{
  display:flex;
  gap:10px;
}

.tab{
  flex:1;
  text-align:center;
  text-decoration:none;
  background: var(--card);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.06);
}

.tab.active{
  outline: 2px solid rgba(43,108,255,.65);
}

.badge{
  display:inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mini{
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}

.btn.secondary{
  background: rgba(255,255,255,.08);
  color: var(--text);
}

.btn:disabled{
  opacity:.55;
  cursor:not-allowed;
}

/* === POND SCENE (vertical water) === */
.pond {
  position: relative;
  height: 210px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #1f556c 0%, #0d2a36 100%);
  border: 1px solid rgba(255,255,255,.06);
}

/* Вертикальные "струи"/волны */
.pond::before,
.pond::after {
  content: "";
  position: absolute;
  inset: -25% -25%;
  pointer-events: none;
}

.pond::before {
  /* мягкие вертикальные "полосы" + пятна бликов */
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,.08) 0px,
      rgba(255,255,255,.08) 2px,
      transparent 10px,
      transparent 26px
    ),
    radial-gradient(70px 40px at 20% 25%, rgba(255,255,255,.10), transparent 70%),
    radial-gradient(90px 45px at 70% 40%, rgba(255,255,255,.08), transparent 72%),
    radial-gradient(80px 40px at 40% 70%, rgba(255,255,255,.07), transparent 72%);
  opacity: .55;
  animation: waterFall1 6.5s ease-in-out infinite;
}

.pond::after {
  /* второй слой: тонкие вертикальные ряби */
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,.06) 0px,
      rgba(255,255,255,.06) 1px,
      transparent 7px,
      transparent 18px
    );
  opacity: .28;
  filter: blur(0.3px);
  animation: waterFall2 4.8s ease-in-out infinite;
}

@keyframes waterFall1 {
  0%   { transform: translateY(-10px); }
  50%  { transform: translateY(12px); }
  100% { transform: translateY(-10px); }
}
@keyframes waterFall2 {
  0%   { transform: translateY(8px); }
  50%  { transform: translateY(-14px); }
  100% { transform: translateY(8px); }
}

/* === FLOAT (2D side view) === */
.float {
  position: absolute;
  left: 50%;
  top: 98px;
  transform: translateX(-50%);
  width: 54px;
  height: 34px;
  pointer-events: none;
  animation: floatBob 1.6s ease-in-out infinite;
  filter: drop-shadow(0 10px 14px rgba(0,0,0,.35));
}

@keyframes floatBob {
  0%   { transform: translateX(-50%) translateY(0px); }
  50%  { transform: translateX(-50%) translateY(2px); }
  100% { transform: translateX(-50%) translateY(0px); }
}

.float .body {
  position: absolute;
  left: 14px;
  top: 2px;
  width: 18px;
  height: 30px;
}

/* красная верхушка */
.float .top {
  position: absolute;
  left: 4px;
  top: 0px;
  width: 10px;
  height: 10px;
  border-radius: 6px;
  background: #ff3b3b;
  box-shadow: 0 0 0 2px rgba(255,255,255,.95);
}

/* белая нижняя часть */
.float .bottom {
  position: absolute;
  left: 1px;
  top: 9px;
  width: 16px;
  height: 20px;
  border-radius: 10px;
  background: #f3f5ff;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.08);
  transform-origin: top center;
  transition: transform .25s ease, opacity .25s ease;
}

/* легкая рябь */
.float .ring {
  position: absolute;
  left: 50%;
  top: 24px;
  width: 46px;
  height: 14px;
  transform: translateX(-50%);
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.16);
  opacity: .8;
}

/* ПОКЛЁВКА: белая часть тонет, красная опускается и дёргается */
.float.bite { animation: none; }

.float.bite .bottom {
  transform: translateY(14px) scaleY(0.12);
  opacity: 0.03;
}

.float.bite .top {
  animation: topBite 0.45s ease-in-out infinite;
}

@keyframes topBite {
  0%   { transform: translateY(6px); }
  30%  { transform: translateY(12px); }
  55%  { transform: translateY(7px); }
  75%  { transform: translateY(14px); }
  100% { transform: translateY(9px); }
}

/* === MINI GAME UI === */

.fightHud {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progressWrap {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.06);
}

.progressFill {
  height: 100%;
  width: 0%;
  background: rgba(43,108,255,.85);
  transition: width .18s ease;
}

.fightTip {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

/* кружочек-мишень */
.target {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;

  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.20), rgba(255,255,255,.05) 55%, rgba(255,255,255,.02) 100%);
  border: 2px solid rgba(255,255,255,.35);
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
}

.target::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.25);
}

.target.pop {
  animation: popIn .12s ease-out forwards;
}
@keyframes popIn {
  from { transform: translate(-50%, -50%) scale(0.85); opacity: .6; }
  to   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* === TARGET TIMER BAR === */

.targetTimer {
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  transform: translateX(-50%);
  width: 44px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.15);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.25);
}

.targetTimerFill {
  height: 100%;
  width: 100%;
  background: #ff3b3b;
  transform-origin: left center;
  animation: timerDrain linear forwards;
}

/* анимация будет задаваться через JS (duration = 1.5s) */
@keyframes timerDrain {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

.invPanel{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.06);
}

.invLeft{
  display:flex;
  flex-direction:column;
  gap:2px;
}

.invTitle{
  font-weight: 800;
  font-size: 13px;
}

.invSub{
  color: var(--muted);
  font-size: 12px;
}

.invRight{
  display:flex;
  gap:8px;
  align-items:center;
}

.invPill{
  display:flex;
  gap:6px;
  align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.08);
  font-weight: 800;
  font-size: 12px;
}
.invPill .mut{
  color: var(--muted);
  font-weight: 700;
}

/* FIX: убираем горизонтальный вылет */
html, body {
  overflow-x: hidden;
}

.wrap, .card {
  width: 100%;
  max-width: 480px; /* оставляем твою “телефонную” ширину */
}

/* FIX: flex-элементы должны иметь право сжиматься */
.row, .invPanel, .tabs {
  min-width: 0;
}

.label, .value, .invLeft, .invRight, .tab {
  min-width: 0;
}

/* на всякий случай: если где-то длинная строка — пусть переносится */
.value {
  overflow-wrap: anywhere;
}

/* === SWAMP SCENE (frogs) === */
.swamp{
  position: relative;
  height: 210px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #2f6a3c 0%, #163621 100%);
  border: 1px solid rgba(255,255,255,.06);
}

.swamp::before,
.swamp::after{
  content:"";
  position:absolute;
  inset:-25% -25%;
  pointer-events:none;
}

.swamp::before{
  background:
    radial-gradient(70px 40px at 18% 30%, rgba(255,255,255,.08), transparent 70%),
    radial-gradient(90px 45px at 72% 38%, rgba(255,255,255,.07), transparent 72%),
    radial-gradient(80px 40px at 42% 72%, rgba(255,255,255,.06), transparent 72%),
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,.05) 0px,
      rgba(255,255,255,.05) 2px,
      transparent 12px,
      transparent 28px
    );
  opacity:.55;
  animation: swampMove1 7s ease-in-out infinite;
}

.swamp::after{
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,.04) 0px,
      rgba(255,255,255,.04) 1px,
      transparent 8px,
      transparent 20px
    );
  opacity:.25;
  filter: blur(.3px);
  animation: swampMove2 5.2s ease-in-out infinite;
}

@keyframes swampMove1{
  0%{ transform: translateY(-10px); }
  50%{ transform: translateY(12px); }
  100%{ transform: translateY(-10px); }
}
@keyframes swampMove2{
  0%{ transform: translateY(10px); }
  50%{ transform: translateY(-12px); }
  100%{ transform: translateY(10px); }
}

/* Лягушка */
.frog{
  position:absolute;
  width: 54px;
  height: 44px;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%) scale(.95);
  border-radius: 18px;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(0,0,0,.35);
  background:
    radial-gradient(circle at 30% 35%, rgba(255,255,255,.18), rgba(255,255,255,0) 55%),
    radial-gradient(circle at 70% 70%, rgba(0,0,0,.18), rgba(0,0,0,0) 55%),
    linear-gradient(180deg, #55c266 0%, #2f8d41 100%);
  border: 2px solid rgba(255,255,255,.18);
  animation: frogPop .10s ease-out forwards;
}

@keyframes frogPop{
  from{ transform: translate(-50%,-50%) scale(.85); opacity:.6; }
  to{ transform: translate(-50%,-50%) scale(.98); opacity:1; }
}

.frog::before, .frog::after{
  content:"";
  position:absolute;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.15);
}
.frog::before{ left: 14px; }
.frog::after{ right: 14px; }
