/* Hero widgets on the home page: bonus slot machine + "Nedavni dobici".
   Loaded only on the home page; every selector is prefixed with .hs-. */

.hero__cards-panel--widgets {
  --hs-gold: #E8C77A;
  --hs-gold-dark: #C9A75A;
  --hs-gold-pale: #F3E4B5;
  --hs-on-gold: #1a0a00;
  --hs-dark: #020617;
  --hs-dark-2: #0F172A;
  --hs-blue: #1E3A8A;
  --hs-win: #4ade80;
  width: 340px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hs-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── Slot: fallback handling ── */
/* The static top offer stays visible without JS. As soon as JS is known to
   run, it is hidden and the slot's space is reserved, so nothing jumps. */
.hs-slot-root { min-height: 0; }
html.hs-js .hs-slot-root:not(.is-active) { min-height: clamp(214px, 60vw, 236px); }
html.hs-js .hs-slot-root [data-hs-fallback],
.hs-slot-root.is-active [data-hs-fallback] { display: none; }

/* ── Slot machine ── */
.hs-slot {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 16px 18px;
  border-radius: 18px;
  background: linear-gradient(160deg, var(--hs-dark-2) 0%, var(--hs-dark) 60%, #1a1405 100%);
  border: 3px solid var(--hs-gold);
  box-shadow: 0 0 0 2px var(--hs-dark), 0 0 0 3px var(--hs-blue), 0 12px 40px rgba(232,199,122,.22), 0 4px 16px rgba(0,0,0,.4);
}
.hs-slot__title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .03em;
  text-transform: uppercase;
  text-align: center;
  color: var(--hs-gold);
}
.hs-slot__reels {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 6px;
  border-radius: 10px;
  background:
    linear-gradient(to right, transparent 0%, rgba(30,58,138,.5) 12%, rgba(37,99,235,.35) 50%, rgba(30,58,138,.5) 88%, transparent 100%) 0 50% / 100% 2px no-repeat,
    var(--hs-dark);
  box-shadow: inset 0 2px 5px rgba(0,0,0,.55), inset 0 -2px 5px rgba(0,0,0,.55);
}
.hs-slot__reels::before,
.hs-slot__reels::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0; height: 0;
  transform: translateY(-50%);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  pointer-events: none;
  z-index: 1;
}
.hs-slot__reels::before { left: 0; border-left: 6px solid var(--hs-gold); }
.hs-slot__reels::after { right: 0; border-right: 6px solid var(--hs-gold); }
.hs-slot__reel {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  max-width: 88px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--hs-gold-pale) 0%, #F1F5F9 100%);
}
.hs-slot__reel:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.hs-slot__reel:not(:last-child) {
  border-top-right-radius: 0; border-bottom-right-radius: 0;
  box-shadow: inset -2px 0 0 0 rgba(15,23,42,.35);
}
.hs-slot__reel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 7px 10px -6px rgba(15,23,42,.35), inset 0 -7px 10px -6px rgba(15,23,42,.35);
  pointer-events: none;
}
.hs-slot__reel:first-child::before,
.hs-slot__reel:last-child::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background: rgba(15,23,42,.18);
  pointer-events: none;
}
.hs-slot.is-spinning .hs-slot__reel { box-shadow: 0 0 0 2px rgba(232,199,122,.55), 0 0 0 3px rgba(37,99,235,.3); }
.hs-slot__track { display: flex; flex-direction: column; will-change: transform; }
.hs-slot__symbol {
  flex-shrink: 0;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hs-slot__symbol-svg { width: 66%; height: 66%; display: block; }

.hs-slot__btn {
  width: 100%;
  max-width: 280px;
  min-height: 46px;
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--hs-gold-pale) 0%, var(--hs-gold) 50%, var(--hs-gold-dark) 100%);
  color: var(--hs-on-gold);
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter .15s;
}
.hs-slot__btn:hover { filter: brightness(.93); }
.hs-slot__btn[aria-disabled="true"] { opacity: .75; cursor: default; }
/* Idle attention pulse: only transform and opacity are animated (the glow is
   a pre-painted pseudo-element), so it stays on the compositor. */
.hs-slot__btn { position: relative; }
.hs-slot__btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 10px 26px rgba(232,199,122,.5);
  opacity: 0;
  pointer-events: none;
}
@keyframes hsAttract {
  0%, 50%, 100% { transform: scale(1); }
  25% { transform: scale(1.03); }
}
@keyframes hsAttractGlow {
  0%, 50%, 100% { opacity: 0; }
  25% { opacity: 1; }
}
.hs-slot[data-state="idle"] .hs-slot__btn--attract { animation: hsAttract 1.1s ease-in-out infinite; }
.hs-slot[data-state="idle"] .hs-slot__btn--attract::after { animation: hsAttractGlow 1.1s ease-in-out infinite; }

.hs-slot__btn:focus-visible,
.hs-modal__close:focus-visible,
.hs-modal__cta:focus-visible,
.hs-modal__retry:focus-visible {
  outline: 3px solid #93C5FD;
  outline-offset: 3px;
}

/* ── Result modal ── */
.hs-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(2,6,23,.75);
  animation: hsFadeIn .25s ease forwards;
}
.hs-modal-overlay[hidden] { display: none; }
.hs-modal {
  position: relative;
  width: 100%;
  max-width: 360px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px 16px;
  border-radius: 18px;
  border: 1.5px solid var(--hs-gold, #E8C77A);
  background: #fff;
  box-shadow: 0 20px 60px rgba(2,6,23,.45), inset 0 0 0 3px rgba(30,58,138,.12);
  color: #0F172A;
  text-align: center;
  font-family: var(--font-sans);
  animation: hsPop .5s cubic-bezier(.22,.9,.32,1.2) forwards;
}
.hs-modal p { margin: 0; }
.hs-modal__close {
  position: absolute;
  top: 6px; right: 6px;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 0;
  border-radius: 50%;
  background: #F1F5F9;
  color: #475569;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.hs-modal__close:hover { background: #E2E8F0; color: #0F172A; }
.hs-modal__badge { font-size: 13px; font-weight: 700; color: #1E3A8A; }
.hs-modal__title { font-size: 20px; font-weight: 800; }
.hs-modal__brand { display: flex; align-items: center; gap: 8px; margin: 2px 0; }
.hs-modal__logo-bg { display: flex; align-items: center; justify-content: center; padding: 6px 10px; border-radius: 12px; }
.hs-modal__logo { height: 28px; width: auto; max-width: 72px; object-fit: contain; }
.hs-modal__name { font-size: 15px; font-weight: 700; }
.hs-modal__card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 4px 0;
  padding: 16px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(30,58,138,.12) 0%, rgba(30,58,138,.03) 100%);
  border: 1.5px solid rgba(30,58,138,.28);
}
.hs-modal__amount { font-size: 28px; font-weight: 800; line-height: 1.15; color: #0F172A; }
.hs-modal__spins { font-size: 15px; font-weight: 700; color: #1E40AF; }
.hs-modal__spins:empty { display: none; }
.hs-modal__cta {
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #F3E4B5 0%, #E8C77A 50%, #C9A75A 100%);
  color: #1a0a00;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
}
.hs-modal__cta:hover { filter: brightness(.93); text-decoration: none; color: #1a0a00; }
.hs-modal__cta[aria-disabled="true"] { opacity: .5; cursor: not-allowed; filter: grayscale(.6); }
.hs-modal__note { font-size: 13px; font-weight: 600; color: #B91C1C; }
.hs-modal__note[hidden] { display: none; }
.hs-modal__timer { margin-top: 4px; font-size: 13px; color: #475569; }
.hs-modal__timer strong { color: #1E40AF; font-variant-numeric: tabular-nums; }
.hs-modal[data-state="expired"] .hs-modal__timer { color: #B91C1C; font-weight: 700; }
.hs-modal__retry {
  min-height: 40px;
  border: 0;
  background: none;
  color: #475569;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.hs-modal__retry:hover { color: #1E40AF; }
@keyframes hsFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes hsPop {
  0% { opacity: 0; transform: scale(.7) translateY(24px); }
  60% { opacity: 1; transform: scale(1.04) translateY(-4px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Nedavni dobici ── */
.hs-wins { width: 100%; min-width: 0; }
.hs-wins__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2px 8px;
  min-height: 32px; /* room for the pause button added by JS: no shift */
  margin-bottom: 8px;
}
.hs-wins__title {
  margin: 0;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #fff;
}
.hs-wins__pause {
  margin-left: auto;
  min-height: 32px;
  min-width: 32px;
  padding: 4px 12px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}
.hs-wins__pause { display: inline-flex; align-items: center; gap: 7px; }
/* Pause icon: two bars; play icon: a triangle. Drawn in CSS, no font glyphs. */
.hs-wins__pause::before {
  content: "";
  width: 3px; height: 10px;
  background: currentColor;
  box-shadow: 5px 0 0 currentColor;
  margin-right: 5px;
}
.hs-wins__pause[data-state="paused"]::before {
  width: 0; height: 0;
  background: none;
  box-shadow: none;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent currentColor;
  margin-right: 0;
}
.hs-wins__pause:hover { background: rgba(255,255,255,.16); }
.hs-wins__pause:focus-visible { outline: 3px solid #93C5FD; outline-offset: 2px; }
.hs-wins__wrap { overflow: hidden; border-radius: 12px; }
.hs-wins__track { display: flex; width: max-content; gap: 8px; will-change: transform; }
/* Before JS: the pending tile (first) is hidden and the visible pair shares
   the width; JS then sets exact tile widths and the resting offset. */
.hs-wins:not(.is-active) .hs-wins__track { width: 100%; }
.hs-wins:not(.is-active) .hs-win { flex: 1 1 0; }
.hs-wins:not(.is-active) .hs-win:first-child { display: none; }

.hs-win {
  flex: 0 0 auto;
  min-width: 0;
  height: 132px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  grid-template-rows: 52px 24px 26px;
  gap: 6px 8px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14);
  color: #fff;
  text-decoration: none;
  transition: background-color .2s, border-color .2s, transform .15s;
}
.hs-win:hover { background: rgba(255,255,255,.12); border-color: rgba(232,199,122,.5); color: #fff; text-decoration: none; }
.hs-win:active { transform: scale(.98); }
.hs-win:focus-visible { outline: 2px solid #93C5FD; outline-offset: -2px; }
.hs-win__thumb {
  grid-column: 1; grid-row: 1;
  width: 52px; height: 52px;
  border-radius: 8px;
  object-fit: cover;
}
.hs-win__info {
  grid-column: 2; grid-row: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  line-height: 1.25;
}
.hs-win__player {
  font-size: 11px;
  color: rgba(255,255,255,.65);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hs-win__game {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.hs-win__amount {
  grid-column: 1 / -1; grid-row: 2;
  display: block;
  font-size: 17px;
  font-weight: 800;
  line-height: 24px;
  color: var(--hs-win, #4ade80);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.hs-win__amount.is-fresh { animation: hsGlow 1.2s ease-out; }
/* filter, not text-shadow: animating text-shadow re-runs layout every frame. */
@keyframes hsGlow {
  from { filter: brightness(1.5) drop-shadow(0 0 6px rgba(74,222,128,.7)); }
  to { filter: brightness(1) drop-shadow(0 0 0 rgba(74,222,128,0)); }
}
.hs-win__cta {
  grid-column: 1 / -1; grid-row: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: linear-gradient(135deg, #F3E4B5 0%, #E8C77A 50%, #C9A75A 100%);
  color: #1a0a00;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.hs-win:hover .hs-win__cta { filter: brightness(.92); }

/* Desktop: title + lead in the left column, widgets in the right column. */
@media (min-width: 769px) {
  .hero__inner--widgets {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
  }
  .hero__inner--widgets .hero__content { grid-column: 1; grid-row: 1; }
  .hero__inner--widgets .hero__cards-panel--widgets { grid-column: 2; grid-row: 1; }
}

@media (max-width: 768px) {
  .hero__cards-panel--widgets {
    width: 100%;
    max-width: 420px;
    margin-inline: auto;
  }
}
@media (max-width: 360px) {
  .hs-slot { padding: 16px 12px 14px; }
  .hs-slot__title { font-size: 12px; }
  .hs-win { grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: 44px 24px 26px; height: 124px; gap: 6px; padding: 7px; }
  .hs-win__thumb { width: 44px; height: 44px; }
  .hs-win__game { font-size: 12px; }
  .hs-win__amount { font-size: 15px; }
}

/* Short viewports (phones in landscape): keep the whole result, CTA and
   retry link inside the screen without scrolling the dialog. */
@media (max-height: 480px) {
  .hs-modal-overlay { padding: 8px; }
  .hs-modal { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); gap: 4px; padding: 12px 14px 8px; }
  .hs-modal__badge { display: none; }
  .hs-modal__title { font-size: 17px; }
  .hs-modal__brand { margin: 0; }
  .hs-modal__card { margin: 0; padding: 8px 12px; gap: 2px; }
  .hs-modal__amount { font-size: 22px; }
  .hs-modal__spins { font-size: 14px; }
  .hs-modal__cta { min-height: 44px; margin-top: 2px; }
  .hs-modal__timer { margin-top: 0; }
  .hs-modal__retry { min-height: 32px; }
}

/* "Prikaži više" under the hero lead: a finger-sized tap target on the home
   page without moving the visible label. */
@media (max-width: 768px) {
  .hero__inner--widgets .hero__lead-toggle {
    min-height: 44px;
    margin-top: -6px;
    margin-bottom: -8px;
    padding-right: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hs-slot[data-state="idle"] .hs-slot__btn--attract,
  .hs-slot[data-state="idle"] .hs-slot__btn--attract::after,
  .hs-win__amount.is-fresh,
  .hs-modal-overlay,
  .hs-modal { animation: none; }
  .hs-slot__track,
  .hs-wins__track { transition: none !important; }
}
