/* App TipTop : fil vertical de vidéos (lecteur officiel TikTok), proposition d'une vidéo */

.app__icon--tiptop { --icon: #0a0a0c; overflow: hidden; }
.app__icon--tiptop img { display: block; width: 100%; height: 100%; border-radius: inherit; }

/* plein écran noir : la fenêtre de l'app n'a plus de marges ni de défilement propre */
.phone__screen[data-app="tiptop"] .sbar,
.phone__screen[data-app="tiptop"] .appwin { background: #000; }
.phone__screen[data-app="tiptop"] .screen { padding: 0; overflow: hidden; }
.view.tiptop:not([hidden]) { position: relative; display: block; height: 100%; color: #fff; background: #000; }

/* barre du haut, posée sur la vidéo */
.tt-top {
  position: absolute; z-index: 3; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px 18px;
  background: linear-gradient(rgba(0, 0, 0, 0.7), transparent);
  pointer-events: none;
}
.tt-top h2 { margin: 0; font-family: var(--head); font-size: 1.375rem; font-weight: 700; letter-spacing: 0.01em; }
.tt-top button { pointer-events: auto; }
.tt-propose-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px 7px 10px; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, 0.16); color: #fff;
  font: inherit; font-size: 0.8125rem; font-weight: 700; cursor: pointer;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: background-color 0.2s, transform 0.15s;
}
.tt-propose-btn:hover { background: rgba(255, 255, 255, 0.26); }
.tt-propose-btn:active { transform: scale(0.96); }
.tt-propose-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }

/* fil : une vidéo par écran, défilement vertical aimanté */
.tt-feed {
  position: absolute; inset: 0;
  overflow-y: auto; overscroll-behavior: contain;
  scroll-snap-type: y mandatory; scrollbar-width: none;
}
.tt-feed::-webkit-scrollbar { display: none; }
.tt-slide { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; background: #000; }
.tt-player, .tt-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tt-player { padding: 52px 0 50px; } /* sous la barre du haut ; en bas, la bande des infos de la publication */
.tt-player iframe { position: static; display: block; background: #000; }

/* chargement d'une vidéo, erreurs */
.tt-wait, .tt-error, .tt-state {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 24px 28px; text-align: center; color: rgba(255, 255, 255, 0.72); font-size: 0.875rem; line-height: 1.45; pointer-events: none;
}
.tt-wait[hidden], .tt-error[hidden] { display: none; }
.tt-error, .tt-state { pointer-events: auto; background: #000; }
.tt-error p, .tt-state p { margin: 0; max-width: 260px; }
.tt-state__title { color: #fff; font-family: var(--head); font-size: 1.125rem; font-weight: 700; }
.tt-spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.18); border-top-color: #ff4f7b; animation: tt-spin 0.8s linear infinite; }
@keyframes tt-spin { to { transform: rotate(360deg); } }

/* infos de la publication et boutons sur le côté */
/* bande sous la vidéo : le lecteur affiche déjà pseudo et description en haut, on ne les superpose pas */
.tt-info { position: absolute; z-index: 2; left: 14px; right: 64px; bottom: 18px; display: flex; align-items: baseline; gap: 8px; min-width: 0; pointer-events: none; }
.tt-author { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; font-size: 0.875rem; }
.tt-date { flex: none; margin: 0; color: rgba(255, 255, 255, 0.6); font-size: 0.75rem; font-weight: 600; }
.tt-side { position: absolute; z-index: 2; right: 8px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 10px; }
.tt-btn {
  display: grid; place-items: center; gap: 2px; width: 46px; min-height: 46px; padding: 6px 0;
  border: 0; border-radius: 14px; background: rgba(0, 0, 0, 0.42); color: #fff; text-decoration: none;
  font: inherit; font-size: 0.625rem; font-weight: 700; cursor: pointer;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background-color 0.2s, transform 0.15s;
}
.tt-btn:hover { background: rgba(0, 0, 0, 0.62); }
.tt-btn:active { transform: scale(0.93); }
.tt-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tt-btn--nav { min-height: 38px; border-radius: 50%; width: 38px; justify-self: center; margin: 0 4px; }
.tt-slide:first-child .tt-btn--nav[data-tt-step="-1"], .tt-slide:last-child .tt-btn--nav[data-tt-step="1"] { visibility: hidden; }
/* écran tactile : on passe d'une vidéo à l'autre en glissant, les flèches chevaucheraient les boutons du lecteur TikTok */
@media (hover: none) and (pointer: coarse) { .tt-btn--nav { display: none; } }
.tt-muted { position: absolute; z-index: 2; left: 14px; right: 64px; bottom: 56px; margin: 0; padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.6); font-size: 0.75rem; pointer-events: none; }

.tt-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border: 0; border-radius: 999px;
  background: linear-gradient(135deg, #ff4f7b, #a52fd0); color: #fff; text-decoration: none;
  font: inherit; font-size: 0.9375rem; font-weight: 800; cursor: pointer; pointer-events: auto;
  transition: filter 0.2s, transform 0.15s;
}
.tt-cta:hover { filter: brightness(1.08); }
.tt-cta:active { transform: scale(0.97); }
.tt-cta:disabled { opacity: 0.6; cursor: default; }
.tt-cta--full { width: 100%; }

/* feuille « Proposer une vidéo » */
.tt-sheet { position: absolute; z-index: 5; inset: 0; display: flex; align-items: flex-end; background: rgba(0, 0, 0, 0.55); animation: tt-fade 0.2s ease-out; }
.tt-sheet[hidden] { display: none; }
.tt-sheet__box {
  width: 100%; display: grid; gap: 12px; padding: 18px 18px 34px;
  border-radius: 22px 22px 0 0; background: var(--panel, #1c1e22); color: var(--text, #ececee);
  box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.5); animation: tt-up 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.tt-sheet__head { display: flex; align-items: center; justify-content: space-between; }
.tt-sheet__head h3 { margin: 0; font-family: var(--head); font-size: 1.125rem; }
.tt-close { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--panel-2, #2a2c31); color: var(--text, #fff); font-size: 1.25rem; cursor: pointer; }
.tt-sheet__text { margin: 0; color: var(--muted, #9a9ca3); font-size: 0.8125rem; line-height: 1.45; }
.tt-field { display: grid; gap: 6px; font-size: 0.8125rem; font-weight: 700; }
.tt-field .input { width: 100%; font-size: 0.9375rem; }
.tt-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.tt-msg { min-height: 1.2em; margin: 0; font-size: 0.8125rem; line-height: 1.4; color: var(--muted, #9a9ca3); }
.tt-msg--ok { color: #34d399; }
.tt-msg--error { color: #ff6b62; }
@keyframes tt-fade { from { opacity: 0; } }
@keyframes tt-up { from { transform: translateY(40px); opacity: 0.4; } }
@media (prefers-reduced-motion: reduce) {
  .tt-sheet, .tt-sheet__box { animation: none; }
  .tt-feed { scroll-behavior: auto; }
}

/* barre de progression de la vidéo, compteur, son coupé, indication, message, carte de fin */
.tt-progress { position: absolute; z-index: 2; left: 0; right: 0; bottom: 46px; height: 3px; background: rgba(255, 255, 255, 0.14); pointer-events: none; }
.tt-progress i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #ff4f7b, #c2328f); transition: width 0.25s linear; }
.tt-count { flex: none; margin: 0 0 0 auto; color: rgba(255, 255, 255, 0.5); font-size: 0.6875rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tt-btn .tt-son-off { display: none; }
.tt-btn.is-muet .tt-son-on { display: none; }
.tt-btn.is-muet .tt-son-off { display: inline; }
.tt-btn.is-muet { color: #ff8fab; }
.tt-hint {
  position: absolute; z-index: 3; left: 50%; bottom: 96px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 0;
  padding: 8px 14px; border-radius: 14px; background: rgba(0, 0, 0, 0.55);
  font-size: 0.75rem; font-weight: 700; pointer-events: none;
  animation: tt-hint 1.4s ease-in-out 3 both;
}
.tt-hint svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@keyframes tt-hint { 0% { opacity: 0; transform: translate(-50%, 10px); } 30%, 70% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -10px); } }
.tt-toast { position: absolute; z-index: 6; left: 50%; bottom: 70px; transform: translateX(-50%); margin: 0; padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.92); color: #111; font-size: 0.8125rem; font-weight: 700; white-space: nowrap; animation: tt-fade 0.2s ease-out; }
.tt-end .tt-state { background: radial-gradient(circle at 50% 40%, rgba(194, 50, 143, 0.25), #000 70%); }
@media (prefers-reduced-motion: reduce) { .tt-hint { animation: none; } }
