/* RadioExplora — phone layout (driven by mobile.js). Desktop is untouched. */
.m-only { display: none; }
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
button, [role="button"], .chip, .tabs button { touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.rx-locked .reticle { opacity: 1; }
.rx-locked .reticle i { border-color: var(--warm); }

@media (max-width: 760px) {
  html, body { overscroll-behavior: none; height: 100dvh; }
  .m-only { display: flex; }
  .hud-corner, .scan, .credits, #panel .brand, #panel .tabs, #pl-vol, #pl-share, .wave, .pl-tele { display: none !important; }
  .reticle { width: 64px; height: 64px; opacity: .75; }
  .reticle i { width: 14px; height: 14px; border-width: 0; }
  .reticle i:nth-child(1) { border-left-width: 2px; border-top-width: 2px; }
  .reticle i:nth-child(2) { border-right-width: 2px; border-top-width: 2px; }
  .reticle i:nth-child(3) { border-left-width: 2px; border-bottom-width: 2px; }
  .reticle i:nth-child(4) { border-right-width: 2px; border-bottom-width: 2px; }
  .glass::before { opacity: .4; }

  /* top: one search pill + language */
  #m-top { position: fixed; z-index: 14; top: 0; left: 0; right: 0; gap: 8px; align-items: center;
    padding: calc(10px + env(safe-area-inset-top)) 12px 8px; pointer-events: none; }
  #m-top > * { pointer-events: auto; }
  .m-search { flex: 1; min-width: 0; height: 46px; display: flex; align-items: center; gap: 10px; padding: 0 16px;
    border-radius: 23px; color: var(--muted); font-size: 15px; text-align: left; transition: transform .12s var(--ease-out); }
  .m-search span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .m-search svg { flex: none; }
  .m-lang { width: 46px; height: 46px; border-radius: 23px; font: 600 12px var(--mono); letter-spacing: .06em; color: var(--text); flex: none;
    justify-content: center; align-items: center; transition: transform .12s var(--ease-out); }
  .map-ctrls { top: calc(64px + env(safe-area-inset-top)); right: 12px; bottom: auto; flex-direction: column; }
  .map-ctrls .icon-btn { width: 40px; height: 40px; border-radius: 20px; }

  /* bottom nav, in thumb reach */
  #m-nav { position: fixed; z-index: 13; left: 0; right: 0; bottom: 0; height: calc(60px + env(safe-area-inset-bottom));
    padding: 0 4px env(safe-area-inset-bottom); background: var(--panel-solid); border-top: 1px solid var(--line); }
  #m-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--dim); font-size: 10.5px; font-weight: 600; transition: color .15s ease, transform .12s var(--ease-out); }
  #m-nav button svg { width: 22px; height: 22px; }
  #m-nav button.on { color: var(--text); }
  #m-nav button.on svg { color: var(--warm); }
  #m-nav button:active { transform: scale(.92); }

  /* mini player: rides on the nav, only when a station is selected */
  #player { left: 8px; right: 8px; width: auto; bottom: calc(66px + env(safe-area-inset-bottom)); height: 62px; border-radius: 14px;
    padding: 0 8px 0 7px; gap: 10px; cursor: pointer; }
  #player.idle { display: none; }
  .pl-art { width: 46px; height: 46px; border-radius: 10px; }
  .play-btn { width: 44px; height: 44px; }
  #pl-fav { width: 40px; height: 40px; }

  /* the sheet: height set by mobile.js (peek / half / full, follows the finger) */
  #panel { top: auto; left: 0; right: 0; width: auto; bottom: var(--sheet-bottom, 60px); height: 120px; border-radius: 18px 18px 0 0;
    border-bottom: 0; transition: height .38s var(--ease-drawer); padding-bottom: 6px; }
  .sheet-handle { display: grid; place-items: center; height: 22px; flex: none; cursor: grab; touch-action: none; }
  .sheet-handle span { width: 40px; height: 4px; border-radius: 4px; background: var(--muted); opacity: .45; }

  /* tuner: what sits under the crosshair */
  #tuner { flex: none; align-items: center; gap: 12px; padding: 2px 14px 12px; min-height: 76px; touch-action: none; cursor: pointer; }
  .tn-dial { width: 44px; height: 44px; border-radius: 50%; flex: none; position: relative; border: 1px solid var(--line-strong);
    background: radial-gradient(circle, rgba(126,166,200,.12), transparent 70%); }
  .tn-dial i { position: absolute; inset: 9px; border-radius: 50%; border: 2px solid var(--accent); border-top-color: transparent;
    animation: spin 2.4s linear infinite; opacity: .6; }
  #tuner.on .tn-dial { border-color: var(--warm); background: radial-gradient(circle, var(--warm-glow), transparent 70%); }
  #tuner.on .tn-dial i { border-color: var(--warm); border-top-color: transparent; animation-duration: 1.2s; opacity: 1; }
  .tn-main { flex: 1; min-width: 0; }
  .tn-k { font: 600 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); display: flex; align-items: center; gap: 6px; }
  #tuner.on .tn-k { color: var(--warm); }
  .tn-name { font-size: 16.5px; font-weight: 600; line-height: 1.25; margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  #tuner:not(.on) .tn-name { font-size: 14.5px; font-weight: 500; color: var(--muted); }
  .tn-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
  .tn-play { width: 50px; height: 50px; }
  .tn-play:disabled { opacity: .3; }

  /* what the sheet shows in each mode */
  #panel:not([data-mode="search"]) .search { display: none; }
  #panel:not([data-mode="explore"]) #tuner { display: none; }
  #panel:not([data-mode="explore"]):not([data-mode="search"]) .chips,
  #panel:not([data-mode="explore"]) .actions { display: none; }
  #panel[data-state="peek"] .chips, #panel[data-state="peek"] .actions, #panel[data-state="peek"] .list-head,
  #panel[data-state="peek"] .list { visibility: hidden; }
  .search { height: 48px; border-radius: 24px; margin: 0 12px 10px; }
  .search input { font-size: 16px; }                      /* under 16px iOS zooms the page in */
  .chips { padding: 0 12px 10px; }
  .chip { padding: 8px 14px; font-size: 13.5px; border-radius: 18px; }
  .actions { padding: 0 12px 10px; gap: 8px; }
  .act { height: 44px; border-radius: 12px; font-size: 13px; white-space: nowrap; gap: 6px; padding: 0 6px; }
  .list { padding: 0 6px 12px; }
  .list-head { padding: 6px 16px; }
  .row { padding: 10px; gap: 12px; min-height: 60px; transition: transform .12s var(--ease-out); }
  .row .icon-btn { width: 44px; height: 44px; }
  .art { width: 46px; height: 46px; border-radius: 10px; }
  .row-name { font-size: 15px; }
  .row-sub { font-size: 12.5px; }
  .list-head .back { padding: 8px 10px 8px 0; font-size: 12px; }
  #toast { top: calc(66px + env(safe-area-inset-top)); }

  /* full-screen player */
  #fp { position: fixed; z-index: 30; inset: 0; flex-direction: column; align-items: center;
    padding: calc(12px + env(safe-area-inset-top)) 22px calc(24px + env(safe-area-inset-bottom));
    background: radial-gradient(120% 70% at 50% 20%, #13263a 0%, #070b10 60%); color: #e3eaf0;
    transform: translateY(100%); visibility: hidden; transition: transform .42s var(--ease-drawer), visibility 0s linear .42s; touch-action: none; }
  #fp.open { transform: none; visibility: visible; transition: transform .42s var(--ease-drawer), visibility 0s; }
  #fp:not(.open) { pointer-events: none; }
  .map-ctrls { transition: opacity .2s ease; }
  :root[data-sheet="half"] .map-ctrls, :root[data-sheet="full"] .map-ctrls { opacity: 0; pointer-events: none; }
  .fp-top { width: 100%; display: flex; align-items: center; justify-content: space-between; }
  .fp-top .icon-btn { width: 44px; height: 44px; color: inherit; }
  .fp-top svg { width: 24px; height: 24px; }
  .fp-k { font: 600 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; opacity: .6; }
  .fp-art { margin-top: 4vh; width: min(66vw, 300px); aspect-ratio: 1; border-radius: 22px; overflow: hidden; display: grid; place-items: center;
    background: rgba(126,166,200,.1); border: 1px solid rgba(150,180,205,.18); position: relative; font: 600 44px var(--mono); color: #b4cee3;
    box-shadow: 0 30px 80px rgba(0,0,0,.5); transition: box-shadow .4s ease; flex: none; }
  .fp-art img { width: 100%; height: 100%; object-fit: cover; background: #fff; position: absolute; inset: 0; }
  .fp-art .mono { font-size: 44px !important; }
  #fp.live .fp-art { box-shadow: 0 0 0 1px var(--warm), 0 0 60px var(--warm-glow), 0 30px 80px rgba(0,0,0,.5); }
  .fp-name { margin-top: 4vh; font-size: 22px; font-weight: 700; text-align: center; line-height: 1.25; max-width: 100%;
    overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .fp-sub { margin-top: 6px; font-size: 14.5px; opacity: .75; text-align: center; }
  .fp-sub.err { color: var(--danger); opacity: 1; }
  .fp-sub .on-air { color: var(--warm); font: 600 12px var(--mono); letter-spacing: .1em; }
  .fp-tele { margin-top: 6px; font: 11px var(--mono); letter-spacing: .05em; opacity: .5; text-align: center; }
  .fp-wave { height: 36px; width: min(80vw, 320px); display: flex; align-items: flex-end; gap: 3px; margin-top: 3vh; opacity: 0; transition: opacity .4s ease; flex: none; }
  #fp.live .fp-wave { opacity: .6; }
  .fp-wave i { flex: 1; background: linear-gradient(0deg, var(--warm), transparent); height: 100%; transform-origin: bottom; animation: wv 1.3s ease-in-out infinite; border-radius: 2px; }
  .fp-ctrls { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 34px; }
  .fp-btn { width: 56px; height: 56px; color: inherit; border-radius: 28px; }
  .fp-btn svg { width: 26px; height: 26px; }
  .fp-btn.on { color: var(--warm); }
  .fp-play { width: 78px; height: 78px; }
  #fp.live .fp-play { background: radial-gradient(circle at 35% 30%, #fbe3bf, #f0c48a 70%); box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 0 36px var(--warm-glow); }
  .fp-play svg { width: 30px; height: 30px; }
  .fp-row { display: flex; gap: 10px; margin-top: 26px; }
  .fp-chip { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 21px; border: 1px solid rgba(150,180,205,.22);
    color: inherit; font-size: 14px; font-weight: 600; transition: transform .12s var(--ease-out); }
  .fp-chip svg { width: 17px; height: 17px; }
  .fp-chip.on { border-color: var(--warm); color: var(--warm); }
  .fp-chip:active, .fp-btn:active, .m-search:active, .m-lang:active, .row:active { transform: scale(.97); }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  #panel, #fp { transition: none; }
}
