/* =====================================================================
   Dalnapló -- mobil réteg (telefon, kb. 320-760px). Az alap stíluslap UTÁN töltődik,
   ezért itt szándékosan felülírunk. Fő hiba, amit javít: a későbbi `.grid{overflow:hidden}`
   szabály levágta a táblázatokat, így oszlopok elvesztek és nem lehetett görgetni.
   ===================================================================== */

/* --- görgethető táblázat-burkoló (a layout.php szkriptje teszi köré) --- */
.tscroll{width:100%;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;margin-bottom:36px;
         border-radius:12px;border:1px solid var(--line);background:var(--surface)}
.tscroll>.grid,.tscroll>table{margin:0;border:0;border-radius:0;display:table;width:100%;overflow:visible}

@media (max-width:760px){
  body{padding-bottom:calc(84px + env(safe-area-inset-bottom));font-size:16px}
  .wrap{padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right))}
  h1{font-size:1.65rem;line-height:1.12}
  h2{font-size:1.2rem}

  /* ---- fejléc: 1. sor márka + fiók, 2. sor görgethető menü, 3. sor kereső; nem tapad (nem eszi a képernyőt) ---- */
  .top{position:static}
  .wrap.top-in{padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right))}
  .top-in{display:grid;grid-template-columns:1fr auto;grid-template-areas:"brand acct" "nav nav" "find find";
         gap:8px 12px;height:auto;padding-top:10px;padding-bottom:12px;align-items:center}
  .brand{grid-area:brand}
  .acct{grid-area:acct;order:0;padding:9px 16px;min-height:40px;display:inline-flex;align-items:center;
        border:1px solid var(--line);border-radius:99px;font-weight:500;font-size:.92rem;background:var(--paper)}
  .nav{grid-area:nav;gap:6px;margin:0 -16px;padding:2px 16px;scroll-snap-type:x proximity;
       mask-image:linear-gradient(90deg,#000 calc(100% - 28px),transparent);
       -webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 28px),transparent)}
  .nav a{padding:9px 14px;min-height:40px;display:inline-flex;align-items:center;border:1px solid var(--line);
         border-radius:99px;background:var(--surface);scroll-snap-align:start;font-size:.95rem}
  .nav a.on{background:var(--ink);color:#fff;border-color:var(--ink)}
  .find{grid-area:find;width:100%;margin:0}
  .find input{flex:1;min-width:0;width:100%;font-size:16px;padding:11px 14px;min-height:44px}   /* 16px: iOS ne nagyítson rá fókuszkor */
  .find button{min-height:44px;padding:0 18px}
  .suggest{left:0;right:0;width:auto;max-width:none}
  .suggest a{padding:13px 14px}

  /* ---- űrlapok: iOS-barát méret ---- */
  input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea{font-size:16px!important;min-height:44px}
  textarea{min-height:96px}
  button,.play,.more,.inline-find button,.donate-go,.donate-no{min-height:44px}
  .inline-find{flex-wrap:wrap}
  .inline-find input,.inline-find.big input{max-width:none;flex:1 1 100%}
  .inline-find button{flex:1 1 100%}
  .bar{gap:10px}
  .datepick,.weekpick{flex-wrap:wrap;width:100%}
  .datepick input,.datepick select,.weekpick select{flex:1;min-width:0}
  .submit-form .f,.submit-form .f.grow,
  :where(form:not(.submit-form) .f),:where(form:not(.submit-form) .f.grow){min-width:0;flex:1 1 100%;width:100%}
  :where(form:not(.submit-form) .f input[type=date]),:where(form:not(.submit-form) .f input[type=time]){min-width:0}
  .vs-form select{min-width:0;flex:1 1 100%}

  /* ---- hero / fejlécblokkok ---- */
  .wall-head{padding:26px 0 22px}
  .hero-stats{gap:8px}
  .hero-stats li{font-size:.84rem;padding:5px 11px}
  .station{padding:16px 16px 0;border-radius:14px;margin:0 0 20px}
  .station-in{gap:14px}
  .tabs{margin-left:-16px;margin-right:-16px;padding:0 16px;gap:0}
  .tabs a{padding:13px 14px;min-height:44px}
  .tools a{padding:9px 14px;min-height:40px;display:inline-flex;align-items:center}
  .chips a{padding:10px 15px}

  /* ---- táblázatok: tördelhető cellák, kompakt méret; ami mégsem fér, a burkolóban görgethető ---- */
  .grid,.tscroll>.grid{display:table;white-space:normal;overflow:visible;width:100%}
  .grid th,.grid td{padding:10px 7px;font-size:.88rem;white-space:normal;vertical-align:middle}
  .grid th:first-child,.grid td:first-child{padding-left:11px}
  .grid th:last-child,.grid td:last-child{padding-right:11px}
  .grid thead th{font-size:.72rem;white-space:nowrap}
  .grid .pos{width:2.2em}
  .grid .t,.grid .num{white-space:nowrap}
  .grid td a{white-space:normal;overflow-wrap:anywhere}
  .grid td.r a{border-bottom:0}
  .grid td a.tiny{display:block;margin:2px 0 0}
  .grid .move,.grid .badge{white-space:nowrap}
  .badge{margin-left:4px}

  /* ---- slágerlista-jellegű táblák (van lejátszó-oszlop): soronként kártya ---- */
  .grid:has(th.pvc) thead{display:none}
  .grid:has(th.pvc),.grid:has(th.pvc) tbody{display:block;width:100%}
  .grid:has(th.pvc) tr{display:grid;grid-template-columns:30px 40px 1fr 1fr;column-gap:6px;align-items:center;
        padding:10px 12px 10px 8px;border-bottom:1px solid var(--line)}
  .grid:has(th.pvc) tr:last-child{border-bottom:0}
  .grid:has(th.pvc) td{display:block;padding:0;border:0;min-width:0;text-align:left;font-size:.9rem}
  .grid:has(th.pvc) td.pos{grid-column:1;grid-row:1/span 3;text-align:center;width:auto;font-size:.82rem}
  .grid:has(th.pvc) td.pvc{grid-column:2;grid-row:1/span 3;text-align:center}
  .grid:has(th.pvc) td:nth-child(3){grid-column:3/5;grid-row:1;font-size:.96rem}
  .grid:has(th.pvc) td:nth-child(4){grid-column:3/5;grid-row:2;color:var(--ink-soft)}
  .grid:has(th.pvc) td:nth-child(n+5){grid-row:3;font-size:.8rem;color:var(--ink-soft);margin-top:3px;text-align:left}
  .grid:has(th.pvc) td[data-l]:nth-child(n+5)::before{content:attr(data-l) ": ";opacity:.8}
  .grid:has(th.pvc) td[colspan]{grid-column:1/-1;grid-row:auto;font-size:.9rem;padding:6px 0}
  .grid:has(th.pvc) .move{margin-left:4px}
  /* heti lista: # | változás | ▶ | előadó | cím | játszás | rádió | hét */
  .grid.grid-w:has(th.pvc) tr{grid-template-columns:34px 40px 1fr 1fr 1fr}
  .grid.grid-w:has(th.pvc) td.pos{grid-column:1;grid-row:1;align-self:end}
  .grid.grid-w:has(th.pvc) td:nth-child(2){grid-column:1;grid-row:2/span 2;align-self:start;text-align:center;font-size:.7rem;margin:0;color:inherit}
  .grid.grid-w:has(th.pvc) td:nth-child(2)::before{content:none!important}
  .grid.grid-w:has(th.pvc) td:nth-child(5)::before{content:none!important}
  .grid.grid-w:has(th.pvc) td.pvc{grid-column:2;grid-row:1/span 3}
  .grid.grid-w:has(th.pvc) td:nth-child(4){grid-column:3/6;grid-row:1;font-size:.96rem;color:var(--ink)}
  .grid.grid-w:has(th.pvc) td:nth-child(5){grid-column:3/6;grid-row:2;color:var(--ink-soft);font-size:.9rem}
  .grid.grid-w:has(th.pvc) td:nth-child(n+6){grid-row:3}
  .grid.grid-w:has(th.pvc) td .move{display:block;white-space:nowrap}
  .pvc{width:1%!important;padding-left:0!important;padding-right:0!important}
  /* kis lejátszógomb: vizuálisan 34px, de a találati terület nagyobb */
  .pv-mini{width:34px!important;height:34px!important;position:relative}
  .pv-mini::after{content:"";position:absolute;inset:-6px}
  .pv-mini svg{width:14px!important;height:14px!important}

  /* ---- rang-listák, kártyák ---- */
  .rank li{padding:13px 14px 13px 42px}
  .rank li::before{left:13px;top:13px}
  .rank li:hover{transform:none;box-shadow:none}
  .wall{gap:10px;margin-bottom:28px}
  .card{min-height:0;padding:14px}
  .cols{gap:24px}
  .pairs li{padding:12px 14px}
  .trend-cols,.trend-grid{grid-template-columns:1fr}
  .plans,.feature-grid,.fav-grid,.wr-months{grid-template-columns:1fr}
  .rep-stats,.wr-cards{grid-template-columns:1fr 1fr}
  .era-tiles li{min-width:0;flex:1 1 40%}
  .origin-share-2 .share-lbl{min-width:0}
  .heatmap{-webkit-overflow-scrolling:touch}
  .chart-head{gap:8px}

  /* ---- alsó lejátszó ---- */
  .player{padding-bottom:env(safe-area-inset-bottom)}
  .player-in{gap:12px;height:68px}
  .pl-toggle{width:46px;height:46px}
  .pl-close{min-width:44px;min-height:44px;font-size:1.2rem}
  .pl-meta strong{font-size:.9rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

  /* ---- adománymodal ---- */
  .donate-box{width:calc(100vw - 32px);max-width:420px}

  /* ---- lábléc: nagyobb koppintási felület ---- */
  .foot{padding:24px 0 32px}
  .foot p a{display:inline-block;padding:7px 2px}
}

@media (max-width:400px){
  .grid th,.grid td{padding:9px 5px;font-size:.84rem}
  .rep-stats,.wr-cards{grid-template-columns:1fr}
  h1{font-size:1.5rem}
}

/* érintőképernyőn nincs hover-emelkedés */
@media (hover:none){
  .card:hover,.rank li:hover{transform:none;box-shadow:none}
}
