/* Full screens: the paywalls (V-bubliki-desktop / V-pr-bubliki) and «Удиви меня» (V-surprise), 1:1.
   Desktop: a modal over the dimmed page with the header. Phone (< 834): the whole screen, no chrome.
   Motion (V-guide-motion): standard cubic-bezier(.2,0,0,1), spring cubic-bezier(.34,1.4,.64,1);
   backdrop 240 ms, sheet 360 ms, pencil 400-600 ms; only transform and opacity move. */
:root { --std: cubic-bezier(.2, 0, 0, 1); --spring: cubic-bezier(.34, 1.4, .64, 1); }

.pw-dim { position: fixed; inset: 0; z-index: 40; background: rgba(42, 42, 40, .42); animation: sc-fade 240ms var(--std) both; }
.pw, .sp { position: fixed; z-index: 41; left: 50%; translate: -50% 0; top: clamp(24px, calc(50vh - 340px), 110px);
  max-height: calc(100vh - 48px); overflow: hidden auto; box-sizing: border-box; background: var(--cream); border-radius: 32px; }
.pw.play, .sp.play { animation: sc-sheet 360ms var(--std) both; }

.pw-close { height: 40px; width: 56px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  border-radius: 999px; border: 1.5px solid var(--rule); color: var(--ink); text-decoration: none; }
.pw-close:hover { border-color: var(--ink); color: var(--ink); }
.pw-close .ico { width: 18px; height: 18px; }

/* ------------------------------------------------ paywall, desktop */
.pw { width: min(1080px, calc(100vw - 48px)); height: 640px; display: flex; }
.pw-side { width: 400px; flex-shrink: 0; box-sizing: border-box; padding: 40px 32px; background: var(--orange-soft); display: flex; flex-direction: column;
  gap: 24px; align-items: center; justify-content: center; position: relative; }
.pw-art { position: relative; width: 336px; height: 190px; margin: 0 auto; }
.pw-art > * { position: absolute; display: block; height: auto; }
.pa-big { left: 98px; top: 12px; width: 140px; }
.pa-left { left: 18px; top: 84px; width: 84px; }
.pa-right { left: 246px; top: 100px; width: 66px; }
.pa-spark { left: 230px; top: 2px; width: 46px; height: 46px; }
.pa-dots { left: 44px; top: 26px; width: 30px; height: 30px; }
.pw-note { position: absolute; right: 36px; top: 150px; font: 400 28px/1 'Marck Script', 'Caveat', cursive; color: var(--orange); rotate: 6deg; white-space: nowrap; }
.pw-main { display: flex; flex-direction: column; gap: 28px; flex-grow: 1; padding: 40px 48px; justify-content: center; min-width: 0; }
.pw-close-row { display: flex; justify-content: flex-end; }
.pw-h { margin: 0; font: 400 56px/60px 'Dela Gothic One', 'Arial Black', sans-serif; color: var(--orange); }
.pw-lead { font-size: 22px; line-height: 28px; color: var(--graphite); max-width: 520px; }
.pw-tiles { display: flex; align-items: stretch; gap: 16px; }
.pw-tile { width: 160px; box-sizing: border-box; padding: 14px 10px 12px; border-radius: 20px; border: 1.5px solid var(--line); display: flex; flex-direction: column;
  align-items: center; gap: 10px; flex-shrink: 0; }
.pw-ticon { width: 36px; height: 36px; }
.pw-lines { position: relative; width: 100%; padding: 6px 0; }
.pw-blur { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; filter: blur(3px); }
.pw-blur span { display: block; height: 8px; border-radius: 999px; background: var(--grey); opacity: .5; }
.pw-blur .l1 { width: 86%; } .pw-blur .l2 { width: 64%; } .pw-blur .l3 { width: 74%; }
.pw-lock { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 36px; height: 36px; border-radius: 999px; background: var(--ink);
  display: flex; align-items: center; justify-content: center; }
.pw-lock svg { width: 18px; height: 18px; stroke: var(--cream); }
.pw-tlabel { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink); }
.pw-first { display: none; }
.pw-acts { display: flex; align-items: center; gap: 20px; }
.pw-want { padding: 0 26px 0 28px; }
.pw-want .ico { width: 22px; height: 22px; }
.pw-acts-note { font-size: 13px; line-height: 18px; font-weight: 600; }
.pw-not { display: none; }

/* the drawing comes together: bagels pop, the sparkle is drawn, the note is written, the locks click shut */
.pw.play .pa-big { animation: sc-pop 420ms 180ms var(--spring) both; }
.pw.play .pa-left { animation: sc-pop 420ms 260ms var(--spring) both; }
.pw.play .pa-right { animation: sc-pop 420ms 320ms var(--spring) both; }
.pw.play .pa-dots { animation: sc-pop 320ms 480ms var(--spring) both; }
.pw.play .pa-spark path, .sp.play .sp-spark path { stroke-dasharray: 90; animation: sc-draw 400ms 520ms var(--std) both; }
.pw.play .pw-note { animation: sc-write 400ms 640ms var(--std) both; }
.pw.play .pw-lock { animation: sc-lock 320ms var(--spring) both; }
.pw.play .pw-tile:nth-child(1) .pw-lock { animation-delay: 420ms; }
.pw.play .pw-tile:nth-child(2) .pw-lock { animation-delay: 500ms; }
.pw.play .pw-tile:nth-child(3) .pw-lock { animation-delay: 580ms; }

/* ------------------------------------------------ «Удиви меня», desktop */
.sp { top: 50%; translate: -50% -50%; width: 440px; display: flex; flex-direction: column; gap: 16px; padding-bottom: 32px; }
.sp-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 24px 0; }
.sp-title { font-size: 17px; line-height: 24px; font-weight: 600; }
.sp-gap { width: 56px; }
.sp-dice { position: relative; height: 80px; display: flex; justify-content: center; }
.sp-dice-i, .sp-dice-i svg { width: 80px; height: 80px; display: block; }
.sp-spark { position: absolute; left: calc(50% + 33px); top: -4px; }
.sp-spark svg { width: 44px; height: 44px; }
.sp-dots { position: absolute; left: calc(50% - 77px); top: 48px; }
.sp-dots svg { width: 30px; height: 30px; }
.sp-lead { font-size: 17px; line-height: 24px; color: var(--graphite); text-align: center; }
.sp-card { box-sizing: border-box; padding: 16px; border-radius: 24px; border: 1.5px solid var(--line); background: var(--cream); display: flex; flex-direction: column;
  gap: 10px; margin: 0 24px; }
.sp-photo { display: block; height: 150px; box-sizing: border-box; border-radius: 16px; background: var(--paper); position: relative; flex-shrink: 0; }
.sp-dish { position: absolute; right: 18px; top: 16px; height: 118px; }
.sp-dish img { height: 118px; width: auto; }
.sp-name-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.sp-name { font: 400 28px/32px 'Dela Gothic One', 'Arial Black', sans-serif; color: var(--orange); text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.sp-name:hover { color: var(--orange); }
.sp-rate { display: flex; align-items: center; gap: 8px; }
.sp-stars { display: inline-flex; gap: 2px; align-items: center; }
.sp-stars svg { width: 16px; height: 16px; }
.sp-r { font-size: 17px; line-height: 24px; font-weight: 600; }
.sp-rv, .sp-addr, .sp-meta, .sp-quote, .sp-why { font-size: 13px; line-height: 18px; color: var(--graphite); }
.sp-addr .ico { width: 16px; height: 16px; color: var(--graphite); }
.sp-meta { display: flex; align-items: baseline; gap: 8px; }
.sp-meta:empty, .sp-meta[hidden] { display: none; }
.sp-meta .bprice { font-size: 13px; line-height: 18px; }
.sp-quote { display: flex; align-items: center; gap: 8px; font-style: italic; }
.sp-quote svg { width: 16px; flex-shrink: 0; }
.sp-why { display: flex; align-items: flex-start; gap: 8px; padding: 0 24px; }
.sp-why svg { width: 16px; height: 16px; flex-shrink: 0; stroke: var(--graphite); }
.sp-why svg circle[fill] { fill: var(--graphite); }
.sp-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 0 24px; }
.sp-chip { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1.5px solid var(--rule); background: transparent; color: var(--ink); font: 400 13px/1 'Nunito Sans', sans-serif; white-space: nowrap; cursor: pointer; }
.sp-chip.on { background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 600; }
.sp-acts { display: flex; flex-direction: column; gap: 12px; padding: 16px 24px 0; }
.sp-go { width: 100%; justify-content: space-between; padding: 0 28px; }
.sp-go .ico { width: 22px; height: 22px; }
.sp-again { height: 48px; padding: 0 22px 0 24px; font-size: 17px; gap: 8px; }
.sp-again .ico { width: 20px; height: 20px; }
[hidden] { display: none !important; }

/* the roll: the dice spins 540° in 600 ms and drops with a bounce, the sparkle is drawn, the card comes up
   from below, the name runs like a slot and stops, then the rest of the card and the pencil mark arrive */
.sp.play .sp-dice-i { animation: sp-drop 600ms var(--spring) both; }
.sp.play .sp-dots { animation: sc-pop 320ms 460ms var(--spring) both; }
.sp.play .sp-card { animation: sp-rise 320ms 380ms var(--std) both; }
.sp.play .bphoto-mark path { stroke-dasharray: 700; animation: sp-mark 600ms 1100ms var(--std) both; }
.sp.play .sp-dish { animation: sc-pop 420ms 1000ms var(--spring) both; }
.sp-card.shuffling .sp-rest, .sp-card.shuffling .sp-badge { opacity: 0; }
.sp-card.shuffling .sp-name { opacity: .55; }
.sp-card.landed .sp-name { animation: sp-land 320ms var(--spring) both; }
.sp-card.landed .sp-badge { animation: sc-pop 320ms 60ms var(--spring) both; }
.sp-card.landed .sp-rest { animation: sp-row 200ms var(--std) both; }
.sp-card.landed .sp-rest:nth-child(3) { animation-delay: 60ms; }
.sp-card.landed .sp-rest:nth-child(4) { animation-delay: 110ms; }
.sp-card.landed .sp-rest:nth-child(5) { animation-delay: 160ms; }
.sp-card.landed .sp-rest:nth-child(6) { animation-delay: 210ms; }
.sp.leaving .sp-card { animation: sp-sink 200ms var(--std) both; }
.sp.leaving .sp-dice-i { animation: sp-shake 400ms var(--std) infinite; }
.sp.leaving .sp-again .ico { animation: sp-turn 600ms linear infinite; }

@keyframes sc-fade { from { opacity: 0; } }
@keyframes sc-sheet { from { opacity: 0; transform: translateY(24px) scale(.98); } }
@keyframes sc-pop { from { opacity: 0; transform: scale(.4); } }
@keyframes sc-draw { from { stroke-dashoffset: 90; } to { stroke-dashoffset: 0; } }
@keyframes sc-write { from { opacity: 0; transform: translateY(6px); } }
@keyframes sc-lock { from { opacity: 0; transform: scale(.5) rotate(-20deg); } }
@keyframes sp-drop { 0% { opacity: 0; transform: translateY(-72px) rotate(-540deg); } 30% { opacity: 1; } 100% { transform: none; } }
@keyframes sp-rise { from { opacity: 0; transform: translateY(56px); } }
@keyframes sp-sink { to { opacity: 0; transform: translateY(32px); } }
@keyframes sp-land { from { transform: scale(1.12); } }
@keyframes sp-row { from { opacity: 0; transform: translateY(6px); } }
@keyframes sp-shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }
@keyframes sp-turn { to { transform: rotate(360deg); } }
@keyframes sp-mark { from { stroke-dashoffset: 700; } to { stroke-dashoffset: 0; } }
.sp-dots, .pa-dots, .pa-big, .pa-left, .pa-right, .pw-lock, .sp-dish { transform-origin: center; }
.pw-lock { transform-box: fill-box; }

@media (prefers-reduced-motion: reduce) {
  .pw.play, .sp.play, .pw-dim, .sp.play .sp-card { animation: sc-fade 200ms var(--std) both !important; }
}

/* ------------------------------------------------ phone */
@media (max-width: 833.98px) {
  body.screen { padding-bottom: 0; }
  .pw-dim { display: none; }
  .pw, .sp { position: static; translate: none; width: auto; height: auto; max-height: none; border-radius: 0; overflow: visible; }
  .pw.play, .sp.play { animation: sc-fade 200ms var(--std) both; }

  .pw { flex-direction: column; gap: 32px; padding-bottom: 200px; }
  .pw-main { display: contents; }
  .pw-close-row { order: 0; justify-content: flex-start; padding: 16px 24px 0; min-height: 40px; }
  .pw-side { order: 1; width: auto; padding: 0; background: none; display: block; }
  .pw-art { width: 342px; height: 176px; }
  .pa-big { left: 101px; } .pa-left { left: 21px; } .pa-right { left: 249px; } .pa-spark { left: 233px; } .pa-dots { left: 47px; }
  .pw-note { right: 20px; top: -17px; font-size: 24px; }
  .pw-h { order: 2; margin-top: -16px; padding: 0 24px; font-size: 40px; line-height: 44px; text-align: center; }
  .pw-lead { order: 3; margin-top: -24px; padding: 0 24px; font-size: 17px; line-height: 24px; text-align: center; max-width: none; }
  .pw-tiles { order: 4; gap: 8px; padding: 0 24px; }
  .pw-tile { width: 108px; flex: 1 1 0; min-width: 0; }
  .pw-first { order: 5; display: flex; align-items: center; gap: 14px; margin: 0 24px; padding: 16px; border-radius: 24px; background: var(--orange-soft); }
  .pw-plane { width: 48px; height: 48px; border-radius: 999px; background: var(--cream); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .pw-plane svg { width: 30px; height: 30px; }
  .pw-first > div { display: flex; flex-direction: column; gap: 2px; }
  .pw-first-t { font-size: 17px; line-height: 24px; font-weight: 600; }
  .pw-first-s { font-size: 13px; line-height: 18px; color: var(--graphite); }
  .pw-acts { order: 6; position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: 16px 24px 32px; box-sizing: border-box; flex-direction: column; gap: 10px;
    background: rgba(255, 251, 248, .78); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); border-top: 1px solid var(--line); }
  .pw-want { width: 100%; justify-content: space-between; padding: 0 28px; }
  .pw-acts-note { display: none; }
  .pw-not { display: block; font-size: 17px; line-height: 24px; font-weight: 600; color: var(--ink); text-decoration: none; }

  .sp { min-height: 100vh; min-height: 100dvh; padding-bottom: 32px; }
  .sp-acts { margin-top: auto; }
}
@media (max-width: 833.98px) and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pw-acts { background: rgba(29, 26, 24, .78); } }
@media (max-width: 833.98px) { :root[data-theme="dark"] .pw-acts { background: rgba(29, 26, 24, .78); } }
