/* "Unikovka z Plzne" - loaded alongside crystal.css, which already defines
   :root palette, html/body basics, #backlink and #corner, and curve.css,
   which defines the shared .game-hidden / .game-switch toggle rules.
   Only game-specific classes live here, all prefixed gw- to avoid clashing
   with the other games on the same page.

   Endless tilt dodger: auto drives down the road, obstacles fall from the
   top, player steers left/right (tilt primary, drag/keys fallback). */

.gw-stage{
  position:fixed;inset:0;z-index:1;
  display:flex;align-items:center;justify-content:center;
  overflow:hidden;
}

.gw-hud{
  /* bottom-left, matching the sitewide convention (.pz-hud in politician.css,
     .cx-hud in crossing.css both sit bottom-left too). */
  position:fixed;bottom:22px;left:22px;z-index:5;
  font-family:'SF Mono','JetBrains Mono',ui-monospace,Menlo,Consolas,monospace;
  font-size:.72rem;letter-spacing:.03em;color:var(--muted);
  display:flex;flex-direction:column;gap:3px;
  background:rgba(255,255,255,0.03);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:10px;padding:12px 14px;
  backdrop-filter:blur(6px);
  min-width:130px;
}
.gw-hud .title{color:#fff;font-weight:700;letter-spacing:.08em;text-transform:uppercase;font-size:.66rem;margin-bottom:4px;opacity:.8;}
.gw-lives{font-size:.9rem;letter-spacing:2px;line-height:1;}

.gw-score-box{
  position:fixed;top:22px;right:26px;z-index:5;
  text-align:right;
  background:rgba(255,255,255,0.03);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:10px;padding:12px 16px;
  backdrop-filter:blur(6px);
  min-width:140px;
}
.gw-score-box .title{color:var(--muted);font-weight:700;letter-spacing:.08em;text-transform:uppercase;font-size:.62rem;margin-bottom:6px;}
.gw-score-box .value{
  font-family:'SF Mono','JetBrains Mono',ui-monospace,Menlo,Consolas,monospace;
  font-size:1.7rem;font-weight:700;color:var(--gold);line-height:1;
}
.gw-score-box .best{
  font-family:'SF Mono','JetBrains Mono',ui-monospace,Menlo,Consolas,monospace;
  font-size:.68rem;color:var(--muted);margin-top:4px;
}

.gw-field{
  position:relative;
  width:min(92vw, 420px);
  height:min(78vh, 680px);
  border-radius:18px;overflow:hidden;
  box-shadow:0 24px 60px -20px rgba(0,0,0,0.6);
  border:1px solid rgba(255,255,255,0.08);
  background:#2a2d36;
  touch-action:none;
}

.gw-curb{
  position:absolute;top:0;bottom:0;width:9%;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,0.14) 0 12px, transparent 12px 24px),
    #c9c2b4;
}
.gw-curb.left{left:0;}
.gw-curb.right{right:0;}

.gw-road{
  position:absolute;top:0;bottom:0;left:9%;right:9%;
  overflow:hidden;
  background:#33363f;
}
/* two lane-divider lines at 1/3 and 2/3, kept off the road center where
   obstacles and the player actually travel (see project lesson: a
   decorative center line visually collides with centered objects) */
.gw-road::before, .gw-road::after{
  content:'';
  position:absolute;top:0;bottom:0;width:0;
  border-left:3px dashed rgba(255,255,255,0.22);
}
.gw-road::before{left:33.3%;}
.gw-road::after{left:66.6%;}

.gw-obstacle{
  position:absolute;
  transform:translate(-50%, -50%);
  /* fixed height (not aspect-ratio off the variable per-type width) so the
     visible tile always matches OBST_HALF_H in getaway.js — a wide obstacle
     (e.g. the parade) used to get a proportionally taller box than its
     actual hitbox, which read as "I can't tell where this thing's edge is". */
  height:13%;
  box-sizing:border-box;
  display:flex;align-items:center;justify-content:center;
  line-height:1;
  border-radius:10px;
  background:rgba(15,17,23,0.55);
  border:2px solid rgba(255,201,60,0.6);
  box-shadow:0 6px 14px -6px rgba(0,0,0,0.65), inset 0 0 0 1px rgba(0,0,0,0.25);
  font-size:clamp(1.05rem, 5.2vw, 1.55rem);
  filter:drop-shadow(0 2px 3px rgba(0,0,0,0.55));
  pointer-events:none;
  white-space:nowrap;
  overflow:hidden;
}
.gw-obstacle span{ line-height:1; }

.gw-player{
  position:absolute;top:86%;left:50%;
  transform:translate(-50%, -50%);
  font-size:clamp(1.6rem, 8vw, 2.3rem);
  filter:drop-shadow(0 0 6px rgba(255,201,60,0.35)) drop-shadow(0 4px 6px rgba(0,0,0,0.5));
  /* NO "transition:left" here on purpose - getaway.js already recomputes
     and writes .style.left every animation frame (~60fps) with its own
     constant-speed easing (see PLAYER_MAX_SPEED in getaway.js). A CSS
     transition on the same property, re-triggered every ~16ms by that JS
     write, fights the JS animation instead of adding to it and produced a
     visibly jerky "snap between a few spots" look on real phones - reported
     as "auto vzdy na pruh preskoci", even though the underlying position is
     fully continuous. If motion ever needs smoothing again, do it in
     getaway.js's own tick(), not via a competing CSS transition. */
  pointer-events:none;
  z-index:3;
}
.gw-player.hit{
  animation:gw-player-blink 0.18s steps(1) infinite;
}
@keyframes gw-player-blink{
  0%, 49%{opacity:1;}
  50%, 100%{opacity:.25;}
}
@media (prefers-reduced-motion: reduce){
  .gw-player.hit{animation:none;opacity:.6;}
}

.gw-caption{
  position:fixed;top:76px;left:50%;z-index:6;
  transform:translate(-50%, -14px);
  background:linear-gradient(135deg, rgba(155,63,174,0.92), rgba(217,92,134,0.92));
  color:#fff;font-size:.8rem;font-weight:600;letter-spacing:.02em;
  padding:9px 18px;border-radius:999px;
  max-width:min(84vw, 360px);text-align:center;
  box-shadow:0 14px 30px -10px rgba(0,0,0,0.55);
  opacity:0;pointer-events:none;
  transition:opacity .3s ease, transform .3s ease;
}
.gw-caption.show{opacity:1;transform:translate(-50%, 0);}

.gw-startcard, .gw-overcard{
  position:fixed;inset:0;z-index:8;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:8px;text-align:center;padding:0 30px;
  background:rgba(11,14,22,0.82);
  transition:opacity .3s ease;
}
.gw-startcard.hidden, .gw-overcard.hidden{opacity:0;pointer-events:none;}
.gw-startcard h1, .gw-overcard h1{font-size:1.2rem;margin:0;}
.gw-startcard .wow{
  font-size:.72rem;letter-spacing:.08em;color:var(--gold);font-weight:700;
  text-transform:uppercase;margin-bottom:2px;
}
.gw-startcard p, .gw-overcard p{color:var(--muted);font-size:.85rem;margin:0;max-width:320px;line-height:1.5;}
.gw-startcard .legend{
  display:flex;flex-wrap:wrap;gap:6px;justify-content:center;max-width:320px;margin-top:4px;
}
.gw-startcard .legend span{
  font-size:.72rem;background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.1);
  border-radius:999px;padding:4px 9px;
}
.gw-startcard .tap, .gw-overcard .tap{
  margin-top:14px;font-weight:700;letter-spacing:.03em;font-size:.92rem;
  padding:13px 28px;border-radius:999px;cursor:pointer;
  background:linear-gradient(135deg, var(--purple), var(--pink));
}
.gw-overcard .final{
  font-family:'SF Mono','JetBrains Mono',ui-monospace,Menlo,Consolas,monospace;
  font-size:2.1rem;font-weight:700;color:var(--gold);
}
.gw-overcard .rank-final{font-size:.85rem;color:#fff;font-weight:600;margin-top:-4px;max-width:300px;}

.gw-ctrl-btn{
  /* lower on the sides (top:64%) - below the sitewide #gameSwitch pill
     (game-switch.js, shared across all games, fixed at top:50%;right:14px,
     ~40px tall), with a safety margin, but still clear of the bottom row
     owned by .gw-hud (bottom-left) and #gwTiltBtn (bottom-center): both
     ctrl buttons sit far enough to the sides (left:10px / right:10px) that
     they never overlap the centered tilt button regardless of vertical
     position, so the only real constraint was staying below the
     game-switch pill. Moved down from top:32% on 10. 9. 2026 per user
     feedback - closer to natural thumb reach in a driving game. */
  position:fixed;top:64%;transform:translateY(-50%);z-index:6;
  width:60px;height:60px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  font-size:1.3rem;color:#fff;border:none;
  background:rgba(255,255,255,0.08);
  border:2px solid rgba(255,255,255,0.2);
  -webkit-tap-highlight-color:transparent;
  touch-action:none;cursor:pointer;
  transition:transform .1s ease, filter .1s ease;
}
.gw-ctrl-btn.active{filter:brightness(1.6);transform:translateY(-50%) scale(0.92);}
.gw-ctrl-left{left:10px;}
.gw-ctrl-right{right:10px;}
@media (prefers-reduced-motion: reduce){
  .gw-ctrl-btn{transition:none;}
}

#gwTiltBtn{
  position:fixed;bottom:26px;left:50%;z-index:7;
  transform:translateX(-50%);
  background:linear-gradient(135deg, var(--purple), var(--pink));
  color:#fff;border:none;border-radius:999px;
  padding:11px 22px;font-size:.82rem;font-weight:600;letter-spacing:.02em;
  cursor:pointer;
  box-shadow:0 14px 30px -10px rgba(0,0,0,0.55);
  transition:opacity .3s ease, transform .3s ease;
}
#gwTiltBtn.is-hidden{opacity:0;pointer-events:none;transform:translateX(-50%) translateY(12px);}
@media (prefers-reduced-motion: reduce){
  #gwTiltBtn{display:none;}
}

@media (max-width:420px){
  .gw-hud, .gw-score-box{min-width:110px;padding:10px 12px;}
}

@media (prefers-reduced-motion: reduce){
  .gw-startcard, .gw-overcard, .gw-caption{transition:none;}
}
