*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --red: #bc060b;
  --red-dark: #9a0509;
  --white: #ffffff;
  --text-shadow: 0px 3px 4px rgba(23, 116, 132, 0.25);
  --glass-bg: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.16);
  --input-bg: rgba(255, 255, 255, 0.15);
  --input-border: rgba(255, 255, 255, 0.5);
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Open Sans", sans-serif;
}

body {
  position: relative;
}

/* ── FIXED BACKGROUND ── */
#bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #0a1628;
}
#bg img.bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.bg-imgmob {
  display: none;
}
/* zastava */
.zastava {
  position: absolute;
  bottom: -20%;
  right: 70%;
  width: 200px;
  pointer-events: none;
  z-index: 100;
  pointer-events: none;
}

/* navijaci */
.navijaci {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  pointer-events: none;
  z-index: 0;
  pointer-events: none;
}

/* ── SPA CONTAINER ── */
#app {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 16px;
}

/* ── SCREEN WRAPPER (handles label + panel together) ── */
.screen-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(1090px, 100%);
  max-height: calc(100vh - 32px);
}

/* ── STEP LABEL ── */
.step-label {
  flex-shrink: 0;
  background: var(--red);
  border-radius: 20px;
  padding: 30px 60px;
  font-family: "Ultra", serif;
  font-size: 35px;
  color: var(--white);
  white-space: nowrap;
  letter-spacing: 0.5px;
  margin-bottom: -1px; /* overlap border */
  z-index: 1;

  margin-bottom: -2.8rem;
}

/* ── GLASS PANEL ── */
.glass-panel {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;

  background: rgba(10, 22, 55, 0.55);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);

  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 28px;

  overflow: hidden;
}

.glass-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 28px;
  right: 28px;
  height: 2px;

  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.18) 20%,
    rgba(255, 255, 255, 0.45) 50%,
    rgba(255, 255, 255, 0.18) 80%,
    transparent 100%
  );

  pointer-events: none;
  z-index: 2;
}

/* inner scrollable area */
.panel-scroll {
  max-height: calc(100vh - 32px - 44px - 2px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: clamp(24px, 4vw, 60px) clamp(16px, 5vw, 70px) clamp(24px, 4vw, 50px);
  scrollbar-width: none;
  border-radius: 28px;
  min-height: 80vh;
}
.panel-scroll::-webkit-scrollbar {
  display: none;
}
/* screen-0 has no label so panel is standalone */
#screen-0 .glass-panel {
  border-radius: 28px;
}

/* ── STEP SCREENS ── */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}
.screen.active {
  opacity: 1;
  pointer-events: auto;
}

/* ── TYPOGRAPHY ── */
h1,
h2,
.ultra {
  font-family: "Ultra", serif;
  color: var(--white);
  text-shadow: var(--text-shadow);
  line-height: 1.2;
  text-align: center;
}

h2 {
  color: #fff;
  text-align: center;

  /* text shadow */
  text-shadow: 0 3px 4px rgba(23, 116, 132, 0.25);
  font-size: 45px;
  font-style: normal;
  font-weight: 400;
  line-height: 130%; /* 58.5px */
}

/* ── STEP 0: NASLOVNICA ── */
#screen-0 .panel-scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding-top: clamp(20px, 3vw, 20px);
}
.title-block {
  position: relative;
  text-align: center;
  line-height: 0.7;
}
.title-block .line1 {
  font-family: "Ultra", serif;
  font-size: clamp(82px, 18vw, 220px);
  color: var(--red);
  text-shadow: var(--text-shadow);
  display: block;
  line-height: 90%;
}
.title-block .line2 {
  font-family: "Ultra", serif;
  font-size: clamp(48px, 13vw, 140px);
  color: var(--white);
  text-shadow: var(--text-shadow);
  display: block;
  position: relative;
}
.ball-inline {
  display: inline-block;
  width: clamp(24px, 6vw, 60px);
  height: clamp(24px, 6vw, 60px);
  vertical-align: middle;
  margin: 0 2px -4px;
}
.powered-by {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
  justify-content: center;
  flex-wrap: wrap;
}
.powered-by span {
  font-family: "Open Sans", sans-serif;
  font-size: clamp(12px, 2vw, 16px);
  font-weight: 600;
  color: var(--white);
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: var(--text-shadow);
}
.powered-by img {
  height: clamp(22px, 4vw, 32px);
}
.subtitle {
  font-family: "Open Sans", sans-serif;
  font-weight: 800;
  font-size: clamp(15px, 3vw, 30px);
  color: var(--white);
  text-shadow: var(--text-shadow);
  text-align: center;
}
.icon {
  height: 32px;
  padding-right: 1rem;
}

.awards {
  color: #ffd900;
  text-align: center;
  /* text shadow */
  text-shadow: 0 3px 4px rgba(23, 116, 132, 0.25);
  font-family: "Open Sans", sans-serif;
  font-size: 25px;
  font-style: normal;
  font-weight: 800;
  line-height: 130%; /* 32.5px */
  max-width: 832px;
  margin: 0 auto;
}
.footer-links {
  display: flex;
  gap: clamp(16px, 4vw, 40px);
  justify-content: center;
  margin-top: 4px;
  flex-wrap: wrap;
}
.footer-links a {
  font-family: "Open Sans", sans-serif;
  font-size: clamp(12px, 1.8vw, 15px);
  font-weight: 800;
  color: var(--white);
  text-decoration: underline;
  cursor: pointer;
}

/* ── BUTTONS ── */
.btn-red {
  background: var(--red);
  border: none;
  border-radius: 14px;
  padding: clamp(14px, 2vw, 20px) clamp(32px, 5vw, 56px);
  font-family: "Ultra", serif;
  font-size: clamp(20px, 3vw, 26px);
  color: var(--white);
  cursor: pointer;
  letter-spacing: 0.5px;
  transition:
    background 0.2s,
    transform 0.15s;
  white-space: nowrap;
}
.btn-red:hover {
  background: var(--red-dark);
  transform: scale(1.03);
}
.btn-red:active {
  transform: scale(0.98);
}

.btn-red-sm {
  background: var(--red);
  border: none;
  border-radius: 10px;
  padding: clamp(12px, 2vw, 16px) clamp(32px, 5vw, 56px);
  font-family: "Open Sans", sans-serif;
  font-weight: 800;
  font-size: clamp(17px, 2.5vw, 22px);
  color: var(--white);
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.15s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-red-sm:hover {
  background: var(--red-dark);
  transform: scale(1.03);
}
.btn-red-sm:active {
  transform: scale(0.98);
}

/* ── STEP 1: UTAKMICA ── */
#screen-1 .panel-scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(20px, 3vw, 36px);
  padding-top: clamp(20px, 3vw, 30px);
  justify-content: center;
}
.match-info {
  display: flex;
  gap: clamp(12px, 3vw, 28px);
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.match-info .info-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.match-info .info-item svg {
  flex-shrink: 0;
  width: clamp(18px, 3vw, 28px);
  height: clamp(18px, 3vw, 28px);
}
.match-info .info-item span {
  font-family: "Open Sans", sans-serif;
  font-weight: 800;
  font-size: clamp(14px, 2.5vw, 20px);
  color: var(--white);
  text-shadow: var(--text-shadow);
}
.teams-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 6vw, 60px);
  flex-wrap: wrap;
}
.team-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 2vw, 16px);
}
.team-flag {
  width: clamp(80px, 18vw, 150px);
  height: clamp(80px, 18vw, 150px);
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.6);
  object-fit: cover;
}
.team-name {
  font-family: "Open Sans", sans-serif;
  font-weight: 800;
  font-size: clamp(15px, 2.5vw, 22px);
  color: var(--white);
  text-shadow: var(--text-shadow);
}
.vs-badge {
  font-family: "Ultra", serif;
  font-size: clamp(26px, 5vw, 40px);
  color: var(--white);
  text-shadow: var(--text-shadow);
  flex-shrink: 0;
}
.score-inputs {
  display: flex;
  gap: clamp(14px, 3vw, 24px);
  align-items: center;
  justify-content: center;
}
.score-box {
  position: relative;
  background: var(--red);
  border-radius: 10px;
  width: clamp(100px, 22vw, 140px);
  height: clamp(56px, 10vw, 70px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.score-box input {
  background: transparent;
  border: none;
  outline: none;
  font-family: "Ultra", serif;
  font-size: clamp(28px, 6vw, 40px);
  color: var(--white);
  text-align: center;
  width: 70px;
  height: 100%;
  pointer-events: none;
}
.score-arrows {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.score-arrows button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.85);
  font-size: clamp(18px, 2vw, 15px);
  transition: color 0.15s;
}
.score-arrows button:hover {
  color: var(--white);
}
.score-dash {
  font-family: "Ultra", serif;
  font-size: clamp(24px, 4vw, 36px);
  color: var(--white);
  text-shadow: var(--text-shadow);
}

/* ── STEP 2: IGRAČI SLIDER ── */
#screen-2 .panel-scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(20px, 3vw, 32px);
  padding-top: clamp(20px, 3vw, 42px);
  justify-content: center;
}
.players-slider-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
}
.players-track {
  display: flex;
  transition: transform 0.35s ease;
  gap: clamp(12px, 2vw, 28px);
  padding: 4px 2px;
}
.player-card {
  flex: 0 0 calc((100% - clamp(24px, 4vw, 56px)) / 3);
  position: relative;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 1/1;
  transition: border-color 0.2s;
  background: rgba(0, 0, 0, 0.3);
}
.player-card:hover {
  border-color: rgba(255, 255, 255, 0.8);
}
.player-card.selected {
  border-color: var(--white);
  border-width: 2.5px;
}
.player-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.player-overlay {
  position: absolute;
  inset: 0;
  background: rgba(58, 122, 161, 0.2);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.player-card.selected .player-overlay {
  opacity: 1;
}
.player-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: clamp(24px, 4vw, 34px);
  height: clamp(24px, 4vw, 34px);
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.player-card.selected .player-check {
  background: none;
  border: 2px solid rgba(255, 255, 255, 1);
}
.player-check svg {
  display: none;
}
.player-card.selected .player-check svg {
  display: block;
}
.player-name-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10, 22, 55, 0.7);
  text-align: center;
  padding: clamp(5px, 1vw, 8px) 4px;
  font-family: "Open Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(11px, 1.8vw, 14px);
  color: var(--white);
}

/* Slider nav */
.slider-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 2px;
}
.slider-arrow {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--white);
  font-size: clamp(20px, 3.5vw, 26px);
  padding: 4px 10px;
  transition: opacity 0.2s;
  opacity: 0.75;
}
.slider-arrow:hover {
  opacity: 1;
}
.slider-arrow:disabled {
  opacity: 0.25;
  cursor: default;
}
.slider-dots {
  display: flex;
  gap: 8px;
}
.slider-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transition:
    background 0.2s,
    transform 0.2s;
}
.slider-dot.active {
  background: var(--white);
  transform: scale(1.2);
}

/* ── STEP 3: TEXTAREA ── */
#screen-3 .panel-scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(20px, 3vw, 36px);
  padding-top: clamp(20px, 3vw, 28px);
  justify-content: center;
}
.styled-textarea {
  width: 100%;
  min-height: clamp(160px, 28vw, 240px);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: clamp(16px, 2.5vw, 24px) clamp(16px, 2.5vw, 28px);
  font-family: "Open Sans", sans-serif;
  font-style: italic;
  font-size: clamp(15px, 2.5vw, 20px);
  color: var(--white);
  resize: none;
  outline: none;
  transition: border-color 0.2s;
  line-height: 1.6;
}
.styled-textarea::placeholder {
  color: rgba(176, 176, 176, 0.8);
}
.styled-textarea:focus {
  border-color: rgba(255, 255, 255, 0.6);
}

/* ── STEP 4: FORMA ── */
#screen-4 .panel-scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(16px, 2.5vw, 28px);
  padding-top: clamp(20px, 4vw, 42px);
  justify-content: center;
}
.form-fields {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2.5vw, 20px);
}
.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-group label {
  font-family: "Open Sans", sans-serif;
  font-weight: 800;
  font-size: clamp(15px, 2.5vw, 20px);
  color: var(--white);
}
.field-group input {
  background: transparent;
  border: none;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.5);
  padding: 8px 2px;
  font-family: "Open Sans", sans-serif;
  font-size: clamp(14px, 2.2vw, 18px);
  color: var(--white);
  outline: none;
  width: 100%;
  transition: border-color 0.2s;
}
.field-group input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}
.field-group input:focus {
  border-bottom-color: var(--white);
}
.uvjeti-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 560px;
  width: 100%;
}
.uvjeti-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--white);
  cursor: pointer;
}
.uvjeti-row span {
  font-family: "Open Sans", sans-serif;
  font-size: clamp(12px, 1.8vw, 13px);
  font-weight: 600;
  color: rgba(247, 247, 247, 0.9);
  line-height: 1.55;
}
.uvjeti-row a {
  color: rgba(247, 247, 247, 0.9);
  text-decoration: underline;
}

/* ── STEP 5: ZAHVALA ── */
#screen-5 .panel-scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(20px, 3vw, 32px);
  padding: clamp(30px, 5vw, 50px) clamp(16px, 5vw, 70px);
  min-height: 200px;
  justify-content: center;
}
.zahvala-logo-row {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.zahvala-logo-row span {
  font-family: "Open Sans", sans-serif;
  font-weight: 800;
  font-size: clamp(15px, 2.5vw, 20px);
  color: var(--white);
}
.zahvala-logo-row img {
  height: clamp(28px, 5vw, 44px);
}

/* ── ERROR MSG ── */
.err-msg {
  color: #ff8080;
  font-size: clamp(12px, 1.8vw, 14px);
  font-weight: 600;
  text-align: center;
  min-height: 18px;
}

/* ── MOBILE BREAKPOINTS ── */
@media (max-width: 480px) {
  #bg .zastava {
    width: 280px;
    top: -70px;
    left: -80px;
  }

  .step-label {
    font-size: 18px;
    padding: 9px 28px;
  }

  .glass-panel {
    border-radius: 20px;
  }
  .panel-scroll {
    border-radius: 20px;
    padding: 20px 18px;
  }

  /* naslovnica gap */
  #screen-0 .panel-scroll {
    gap: 18px;
  }

  /* step 1: teams stacked vertically */
  .teams-row {
    gap: 10px;
  }
  .vs-badge {
    font-size: 22px;
  }

  /* step 2: slider shows 1 card on very small screens */
  .player-card {
    flex: 0 0 calc((100% - 24px) / 2);
  }

  /* match select full width */
  #match-select {
    font-size: 14px;
    padding: 8px 12px;
  }

  .footer-links {
    gap: 12px;
  }
  .footer-links a {
    font-size: 11px;
  }
  #bg img.bg-img,
  .zastava {
    object-position: left bottom;
  }
  .zastava {
    width: 100px;
    right: 0;
    bottom: -70px;
  }
  .bg-imgmob {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .awards {
    font-size: 1rem;
  }
  .step-label {
    margin-bottom: -1.2rem;
    border-radius: 1rem;
  }
  .navijaci {
    width: 140%;
    z-index: 0;
  }
}

@media (max-width: 360px) {
  .player-card {
    flex: 0 0 calc(100% - 4px);
  }
  .title-block .line1 {
    font-size: 44px;
  }
  .title-block .line2 {
    font-size: 30px;
  }
}
