/* =========================================================
   AJS BLUODEON - ANDROID / SMARTPHONE MOBILE OVERRIDES
   Test version: 2026-08-15
   Desktop layout remains unchanged. These rules activate
   only on narrow/mobile screens.
========================================================= */

@media (max-width: 900px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body {
    font-size: 18px;
    line-height: 1.55;
  }

  /* Menu is no longer placed over the background on a phone. */
  header {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    padding: 12px 14px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: center !important;
    background: #0b0b0b !important;
    z-index: 1000 !important;
  }

  header .logo {
    width: 100%;
    align-items: center !important;
    text-align: center;
    margin: 0 0 10px;
  }

  header .logo h1 {
    font-size: 24px !important;
    line-height: 1.25;
    letter-spacing: 2px !important;
    text-align: center;
  }

  header .line {
    width: min(230px, 72vw) !important;
  }

  nav,
  nav ul {
    width: 100% !important;
  }

  nav ul {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 7px !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center !important;
  }

  nav li {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  nav a {
    display: block !important;
    width: 100% !important;
    min-height: 48px;
    padding: 12px 14px !important;
    border: 1px solid rgba(216, 178, 90, 0.45);
    border-radius: 8px;
    background: #151515;
    color: #fff !important;
    font-size: 18px !important;
    line-height: 1.25;
    text-align: center !important;
    touch-action: manipulation;
  }

  nav a:active {
    background: #242018;
    color: #f1d07c !important;
  }

  /* Background remains visible, but animated/large lettering is removed. */
  .hero {
    height: clamp(250px, 53vh, 440px) !important;
    min-height: 250px !important;
    background-size: cover !important;
    background-position: center center !important;
  }

  .overlay {
    background: transparent !important;
  }

  .hero-title {
    display: none !important;
    animation: none !important;
    transform: none !important;
    opacity: 0 !important;
  }

  .hero-buttons {
    padding: 20px 14px !important;
  }

  .buttons {
    width: 100%;
    gap: 10px !important;
  }

  .btn,
  button,
  input[type="submit"],
  input[type="button"] {
    min-height: 48px;
    font-size: 17px !important;
    touch-action: manipulation;
  }

  .btn {
    display: block !important;
    width: min(100%, 420px) !important;
    margin: 5px auto !important;
    padding: 13px 18px !important;
    text-align: center;
  }

  .container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .about,
  .offer {
    padding: 52px 0 !important;
  }

  .about h2,
  .offer h2,
  .player-intro h1,
  .player-section h2 {
    font-size: clamp(27px, 8vw, 36px) !important;
    line-height: 1.2 !important;
  }

  .about p,
  .player-intro p {
    font-size: 18px !important;
    line-height: 1.65 !important;
  }

  .cards {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    margin-top: 30px !important;
  }

  .card {
    padding: 24px 20px !important;
    transform: none !important;
  }

  .card h3 {
    font-size: 24px !important;
  }

  /* Category/player pages */
  .decorative-separator {
    width: 100% !important;
    margin-top: 10px !important;
    overflow: hidden;
  }

  .music-player-page {
    width: 100% !important;
    max-width: 100% !important;
    padding: 24px 10px 38px !important;
  }

  .player-intro,
  .player-section {
    width: 100% !important;
    padding: 18px 12px !important;
    margin-bottom: 16px !important;
    border-radius: 10px !important;
  }

  .player-intro {
    padding-bottom: 8px !important;
  }

  #layout {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 24px !important;
  }

  #playerColumn,
  #lyricsColumn {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: 0 1 auto !important;
  }

  #lyricsColumn {
    min-height: 0 !important;
  }

  #player {
    width: min(94vw, 440px) !important;
    max-width: 100% !important;
    margin: 0 auto !important;
  }

  #panel,
  #booklet,
  .category-title-image img,
  img {
    max-width: 100%;
    height: auto;
  }

  .category-title-image {
    width: 100% !important;
    margin-bottom: 12px !important;
  }

  #panelControls {
    touch-action: manipulation;
  }

  /* Larger touch area over the physical buttons of the gramophone panel. */
  .panelButton {
    width: 9.2% !important;
    min-width: 32px;
    min-height: 32px;
    transform: translate(-14%, -14%);
    touch-action: manipulation;
  }

  #progressContainer {
    width: 100% !important;
    max-width: 100% !important;
    gap: 7px !important;
    margin-top: 14px !important;
    font-size: 13px !important;
  }

  #progressBar {
    height: 14px !important;
  }

  #currentTime,
  #duration {
    width: 38px !important;
    flex: 0 0 38px;
  }

  #bookletWrap {
    width: 100% !important;
    margin-bottom: 14px !important;
  }

  #lyricsContainer {
    width: 100% !important;
    max-height: none !important;
    min-height: 220px !important;
    padding: 18px 15px !important;
    overflow-y: visible !important;
  }

  #lyricsContent {
    font-size: 17px !important;
    line-height: 1.65 !important;
    overflow-wrap: anywhere;
  }

  .playlist-info,
  .order-actions {
    width: 100% !important;
  }

  .order-actions {
    margin-top: 22px !important;
  }

  .order-actions .btn {
    display: block !important;
    width: 100% !important;
    max-width: 420px !important;
    margin: 9px auto !important;
  }

  /* Video player */
  .video-player-shell {
    width: 100% !important;
    max-width: 100% !important;
    padding: 7px !important;
  }

  #videoPlayer,
  video {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }

  .video-controls {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .video-controls button {
    min-height: 48px !important;
    padding: 10px 5px !important;
    font-size: 14px !important;
  }

  audio {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Forms and order pages */
  form,
  .form-container,
  .contact-form,
  .order-form {
    width: 100% !important;
    max-width: 100% !important;
  }

  input,
  select,
  textarea {
    max-width: 100% !important;
    font-size: 18px !important;
  }

  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    width: 100% !important;
    min-height: 46px;
  }

  textarea {
    min-height: 150px;
  }

  table {
    display: block;
    width: 100% !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  footer {
    padding: 28px 16px !important;
    font-size: 15px;
    line-height: 1.5;
  }
}

@media (max-width: 430px) {
  .hero {
    height: 300px !important;
  }

  nav a {
    font-size: 17px !important;
  }

  .player-intro,
  .player-section {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .video-controls {
    grid-template-columns: 1fr 1fr !important;
  }
}


/* === ANDROID BACKGROUND + PLAYER ANCHOR FIX 20260815-2 === */
@media (max-width: 900px) {
  /* Keep the original studio background visible on phones. */
  .hero {
    min-height: 430px !important;
    height: 62vh !important;
    background-image: url("Images/Background/background-unified-20260819.jpg") !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
  }

  /* No animated/page-title lettering over the background on Android. */
  .hero .hero-title,
  .hero .overlay > .hero-title {
    display: none !important;
    animation: none !important;
    transform: none !important;
  }

  /* Make anchor navigation land at the player rather than above it. */
  #playerColumn,
  #player,
  #videoPlayer,
  #katalog-muzyczny,
  #katalog-video {
    scroll-margin-top: 18px !important;
  }
}

/* The same background path when android-mobile.css is loaded from /Kategorie pages. */
@media (max-width: 900px) {
  body.category-page .hero {
    background-position: center center !important;
  }
}

/* === ANDROID GRAMOPHONE PANEL VISIBILITY FIX 20260819-2 === */
@media (max-width: 900px) {
  /* Give the gramophone a stable box before/while images are decoded. */
  #player {
    display: block !important;
    position: relative !important;
    width: min(94vw, 440px) !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    overflow: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* The physical gramophone panel must always remain the base visible layer. */
  #player > #panel {
    display: block !important;
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 1 !important;
  }

  /* Record/cover and touch controls stay above the panel, never instead of it. */
  #player > #cover {
    display: block !important;
    position: absolute !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 2 !important;
  }

  #player > #panelControls {
    display: block !important;
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 3 !important;
    pointer-events: none;
  }

  #player > #panelControls .panelButton {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto;
  }
}


/* === TESTED AUDIO PLAYER INTEGRATION 20260819-3 === */
@media (max-width: 900px) {
  /* The tested panel-01 is square (1254x1254). Do not force the old 1000x700 box. */
  #player {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    max-width: 620px !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    margin: 0 auto !important;
    overflow: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  #player > #panel {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 1 !important;
  }

  #player > #cover {
    position: absolute !important;
    width: 42% !important;
    left: 47% !important;
    top: 41% !important;
    transform: translate(-50%, -50%);
    transform-origin: center center;
    border-radius: 50%;
    z-index: 2 !important;
  }

  #player > #panelControls {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 3 !important;
    pointer-events: none;
  }

  #player > #panelControls .panelButton {
    pointer-events: auto;
  }
}


/* === ANDROID EXTRA GRAMOPHONE BUTTONS — Nutka w Prezencie pattern 20260819 === */
.android-gramophone-buttons {
  display: none;
}

@media (max-width: 900px) {
  #player {
    aspect-ratio: auto !important;
    height: auto !important;
  }

  #player > #panel {
    aspect-ratio: auto !important;
    height: auto !important;
    object-fit: contain !important;
  }

  .android-gramophone-buttons {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    width: 100%;
    max-width: 620px;
    margin: 12px auto 14px;
  }

  .android-gramophone-buttons button {
    min-width: 0;
    min-height: 42px;
    height: 42px;
    padding: 4px 2px;
    border: 1px solid #d8b25a;
    border-radius: 6px;
    background: #11131b;
    color: #f1d58a;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    text-align: center;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .android-gramophone-buttons button:active {
    transform: scale(.98);
  }
}

@media (max-width: 390px) {
  .android-gramophone-buttons { gap: 4px; }
  .android-gramophone-buttons button {
    min-height: 38px;
    height: 38px;
    font-size: 12px;
    letter-spacing: -.25px;
  }
}
