/* Swobodne ikony nagłówków w Prezenterze */
.pr-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.5rem;
  color: var(--tone);
  vertical-align: -2px;
  line-height: 0;
}
.pr-title-icon .ic { width: 1.5rem; height: 1.5rem; }
.rv-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.5rem;
  color: var(--tone);
  vertical-align: -2px;
  line-height: 0;
}
.rv-title-icon .ic { width: 1.5rem; height: 1.5rem; }
/* Prezenter: układ, którego nie wyrażają klasy wspólne z halonik.css.
   Ładowany po halonik.css; tylko tokeny (:root), bez kolorów na sztywno. */

.pr-spinner {
  display: inline-block; width: 2.25rem; height: 2.25rem;
  border: 3px solid var(--tone-light); border-top-color: var(--tone); border-radius: 50%;
  animation: pr-spin 0.9s linear infinite;
}
@keyframes pr-spin { to { transform: rotate(360deg); } }

/* ---------- Strona startowa ---------- */
.pr-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.25rem; margin-bottom: 1.5rem; }
.pr-choice { padding: 1.6rem 1.4rem; text-align: center; }
.pr-choice .subject-emoji { font-size: 2.8rem; }
.pr-choice b { font-size: 1.15rem; }
.pr-choice small { max-width: 24rem; font-size: 0.85rem; line-height: 1.45; }
.pr-choice { animation: rise 0.4s ease backwards; }
.pr-choice:nth-child(2) { animation-delay: 0.08s; }
.pr-choice .subject-emoji { animation: bob 3s ease-in-out infinite; }
.pr-choice:nth-child(2) .subject-emoji { animation-delay: 0.7s; }
.pr-stickers { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.pr-stickers .pill { font-size: 0.85rem; padding: 0.3rem 0.85rem; box-shadow: var(--shadow-sm); animation: pop 0.35s ease backwards; }
.pr-stickers .pill:nth-child(odd) { transform: rotate(-3deg); }
.pr-stickers .pill:nth-child(even) { transform: rotate(2.5deg); }
.pr-stickers .pill:nth-child(2) { animation-delay: 0.06s; }
.pr-stickers .pill:nth-child(3) { animation-delay: 0.12s; }
.pr-stickers .pill:nth-child(4) { animation-delay: 0.18s; }
.pr-stickers .pill:nth-child(5) { animation-delay: 0.24s; }
.pr-about .about-card-title { display: flex; align-items: center; }
.pr-about { margin-bottom: 2rem; }
.pr-about code { white-space: nowrap; font-size: 0.85em; background: var(--gray-100); padding: 1px 5px; border-radius: 4px; }

/* ---------- Telefon (prezenter): układ zablokowany na wysokość okna ---------- */
.pr-app { height: 100dvh; overflow: hidden; touch-action: manipulation; }
.pr-main { position: relative; flex: 1; min-height: 0; overflow: hidden auto; display: flex; padding: 0; }
/* Kolorowe plamy w tonacji za kartami. */
.pr-main::before, .pr-main::after { content: ""; position: absolute; z-index: 0; border-radius: 50%; pointer-events: none; }
.pr-main::before { width: 16rem; height: 16rem; top: -6rem; right: -5rem; background: var(--tone-light); }
.pr-main::after { width: 13rem; height: 13rem; bottom: -5rem; left: -4rem; background: var(--accent-teal-light); opacity: 0.8; }
.pr-wrap {
  width: 100%;
  /* Telefon: wąska kolumna. Szeroki ekran: rośnie z oknem do 44rem, żeby podgląd slajdu dało się ocenić. */
  max-width: min(max(28rem, 46vw), 44rem);
  margin: 0 auto; padding: 1.25rem 1rem;
  display: flex; flex-direction: column; justify-content: center; gap: 1rem;
  position: relative; z-index: 1;
}
.pr-wrap.is-presenting { height: 100%; justify-content: flex-start; padding-block: 0.75rem; gap: 0.6rem; }
.pr-card { position: relative; display: flex; flex-direction: column; gap: 0.9rem; margin: 0; padding-top: 1.7rem; animation: rise 0.35s ease backwards; }
/* Kolorowy karteluszek u góry karty, jak w kartach zadań. */
.pr-card::before, .rv-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 10px;
  background: var(--tone); border-bottom: 1.5px solid var(--ink);
  border-radius: calc(var(--radius) - 1.5px) calc(var(--radius) - 1.5px) 0 0;
}
.pr-card .hint { margin: 0; }
.pr-center { align-items: center; text-align: center; }
.pr-center-text { text-align: center; }
.pr-title { font-size: 1.4rem; margin: 0; }

.pr-waiting { position: relative; width: 3.5rem; height: 3.5rem; display: grid; place-items: center; margin: 0.5rem 0; }
.pr-waiting i {
  position: absolute; inset: 0; border: 2px solid var(--tone); border-radius: 50%;
  animation: pr-ring 2.2s ease-out infinite backwards;
}
.pr-waiting i:nth-child(2) { animation-delay: 0.75s; }
.pr-waiting i:nth-child(3) { animation-delay: 1.45s; }
@keyframes pr-ring { from { transform: scale(0.6); opacity: 0.9; } to { transform: scale(2.4); opacity: 0; } }

.pr-drop {
  animation: pr-idle 2.6s ease-in-out infinite;
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  padding: 1.75rem 1rem; text-align: center; cursor: pointer;
  background: var(--bg-subtle); border: 2px dashed var(--ink); border-radius: var(--radius);
  transition: background-color 0.12s, transform 0.1s;
}
.pr-drop:hover, .pr-drop:focus-within { animation: none; background: var(--tone-light); border-color: var(--tone); transform: translate(-1px, -1px); }
@keyframes pr-idle { 0%, 100% { border-color: var(--ink); background-color: var(--bg-subtle); } 50% { border-color: var(--tone); background-color: var(--tone-light); } }
.pr-drop > .ic { width: 2.6rem; height: 2.6rem; color: var(--tone); animation: bob 2.4s ease-in-out infinite; }
.pr-drop-text { display: flex; flex-direction: column; gap: 0.15rem; }
.pr-drop-text b { font-size: 1rem; color: var(--ink); }
.pr-drop-text small { color: var(--text-muted); font-size: 0.8rem; }
.pr-drop input[type="file"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; padding: 0; border: 0;
}
.pr-or { display: flex; align-items: center; gap: 0.75rem; color: var(--text-muted); font-size: 0.75rem; }
.pr-or::before, .pr-or::after { content: ""; flex: 1; height: 1.5px; background: var(--gray-300); }
.pr-sample { color: var(--text-muted); font-size: 0.8rem; white-space: normal; text-align: center; }

.pr-presenting { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; gap: 0.6rem; }
.pr-topbar { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.pr-status { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; font-size: 0.8rem; font-weight: 700; color: var(--ink); white-space: nowrap; }
.pr-status-inner { display: inline-flex; align-items: center; gap: 0.4rem; }
.pr-preview { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
/* Kurczy się do slajdu, żeby plakietka strony siedziała na slajdzie, a nie w rogu wysokiej ramki. */
.pr-frame { position: relative; display: inline-flex; max-width: 100%; max-height: 100%; }
.pr-slide {
  display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain;
  background: var(--bg-card);
  border: 1.5px solid var(--ink); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
}
.pr-video { width: 100%; height: 100%; }
.pr-badge { position: absolute; top: 0.5rem; right: 0.5rem; z-index: 2; background-color: var(--tone-light); }
.pr-blanked {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;
  background: var(--ink); color: var(--bg-card);
  border-radius: var(--radius-sm);
}
.pr-blanked .ic { width: 2rem; height: 2rem; }
.pr-blanked p { margin: 0; font-size: 0.8rem; opacity: 0.75; }
.pr-progress { flex-shrink: 0; height: 10px; }
.pr-progress::-webkit-progress-value { background: var(--tone); }
.pr-progress::-moz-progress-bar { background: var(--tone); }
.pr-timer { margin: 0; text-align: center; font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-mono); }
.pr-nav { display: flex; gap: 0.75rem; height: clamp(3.25rem, 12vh, 5rem); flex-shrink: 0; }
.pr-nav .btn { flex: 1; height: 100%; font-size: 1.1rem; }
.pr-nav .btn:last-child { flex: 2; }
.pr-modal-text { margin: 0; color: var(--text-body); }
.pr-modal-foot { justify-content: stretch; }
.pr-modal-foot .btn { flex: 1; }

/* ---------- Ekran (receiver): ciemna scena, jasne karty z tonowym cieniem ---------- */
body.pr-stage {
  position: relative; height: 100dvh; min-height: 0; overflow: hidden;
  align-items: center; justify-content: center;
  background: var(--ink);
}
.rv-card {
  position: relative; z-index: 20; margin: 0; width: clamp(19rem, 62vmin, 52rem);
  animation: rise 0.4s ease backwards;
  display: flex; flex-direction: column; align-items: center; gap: 0.9rem; text-align: center;
  padding: calc(clamp(1rem, 3.5vmin, 2.5rem) + 10px) clamp(1rem, 3.5vmin, 2.5rem) clamp(1rem, 3.5vmin, 2.5rem);
  box-shadow: 8px 8px 0 var(--tone);
}
.rv-brand { margin-bottom: 0.2rem; }
.rv-logo { height: clamp(32px, 6vmin, 56px); width: auto; }
.rv-brand .brand-app { display: block; font-size: clamp(0.6rem, 1.6vmin, 0.9rem); max-width: none; }
.rv-muted { margin: 0; color: var(--text-muted); font-size: clamp(0.8rem, 2.4vmin, 1.2rem); line-height: 1.4; }
.rv-url { font-family: var(--font-mono); color: var(--ink); }
.rv-qr {
  background: var(--bg-card); /* kod QR potrzebuje białej ramki wokół */
  padding: clamp(0.5rem, 2vmin, 1rem);
  border: 1.5px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.rv-qr canvas, .rv-qr img { display: block; width: clamp(140px, 26vmin, 360px) !important; height: clamp(140px, 26vmin, 360px) !important; }
/* PIN jako cztery kolorowe kafelki (każdy w swojej tonacji), nie jeden blok tekstu. */
.rv-pin { display: flex; gap: clamp(0.35rem, 1.6vmin, 0.9rem); font-size: clamp(2.2rem, 11vmin, 7rem); }
.rv-digit {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.2em; min-height: 1.35em; padding: 0.12em 0.18em;
  font-family: var(--font-mono); font-weight: 700; line-height: 1.4; color: var(--ink);
  box-sizing: border-box;
  background: var(--tone-light);
  border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  animation: pop 0.4s ease backwards;
}
.rv-card .rv-title { margin: 0; font-size: clamp(1.1rem, 4vmin, 2rem); }
.rv-countdown span { display: inline-block; animation: pop 0.45s ease; }
.rv-countdown { font-family: var(--font-mono); font-weight: 800; font-size: clamp(2.5rem, 10vmin, 5rem); line-height: 1; color: var(--tone); }
.rv-actions { display: flex; gap: 0.75rem; width: 100%; }
.rv-actions .btn { flex: 1; }
.rv-layer { position: fixed; inset: 0; width: 100vw; height: 100dvh; object-fit: contain; background: var(--ink); z-index: 10; }
.rv-blank { position: fixed; inset: 0; z-index: 40; background: var(--ink); }
.rv-watermark { position: fixed; top: 1.25rem; left: 1.25rem; z-index: 70; opacity: 0.85; pointer-events: none; background-color: var(--bg-card); }
.rv-reconnect { position: fixed; bottom: 1.25rem; left: 1.25rem; z-index: 70; background-color: var(--accent-amber-light); pointer-events: none; }
.rv-end, .rv-fs {
  position: fixed; right: 1.25rem; z-index: 70;
  opacity: 0; transform: scale(0.85); pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.12s ease;
}
.rv-end { top: 1.25rem; }
.rv-fs { bottom: 1.25rem; }
.rv-end:hover { background-color: var(--accent-red-light); }
body.pr-stage:hover .rv-end, body.pr-stage:hover .rv-fs, .rv-end:focus-visible, .rv-fs:focus-visible {
  opacity: 1; transform: none; pointer-events: auto;
}
/* Bez wskaźnika (telewizor, panel dotykowy) nie ma :hover: przyciski zostają widoczne, przygaszone. */
@media (hover: none), (pointer: coarse) {
  .rv-end, .rv-fs { opacity: 0.6; transform: none; pointer-events: auto; }
}
.rv-fs-unlock { position: fixed; bottom: 2rem; left: 0; right: 0; z-index: 80; display: flex; justify-content: center; }

/* Dryfujące kształty za kartami: kolor na ciemnej scenie i ochrona przed wypaleniem ekranu, który świeci godzinami. */
.rv-deco { position: fixed; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.rv-deco i { position: absolute; display: block; opacity: 0.9; animation: pr-drift 28s ease-in-out infinite alternate; }
.rv-deco i:nth-child(1) { width: 12vmin; height: 12vmin; left: 7%; top: 12%; border-radius: 50%; background: var(--accent-purple); }
.rv-deco i:nth-child(2) { width: 9vmin; height: 9vmin; right: 9%; top: 16%; border-radius: 14%; background: var(--accent-teal); animation-duration: 34s; }
.rv-deco i:nth-child(3) { width: 11vmin; height: 11vmin; left: 13%; bottom: 10%; background: var(--accent-pink); clip-path: polygon(50% 0, 100% 100%, 0 100%); animation-duration: 31s; }
.rv-deco i:nth-child(4) { width: 10vmin; height: 10vmin; right: 13%; bottom: 13%; border-radius: 50%; border: 1.6vmin solid var(--accent-amber); animation-duration: 37s; }
.rv-deco i:nth-child(5) { width: 5vmin; height: 5vmin; left: 44%; top: 5%; border-radius: 50%; background: var(--accent-blue); animation-duration: 25s; }
.rv-deco i:nth-child(6) { width: 8vmin; height: 8vmin; right: 27%; bottom: 4%; background: var(--accent-amber-light); clip-path: polygon(50% 0, 62% 36%, 100% 38%, 70% 60%, 80% 100%, 50% 76%, 20% 100%, 30% 60%, 0 38%, 38% 36%); animation-duration: 29s; }
.rv-deco i:nth-child(7) { width: 5vmin; height: 5vmin; left: 4%; top: 52%; border-radius: 22%; background: var(--accent-green); animation-duration: 33s; }
@keyframes pr-drift { from { transform: translate(0, 0) rotate(0deg); } to { transform: translate(2.5vmin, -3.5vmin) rotate(28deg); } }
