/* ===========================================================================
   PHONE FIXES, plus the "install me" nag. Loaded last.
   =========================================================================== */

/* ------------------------------------------------------------------- chat */

/* One time per run of messages, under the last one, not under every bubble. */
.msg:has(+ .msg:not(.is-first)) .msg-meta { min-height: 0; margin: 0; }
.msg:has(+ .msg:not(.is-first)) .msg-meta time { display: none; }
.msg:has(+ .msg:not(.is-first)) .msg-take { display: none; }
.msg:has(+ .msg:not(.is-first)):hover .msg-take { display: inline; }
.msg:has(+ .msg:not(.is-first)) { margin-bottom: -0.15rem; }

/* ------------------------------------------------------------ blank posters */

.poster-blank b {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  /* ---- header: the travelling dot ran over the clocks, so it goes. */
  .top { grid-template-columns: auto minmax(0, 1fr) auto; }
  .brand-cat { height: 26px; }
  .horizon { gap: 0.3rem; justify-content: center; }
  .tether { display: none; }
  .place { flex: 1 1 0; min-width: 0; justify-content: center; padding: 0.2rem 0.25rem; gap: 0.35rem; }
  .place-text { min-width: 0; }
  .place-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.6rem; }
  .place-clock { font-size: 1.15rem; }
  .place-flag .flag { width: 20px; height: 14px; }
  .top-actions { gap: 0.1rem; }
  .status { padding: 0.35rem; }

  /* ---- cinema: the picker was squeezed into a 16:9 box and cut off. */
  .stage:has(> .stage-empty:not([hidden])) { aspect-ratio: auto; min-height: 0; max-height: none; }
  .stage > .stage-empty:not([hidden]) { position: relative; inset: auto; padding: 1.1rem 1rem 1.2rem; overflow: visible; }
  .launch { gap: 0.4rem; }
  .launch-cat { width: 64px; }
  .launch-title { font-size: 1.45rem; margin: 0 0 0.3rem; }
  .launch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; }
  .launch-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.55rem;
    max-width: none;
    min-height: 48px;
    padding: 0.55rem 0.75rem;
    text-align: left;
  }
  .launch-btn:last-child:nth-child(odd) { grid-column: 1 / -1; justify-content: center; }
  .launch-btn span { font-size: 0.95rem; line-height: 1.1; }
  .launch-btn .ico { flex: none; }

  .rail { max-height: 62dvh; min-height: 300px; border-radius: var(--wob-sm); }

  /* ---- films */
  .films { gap: 0.85rem; }
  .films-head { align-items: center; }
  .fa-input { font-size: 1rem; padding: 0.7rem 0.9rem; }
  .films-tab { font-size: 1.2rem; padding: 0.35rem 0.7rem 0.55rem; }
  .fa-results { max-height: 60dvh; }

  .dia-entry { grid-template-columns: 2.1rem 64px minmax(0, 1fr); gap: 0.7rem; padding: 0.8rem 0.2rem; }
  .dia-date b { font-size: 1.6rem; }
  .dia-title b { font-size: 1.25rem; }
  .dia-reviews { grid-template-columns: minmax(0, 1fr); gap: 0.45rem; }
  .dia-review { padding: 0.45rem 0.6rem 0.5rem; }
  .dr-text { font-size: 1.05rem; }
  .dr-head { flex-wrap: nowrap; gap: 0.4rem; }
  .dr-name { flex: none; }

  .stat-tile { padding: 0.65rem 0.8rem; }
  .stat-tile b { font-size: 1.9rem; }
  .histo { height: 120px; gap: 4px; }

  /* film page: small poster beside the title, everything else full width */
  .fp { grid-template-columns: 104px minmax(0, 1fr); column-gap: 0.9rem; row-gap: 0.4rem; padding: 1rem; }
  .fp-info { display: contents; }
  .fp-poster { width: 100%; grid-row: 1 / span 4; justify-self: stretch; transform: rotate(-2deg); }
  .fp-info > * { grid-column: 1 / -1; }
  .fp-info > .fp-facts, .fp-info > h2, .fp-info > .fp-dir, .fp-info > .fp-genres { grid-column: 2; }
  .fp-info > .fp-facts { align-self: end; }
  .fp-info h2 { font-size: 1.55rem; padding-right: 1.6rem; }
  .fp-dir, .fp-genres { font-size: 0.85rem; }
  .fp-actions .btn { flex: 1 1 auto; justify-content: center; }
  .fp-rating { grid-template-columns: 4rem 1fr; }
}

/* =============================================================== THE NAG */

.nag {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgb(8 10 14 / 0.82);
  backdrop-filter: blur(4px);
  animation: nag-in 0.25s ease-out both;
}
@keyframes nag-in { from { opacity: 0; } }
.nag-card {
  position: relative;
  width: min(380px, 100%);
  display: grid;
  justify-items: center;
  gap: 0.7rem;
  padding: 1.6rem 1.3rem 1.2rem;
  text-align: center;
  background: var(--print);
  color: var(--print-ink);
  border: 3px solid var(--print-ink);
  border-radius: 18px 26px 16px 24px / 24px 16px 26px 18px;
  box-shadow: 6px 8px 0 rgb(0 0 0 / 0.45);
  animation: nag-shake 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) 0.2s both;
}
@keyframes nag-shake {
  0% { transform: scale(0.6) rotate(-8deg); opacity: 0; }
  40% { transform: scale(1.08) rotate(3deg); opacity: 1; }
  55% { transform: rotate(-3deg); }
  70% { transform: rotate(2deg); }
  85% { transform: rotate(-1deg); }
  100% { transform: rotate(-1.5deg); }
}
.nag-cat { width: 120px; margin-top: -4.2rem; filter: drop-shadow(2px 5px 4px rgb(0 0 0 / 0.4)); animation: nag-wobble 1.4s ease-in-out infinite; }
@keyframes nag-wobble { 50% { transform: rotate(-7deg) translateY(-3px); } }
.nag-warn {
  margin: 0;
  padding: 0.15rem 0.6rem;
  background: #e0473d;
  color: #fff;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  transform: rotate(-2deg);
}
.nag-shout { margin: 0; font-family: var(--display); font-size: 1.45rem; font-weight: 700; line-height: 1.12; text-transform: uppercase; }
.nag-bug {
  margin: 0;
  font-family: var(--display);
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1;
  color: #e0473d;
  transform: rotate(-4deg);
  animation: nag-pulse 0.9s ease-in-out infinite;
}
@keyframes nag-pulse { 50% { transform: rotate(-4deg) scale(1.08); } }
.nag-how { margin: 0; font-size: 0.92rem; line-height: 1.45; }
.nag-how b { white-space: nowrap; }
.nag-go {
  width: 100%;
  min-height: 52px;
  border: 3px solid var(--print-ink);
  border-radius: 14px 18px 12px 16px;
  background: #f2ad6b;
  color: #2a1f14;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  box-shadow: 3px 4px 0 var(--print-ink);
  cursor: pointer;
}
.nag-go:active { transform: translate(2px, 3px); box-shadow: 1px 1px 0 var(--print-ink); }
.nag-later {
  border: 0;
  background: none;
  color: color-mix(in srgb, var(--print-ink) 60%, transparent);
  font-size: 0.78rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0.3rem;
}
.nag-later[disabled] { cursor: wait; text-decoration: none; }
@media (prefers-reduced-motion: reduce) {
  .nag-card, .nag-cat, .nag-bug { animation: none; }
}
