/* Precious ships ascent 75% / descent 25%, but caps are only 71.5% tall, so text sat high in buttons and badges.
   Shifting the metrics (same 100% total, so line heights are unchanged) centers caps and accented letters. */
@font-face { font-family: Precious; font-weight: 500; font-display: swap; ascent-override: 84%; descent-override: 16%; line-gap-override: 0%; src: url(/fonts/precious-medium.woff2) format("woff2"); }
@font-face { font-family: Precious; font-weight: 500; font-style: italic; font-display: swap; ascent-override: 84%; descent-override: 16%; line-gap-override: 0%; src: url(/fonts/precious-medium-italic.woff2) format("woff2"); }
@font-face { font-family: Precious; font-weight: 600; font-display: swap; ascent-override: 84%; descent-override: 16%; line-gap-override: 0%; src: url(/fonts/precious-demibold.woff2) format("woff2"); }
@font-face { font-family: Precious; font-weight: 700; font-display: swap; ascent-override: 84%; descent-override: 16%; line-gap-override: 0%; src: url(/fonts/precious-bold.woff2) format("woff2"); }

:root {
  --magenta: #ed135c;
  --purple: #24014c;
  --night: #12062b;
  --gold: #ffc94d;
  --ink: #f7f7f8;
  --font: "Precious", Tahoma, Geneva, Verdana, sans-serif;
  --spring: cubic-bezier(.2, 1.3, .35, 1);
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; background: var(--night); color: var(--ink); font-family: var(--font); overflow: hidden; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
body { display: flex; justify-content: center; }

#game {
  position: relative;
  width: min(100vw, calc(100dvh * .62));
  height: 100dvh;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* HUD */
.hud {
  position: absolute; left: 0; right: 0; top: 0;
  padding: calc(env(safe-area-inset-top) + 10px) 14px 8px;
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 14px;
  pointer-events: none;
  transition: opacity .3s;
}
.hud.hidden { opacity: 0; }
.hud .lives { display: flex; gap: 3px; }
.hud .lives svg { width: 24px; height: 24px; fill: var(--magenta); filter: drop-shadow(0 0 6px rgba(237,19,92,.6)); transition: transform .3s var(--spring), opacity .3s; }
.hud .lives svg.off { fill: none; stroke: rgba(255,255,255,.35); stroke-width: 1.5; filter: none; transform: scale(.85); }
.hud .lvl { flex: 1; text-align: center; font-size: 12px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud .score { min-width: 48px; text-align: right; font-variant-numeric: tabular-nums; }
.hud .pause { pointer-events: auto; border: 0; background: rgba(255,255,255,.12); color: #fff; width: 32px; height: 32px; border-radius: 5px; font-size: 10px; cursor: pointer; }

/* Overlays */
.overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(env(safe-area-inset-top) + 16px) 16px calc(env(safe-area-inset-bottom) + 16px);
  background: rgba(18, 6, 43, .35);
  opacity: 0; transition: opacity .35s ease;
  overflow-y: auto;
}
.overlay.in { opacity: 1; }
.overlay[hidden] { display: none; }
.overlay .card, .overlay .pf { transform: translateY(24px) scale(.96); transition: transform .55s var(--spring); }
.overlay.in .card, .overlay.in .pf { transform: none; }

.card {
  width: 100%; max-width: 360px;
  background: rgba(36, 1, 76, .78);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 24px;
  padding: 26px 22px 18px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.card p { font-size: 15px; line-height: 1.45; opacity: .88; margin-top: 10px; font-weight: 500; }
.card h1 { font-size: 46px; line-height: .95; margin-top: 18px; }
.card h1 em { font-style: normal; color: var(--magenta); }
.card h2 { font-size: 30px; line-height: 1.05; margin-top: 4px; }
.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: 11px !important; color: var(--gold); opacity: 1 !important; margin: 0 !important; }

.brandrow { display: flex; align-items: center; justify-content: center; gap: 10px; }
.simplo-logo { height: 26px; width: auto; display: block; }
.client { font-size: 13px; opacity: .8; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.3); }

.powers { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 16px 0 4px; }
.powers li { display: flex; flex-direction: column; align-items: center; font-size: 11px; line-height: 1.15; font-weight: 600; }
.powers img { width: 72px; height: 72px; margin: -14px; }
.powers small { font-weight: 500; opacity: .7; font-size: 10px; }

.btn {
  /* Based on .s-button--primary from simplo.cz */
  display: flex; justify-content: center; align-items: center;
  width: 100%; min-height: 50px;
  margin-top: 18px;
  border: 1px solid transparent; border-radius: 5px;
  padding: .5rem 2.5rem;
  font: 600 17px/1.5 var(--font);
  color: #fff; background: var(--magenta);
  box-shadow: 0 6px 16px #00000029;
  cursor: pointer;
  transition: color .3s, border-color .3s, background-color .3s, transform .2s var(--spring);
}
.btn:active { transform: scale(.97); }
@media (hover: hover) {
  .btn:hover { color: #fff; background: var(--purple); border-color: rgba(255,255,255,.25); } /* thin light border keeps it visible on the purple cards */
}
.btn.white { color: var(--purple); background: #fff; }
@media (hover: hover) { .btn.white:hover { color: #fff; background: var(--purple); border-color: rgba(255,255,255,.25); } }
.link { display: inline-block; margin-top: 12px; padding: 8px; border: 0; background: none; color: #fff; opacity: .75; font: 600 14px var(--font); cursor: pointer; text-decoration: none; }
.hint { font-size: 12px !important; opacity: .6 !important; }

/* PF – postcard */
.overlay.pfwrap { background: linear-gradient(rgba(18,6,43,.55), rgba(18,6,43,0) 75%); justify-content: flex-start; padding-top: calc(env(safe-area-inset-top) + clamp(40px, 8vh, 80px)); }
.pf { width: 100%; max-width: 360px; min-height: 100%; display: flex; flex-direction: column; align-items: center; }
.overlay .pf { transform: translateY(-40px) rotate(-7deg) scale(.9); transition: transform .8s var(--spring); }
.overlay.in .pf { transform: none; }

.pf-air {
  width: 100%;
  padding: 7px;
  border-radius: 6px;
  background: repeating-linear-gradient(-45deg, var(--magenta) 0 12px, #fbf8f3 12px 20px, var(--purple) 20px 32px, #fbf8f3 32px 40px);
  transform: rotate(-1.5deg);
  box-shadow: 0 24px 50px rgba(0,0,0,.45);
}
.pf-card {
  position: relative;
  background: #fbf8f3 repeating-linear-gradient(0deg, transparent 0 27px, rgba(36,1,76,.05) 27px 28px);
  color: var(--purple);
  border-radius: 3px;
  padding: 22px 20px 18px;
  text-align: left;
}
.pf-stamp {
  position: absolute; top: 14px; right: 14px;
  width: 76px; padding: 5px;
  background: radial-gradient(circle at 4px 4px, transparent 2.6px, #fff 3px) -4px -4px / 8px 8px;
  filter: drop-shadow(0 1px 1px rgba(36,1,76,.25));
  transform: rotate(4deg);
}
.pf-stamp-in { background: #fff; padding: 3px 3px 2px; text-align: center; }
.pf-stamp img { display: block; width: 100%; background: var(--purple); border-radius: 1px; }
.pf-stamp span { display: block; font-size: 8px; font-weight: 700; letter-spacing: .08em; margin-top: 2px; color: var(--magenta); }
.pf-postmark {
  position: absolute; top: 46px; right: 64px;
  width: 64px; height: 64px; border-radius: 50%;
  border: 2px solid rgba(237,19,92,.55);
  color: rgba(237,19,92,.7);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 7px; font-weight: 700; letter-spacing: .1em; line-height: 1.3;
  transform: rotate(-14deg);
  pointer-events: none;
}
.pf-postmark b { font-size: 10px; border-top: 1px solid currentColor; border-bottom: 1px solid currentColor; padding: 1px 0; }
.pf-big { font-size: 64px; font-weight: 700; line-height: .82; color: var(--magenta); }
.pf-big em { display: block; font-style: normal; color: var(--purple); font-size: 52px; }
.pf-greet { font-size: 19px; font-weight: 700; margin-top: 20px; }
.pf-msg { font-size: 15px; line-height: 28px; margin-top: 10px; font-weight: 500; }
.pf-fact { margin-top: 10px; font-weight: 700; color: var(--magenta); }
.pf-sign { margin-top: 10px; font-size: 20px; font-style: italic; font-weight: 500; transform: rotate(-2deg); transform-origin: left; }
.pf-logos { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding-top: 12px; border-top: 1px dashed rgba(36,1,76,.25); }
.pf-simplo { height: 20px; width: auto; }
.pf-client { height: 14px; width: auto; max-width: 140px; }
.pf-x { opacity: .4; font-size: 14px; }

.pf-actions { margin-top: auto; padding-top: 120px; display: flex; flex-direction: column; align-items: center; width: 100%; }
.pf-actions .link { opacity: 1; color: var(--purple); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .overlay .card, .overlay .pf { transition: none; transform: none; }
}
@media (max-height: 640px) {
  .card h1 { font-size: 36px; margin-top: 10px; }
  .powers { display: none; }
  .pf-big { font-size: 48px; }
  .pf-big em { font-size: 40px; }
}
