/* ============================================================
   mobile.css — landscape mobile only
   Linked after style.css in index.html; never modify style.css
   ============================================================ */

/* FABs: hidden on desktop by default */
.fab { display: none; }

/* ======================================================
   Phase 1 — Portrait warning
   ====================================================== */
#portrait-warning { display: none; }

@media screen and (orientation: portrait) and (max-width: 800px) {
  #portrait-warning {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    background: var(--color-topbar-bg);
    z-index: 9999;
    color: #fff;
    font-size: 1.1rem;
    text-align: center;
    padding: 2rem;
  }
  .app { display: none; }
}

/* ======================================================
   Phases 2–5 — Mobile landscape
   ====================================================== */
@media screen and (max-width: 900px) and (orientation: landscape) and (pointer: coarse) {

  /* --- Phase 2: Topbar simplification --- */
  .btn-reset,
  .btn-imprimir,
  .btn-import,
  .btn-export,
  #inp-importar,
  .topbar-logo { display: none !important; }

  .btn-tour { font-size: 12px; padding: 2px 6px; }

  .topbar { height: 44px; padding: 2px 8px; gap: 4px; }
  .topbar input,
  .topbar select { font-size: 12px; padding: 2px 4px; }

  /* --- Phase 3: Off-canvas sidebars --- */
  .sidebar,
  .sidebar-ritmos {
    position: fixed;
    top: 0;
    height: 100vh;
    z-index: 500;
    overflow-y: auto;
    transition: transform 0.25s ease;
  }
  .sidebar {
    left: 0;
    transform: translateX(-100%);
    width: 160px;
  }
  .sidebar-ritmos {
    right: 0;
    transform: translateX(100%);
    width: 220px;
  }
  .sidebar.open       { transform: translateX(0); }
  .sidebar-ritmos.open { transform: translateX(0); }

  /* Workarea fills full width with sidebars off-canvas */
  .workarea { flex: 1 1 0; min-width: 0; }

  /* --- Phase 3: Palette — root-note buttons --- */
  .pal-buscar { display: none; }

  .root-btn-bar {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding: 8px 6px;
  }
  .root-btn-bar button {
    min-width: 36px;
    height: 36px;
    font-size: 13px;
    font-weight: 600;
    padding: 0;
    flex-shrink: 0;
    background: none;
    border: 1px solid var(--color-divider);
    border-radius: 4px;
    cursor: pointer;
    color: inherit;
  }
  .root-btn-bar button.root-btn-active {
    background: var(--color-accent);
    color: #000;
    border-color: var(--color-accent);
  }

  #pal-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 4px;
    overflow-y: auto;
    max-height: calc(100vh - 120px);
  }
  #pal-grid .pal-chord {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    border-bottom: 1px solid var(--color-border-tertiary);
  }
  #pal-grid .pal-chord .cn { font-size: 13px; }
  #pal-grid .pal-chord .cl { font-size: 10px; }

  /* --- Phase 4: Hide lyrics --- */
  .bar-texto { display: none; }

  /* --- Custom chord builder: hidden on mobile --- */
  .acorde-custom { display: none; }

  /* --- Phase 5: FABs --- */
  .fab {
    display: flex;
    position: fixed;
    bottom: 16px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 20px;
    z-index: 600;
    background: var(--color-accent);
    color: #000;
    border: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.4);
  }
  .fab-left  { left: 12px; }
  .fab-right { right: 12px; }

  /* Top-corner FABs — z-index below sidebars (500) so they hide behind open drawers */
  .fab-top-left  { bottom: auto; top: 56px; left: 12px; background: var(--color-btn-danger); color: #fff; font-size: 18px; z-index: 400; }
  .fab-top-right { bottom: auto; top: 56px; right: 12px; background: var(--color-btn-confirm); color: #fff; font-size: 18px; z-index: 400; }

  /* --- Phase 5: Touch targets --- */
  .ci-quitar { width: 28px; height: 28px; }
  .beats-badge { min-width: 24px; font-size: 11px; }

  /* --- Phase 5: Horizontal bar scroll --- */
  .sec-acordes { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .sec-acordes .bar { flex-shrink: 0; }

}
