:root { color-scheme: dark; --bg:#101820; --panel:#18232e; --line:#2b3b4a; --text:#e7eef4; --dim:#8ea3b5;
          --r0:#8ea3b5; --r1:#5fd08a; --r2:#4aa8ff; --r3:#b07cff; --r4:#ffb02e; --r5:#ff4d6d; }
  * { box-sizing: border-box; }
  [hidden] { display:none !important; }
  /* Яндекс Игры: без прокрутки страницы (1.10.2), долгое нажатие не выделяет текст (1.6.1.8) */
  html, body { height:100%; margin:0; overflow:hidden; overscroll-behavior:none; }
  body { background:var(--bg); color:var(--text); font:15px/1.4 -apple-system,Segoe UI,Roboto,sans-serif;
         user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; }
  #app { max-width:760px; height:100dvh; margin:0 auto; display:flex; flex-direction:column; }
  button { font:inherit; color:var(--text); background:#26384a; border:1px solid var(--line);
           border-radius:8px; padding:8px 14px; min-height:44px; cursor:pointer; touch-action:manipulation; }
  button:hover:not(:disabled) { background:#31485e; }
  button:disabled { opacity:.45; cursor:default; }
  .primary, .primary:hover:not(:disabled) { background:var(--r1); color:#0c1a12; border-color:transparent; font-weight:600; }
  .strike, .strike:hover { background:var(--r4); color:#241800; border-color:transparent; font-weight:600; }
  .hint { color:var(--dim); font-size:13px; }
  .up { color:var(--r1); } .down { color:#ff6b6b; }
  .rec { color:var(--r4); font-size:12px; font-weight:600; }
  .new { color:var(--r1); font-size:12px; }
  /* значок на кнопке: число или точка */
  button i { font-style:normal; font-size:11px; font-weight:600; background:var(--r5); color:#fff;
             border-radius:9px; padding:0 5px; margin-left:4px; vertical-align:top; }
  button i:empty { display:none; }

  /* шапка: только то, что меняется каждую минуту */
  .hud { display:flex; align-items:center; gap:8px; padding:10px 16px 4px; }
  .wallet { margin-right:auto; display:flex; flex-direction:column; line-height:1.2; min-width:0; }
  .wallet b { font-size:24px; color:var(--r4); font-variant-numeric:tabular-nums; }
  .wallet small { color:var(--dim); font-size:12px; }
  .rank-title { color:var(--r4); }
  .chip { padding:6px 12px; font-size:14px; white-space:nowrap; }
  .dev { padding:0 16px; font-size:12px; color:var(--dim); }
  .dev summary { cursor:pointer; padding:2px 0; }
  .dev div { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }

  main { flex:1; min-height:0; display:flex; flex-direction:column; }
  .view { flex:1; min-height:0; display:flex; flex-direction:column; gap:8px; padding:8px 16px; overflow-y:auto; }
  #v-fish { overflow:hidden; }

  /* водоёмы и ворота */
  .tabs { display:flex; gap:6px; }
  .tab { flex:1; font-size:13px; padding:6px 8px; }
  .tab.on { background:var(--r2); color:#04121f; border-color:transparent; font-weight:600; }
  .gate { display:flex; align-items:center; gap:4px 10px; flex-wrap:wrap; }
  .gate:empty { display:none; }
  .cells { flex:1 1 140px; display:flex; gap:3px; }
  .g { flex:1; height:8px; border-radius:2px; background:#0c141c; border:1px solid var(--line); }
  .g.on { background:var(--r1); border-color:transparent; }
  .g.free { background:#2f5f45; border-color:transparent; }

  /* сцена: по центру, пока влезает; длинный улов прокручивается внутри */
  .stage { flex:1; min-height:0; overflow-y:auto; display:flex; flex-direction:column; align-items:center;
           gap:8px; text-align:center; background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:10px; }
  .stage > :first-child { margin-top:auto; }
  .stage > :last-child { margin-bottom:auto; }
  .wait { color:var(--dim); font-size:14px; }
  .bite { font-size:22px; font-weight:600; color:var(--r4); }
  .float { font-size:32px; animation:bob 1.4s ease-in-out infinite; }
  @keyframes bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(6px)} }
  .profit { font-size:14px; }
  .track { position:relative; width:100%; max-width:420px; height:30px; border-radius:6px; flex-shrink:0;
           background:#0c141c; border:1px solid var(--line); overflow:hidden; }
  .zone { position:absolute; top:0; bottom:0; background:rgba(95,208,138,.30); }
  .zone.mid { background:rgba(95,208,138,.55); }
  .marker { position:absolute; top:0; bottom:0; width:3px; background:var(--r4); will-change:left; }

  /* панель действия: одна точка для всей петли */
  .status { font-size:12px; color:var(--dim); display:flex; flex-direction:column; }
  .bar { display:flex; gap:8px; }
  .bar > button, #phase button { flex:1; min-height:56px; font-size:17px; font-weight:600; }
  .bar small { display:block; font-size:12px; font-weight:400; }
  #phase { flex:1; display:flex; }
  #phase:empty { display:none; }
  #phase:not(:empty) ~ button { display:none; }

  /* карточки */
  .list { display:flex; flex-direction:column; gap:8px; }
  .cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:8px; width:100%; flex-shrink:0; }
  .card { border:1px solid var(--line); border-radius:10px; padding:10px; background:#0f1a24; text-align:left;
          display:flex; flex-direction:column; gap:4px; }
  .card .name { font-weight:600; }
  .card .rank { font-size:12px; }
  .card .price { font-variant-numeric:tabular-nums; font-size:13px; }
  .card .row { display:flex; gap:6px; margin-top:4px; }
  .card .row button { flex:1; padding:6px 8px; font-size:13px; }
  /* совет на карточке — контуром: залитая кнопка на экране одна */
  .card .row .primary { background:transparent; color:var(--r1); border-color:var(--r1); }
  .catch { display:grid; grid-template-columns:72px 1fr; gap:4px 10px; }
  .catch .thumb { width:72px; height:72px; object-fit:cover; border-radius:8px; }
  .catch .row { grid-column:1 / -1; }
  .kg { font-weight:400; font-variant-numeric:tabular-nums; }
  .gear { display:grid; grid-template-columns:minmax(0,1fr) 48px; gap:4px 10px; }
  .gear .ico { grid-column:2; grid-row:1; width:48px; height:48px; object-fit:contain; }
  .gear .wide { grid-column:1 / -1; }
  .card .line { display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:13px; color:var(--dim); }
  .card .line button { padding:4px 10px; font-size:12px; }

  /* стенд */
  .stats { display:flex; flex-wrap:wrap; gap:2px 14px; font-size:13px; color:var(--dim); }
  .stats b { color:var(--text); }
  .pond-title { font-size:13px; color:var(--dim); margin-top:6px; }
  .stand { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:6px; }
  .elite-grid { grid-template-columns:repeat(6,minmax(0,1fr)); }
  .cell { border:1px dashed var(--line); border-radius:8px; padding:4px; font-size:11px; line-height:1.25;
          text-align:center; color:var(--dim); display:flex; flex-direction:column; align-items:center;
          gap:2px; overflow-wrap:anywhere; }
  .cell.got { border-style:solid; background:#0f1a24; }
  .cell b { font-weight:600; }
  .cell small { color:var(--dim); font-size:10px; font-variant-numeric:tabular-nums; }
  .cell .pic { width:100%; aspect-ratio:4 / 3; object-fit:cover; border-radius:5px; }
  .cell .q { display:grid; place-items:center; background:#0c141c; font-size:16px; }
  .cell.locked .pic { filter:grayscale(1) brightness(.3); }

  /* вкладки снизу, в зоне большого пальца */
  .tabbar { display:flex; border-top:1px solid var(--line); background:var(--panel);
            padding-bottom:env(safe-area-inset-bottom); }
  .tabbar button { flex:1; border:0; border-radius:0; background:none; min-height:52px; color:var(--dim); font-size:13px; }
  .tabbar button.on { color:var(--text); box-shadow:inset 0 2px 0 var(--r2); }
