:root {
  --bg: #FFF6EB;
  --bg-accent: #FFE8F0;
  --ink: #1B2430;
  --ink-soft: #4A5568;
  --coral: #FF4D5A;
  --coral-dark: #E03A47;
  --sunny: #FFC857;
  --sunny-soft: #FFE6A8;
  --mint: #7ED6A5;
  --sky: #7EC8F5;
  --surface: #FFFFFF;
  --border: #F0D9C8;
  --shadow: 0 10px 30px rgba(255, 77, 90, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
  --font-brand: "Fredoka", system-ui, sans-serif;
  --font-body: "Nunito Sans", system-ui, sans-serif;
  --max: 1120px;
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(1000px 520px at 8% -8%, rgba(255, 77, 90, 0.22), transparent 58%),
    radial-gradient(900px 480px at 96% 4%, rgba(255, 200, 87, 0.35), transparent 52%),
    radial-gradient(700px 420px at 50% 110%, rgba(126, 214, 165, 0.22), transparent 55%),
    linear-gradient(165deg, #FFF9F1 0%, #FFEFE4 35%, #FFE6F0 70%, #EAF7FF 100%);
  background-attachment: scroll;
  line-height: 1.6;
}

/* Soft photo wash (legacy cheerful backdrop, not fixed — better on mobile) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(255, 249, 241, 0.72), rgba(255, 236, 245, 0.78)),
    url("/js/pozadina22.jpg") center top / cover no-repeat;
  opacity: 0.28;
}

/* Playful confetti / bubble pattern */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Ccircle cx='18' cy='22' r='5' fill='%23FF4D5A' fill-opacity='0.28'/%3E%3Ccircle cx='78' cy='16' r='4' fill='%23FFC857' fill-opacity='0.45'/%3E%3Ccircle cx='132' cy='34' r='6' fill='%237EC8F5' fill-opacity='0.32'/%3E%3Ccircle cx='48' cy='68' r='3.5' fill='%237ED6A5' fill-opacity='0.4'/%3E%3Ccircle cx='112' cy='78' r='5' fill='%23FF4D5A' fill-opacity='0.18'/%3E%3Ccircle cx='28' cy='118' r='7' fill='%23FFC857' fill-opacity='0.3'/%3E%3Ccircle cx='96' cy='128' r='4' fill='%237EC8F5' fill-opacity='0.35'/%3E%3Ccircle cx='148' cy='108' r='3' fill='%237ED6A5' fill-opacity='0.35'/%3E%3Crect x='58' y='42' width='8' height='8' rx='2' transform='rotate(18 62 46)' fill='%23FFC857' fill-opacity='0.35'/%3E%3Crect x='120' y='54' width='7' height='7' rx='2' transform='rotate(-22 123.5 57.5)' fill='%23FF4D5A' fill-opacity='0.22'/%3E%3Cpath d='M66 98c4-6 12-6 16 0' stroke='%23FF4D5A' stroke-opacity='0.25' stroke-width='2.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

a {
  color: var(--coral-dark);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

a:hover {
  color: var(--ink);
}

.site-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(255, 252, 247, 0.88);
  border-bottom: 1px solid transparent;
  transition: box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}

/* Auto ads + sticky header cover the screen on phones — keep sticky only on desktop */
@media (max-width: 959px) {
  .site-header {
    position: static;
  }
}

.site-header.is-scrolled {
  box-shadow: 0 8px 24px rgba(27, 36, 48, 0.08);
  border-bottom-color: var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
}

.brand:hover {
  color: var(--ink);
}

.brand__logo {
  width: auto;
  height: 28px;
  max-width: min(180px, 52vw);
  object-fit: contain;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  position: relative;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: var(--ink);
}

.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

.site-nav {
  display: none;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.5rem 0 1rem;
  flex-basis: 100%;
  width: 100%;
}

.site-nav.is-open {
  display: flex;
}

.site-nav a {
  display: block;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  color: var(--ink);
  font-weight: 700;
}

.site-nav a:hover,
.site-nav a.is-active {
  background: rgba(255, 77, 90, 0.1);
  color: var(--coral-dark);
}

@media (min-width: 960px) {
  .nav-toggle { display: none; margin-left: 0; }
  .site-header__inner {
    flex-wrap: nowrap;
  }
  .site-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0;
    gap: 0.15rem;
    flex-basis: auto;
    width: auto;
  }
  .site-nav a {
    padding: 0.5rem 0.65rem;
    font-size: 0.9rem;
    white-space: nowrap;
  }
}

/* Masthead / hub */
.masthead {
  padding: 1.5rem 0 0.5rem;
}

.masthead__panel {
  padding: 1.5rem 1.25rem;
  border-radius: calc(var(--radius) + 4px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.82)),
    linear-gradient(120deg, rgba(255, 77, 90, 0.12), rgba(255, 200, 87, 0.22));
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow);
}

.masthead h1 {
  margin: 0 0 0.5rem;
  font-family: var(--font-brand);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.masthead p {
  margin: 0 0 1.1rem;
  color: var(--ink-soft);
  max-width: 38rem;
  font-size: clamp(1rem, 2.4vw, 1.1rem);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  border: 0;
  font-family: var(--font-body);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 8px 18px rgba(255, 77, 90, 0.28);
}

.btn-primary:hover {
  background: var(--coral-dark);
  color: #fff;
}

.btn-secondary {
  background: var(--sunny);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(255, 200, 87, 0.28);
}

.btn-ghost {
  background: rgba(27, 36, 48, 0.06);
  color: var(--ink);
}

/* Layout */
.page-grid {
  display: grid;
  gap: 1.5rem;
  padding: 1.25rem 0 2.5rem;
}

@media (min-width: 960px) {
  .page-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
  }
}

.main-col,
.aside-col {
  min-width: 0;
}

.aside-col {
  display: grid;
  gap: 1rem;
}

/* Cards / posts */
.post-card,
.panel,
.game-panel,
.aside-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.post-card {
  padding: 1.15rem 1.15rem 1.25rem;
  margin-bottom: 1.15rem;
  animation: rise-in 0.45s var(--ease) both;
}

.post-card:nth-child(2) { animation-delay: 0.04s; }
.post-card:nth-child(3) { animation-delay: 0.08s; }
.post-card:nth-child(4) { animation-delay: 0.12s; }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.post-card--video { border-top: 4px solid #5B8DEF; }
.post-card--image { border-top: 4px solid var(--coral); }
.post-card--text { border-top: 4px solid #49B07B; }

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge-video { background: rgba(91, 141, 239, 0.15); color: #2F5FB8; }
.badge-image { background: rgba(255, 77, 90, 0.12); color: var(--coral-dark); }
.badge-text { background: rgba(73, 176, 123, 0.15); color: #2F8A57; }
.badge-game { background: rgba(255, 200, 87, 0.25); color: #8A5A00; }

.post-card h2,
.article-head h1 {
  margin: 0 0 0.65rem;
  font-family: var(--font-brand);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.post-card h2 a,
.article-head h1 {
  color: var(--ink);
}

.post-card h2 a:hover {
  color: var(--coral-dark);
}

.tekstbox {
  color: var(--ink-soft);
  margin-bottom: 0.85rem;
}

.tekstbox p:first-child { margin-top: 0; }
.tekstbox p:last-child { margin-bottom: 0; }

.media-frame {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #0f1720;
}

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.post-image {
  display: block;
  width: 100%;
  border-radius: var(--radius-sm);
}

.post-link-more {
  display: inline-flex;
  margin-top: 0.75rem;
  font-weight: 800;
}

/* Swiper gallery */
.gallery-swiper {
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.gallery-swiper .swiper-slide img {
  width: 100%;
  display: block;
  max-height: 70vh;
  object-fit: contain;
  background: #111827;
}

.gallery-swiper .swiper-pagination-bullet-active {
  background: var(--coral);
}

.gallery-swiper .swiper-button-next,
.gallery-swiper .swiper-button-prev {
  color: #fff;
}

/* Aside / related */
.aside-card,
.related-section,
.panel,
.game-panel {
  padding: 1rem;
}

.aside-card h2,
.related-section h2,
.panel h1,
.game-panel h1 {
  margin: 0 0 0.85rem;
  font-family: var(--font-brand);
  font-size: 1.2rem;
}

.teaser-list {
  display: grid;
  gap: 0.85rem;
}

.teaser {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.35rem;
  border-radius: 14px;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.teaser:hover {
  background: rgba(255, 77, 90, 0.06);
  transform: translateY(-1px);
}

.teaser img {
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--bg-accent);
}

.teaser h3 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.35;
  color: var(--ink);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.85rem;
}

.related-card {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.related-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.related-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.related-card span {
  display: block;
  padding: 0.65rem 0.7rem 0.8rem;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.35;
}

/* Ads */
.ad-unit,
.ad-slot {
  margin: 1.75rem 0;
  padding: 0.85rem 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed rgba(27, 36, 48, 0.12);
  overflow: hidden;
  min-height: 0;
  display: block;
  place-items: unset;
}

.ad-unit__label {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: center;
}

/* Reserve space before AdSense paints — reduces layout shift (CLS) */
.ad-unit__frame {
  position: relative;
  width: 100%;
  min-height: 320px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.ad-slot--sidebar .ad-unit__frame,
.ad-unit.ad-slot--sidebar .ad-unit__frame {
  min-height: 320px;
}

@media (min-width: 960px) {
  .ad-unit__frame {
    min-height: 300px;
  }

  .ad-slot--sidebar .ad-unit__frame,
  .ad-unit.ad-slot--sidebar .ad-unit__frame {
    min-height: 600px;
  }
}

.ad-unit.ad-slot--sidebar {
  margin-top: 1.5rem;
}

.ad-unit ins,
.ad-slot ins,
.ad-unit__frame .adsbygoogle {
  width: 100% !important;
  min-height: inherit;
}

.aside-col .ad-unit {
  margin-top: 1.5rem;
}

.main-col > .ad-unit:first-child {
  margin-top: 0.5rem;
}

.post-card + .ad-unit,
.game-panel + .ad-unit {
  margin-top: 2rem;
}

/* Pagination */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
}

.pagination a,
.pagination .active .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
}

.pagination .active .page-link,
.pagination a:hover {
  background: var(--coral);
  border-color: var(--coral);
  color: #fff;
}

/* Games / forms */
.game-panel h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.game-lead {
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

.form-grid {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .form-grid.two {
    grid-template-columns: 1fr 1fr;
  }
}

.form-field label {
  display: block;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.form-field select,
select.letter-input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  font: inherit;
  background: #fff;
}


.letter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.letter-buttons button {
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--sunny-soft);
  font-weight: 800;
  cursor: pointer;
}

.result-box {
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 77, 90, 0.06);
  border: 1px dashed rgba(255, 77, 90, 0.3);
}

.result-box--big {
  text-align: center;
  font-size: clamp(1.1rem, 3vw, 1.35rem);
}

.result-percent {
  font-family: var(--font-brand);
  font-size: clamp(2.5rem, 8vw, 4rem);
  color: var(--coral);
  line-height: 1;
  margin-top: 0.75rem;
}

.quiz-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.quiz-question {
  margin: 0 0 1rem;
  font-family: var(--font-brand);
  font-size: clamp(1.15rem, 3vw, 1.4rem);
  line-height: 1.35;
}

.quiz-choices {
  display: grid;
  gap: 0.65rem;
}

.quiz-choice {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1rem;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.15s var(--ease);
}

.quiz-choice:hover:not(:disabled) {
  border-color: var(--coral);
  background: rgba(255, 77, 90, 0.06);
  transform: translateY(-1px);
}

.quiz-choice:disabled {
  cursor: default;
}

.quiz-choice.is-correct {
  background: rgba(126, 214, 165, 0.35);
  border-color: var(--mint);
}

.quiz-choice.is-wrong {
  background: rgba(255, 77, 90, 0.15);
  border-color: var(--coral);
}

.quiz-choice.is-muted {
  opacity: 0.55;
}

.quiz-actions {
  margin-top: 1rem;
}

[x-cloak] {
  display: none !important;
}

.horoscope-list {
  display: grid;
  gap: 1rem;
}

.horoscope-item h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-brand);
  font-size: 1.15rem;
  color: var(--coral-dark);
}

.horoscope-item p,
.horoscope-item .horoskop {
  margin: 0;
  color: var(--ink-soft);
}

.legal-content {
  max-width: 48rem;
}

.legal-content h1 {
  font-family: var(--font-brand);
  font-size: clamp(1.6rem, 4vw, 2.1rem);
}

.error-page {
  text-align: center;
  padding: 2rem 1.25rem;
}

.error-page__code {
  font-family: var(--font-brand);
  font-size: clamp(4rem, 18vw, 7rem);
  line-height: 1;
  color: var(--coral);
  margin: 0;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: rgba(255, 252, 247, 0.82);
  padding: 2rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.site-footer h2 {
  margin: 0 0 0.6rem;
  font-family: var(--font-brand);
  font-size: 1.05rem;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.site-footer a {
  color: var(--ink-soft);
  font-weight: 700;
}

.site-footer a:hover {
  color: var(--coral-dark);
}

.footer-copy {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hide,
.hidden {
  display: none !important;
}

.loader {
  width: 20px;
  height: 20px;
  vertical-align: middle;
}
