/* ============================================================
   LOBBY NO TELEFONE — "KANDY MAPS"  (TESTE, ver lobby-mobile.js)
   ============================================================
   Tudo aqui vale só em tela estreita. Fora dela a camada inteira não existe na tela, e o
   lobby é o mapa aberto de sempre. */
.lm { display: none; }

@media (max-width: 760px) {
  .app-page[data-page="lobby"] {
    --lm-bar: 40px;      /* barra do app */
    --lm-sheet: 132px;   /* gaveta fechada */
    --lm-bot: 84px;      /* faixa de avisos, fixa no rodapé da tela */
    background: #0b0b0e;
  }
  body.no-ticker .app-page[data-page="lobby"] { --lm-bot: 0px; }

  .lm { display: block; }

  /* O mapa ocupa só o MEIO: termina onde a gaveta começa. Como o palco se dimensiona
     pela altura da janela (cqh), encolher a janela encolhe o mapa junto — nenhum prédio
     fica escondido atrás da gaveta. */
  .app-page[data-page="lobby"] .lobby-view,
  .app-page[data-page="lobby"] .lobby-frame {
    top: var(--lm-bar);
    bottom: calc(var(--lm-sheet) + var(--lm-bot));
  }
  /* O título e a dica de arrastar eram do mapa aberto; aqui a barra do app diz onde se
     está e a gaveta diz o que fazer. */
  .lobby-title { display: none; }
  .lobby-frame { background: radial-gradient(130% 100% at 50% 45%, transparent 60%, rgba(8,8,11,0.5) 100%); }

  /* ---- barra do app ---- */
  .lm-bar {
    position: absolute; top: 0; left: 0; right: 0; height: var(--lm-bar); z-index: 6;
    display: flex; align-items: center; gap: 8px; padding: 0 14px;
    background: #0b0b0e; border-bottom: 1px solid rgba(255,255,255,0.08);
    color: var(--accent);
  }
  .lm-bar svg { width: 17px; height: 17px; flex: 0 0 auto; }
  .lm-bar b {
    font-family: var(--font-display); font-weight: 800; font-style: italic;
    font-size: 13px; letter-spacing: 1.6px; color: var(--text);
  }
  .lm-live {
    margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--font-ui); font-weight: 700; font-size: 9.5px; letter-spacing: 1.6px;
    color: var(--text-dim);
  }
  .lm-live i {
    width: 7px; height: 7px; border-radius: 50%; background: var(--success);
    box-shadow: 0 0 8px var(--success); animation: pulse-dot 1.6s infinite;
  }

  /* ---- gaveta de destinos ----
     Fechada tem a altura exata de --lm-sheet (é ela que o mapa desconta). Aberta cresce
     por cima do mapa até quase a barra do app. */
  .lm-sheet {
    position: absolute; left: 0; right: 0; bottom: var(--lm-bot); z-index: 7;
    height: var(--lm-sheet); max-height: calc(100% - var(--lm-bar) - var(--lm-bot) - 12px);
    display: flex; flex-direction: column;
    background: #121216; border-top: 1px solid rgba(255,255,255,0.12);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -14px 34px rgba(0,0,0,0.55);
    transition: height 320ms var(--ease-smooth);
    overflow: hidden;
  }
  .lm-sheet.is-open { height: calc(100% - var(--lm-bar) - var(--lm-bot) - 12px); }

  .lm-head {
    position: relative; flex: 0 0 auto;
    display: flex; align-items: center; gap: 11px; width: 100%;
    padding: 18px 16px 10px; cursor: pointer; text-align: left;
    background: none; border: 0; color: var(--text);
    -webkit-tap-highlight-color: transparent;
  }
  .lm-grab {
    position: absolute; top: 7px; left: 50%; width: 38px; height: 4px; margin-left: -19px;
    border-radius: 99px; background: rgba(255,255,255,0.22);
  }
  .lm-face {
    width: 38px; height: 38px; flex: 0 0 auto; border-radius: 50%;
    object-fit: cover; object-position: 50% 18%;
    border: 2px solid var(--accent); background: #e8315b;
  }
  .lm-q { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; line-height: 1.25; }
  .lm-q b { font-family: var(--font-display); font-weight: 800; font-style: italic; font-size: 14.5px; letter-spacing: 0.6px; }
  .lm-q small { font-size: 11.5px; color: var(--text-dim); }
  .lm-chev { width: 20px; height: 20px; flex: 0 0 auto; color: var(--text-dim); transition: transform 320ms var(--ease-smooth); }
  .lm-sheet.is-open .lm-chev { transform: rotate(180deg); }

  /* chips: a fileira de atalhos da gaveta fechada */
  .lm-chips {
    flex: 0 0 auto; display: flex; gap: 8px; padding: 2px 16px 14px;
    overflow-x: auto; scrollbar-width: none; overscroll-behavior: contain;
  }
  .lm-chips::-webkit-scrollbar { display: none; }
  .lm-chip {
    position: relative; flex: 0 0 auto;
    display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px 0 11px;
    border-radius: 99px; cursor: pointer; white-space: nowrap;
    font-family: var(--font-ui); font-weight: 700; font-size: 12px; letter-spacing: 0.5px;
    color: var(--text); background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.13);
    -webkit-tap-highlight-color: transparent;
  }
  .lm-chip:active { background: rgba(233,161,59,0.2); border-color: var(--accent); }
  .lm-chip .lm-ico { width: 17px; height: 17px; color: var(--accent); }
  .lm-chip.is-locked { color: var(--text-dim); }
  .lm-chip.is-locked .lm-ico { color: var(--text-dim); }
  .lm-dot {
    position: absolute; top: 5px; right: 7px; width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 0 8px var(--accent);
  }
  .lm-sheet.is-open .lm-chips, .lm-sheet.has-dest .lm-chips { display: none; }

  /* lista: a gaveta aberta */
  .lm-list {
    display: none; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    padding: 2px 10px 14px;
  }
  .lm-sheet.is-open .lm-list { display: block; }
  .lm-row {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 11px 8px; cursor: pointer; text-align: left;
    background: none; border: 0; border-bottom: 1px solid rgba(255,255,255,0.06);
    color: var(--text); -webkit-tap-highlight-color: transparent;
  }
  .lm-row:active { background: rgba(255,255,255,0.05); }
  .lm-row-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; flex: 0 0 auto; border-radius: 12px;
    color: var(--accent); background: rgba(233,161,59,0.10); border: 1px solid rgba(233,161,59,0.28);
  }
  .lm-row-ico .lm-ico { width: 21px; height: 21px; }
  .lm-row-txt { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; line-height: 1.3; }
  .lm-row-txt b {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-family: var(--font-display); font-weight: 800; font-style: italic; font-size: 13.5px; letter-spacing: 0.8px;
  }
  .lm-row-txt small { font-size: 11px; letter-spacing: 0.6px; color: var(--text-dim); }
  .lm-row-go { width: 18px; height: 18px; flex: 0 0 auto; color: var(--text-dim); }
  .lm-tag {
    font-family: var(--font-ui); font-style: normal; font-weight: 800; font-size: 8.5px; letter-spacing: 1px;
    padding: 2px 6px; border-radius: 4px; color: #0b0b0e; background: var(--accent);
  }
  .lm-tag.is-lock { color: var(--text-dim); background: rgba(255,255,255,0.10); }
  .lm-row.is-locked .lm-row-ico {
    color: var(--text-dim); background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.12);
  }

  /* destino escolhido: troca os chips pelo cartão, na mesma altura da gaveta fechada */
  .lm-dest { display: none; }
  .lm-sheet.has-dest .lm-head { display: none; }
  .lm-sheet.has-dest .lm-dest {
    display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px 12px;
    padding: 16px 16px 14px; animation: lmDestIn 300ms var(--ease-smooth) both;
  }
  @keyframes lmDestIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  .lm-clear {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; padding: 0; cursor: pointer; border-radius: 50%;
    color: var(--text-dim); background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  }
  .lm-clear svg { width: 15px; height: 15px; }
  .lm-go {
    grid-column: 1 / -1;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 46px; border-radius: 12px; cursor: pointer; text-decoration: none;
    font-family: var(--font-display); font-weight: 800; font-style: italic; font-size: 15px; letter-spacing: 2px;
    color: #0b0b0e; background: linear-gradient(100deg, var(--accent-strong), var(--accent) 45%, var(--accent-soft));
    border: 1px solid var(--accent-soft);
    box-shadow: 0 0 22px var(--accent-glow);
    -webkit-tap-highlight-color: transparent;
  }
  .lm-go svg { width: 18px; height: 18px; }
  .lm-go:active { transform: scale(0.98); filter: brightness(1.08); }
  .lm-go.is-buy { font-size: 13px; letter-spacing: 1.4px; }

  /* Durante o passeio da Kandy a caixa de diálogo é dela: a gaveta sai de cena. */
  body.tour-on .lm-sheet { opacity: 0; pointer-events: none; }
}

@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  .lm-sheet, .lm-chev { transition: none; }
  .lm-sheet.has-dest .lm-dest, .lm-live i { animation: none; }
}
