@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700;800&family=Nunito:wght@500;600;700;800&display=swap');

:root {
  --purple: #7c4dff;
  --purple-dark: #5c2fd6;
  --pink: #ff6f91;
  --yellow: #ffd54f;
  --blue: #4fc3f7;
  --green: #66d7a8;
  --ink: #30264a;
  --muted: #6f6682;
  --cream: #fffaf0;
  --white: #ffffff;
  --shadow: 0 24px 70px rgba(72, 38, 126, 0.18);
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 213, 79, .45), transparent 24%),
    radial-gradient(circle at 92% 12%, rgba(79, 195, 247, .38), transparent 26%),
    radial-gradient(circle at 15% 88%, rgba(255, 111, 145, .28), transparent 24%),
    linear-gradient(135deg, #fffaf0 0%, #f5efff 48%, #eafaff 100%);
}

button, select { font: inherit; }
button { cursor: pointer; }

.floating-shapes span {
  position: fixed;
  z-index: 0;
  font-size: clamp(28px, 4vw, 58px);
  opacity: .35;
  filter: drop-shadow(0 8px 14px rgba(66, 42, 108, .16));
  animation: float 6s ease-in-out infinite;
  pointer-events: none;
}

.floating-shapes span:nth-child(1) { left: 4%; top: 10%; }
.floating-shapes span:nth-child(2) { right: 5%; top: 15%; animation-delay: -1s; }
.floating-shapes span:nth-child(3) { left: 8%; bottom: 14%; animation-delay: -2s; }
.floating-shapes span:nth-child(4) { right: 6%; bottom: 8%; animation-delay: -3s; }
.floating-shapes span:nth-child(5) { left: 22%; top: 3%; animation-delay: -4s; }
.floating-shapes span:nth-child(6) { right: 25%; bottom: 3%; animation-delay: -5s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-14px) rotate(5deg); }
}

.page-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px 18px;
}

.hero-card {
  width: min(880px, 100%);
  padding: clamp(24px, 5vw, 52px);
  text-align: center;
  border: 4px solid rgba(255,255,255,.9);
  border-radius: 38px;
  background: rgba(255,255,255,.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--pink);
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: .82rem;
}

h1, h2, h3 { font-family: "Baloo 2", cursive; }

.hero-card h1,
.registrations-header h1 {
  margin: 0;
  color: var(--purple);
  font-size: clamp(2.1rem, 7vw, 4.7rem);
  line-height: .95;
  text-shadow: 0 5px 0 rgba(124,77,255,.1);
}

.hero-card h2,
.registrations-header h2 {
  margin: 8px auto 22px;
  max-width: 760px;
  font-size: clamp(1.35rem, 3.4vw, 2.3rem);
  line-height: 1.1;
  color: var(--ink);
}

.event-info,
.summary-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.info-pill,
.summary-strip span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #f8f5ff;
  border: 2px solid #ebe4ff;
  font-size: .94rem;
}

.timer-section {
  margin-top: 28px;
  padding: clamp(20px, 4vw, 34px);
  border-radius: 30px;
  background: linear-gradient(145deg, #fff8d9, #fff0f6 48%, #eef9ff);
  border: 3px dashed rgba(124,77,255,.28);
}

.group-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 800;
}

.group-select {
  width: min(360px, 100%);
  padding: 11px 16px;
  border: 2px solid #d9ccff;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  outline: none;
}

.group-select:focus { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(124,77,255,.12); }

.timer-ring {
  --progress: 0deg;
  width: min(330px, 74vw);
  aspect-ratio: 1;
  margin: 24px auto;
  padding: 14px;
  border-radius: 50%;
  background: conic-gradient(var(--pink) var(--progress), rgba(124,77,255,.13) 0deg);
  box-shadow: 0 20px 40px rgba(95, 50, 150, .17);
  transition: background .2s linear, transform .25s ease;
}

.timer-ring.is-running { animation: pulse 1.4s ease-in-out infinite; }

@keyframes pulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.018); }
}

.timer-inner {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  border-radius: 50%;
  background: #fff;
  border: 5px solid rgba(255,255,255,.9);
}

.timer-caption { color: var(--muted); font-weight: 800; }

#timerDisplay {
  display: block;
  margin: 2px 0;
  font-family: "Baloo 2", cursive;
  font-size: clamp(4rem, 15vw, 7rem);
  font-weight: 800;
  line-height: 1;
  color: var(--purple);
  font-variant-numeric: tabular-nums;
}

.timer-status { font-weight: 900; color: var(--pink); }

.timer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.btn {
  min-width: 120px;
  padding: 12px 18px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 8px 0 rgba(48,38,74,.15);
  transition: transform .15s ease, box-shadow .15s ease, opacity .2s ease;
}

.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 0 rgba(48,38,74,.13); }
.btn:active { transform: translateY(3px); box-shadow: 0 4px 0 rgba(48,38,74,.15); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-start { background: linear-gradient(135deg, #62d9a7, #27b980); }
.btn-pause { background: linear-gradient(135deg, #ffbd4a, #f39237); }
.btn-reset { background: linear-gradient(135deg, #ff7a9a, #ed4772); }

.timer-note {
  max-width: 610px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.5;
}

.registrations-link {
  display: inline-block;
  margin-top: 15px;
  color: #746a86;
  font-size: .76rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(38, 22, 64, .58);
}

.modal[hidden] { display: none; }

.modal-card {
  width: min(430px, 100%);
  padding: 30px;
  text-align: center;
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--shadow);
  animation: pop .3s ease;
}

@keyframes pop { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-card h3 { margin: 6px 0; font-size: 2rem; color: var(--purple); }
.modal-card p { color: var(--muted); }
.celebration { font-size: 2.7rem; }

/* Prijave */
.registrations-header {
  padding: 34px 18px 28px;
  text-align: center;
}

.registrations-header h1 { font-size: clamp(2rem, 6vw, 4rem); }
.registrations-header h2 { margin-bottom: 16px; }

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--purple-dark);
  font-weight: 900;
  text-decoration: none;
}

.groups-container {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto 40px;
}

.capacity-card {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
  padding: 18px 22px;
  border-radius: 22px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 14px 40px rgba(72,38,126,.12);
}

.capacity-card > div:first-child { display: flex; gap: 8px; align-items: baseline; }
.capacity-label { color: var(--muted); font-weight: 800; }
.capacity-card strong { color: var(--purple); font-size: 1.25rem; }
.capacity-bar { height: 14px; overflow: hidden; border-radius: 999px; background: #ece5ff; }
.capacity-bar span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--pink), var(--purple)); transition: width .4s ease; }
.available-count { color: #16845a; font-weight: 900; }

.groups-list { display: grid; gap: 22px; }

.group-card {
  overflow: hidden;
  border-radius: 26px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 16px 44px rgba(72,38,126,.13);
  border: 3px solid rgba(255,255,255,.9);
}

.group-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px;
  background: var(--group-color, #7c4dff);
  color: #fff;
}

.group-heading h3 { margin: 0; font-size: 1.75rem; }
.group-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.group-meta span { padding: 7px 11px; border-radius: 999px; background: rgba(255,255,255,.2); font-weight: 800; font-size: .86rem; }

.table-wrap { overflow-x: auto; }
.participants-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.participants-table th,
.participants-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #eee9f7; }
.participants-table th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; background: #fbfaff; }
.participants-table tbody tr:hover { background: #fffaf1; }
.participants-table td:first-child { width: 68px; font-weight: 900; color: var(--purple); }
.empty-slot { color: #aaa2b6; font-style: italic; }
.status-badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: .78rem; font-weight: 900; }
.status-confirmed { color: #157454; background: #dff8ed; }
.status-open { color: #8a6620; background: #fff1c7; }

.site-footer {
  padding: 10px 20px 32px;
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
}

@media (max-width: 720px) {
  .hero-card { border-radius: 26px; }
  .event-info { flex-direction: column; align-items: stretch; }
  .info-pill { justify-content: center; }
  .timer-actions .btn { flex: 1 1 30%; min-width: 95px; }
  .capacity-card { grid-template-columns: 1fr; gap: 10px; }
  .capacity-card > div:first-child { justify-content: space-between; }
  .available-count { text-align: right; }
}

@media print {
  body { background: #fff; }
  .back-link, .capacity-card, .site-footer { display: none; }
  .registrations-header { padding-top: 0; }
  .group-card { box-shadow: none; break-inside: avoid; margin-bottom: 12px; }
  .group-heading { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
