/* Nákup na skok – vzhled. Barvy a písmo vycházejí z identity Žabky. */

:root {
  --grey: #494949;
  --grey-d: #323232;
  --ink: #2a2a2a;
  --lime: #cbd300;
  --lime-d: #8d9300;
  --red: #e3252a;
  --green: #8cc63f;
  --orange: #f7a823;
  --blue: #1e9be0;
  --paper: #f7f5f0;
  --line: #e2ded4;
  --muted: #6b6b6b;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --squares: repeating-linear-gradient(90deg,
    var(--red) 0 6px, transparent 6px 16px,
    var(--green) 16px 22px, transparent 22px 32px,
    var(--orange) 32px 38px, transparent 38px 48px,
    var(--blue) 48px 54px, transparent 54px 64px);
  --cond: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  height: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

body {
  height: 100%;
  margin: 0;
  background: #262626;
  color: var(--ink);
  font: 400 16px/1.4 Barlow, "Segoe UI", Arial, sans-serif;
  overscroll-behavior: none;
}

h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

button:focus-visible, select:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

#app {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
}

#stage {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 480px;
  overflow: hidden;
  background: var(--paper);
}

@media (min-width: 560px) and (min-height: 620px) {
  #app { padding: 20px; }
  #stage {
    max-width: 420px;
    max-height: 880px;
    border-radius: 30px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .5), 0 0 0 8px #111;
  }
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#safe-probe { position: absolute; visibility: hidden; padding-bottom: var(--sab); }

/* ---------- horní lišta ---------- */

#hud {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 5;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: calc(var(--sat) + 8px) 6px 15px 16px;
  background: var(--grey);
  color: #fff;
}

#hud::after {
  content: "";
  position: absolute;
  left: 16px; right: 16px; bottom: 5px;
  height: 5px;
  background: var(--squares);
}

.hud-score { display: grid; min-width: 86px; }
.hud-label { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; opacity: .7; line-height: 1; }
.hud-value { display: flex; align-items: center; gap: 7px; height: 32px; }
.hud-value b { font: 700 30px/1 var(--cond); font-variant-numeric: tabular-nums; }

#mult {
  font: 800 17px/1 var(--cond);
  font-style: normal;
  color: var(--ink);
  background: var(--lime);
  padding: 4px 7px 5px;
  border-radius: 7px;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .15s, transform .15s var(--ease-out);
}
#mult.on { opacity: 1; transform: none; }
#mult.bump { animation: bump .35s var(--ease-out); }
@keyframes bump { 0% { transform: scale(1.5) rotate(-8deg); } 100% { transform: none; } }

.hud-time { display: flex; align-items: center; gap: 10px; }
.time-bar { flex: 1; height: 12px; border-radius: 6px; background: rgba(255, 255, 255, .16); overflow: hidden; }
#time-fill { display: block; height: 100%; background: var(--lime); transform-origin: left center; border-radius: 6px; }
#time-num { font: 700 26px/1 var(--cond); min-width: 30px; text-align: right; font-variant-numeric: tabular-nums; }

#hud.finish #time-fill { background: var(--red); }
#hud.finish #time-num { color: #ff8a8c; animation: pulse .5s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.18); } }
#hud.hit .time-bar { animation: hit .4s; }
@keyframes hit { 0%, 60% { background: var(--red); } }

.icon-btn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: #fff;
  transition: background .12s, transform .12s var(--ease-out);
}
.icon-btn:active { background: rgba(255, 255, 255, .16); transform: scale(.92); }
.hud-btns { display: flex; }
.hud-btns .icon-btn { width: 40px; }
#btn-sound .snd-off { display: none; }
#btn-sound[aria-pressed="false"] .snd-on { display: none; }
#btn-sound[aria-pressed="false"] .snd-off { display: block; }
#btn-sound[aria-pressed="false"] { opacity: .6; }

/* ---------- tlačítka ---------- */

.btn {
  display: flex; align-items: center; justify-content: center;
  min-height: 56px;
  padding: 0 22px;
  border-radius: 14px;
  font: 800 22px/1 var(--cond);
  letter-spacing: .05em;
  text-transform: uppercase;
  transition: transform .1s var(--ease-out), box-shadow .1s var(--ease-out), background .12s;
}
.btn-lime { background: var(--lime); color: #1c1c1c; box-shadow: 0 5px 0 var(--lime-d); }
.btn-lime:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--lime-d); }
.btn-dark { background: var(--grey); color: #fff; box-shadow: 0 4px 0 #1f1f1f; font-size: 18px; min-height: 50px; width: 100%; }
.btn-dark:active { transform: translateY(3px); box-shadow: 0 1px 0 #1f1f1f; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2.500px var(--ink); }
.btn-ghost:active { background: rgba(0, 0, 0, .08); transform: scale(.97); }

.link-btn {
  font-weight: 600; font-size: 14px; color: #fff;
  padding: 10px 2px 10px 10px;
  text-decoration: underline; text-decoration-color: var(--lime); text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.link-btn:active { opacity: .6; }

.chip {
  display: inline-block;
  font: 600 10.500px/1 Barlow, sans-serif;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 6px 4px;
  border-radius: 5px;
  background: #e9e5da; color: var(--muted);
  vertical-align: 1px;
  white-space: nowrap;
}

/* ---------- úvod ---------- */

#start {
  position: absolute; inset: 0; z-index: 10;
  pointer-events: none;
  filter: drop-shadow(0 7px 0 var(--lime));
  transition: transform .55s var(--ease-in-out), visibility 0s;
}
#start.away { transform: translateY(-108%); visibility: hidden; transition: transform .55s var(--ease-in-out), visibility 0s .55s; }

.start-panel {
  pointer-events: auto;
  display: flex; flex-direction: column;
  gap: clamp(8px, 1.500vh, 14px);
  padding: calc(var(--sat) + 8px) 20px calc(24px + 7vw);
  background: var(--grey);
  color: #fff;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12vw), 0 100%);
}
@media (min-width: 480px) {
  .start-panel { padding-bottom: 62px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 54px), 0 100%); }
}

.start-top { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.brand { position: relative; display: flex; align-items: baseline; gap: 7px; padding-bottom: 9px; }
.brand b { font: 500 26px/1 Barlow, sans-serif; letter-spacing: -.01em; }
.brand span { font-size: 13px; opacity: .85; }
.brand::after { content: ""; position: absolute; left: 0; bottom: 0; width: 118px; height: 5px; background: var(--squares); }

h1 {
  font: 800 clamp(44px, 8.800vh, 76px)/.9 var(--cond);
  text-transform: uppercase;
  letter-spacing: -.005em;
}
h1 em { font-style: normal; color: var(--lime); }

.lead { font-size: clamp(15px, 2.200vh, 17px); line-height: 1.35; color: #ededed; max-width: 32ch; }

.how { display: grid; gap: clamp(5px, 1vh, 9px); counter-reset: how; }
.how li {
  counter-increment: how;
  display: flex; align-items: center; gap: 11px;
  font-weight: 500; font-size: clamp(14.500px, 2.100vh, 16px);
}
.how li::before {
  content: counter(how);
  flex: none;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 5px;
  font: 800 16px/1 var(--cond);
  color: #fff;
  background: var(--red);
}
.how li:nth-child(2)::before { background: var(--green); color: var(--ink); }
.how li:nth-child(3)::before { background: var(--orange); color: var(--ink); }

#btn-play { margin-top: 4px; min-height: 62px; font-size: 28px; }
.record { font-size: 14px; color: #dcdcdc; text-align: center; margin-top: -2px; }
.record b { font: 700 17px/1 var(--cond); color: #fff; }

@media (max-height: 610px) {
  .lead { display: none; }
  #btn-play { min-height: 54px; font-size: 24px; }
}

/* ---------- výsuvné panely ---------- */

.sheet {
  position: absolute; inset: 0; z-index: 20;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: rgba(20, 20, 20, 0);
  visibility: hidden;
  transition: background .3s, visibility 0s .45s;
}
.sheet.open { visibility: visible; background: rgba(20, 20, 20, .6); transition: background .3s; }

.sheet-panel {
  display: flex; flex-direction: column;
  max-height: calc(100% - var(--sat) - 14px);
  background: var(--paper);
  border-radius: 22px 22px 0 0;
  overflow: hidden;
  transform: translateY(104%);
  transition: transform .5s var(--ease-out);
}
.sheet.open .sheet-panel { transform: none; }

.sheet-scroll { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

.sheet-actions {
  display: flex; gap: 10px;
  padding: 12px 16px calc(14px + var(--sab));
  background: var(--paper);
  border-top: 1px solid var(--line);
}
.sheet-actions .btn-lime { flex: 1; }

.r-head, .p-head {
  position: relative;
  padding: 20px 20px 22px;
  background: var(--grey);
  color: #fff;
}
.r-head::after, .p-head::after {
  content: ""; position: absolute; left: 20px; right: 20px; bottom: 8px; height: 5px; background: var(--squares);
}
.r-close { position: absolute; top: 8px; right: 8px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; opacity: .75; }
.r-head h2, .p-head h2 { font: 800 34px/1 var(--cond); text-transform: uppercase; margin-top: 4px; color: var(--lime); }
.p-head p:last-child { margin-top: 8px; font-size: 16px; line-height: 1.4; color: #ededed; max-width: 34ch; padding-bottom: 6px; }

.r-score { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.r-score b { font: 800 68px/1 var(--cond); font-variant-numeric: tabular-nums; }
.r-score span { font-size: 17px; opacity: .8; }
.r-record { min-height: 20px; font-size: 14px; color: #dcdcdc; }
.r-record strong { color: var(--lime); font-weight: 700; }

.r-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 8px; }
.r-stats li { padding: 9px 10px 8px; border-radius: 10px; background: rgba(255, 255, 255, .1); }
.r-stats b { display: block; font: 700 26px/1 var(--cond); font-variant-numeric: tabular-nums; }
.r-stats span { font-size: 12.500px; opacity: .8; }

.r-body { display: grid; gap: 14px; padding: 16px 16px 20px; }

/* kupón */
.coupon {
  display: grid; grid-template-columns: 96px 1fr;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 0 var(--line), 0 6px 18px rgba(0, 0, 0, .08);
  overflow: hidden;
}
.coupon-stub {
  position: relative;
  display: grid; place-items: center;
  padding: 8px;
  color: #fff;
  background: var(--blue);
  text-align: center;
}
.coupon-stub::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: -5px; width: 10px;
  background: radial-gradient(circle at 5px 6px, #fff 4.200px, transparent 4.700px) 0 0 / 10px 12px repeat-y;
}
.coupon-stub b { font: 800 30px/.95 var(--cond); transform: rotate(-6deg); }
.coupon[data-color="orange"] .coupon-stub { background: var(--orange); color: var(--ink); }
.coupon[data-color="red"] .coupon-stub { background: var(--red); }
.coupon-main { padding: 12px 14px 12px 18px; min-width: 0; }
.kicker { font-size: 12px; font-weight: 600; color: var(--muted); }
.coupon h3 { font: 700 21px/1.1 var(--cond); margin: 3px 0 9px; }
.barcode { height: 30px; border-radius: 2px; }
.coupon-code { margin-top: 5px; font-size: 12px; color: var(--muted); }
.coupon-code span { font-weight: 700; color: var(--ink); letter-spacing: .06em; }
.coupon.pop { animation: couponIn .6s var(--ease-out) both; }
@keyframes couponIn { 0% { transform: translateY(18px) scale(.94); opacity: 0; } 100% { transform: none; opacity: 1; } }

.next p { font-size: 14px; color: var(--muted); }
.next p b { color: var(--ink); }
.next-bar { height: 8px; margin-top: 7px; border-radius: 4px; background: #e6e2d8; overflow: hidden; }
#next-fill { display: block; height: 100%; width: 100%; background: var(--green); border-radius: 4px; transform-origin: left center; transform: scaleX(0); transition: transform .9s var(--ease-out) .3s; }

/* liga */
.league { padding: 14px; border-radius: 14px; background: #fff; box-shadow: 0 1px 0 var(--line); }
.league header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.league h3, .sub { font: 700 22px/1 var(--cond); text-transform: uppercase; }
.store-pick { display: flex; align-items: center; gap: 8px; margin: 10px 0 12px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.store-pick select {
  flex: 1; min-width: 0;
  height: 44px;
  padding: 0 10px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: 600 16px Barlow, sans-serif;
}
#league-list { display: grid; gap: 6px; }
#league-list li {
  position: relative;
  display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 15px;
  overflow: hidden;
  isolation: isolate;
}
#league-list li i { position: absolute; inset: 0; z-index: -1; background: #f1eee6; transform-origin: left center; border-radius: 9px; }
#league-list .rank { font: 700 17px/1 var(--cond); color: var(--muted); }
#league-list .pts { font: 700 17px/1 var(--cond); font-variant-numeric: tabular-nums; }
#league-list li.me { font-weight: 700; }
#league-list li.me i { background: #e9efa0; }
#league-list li.me .rank { color: var(--ink); }
#league-list .gain { font: 700 13px/1 var(--cond); color: #4d7a12; margin-left: 5px; }

/* koncept */
.points { display: grid; gap: 10px; }
.points li {
  padding: 13px 14px 14px 18px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 0 var(--line);
  border-left: 6px solid var(--red);
}
.points li:nth-child(2) { border-left-color: var(--green); }
.points li:nth-child(3) { border-left-color: var(--orange); }
.points li:nth-child(4) { border-left-color: var(--blue); }
.points h3 { font: 700 20px/1.1 var(--cond); margin-bottom: 4px; }
.points p { font-size: 15px; line-height: 1.42; color: #4a4a4a; }
.sub { margin-top: 8px; }
.ticks { display: grid; gap: 9px; }
.ticks li { position: relative; padding-left: 26px; font-size: 15px; line-height: 1.4; }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: 3px;
  width: 14px; height: 8px;
  border-left: 3px solid #5d9a1b; border-bottom: 3px solid #5d9a1b;
  transform: rotate(-45deg);
}
.p-note { font-size: 13px; color: var(--muted); padding-top: 4px; }
.p-studio { font-size: 14px; font-weight: 600; }

/* ---------- potvrzení vzdání hry ---------- */

.modal {
  position: absolute; inset: 0; z-index: 30;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(20, 20, 20, 0);
  visibility: hidden;
  transition: background .2s, visibility 0s .2s;
}
.modal.open { visibility: visible; background: rgba(20, 20, 20, .62); transition: background .2s; }
.modal-card {
  width: 100%; max-width: 320px;
  padding: 22px 20px 20px;
  border-radius: 18px;
  background: var(--paper);
  text-align: center;
  opacity: 0; transform: scale(.92);
  transition: opacity .15s, transform .25s var(--ease-out);
}
.modal.open .modal-card { opacity: 1; transform: none; }
.modal-card h2 { font: 800 30px/1 var(--cond); text-transform: uppercase; }
.modal-card p { margin-top: 8px; font-size: 15px; line-height: 1.4; color: var(--muted); }
.modal-actions { display: grid; gap: 12px; margin-top: 18px; }
.modal-actions .btn-ghost { min-height: 50px; font-size: 19px; }

/* ---------- drobnosti ---------- */

#toast {
  position: absolute; left: 16px; right: 16px; bottom: calc(92px + var(--sab)); z-index: 40;
  margin: 0 auto; max-width: 340px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--ink); color: #fff;
  font-size: 14.500px; line-height: 1.35; text-align: center;
  opacity: 0; transform: translateY(12px);
  pointer-events: none;
  transition: opacity .2s, transform .25s var(--ease-out);
}
#toast.show { opacity: 1; transform: none; }

#rotate {
  position: absolute; inset: 0; z-index: 50;
  display: none; place-items: center; align-content: center; gap: 10px;
  background: var(--grey); color: #fff;
  font: 700 22px var(--cond); text-transform: uppercase; letter-spacing: .04em;
}
@media (orientation: landscape) and (max-height: 440px) {
  #rotate { display: grid; }
}

@media (hover: hover) and (pointer: fine) {
  .btn-lime:hover { background: #d8e019; }
  .btn-dark:hover { background: #585858; }
  .btn-ghost:hover { background: rgba(0, 0, 0, .05); }
  .icon-btn:hover { background: rgba(255, 255, 255, .12); }
  .link-btn:hover { text-decoration-color: #fff; }
}

@media (prefers-reduced-motion: reduce) {
  #start, .sheet-panel, .coupon.pop, #mult.bump { transition-duration: .01s; animation-duration: .01s; }
  #hud.finish #time-num { animation: none; }
}
