/* FLIMBO MUSIC — osobna warstwa mobilna
   Plik jest ładowany wyłącznie na ekranach do 760 px.
   Nie zmienia wyglądu wersji komputerowej. */

:root {
  --mobile-pad: 12px;
  --mobile-player-height: 112px;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  padding-bottom: calc(var(--mobile-player-height) + env(safe-area-inset-bottom, 0px));
  -webkit-text-size-adjust: 100%;
}

button,
a,
input,
textarea,
select {
  touch-action: manipulation;
}

/* Nawigacja i główna zawartość */
.sidebar {
  display: none !important;
}

main {
  width: 100%;
  margin-left: 0 !important;
}

.topbar {
  height: 60px;
  padding: 8px var(--mobile-pad) !important;
}

.search {
  width: 100% !important;
  min-width: 0;
  padding: 9px 12px;
}

.search input {
  min-width: 0;
  font-size: 16px;
}

/* Baner */
.hero {
  padding: 12px var(--mobile-pad) 0 !important;
}

.hero-banner {
  width: 100%;
  border-radius: 16px !important;
}

.hero-banner img {
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: 975 / 180;
  object-fit: cover !important;
}

.banner-fade {
  background: linear-gradient(180deg, transparent 35%, rgba(2, 5, 3, .9));
}

.banner-actions {
  left: 10px !important;
  right: 10px !important;
  bottom: 9px !important;
  width: auto !important;
  transform: none !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 7px !important;
}

.banner-actions > * {
  width: 100%;
  min-width: 0;
  padding: 9px 7px;
  border-radius: 10px;
  font-size: 10px;
  white-space: nowrap;
}

/* Główny odtwarzacz w sekcji hero */
.hero-player-pro {
  width: auto !important;
  margin: 14px var(--mobile-pad) 0 !important;
  padding: 14px !important;
  display: grid !important;
  grid-template-columns: 74px minmax(0, 1fr) !important;
  gap: 12px !important;
  border-radius: 18px !important;
}

.hero-player-cover-stage {
  width: 74px !important;
  min-width: 74px !important;
  height: 74px !important;
}

.hero-player-cover-wrap,
.hero-player-cover-wrap img {
  width: 74px !important;
  height: 74px !important;
}

.vinyl-disc,
.now-badge {
  display: none !important;
}

.hero-player-main {
  min-width: 0;
}

.hero-player-meta span {
  font-size: 8px !important;
  letter-spacing: 1.4px !important;
}

.hero-player-meta h2 {
  margin: 4px 0 2px !important;
  font-size: 17px !important;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hero-player-meta p {
  margin: 0 !important;
  font-size: 10px !important;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hero-player-controls {
  margin-top: 9px !important;
  gap: 7px !important;
  justify-content: flex-start !important;
}

.hero-player-controls button {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  padding: 0 !important;
}

.hero-main-play {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
}

.hero-progress {
  grid-column: 1 / -1;
  grid-template-columns: 30px minmax(0, 1fr) 30px !important;
  gap: 6px !important;
  margin-top: 4px;
}

.hero-player-side,
.hero-spectrum {
  display: none !important;
}

/* Analizator */
.visualizer-section {
  width: auto;
  margin: 14px var(--mobile-pad) 0 !important;
  padding: 0 !important;
}

.visualizer-head {
  align-items: center !important;
}

.visualizer-head strong {
  max-width: 70vw;
  font-size: 15px !important;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.big-equalizer {
  height: 68px !important;
  gap: 3px !important;
  padding: 10px !important;
  border-radius: 14px !important;
}

.big-equalizer b {
  width: 4px !important;
  max-height: 48px;
}

/* Sekcje */
.section {
  width: 100%;
  padding: 34px var(--mobile-pad) !important;
}

.section-title {
  margin-bottom: 15px !important;
  align-items: center !important;
  gap: 10px !important;
}

.section-title h2,
.support-box h2 {
  margin-top: 5px !important;
  font-size: clamp(22px, 7vw, 29px) !important;
  line-height: 1.08;
}

.section-title span,
.eyebrow {
  font-size: 8px !important;
  letter-spacing: 2px !important;
}

#playAll {
  flex: 0 0 auto;
  padding: 9px 10px;
  font-size: 10px;
}

/* Karty — dwa kompaktowe kafelki w rzędzie na typowym telefonie */
#tracksGrid.tracks-grid,
.tracks-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 9px !important;
}

.track-card {
  min-width: 0 !important;
  border-radius: 13px !important;
}

.track-cover {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
}

.track-cover img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.cover-play {
  display: none !important;
}

.track-body {
  min-width: 0;
  padding: 9px !important;
}

.track-row {
  min-width: 0;
  gap: 5px;
}

.track-row h3 {
  min-width: 0;
  font-size: 12px !important;
  line-height: 1.2;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.track-row span {
  flex: 0 0 auto;
  font-size: 8px !important;
}

.track-body > p {
  margin-top: 4px !important;
  min-height: 13px !important;
  max-height: 13px !important;
  font-size: 8.5px !important;
  line-height: 13px !important;
}

.track-actions {
  grid-template-columns: minmax(0, 1fr) 38px minmax(0, 1fr) !important;
  gap: 4px !important;
  margin-top: 7px !important;
}

.track-actions button {
  min-height: 31px !important;
  padding: 5px 3px !important;
  border-radius: 7px !important;
  font-size: 8px !important;
}

.track-actions .action-icon {
  font-size: 10px !important;
}

.track-actions .action-count {
  min-width: 14px !important;
  height: 14px !important;
  padding: 0 3px !important;
  font-size: 8px !important;
}

.track-actions .support-card {
  min-height: 29px !important;
}

/* Popularne */
.popular-tracks {
  gap: 8px !important;
}

.popular-track {
  grid-template-columns: 30px 46px minmax(0, 1fr) !important;
  gap: 8px !important;
  padding: 8px !important;
}

.popular-track img {
  width: 46px !important;
  height: 46px !important;
}

.popular-track .popular-rank {
  font-size: 18px !important;
}

/* Wsparcie i sociale */
.support-box {
  grid-template-columns: 1fr !important;
  gap: 16px !important;
  padding: 17px !important;
  border-radius: 18px !important;
}

.support-box p {
  margin: 10px 0;
  font-size: 13px;
  line-height: 1.55;
}

.support-buttons {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 8px !important;
}

.support-buttons a {
  width: 100%;
  padding: 11px;
  font-size: 11px;
}

.support-emblem {
  min-height: 145px !important;
}

.support-emblem div {
  font-size: 45px !important;
}

.support-emblem strong {
  font-size: 24px !important;
  letter-spacing: 5px !important;
}

.social-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 9px !important;
}

.social-grid a {
  min-width: 0;
  gap: 9px !important;
  padding: 11px !important;
  border-radius: 13px !important;
}

.social-icon-svg,
.social-grid i {
  flex: 0 0 36px;
  width: 36px !important;
  height: 36px !important;
  border-radius: 10px !important;
}

.social-grid a > div {
  min-width: 0;
}

.social-grid strong,
.social-grid span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.social-grid strong {
  font-size: 11px;
}

.social-grid span {
  font-size: 8px !important;
}

/* Użytkownicy online */
.online-community {
  margin: 10px var(--mobile-pad) 28px !important;
  padding: 14px !important;
  border-radius: 16px !important;
}

.online-community-head {
  gap: 8px;
}

.online-community-head h2 {
  font-size: 18px !important;
}

.online-users-list {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.online-users-list::-webkit-scrollbar {
  display: none;
}

.online-user-card {
  min-width: 165px !important;
}

footer {
  padding: 24px var(--mobile-pad) !important;
  gap: 5px !important;
  text-align: center;
  font-size: 11px;
}

/* Dolny odtwarzacz */
.player {
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: calc(var(--mobile-player-height) + env(safe-area-inset-bottom, 0px)) !important;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  grid-template-rows: 50px 38px !important;
  gap: 4px 8px !important;
}

.player-track {
  min-width: 0;
  gap: 8px !important;
}

.player-track img {
  flex: 0 0 42px;
  width: 42px !important;
  height: 42px !important;
  border-radius: 9px !important;
}

.player-track > div {
  min-width: 0;
}

.player-track strong,
.player-track span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.player-track strong {
  font-size: 12px;
}

.player-track span {
  font-size: 9px !important;
}

.player-center {
  display: contents !important;
}

.controls {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  gap: 5px !important;
}

.controls button {
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 15px !important;
}

.controls .play {
  width: 38px !important;
  height: 38px !important;
}

.progress {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  grid-template-columns: 30px minmax(0, 1fr) 30px !important;
  gap: 6px !important;
}

.volume {
  display: none !important;
}

.toast {
  left: 12px !important;
  right: 12px !important;
  bottom: calc(var(--mobile-player-height) + 14px) !important;
  text-align: center;
}

/* Panele konta, czatu i modale */
.community-panel,
.chat-drawer {
  width: min(100%, 390px) !important;
  max-width: 100% !important;
}

.chat-drawer {
  height: 100dvh !important;
  max-height: 100dvh !important;
}

.chat-messages {
  overscroll-behavior: contain;
}

.auth-overlay,
.profile-overlay,
.public-profile-overlay,
.notifications-overlay,
.download-overlay {
  padding: 0 !important;
  align-items: stretch !important;
}

.auth-modal,
.profile-modal,
.public-profile-modal,
.notifications-modal,
.download-modal {
  width: 100% !important;
  max-width: none !important;
  max-height: 100dvh !important;
  min-height: 100dvh;
  margin: 0 !important;
  border-radius: 0 !important;
  overflow-y: auto !important;
}

.profile-modal,
.notifications-modal,
.download-modal,
.auth-modal {
  padding: 18px !important;
  padding-top: max(18px, env(safe-area-inset-top, 0px)) !important;
  padding-bottom: max(22px, env(safe-area-inset-bottom, 0px)) !important;
}

.modal-close {
  position: sticky !important;
  top: 8px !important;
  margin-left: auto;
  z-index: 20;
}

.profile-banner-edit {
  height: 112px !important;
  margin: -18px -18px 15px !important;
  border-radius: 0 0 15px 15px !important;
}

.profile-hero-edit {
  margin-top: -43px !important;
}

.profile-form input,
.profile-form textarea,
.profile-form select,
.profile-comment-form textarea {
  font-size: 16px !important;
}

.profile-form > button[type="submit"] {
  position: sticky;
  bottom: 8px;
  z-index: 10;
}

.public-profile-page {
  max-height: 100dvh !important;
}

.public-profile-banner {
  height: 120px !important;
}

.public-profile-body {
  padding: 0 13px 24px !important;
}

.public-profile-headline {
  grid-template-columns: 72px minmax(0, 1fr) !important;
  gap: 10px !important;
  align-items: end !important;
}

.public-profile-avatar {
  width: 72px !important;
  height: 72px !important;
  margin-top: -36px !important;
  border-width: 4px !important;
}

.public-profile-title {
  min-width: 0;
}

.public-profile-title h2 {
  font-size: 19px !important;
  overflow-wrap: anywhere;
}

.public-profile-actions {
  grid-column: 1 / -1 !important;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  gap: 6px !important;
  padding-bottom: 0 !important;
}

.public-profile-actions button {
  min-width: 0;
  padding: 9px 4px !important;
  font-size: 9px !important;
}

.public-profile-bio {
  margin: 12px 0 !important;
  padding: 11px !important;
  font-size: 12px;
}

.social-profile-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
}

.social-profile-stats > div,
.social-profile-stats > button {
  min-width: 0;
  padding: 9px 5px !important;
}

.social-profile-stats strong {
  font-size: 13px !important;
}

.social-profile-stats span {
  font-size: 8px !important;
  overflow-wrap: anywhere;
}

.pinned-track-card {
  align-items: stretch !important;
  flex-direction: column !important;
  padding: 12px !important;
}

.profile-tabs {
  gap: 6px !important;
  margin: 13px -2px 9px !important;
  padding-bottom: 3px;
}

.profile-tabs button {
  padding: 9px 10px !important;
  font-size: 10px;
}

.public-favorites-grid,
.profile-people-list {
  grid-template-columns: 1fr !important;
}

.public-favorites-grid article {
  grid-template-columns: 48px minmax(0, 1fr) 36px !important;
}

.public-favorites-grid img {
  width: 48px !important;
  height: 48px !important;
}

.profile-comment {
  grid-template-columns: 36px minmax(0, 1fr) !important;
}

.profile-comment > img {
  width: 36px !important;
  height: 36px !important;
}

.notifications-list {
  max-height: none !important;
}

.download-support-links {
  grid-template-columns: 1fr !important;
}

/* Bardzo wąskie ekrany */
@media (max-width: 360px) {
  :root {
    --mobile-pad: 9px;
  }

  .banner-actions > * {
    font-size: 9px;
  }

  .track-actions .action-label {
    display: none !important;
  }

  .track-actions {
    grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr) !important;
  }

  .public-profile-actions {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 330px) {
  #tracksGrid.tracks-grid,
  .tracks-grid,
  .social-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ===== V3.4.8: płynny equalizer mobilny bez Web Audio API =====
   Na telefonach słupki animują się wyłącznie podczas odtwarzania.
   Nie podłączamy analizatora audio, dzięki czemu nie wraca zrywanie początku utworu. */
@media screen and (max-width: 760px) {
  .big-equalizer.playing b {
    transform-origin: center bottom;
    animation: flimbo-mobile-eq 0.72s ease-in-out infinite alternate !important;
    will-change: transform;
  }

  .big-equalizer.playing b:nth-child(2n) { animation-duration: 0.58s !important; }
  .big-equalizer.playing b:nth-child(3n) { animation-duration: 0.86s !important; }
  .big-equalizer.playing b:nth-child(4n) { animation-duration: 0.66s !important; }
  .big-equalizer.playing b:nth-child(5n) { animation-duration: 0.94s !important; }
  .big-equalizer.playing b:nth-child(6n) { animation-delay: -0.31s !important; }
  .big-equalizer.playing b:nth-child(7n) { animation-delay: -0.52s !important; }

  .big-equalizer:not(.playing) b {
    animation: none !important;
    transform: scaleY(1);
  }
}

@keyframes flimbo-mobile-eq {
  0%   { transform: scaleY(0.22); }
  35%  { transform: scaleY(0.75); }
  70%  { transform: scaleY(0.42); }
  100% { transform: scaleY(1); }
}

@media (prefers-reduced-motion: reduce) and (max-width: 760px) {
  .big-equalizer.playing b {
    animation-duration: 1.25s !important;
  }
}


/* ===== FLIMBO MUSIC v4.0 FINAL — stabilizacja mobile ===== */
@media (max-width: 900px){
  html,body{max-width:100%;overflow-x:hidden}
  img,video,canvas,svg{max-width:100%}
  button,a,input,select,textarea{min-height:44px}
  .track-card,.profile-modal,.public-profile-modal,.notifications-modal{min-width:0;max-width:100%}
  .track-row h3,.public-profile-title h2,.notification-item strong{overflow-wrap:anywhere}
  .track-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
  .support-buttons,.public-profile-actions{display:grid;grid-template-columns:1fr;width:100%}
  .profile-comment-form textarea{width:100%;box-sizing:border-box}
}
@media (max-width: 420px){
  .track-actions{grid-template-columns:1fr}
  .track-stats{flex-wrap:wrap}
}
