/* TRKA — candy Fall Guys UI */
:root {
  --tama: #1a1450;
  --tama2: #2a1f6e;
  --bijela: #fff8ff;
  --zuta: #ffe066;
  --ruzicasta: #ff5d8f;
  --tirkiz: #5ef0d0;
  --ljubicasta: #b794ff;
  --narancasta: #ff9f4a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 20% 10%, #ff8ec580 0%, transparent 45%),
    radial-gradient(ellipse at 80% 0%, #5ef0d055 0%, transparent 40%),
    radial-gradient(ellipse at 50% 100%, #b794ff66 0%, transparent 50%),
    linear-gradient(160deg, #1a1450 0%, #2a1f6e 50%, #3a1860 100%);
  color: var(--bijela);
  font-family: "Nunito", system-ui, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

#platno {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 0;
}

.zaslon {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px;
  z-index: 10;
  pointer-events: auto;
}
.zaslon.aktivan { display: flex; }

#z-igra { pointer-events: none; align-items: stretch; z-index: 5; }
#z-igra.aktivan { display: block; }

.placa {
  background: linear-gradient(160deg, #fff, #ffe8f2);
  color: #1a1450;
  border: 3px solid #ffe066;
  border-radius: 16px;
  padding: 7px 12px;
  min-width: 64px;
  text-align: center;
  box-shadow: 0 5px 0 #ff5d8f;
  font-family: "Nunito", sans-serif;
  animation: hud-float 2.4s ease-in-out infinite;
}
.placa small {
  display: block;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.55;
  font-weight: 800;
}
.placa b {
  font-family: "Baloo 2", sans-serif;
  font-size: 18px;
  line-height: 1.1;
  color: #1a1450;
}
@keyframes hud-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
.ploca {
  width: min(460px, 100%);
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(255, 93, 143, 0.35), transparent 45%),
    radial-gradient(ellipse at 90% 10%, rgba(255, 224, 102, 0.25), transparent 40%),
    radial-gradient(ellipse at 80% 100%, rgba(94, 240, 208, 0.28), transparent 45%),
    linear-gradient(165deg, rgba(48, 28, 120, 0.95), rgba(26, 20, 80, 0.97));
  border: 4px solid rgba(255, 224, 102, 0.7);
  border-radius: 32px;
  padding: 30px 22px 26px;
  text-align: center;
  backdrop-filter: blur(14px);
  box-shadow:
    0 0 0 3px rgba(255, 93, 143, 0.25),
    0 24px 60px rgba(255, 93, 143, 0.35),
    inset 0 1px 0 rgba(255,255,255,0.25);
}
.ploca.svecana::before,
.ploca.svecana::after {
  content: "";
  position: absolute;
  width: 120%;
  height: 18px;
  left: -10%;
  background: repeating-linear-gradient(
    90deg,
    #ff5d8f 0 14px,
    #ffe066 14px 28px,
    #5ef0d0 28px 42px,
    #b794ff 42px 56px
  );
  opacity: 0.9;
  pointer-events: none;
}
.ploca.svecana::before { top: 0; border-radius: 32px 32px 0 0; }
.ploca.svecana::after { bottom: 0; border-radius: 0 0 32px 32px; }

.badge-mini {
  display: inline-block;
  font: 800 11px/1 "Nunito", sans-serif;
  letter-spacing: 2px;
  color: #1a1450;
  background: linear-gradient(90deg, #ffe066, #5ef0d0);
  padding: 6px 12px;
  border-radius: 99px;
  margin-bottom: 8px;
  box-shadow: 0 3px 0 #ff5d8f;
  animation: badge-bounce 1.6s ease-in-out infinite;
}
@keyframes badge-bounce {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-3px) rotate(1deg); }
}

.ukrasi {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.ukrasi .zv {
  position: absolute;
  left: var(--x);
  top: var(--y);
  font-style: normal;
  font-size: 18px;
  color: #ffe066;
  animation: sparkle 1.8s ease-in-out infinite;
  animation-delay: var(--d);
  filter: drop-shadow(0 0 6px #ff5d8f);
}
@keyframes sparkle {
  0%, 100% { opacity: 0.35; transform: scale(0.8) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.25) rotate(15deg); }
}

.ploca > *:not(.ukrasi) { position: relative; z-index: 1; }

h1, .naslov-wiggle {
  font-family: "Baloo 2", "Nunito", sans-serif;
  font-weight: 800;
  font-size: clamp(48px, 13vw, 74px);
  letter-spacing: 2px;
  line-height: 0.95;
  margin-bottom: 10px;
  background: linear-gradient(115deg, #ffe066 10%, #ff5d8f 40%, #b794ff 70%, #5ef0d0);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 0 rgba(0,0,0,0.28));
  animation: title-shine 3s linear infinite, title-wiggle 2.2s ease-in-out infinite;
}
@keyframes title-shine {
  from { background-position: 0% 50%; }
  to { background-position: 200% 50%; }
}
@keyframes title-wiggle {
  0%, 100% { transform: rotate(-1.5deg) scale(1); }
  50% { transform: rotate(1.5deg) scale(1.03); }
}
h2 {
  font-family: "Baloo 2", sans-serif;
  font-size: 34px;
  margin-bottom: 8px;
  color: var(--zuta);
  text-shadow: 0 3px 0 #ff5d8f;
}

.uvod {
  color: rgba(255, 248, 255, 0.85);
  font-size: 15px;
  line-height: 1.45;
  margin-bottom: 20px;
  font-weight: 700;
}

.izbor button {
  flex: 1;
  border: 3px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: var(--bijela);
  border-radius: 18px;
  padding: 13px 8px;
  font: 800 15px/1 "Nunito", sans-serif;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition: transform .12s, background .12s, border-color .12s, box-shadow .12s;
}
.izbor button.odabran {
  background: linear-gradient(135deg, #ff5d8f, #ff9f4a);
  border-color: #ffe066;
  color: #1a1450;
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 6px 0 #c44a6e, 0 0 16px rgba(255, 224, 102, 0.45);
}

.gumb.velik {
  width: 100%;
  margin-top: 10px;
  padding: 17px;
  font-size: 22px;
  font-family: "Baloo 2", sans-serif;
  border-radius: 20px;
  background: linear-gradient(135deg, #ffe066, #ff9f4a 45%, #ff5d8f);
  box-shadow: 0 9px 0 #c44a6e, 0 14px 28px rgba(255, 93, 143, 0.4);
  transition: transform .1s, box-shadow .1s;
}
.gumb-sja {
  animation: gumb-pulse 1.4s ease-in-out infinite;
}
@keyframes gumb-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); }
}
.gumb.velik:active {
  transform: translateY(5px);
  box-shadow: 0 4px 0 #c44a6e;
}

.tip-turnir {
  text-align: left;
  color: #1a1450;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 800;
  margin: -4px 0 16px;
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(94, 240, 208, 0.95), rgba(255, 224, 102, 0.9));
  border: 3px solid #fff;
  box-shadow: 0 4px 0 rgba(255, 93, 143, 0.45);
}

.mjesto {
  background: linear-gradient(145deg, #2a1f6e, #1a1450);
  border: 3px solid #ffe066;
  border-radius: 16px;
  padding: 8px 14px;
  font-family: "Baloo 2", sans-serif;
  box-shadow: 0 5px 0 #ff5d8f;
}
.mjesto b { font-size: 24px; color: var(--zuta); }
.runda {
  background: linear-gradient(135deg, #ff5d8f, #ff9f4a);
  border: 3px solid #ffe066;
  border-radius: 14px;
  padding: 7px 11px;
  font: 800 12px/1.2 "Nunito", sans-serif;
  letter-spacing: 0.3px;
  max-width: 42vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1a1450;
  box-shadow: 0 4px 0 #c44a6e;
}
.traka-staze {
  width: min(160px, 28vw);
  height: 12px;
  background: rgba(0,0,0,0.4);
  border-radius: 99px;
  overflow: hidden;
  border: 3px solid rgba(255,255,255,0.35);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}
.vrijeme {
  font-family: "Baloo 2", sans-serif;
  font-size: 22px;
  background: linear-gradient(145deg, #2a1f6e, #1a1450);
  border: 3px solid #5ef0d0;
  border-radius: 16px;
  padding: 6px 12px;
  box-shadow: 0 4px 0 #2a8a78;
}
.palica {
  pointer-events: auto;
  width: 124px;
  height: 124px;
  border-radius: 50%;
  background: rgba(26, 20, 80, 0.5);
  border: 4px solid #ffe066;
  position: relative;
  touch-action: none;
  box-shadow: 0 0 0 4px rgba(255, 93, 143, 0.35), 0 8px 20px rgba(0,0,0,0.25);
}
.skok {
  pointer-events: auto;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 4px solid #ffe066;
  background: linear-gradient(145deg, #ff5d8f, #ff9f4a);
  color: #1a1450;
  font: 800 15px/1 "Baloo 2", sans-serif;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 7px 0 #c44a6e, 0 0 20px rgba(255, 93, 143, 0.45);
  animation: skok-wiggle 2s ease-in-out infinite;
}
@keyframes skok-wiggle {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

.ljestvica li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: 16px;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.14);
  font-weight: 800;
  animation: red-in 0.35s ease both;
}
.ljestvica li:nth-child(1) { animation-delay: 0.05s; }
.ljestvica li:nth-child(2) { animation-delay: 0.1s; }
.ljestvica li:nth-child(3) { animation-delay: 0.15s; }
.ljestvica li:nth-child(1) {
  background: linear-gradient(90deg, #ffe066cc, #ffe06633);
  border-color: #ffe066;
  box-shadow: 0 4px 0 #ff5d8f66;
}
.ljestvica li:nth-child(2) {
  background: linear-gradient(90deg, #c0c8d5bb, transparent);
  border-color: #c0c8d5;
}
.ljestvica li:nth-child(3) {
  background: linear-gradient(90deg, #ff9f4abb, transparent);
  border-color: #ff9f4a;
}
.ljestvica li.ja {
  outline: 3px solid #5ef0d0;
  outline-offset: 1px;
}
@keyframes red-in {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: none; }
}
.red-lijevo {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.red-lijevo em {
  font-style: normal;
  font-family: "Baloo 2", sans-serif;
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.red-desno {
  font-size: 14px;
  color: rgba(255,248,255,0.85);
  white-space: nowrap;
}
.red-desno b {
  font-family: "Baloo 2", sans-serif;
  font-size: 18px;
  color: #ffe066;
}
.rang {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0,0,0,0.25);
  font-size: 13px;
}
.ti {
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  background: #5ef0d0;
  color: #1a1450;
  padding: 3px 6px;
  border-radius: 99px;
}

#z-kraj {
  /* Gore čisto — vidi se podium; dolje blagi fade + sheet */
  background: linear-gradient(180deg, transparent 0%, transparent 48%, rgba(26, 20, 80, 0.35) 72%, rgba(26, 20, 80, 0.72) 100%);
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0 12px max(12px, env(safe-area-inset-bottom));
  pointer-events: none;
}
#z-kraj .kraj-kartica {
  pointer-events: auto;
  width: min(420px, 100%);
  max-height: min(38vh, 340px);
  overflow: auto;
  padding: 14px 14px 12px;
  border-radius: 24px 24px 20px 20px;
  border-width: 3px;
  margin: 0 auto;
}
#z-kraj .kraj-kartica.svecana::before,
#z-kraj .kraj-kartica.svecana::after {
  height: 10px;
  opacity: 0.75;
}
.kraj-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  text-align: left;
}
.kraj-medalja {
  font-size: 36px;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 3px 0 rgba(0,0,0,0.2));
  animation: medal-pop 1.2s ease-in-out infinite;
}
@keyframes medal-pop {
  0%, 100% { transform: scale(1) rotate(-4deg); }
  50% { transform: scale(1.1) rotate(4deg); }
}
.kraj-info {
  flex: 1;
  min-width: 0;
}
#z-kraj h2 {
  font-size: 22px;
  margin: 0 0 2px;
  text-shadow: 0 2px 0 #ff5d8f88;
}
#z-kraj .uvod {
  font-size: 12px;
  margin: 0;
  line-height: 1.25;
  font-weight: 700;
  opacity: 0.85;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kraj-mjesto {
  text-align: center;
  background: linear-gradient(135deg, #ffe066, #ff9f4a);
  color: #1a1450;
  border-radius: 14px;
  padding: 6px 10px;
  box-shadow: 0 3px 0 #c44a6e;
  flex-shrink: 0;
}
.kraj-mjesto small {
  display: block;
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 800;
  opacity: 0.7;
}
.kraj-mjesto b {
  font-family: "Baloo 2", sans-serif;
  font-size: 26px;
  line-height: 1;
}
#z-kraj .ljestvica {
  margin: 0 0 8px;
  max-height: 9.5em;
}
#z-kraj .ljestvica li {
  padding: 7px 10px;
  margin-bottom: 4px;
  border-radius: 12px;
  font-size: 13px;
}
#z-kraj .red-lijevo em { font-size: 14px; }
#z-kraj .red-desno b { font-size: 15px; }
#z-kraj .gumb.velik {
  margin-top: 4px;
  padding: 12px;
  font-size: 18px;
}
#z-kraj .gumb.tihi {
  margin-top: 6px;
  padding: 8px;
  font-size: 13px;
}

.polje { margin-bottom: 16px; text-align: left; }
.polje label {
  display: block;
  font-size: 12px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(255, 248, 255, 0.55);
  margin-bottom: 7px;
  font-weight: 800;
}

.izbor { display: flex; gap: 8px; }

.gumb {
  border: 0;
  border-radius: 16px;
  padding: 12px 18px;
  font: 800 16px/1 "Nunito", sans-serif;
  cursor: pointer;
  color: #1a1450;
  background: var(--tirkiz);
}
.gumb.tihi {
  margin-top: 10px;
  width: 100%;
  background: transparent;
  color: rgba(255,248,255,0.7);
  border: 2px solid rgba(255,255,255,0.2);
}

.hud {
  pointer-events: none;
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  z-index: 5;
}
.hud-lijevo, .hud-desno { display: flex; align-items: center; gap: 10px; }
.mjesto small { opacity: 0.7; margin-left: 2px; }
.traka-staze i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #5ef0d0, #ffe066, #ff5d8f);
  border-radius: 99px;
}
.ikona {
  pointer-events: auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,0.25);
  background: rgba(26, 20, 80, 0.75);
  color: var(--bijela);
  font-weight: 800;
  cursor: pointer;
}

/* Utišano stanje mora biti čitljivo i djetetu koje ne razlikuje ♪ od ✕ —
   zato uz znak ide i prigušena boja, ne samo drugi glif. */
.ikona.iskljucen {
  color: rgba(255, 255, 255, 0.45);
  background: rgba(26, 20, 80, 0.4);
  border-color: rgba(255, 255, 255, 0.12);
}

.dodir {
  pointer-events: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 18px;
  z-index: 5;
}
.palica i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 48px;
  margin: -24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffe066, #ff5d8f);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.poruka {
  pointer-events: none;
  position: fixed;
  left: 50%;
  top: 28%;
  transform: translate(-50%, -50%) scale(0.8);
  font-family: "Baloo 2", sans-serif;
  font-size: clamp(36px, 10vw, 64px);
  color: var(--zuta);
  text-shadow: 0 4px 0 #c44a6e, 0 8px 24px rgba(0,0,0,0.35);
  opacity: 0;
  transition: opacity .2s, transform .2s;
  z-index: 6;
}
.poruka.vidi {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.tips {
  pointer-events: none;
  position: fixed;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  z-index: 8;
  background: linear-gradient(135deg, rgba(26,20,80,0.92), rgba(48,28,120,0.92));
  border: 3px solid #ffe066;
  border-radius: 20px;
  padding: 14px 18px;
  box-shadow: 0 8px 0 #ff5d8f55, 0 16px 40px rgba(0,0,0,0.35);
  font: 800 14px/1.45 "Nunito", sans-serif;
  text-align: left;
  animation: tip-in 0.4s ease both;
}
.tips p { margin: 4px 0; color: #fff8ff; }
.tips b { color: #ffe066; font-family: "Baloo 2", sans-serif; }
@keyframes tip-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%); }
}
.unlock-badge {
  display: inline-block;
  margin: -6px 0 14px;
  padding: 6px 12px;
  border-radius: 99px;
  background: linear-gradient(90deg, #5ef0d0, #ffe066);
  color: #1a1450;
  font: 800 12px/1 "Nunito", sans-serif;
  box-shadow: 0 3px 0 #ff5d8f;
}

/* Fullscreen KRAJ UTRKE / NEUSPJEH */
.ekran-banner {
  pointer-events: none;
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  opacity: 0;
  visibility: hidden;
  background: radial-gradient(ellipse at center, rgba(26,20,80,0.35), rgba(26,20,80,0.72));
  transition: opacity .25s, visibility .25s;
}
.ekran-banner.vidi {
  opacity: 1;
  visibility: visible;
}
.ekran-banner-tekst {
  font-family: "Baloo 2", Impact, sans-serif;
  font-weight: 800;
  font-size: clamp(42px, 14vw, 110px);
  line-height: 0.95;
  text-align: center;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 0 16px;
  animation: banner-pulse 0.7s ease-in-out infinite alternate;
}
.ekran-banner.kraj .ekran-banner-tekst {
  color: #ffe066;
  background: linear-gradient(120deg, #ffe066, #ff5d8f, #5ef0d0, #ffe066);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 2px #1a1450;
  filter: drop-shadow(0 6px 0 #ff5d8f) drop-shadow(0 0 28px rgba(255, 224, 102, 0.85));
  animation: banner-pulse 0.55s ease-in-out infinite alternate, banner-rainbow 1.4s linear infinite;
}
.ekran-banner.neuspjeh .ekran-banner-tekst {
  color: #ff2a4a;
  -webkit-text-stroke: 3px #fff;
  text-shadow:
    0 0 20px #ff0044,
    0 8px 0 #7a0018,
    0 0 40px rgba(255, 40, 80, 0.9);
  animation: banner-shake 0.45s ease-in-out infinite alternate;
}
@keyframes banner-pulse {
  from { transform: scale(0.92) rotate(-1deg); }
  to { transform: scale(1.08) rotate(1deg); }
}
@keyframes banner-rainbow {
  from { background-position: 0% 50%; }
  to { background-position: 200% 50%; }
}
@keyframes banner-shake {
  from { transform: scale(1.05) rotate(-2deg); }
  to { transform: scale(0.95) rotate(2deg); }
}

.ljestvica {
  list-style: none;
  text-align: left;
  margin: 8px 0 16px;
  max-height: 32vh;
  overflow: auto;
}
