/* TAKSTAV — Expresní kurýr nákladů */
:root {
  --y: #ffd618; --y-dark: #e6c000; --y-light: #fff3a8;
  --bg: #121214; --panel: #1a1b1f; --panel-2: #232428;
  --text: #ffffff; --muted: #8e8e93; --red: #f64e60; --green: #1bc5bd;
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--font); color: var(--text); background: var(--bg);
  overflow: hidden; position: fixed; inset: 0; width: 100%;
  touch-action: none; overscroll-behavior: none; user-select: none; -webkit-user-select: none;
  display: flex; align-items: center; justify-content: center; gap: 48px;
  opacity: 0; transition: opacity .25s;
}
body.ready { opacity: 1; }
body.column {
  background: radial-gradient(ellipse at 50% 30%, #232428 0%, #0f0f11 70%);
}
body.column::before {
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(45deg, rgba(255,214,24,.025) 0 14px, transparent 14px 42px);
}
#stage { position: relative; overflow: hidden; background: #2b2c30; box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 30px 80px rgba(0,0,0,.6); }
body:not(.column) #stage { box-shadow: none; }
#game { display: block; }
.hidden { display: none !important; }

/* ---------- HUD ---------- */
.hud { position: absolute; inset: 0; pointer-events: none; padding: max(8px, env(safe-area-inset-top)) 10px max(8px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.hud .label { font-size: 9px; font-weight: 800; letter-spacing: .12em; color: rgba(255,255,255,.7); }
.hud-top { display: flex; align-items: center; gap: 8px; }
.brand { background: var(--y); padding: 5px 7px 4px; border-radius: 3px; display: flex; align-items: center; }
.brand img { height: 11px; display: block; }
.brand-sub { font-size: 8.5px; font-weight: 800; letter-spacing: .1em; line-height: 1.15; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.8); }
.hud-score { margin-left: auto; text-align: right; }
.hud-score .value { font-size: 24px; font-weight: 900; line-height: 1; color: var(--y); text-shadow: 0 2px 4px rgba(0,0,0,.7); font-variant-numeric: tabular-nums; }
.hud-row { display: flex; align-items: flex-end; gap: 10px; margin-top: 8px; }
.cargo { flex: 1; max-width: 220px; background: rgba(18,18,20,.78); border-radius: 8px; padding: 6px 8px 7px; backdrop-filter: blur(4px); }
.cargo .label { display: flex; justify-content: space-between; margin-bottom: 4px; }
.cargo .label b { color: #fff; font-size: 11px; }
.cargo .label span:last-child { letter-spacing: 0; font-size: 10.5px; font-weight: 700; color: rgba(255,255,255,.85); }
.cargo .bar { height: 7px; background: rgba(255,255,255,.14); border-radius: 4px; overflow: hidden; }
.cargo .bar div { height: 100%; width: 0; background: var(--y); border-radius: 4px; transition: width .18s ease-out, background .2s; }
.cargo.high .bar div { background: #ffa800; }
.cargo.full .bar div { background: var(--red); }
.lives { display: flex; gap: 3px; margin-left: auto; background: rgba(18,18,20,.78); padding: 6px 8px; border-radius: 8px; }
.lives span { width: 18px; height: 18px; display: block; }
.lives svg { width: 100%; height: 100%; fill: var(--y); filter: drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
.lives span.off svg { fill: rgba(255,255,255,.18); }
.hud-side { position: absolute; left: 0; right: 0; top: 100px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.combo { background: var(--y); color: #1a1b1f; font-weight: 900; font-size: 20px; line-height: 1; padding: 6px 9px 5px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; box-shadow: 0 3px 10px rgba(0,0,0,.45); }
.combo small { font-size: 7.5px; letter-spacing: .12em; margin-top: 2px; }
.combo.pop { animation: pop .35s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { 0% { transform: scale(.6); } 100% { transform: scale(1); } }
.boost { background: #1a1b1f; color: var(--y); font-weight: 900; font-size: 10px; letter-spacing: .1em; padding: 5px 8px; border-radius: 6px; border: 1px solid var(--y); animation: blink .5s steps(2) infinite; }
@keyframes blink { 50% { opacity: .45; } }
.hud-bottom { margin-top: auto; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.vehicle { background: rgba(18,18,20,.78); padding: 6px 9px 6px 6px; border-radius: 8px; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
.vehicle .lvl { background: var(--y); color: #1a1b1f; border-radius: 4px; padding: 2px 4px; font-size: 9px; font-weight: 900; }
.dist { background: rgba(18,18,20,.78); padding: 6px 9px; border-radius: 8px; font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hud-btns { margin-left: auto; display: flex; gap: 6px; pointer-events: auto; }
.icon-btn { width: 36px; height: 36px; border-radius: 8px; border: 0; background: rgba(18,18,20,.78); color: #fff; font-size: 15px; font-family: inherit; font-weight: 900; cursor: pointer; }
.icon-btn:active { background: var(--y); color: #1a1b1f; }

.banner { position: absolute; left: 0; right: 0; top: 34%; display: flex; justify-content: center; pointer-events: none; }
.banner-inner { background: var(--y); color: #1a1b1f; padding: 14px 22px; border-radius: 12px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.5); transform: scale(.6); opacity: 0; }
.banner.show .banner-inner { animation: bannerIn 2.6s cubic-bezier(.2,1.4,.4,1) forwards; }
@keyframes bannerIn { 0% { transform: scale(.6) rotate(-3deg); opacity: 0; } 12% { transform: scale(1.05); opacity: 1; } 18% { transform: scale(1); } 85% { transform: scale(1); opacity: 1; } 100% { transform: scale(.9); opacity: 0; } }
.banner-title { font-size: 22px; font-weight: 900; letter-spacing: .02em; }
.banner-sub { font-size: 12px; font-weight: 800; margin-top: 3px; }
.banner-note { font-size: 10px; font-weight: 700; margin-top: 4px; opacity: .8; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- obrazovky ---------- */
.screen { position: absolute; inset: 0; background: rgba(14,14,16,.9); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.screen.overlay { background: rgba(14,14,16,.72); }
.screen-inner { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: max(22px, env(safe-area-inset-top)) 22px max(18px, env(safe-area-inset-bottom)); text-align: center; gap: 10px; }
.logo-block { background: var(--y); padding: 16px 22px 13px; border-radius: 4px; display: inline-block; box-shadow: 0 8px 30px rgba(255,214,24,.18); }
.logo-block img { height: 26px; display: block; }
.logo-block.small { padding: 9px 14px 7px; }
.logo-block.small img { height: 16px; }
h1 { font-size: 28px; font-weight: 900; line-height: 1.05; letter-spacing: .01em; margin-top: 6px; }
h2 { font-size: 24px; font-weight: 900; letter-spacing: .01em; line-height: 1.1; }
h2.record { color: var(--y); animation: recordPulse 1.2s ease-in-out infinite alternate; }
@keyframes recordPulse { from { transform: scale(1); } to { transform: scale(1.06); text-shadow: 0 0 24px rgba(255,214,24,.6); } }
.tagline { color: var(--muted); font-weight: 700; font-size: 12.5px; letter-spacing: .02em; }
.over-sub { font-size: 9px; font-weight: 800; letter-spacing: .18em; color: var(--muted); }
.howto { list-style: none; text-align: left; width: 100%; max-width: 320px; margin: 6px 0 4px; display: flex; flex-direction: column; gap: 6px; }
.howto li { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.05); border-radius: 10px; padding: 8px 10px; font-size: 12px; font-weight: 600; line-height: 1.3; }
.howto b { color: var(--y); font-weight: 800; }
.howto .ico { width: 30px; height: 30px; flex: none; display: grid; place-items: center; background: var(--y); color: #1a1b1f; border-radius: 8px; font-size: 16px; font-weight: 900; }
.btn { font-family: inherit; font-weight: 900; font-size: 16px; letter-spacing: .08em; text-transform: uppercase; border: 0; border-radius: 12px; height: 54px; width: 100%; max-width: 320px; cursor: pointer; transition: transform .08s, background .15s; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--y); color: #1a1b1f; box-shadow: 0 8px 24px rgba(255,214,24,.25); margin-top: 8px; }
.btn-primary:hover { background: var(--y-dark); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-ghost { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.25); height: 48px; font-size: 13px; }
.btn-ghost:hover { border-color: var(--y); color: var(--y); }
.btn-link { background: none; color: var(--muted); height: auto; font-size: 11px; letter-spacing: .06em; text-decoration: underline; text-underline-offset: 3px; }
.best { font-size: 12px; font-weight: 700; color: var(--muted); }
.best b { color: #fff; }
.start-top { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; max-width: 320px; }
.start-top .top-title { width: 100%; font-size: 9px; letter-spacing: .18em; font-weight: 800; color: var(--muted); }
.chip { background: rgba(255,255,255,.06); border-radius: 20px; padding: 4px 9px; font-size: 11px; font-weight: 700; }
.chip b { color: var(--y); }
.powered { margin-top: 10px; font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: .04em; }
.powered b { color: rgba(255,255,255,.8); }

.big-score { margin-top: 4px; }
.big-score .label { font-size: 9px; font-weight: 800; letter-spacing: .2em; color: var(--muted); }
.big-score div:last-child { font-size: 48px; font-weight: 900; line-height: 1; color: var(--y); font-variant-numeric: tabular-nums; text-shadow: 0 4px 20px rgba(255,214,24,.3); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 100%; max-width: 320px; }
.stats div { background: rgba(255,255,255,.05); border-radius: 10px; padding: 8px 10px; text-align: left; display: flex; flex-direction: column; gap: 2px; }
.stats small { font-size: 9.5px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.stats b { font-size: 14px; font-weight: 800; }
.save-form { width: 100%; max-width: 320px; background: rgba(255,214,24,.08); border: 1px solid rgba(255,214,24,.3); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.save-title { font-size: 11px; font-weight: 900; letter-spacing: .14em; color: var(--y); }
#name-input { width: 100%; height: 50px; border-radius: 10px; border: 2px solid rgba(255,255,255,.2); background: #0f0f11; color: #fff; font-family: inherit; font-weight: 900; font-size: 18px; letter-spacing: .1em; text-align: center; text-transform: uppercase; outline: none; }
#name-input:focus { border-color: var(--y); }
#name-input.shake { animation: shake .4s; border-color: var(--red); }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.save-form .btn-primary { margin-top: 0; }
.save-msg { font-size: 10.5px; color: var(--muted); line-height: 1.35; }
.save-msg:empty { display: none; }

.board { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto; padding: 2px; }
.board .row { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.05); border-radius: 10px; padding: 7px 10px; text-align: left; }
.board .row.me { background: var(--y); color: #1a1b1f; }
.board .row.gap { margin-top: 10px; position: relative; }
.board .row.gap::before { content: "···"; position: absolute; top: -13px; left: 0; right: 0; text-align: center; color: var(--muted); font-size: 12px; letter-spacing: .3em; }
.board .rank { width: 30px; font-weight: 900; font-size: 13px; flex: none; }
.board .name { flex: 1; font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; flex-direction: column; }
.board .name small { font-size: 9px; font-weight: 700; opacity: .55; letter-spacing: .08em; text-transform: none; }
.board .score { font-weight: 900; font-size: 14px; font-variant-numeric: tabular-nums; }
.board .row.me .score { color: #1a1b1f; }
.board .row:not(.me) .score { color: var(--y); }
.board .empty { padding: 20px; color: var(--muted); font-weight: 700; font-size: 12px; }
.board-note { font-size: 11px; font-weight: 700; color: var(--muted); }
.rotate-ico { font-size: 56px; animation: rot 1.6s ease-in-out infinite alternate; }
@keyframes rot { from { transform: rotate(0); } to { transform: rotate(90deg); } }

@media (max-height: 640px) {
  .howto li { padding: 6px 9px; font-size: 11px; }
  h1 { font-size: 24px; }
  .logo-block { padding: 12px 18px 10px; } .logo-block img { height: 20px; }
  .big-score div:last-child { font-size: 40px; }
  .btn { height: 48px; }
}

/* ---------- desktop: boční panel s QR ---------- */
.side-panel { display: none; width: 230px; flex-direction: column; align-items: center; gap: 10px; text-align: center; position: relative; z-index: 1; }
body.column .side-panel { display: flex; }
@media (max-width: 960px) { body.column .side-panel { display: none; } }
.sp-title { font-size: 12px; font-weight: 900; letter-spacing: .2em; color: var(--y); }
.side-panel img { width: 180px; height: 180px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.sp-url { font-size: 12px; font-weight: 800; color: #fff; letter-spacing: .02em; }
.sp-keys { margin-top: 14px; font-size: 11px; font-weight: 600; color: var(--muted); line-height: 2; }
.sp-keys span { display: block; font-weight: 800; letter-spacing: .1em; font-size: 9px; }
kbd { display: inline-block; min-width: 20px; padding: 1px 5px; margin: 0 1px; border-radius: 5px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); color: #fff; font-family: inherit; font-weight: 800; font-size: 10px; }

/* boost energie */
.boost-label { margin-top: 5px; }
.cargo .boost-label span:first-child { color: var(--y); }
.cargo .boost-bar { height: 4px; margin-top: 3px; }
.cargo .boost-bar div { background: var(--y); transition: width .12s linear; }
.cargo .boost-bar div.empty { background: var(--red); }
.cargo .boost-bar div.fullb { box-shadow: 0 0 8px var(--y); }
