/* «Клює!» — інтерфейс поверх сцени: напівпрозорі «скляні» панелі, теплий акцент, великі кнопки під палець */
:root { --g1: rgba(10, 18, 26, 0.62); --g2: rgba(10, 18, 26, 0.86); --line: rgba(255, 255, 255, 0.14); --txt: #f2f5f2; --dim: #a9b8bc; --acc: #ffb547; --acc2: #ffd27a; --ok: #6ee39a; --bad: #ff6b5a; --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { position: fixed; inset: 0; overflow: hidden; background: #0f1a24; color: var(--txt); font-family: 'Rubik', system-ui, sans-serif; font-size: 14px; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; touch-action: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
.hidden { display: none !important; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.glass, .chip, .tb, .seg, #gauge, #tourBanner, #hint { background: var(--g1); border: 1px solid var(--line); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

/* ---------- верх ---------- */
#top { position: absolute; z-index: 5; left: 0; right: 0; top: 0; padding: calc(8px + var(--safe-t)) 10px 0 30px; display: flex; gap: 8px; align-items: flex-start; pointer-events: none; }
#top > * { pointer-events: auto; }
.grow { flex: 1; }
.chips { display: flex; gap: 8px; min-width: 0; }
.chip { display: flex; flex-direction: column; justify-content: center; min-height: 44px; padding: 5px 12px; border-radius: 13px; text-align: left; min-width: 0; }
.chip.ic { flex-direction: row; align-items: center; gap: 9px; padding: 5px 12px 5px 9px; }
.chip.ic > i { width: 26px; height: 26px; flex: none; display: block; }
.chip.ic > i svg, #act i svg, .item .ico svg, .ibadge svg { width: 100%; height: 100%; display: block; }
.chip.ic > span { display: flex; flex-direction: column; min-width: 0; }
.chip.ic > i.wxi { width: 24px; height: 24px; margin-left: 2px; }
.chip.ic > i.bigi { width: 34px; height: 34px; padding: 3px; border-radius: 10px; background: rgba(255, 255, 255, 0.1); }
.chev { font-style: normal; color: var(--dim); font-size: 12px; margin-left: 2px; }
.chip b { font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip small { font-size: 11.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.money b { color: var(--acc2); font-variant-numeric: tabular-nums; }
.lvl { min-width: 84px; }
.xp { display: block; height: 5px; border-radius: 5px; background: rgba(255, 255, 255, 0.15); overflow: hidden; margin-top: 4px; }
.xp u { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6ee39a, #ffd27a); border-radius: 5px; transition: width 0.4s; }
#bar { position: absolute; z-index: 5; right: 10px; top: calc(62px + var(--safe-t)); display: flex; flex-direction: column; gap: 6px; }
.tb { position: relative; width: 58px; height: 54px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.tb svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tb span { font-size: 10px; font-weight: 700; color: var(--dim); }
.tb:active { transform: scale(0.95); }
.bdg { position: absolute; top: 3px; right: 4px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 10px; font-style: normal; font-weight: 800; line-height: 17px; text-align: center; padding: 0 4px; }

/* ---------- низ ---------- */
#bottom { position: absolute; z-index: 5; left: 0; right: 0; bottom: 0; padding: 0 12px calc(12px + var(--safe-b)) 30px; display: flex; align-items: flex-end; gap: 10px; pointer-events: none; }
#bottom > * { pointer-events: auto; }
#bottom .left { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
#bottom .right { margin-left: auto; display: flex; align-items: flex-end; gap: 10px; }
.seg { display: flex; padding: 3px; border-radius: 13px; gap: 3px; }
.seg button { height: 36px; padding: 0 12px; border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--dim); }
.seg button.on { background: rgba(255, 255, 255, 0.16); color: var(--txt); }
.seg button:disabled { opacity: 0.35; }
.baitChip { min-width: 190px; min-height: 52px; border-radius: 15px; }
.money { cursor: pointer; }
#act { width: 112px; height: 112px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffd27a, #f29a2e); color: #2b1604; border: 3px solid rgba(255, 255, 255, 0.55); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; touch-action: none; }
#act i { width: 28px; height: 28px; display: block; margin-bottom: 2px; }
#act span { font-size: 16px; font-weight: 900; line-height: 1.1; }
#act small { font-size: 10.5px; font-weight: 700; opacity: 0.7; margin-top: 3px; max-width: 90px; line-height: 1.2; }
#act.hot { animation: hot 0.45s ease-in-out infinite alternate; background: radial-gradient(circle at 35% 30%, #ff9a7a, #e23b2a); color: #fff; }
#act.reel { background: radial-gradient(circle at 35% 30%, #b8f0ff, #3aa6d6); color: #06202c; }
#act.down { transform: scale(0.94); }
#act:disabled { opacity: 0.5; }
@keyframes hot { from { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 90, 60, 0.6); } to { transform: scale(1.06); box-shadow: 0 0 0 14px rgba(255, 90, 60, 0); } }
.sbtn { height: 40px; padding: 0 14px; border-radius: 12px; background: var(--g2); border: 1px solid var(--line); font-weight: 700; font-size: 13px; }

/* ---------- датчик ---------- */
#gauge { position: absolute; z-index: 5; left: 50%; transform: translateX(-50%); bottom: calc(150px + var(--safe-b)); width: min(440px, calc(100% - 40px)); padding: 10px 14px; border-radius: 16px; }
.gtitle { display: flex; justify-content: space-between; font-size: 12px; font-weight: 800; color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.gtitle b { color: var(--txt); letter-spacing: 0; text-transform: none; font-size: 13px; }
.gbar { position: relative; height: 18px; border-radius: 9px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.gbar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 9px; background: linear-gradient(90deg, #6ee39a, #ffd27a 70%, #ff6b5a); transition: width 0.08s linear; }
.gbar em { position: absolute; top: -2px; bottom: -2px; width: 3px; background: #fff; border-radius: 2px; display: none; }
.gbar .band { position: absolute; top: 0; bottom: 0; background: rgba(110, 227, 154, 0.32); border-left: 2px solid rgba(110, 227, 154, 0.8); border-right: 2px solid rgba(110, 227, 154, 0.8); }
.gbar .tick { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255, 255, 255, 0.55); }
.gbar .tick span { position: absolute; top: 20px; transform: translateX(-50%); font-size: 10px; color: var(--dim); white-space: nowrap; }
.gsub { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--dim); margin-top: 6px; min-height: 15px; }
.gsub b { color: var(--txt); }
.stam { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.12); overflow: hidden; margin-top: 6px; }
.stam u { display: block; height: 100%; background: #8fd0ff; border-radius: 6px; }

#hint { position: absolute; z-index: 6; left: 50%; transform: translateX(-50%); top: 26%; max-width: min(460px, 88vw); padding: 11px 16px; border-radius: 14px; font-size: 14px; font-weight: 600; line-height: 1.45; text-align: center; pointer-events: none; }
#flash { position: absolute; z-index: 6; left: 50%; top: 36%; transform: translateX(-50%); font-size: 34px; font-weight: 900; text-shadow: 0 4px 22px rgba(0, 0, 0, 0.6); pointer-events: none; white-space: nowrap; opacity: 0; }
#flash.show { animation: flash 1.2s ease-out forwards; }
@keyframes flash { 0% { opacity: 0; transform: translate(-50%, 10px) scale(0.9); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.05); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -12px); } }
#tourBanner { position: absolute; z-index: 6; left: 50%; transform: translateX(-50%); top: calc(62px + var(--safe-t)); display: flex; align-items: center; gap: 14px; padding: 6px 8px 6px 16px; border-radius: 14px; font-size: 15px; border-color: rgba(255, 181, 71, 0.6); }
#tourBanner b { color: var(--acc2); }
#tourBanner span { font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- вікна ---------- */
.modal { position: fixed; inset: 0; z-index: 30; background: rgba(4, 8, 12, 0.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: calc(12px + var(--safe-t)) 12px calc(12px + var(--safe-b)); touch-action: auto; }
.box { width: min(440px, 100%); max-height: 100%; overflow-y: auto; background: linear-gradient(180deg, #1b2a36, #121d27); border: 1px solid var(--line); border-radius: 22px; padding: 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); animation: pop 0.18s ease-out; user-select: text; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.box h2 { margin: 0 0 6px; font-size: 20px; font-weight: 900; }
.note { color: var(--dim); font-size: 13.5px; line-height: 1.5; margin: 0 0 12px; }
.note b { color: var(--txt); }
.btn { min-height: 44px; padding: 0 16px; border-radius: 13px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line); font-weight: 800; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex-direction: column; }
.btn small { font-size: 11px; font-weight: 600; opacity: 0.75; }
.btn.pri { background: linear-gradient(180deg, #ffcf6e, #f0a03a); color: #2b1604; border-color: #ffe3a8; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
.catch { text-align: center; position: relative; overflow: hidden; background: radial-gradient(120% 70% at 50% 18%, #2f6a84 0%, #1a3a4c 45%, #111d27 100%); }
.catch::before { content: ''; position: absolute; left: -20%; right: -20%; top: -40%; height: 90%; background: repeating-linear-gradient(100deg, rgba(255, 255, 255, 0.05) 0 18px, rgba(255, 255, 255, 0) 18px 54px); pointer-events: none; }
.catch canvas { position: relative; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45)); }
.catch h2, .catch .big, .catch .tags, .catch .row { position: relative; }
.catch canvas { width: 100%; height: auto; display: block; margin: -4px 0 4px; }
.catch .big { font-size: 34px; font-weight: 900; color: var(--acc2); font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.catch .kv { padding: 8px 4px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); }
.catch .kv small { display: block; font-size: 11px; color: var(--dim); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.catch .kv b { font-size: 17px; }
.catch .btns { margin-top: 12px; }
.tags { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; min-height: 4px; }
.tag { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: rgba(255, 210, 122, 0.16); border: 1px solid rgba(255, 210, 122, 0.55); color: var(--acc2); }
.tag.g { background: rgba(110, 227, 154, 0.14); border-color: rgba(110, 227, 154, 0.5); color: var(--ok); }
.trophy { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); padding: 4px 12px; border-radius: 999px; font-weight: 900; font-size: 13px; background: linear-gradient(90deg, #ffd27a, #f29a2e); color: #2b1604; }
.sheet { width: min(620px, 100%); height: min(720px, 100%); display: flex; flex-direction: column; padding: 0; }
.shead { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.shead h2 { margin: 0; flex: 1; }
.x { width: 38px; height: 38px; border-radius: 11px; background: rgba(255, 255, 255, 0.08); font-size: 16px; }
.sbody { flex: 1; overflow-y: auto; padding: 12px 16px 18px; }
.tabs { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: rgba(0, 0, 0, 0.25); margin-bottom: 12px; overflow-x: auto; }
.tabs button { flex: 1; min-width: max-content; height: 34px; padding: 0 10px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--dim); }
.tabs button.on { background: rgba(255, 255, 255, 0.14); color: var(--txt); }
.item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); margin-bottom: 8px; }
.item .t { flex: 1; min-width: 0; }
.item .t b { display: block; font-size: 14.5px; }
.item .t small { display: block; font-size: 12px; color: var(--dim); line-height: 1.4; margin-top: 2px; }
.item.on { border-color: rgba(255, 210, 122, 0.6); background: rgba(255, 210, 122, 0.08); }
.item.lock { opacity: 0.55; }
.item .ico { width: 54px; height: 54px; border-radius: 12px; background: rgba(0, 0, 0, 0.25); flex: none; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 9px; }
.item .ico.fish { padding: 0; }
.item .ico canvas { width: 54px; height: 32px; }
.item .t + .btn { margin-left: auto; }
.ibadge { display: inline-block; width: 18px; height: 18px; vertical-align: -4px; margin-right: 4px; }
.agrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.acard { padding: 8px; border-radius: 13px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); text-align: center; cursor: pointer; }
.acard canvas { width: 100%; height: auto; display: block; }
.acard b { display: block; font-size: 13px; margin-top: 2px; }
.acard small { display: block; font-size: 11.5px; color: var(--dim); }
.acard.lock b { color: var(--dim); }
.prog { height: 7px; border-radius: 7px; background: rgba(255, 255, 255, 0.12); overflow: hidden; margin-top: 6px; }
.prog u { display: block; height: 100%; background: linear-gradient(90deg, #6ee39a, #ffd27a); }
.lbrow { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); margin-bottom: 4px; font-weight: 700; }
.lbrow .n { width: 22px; color: var(--dim); } .lbrow .s { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--acc2); }
.lbrow.me { border: 1px solid rgba(255, 210, 122, 0.6); }
.empty { padding: 20px; text-align: center; color: var(--dim); font-size: 13px; }
.cond { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 14px; }
.cond div { padding: 10px 6px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); text-align: center; }
.cond small { display: block; font-size: 11px; color: var(--dim); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.cond b { font-size: 15px; }
#toasts { position: fixed; z-index: 40; left: 50%; transform: translateX(-50%); bottom: calc(140px + var(--safe-b)); display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
#toasts div { padding: 9px 16px; border-radius: 12px; background: var(--g2); border: 1px solid var(--line); font-size: 13.5px; font-weight: 700; max-width: 90vw; text-align: center; animation: pop 0.2s; }

/* ---------- телефон ---------- */
@media (max-width: 640px) {
    #top { padding-left: 26px; gap: 6px; flex-wrap: nowrap; }
    #top .chips { flex: 1 1 auto; }
    #top .grow { display: none; }
    .money small { display: none; }
    .money, .lvl { flex: none; }
    .chip { min-height: 40px; padding: 4px 10px; }
    .chip b { font-size: 13.5px; } .chip small { font-size: 11px; }
    #cTime { display: none; }
    #cLoc { max-width: none; flex: 1 1 auto; }
    .chip.ic > i { width: 22px; height: 22px; }
    .baitChip { min-width: 150px; min-height: 48px; }
    .chip.ic > i.bigi { width: 30px; height: 30px; }
    #act i { width: 24px; height: 24px; }
    .lvl { min-width: 0; }
    #bar { left: 26px; right: 8px; top: calc(56px + var(--safe-t)); flex-direction: row; justify-content: space-between; gap: 4px; }
    .tb { width: auto; flex: 1 1 0; min-width: 0; height: 46px; border-radius: 12px; padding: 0; }
    .tb svg { width: 19px; height: 19px; }
    .tb span { font-size: 8.5px; letter-spacing: -0.2px; max-width: 100%; overflow: hidden; white-space: nowrap; }
    .tb[data-open="tasks"] span { font-size: 0; letter-spacing: 0; }
    .tb[data-open="tasks"] span::after { content: 'Завдання'; font-size: 8px; letter-spacing: -0.3px; }
    #bottom { padding-left: 26px; gap: 8px; }
    #bottom .left { flex: 0 1 auto; min-width: 0; }
    #bottom .right { flex-direction: column; align-items: flex-end; gap: 8px; }
    .baitChip { max-width: 100%; }
    .item { flex-wrap: wrap; row-gap: 9px; }
    .item .t { flex: 1 1 calc(100% - 66px); }
    #act { width: 96px; height: 96px; }
    #act span { font-size: 15px; }
    .baitChip { min-width: 128px; }
    .seg button { padding: 0 10px; }
    #gauge { bottom: calc(126px + var(--safe-b)); }
    #tourBanner { top: calc(108px + var(--safe-t)); font-size: 13px; gap: 10px; }
}
@media (max-width: 640px) and (max-height: 700px) { .tb span { display: none; } .tb { height: 40px; } }
