/* Τένις Ύδρας: DoorScene, the drawing of a door code opening the court's gate (bookings/door_scene.html, in its frame
   bookings/door_box.html). Ours, in place of the design's: drawn like the court on the home page (css/court.css), ink
   lines and flat colours, by day and by night (data-tone, which js/site.js changes in place). The floodlights follow
   the night, not the booking's time: on at night, off by day, and they strike like the home page's (dark for a moment,
   a flicker, then on). Wherever a door code is shown with it: on «Οι κρατήσεις
   μου» (the open booking, and the cards of a new account and of a visitor) and on the booking page (a time of yours
   open in step 1, and the end of a booking).

   One timeline, played once when the drawing appears; then it rests on its last frame, the gate open (and with motion
   reduced it shows only that frame). The replay button (js/booking.js) plays it again from a fresh copy. In seconds:
     0.4–1.8    the clock's hands run an hour forward, to the booking's start
     0.76–1     at night, the floodlights strike (and again whenever night falls with the drawing on the page)
     1.8–2.2    the booking's 90 minutes fill the dial
     2.2        the keypad wakes: amber light, screen on
     2.4–3.8    the six keys of the code, 0.28 apart: each fills a dot on the screen and lights its cell in the code beside
     4.1        the light turns green
     4.2        the bolt slides back
     4.45–5.65  the gate swings in, and the court shows through the opening
   Each element's own style is the last frame; its animation starts it from somewhere else. */
/* the door box (bookings/door_box.html): the drawing in its frame, with the button that plays it again. In .pf-door it
   sits beside the door code from 700px wide, above it on a phone. The design's frame, moved here from profile.css so that
   both pages have it */
.pf-door{display:grid;gap:10px;--pf-key:#FFD27D}
.tx[data-theme="night"] .pf-door{--pf-key:#0A1730}
.pf-scene{position:relative;overflow:hidden;border-radius:16px;background:var(--bg);aspect-ratio:400/216;transition:background-color 1.2s}
.pf-scene .dc{position:absolute;inset:0;width:auto;height:auto;aspect-ratio:auto}
.pf-door .pf-scene{width:100%;max-height:250px}
.pf-replay{position:absolute;z-index:1;top:8px;left:8px;display:grid;place-items:center;width:36px;height:36px;margin:0;padding:0;border:0;border-radius:999px;background:var(--card);box-shadow:0 0 0 1px var(--line),0 2px 6px -2px rgba(9,20,42,.2);color:var(--accent);cursor:pointer;opacity:.92;transition:opacity .15s,transform .15s}
.pf-replay::after{content:"";position:absolute;inset:-4px}
.pf-replay:hover{opacity:1}
.pf-replay:active{transform:scale(.94)}
.pf-replay .tx-ico{width:18px;height:18px;stroke-width:2}
.pf-door .bk-code{align-content:start}
@container (min-width:700px){.pf-door{grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:12px}.pf-door .pf-scene{aspect-ratio:auto;min-height:226px;max-height:none}}

/* the drawing */
.dc{--dc-sky:#F4F5F1;--dc-ink:#1C4B97;--dc-face:#FFFFFF;--dc-surround:#D59D89;--dc-court:#8AB18F;--dc-lines:#FCFCF8;--dc-net:#163773;
  --dc-wait:#D08A12;--dc-go:#2F7D4A;--dc-press:#F2B84B;--dc-screen:#FBEBC8;--dc-lens:#FFF4D6;--dc-glow:#FFD27D;--dc-pool:#FFE3A3;--dc-star:#FFFFFF;
  position:relative;display:block;width:100%;aspect-ratio:8/5;overflow:hidden;background:var(--dc-sky);container-type:size;transition:background-color 1.2s}
.dc[data-tone="night"]{--dc-sky:#0E1B35;--dc-ink:#C3D2EC;--dc-face:#132443;--dc-surround:#4E3547;--dc-court:#26503F;--dc-lines:#DFE8F4;--dc-net:#C3D2EC;
  --dc-wait:#FFD27D;--dc-go:#7AD3A0;--dc-press:#FFD27D;--dc-screen:#3D3426}
/* the drawing is 400 by 250 units and covers its frame, cut at the edges; the gate, the clock and the keypad are in the
   middle, so it reads from a phone's card to the computer's door box */
.dc-stage{position:absolute;left:50%;top:50%;width:100%;height:100%;width:max(100cqw,160cqh);height:max(100cqh,62.5cqw);transform:translate(-50%,-50%);container-type:inline-size}
.dc-stage>svg,.dc-leaf svg{fill:none;stroke:var(--dc-ink);stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round}
.dc-stage>svg{position:absolute;inset:0;width:100%;height:100%;overflow:hidden}
.dc :where(svg *){transition:fill 1.2s,stroke 1.2s}

/* behind the fence: the sky (stars at night), the hill, the floodlights, the court and its fences, in perspective */
.dc-stars{stroke:var(--dc-star);stroke-width:1.6;opacity:0;transition:opacity 1.2s}
.dc-stars-s{stroke-width:1.1}
.dc[data-tone="night"] .dc-stars{opacity:.7}
.dc-hill{stroke-width:.9;opacity:.45}
.dc-pole{stroke-width:1.3}
.dc-head{fill:var(--dc-sky);stroke-width:1.1}
.dc-lens{fill:var(--dc-lens);stroke:none}
.dc-head-x{stroke-width:.7}
.dc-side,.dc-farf{fill:var(--dc-ink);fill-opacity:.07;stroke:none}
.dc-rails{stroke-width:.7;opacity:.55}
.dc-floor{fill:var(--dc-surround);stroke:none}
.dc-court{fill:var(--dc-court);stroke:none}
.dc-lines{stroke:var(--dc-lines);stroke-width:1.2}
.dc-net{fill:var(--dc-net);fill-opacity:.3;stroke:none}
.dc-net-post{stroke-width:1}
.dc-tape{stroke:var(--dc-lines);stroke-width:1.1}
/* the floodlights: on at night, off by day. At night they strike: dark while night falls, then they flicker on and
   settle, on the same 1.4 s timeline as the home page's drawing and photo (ct-strike in css/court.css, js/photo.js; keep
   the three in step). That is as the drawing starts at night (and as it plays again), and when the tone turns to night
   with the drawing on the page; going back to day they fade out with it. Their light is a glow round each head and a
   pool on the court, under the fence */
.dc-lamps{opacity:0;transition:opacity 1.2s}
.dc-lights{position:absolute;inset:0;opacity:0;transition:opacity 1.2s}
.dc[data-tone="night"] .dc-lamps,.dc[data-tone="night"] .dc-lights{opacity:1;transition:none;animation:dc-strike 1.4s linear both}
@keyframes dc-strike{0%,54%{opacity:0}56.5%{opacity:.8}59.5%{opacity:.1}63.5%{opacity:.9}66.5%{opacity:.2}71.5%,100%{opacity:1}}
.dc-glow{position:absolute;top:11%;width:24%;aspect-ratio:1;border-radius:50%;background:radial-gradient(closest-side,var(--dc-glow),transparent);opacity:.9;transform:translate(-50%,-50%)}
.dc-glow:first-child{left:23.55%}
.dc-glow+.dc-glow{left:76.45%}
.dc-pool{position:absolute;left:12.5%;top:32%;width:75%;height:34%;background:radial-gradient(closest-side,var(--dc-pool),transparent);opacity:.3}

/* the near fence: chain-link over a pale wash, open where the gate is; its posts, the stones of the path, the clock and
   the keypad on the gate's post */
.dc-veil{fill:var(--dc-sky);fill-opacity:.66;fill-rule:evenodd;stroke:none}
.dc-mesh{stroke-width:.5;opacity:.3}
.dc-rail{stroke-width:1.6}
.dc-ground{stroke-width:1.3}
.dc-stones{stroke-width:.9;opacity:.55}
.dc-lpost{stroke-width:1.8}
.dc-post{fill:var(--dc-sky);stroke-width:1.3}
.dc-knuckle{fill:var(--dc-ink);stroke-width:.8}
.dc-keeper{stroke-width:1}
.dc-arm{stroke-width:1.6}
.dc-face{fill:var(--dc-face);stroke:none}
.dc-slot{stroke:var(--dc-go);stroke-width:19.5;stroke-linecap:butt;stroke-dasharray:7.66 70;opacity:.85}
.dc-ticks{stroke-width:1.1}
.dc-hh{stroke-width:2.6}
.dc-mh{stroke-width:1.6}
.dc-pin{fill:var(--dc-ink);stroke:none}
.dc-rim{stroke-width:1.6}
.dc-pad{fill:var(--dc-face);stroke-width:1.4}
.dc-led{stroke-width:.8}
.dc-led-wait{fill:var(--dc-wait);stroke:none;opacity:0}
.dc-led-go{fill:var(--dc-go);stroke:none}
.dc-led-ring{stroke:var(--dc-go);stroke-width:1;opacity:0;transform-box:fill-box;transform-origin:center}
.dc-screen{stroke-width:.9}
.dc-screen-on{fill:var(--dc-screen);stroke:none}
.dc-places{stroke-width:.6;opacity:.6}
.dc-dot{fill:var(--dc-ink);stroke:none}
.dc-keys{stroke-width:.8}
.dc-press{fill:var(--dc-press);stroke:none;opacity:0}

/* the gate: an HTML layer over the drawing so that it can turn in 3D, hinged on the left; it swings in toward the point
   where the court's lines meet (200 84 of 400 250), seen from 2 m (160 units) */
.dc-door{position:absolute;inset:0;perspective:40cqw;perspective-origin:50% 33.6%}
.dc-leaf{position:absolute;left:34%;top:18.4%;width:22.5%;height:64.8%;transform-origin:0 50%;transform:rotateY(75deg)}
.dc-leaf svg{display:block;width:100%;height:100%;overflow:visible}
.dc-frame{stroke-width:2.4}
.dc-mid{stroke-width:1.8}
.dc-strap{stroke-width:2.2}
.dc-bolt{fill:var(--dc-ink);stroke:none;transform:translateX(-11px)}
.dc-lock{fill:var(--dc-face);stroke-width:1.1}
.dc-handle{stroke-width:2.2}

/* the timeline */
.dc-hh,.dc-mh{animation:dc-hour 1.4s .4s cubic-bezier(.45,0,.2,1) both}
.dc-mh{animation-name:dc-minute}
@keyframes dc-hour{from{transform:rotate(-30deg)}}
@keyframes dc-minute{from{transform:rotate(-360deg)}}
.dc-slot{animation:dc-slot .4s 1.8s ease-out both}
@keyframes dc-slot{from{stroke-dasharray:0 70}}
.dc-led-wait{animation:dc-wait 1.9s 2.2s linear both}
@keyframes dc-wait{0%{opacity:0}10%,99%{opacity:1}100%{opacity:0}}
.dc-screen-on{animation:dc-on .2s 2.2s ease-out both}
@keyframes dc-on{from{opacity:0}}
.dc-press{animation:dc-press .34s ease-out both}
@keyframes dc-press{0%{opacity:0}15%{opacity:1}100%{opacity:0}}
.dc-dot{animation:dc-on .14s ease-out both}
.dc-press[data-i="0"]{animation-delay:2.4s}.dc-dot[data-i="0"]{animation-delay:2.46s}
.dc-press[data-i="1"]{animation-delay:2.68s}.dc-dot[data-i="1"]{animation-delay:2.74s}
.dc-press[data-i="2"]{animation-delay:2.96s}.dc-dot[data-i="2"]{animation-delay:3.02s}
.dc-press[data-i="3"]{animation-delay:3.24s}.dc-dot[data-i="3"]{animation-delay:3.3s}
.dc-press[data-i="4"]{animation-delay:3.52s}.dc-dot[data-i="4"]{animation-delay:3.58s}
.dc-press[data-i="5"]{animation-delay:3.8s}.dc-dot[data-i="5"]{animation-delay:3.86s}
.dc-led-go{animation:dc-on .15s 4.1s both}
.dc-led-ring{animation:dc-ring .6s 4.1s ease-out forwards}
@keyframes dc-ring{from{opacity:.9;transform:none}to{opacity:0;transform:scale(3.2)}}
.dc-bolt{animation:dc-bolt .15s 4.2s ease-in both}
@keyframes dc-bolt{from{transform:none}}
.dc-leaf{animation:dc-swing 1.2s 4.45s cubic-bezier(.4,0,.2,1) both}
@keyframes dc-swing{from{transform:rotateY(0deg)}}
/* the door code beside the drawing (.pf-door): its cells light up with the keys, so these delays are the presses' */
.pf-door .bk-digits b{animation:pf-key .52s ease-out both}
.pf-door .bk-digits b:nth-of-type(1){animation-delay:2.4s}
.pf-door .bk-digits b:nth-of-type(2){animation-delay:2.68s}
.pf-door .bk-digits b:nth-of-type(3){animation-delay:2.96s}
.pf-door .bk-digits b:nth-of-type(4){animation-delay:3.24s}
.pf-door .bk-digits b:nth-of-type(5){animation-delay:3.52s}
.pf-door .bk-digits b:nth-of-type(6){animation-delay:3.8s}
@keyframes pf-key{0%{transform:none;box-shadow:0 0 0 0 transparent}22%{transform:translateY(-3px);box-shadow:0 0 0 2px var(--pf-key)}100%{transform:none;box-shadow:0 0 0 0 transparent}}
@media (prefers-reduced-motion:reduce){.dc *,.pf-door .bk-digits b{animation:none!important}.dc,.dc *{transition:none!important}.pf-replay{display:none}}
