/* BPINFO Adventski kalendar */

.bpadv {
  --navy: #0c1f3d;
  --navy2: #13294b;
  --blue: #2f6fe0;
  --blue-l: #5b9bff;
  --gold: #e6b85c;
  --cream: #f4f7fc;
  --a-display: "Poppins", system-ui, sans-serif;
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  overflow: hidden;
  color: var(--cream);
  font-family: "Poppins", system-ui, sans-serif;
  background: radial-gradient(1100px 600px at 50% -10%, #1d3f78 0%, #0c1f3d 55%, #081429 100%);
}
.bpadv *, .bpadv *::before, .bpadv *::after { box-sizing: border-box; }
body.bpadv-body { overflow-x: clip; }
body.bpadv-body .site-footer { margin-top: 0; }

/* snijeg */
.bpadv-snow { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.bpadv-snow .flake { position: absolute; top: -20px; color: #fff; opacity: .8; animation: bpadv-fall linear infinite; }
@keyframes bpadv-fall { to { transform: translateY(var(--h, 1600px)) rotate(360deg); } }

.bpadv-wrap { position: relative; z-index: 2; max-width: 980px; margin: 0 auto; padding: 40px 16px 60px; }

/* zaglavlje */
.bpadv-head { text-align: center; margin-bottom: 10px; }
.bpadv-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  padding: 7px 16px;
  border-radius: 999px;
  color: var(--cream);
}
.bpadv-badge b { color: var(--blue-l); }
.bpadv-title {
  font-family: "Poppins", system-ui, sans-serif;
  font-size: clamp(30px, 7vw, 54px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -1px;
  margin: 16px 0 6px;
  color: var(--cream);
}
.bpadv-title .hl { color: var(--gold); }
.bpadv-sub { color: #bcd0ee; font-size: clamp(14px, 3.4vw, 18px); font-weight: 500; max-width: 560px; margin: 0 auto; line-height: 1.5; }
.bpadv-note {
  margin: 18px auto 0;
  max-width: 560px;
  font-size: 13px;
  color: #9fb6da;
  background: rgba(47,111,224,.12);
  border: 1px solid rgba(91,155,255,.25);
  padding: 10px 14px;
  border-radius: 12px;
}
.bpadv-note.is-err { color: #ffb4b9; border-color: rgba(214,69,80,.5); background: rgba(214,69,80,.12); }

/* mreža vratašca */
.bpadv-grid {
  list-style: none;
  margin: 30px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
/* 24. je veliki (2×2) u donjem desnom kutu; ukrasne pločice popune ostatak reda */
.bpadv-cell.is-big { grid-column: 3 / span 2; grid-row: 6 / span 2; }
.bpadv-deco.d2, .bpadv-deco.d3 { display: none; }
@media (min-width: 680px) {
  .bpadv-grid { grid-template-columns: repeat(6, 1fr); gap: 16px; }
  .bpadv-cell.is-big { grid-column: 5 / span 2; grid-row: 4 / span 2; }
  .bpadv-deco.d2, .bpadv-deco.d3 { display: grid; }
}

.bpadv-cell, .bpadv-deco { position: relative; aspect-ratio: 1; perspective: 900px; margin: 0; padding: 0; }
.bpadv-deco {
  display: grid;
  place-items: center;
  font-size: clamp(22px, 5vw, 34px);
  border-radius: 16px;
  border: 1px dashed rgba(91,155,255,.25);
  background: rgba(255,255,255,.03);
}

/* unutrašnjost (nagrada) */
.bpadv-back {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(160deg, #17305a, #0e2142);
  border: 1px solid rgba(91,155,255,.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  gap: 6px;
  box-shadow: inset 0 0 30px rgba(0,0,0,.4);
}
.bpadv-back .emoji { font-size: clamp(22px, 5vw, 34px); line-height: 1; }
.bpadv-back .spon { font-size: 11px; font-weight: 700; letter-spacing: .5px; color: var(--blue-l); text-transform: uppercase; line-height: 1.2; }
.bpadv-back .gift { font-size: clamp(11px, 2.4vw, 15px); font-weight: 700; color: #fff; line-height: 1.2; }
.bpadv-back .win { font-size: 10px; font-weight: 600; color: var(--gold); line-height: 1.2; }
.bpadv-back.has-img { padding: 0; justify-content: flex-end; }
.bpadv-back.has-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bpadv-back.has-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(8,20,41,.92)); }
.bpadv-back.has-img .txt { position: relative; z-index: 1; padding: 8px; display: grid; gap: 3px; }
.bpadv-back.has-img.is-logo::after { display: none; }
.bpadv-back.has-img.is-logo img { bottom: auto; height: 52%; object-fit: contain; padding: 10% 14%; background: #fff; }
.is-big .bpadv-back .gift { font-size: clamp(16px, 2.4vw, 22px); }
.is-big .bpadv-back .spon { font-size: 13px; }
.is-big .bpadv-back .emoji { font-size: clamp(40px, 9vw, 64px); }
@media (max-width: 420px) {
  .bpadv-back .spon { display: none; }
  .is-big .bpadv-back .spon { display: block; }
}

/* vratašca */
.bpadv-door {
  all: unset;
  position: absolute;
  inset: 0;
  border-radius: 16px;
  cursor: pointer;
  z-index: 3;
  transform-origin: left center;
  transition: transform .85s cubic-bezier(.3,.7,.2,1), box-shadow .3s;
  background: linear-gradient(150deg, #2f6fe0 0%, #1d4ea8 55%, #163c84 100%);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 10px 22px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  -webkit-tap-highlight-color: transparent;
}
.bpadv-door:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.bpadv-door::after {
  content: "";
  position: absolute;
  right: 9px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  transform: translateY(-50%);
  box-shadow: 0 0 8px rgba(230,184,92,.8);
}
.bpadv-door .num { font-size: clamp(20px, 5vw, 30px); font-weight: 800; color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.3); }
.is-big .bpadv-door .num { font-size: clamp(34px, 7vw, 54px); }
.bpadv-door .lock { display: none; position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); font-size: 12px; opacity: .7; }

.bpadv-cell.is-open .bpadv-door { transform: rotateY(-118deg); box-shadow: -18px 10px 30px rgba(0,0,0,.45); }
.bpadv-cell.is-locked .bpadv-door { background: linear-gradient(150deg, #28406e, #1a2d55); cursor: not-allowed; }
.bpadv-cell.is-locked .bpadv-door::after { background: #5c6f94; box-shadow: none; }
.bpadv-cell.is-locked .bpadv-door .num { color: #8aa0c6; }
.bpadv-cell.is-locked .bpadv-door .lock { display: block; }
.bpadv-cell.is-today:not(.is-open) .bpadv-door { animation: bpadv-glow 1.8s ease-in-out infinite; }
@keyframes bpadv-glow {
  0%, 100% { box-shadow: 0 10px 22px rgba(0,0,0,.35), 0 0 0 0 rgba(230,184,92,.6); }
  50%      { box-shadow: 0 10px 22px rgba(0,0,0,.35), 0 0 0 7px rgba(230,184,92,0); }
}
.bpadv-shake { animation: bpadv-shake .4s; }
@keyframes bpadv-shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
/* otvorena vratašca se mogu ponovno kliknuti (klik ide na unutrašnjost) */
.bpadv-cell.is-open .bpadv-back { cursor: pointer; }

/* poziv i podnožje */
.bpadv-cta { margin-top: 34px; text-align: center; }
.bpadv-cta a:not(.plain) {
  display: inline-block;
  background: var(--gold);
  color: #2a1c04 !important;
  font-weight: 800;
  font-size: 16px;
  padding: 15px 30px;
  border-radius: 14px;
  text-decoration: none !important;
  box-shadow: 0 12px 26px rgba(230,184,92,.3);
}
.bpadv-how { max-width: 560px; margin: 16px auto 0; font-size: 13px; color: #9fb6da; line-height: 1.6; }
.bpadv-rules { margin: 10px 0 0; font-size: 13px; }
.bpadv-rules a { color: var(--blue-l) !important; background: none !important; box-shadow: none !important; padding: 0 !important; font-size: 13px !important; font-weight: 600 !important; }
.bpadv-foot { text-align: center; margin: 26px 0 0; font-weight: 800; letter-spacing: 2px; font-size: 13px; color: #8aa0c6; }
.bpadv-foot b { color: var(--blue-l); }
.bpadv-noscript { text-align: center; padding: 16px; background: #fff3cd; color: #5c4400; margin: 0; position: relative; z-index: 3; }

/* ---------- Otvaranje kućice ("pack opening") ---------- */
html.bpadv-lock { overflow: hidden; }
.bpadv-pack {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  overflow-x: hidden;
  overflow-y: auto;
  --gold-1: #fbe7b8;
  --gold-2: #e6b85c;
  --gold-3: #a87a2a;
}
.bpadv-pack::backdrop { background: rgba(4,7,20,.92); }
.bpadv-pack.is-past { --gold-1: #f3f5fa; --gold-2: #b9c2d6; --gold-3: #7d879e; }

.pk-bg {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, #1d3f78 0%, #0c1f3d 55%, #081429 100%);
  opacity: 0;
  transition: opacity .4s;
  overflow: hidden;
}
.st-in .pk-bg { opacity: 1; }
.pk-rays {
  position: absolute;
  left: 50%; top: 42%;
  width: 180vmax; height: 180vmax;
  margin: -90vmax 0 0 -90vmax;
  background: repeating-conic-gradient(from 0deg, rgba(255,214,120,.0) 0deg 7deg, rgba(255,214,120,.22) 9deg 12deg, rgba(255,214,120,0) 14deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 0, transparent 55%);
          mask: radial-gradient(circle, #000 0, transparent 55%);
  opacity: 0;
  transform: scale(.6);
  transition: opacity .8s, transform 1.2s;
}
.st-shake .pk-rays { opacity: .6; transform: scale(.85); animation: pk-spin 18s linear infinite; }
.st-card .pk-rays { opacity: 1; transform: scale(1.1); }
.is-past .pk-rays { filter: grayscale(1); opacity: .35; }
@keyframes pk-spin { to { rotate: 360deg; } }

.pk-flash {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, #fff 0, #fff6dc 40%, rgba(255,246,220,.0) 80%);
  opacity: 0;
  pointer-events: none;
}
.st-flash .pk-flash { animation: pk-flash .75s ease-out; }
@keyframes pk-flash { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }

.pk-confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }

.pk-close, .pk-skip {
  position: fixed;
  z-index: 5;
  border: 0;
  cursor: pointer;
  font: inherit;
}
.pk-close {
  top: 14px; right: 14px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
}
.pk-close:hover { background: rgba(255,255,255,.22); }
.pk-skip {
  bottom: 22px; left: 50%;
  transform: translateX(-50%);
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  color: #c9d2ee;
  font-size: .9rem;
  font-weight: 600;
}
.st-cta .pk-skip { display: none; }

.pk-stage {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  box-sizing: border-box;
  padding: 70px 16px 70px;
  display: grid;
  grid-template-areas: "c" "t";
  justify-items: center;
  align-content: center;
  row-gap: 22px;
  perspective: 1100px;
}

/* zatvoreni "paket" */
.pk-box {
  grid-area: c;
  align-self: center;
  width: min(230px, 58vw);
  aspect-ratio: 3 / 4.3;
  border-radius: 14px;
  padding: 6px;
  box-sizing: border-box;
  background: linear-gradient(150deg, var(--gold-1), var(--gold-2) 35%, var(--gold-3) 70%, var(--gold-2));
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.7);
  position: relative;
  opacity: 0;
  transform: scale(.5) translateY(30px);
  transition: opacity .4s, transform .5s cubic-bezier(.2,1.4,.4,1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  isolation: isolate;
}
.pk-box::before {
  content: "";
  position: absolute;
  inset: 6px;
  z-index: -1;
  border-radius: 9px;
  background:
    linear-gradient(115deg, rgba(255,255,255,0) 30%, rgba(255,255,255,.22) 45%, rgba(255,255,255,0) 60%) 120% 0 / 260% 100% no-repeat,
    radial-gradient(circle at 70% 10%, rgba(143,168,255,.4), transparent 55%),
    linear-gradient(170deg, #1d3f78, #0c1f3d 75%);
}
.st-shake .pk-box::before { animation: pk-foil 1.9s linear forwards; }
.pk-box .pk-logo { width: 46%; height: auto; margin-bottom: 4px; }
.pk-box-num {
  font-family: var(--a-display, "Barlow Condensed", sans-serif);
  font-weight: 800;
  font-size: clamp(6rem, 30vw, 8.5rem);
  line-height: .9;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.pk-box-txt { font-weight: 700; color: var(--gold-2); }
.st-in .pk-box { opacity: 1; transform: none; }
.st-shake .pk-box { animation: pk-shake 1.9s ease-in forwards; }
@keyframes pk-shake {
  0%   { transform: rotate(0); box-shadow: 0 0 0 rgba(230,184,92,0); }
  10%  { transform: rotate(-2deg); }
  20%  { transform: rotate(2deg); }
  30%  { transform: rotate(-3deg) scale(1.02); }
  40%  { transform: rotate(3deg) scale(1.02); }
  50%  { transform: rotate(-4deg) scale(1.04); }
  58%  { transform: rotate(4deg) scale(1.05); }
  66%  { transform: rotate(-5deg) scale(1.07); }
  73%  { transform: rotate(5deg) scale(1.08); }
  80%  { transform: rotate(-6deg) scale(1.1); }
  86%  { transform: rotate(6deg) scale(1.12); }
  92%  { transform: rotate(-3deg) scale(1.15); }
  100% { transform: rotate(0) scale(1.2); box-shadow: 0 0 90px 30px rgba(230,184,92,.85); }
}
@keyframes pk-foil { from { background-position: 120% 0, 0 0, 0 0; } to { background-position: -40% 0, 0 0, 0 0; } }
.st-flash .pk-box { animation: none; opacity: 0; transform: scale(1.5); transition: opacity .2s, transform .3s; }
.st-card .pk-box, .is-quick .pk-box { visibility: hidden; }
.is-quick .pk-flash { animation: none; }

/* kartica s nagradom */
.pk-card {
  grid-area: c;
  width: min(300px, 76vw);
  aspect-ratio: 5 / 7.3;
  position: relative;
  visibility: hidden;
  transform: scale(.3) rotateY(540deg);
  transform-style: preserve-3d;
  --shape: polygon(12% 0, 88% 0, 100% 7%, 100% 87%, 50% 100%, 0 87%, 0 7%);
}
.pk-face, .pk-back {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
  filter: drop-shadow(0 30px 40px rgba(0,0,0,.6)) drop-shadow(0 0 40px rgba(230,184,92,.35));
}
.pk-back { transform: rotateY(180deg); }
.pk-back .pk-card-in { justify-content: center; }
.pk-back .pk-logo { width: 62%; height: auto; }
.st-card .pk-card { visibility: visible; animation: pk-walkout 1.05s cubic-bezier(.15,.75,.25,1) forwards; }
@keyframes pk-walkout {
  0%   { transform: scale(.3) rotateY(540deg); }
  80%  { transform: scale(1.08) rotateY(-8deg); }
  100% { transform: scale(1) rotateY(0); }
}
.pk-face::before, .pk-back::before {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: var(--shape);
  background: linear-gradient(150deg, var(--gold-1), var(--gold-2) 35%, var(--gold-3) 70%, var(--gold-2));
}
.pk-card-in {
  position: absolute;
  inset: 7px;
  clip-path: var(--shape);
  background:
    radial-gradient(circle at 70% 10%, rgba(143,168,255,.35), transparent 50%),
    linear-gradient(170deg, #1d3f78, #0c1f3d 75%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 16px 0;
  box-sizing: border-box;
}
.pk-card-top {
  align-self: stretch;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-left: 8px;
}
.pk-num {
  font-family: var(--a-display, "Barlow Condensed", sans-serif);
  font-weight: 800;
  font-size: 3.4rem;
  line-height: .9;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.pk-mon { font-weight: 700; color: var(--gold-2); font-size: .95rem; }
.pk-img {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  margin: 10px 0 10px;
  border-radius: 10px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 60%, #ffe2a3, #e6b85c 55%, #e59a2f);
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 2px rgba(255,255,255,.12);
}
.pk-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pk-img.is-logo { background: #fff; }
.pk-img.is-logo img { object-fit: contain; padding: 12%; box-sizing: border-box; }
.pk-img .pk-emoji { font-size: clamp(64px, 22vw, 96px); line-height: 1; }
.pk-sponsor { margin: 0; color: var(--gold-2); font-weight: 700; font-size: .95rem; text-align: center; }
.pk-sponsor:empty { display: none; }
.pk-prize {
  margin: 2px 0 0;
  padding: 0 6px;
  font-family: var(--a-display, "Barlow Condensed", sans-serif);
  font-weight: 800;
  font-size: clamp(1.6rem, 6.4vw, 1.95rem);
  line-height: 1;
  text-align: center;
  color: #fff;
  min-height: 2em;
  margin-bottom: 15%;
}
.pk-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.35) 48%, rgba(255,255,255,.05) 54%, transparent 62%);
  background-size: 260% 100%;
  background-position: 130% 0;
  pointer-events: none;
}
.st-card .pk-shine { animation: pk-sweep 3.2s ease-in-out .9s infinite; }
@keyframes pk-sweep { 0% { background-position: 130% 0; } 45%, 100% { background-position: -40% 0; } }

/* poziv na sudjelovanje */
.pk-cta {
  grid-area: t;
  width: min(420px, 100%);
  text-align: center;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .45s, transform .45s;
  visibility: hidden;
}
.st-cta .pk-cta { opacity: 1; transform: none; visibility: visible; }
.pk-desc { margin: 0 0 14px; color: #c9d2ee; line-height: 1.55; }
.pk-h {
  font-family: var(--a-display, "Barlow Condensed", sans-serif);
  font-weight: 800;
  font-size: 2rem;
  line-height: 1;
  margin: 0 0 6px;
  color: #fff;
}
.pk-how { margin: 0 0 16px; color: #dfe5f7; line-height: 1.55; }
.pk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 15px 20px;
  border-radius: 12px;
  background: #2f6fe0;
  color: #fff !important;
  font-weight: 700;
  font-size: 1.08rem;
  text-decoration: none !important;
  box-shadow: 0 10px 30px -10px rgba(65,105,240,.9);
}
.pk-btn:hover { background: #1d4ea8; }
.pk-small { margin: 12px 0 0; font-size: .9rem; color: #9aa6cc; }
.pk-note {
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  color: #dfe5f7;
}
.pk-note strong { color: #fff; }
.pk-links { margin: 14px 0 0; display: flex; gap: 18px; justify-content: center; }
.pk-links:empty { display: none; }
.pk-link { color: #5b9bff !important; font-weight: 600; }

.bpadv-noscript { text-align: center; padding: 16px; background: #fff3cd; color: #5c4400; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .bpadv-door { transition: none; }
  .bpadv-cell.is-today .bpadv-door { animation: none; box-shadow: 0 0 0 4px rgba(230,184,92,.6); }
  .bpadv-snow { display: none; }
  .bpadv-pack *, .bpadv-pack { animation: none !important; transition: none !important; }
  .st-card .pk-card { visibility: visible; transform: none; }
}
