:root {
  --bg-0: #07080f;
  --bg-1: #0b0d17;
  --bg-2: #131628;
  --fg: #f5f7ff;
  --fg-dim: #a9b0cf;
  --accent: #ffcc00;
  --vsb: #00AA9D;
  --vsb-2: #2fd9c8;
  --osu: #23B9D7;
  --osu-2: #6ad9ec;
  --hez-h: #4f8cff;
  --hez-k: #ff5ea1;
  --card: rgba(255, 255, 255, 0.06);
  --card-br: rgba(255, 255, 255, 0.12);
  --danger: #ff5468;
  --ok: #38e0a1;
  --radius: 22px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(120% 80% at 50% 0%, #1a1f3d 0%, var(--bg-0) 60%);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior: none;
}

body {
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.bg-orbs {
  position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0;
}
.bg-orbs span {
  position: absolute; width: 380px; height: 380px; border-radius: 50%;
  filter: blur(80px); opacity: .35;
}
.bg-orbs span:nth-child(1) { background: var(--vsb); top: -120px; left: -120px; }
.bg-orbs span:nth-child(2) { background: var(--osu); bottom: -120px; right: -120px; }
.bg-orbs span:nth-child(3) { background: #6b3cff; top: 40%; left: 40%; opacity: .25; }

#app {
  position: relative;
  z-index: 1;
  max-width: 460px;
  margin: 0 auto;
  padding: 16px 20px 24px;
}

/* SCREENS */
.screen {
  display: none;
  animation: slideIn .35s cubic-bezier(.2,.8,.2,1);
}
.screen.active { display: block; }
@keyframes slideIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* HERO */
.hero { text-align: center; padding: 18px 0 16px; }
.badge {
  display: inline-block;
  font-size: 10px; letter-spacing: .25em;
  padding: 6px 12px; border-radius: 100px;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--card-br);
  color: var(--fg-dim);
  text-transform: uppercase;
  font-weight: 600;
}
.title {
  font-size: 36px;
  line-height: 1;
  margin: 12px 0 6px;
  font-weight: 900;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, var(--vsb-2) 0%, #fff 50%, var(--osu-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.title .vs {
  display: inline-block;
  font-size: 16px;
  color: var(--accent);
  vertical-align: middle;
  margin: 0 6px;
  font-weight: 700;
  -webkit-text-fill-color: var(--accent);
}
.subtitle { color: var(--fg-dim); margin: 0; font-size: 13px; }

/* POLL CARDS */
.poll-cards { display: grid; gap: 14px; margin-top: 18px; }
.poll-card {
  position: relative;
  text-align: left;
  width: 100%;
  border: 1px solid var(--card-br);
  background: var(--card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--radius);
  padding: 16px 18px;
  color: var(--fg);
  cursor: pointer;
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
}
.poll-card:active { transform: scale(.98); }
.poll-card::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--c1, #2b8cff) 0%, transparent 70%);
  opacity: .25;
  pointer-events: none;
}
.poll-card > * { position: relative; }
.poll-card--player { --c1: var(--vsb-2); }
.poll-card--hezounek { --c1: var(--hez-k); }
.poll-card__icon {
  font-size: 30px;
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.08);
  border-radius: 16px;
  border: 1px solid var(--card-br);
}
.poll-card__title { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.poll-card__sub { color: var(--fg-dim); margin-top: 2px; font-size: 12px; }
.poll-card__cta {
  font-weight: 800; color: var(--accent);
  font-size: 20px;
}

/* COMMON */
.back {
  background: rgba(255,255,255,.08);
  border: 1px solid var(--card-br);
  color: var(--fg);
  padding: 10px 16px;
  border-radius: 100px;
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 18px;
  font-weight: 600;
}
.back:active { transform: scale(.96); }

.step-title {
  font-size: 28px;
  margin: 6px 0 6px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.step-sub { color: var(--fg-dim); margin: 0 0 22px; font-size: 14px; }

/* TEAM / CATEGORY GRID */
.team-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.team-grid--stack { grid-template-columns: 1fr; }
.team-grid--stack .team-card { aspect-ratio: auto; min-height: 140px; }
.team-card {
  position: relative;
  aspect-ratio: 1 / 1.15;
  border-radius: var(--radius);
  border: 1px solid var(--card-br);
  background: var(--card);
  color: var(--fg);
  padding: 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  transition: transform .18s ease;
}
.team-card:active { transform: scale(.97); }
.team-card::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(160deg, var(--tc, #2b8cff) 0%, transparent 75%);
  opacity: .55;
}
.team-card > * { position: relative; }
.team-card__code {
  font-size: 56px; font-weight: 900; line-height: 1; letter-spacing: -.04em;
}
.team-card__name { font-size: 13px; color: rgba(255,255,255,.85); margin-top: 4px; font-weight: 600; }

.team-vsb { --tc: var(--vsb); }
.team-osu { --tc: var(--osu); }
.hez-h    { --tc: var(--hez-h); }
.hez-k    { --tc: var(--hez-k); }

/* Speciální layout karet na obrazovce Hezounek (centrované) */
.screen[data-screen="hez-cat"] .team-card {
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 22px 16px;
}
.screen[data-screen="hez-cat"] .team-card__code {
  font-size: 84px;
  line-height: 1;
  margin-bottom: 10px;
}
.screen[data-screen="hez-cat"] .team-card__name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: #fff;
}

/* PLAYER GRID */
.player-grid {
  display: grid;
  gap: 44px 14px; /* extra vertikální mezera kvůli přesahujícímu číslu */
  grid-template-columns: 1fr 1fr;
  padding-top: 36px;  /* první řada má taky kam přesáhnout */
}
.player-card {
  position: relative;
  border-radius: 18px;
  border: 1px solid var(--card-br);
  background: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: visible;
  cursor: pointer;
  padding: 14px 16px 16px;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
  color: var(--fg);
  text-align: left;
}
.player-card::after {
  /* jemná barevná aura pod kartou */
  content: "";
  position: absolute;
  inset: auto -4px -8px -4px;
  height: 28px;
  background: var(--tc, #2b8cff);
  filter: blur(22px);
  opacity: .25;
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}
.player-card:active { transform: scale(.96); }
.player-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255,204,0,.35);
}
.player-card.is-selected .player-card__num {
  color: var(--accent);
  text-shadow: 0 6px 24px rgba(255,204,0,.35);
}
.player-card__num {
  position: absolute;
  top: -45px;
  right: 8px;
  font-size: 84px;
  font-weight: 900;
  line-height: 1;
  color: var(--tc, #2b8cff);
  letter-spacing: -.06em;
  text-shadow: 0 8px 28px rgba(0,0,0,.45);
  z-index: 1;
}
.player-card__name {
  position: relative;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  max-width: 70%;
}
.player-card__team {
  position: relative;
  font-size: 10px;
  color: var(--fg-dim);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.player-card.team-VSB { --tc: var(--vsb-2); }
.player-card.team-OSU { --tc: var(--osu-2); }

/* FORM */
.vote-form { display: grid; gap: 16px; }
.vote-form label {
  display: grid; gap: 6px;
  font-size: 13px;
  color: var(--fg-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.vote-form input {
  font: inherit;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--card-br);
  background: rgba(255,255,255,.05);
  color: var(--fg);
  font-size: 17px;
  font-weight: 500;
  outline: none;
  transition: border-color .15s ease, background .15s ease;
}
.vote-form input::placeholder { color: rgba(255,255,255,.3); }
.vote-form input:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,.08);
}

.cta {
  margin-top: 8px;
  background: linear-gradient(135deg, var(--accent), #ffae00);
  color: #1a1500;
  border: none;
  padding: 18px 22px;
  font-size: 17px;
  font-weight: 800;
  border-radius: 16px;
  cursor: pointer;
  letter-spacing: .01em;
  transition: transform .15s ease, opacity .15s ease;
}
.cta:active { transform: scale(.98); }
.cta:disabled { opacity: .45; cursor: not-allowed; }

.form-error {
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
  min-height: 18px;
}
.counter {
  text-align: center;
  font-size: 12px;
  color: var(--fg-dim);
  margin-top: 4px;
}

/* SUCCESS */
.success { text-align: center; padding: 60px 20px; }
.success__check {
  width: 90px; height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ok), #1ec98f);
  color: #002a1c;
  font-size: 52px;
  font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 12px 40px rgba(56,224,161,.35);
}
.success h2 { font-size: 26px; margin: 8px 0; }
.success p { color: var(--fg-dim); margin-bottom: 24px; }

.foot { text-align: center; color: var(--fg-dim); font-size: 11px; padding: 16px 0 4px; }

.global-foot {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  text-align: center;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, rgba(7,8,15,.85) 40%);
  pointer-events: none;
  display: none;
  z-index: 10;
}
.global-foot a {
  color: var(--fg-dim);
  font-size: 11px;
  text-decoration: none;
  border-bottom: 1px dotted rgba(255,255,255,.2);
  padding-bottom: 1px;
  pointer-events: auto;
}
.global-foot a:active { color: var(--fg); }
body.show-global-foot .global-foot { display: block; }
body.show-global-foot #app { padding-bottom: 56px; }
