/* EKP brand — Pantone 303 (tmavě modrá) + Pantone 397 (žlutá) + Source Serif Pro */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  /* Firemní barvy EKP */
  --paper:        #FFFFFF;
  --paper-deep:   #F2F4F7;
  --paper-shade:  #E1E6EC;
  --ink:          #001E26;     /* nejtmavší — kontury, hlavní text */
  --ink-soft:     #003A56;     /* Pantone 303 — primární */
  --stamp:        #003A56;     /* Pantone 303 — razítka, akce */
  --stamp-deep:   #001E26;
  --accent:       #DDD200;     /* Pantone 397 — akcent, CTA, highlight */
  --rule:         rgba(0, 59, 73, 0.18);

  --font-display: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono:    'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-brand:   'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; height: 100dvh; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { height: 100%; height: 100dvh; overflow: hidden; overscroll-behavior: none; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.4;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.01em;
  font-variant-numeric: lining-nums;
  font-feature-settings: "lnum" 1, "tnum" 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Respect user motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Grain + subtle grid texture overlaid on every page */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(0,20,41,0.05) 23px 24px),
    repeating-linear-gradient(90deg, transparent 0 23px, rgba(0,20,41,0.05) 23px 24px);
  z-index: 1;
  mix-blend-mode: multiply;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='5'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.18 0'/></filter><rect width='240' height='240' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
  mix-blend-mode: multiply;
}

.screen {
  position: absolute;
  inset: 0;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  z-index: 3;
}
.hidden { display: none !important; }

/* ===== STAMP / NÁZEV ===== */
.brand {
  text-align: center;
  position: relative;
}
.stamp-badge {
  width: 132px; height: 132px;
  border-radius: 50%;
  border: 3px solid var(--stamp);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  margin: 0 auto 20px;
  color: var(--stamp);
  transform: rotate(-7deg);
  font-family: var(--font-mono);
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 13px;
  position: relative;
  background: var(--paper);
}
.stamp-badge::before, .stamp-badge::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px solid var(--stamp);
  opacity: 0.5;
}
.stamp-badge::after { inset: 12px; opacity: 0.3; }
.stamp-badge .num {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 900;
  line-height: 1;
  margin: 4px 0;
}

h1.title {
  font-family: var(--font-brand);
  font-weight: 900;
  font-size: clamp(64px, 20vw, 110px);
  line-height: 0.82;
  letter-spacing: -0.02em;
  color: var(--ink);
}
h1.title em {
  font-style: normal;
  color: var(--stamp);
  display: block;
  transform: translateX(-6px);
}
.tagline {
  font-family: var(--font-mono);
  font-size: 13px;
  margin-top: 18px;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  border-top: 1.5px dashed var(--rule);
  border-bottom: 1.5px dashed var(--rule);
  padding: 10px 0;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.hint {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  text-align: center;
  margin-top: 8px;
  opacity: 0.7;
}

/* Prize badge on start screen */
.prize-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 2px dashed var(--stamp);
  background: rgba(2, 58, 87, 0.05);
  max-width: 320px;
  transform: rotate(-1deg);
}
.prize-icon { font-size: 28px; }
.prize-line {
  display: block;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1;
}
.prize-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  margin-top: 4px;
}

/* End screen action row */
.end-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 380px;
}
.end-actions button { width: 100%; }

/* ===== BOOT LOADER ===== */
#boot-loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}
#boot-loader.done {
  opacity: 0;
  visibility: hidden;
}
.boot-logo {
  width: 88px; height: 88px;
  background: var(--stamp);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 48px;
  letter-spacing: -1px;
  border: 4px solid var(--ink);
  box-shadow: 8px 8px 0 var(--accent);
}
.boot-title {
  font-family: var(--font-brand);
  font-weight: 900;
  font-size: 56px;
  line-height: 0.85;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-align: center;
}
.boot-spinner {
  width: 36px; height: 36px;
  border: 4px solid var(--ink);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: boot-spin 0.9s linear infinite;
}
@keyframes boot-spin { to { transform: rotate(360deg); } }
.boot-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--ink-soft);
}

/* ===== Avatar picker ===== */
.avatar-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 4px;
}
.avatar-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
}
.avatar-swatches {
  display: flex;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
}
.avatar-swatches .swatch {
  width: 32px; height: 32px;
  border-radius: 0;
  border: 2.5px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.12s ease;
  padding: 0;
  font-size: 0;
  font-family: inherit;
}
.avatar-swatches .swatch:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.avatar-swatches .swatch.active {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}

/* ===== Presence ===== */
.presence {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-shadow: 0 0 0 var(--ink);
  -webkit-text-stroke: 0.5px var(--ink);
  text-align: center;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--accent);
  display: inline-block;
}
.presence.hidden { display: none; }

/* ===== Lock banner on start screen ===== */
.lock-banner {
  position: absolute;
  top: 12px; left: 12px; right: 12px;
  background: var(--ink);
  color: var(--paper);
  padding: 14px 18px;
  border: 3px solid var(--stamp);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 10;
}
.lock-banner.hidden { display: none; }
.lock-banner strong {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.05em;
  color: var(--stamp);
}
.lock-banner span {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--ink-soft);
}

/* ===== First-door hint ===== */
.first-hint {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  border: 2px solid var(--accent);
  pointer-events: none;
  animation: hint-pulse 1.2s ease-in-out infinite;
}
.first-hint.hidden { display: none; }
.first-hint-arrow {
  font-size: 22px;
  color: var(--accent);
  animation: hint-bounce 0.7s ease-in-out infinite;
}
@keyframes hint-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(221, 208, 4, 0.4); }
  50%      { box-shadow: 0 0 0 12px rgba(221, 208, 4, 0); }
}
@keyframes hint-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(4px); }
}

/* ===== Perfect run overlay ===== */
.perfect-run {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(0, 20, 41, 0.55);
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.perfect-run.hidden { display: none; }
.perfect-tag {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.3em;
  background: var(--stamp);
  color: var(--paper);
  padding: 8px 18px;
  transform: rotate(-3deg);
}
.perfect-big {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(120px, 30vw, 220px);
  line-height: 0.9;
  color: var(--accent);
  -webkit-text-stroke: 6px var(--ink);
  paint-order: stroke fill;
  filter: drop-shadow(8px 8px 0 rgba(0, 20, 41, 0.4));
  animation: perfect-pop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.4) forwards;
}
.perfect-bonus {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 56px;
  color: var(--paper);
  background: var(--ink);
  padding: 8px 24px;
  border: 3px solid var(--accent);
  letter-spacing: -0.01em;
}
@keyframes perfect-pop {
  0%   { transform: scale(0.4); opacity: 0; }
  60%  { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ===== FORMULÁŘ ===== */
#name-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 380px;
  margin-top: 36px;
}
.field-label {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
}
.field-label::after {
  content: 'POVINNÉ POLE';
  color: var(--stamp);
}
#name-input {
  width: 100%;
  padding: 16px 18px;
  border: 2.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  outline: none;
  border-radius: 0;
  letter-spacing: 0.02em;
}
#name-input::placeholder { color: rgba(10,10,20,0.4); font-weight: 500; }
#name-input:focus { border-color: var(--stamp); }

button {
  cursor: pointer;
  padding: 18px 24px;
  border: 2.5px solid var(--ink);
  background: var(--stamp);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.04em;
  border-radius: 0;
  position: relative;
  transition: transform 0.08s ease;
  box-shadow: 6px 6px 0 var(--ink);
}
button:active {
  transform: translate(3px, 3px);
  box-shadow: 3px 3px 0 var(--ink);
}
button.ghost {
  background: var(--paper);
  color: var(--ink);
}

.rules {
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.1em;
  text-align: center;
}
.rules .dot { color: var(--stamp); margin: 0 6px; }

/* ===== HOW-TO TUTORIAL ===== */
.howto {
  margin-top: 28px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.howto-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  text-align: center;
}
.howto-zones {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.howto-zones .zone {
  position: relative;
  height: 76px;
  border: 2px dashed var(--rule);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  overflow: hidden;
}
.howto-zones .zone .finger {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  margin-top: -16px;
  margin-left: -11px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--ink);
  animation: tap 2.4s infinite;
}
.howto-zones .zone:nth-child(2) .finger { animation-delay: 0.8s; }
.howto-zones .zone:nth-child(3) .finger { animation-delay: 1.6s; }
@keyframes tap {
  0%, 60%, 100% { transform: scale(1); opacity: 0.85; }
  20% { transform: scale(1.6); opacity: 1; box-shadow: 0 0 0 8px rgba(221, 208, 4, 0.25); }
  35% { transform: scale(0.9); opacity: 0.6; }
}
.howto-swipe {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--ink-soft);
  text-align: center;
  margin-top: 4px;
}

/* ===== SCORE POPUP & SCREEN FLASH ===== */
.score-popup {
  position: absolute;
  z-index: 5;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 56px;
  letter-spacing: -0.01em;
  color: var(--accent);
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
  pointer-events: none;
  animation: float-up 1.2s ease-out forwards;
  transform-origin: center;
}
.score-popup.good { color: var(--accent); }
.score-popup.bad  { color: #FF6B45; -webkit-text-stroke-color: var(--ink); }
.score-popup.meh  { color: #FFFFFF; -webkit-text-stroke-color: var(--ink-soft); font-size: 36px; }
@keyframes float-up {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(0.6); }
  20%  { opacity: 1; transform: translate(-50%, -10px) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -180px) scale(0.9); }
}
.flash-correct, .flash-wrong {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  animation: flash 0.42s ease-out forwards;
}
.flash-correct { background: rgba(221, 208, 4, 0.32); }
.flash-wrong { background: rgba(201, 36, 16, 0.5); }
@keyframes flash {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* ===== MUTE BUTTON ===== */
.mute-btn {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom, 24px) + 28px);
  right: 12px;
  z-index: 6;
  width: 40px; height: 40px;
  border: 2px solid var(--ink);
  background: var(--paper);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  box-shadow: 3px 3px 0 var(--ink);
  font-family: var(--font-mono);
  opacity: 0.85;
}
.mute-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

/* ===== HRA — klikací quiz ===== */
#screen-game {
  padding: calc(env(safe-area-inset-top, 0px) + 12px)
           calc(env(safe-area-inset-right, 0px) + 14px)
           calc(env(safe-area-inset-bottom, 0px) + 18px)
           calc(env(safe-area-inset-left, 0px) + 14px);
  justify-content: flex-start;
  gap: 14px;
  background: var(--paper);
}

/* Small screens — iPhone SE, older Android (<= 360px wide) */
@media (max-width: 360px) {
  #screen-game {
    padding: calc(env(safe-area-inset-top, 0px) + 8px) 10px 12px;
    gap: 10px;
  }
  .game-question {
    font-size: 18px;
    min-height: 70px;
  }
  .game-opt {
    padding: 14px 14px;
    gap: 10px;
  }
  .game-opt .opt-letter {
    width: 42px;
    height: 42px;
    font-size: 24px;
  }
  .game-opt .opt-text {
    font-size: 17px;
  }
  .game-progress {
    padding: 6px 10px;
    font-size: 24px;
  }
  .game-correct {
    padding: 6px 12px;
  }
  .game-correct #hud-correct-num {
    font-size: 34px;
  }
  .game-timer-num {
    width: 44px;
    height: 44px;
    font-size: 24px;
  }
}

/* Very tall phones (e.g. iPhone Pro Max) — give game options a bit more breathing room */
@media (min-height: 800px) {
  .game-opt { padding: 22px 18px; }
}

.game-hud {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 12px;
  margin-top: env(safe-area-inset-top, 0px);
}
.game-progress {
  background: var(--paper);
  border: 3px solid var(--ekp-dark);
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 32px;
  line-height: 1;
  color: var(--ekp-dark);
  letter-spacing: -0.02em;
  box-shadow: 3px 3px 0 var(--ekp-green);
}
.game-progress-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
}
.game-progress-of {
  font-size: 20px;
  color: var(--ink-soft);
  margin-left: 2px;
}
.game-correct {
  background: var(--ekp-green);
  border: 3px solid var(--ekp-dark);
  padding: 10px 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  box-shadow: -3px 3px 0 var(--ekp-dark);
}
.game-correct #hud-correct-num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 44px;
  line-height: 1;
  color: var(--ekp-dark);
  letter-spacing: -0.02em;
}
.game-correct-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--ekp-dark);
  margin-top: -2px;
}

/* ===== Timer (bar + countdown number) ===== */
.game-timer {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
}
.game-timer-bar {
  flex: 1;
  height: 14px;
  background: var(--paper-deep);
  border: 2px solid var(--ekp-dark);
  position: relative;
  overflow: hidden;
}
.game-timer-bar span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--ekp-green);
}
.game-timer-num {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ekp-dark);
  color: var(--paper);
  border: 2px solid var(--ekp-dark);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.game-timer-num.warn {
  background: #C92410;
  animation: timer-pulse 0.5s ease-in-out infinite;
}
@keyframes timer-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* ===== Question ===== */
.game-question {
  width: 100%;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(22px, 6.5vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ekp-dark);
  text-align: center;
  text-transform: none;
  padding: 4px 0 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Answer buttons (vertical stack) ===== */
.game-options {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
}
.game-opt {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 18px;
  border: 3px solid var(--ekp-dark);
  background: var(--paper);
  color: var(--ekp-dark);
  text-align: left;
  cursor: pointer;
  border-radius: 0;
  box-shadow: 5px 5px 0 var(--ekp-dark);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.18s ease, border-color 0.18s ease;
  font-family: var(--font-mono);
  text-transform: none;
  font-size: inherit;
  letter-spacing: 0;
  font-weight: 600;
}
.game-opt:active:not(:disabled) {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--ekp-dark);
}
.game-opt:focus {
  outline: none;
}
.game-opt:focus-visible {
  outline: 3px solid var(--ekp-green);
  outline-offset: 2px;
}
.game-opt:disabled {
  cursor: default;
  opacity: 1;
  background: var(--paper);
  color: var(--ekp-dark);
  box-shadow: 3px 3px 0 var(--ekp-dark);
}
.game-opt .opt-letter {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ekp-green);
  color: var(--ekp-dark);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 32px;
  line-height: 1;
  border: 2px solid var(--ekp-dark);
}
.game-opt .opt-text {
  flex: 1;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(22px, 5.5vw, 30px);
  line-height: 1.15;
  color: var(--ekp-dark);
  letter-spacing: -0.01em;
  word-break: break-word;
}
.game-opt.correct {
  background: #2F8F4F;
  border-color: #1F6735;
  color: var(--paper);
}
.game-opt.correct .opt-letter {
  background: var(--paper);
  color: #1F6735;
}
.game-opt.correct .opt-text { color: var(--paper); }
.game-opt.wrong {
  background: #C92410;
  border-color: #8A1707;
  color: var(--paper);
}
.game-opt.wrong .opt-letter {
  background: var(--paper);
  color: #8A1707;
}
.game-opt.wrong .opt-text { color: var(--paper); }

/* ===== Full-screen flash overlay on answer ===== */
.game-flash {
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  animation: flash 0.5s ease-out forwards;
}
.game-flash.hidden { display: none; }
.flash-correct { background: rgba(47, 143, 79, 0.35); }
.flash-wrong   { background: rgba(201, 36, 16, 0.45); }
.flash-timeout { background: rgba(0, 20, 41, 0.30); }
@keyframes flash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* ===== COUNTDOWN ===== */
.countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  pointer-events: none;
  background: rgba(0, 20, 41, 0.18);
  backdrop-filter: blur(2px);
}
.countdown.hidden { display: none; }
.countdown-num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(180px, 50vw, 320px);
  line-height: 1;
  color: var(--accent);
  -webkit-text-stroke: 6px var(--ink);
  paint-order: stroke fill;
  letter-spacing: -0.02em;
  animation: pop 1s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
  filter: drop-shadow(8px 8px 0 rgba(0,20,41,0.4));
}
.countdown-num.go {
  font-size: clamp(96px, 22vw, 180px);
  color: var(--paper);
  -webkit-text-stroke: 5px var(--accent);
  background: var(--stamp);
  padding: 24px 56px;
  transform: rotate(-4deg);
}
@keyframes pop {
  0%   { transform: scale(0.4); opacity: 0; }
  20%  { transform: scale(1.15); opacity: 1; }
  60%  { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.3); opacity: 0; }
}
.hud {
  position: absolute;
  top: env(safe-area-inset-top, 14px);
  left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 18px;
  pointer-events: none;
  z-index: 4;
}
.hud-progress {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.01em;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  padding: 6px 12px;
  box-shadow: 3px 3px 0 var(--accent);
  transform: rotate(-2deg);
}
.hud-progress::before {
  content: 'OTÁZKA';
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  margin-bottom: 2px;
}
.hud-correct {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  background: var(--accent);
  border: 2.5px solid var(--ink);
  padding: 6px 14px;
  box-shadow: -3px 3px 0 var(--ink);
  transform: rotate(2deg);
  transition: transform 0.18s ease;
}
.hud-correct.pulse {
  animation: hud-pulse 0.6s ease-out;
}
@keyframes hud-pulse {
  0% { transform: rotate(2deg) scale(1); }
  50% { transform: rotate(2deg) scale(1.25); }
  100% { transform: rotate(2deg) scale(1); }
}
.hud-correct-num {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 900;
  line-height: 0.9;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.hud-correct-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--ink);
  margin-top: -2px;
}

.hud-question {
  position: absolute;
  top: 110px;
  left: 10px; right: 10px;
  background: rgba(0, 20, 41, 0.92);
  backdrop-filter: blur(4px);
  color: var(--paper);
  padding: 0 0 6px;
  z-index: 4;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.2s ease;
  pointer-events: none;
  box-shadow: 4px 4px 0 var(--accent);
  overflow: hidden;
}
.hud-question.show { opacity: 1; transform: none; }
.hud-question.warn {
  box-shadow: 4px 4px 0 #C92410;
  animation: warn-shake 0.5s ease-in-out infinite;
}
@keyframes warn-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}
.timer-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
}
.timer-bar span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent);
  transition: width 5000ms linear;
}
.hud-question.warn .timer-bar span {
  background: #FF5C5C;
}
.hud-q-text {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 17px;
  line-height: 1.05;
  letter-spacing: -0.005em;
  text-align: center;
  margin: 8px 12px 8px;
}
.hud-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  font-family: var(--font-mono);
  font-weight: 700;
  margin: 0 8px;
}
.hud-options .opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 4px 4px;
  text-align: center;
  border-left: 1px solid rgba(255,255,255,0.18);
  font-size: 12px;
  line-height: 1.15;
  min-width: 0;
}
.hud-options .opt:first-child { border-left: 0; }
.hud-options b {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 2px;
}
.hud-options .opt-a b { color: #5BA9D6; }
.hud-options .opt-b b { color: var(--accent); }
.hud-options .opt-c b { color: #FF6B45; }
.hud-options .opt span {
  display: block;
  font-size: 12px;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* ===== KONEC BĚHU ===== */
#screen-end {
  background: var(--paper);
  gap: 24px;
}
.end-stamp {
  width: 180px; height: 180px;
  border-radius: 50%;
  border: 4px solid var(--stamp);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  color: var(--stamp);
  transform: rotate(-12deg);
  font-family: var(--font-mono);
  font-weight: 800;
  position: relative;
}
.end-stamp::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1.5px solid var(--stamp);
  border-radius: 50%;
  opacity: 0.4;
}
.end-stamp .label { font-size: 12px; letter-spacing: 0.2em; }
.end-stamp .big {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 900;
  line-height: 1;
  margin: 4px 0;
  color: var(--stamp);
}

#screen-end h2 {
  font-family: var(--font-display);
  font-size: clamp(48px, 12vw, 84px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 0.9;
  text-align: center;
}

.result {
  width: 100%;
  max-width: 380px;
  background: transparent;
  border: 2.5px solid var(--ink);
  padding: 4px;
}
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  font-weight: 700;
  border-bottom: 1.5px dashed var(--rule);
}
.result-row:last-child { border-bottom: 0; }
.result-row strong {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 900;
  color: var(--stamp);
  letter-spacing: 0;
}

/* ===== TV LEADERBOARD ===== */
body.tv {
  font-size: 18px;
}
.tv-header {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
  padding: 32px 48px 24px;
  border-bottom: 4px double var(--ink);
  z-index: 3;
}
.tv-stamp {
  width: 140px; height: 140px;
  border-radius: 50%;
  border: 4px solid var(--stamp);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  color: var(--stamp);
  transform: rotate(-8deg);
  font-family: var(--font-mono);
  font-weight: 800;
  letter-spacing: 0.1em;
  font-size: 12px;
  background: var(--paper);
  position: relative;
}
.tv-stamp::before, .tv-stamp::after {
  content: '';
  position: absolute;
  border: 1.5px solid var(--stamp);
  border-radius: 50%;
}
.tv-stamp::before { inset: 8px; opacity: 0.5; }
.tv-stamp::after { inset: 14px; opacity: 0.3; }
.tv-stamp .num {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 900;
  line-height: 1;
  margin: 2px 0;
  color: var(--stamp);
}
.tv-title {
  font-family: var(--font-brand);
  font-weight: 900;
  font-size: clamp(56px, 8vw, 132px);
  line-height: 0.82;
  letter-spacing: -0.02em;
}
.tv-title em {
  font-style: normal;
  color: var(--stamp);
  display: block;
}
.tv-sub {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.18em;
  margin-top: 10px;
  color: var(--ink-soft);
}
.tv-qr {
  text-align: center;
  background: var(--ink);
  padding: 16px 16px 12px;
  position: relative;
  transform: rotate(2deg);
}
.tv-qr::before {
  content: 'NASKENUJ';
  position: absolute;
  top: -10px; left: 50%;
  transform: translateX(-50%);
  background: var(--stamp);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
  padding: 3px 10px;
}
.tv-qr img {
  width: 280px; height: 280px;
  display: block;
  background: white;
  padding: 12px;
}
.tv-qr p {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--paper);
  letter-spacing: 0.1em;
  word-break: break-all;
}

.tv-main {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 48px;
  padding: 32px 48px;
  height: calc(100vh - 290px);
  overflow: hidden;
  position: relative;
  z-index: 3;
}

.section-title {
  font-family: var(--font-display);
  font-size: 58px;
  font-weight: 900;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.section-title::after {
  content: '';
  flex: 1;
  margin-left: 16px;
  height: 0;
  border-bottom: 2.5px dashed var(--rule);
  transform: translateY(-8px);
}
.section-title .meta {
  font-family: var(--font-mono);
  font-size: 18px;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  font-weight: 700;
  margin-left: 16px;
}

#lb {
  list-style: none;
  display: flex; flex-direction: column;
  gap: 0;
}
.lb-row {
  display: grid;
  grid-template-columns: 90px 1fr 170px 220px;
  align-items: baseline;
  padding: 18px 0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 30px;
  border-bottom: 1.5px dashed var(--rule);
  letter-spacing: 0.02em;
  position: relative;
}
.lb-row .rank {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 900;
  color: var(--ink-soft);
  letter-spacing: -0.02em;
}
.lb-row .name {
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-row .doors {
  font-size: 20px;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}
.lb-row .score {
  text-align: right;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 60px;
  color: var(--stamp);
  letter-spacing: -0.02em;
}
.lb-row.first {
  background: var(--ink);
  color: var(--paper);
  padding: 22px 20px;
  margin: 0 -20px;
  border-bottom: 0;
}
.lb-row.first .rank { color: var(--stamp); }
.lb-row.first .doors { color: var(--paper-deep); }
.lb-row.first .score { color: var(--stamp); font-size: 76px; }
.lb-row.first::after {
  content: '★ LEADER';
  position: absolute;
  top: -12px; right: 20px;
  background: var(--stamp);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.2em;
  padding: 5px 14px;
}

#active {
  list-style: none;
  display: flex; flex-direction: column;
  gap: 8px;
  max-height: 100%;
  overflow: hidden;
}
#active li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 18px;
  border: 2px solid var(--accent);
  background: rgba(221, 208, 4, 0.12);
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 24px;
  position: relative;
}
#active li::before {
  content: '●';
  color: var(--accent);
  margin-right: 10px;
  font-size: 28px;
  animation: pulse 1.4s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: 0.3 } }
#active .score {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 900;
  color: var(--ink);
}
#active .empty, #lb .empty {
  font-family: var(--font-mono);
  font-style: italic;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
  padding: 14px 0;
  font-size: 22px;
}

.tv-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  padding: 18px 48px;
  border-top: 4px double var(--ink);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.18em;
  background: var(--paper);
  z-index: 3;
}
.tv-footer .center { color: var(--stamp); }

/* ===== TV WOW MOMENT (new leader) ===== */
.wow {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 20, 41, 0.78);
  backdrop-filter: blur(8px);
  pointer-events: none;
}
.wow.hidden { display: none; }
.wow-card {
  text-align: center;
  background: var(--paper);
  padding: 56px 80px;
  border: 6px solid var(--ink);
  box-shadow: 18px 18px 0 var(--accent);
  animation: wow-pop 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2) forwards;
  transform: rotate(-2deg);
  position: relative;
  z-index: 2;
}
.wow-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.25em;
  background: var(--stamp);
  color: var(--paper);
  padding: 8px 22px;
  margin-bottom: 28px;
}
.wow-name {
  font-family: var(--font-display);
  font-size: clamp(70px, 10vw, 150px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 0.9;
  color: var(--ink);
  word-break: break-word;
}
.wow-score {
  font-family: var(--font-display);
  font-size: clamp(120px, 18vw, 280px);
  font-weight: 900;
  line-height: 0.9;
  color: var(--accent);
  -webkit-text-stroke: 7px var(--ink);
  paint-order: stroke fill;
  margin: 12px 0 4px;
}
.wow-sub {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
}
@keyframes wow-pop {
  0%   { transform: rotate(-2deg) scale(0.4); opacity: 0; }
  60%  { transform: rotate(-2deg) scale(1.06); opacity: 1; }
  100% { transform: rotate(-2deg) scale(1); opacity: 1; }
}
.wow-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  top: -20px;
  width: 14px;
  height: 24px;
  display: block;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0%   { transform: translateY(-40px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0.7; }
}

/* ===== Fact card on TV (idle rotator) ===== */
.fact-card {
  margin-top: 24px;
  border: 3px solid var(--ink);
  background: var(--paper);
  padding: 20px 22px;
  position: relative;
  transform: rotate(-1.5deg);
  box-shadow: 8px 8px 0 var(--accent);
}
.fact-card.hidden { display: none; }
.fact-tag {
  display: inline-block;
  background: var(--stamp);
  color: var(--paper);
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.2em;
  padding: 6px 14px;
  margin-bottom: 14px;
}
.fact-text {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 38px;
  line-height: 1.05;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* ===== Podium / vyhlášení vítězů ===== */
.podium {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: radial-gradient(120% 80% at 50% 0%, var(--ink) 0%, #000814 60%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
  padding: 40px;
}
.podium.hidden { display: none; }
.podium-tag {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(44px, 5vw, 72px);
  letter-spacing: -0.01em;
  color: var(--accent);
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
  filter: drop-shadow(8px 8px 0 var(--stamp));
}
.podium-stage {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  align-items: end;
  gap: 24px;
  width: 100%;
  max-width: 1100px;
}
.podium-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: podium-rise 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2) forwards;
  opacity: 0;
}
.place-2 { animation-delay: 0.2s; }
.place-1 { animation-delay: 0.6s; }
.place-3 { animation-delay: 0.4s; }
@keyframes podium-rise {
  0%   { transform: translateY(80px); opacity: 0; }
  100% { transform: translateY(0);    opacity: 1; }
}
.podium-place.empty .medal,
.podium-place.empty .podium-name,
.podium-place.empty .podium-score { opacity: 0.3; }
.podium-place .medal {
  font-size: clamp(56px, 7vw, 96px);
  line-height: 1;
}
.podium-place .podium-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(34px, 4vw, 56px);
  color: var(--paper);
  letter-spacing: -0.01em;
  text-align: center;
  word-break: break-word;
}
.podium-place .podium-score {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(46px, 6vw, 88px);
  color: var(--accent);
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  line-height: 1;
}
.podium-block {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(80px, 10vw, 140px);
  color: var(--ink);
  background: var(--accent);
  width: 100%;
  text-align: center;
  border: 4px solid var(--paper);
  border-bottom: 0;
}
.place-1 .podium-block { padding: 80px 0; background: var(--accent); }
.place-2 .podium-block { padding: 50px 0; background: #B8B8B8; }
.place-3 .podium-block { padding: 30px 0; background: #C18A4D; }
.podium-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

/* ===== Email input + EKPřehled toggle ===== */
#email-input {
  width: 100%;
  padding: 16px 18px;
  border: 2.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  outline: none;
  border-radius: 0;
  letter-spacing: 0.02em;
}
#email-input::placeholder { color: rgba(10,10,20,0.4); font-weight: 500; }
#email-input:focus { border-color: var(--stamp); }
#email-input:invalid:not(:placeholder-shown) { border-color: #C92410; }

#name-form .field-label {
  margin-top: 4px;
  margin-bottom: -6px;
}
#name-form .field-label:first-of-type { margin-top: 0; }

.ekp-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 2.5px dashed var(--rule);
  cursor: pointer;
  user-select: none;
  background: var(--paper);
  margin-top: 8px;
}
.ekp-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.ekp-box {
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--ink);
  background: var(--paper);
  position: relative;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.ekp-box::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  color: var(--ink);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.ekp-toggle input:checked ~ .ekp-box {
  background: var(--accent);
}
.ekp-toggle input:checked ~ .ekp-box::after {
  opacity: 1;
}
.ekp-toggle input:focus-visible ~ .ekp-box {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.ekp-label {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-transform: none;
}
.ekp-label em {
  font-style: normal;
  color: var(--stamp);
  font-weight: 800;
}

/* ===== Prize card on end screen ===== */
.prize-card {
  width: 100%;
  max-width: 420px;
  background: var(--paper);
  border: 4px solid var(--ink);
  padding: 28px 24px;
  text-align: center;
  box-shadow: 10px 10px 0 var(--accent);
  position: relative;
  transform: rotate(-1deg);
}
.prize-card-tag {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.25em;
  padding: 6px 16px;
  margin-bottom: 14px;
}
.prize-card-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(40px, 9vw, 64px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--stamp);
  margin-bottom: 16px;
  word-break: break-word;
}
.prize-card-message {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-transform: none;
  margin-top: 4px;
}
.prize-card.tier-top {
  background: var(--accent);
  box-shadow: 12px 12px 0 var(--ink);
}
.prize-card.tier-top .prize-card-name { color: var(--ink); }
.prize-card.tier-top .prize-card-tag { background: var(--stamp); }
.prize-card.tier-high {
  box-shadow: 10px 10px 0 var(--stamp);
}
.prize-card.tier-mid {
  box-shadow: 10px 10px 0 var(--ink-soft);
}
.prize-card.tier-low .prize-card-name { font-size: clamp(32px, 7vw, 48px); }
.prize-card.tier-zero {
  background: var(--paper-deep);
  transform: rotate(-1.5deg);
}
.prize-card.tier-zero .prize-card-name {
  color: var(--ink-soft);
  font-size: clamp(28px, 6vw, 40px);
}

#screen-end .end-stamp {
  margin-bottom: 8px;
}
#screen-end .end-actions {
  margin-top: 12px;
}

/* ===== TV — simplified live view ===== */
.tv-main-simple {
  grid-template-columns: 1.4fr 1fr;
}
.tv-main-simple #active li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 18px;
  align-items: baseline;
}
.tv-main-simple #active li .run-progress {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}
.tv-main-simple .section-title .meta {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 900;
  color: var(--stamp);
  letter-spacing: -0.02em;
  margin-left: 12px;
}

.day-stats {
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100%;
}
.big-stat {
  background: var(--ink);
  color: var(--paper);
  padding: 36px 32px 28px;
  border: 4px solid var(--ink);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  box-shadow: 10px 10px 0 var(--accent);
  position: relative;
}
.big-stat-label {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.25em;
  color: var(--accent);
}
.big-stat-num {
  font-family: var(--font-display);
  font-size: clamp(96px, 12vw, 180px);
  font-weight: 900;
  line-height: 0.9;
  color: var(--paper);
  letter-spacing: -0.04em;
}
.big-stat-sub {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--paper-deep);
  opacity: 0.75;
}

.prize-tiers {
  background: var(--paper);
  border: 3px solid var(--ink);
  padding: 20px 24px;
}
.prize-tier-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--stamp);
  margin-bottom: 10px;
  border-bottom: 2.5px dashed var(--rule);
  padding-bottom: 6px;
}
.prize-tiers ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.prize-tiers li {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px dashed var(--rule);
  font-family: var(--font-mono);
}
.prize-tiers li:last-child { border-bottom: 0; }
.prize-tier-num {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.02em;
  text-align: center;
  background: var(--accent);
  border: 2px solid var(--ink);
  padding: 2px 0;
}
.prize-tier-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
}

/* ===== Brand colors (EKP) ===== */
:root {
  --ekp-dark:  #003A56;   /* Pantone 303 */
  --ekp-green: #DDD200;   /* Pantone 397 */
}

/* ===== Registration title — inline EKPřehled ===== */
h1.title {
  font-family: var(--font-brand);
  font-size: clamp(54px, 17vw, 92px);
  color: var(--ekp-dark);
}
h1.title em {
  display: inline;
  font-style: normal;
  color: var(--ekp-green);
  -webkit-text-stroke: 2px var(--ekp-dark);
  paint-order: stroke fill;
  transform: none;
}
.subtitle {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  text-align: center;
  margin-top: -8px;
  margin-bottom: 10px;
  border-top: 1.5px dashed var(--rule);
  border-bottom: 1.5px dashed var(--rule);
  padding: 10px 0;
  max-width: 380px;
  width: 100%;
}
.howto-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 380px;
  padding: 4px 0;
  margin: 4px 0 12px;
  counter-reset: step;
}
.howto-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 2px solid var(--ink);
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.howto-steps li strong {
  font-weight: 800;
  color: var(--ekp-dark);
}
.howto-steps .step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: var(--ekp-green);
  color: var(--ekp-dark);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ekp-dark);
}
#name-form { margin-top: 12px; }

/* ===== TV: EKP logo (no frame, larger) ===== */
.tv-logo {
  width: clamp(220px, 22vw, 360px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
}
.tv-logo-img {
  max-width: 100%;
  height: auto;
  display: block;
}
.tv-logo-fallback {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}
.tv-logo-text {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(110px, 14vw, 180px);
  line-height: 0.9;
  letter-spacing: -0.06em;
  color: var(--ekp-dark);
  display: flex;
  align-items: baseline;
}
.tv-logo-text .logo-k {
  color: var(--ekp-green);
}
.tv-logo-tag {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: clamp(11px, 1.1vw, 14px);
  letter-spacing: 0.04em;
  color: var(--ekp-dark);
  text-align: center;
  text-transform: lowercase;
  margin-top: -8px;
}

/* ===== TV: how-to strip below header ===== */
.tv-howto {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 48px;
  background: var(--ink);
  color: var(--paper);
  border-bottom: 4px double var(--ink);
  z-index: 3;
  position: relative;
}
.tv-howto-tag {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 40px;
  letter-spacing: 0.02em;
  color: var(--ekp-dark);
  background: var(--ekp-green);
  padding: 10px 22px 8px;
  transform: rotate(-2deg);
  border: 3px solid var(--ekp-dark);
  line-height: 1;
}
.tv-howto-steps {
  list-style: none;
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  flex: 1;
  align-items: center;
  justify-content: space-around;
}
.tv-howto-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(16px, 1.4vw, 22px);
  letter-spacing: 0;
  color: var(--paper);
  white-space: nowrap;
  position: relative;
  padding: 0 14px;
}
.tv-howto-steps li::after {
  content: '→';
  position: absolute;
  right: -8px;
  color: var(--ekp-green);
  font-weight: 900;
  font-size: 18px;
}
.tv-howto-steps li:last-child::after { display: none; }
.tv-howto-steps li strong {
  color: var(--ekp-green);
  font-weight: 800;
}
.tv-howto-steps .step-n {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  background: var(--ekp-green);
  color: var(--ekp-dark);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--paper);
}

.tv-title-wrap {
  display: flex;
  flex-direction: column;
}

.tv-title {
  font-family: var(--font-brand);
  color: var(--ekp-dark);
}
.tv-title em {
  display: inline;
  font-style: normal;
  color: var(--ekp-green);
  -webkit-text-stroke: 3px var(--ekp-dark);
  paint-order: stroke fill;
}

/* ===== Howto screen — between registration and game ===== */
#screen-howto {
  gap: 18px;
  padding: 28px 24px;
}
.howto-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(48px, 13vw, 80px);
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: var(--ekp-dark);
  text-align: center;
}
.howto-sub {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  text-align: center;
  margin-top: -10px;
}
.howto-mock {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 380px;
  margin-top: 8px;
}
.howto-zone-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 3px solid var(--ekp-dark);
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--ekp-dark);
}
.howto-zone-card.howto-zone-active {
  background: rgba(168, 201, 72, 0.25);
  box-shadow: 4px 4px 0 var(--ekp-green);
}
.howto-zone-letter {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ekp-green);
  color: var(--ekp-dark);
  border: 2px solid var(--ekp-dark);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 24px;
  line-height: 1;
}
.howto-zone-text {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--ekp-dark);
  text-transform: none;
  letter-spacing: 0.02em;
}
.howto-zone-card.howto-zone-active .howto-zone-text {
  font-weight: 800;
}
.howto-zone-finger {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ekp-green);
  border: 3px solid var(--ekp-dark);
  animation: tap 1.6s infinite;
}

.howto-explain {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ekp-dark);
  text-align: center;
  text-transform: none;
  margin-top: 4px;
}

.howto-tips {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 380px;
  margin-top: 8px;
}
.howto-tips li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  border: 2px solid var(--rule);
  background: var(--paper);
}
.howto-tips li::before {
  content: '✓';
  color: var(--ekp-green);
  font-weight: 900;
  font-size: 18px;
  font-family: var(--font-display);
  -webkit-text-stroke: 1.5px var(--ekp-dark);
  paint-order: stroke fill;
}
.howto-tips strong {
  color: var(--ekp-dark);
  font-weight: 800;
}

#howto-start {
  margin-top: 6px;
  width: 100%;
  max-width: 380px;
}

/* ===== Boot loader: EKP brand ===== */
.boot-logo {
  font-family: var(--font-brand);
  background: var(--ekp-dark);
  color: var(--paper);
  font-size: 36px;
  letter-spacing: -0.5px;
  border-color: var(--ekp-dark);
  box-shadow: 8px 8px 0 var(--ekp-green);
}
.boot-spinner {
  border-color: var(--ekp-dark);
  border-top-color: var(--ekp-green);
}


/* ===== End-screen: seminar invitation card ===== */
.seminar-card {
  width: 100%;
  max-width: 460px;
  background: var(--ekp-dark);
  color: var(--paper);
  padding: 24px 24px 22px;
  border: 4px solid var(--ekp-dark);
  position: relative;
  box-shadow: 10px 10px 0 var(--ekp-green);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  text-align: center;
}
.seminar-tag {
  display: inline-block;
  align-self: center;
  background: var(--ekp-green);
  color: var(--ekp-dark);
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.25em;
  padding: 5px 14px;
  border: 2px solid var(--paper);
}
.seminar-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(36px, 9vw, 56px);
  line-height: 0.92;
  letter-spacing: -0.02em;
  color: var(--paper);
  margin: 4px 0;
}
.seminar-sub {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--paper-deep);
  letter-spacing: 0.01em;
  text-transform: none;
  padding: 0 4px;
}
.seminar-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
  border-top: 2px dashed rgba(255, 255, 255, 0.25);
  border-bottom: 2px dashed rgba(255, 255, 255, 0.25);
  padding: 14px 0;
}
.seminar-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}
.seminar-meta-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: var(--ekp-green);
}
.seminar-meta-value {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--paper);
  margin-top: 2px;
}
.seminar-meta-sub {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--paper-deep);
  margin-top: 2px;
}
.seminar-cta {
  display: block;
  text-align: center;
  background: var(--ekp-green);
  color: var(--ekp-dark);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 26px;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding: 16px 22px;
  border: 3px solid var(--paper);
  box-shadow: 5px 5px 0 var(--paper);
  margin-top: 6px;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.seminar-cta:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--paper);
}

/* ===== End-screen answers recap ===== */
#screen-end {
  overflow-y: auto;
  justify-content: flex-start;
  padding-top: 20px;
  padding-bottom: 32px;
}
.answers-recap {
  width: 100%;
  max-width: 460px;
  margin-top: 8px;
  border: 2.5px solid var(--ink);
  background: var(--paper);
}
.answers-recap summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  background: var(--paper-deep);
  border-bottom: 2px solid var(--ink);
  user-select: none;
}
.answers-recap summary::-webkit-details-marker { display: none; }
.answers-recap summary::after {
  content: '▼';
  margin-left: 12px;
  font-size: 12px;
  color: var(--stamp);
  transition: transform 0.18s ease;
}
.answers-recap[open] summary::after { transform: rotate(180deg); }
.answers-recap[open] summary {
  background: var(--ink);
  color: var(--paper);
}
.answers-recap[open] summary::after { color: var(--accent); }
.recap-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.recap-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  opacity: 0.8;
}
.answers-recap[open] .recap-hint { color: var(--paper-deep); }
.recap-list {
  padding: 6px 0;
}
.recap-row {
  padding: 14px 16px;
  border-bottom: 1.5px dashed var(--rule);
}
.recap-row:last-child { border-bottom: 0; }
.recap-q-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.recap-num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  color: var(--ink-soft);
  letter-spacing: -0.02em;
}
.recap-status {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  padding: 4px 10px;
  border: 2px solid var(--ink);
}
.recap-status-ok       { background: #2F8F4F; color: var(--paper); border-color: #1F6735; }
.recap-status-bad      { background: #C92410; color: var(--paper); border-color: #8A1707; }
.recap-status-timeout  { background: var(--ink-soft); color: var(--paper); border-color: var(--ink); }

.recap-q-text {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 8px;
}
.recap-opts {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.recap-opts li {
  display: grid;
  grid-template-columns: 24px 1fr 24px;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid var(--rule);
  background: var(--paper);
  color: var(--ink-soft);
}
.recap-letter {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  text-align: center;
  color: var(--ink-soft);
}
.recap-mark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  text-align: center;
}
.recap-opt-text {
  letter-spacing: 0.02em;
}
.recap-opts li.opt-correct {
  background: rgba(47, 143, 79, 0.15);
  border-color: #2F8F4F;
  color: var(--ink);
}
.recap-opts li.opt-correct .recap-letter,
.recap-opts li.opt-correct .recap-mark { color: #2F8F4F; }
.recap-opts li.opt-user-wrong {
  background: rgba(201, 36, 16, 0.12);
  border-color: #C92410;
  color: var(--ink);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}
.recap-opts li.opt-user-wrong .recap-letter,
.recap-opts li.opt-user-wrong .recap-mark { color: #C92410; }
.recap-opts li.opt-user-correct {
  background: rgba(47, 143, 79, 0.28);
  border-color: #2F8F4F;
  color: var(--ink);
}
.recap-opts li.opt-user-correct .recap-letter,
.recap-opts li.opt-user-correct .recap-mark { color: #2F8F4F; }

