/* Phone layout: compact header, full-width tabs, 2-column cards, lighter effects. Loaded after style.css. */
.me-chip[hidden] { display: none; }
/* the glitch animation replaces the entrance one; keep the card in place once it ends */
.card.glitch { opacity: 1; transform: none; }

@media (hover: none) {
  .person:hover { transform: none; }
  .card:hover .media canvas { transform: none; }
}

@media (max-width: 640px) {
  /* blur over an animated background is the main cause of scroll jank on phones: use solid panels instead */
  .top, .tabs, .lede, .hint, .card, .panel, .xmas-in, .sheet-backdrop, .tuto-bd { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
  #bg { height: 100lvh; opacity: .7; }

  /* header */
  .top { gap: 8px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: #050505; }
  .logo { font-size: 13px; gap: 8px; margin-right: auto; }
  .logo-mark { transform: scale(.85); }
  .me-chip { padding: 5px 10px 5px 8px; font-size: 12px; max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .help-btn { width: 28px !important; height: 28px !important; font-size: 13px !important; }
  .ticker { background: rgba(5,5,5,.9); }
  .ticker-track { font-size: 10px; padding: 5px 0; }

  /* countdown + Santa */
  .xmas { margin-top: 14px; padding: 0 16px; }
  .xmas-in { background: rgba(8,8,8,.94); }
  .cd { padding: 12px 14px 10px; gap: 8px; }
  .cd-title { font-size: 10px; }
  .cd-grid { gap: 2px; justify-content: space-between; }
  .cd-u { flex: 1; }
  .cd-n { font-size: clamp(28px, 9.4vw, 40px); }
  .cd-sep { font-size: clamp(20px, 7vw, 30px); }
  .cd-l { font-size: 8px; margin-top: 5px; letter-spacing: .04em; }
  .santa-cap { font-size: 8px; }

  /* page */
  main { padding: 0 16px 96px; }
  .hero { padding: 22px 0 16px; }
  .eyebrow { font-size: 10px; }
  h1.big { font-size: clamp(42px, 12.5vw, 60px); line-height: .9; margin-top: 10px; }
  .lede { font-size: 13px; margin-top: 16px; background: rgba(8,8,8,.92); }

  /* tabs: a full-width segmented control that stays under the header */
  .tabs { top: calc(max(10px, env(safe-area-inset-top)) + 40px); width: 100%; padding: 4px; gap: 2px; margin-bottom: 20px; background: rgba(10,10,10,.96); }
  .tab { flex: 1 1 0; padding: 10px 4px; font-size: 12px; text-align: center; min-width: 0; }
  .tab .n { margin-left: 4px; font-size: 9px; }

  /* people strip */
  .people { margin: 0 -16px 6px; padding: 4px 16px 14px; gap: 8px; scroll-padding-left: 16px; }
  .person { min-width: 112px; padding: 12px; gap: 8px; }
  .person b { font-size: 21px; }
  .person .avatar { width: 34px !important; height: 34px !important; }

  /* section heads */
  .section-head { margin: 6px 0 14px; gap: 10px; }
  .section-head h2 { font-size: clamp(32px, 10vw, 44px); }
  .hint { font-size: 11.5px; background: rgba(8,8,8,.92); }

  /* cards: always two columns, compact */
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card { background: #0b0b0b; }
  .card .body { padding: 10px; gap: 6px; }
  .card h3 { font-size: 16px; line-height: 1.1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .card .note { font-size: 11px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .card .media .noimg { font-size: 60px; }
  .card .price { font-size: 10px; padding: 3px 6px; bottom: 6px; right: 6px; }
  .card .fav { font-size: 8px; }
  .card .row { gap: 5px; }
  .card .row .btn { padding: 8px 10px; font-size: 11px; }
  .btn.take { width: 100%; }
  .stamp { font-size: 14px; padding: 4px 8px; }
  .taken-line { font-size: 10.5px; }
  .empty { padding: 26px 18px !important; }
  .add-card { min-height: 0; aspect-ratio: auto; padding: 16px 10px; }
  .add-card .plus { font-size: 34px; margin-bottom: 6px; }
  .add-card span.l { font-size: 20px; }

  .hello { min-height: 0; justify-content: flex-start; padding: 26px 0 40px; }
  .toast { bottom: calc(max(18px, env(safe-area-inset-bottom)) + 66px); max-width: calc(100vw - 32px); text-align: center; font-size: 12.5px; }
  .toast:not(.on) { transform: translate(-50%, 200px); }
  .fab { right: 16px; padding: 13px 18px; }

  /* footer */
  .foot { flex-direction: column; gap: 6px; font-size: 11px; }
}

@media (max-width: 340px) {
  .grid { gap: 8px; }
  .card h3 { font-size: 14.5px; }
  .tab { font-size: 11px; }
}
