:root {
  --bg: #fff8ee;
  --card: #ffffff;
  --text: #2b2438;
  --muted: #756e82;
  --primary: #ff6b6b;
  --primary-dark: #e6534f;
  --purple: #7c5cff;
  --blue: #3aa8ff;
  --green: #2ecc9a;
  --yellow: #ffc84a;
  --pink: #ff8fc7;
  --border: #f0e4d0;
  --radius: 20px;
  --radius-sm: 12px;
  --danger: #e0483e;
  --ok: #1fae7a;
  --warn: #d98c1a;
  --shadow: 0 8px 24px rgba(120, 90, 40, 0.10);
  --shadow-lg: 0 16px 40px rgba(120, 90, 40, 0.16);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at 8% 12%, rgba(255,143,199,0.16) 0%, transparent 40%),
    radial-gradient(circle at 92% 18%, rgba(58,168,255,0.14) 0%, transparent 38%),
    radial-gradient(circle at 12% 85%, rgba(46,204,154,0.14) 0%, transparent 36%),
    radial-gradient(circle at 88% 82%, rgba(255,200,74,0.16) 0%, transparent 38%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.55;
  font-size: 16px;
}

h1, h2, h3, .display {
  font-family: 'Baloo 2', 'Comfortaa', 'Nunito', sans-serif;
  font-weight: 700;
}

a { color: var(--primary-dark); text-decoration: none; }

header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--card);
  border-bottom: 3px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  gap: 10px;
  flex-wrap: wrap;
}

header.site .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary-dark);
}
header.site .brand img { height: 38px; width: 38px; }

header.site nav {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }

.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 6px 0 var(--primary-dark);
}
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--primary-dark); }
.btn.primary:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--primary-dark); }

.btn.purple { background: var(--purple); border-color: var(--purple); color: #fff; box-shadow: 0 6px 0 #5b3fd6; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 6px 0 #1f9a76; }

.btn.small { padding: 7px 14px; font-size: 0.85rem; box-shadow: none; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.danger { border-color: var(--danger); color: var(--danger); background: transparent; box-shadow: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

.card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.hero {
  text-align: center;
  padding: 20px 16px 8px;
  position: relative;
}

.hero-3d {
  width: 100%;
  max-width: 480px;
  height: 220px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.1rem;
  margin: 4px 0 10px;
  color: var(--primary-dark);
  line-height: 1.2;
}

.hero p { color: var(--muted); max-width: 560px; margin: 0 auto 20px; font-size: 1.05rem; }

.hero .cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
}

.age-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: #fff;
}
.age-4-6 { background: var(--pink); }
.age-7-9 { background: var(--blue); }
.age-10-12 { background: var(--purple); }
.age-13-14 { background: var(--primary-dark); }
.age-4-14 { background: linear-gradient(90deg, var(--purple), var(--pink)); }

.topic-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: #eaf7f0;
  color: var(--ok);
  font-size: 0.78rem;
  font-weight: 700;
  margin-left: 6px;
}

.course-card {
  display: block;
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.course-card:hover { transform: translateY(-4px) rotate(-0.3deg); box-shadow: var(--shadow-lg); }
.course-card .icon { font-size: 2.2rem; }
.course-card.locked { opacity: 0.92; }
.premium-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--yellow);
  color: #6b4a00;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  box-shadow: var(--shadow);
}

form.stack { display: flex; flex-direction: column; gap: 12px; max-width: 420px; }

label { font-size: 0.88rem; color: var(--muted); margin-bottom: 4px; display: block; font-weight: 700; }

input, select, textarea {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  background: #fff;
  color: var(--text);
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--purple); }

.error-msg {
  color: var(--danger);
  background: #fdecea;
  border: 2px solid #f5c6c2;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.success-msg {
  color: var(--ok);
  background: #e6f8f0;
  border: 2px solid #bfe3d6;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 800; }

.table-wrap { overflow-x: auto; }

.status-pill {
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}
.status-pill.not_started { background: #eee; color: #777; }
.status-pill.in_progress { background: #fdf0d5; color: var(--warn); }
.status-pill.completed { background: #e0f2e9; color: var(--ok); }

.stat-row { display: flex; gap: 12px; flex-wrap: wrap; }
.stat-box {
  flex: 1;
  min-width: 120px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-box .num { font-size: 1.8rem; font-weight: 800; color: var(--primary-dark); font-family: 'Baloo 2', sans-serif; }
.stat-box .label { font-size: 0.8rem; color: var(--muted); font-weight: 700; }

.embed-wrap {
  position: relative;
  width: 100%;
  padding-top: 62.5%;
  background: #111;
  border-radius: var(--radius);
  overflow: hidden;
  margin: 16px 0;
}
.embed-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.embed-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
  font-size: 0.9rem;
  text-align: center;
  padding: 20px;
}

.access-code-box {
  font-family: monospace;
  font-size: 1.1rem;
  background: #fbeee9;
  padding: 8px 12px;
  border-radius: 8px;
  display: inline-block;
  letter-spacing: 2px;
}

footer.site {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 28px 16px 40px;
}

.lesson-list { list-style: none; padding: 0; margin: 0; }
.lesson-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  background: var(--card);
  transition: transform 0.12s ease;
}
.lesson-list li:hover { transform: translateX(3px); }
.lesson-list a { color: var(--text); font-weight: 700; }

.mascot-float {
  animation: bob 3.2s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
}

.badge-lock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff3d6;
  color: #8a5a00;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
}

/* --- Igra memorije --- */
.memory-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 16px 0;
}
@media (min-width: 520px) {
  .memory-board { grid-template-columns: repeat(4, 1fr); gap: 12px; }
}
.memory-card {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  perspective: 800px;
}
.memory-card .inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.35s cubic-bezier(.4,.2,.2,1);
  transform-style: preserve-3d;
}
.memory-card.flipped .inner, .memory-card.matched .inner { transform: rotateY(180deg); }
.memory-card .face {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  padding: 6px;
  text-align: center;
  font-weight: 800;
}
.memory-card .front {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: #fff;
  font-size: 1.6rem;
}
.memory-card .back {
  background: #fff;
  border: 2px solid var(--border);
  transform: rotateY(180deg);
  font-size: clamp(1.1rem, 4vw, 1.8rem);
  color: var(--text);
}
.memory-card.matched .back { background: #e6f8f0; border-color: var(--ok); color: var(--ok); }
.memory-card.shake .inner { animation: shake 0.4s; }
@keyframes shake {
  0%, 100% { transform: rotateY(0) translateX(0); }
  25% { transform: rotateY(0) translateX(-6px); }
  75% { transform: rotateY(0) translateX(6px); }
}

.game-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-weight: 800;
  color: var(--muted);
}

.win-banner {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, #fff3d6, #ffe0ec);
  border-radius: var(--radius);
  border: 2px solid var(--yellow);
}
.win-banner h3 { color: var(--primary-dark); margin: 8px 0; font-size: 1.5rem; }

.admin-lesson-row {
  border-top: 1px solid var(--border);
  padding: 12px 0;
}
.pair-row { display: flex; gap: 8px; margin-bottom: 6px; align-items: center; }

/* --- Sticker kartice (umesto ravnih pravougaonih kartica) --- */
.sticker-card {
  position: relative;
  background: var(--card);
  border-radius: 26px 26px 26px 8px;
  border: 3px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.2s cubic-bezier(.34,1.56,.64,1), box-shadow 0.2s ease;
}
.sticker-card:nth-child(3n+1) { transform: rotate(-1.4deg); }
.sticker-card:nth-child(3n+2) { transform: rotate(1.1deg); }
.sticker-card:nth-child(3n+3) { transform: rotate(-0.6deg); border-radius: 8px 26px 26px 26px; }
.sticker-card:hover, a.sticker-card:hover {
  transform: translateY(-6px) rotate(0deg) scale(1.02);
  box-shadow: var(--shadow-lg);
  z-index: 2;
}
.sticker-card .icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  font-size: 1.8rem;
  margin-bottom: 10px;
}

/* --- Oblacic za govor (maskota) --- */
.speech-bubble {
  position: relative;
  background: #fff;
  border: 3px solid var(--purple);
  border-radius: 20px;
  padding: 10px 16px;
  font-weight: 800;
  color: var(--purple);
  display: inline-block;
  box-shadow: var(--shadow);
}
.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -14px;
  left: 30px;
  border: 9px solid transparent;
  border-top-color: var(--purple);
  border-bottom: 0;
}
.speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 33px;
  border: 7px solid transparent;
  border-top-color: #fff;
  border-bottom: 0;
  z-index: 1;
}

/* --- Decorative floating shapes --- */
.floaty {
  position: absolute;
  animation: floaty-drift 5s ease-in-out infinite;
  opacity: 0.85;
  pointer-events: none;
  user-select: none;
}
@keyframes floaty-drift {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(8deg); }
}

/* --- Level path (vijugava staza lekcija, a la igra sa mapama) --- */
.level-path {
  position: relative;
  max-width: 420px;
  margin: 20px auto;
  padding: 10px 0 30px;
}
.level-path::before {
  content: '';
  position: absolute;
  top: 30px;
  bottom: 30px;
  left: 50%;
  width: 6px;
  margin-left: -3px;
  background: repeating-linear-gradient(
    to bottom, var(--border) 0 10px, transparent 10px 20px
  );
  border-radius: 4px;
  z-index: 0;
}
.level-node-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  margin-bottom: 6px;
}
.level-node-wrap.pos-left { justify-content: flex-start; }
.level-node-wrap.pos-right { justify-content: flex-end; }
.level-node-wrap.pos-center { justify-content: center; }

.level-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  width: 108px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}
.level-node .circle {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  border: 5px solid #fff;
  box-shadow: 0 6px 0 rgba(0,0,0,0.15), var(--shadow);
  transition: transform 0.15s ease;
  position: relative;
}
.level-node:hover .circle { transform: scale(1.08) translateY(-2px); }
.level-node .label {
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  color: var(--text);
  line-height: 1.2;
}
.level-node.available .circle { background: linear-gradient(135deg, var(--purple), var(--blue)); color: #fff; }
.level-node.completed .circle { background: linear-gradient(135deg, var(--yellow), #ffb648); color: #fff; }
.level-node.completed .circle::after {
  content: '⭐';
  position: absolute;
  top: -10px;
  right: -8px;
  font-size: 1.3rem;
}
.level-node.locked .circle { background: #e7e2d8; color: #a89f8e; box-shadow: 0 6px 0 rgba(0,0,0,0.06); }
.level-node.locked { cursor: not-allowed; }
.level-node.current .circle {
  animation: pulse-node 1.6s ease-in-out infinite;
}
@keyframes pulse-node {
  0%, 100% { box-shadow: 0 6px 0 rgba(0,0,0,0.15), 0 0 0 0 rgba(124,92,255,0.5); }
  50% { box-shadow: 0 6px 0 rgba(0,0,0,0.15), 0 0 0 10px rgba(124,92,255,0); }
}
.pair-row input { flex: 1; }
