:root {
  --ink: #1a2e35;
  --muted: #4d6b74;
  --paper: #fff8ef;
  --card: rgba(255, 252, 246, 0.88);
  --line: rgba(26, 46, 53, 0.12);
  --sun: #ffb703;
  --coral: #fb8500;
  --sky: #8ecae6;
  --sea: #219ebc;
  --deep: #023047;
  --grass: #2a9d8f;
  --pink: #e76f51;
  --shadow: 0 18px 40px rgba(2, 48, 71, 0.14);
  --radius: 28px;
  --font-display: "Baloo 2", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
  --bg-a: #d7f0ff;
  --bg-b: #fff4e0;
  --bg-c: #ffe8c8;
  --bg-glow-sun: #ffe08a;
  --bg-glow-sky: #9ad8f0;
  --panel-border: rgba(2, 48, 71, 0.08);
  --nav-bg: rgba(255, 255, 255, 0.94);
  --input-bg: white;
  --table-head: #f8fafc;
  --transition-sky: background 1.2s ease, color 0.8s ease, border-color 0.8s ease,
    box-shadow 0.8s ease;
}

body.night {
  --ink: #e7f1f7;
  --muted: #9db4c3;
  --paper: #0b1724;
  --card: rgba(18, 32, 48, 0.88);
  --line: rgba(231, 241, 247, 0.14);
  --deep: #d7ebf7;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --bg-a: #061018;
  --bg-b: #0d1b2a;
  --bg-c: #13283d;
  --bg-glow-sun: #1b2a4a;
  --bg-glow-sky: #243b55;
  --panel-border: rgba(231, 241, 247, 0.1);
  --nav-bg: rgba(16, 28, 42, 0.94);
  --input-bg: rgba(10, 20, 32, 0.9);
  --table-head: rgba(255, 255, 255, 0.06);
}

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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  max-width: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, var(--bg-glow-sun) 0%, transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 0%, var(--bg-glow-sky) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-a) 0%, var(--bg-b) 42%, var(--bg-c) 100%);
  overflow-x: clip;
  overscroll-behavior-x: none;
  touch-action: pan-y;
  padding-bottom: calc(4.1rem + env(safe-area-inset-bottom));
  transition: var(--transition-sky);
}

img,
canvas,
svg,
video {
  max-width: 100%;
  height: auto;
}

.jump-nav {
  position: fixed;
  left: 0.5rem;
  right: 0.5rem;
  bottom: max(0.65rem, env(safe-area-inset-bottom));
  transform: none;
  z-index: 900;
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 0.2rem;
  max-width: none;
  width: auto;
  padding: 0.3rem;
  background: var(--nav-bg);
  border: 3px solid var(--panel-border);
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(2, 48, 71, 0.18);
  backdrop-filter: blur(10px);
  animation: pop-in 0.45s ease both;
  overflow: hidden;
  transition: var(--transition-sky);
}

.jump-nav a {
  text-decoration: none;
  color: var(--deep);
  font-weight: 800;
  font-size: clamp(0.68rem, 2.8vw, 0.88rem);
  padding: 0.5rem 0.35rem;
  border-radius: 999px;
  white-space: nowrap;
  flex: 1 1 0;
  text-align: center;
  min-width: 0;
  transition:
    transform 0.15s ease,
    background 0.15s ease;
}

.jump-nav a:hover,
.jump-nav a:focus-visible {
  background: #fff4cc;
  transform: translateY(-2px);
  outline: none;
}

@media (max-width: 520px) {
  .jump-nav a {
    font-size: 0.7rem;
    padding: 0.48rem 0.2rem;
  }
}

#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
}

.sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  max-width: 100%;
}

.sun {
  position: absolute;
  top: 2.5rem;
  right: 4%;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6b5, var(--sun) 55%, #f4a261);
  box-shadow: 0 0 0 12px rgba(255, 183, 3, 0.25);
  animation: pulse-sun 4s ease-in-out infinite;
  opacity: 1;
  transition: opacity 1s ease, transform 1.2s ease;
}

.moon {
  position: absolute;
  top: 2.3rem;
  right: 5%;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fffef8, #e8e4c9 52%, #b8b39a 90%);
  box-shadow: 0 0 0 10px rgba(232, 228, 201, 0.12);
  opacity: 0;
  transition: opacity 1s ease, box-shadow 0.8s ease, background 0.8s ease;
  overflow: hidden;
}

/* Moon phases (shadow = dark side) */
.moon.phase-full {
  box-shadow:
    0 0 0 12px rgba(232, 228, 201, 0.16),
    inset 0 0 0 transparent;
}
.moon.phase-new {
  background: #2a3340;
  box-shadow:
    0 0 0 8px rgba(232, 228, 201, 0.06),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.moon.phase-waxing-crescent {
  box-shadow:
    0 0 0 10px rgba(232, 228, 201, 0.1),
    inset 18px 0 0 0 rgba(13, 27, 42, 0.88);
}
.moon.phase-first-quarter {
  box-shadow:
    0 0 0 10px rgba(232, 228, 201, 0.12),
    inset 26px 0 0 0 rgba(13, 27, 42, 0.9);
}
.moon.phase-waxing-gibbous {
  box-shadow:
    0 0 0 10px rgba(232, 228, 201, 0.14),
    inset 12px 0 0 0 rgba(13, 27, 42, 0.75);
}
.moon.phase-waning-gibbous {
  box-shadow:
    0 0 0 10px rgba(232, 228, 201, 0.14),
    inset -12px 0 0 0 rgba(13, 27, 42, 0.75);
}
.moon.phase-last-quarter {
  box-shadow:
    0 0 0 10px rgba(232, 228, 201, 0.12),
    inset -26px 0 0 0 rgba(13, 27, 42, 0.9);
}
.moon.phase-waning-crescent {
  box-shadow:
    0 0 0 10px rgba(232, 228, 201, 0.1),
    inset -18px 0 0 0 rgba(13, 27, 42, 0.88);
}

.stars {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
}

.stars span {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff8dc;
  box-shadow: 0 0 6px rgba(255, 248, 220, 0.85);
  animation: twinkle 2.8s ease-in-out infinite;
}

.stars span:nth-child(1) { top: 8%; left: 12%; animation-delay: 0s; }
.stars span:nth-child(2) { top: 14%; left: 28%; width: 2px; height: 2px; animation-delay: 0.4s; }
.stars span:nth-child(3) { top: 6%; left: 48%; animation-delay: 0.8s; }
.stars span:nth-child(4) { top: 18%; left: 62%; width: 2px; height: 2px; animation-delay: 1.1s; }
.stars span:nth-child(5) { top: 10%; left: 78%; animation-delay: 0.2s; }
.stars span:nth-child(6) { top: 24%; left: 88%; width: 2px; height: 2px; animation-delay: 1.4s; }
.stars span:nth-child(7) { top: 32%; left: 18%; animation-delay: 0.6s; }
.stars span:nth-child(8) { top: 28%; left: 40%; width: 2px; height: 2px; animation-delay: 1.7s; }
.stars span:nth-child(9) { top: 36%; left: 55%; animation-delay: 0.3s; }
.stars span:nth-child(10) { top: 22%; left: 70%; animation-delay: 1s; }
.stars span:nth-child(11) { top: 42%; left: 8%; width: 2px; height: 2px; animation-delay: 1.3s; }
.stars span:nth-child(12) { top: 48%; left: 33%; animation-delay: 0.5s; }
.stars span:nth-child(13) { top: 52%; left: 72%; width: 2px; height: 2px; animation-delay: 1.6s; }
.stars span:nth-child(14) { top: 16%; left: 92%; animation-delay: 0.9s; }
.stars span:nth-child(15) { top: 4%; left: 35%; width: 2px; height: 2px; animation-delay: 1.2s; }
.stars span:nth-child(16) { top: 40%; left: 85%; animation-delay: 0.7s; }
.stars span:nth-child(17) { top: 58%; left: 22%; width: 2px; height: 2px; animation-delay: 1.5s; }
.stars span:nth-child(18) { top: 12%; left: 58%; animation-delay: 0.15s; }
.stars span:nth-child(19) { top: 30%; left: 5%; width: 2px; height: 2px; animation-delay: 1.8s; }
.stars span:nth-child(20) { top: 46%; left: 48%; animation-delay: 0.35s; }

body.night .sun {
  opacity: 0;
  pointer-events: none;
}

body.night .moon {
  opacity: 1;
  animation: moon-float 5s ease-in-out infinite;
}

body.night .stars {
  opacity: 1;
}

body.night.wx-overcast .stars,
body.night.wx-rain .stars,
body.night.wx-storm .stars {
  opacity: 0.25;
}

body.day .moon,
body.day .stars {
  opacity: 0;
}

/* Cloud density by weather */
body.wx-clear .cloud.c4,
body.wx-clear .cloud.c5 {
  opacity: 0;
}
body.wx-clear .cloud {
  opacity: 0.55;
}
body.wx-cloudy .cloud {
  opacity: 0.85;
}
body.wx-overcast .cloud,
body.wx-rain .cloud,
body.wx-storm .cloud,
body.wx-fog .cloud {
  opacity: 0.95;
  filter: blur(0.8px) brightness(0.92);
}
body.wx-overcast .sun,
body.wx-rain .sun,
body.wx-storm .sun,
body.wx-fog .sun {
  opacity: 0.25;
  filter: grayscale(0.3);
}
body.night .cloud {
  opacity: 0;
}
body.night.wx-cloudy .cloud,
body.night.wx-overcast .cloud,
body.night.wx-rain .cloud,
body.night.wx-storm .cloud {
  opacity: 0.4;
  background: rgba(148, 163, 184, 0.45);
}
body.wx-fog {
  --bg-a: #c5d0d8;
  --bg-b: #d8dfe4;
  --bg-c: #e4e8eb;
}
body.night.wx-fog {
  --bg-a: #0a1218;
  --bg-b: #121c26;
  --bg-c: #182430;
}
body.wx-rain,
body.wx-storm {
  --bg-a: #9bb4c7;
  --bg-b: #b7c5d1;
  --bg-c: #cfd6dc;
}
body.night.wx-rain,
body.night.wx-storm {
  --bg-a: #071018;
  --bg-b: #0c1824;
  --bg-c: #122030;
}

.rain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.rain[hidden] {
  display: none !important;
}

.rain span {
  position: absolute;
  top: -12%;
  width: 2px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, transparent, rgba(186, 230, 253, 0.85));
  animation: rain-fall 1s linear infinite;
  opacity: 0.75;
}

body.night .rain span {
  background: linear-gradient(180deg, transparent, rgba(148, 163, 184, 0.7));
}

@keyframes rain-fall {
  from {
    transform: translateY(0) translateX(0);
  }
  to {
    transform: translateY(110vh) translateX(-18px);
  }
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  filter: blur(0.5px);
  animation: drift 28s linear infinite;
  opacity: 1;
  transition: opacity 1s ease;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.cloud.c1 {
  top: 6rem;
  left: -8%;
  width: 120px;
  height: 40px;
}
.cloud.c1::before {
  width: 48px;
  height: 48px;
  top: -24px;
  left: 18px;
}
.cloud.c1::after {
  width: 60px;
  height: 60px;
  top: -30px;
  left: 50px;
}

.cloud.c2 {
  top: 10rem;
  left: 40%;
  width: 160px;
  height: 46px;
  animation-duration: 36s;
  animation-delay: -8s;
}
.cloud.c2::before {
  width: 56px;
  height: 56px;
  top: -28px;
  left: 24px;
}
.cloud.c2::after {
  width: 72px;
  height: 72px;
  top: -36px;
  left: 64px;
}

.cloud.c3 {
  top: 4rem;
  left: 70%;
  width: 100px;
  height: 34px;
  animation-duration: 40s;
  animation-delay: -18s;
}
.cloud.c3::before {
  width: 40px;
  height: 40px;
  top: -20px;
  left: 16px;
}
.cloud.c3::after {
  width: 50px;
  height: 50px;
  top: -26px;
  left: 42px;
}

.cloud.c4 {
  top: 8.5rem;
  left: 15%;
  width: 90px;
  height: 30px;
  animation-duration: 32s;
  animation-delay: -4s;
  opacity: 0.7;
}
.cloud.c4::before {
  width: 36px;
  height: 36px;
  top: -18px;
  left: 14px;
}
.cloud.c4::after {
  width: 46px;
  height: 46px;
  top: -24px;
  left: 38px;
}

.cloud.c5 {
  top: 12rem;
  left: 58%;
  width: 130px;
  height: 38px;
  animation-duration: 44s;
  animation-delay: -22s;
  opacity: 0.65;
}
.cloud.c5::before {
  width: 44px;
  height: 44px;
  top: -22px;
  left: 20px;
}
.cloud.c5::after {
  width: 56px;
  height: 56px;
  top: -28px;
  left: 52px;
}

@keyframes drift {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(18vw);
  }
}

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

@keyframes moon-float {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-5px) scale(1.03);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes wiggle {
  0%,
  100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-4deg);
  }
  75% {
    transform: rotate(4deg);
  }
}

@keyframes bounce-soft {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.hero,
main,
.footer {
  position: relative;
  z-index: 1;
}

.hero {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem) clamp(0.85rem, 3vw, 1.25rem) 0.75rem;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 0.9rem 1.5rem;
  align-items: center;
  animation: pop-in 0.7s ease both;
  box-sizing: border-box;
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.hero-copy {
  text-align: left;
}

@media (max-width: 860px) {
  .hero-copy {
    text-align: center;
  }
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--sea);
}

.brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 10vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--deep);
  text-shadow: 4px 6px 0 rgba(251, 133, 0, 0.25);
}

.tagline {
  max-width: 28rem;
  margin: 0.45rem 0 0;
  font-size: 1.12rem;
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 860px) {
  .tagline {
    margin-left: auto;
    margin-right: auto;
  }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-start;
  margin-top: 0.75rem;
}

@media (max-width: 860px) {
  .hero-actions {
    justify-content: center;
  }
}

.hero-photo {
  margin: 0;
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 4px solid rgba(255, 255, 255, 0.85);
  background: #1a1a1a;
  animation: pop-in 0.8s ease 0.08s both;
}

.hero-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: center 30%;
  filter: contrast(1.05);
  transition: transform 0.5s ease;
}

.hero-photo:hover img {
  transform: scale(1.02);
}

.captain-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.55rem 0.65rem;
  background: linear-gradient(90deg, #fecaca 0%, #fff 45%, #fff 55%, #bbf7d0 100%);
}

body.night .captain-strip {
  background: linear-gradient(90deg, #4a1d1d 0%, #1a2430 45%, #1a2430 55%, #134e4a 100%);
}

.cap-tag {
  font-weight: 800;
  font-size: 0.82rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: white;
  border: 2px solid transparent;
}

.cap-tag.mali {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.25);
}

.cap-tag.veliki {
  color: #0f766e;
  border-color: rgba(15, 118, 110, 0.25);
}

.vs-mini {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--deep);
  font-size: 0.95rem;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.35rem;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.btn:hover {
  transform: translateY(-2px) scale(1.02);
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--coral), #ff5e5b);
  color: white;
  box-shadow: 0 10px 0 #c2410c;
}

.btn-primary:active {
  box-shadow: 0 4px 0 #c2410c;
}

.btn-secondary {
  background: var(--sea);
  color: white;
  box-shadow: 0 8px 0 #0b6f86;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.7);
  color: var(--deep);
  border: 2px solid rgba(2, 48, 71, 0.12);
}

.btn-whatsapp {
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: white;
  box-shadow: 0 8px 0 #0b6b4f;
}

.btn-whatsapp:active {
  box-shadow: 0 4px 0 #0b6b4f;
}

.bounce {
  animation: bounce-soft 1.6s ease-in-out infinite;
}

main {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 0 clamp(0.85rem, 3vw, 1.25rem) 0.35rem;
  display: grid;
  gap: 0.85rem;
  box-sizing: border-box;
}

.panel {
  background: var(--card);
  backdrop-filter: blur(10px);
  border: 3px solid var(--panel-border);
  border-radius: var(--radius);
  padding: clamp(0.85rem, 2.5vw, 1.25rem);
  box-shadow: var(--shadow);
  animation: pop-in 0.55s ease both;
  scroll-margin-top: 1rem;
  transition: var(--transition-sky);
}

.more-box {
  border: 0;
}

.more-box summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--deep);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.more-box summary::-webkit-details-marker {
  display: none;
}

.more-box summary::after {
  content: "▼";
  font-size: 0.8rem;
  opacity: 0.55;
  transition: transform 0.2s ease;
}

.more-box[open] summary::after {
  transform: rotate(180deg);
}

.more-box .stats-grid {
  margin-top: 0.9rem;
}

.detail-pick,
.selected-who.is-empty {
  margin: 0 0 0.55rem;
  font-weight: 800;
  color: var(--muted);
}

.selected-who {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: 16px;
  border: 3px solid color-mix(in srgb, var(--who-color, var(--sea)) 55%, transparent);
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--who-color, var(--sea)) 18%, transparent),
      var(--input-bg)
    );
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--who-color, var(--sea)) 16%, transparent);
}

.selected-who.is-empty {
  display: block;
  border-style: dashed;
  border-color: var(--line);
  background: transparent;
  box-shadow: none;
  padding: 0.55rem 0.65rem;
}

.selected-emoji {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

.selected-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.45rem;
  min-width: 0;
}

.selected-meta strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.1;
  color: var(--deep);
}

body.night .selected-who {
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--who-color, var(--sea)) 22%, transparent),
      rgba(10, 20, 32, 0.95)
    );
}

.kid-card.selected .big-emoji {
  animation: pop-spin 0.45s ease;
}

@keyframes pop-spin {
  0% {
    transform: scale(0.7) rotate(-12deg);
  }
  60% {
    transform: scale(1.2) rotate(8deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

.score-card.winning .team-emoji {
  animation: jump 0.9s ease-in-out infinite;
}

@keyframes jump {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.quiz-opt.correct {
  animation: pop-in 0.35s ease;
}

@keyframes tug-glow {
  from {
    filter: brightness(1);
  }
  to {
    filter: brightness(1.08);
  }
}

.weather-section {
  animation-delay: 0.02s;
}

.weather-stamp {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
  text-align: right;
  max-width: 12rem;
  line-height: 1.25;
}

.weather-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
}

@media (min-width: 720px) {
  .weather-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
  }
}

.weather-card {
  background: var(--input-bg);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 0.6rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  min-height: 5.4rem;
  transition: background 0.8s ease, border-color 0.8s ease;
}

.weather-card.featured {
  min-height: 6rem;
}

.weather-card.sea {
  background: linear-gradient(145deg, rgba(33, 158, 188, 0.18), var(--input-bg));
  border-color: rgba(33, 158, 188, 0.45);
}

.weather-card.air {
  background: linear-gradient(145deg, rgba(255, 183, 3, 0.16), var(--input-bg));
  border-color: rgba(255, 183, 3, 0.4);
}

.weather-card.moon-card {
  background: linear-gradient(145deg, rgba(148, 163, 184, 0.18), var(--input-bg));
}

.weather-card .w-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.weather-card .w-value {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 5vw, 1.55rem);
  line-height: 1.15;
  color: var(--deep);
  word-break: break-word;
}

.weather-card.moon-card .w-value {
  font-size: 1.7rem;
}

.weather-card .w-hint {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.25;
}

body.night .weather-card.sea {
  background: #12242c;
  border-color: rgba(56, 189, 248, 0.45);
}

body.night .weather-card.air {
  background: #241c12;
  border-color: rgba(255, 196, 60, 0.45);
}

body.night .weather-card.moon-card {
  background: #161e28;
  border-color: rgba(148, 163, 184, 0.35);
}

.battle-section {
  animation-delay: 0.05s;
}
.podium-section {
  animation-delay: 0.1s;
}
.calendar-section {
  animation-delay: 0.12s;
}
.stats-section {
  animation-delay: 0.15s;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cal-nav .btn {
  padding: 0.45rem 0.85rem;
  min-width: 2.6rem;
}

.cal-month-label {
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 3.5vw, 1.15rem);
  min-width: 0;
  max-width: 9.5rem;
  text-align: center;
  text-transform: capitalize;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.3rem;
  width: 100%;
}

.cal-cell {
  appearance: none;
  border: 2px solid var(--line);
  background: var(--input-bg);
  border-radius: 12px;
  min-height: 58px;
  min-width: 0;
  width: 100%;
  padding: 0.18rem 0.1rem 0.2rem;
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.05rem;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}

.cal-head {
  text-align: center;
  font-weight: 800;
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0.25rem 0;
  text-transform: uppercase;
  min-width: 0;
}

.cal-cell:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--sea);
}

.cal-cell:disabled {
  cursor: default;
  background: transparent;
  border-color: transparent;
}

.cal-cell .num {
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1;
}

.cal-cell .wday {
  display: block;
  width: 100%;
  max-width: 100%;
  font-size: clamp(0.48rem, 2.1vw, 0.62rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--muted);
  text-align: center;
  text-transform: lowercase;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.cal-cell .dots {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 12px;
  width: 100%;
  margin-top: 0.05rem;
}

.cal-cell .dot-row {
  display: flex;
  gap: 2px;
  min-height: 5px;
  justify-content: center;
}

.cal-cell .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sea);
}

.cal-cell .dot.mali {
  background: #ef4444;
}

.cal-cell .dot.veliki {
  background: #0f766e;
}

.cal-legend {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
}

.cal-leg {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.cal-leg i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.cal-leg.mali i {
  background: #ef4444;
}

.cal-leg.veliki i {
  background: #0f766e;
}

.cal-cell.has-data {
  border-color: rgba(33, 158, 188, 0.45);
  background: #f0f9ff;
}

body.night .cal-cell.has-data {
  background: rgba(33, 158, 188, 0.12);
}

.cal-cell.is-today {
  box-shadow: 0 0 0 3px rgba(251, 133, 0, 0.35);
}

.cal-cell.is-seed {
  background: linear-gradient(165deg, #fff7ed, #fff);
  border-color: rgba(251, 133, 0, 0.4);
}

.cal-cell.selected {
  border-color: var(--coral);
  background: #fff7ed;
  transform: scale(1.03);
}

.cal-hint {
  margin: 0.4rem 0 0;
  text-align: center;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.9rem;
}
.chart-section {
  animation-delay: 0.2s;
}
.kids-section {
  animation-delay: 0.25s;
}
.detail-section {
  animation-delay: 0.3s;
}
.quiz-section {
  animation-delay: 0.35s;
}

.section-head {
  margin-bottom: 0.65rem;
}

.section-head.center {
  text-align: center;
}

.battle-score {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.55rem;
  align-items: stretch;
  margin-bottom: 0.7rem;
}

@media (max-width: 700px) {
  .battle-score {
    grid-template-columns: 1fr;
  }
}

.score-card {
  border-radius: 22px;
  padding: 0.8rem 0.75rem;
  background: var(--input-bg);
  border: 3px solid var(--line);
  text-align: center;
  transition: transform 0.2s ease, background 0.8s ease;
}

.score-card:hover {
  transform: translateY(-3px);
}

.score-card.veliki {
  border-color: rgba(15, 118, 110, 0.45);
  background: linear-gradient(165deg, #ecfdf5, #fff);
}

.score-card.mali {
  border-color: rgba(185, 28, 28, 0.4);
  background: linear-gradient(165deg, #fef2f2, #fff);
}

.score-card.winning {
  box-shadow: 0 0 0 4px rgba(255, 183, 3, 0.45);
  animation: bounce-soft 1.4s ease-in-out infinite;
}

.score-card .team-emoji {
  font-size: 2rem;
  display: block;
}

.score-card .team-name {
  margin: 0.15rem 0 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
}

.score-card .team-score {
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
  font-size: 2.4rem;
  line-height: 1;
}

.score-card .team-meta {
  margin: 0.35rem 0 0;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.9rem;
}

.score-vs {
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--deep);
  align-self: center;
}

.tug {
  position: relative;
  display: flex;
  flex-direction: row;
  height: 28px;
  border-radius: 999px;
  overflow: hidden;
  border: 3px solid rgba(2, 48, 71, 0.12);
  background: #e2e8f0;
  margin: 0.25rem 0 0.75rem;
}

.tug-fill {
  height: 100%;
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  animation: tug-glow 2.4s ease-in-out infinite alternate;
}

.tug-fill.mali {
  order: 1;
  background: linear-gradient(90deg, #dc2626, #fb923c);
}

.tug-fill.veliki {
  order: 2;
  background: linear-gradient(90deg, #34d399, #0f766e);
}

.tug-mid {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.battle-status {
  text-align: center;
  font-weight: 800;
  font-size: 1.05rem;
  margin: 0 0 0.65rem;
  color: var(--deep);
}

.team-boards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

@media (max-width: 720px) {
  .team-boards {
    grid-template-columns: 1fr;
  }
}

.team-board {
  border-radius: 18px;
  padding: 0.65rem;
  background: rgba(255, 255, 255, 0.55);
  border: 2px solid var(--line);
}

.team-board h3 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.members {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.member-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
  min-width: 0;
  padding: 0.45rem 0.5rem;
  margin: 0;
  border: 0;
  border-radius: 12px;
  background: var(--input-bg);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition:
    transform 0.15s ease,
    background 0.8s ease;
}

.member-row:hover {
  transform: translateY(-2px);
}

.member-top {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}

.member-emoji {
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
}

.member-name {
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.member-name .ico {
  margin-left: 0.15rem;
  font-size: 0.78rem;
}

.member-bottom {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem;
  min-width: 0;
}

.member-kg {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.member-row .pct {
  font-family: var(--font-display);
  font-size: 0.95rem;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
}

.badge-cap {
  display: inline-block;
  margin-left: 0.25rem;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-weight: 800;
  vertical-align: middle;
}

.badge-mvp {
  display: inline-block;
  margin-left: 0.2rem;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e40af;
  font-weight: 800;
}

.team-chip {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: 0.25rem;
}

.team-chip.veliki {
  background: #ccfbf1;
  color: #0f766e;
}

.team-chip.mali {
  background: #fee2e2;
  color: #b91c1c;
}

.section-head.row-between {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  color: var(--deep);
}

.section-head p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-weight: 700;
}

.mode-toggle {
  display: inline-flex;
  gap: 0.35rem;
  margin-top: 0.7rem;
  background: rgba(2, 48, 71, 0.06);
  padding: 0.3rem;
  border-radius: 999px;
}

.mode {
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 800;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
}

.mode.active {
  background: white;
  color: var(--deep);
  box-shadow: 0 4px 14px rgba(2, 48, 71, 0.12);
}

.podium {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  align-items: end;
  min-height: 220px;
}

@media (max-width: 720px) {
  .podium {
    grid-template-columns: 1fr;
    min-height: 0;
  }
}

.podium-card {
  position: relative;
  text-align: center;
  padding: 1rem 0.75rem 1.1rem;
  border-radius: 24px;
  background: white;
  border: 3px solid transparent;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.podium-card:hover,
.podium-card:focus-visible {
  transform: translateY(-6px) scale(1.03);
  outline: none;
}

.podium-card.rank-1 {
  order: 2;
  min-height: 210px;
  border-color: #ffb703;
  background: linear-gradient(180deg, #fff7d6, #fff);
  box-shadow: 0 12px 0 rgba(255, 183, 3, 0.35);
}

.podium-card.rank-2 {
  order: 1;
  min-height: 170px;
  border-color: #94a3b8;
  box-shadow: 0 10px 0 rgba(148, 163, 184, 0.35);
}

.podium-card.rank-3 {
  order: 3;
  min-height: 150px;
  border-color: #d97706;
  box-shadow: 0 10px 0 rgba(217, 119, 6, 0.28);
}

@media (max-width: 720px) {
  .podium-card.rank-1,
  .podium-card.rank-2,
  .podium-card.rank-3 {
    order: initial;
    min-height: 0;
  }
}

.podium-card .place {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: 0.2rem;
}

.podium-card .emoji {
  font-size: 2.4rem;
  display: block;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.podium-card .name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0;
}

.podium-card .delta {
  margin: 0.35rem 0 0;
  font-weight: 800;
  font-size: 1.15rem;
}

.podium-card .meta {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.rest-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.65rem;
  margin-top: 0.9rem;
}

.rest-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  border: 2px solid var(--line);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: transform 0.15s ease;
}

.rest-card:hover {
  transform: translateY(-2px);
}

.rest-card .rank-badge {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: rgba(2, 48, 71, 0.08);
  flex-shrink: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.55rem;
}

.stat-card {
  background: var(--input-bg);
  border-radius: 18px;
  padding: 0.75rem 0.85rem;
  border: 2px solid var(--line);
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition:
    transform 0.2s ease,
    background 0.8s ease,
    border-color 0.8s ease;
}

.stat-card.fact-mali {
  background: linear-gradient(145deg, #fee2e2, var(--input-bg));
  border-color: rgba(239, 68, 68, 0.4);
}

.stat-card.fact-veliki {
  background: linear-gradient(145deg, #ccfbf1, var(--input-bg));
  border-color: rgba(15, 118, 110, 0.4);
}

.stat-card:hover {
  transform: translateY(-3px);
}

.stat-card .label {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-card .value {
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1.2;
  color: var(--deep);
  word-break: break-word;
}

.stat-card .hint {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
}

.stat-card.highlight {
  background: linear-gradient(145deg, #e8fff8, #fff);
  border-color: rgba(42, 157, 143, 0.35);
}

.stat-card.gold {
  background: linear-gradient(145deg, #fff4cc, #fff);
  border-color: rgba(255, 183, 3, 0.45);
}

/* Night: solid dark cards, accent borders only — no washed gradients */
body.night .more-box summary {
  color: #f0f6fb;
}

body.night .stat-card {
  background: #121e2c;
  border-color: rgba(231, 241, 247, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

body.night .stat-card .label {
  color: #c5d6e4;
}

body.night .stat-card .value {
  color: #f5f9fc;
}

body.night .stat-card .hint {
  color: #a8bfd0;
}

body.night .stat-card.gold {
  background: #1a2218;
  border-color: rgba(255, 196, 60, 0.55);
}

body.night .stat-card.highlight {
  background: #13242a;
  border-color: rgba(45, 212, 191, 0.45);
}

body.night .stat-card.fact-veliki {
  background: #12241f;
  border-color: rgba(45, 212, 191, 0.55);
}

body.night .stat-card.fact-mali {
  background: #241616;
  border-color: rgba(248, 113, 113, 0.5);
}

.chart-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chart-filter {
  border: 2px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  color: var(--muted);
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

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

.chart-filter.active {
  background: var(--deep);
  border-color: var(--deep);
  color: white;
}

.legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
  max-width: 100%;
}

@media (max-width: 520px) {
  .legend {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }
}

.legend-team {
  min-width: 0;
  padding: 0.45rem;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: rgba(255, 255, 255, 0.35);
}

.legend-team.mali {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(254, 226, 226, 0.35);
}

.legend-team.veliki {
  border-color: rgba(15, 118, 110, 0.35);
  background: rgba(204, 251, 241, 0.35);
}

.legend-team-title {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.legend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
}

.legend-chip {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.4rem;
  border-radius: 12px;
  border: 2px solid transparent;
  background: var(--input-bg);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  font-size: 0.78rem;
  cursor: pointer;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  transition:
    transform 0.15s ease,
    opacity 0.15s ease,
    border-color 0.15s ease;
}

.legend-who {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-pct {
  font-size: 0.72rem;
  font-weight: 800;
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}

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

.legend-chip.dim {
  opacity: 0.35;
}

.legend-chip.active {
  border-color: var(--chip, var(--sea));
  box-shadow: 0 0 0 1px var(--chip, var(--sea));
}

.legend-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--chip, currentColor);
  flex-shrink: 0;
}

.chart-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 18px;
  background: var(--input-bg);
  border: 2px solid var(--line);
}

#chart {
  display: block;
  width: 100%;
  height: auto;
  touch-action: manipulation;
  cursor: crosshair;
}

.chart-tip {
  margin-top: 0.65rem;
  padding: 0.7rem 0.9rem;
  border-radius: 16px;
  background: var(--deep);
  color: white;
  font-weight: 800;
  text-align: center;
}

.kids {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.7rem;
}

.kid-card {
  appearance: none;
  border: 3px solid transparent;
  background: white;
  border-radius: 22px;
  padding: 1rem 0.75rem;
  text-align: center;
  cursor: pointer;
  font: inherit;
  box-shadow: 0 8px 0 rgba(2, 48, 71, 0.08);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.kid-card:hover {
  transform: translateY(-4px);
}

.kid-card.selected {
  border-color: var(--kid-color, var(--coral));
  box-shadow: 0 10px 0 color-mix(in srgb, var(--kid-color, var(--coral)) 35%, white);
  animation: wiggle 0.45s ease;
}

.kid-card .big-emoji {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 0.2rem;
}

.kid-card .kid-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0;
}

.kid-card .kid-age {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.9rem;
}

.kid-card .kid-delta {
  margin: 0.4rem 0 0;
  font-weight: 800;
  font-size: 0.95rem;
}

.stat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pill {
  background: white;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-weight: 800;
  font-size: 0.88rem;
}

.table-scroll {
  overflow-x: hidden;
  overflow-y: auto;
  max-height: min(22rem, 52vh);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: none;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  border-radius: 18px;
  border: 2px solid var(--line);
  background: var(--input-bg);
  max-width: 100%;
  width: 100%;
  margin-top: 0.25rem;
}

.weight-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}

.weight-table col.col-date { width: 28%; }
.weight-table col.col-kg { width: 20%; }
.weight-table col.col-pct { width: 22%; }
.weight-table col.col-actions { width: 30%; }

.weight-table th,
.weight-table td {
  padding: 0.45rem 0.35rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  overflow: hidden;
}

.weight-table .nowrap,
.nowrap {
  white-space: nowrap;
}

.weight-table .day-sub {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: lowercase;
  line-height: 1.1;
}

.weight-table .row-actions {
  white-space: nowrap;
  text-align: right;
  padding-right: 0.4rem;
}

.weight-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--table-head);
}

.weight-table tbody tr {
  transition: background 0.15s ease;
}

.weight-table tbody tr:hover {
  background: #fff7ed;
}

.delta-up {
  color: #16a34a;
  font-weight: 800;
}
.delta-down {
  color: #dc2626;
  font-weight: 800;
}
.delta-flat {
  color: var(--muted);
  font-weight: 800;
}

.edit-btn,
.del-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: rgba(2, 48, 71, 0.06);
  border-radius: 999px;
  width: 2rem;
  height: 2rem;
  padding: 0;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  vertical-align: middle;
}

.del-btn {
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  margin-left: 0.2rem;
}

body.night .edit-btn {
  background: rgba(231, 241, 247, 0.08);
}

body.night .del-btn {
  background: rgba(220, 38, 38, 0.18);
}

.add-form {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 0.5rem 0.65rem;
  margin: 0.35rem 0 1.15rem;
  align-items: end;
}

@media (max-width: 700px) {
  .add-form {
    grid-template-columns: 1fr 1fr;
  }

  .add-form .btn {
    grid-column: 1 / -1;
    margin-top: 0.15rem;
  }
}

.add-form label {
  display: grid;
  gap: 0.25rem;
  font-weight: 800;
  font-size: 0.85rem;
}

.add-form .btn-primary {
  box-shadow: 0 6px 0 #c2410c;
  padding: 0.75rem 1.15rem;
  margin-bottom: 0.35rem;
}

.add-form .btn-primary:active {
  box-shadow: 0 3px 0 #c2410c;
}

.add-form select,
.add-form input {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  font-weight: 700;
  background: var(--input-bg);
  color: var(--ink);
  transition: background 0.8s ease, color 0.8s ease, border-color 0.8s ease;
}

.add-form select:focus,
.add-form input:focus {
  outline: 3px solid rgba(33, 158, 188, 0.35);
  border-color: var(--sea);
}

.date-field {
  position: relative;
  display: grid;
  gap: 0.25rem;
  font-weight: 800;
  font-size: 0.85rem;
  min-width: 0;
}

.date-field .field-label {
  color: var(--ink);
}

.date-trigger {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  font-weight: 700;
  background: var(--input-bg);
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.8s ease;
}

.date-trigger.has-value {
  color: var(--ink);
}

.date-trigger:focus-visible,
.date-trigger[aria-expanded="true"] {
  outline: 3px solid rgba(33, 158, 188, 0.35);
  border-color: var(--sea);
}

#date-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: capitalize;
}

.date-trigger-ico {
  flex-shrink: 0;
}

.date-picker {
  position: relative;
  z-index: 5;
  width: 100%;
  margin-top: 0.4rem;
  background: var(--input-bg);
  border: 3px solid var(--line);
  border-radius: 18px;
  padding: 0.65rem;
  box-shadow: var(--shadow);
  animation: pop-in 0.2s ease;
}

.date-picker[hidden] {
  display: none !important;
}

/* Keep form layout tidy when picker opens (pushes Kalendar down, no overlay) */
.date-field:has(.date-picker:not([hidden])) {
  grid-column: 1 / -1;
}

.date-picker-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.date-picker-month {
  font-family: var(--font-display);
  font-size: 1.05rem;
  text-transform: capitalize;
  text-align: center;
  color: var(--deep);
}

.date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.25rem;
}

.dp-head {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  padding: 0.15rem 0;
}

.dp-cell {
  appearance: none;
  border: 2px solid var(--line);
  background: var(--input-bg);
  border-radius: 10px;
  min-height: 44px;
  padding: 0.15rem;
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  color: var(--ink);
}

.dp-cell:disabled {
  border-color: transparent;
  background: transparent;
  cursor: default;
}

.dp-cell .dp-num {
  font-family: var(--font-display);
  font-size: 0.95rem;
  line-height: 1;
}

.dp-cell .dp-wday {
  font-size: 0.55rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: lowercase;
  line-height: 1;
}

.dp-cell.today {
  box-shadow: 0 0 0 2px rgba(251, 133, 0, 0.4);
}

.dp-cell.selected {
  border-color: var(--coral);
  background: rgba(251, 133, 0, 0.16);
}

.dp-cell:hover:not(:disabled) {
  border-color: var(--sea);
}

.date-picker-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.date-picker-actions .btn {
  flex: 1;
  padding: 0.5rem 0.65rem;
}

@media (max-width: 700px) {
  .date-field {
    grid-column: 1 / -1;
  }
}

body.night .date-picker {
  background: rgba(18, 32, 48, 0.98);
  border-color: rgba(231, 241, 247, 0.14);
}

body.night .dp-cell.selected {
  background: rgba(251, 133, 0, 0.22);
}

.quiz {
  display: grid;
  gap: 0.45rem;
}

.quiz-stats {
  margin-bottom: 0.45rem;
}

.quiz-section {
  padding-bottom: 0.7rem;
}

.quiz-section .section-head {
  margin-bottom: 0.45rem;
}

.quiz-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.quiz-stat-card {
  background: var(--input-bg);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.quiz-stat-card.gold {
  background: linear-gradient(145deg, #fff4cc, #fff);
  border-color: rgba(255, 183, 3, 0.45);
}

.quiz-stat-card .label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.quiz-stat-card .value {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--deep);
}

.quiz-stat-card .hint {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.quiz-topic-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.quiz-stat-chip {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--deep);
}

.quiz-topic {
  margin: 0 0 0.35rem;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sea);
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.15rem;
}

.quiz-actions .btn {
  flex: 1 1 auto;
  justify-content: center;
  text-align: center;
  min-width: 8rem;
}

.quiz-remaining {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--muted);
}

.quiz-q {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0;
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.55rem;
}

.quiz-opt {
  border: 3px solid var(--line);
  background: var(--input-bg);
  color: var(--ink);
  border-radius: 16px;
  padding: 0.7rem 0.65rem;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

.quiz-opt:hover {
  transform: translateY(-2px);
}

.quiz-opt.correct {
  background: #dcfce7;
  border-color: #16a34a;
}

.quiz-opt.wrong {
  background: #fee2e2;
  border-color: #dc2626;
}

.quiz-result {
  font-weight: 800;
  min-height: 1.1em;
  margin: 0;
}

.footer {
  text-align: center;
  padding: 0.15rem 1rem 0.35rem;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.85rem;
}

.footer p {
  margin: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(4.2rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--deep);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  font-weight: 800;
  z-index: 1100;
  box-shadow: var(--shadow);
  animation: pop-in 0.25s ease;
  max-width: calc(100% - 1.5rem);
  text-align: center;
}

/* —— Liquid glass PIN (Apple-like) —— */
.pin-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  place-items: center;
  padding: max(1rem, env(safe-area-inset-top)) 1rem
    max(1rem, env(safe-area-inset-bottom));
  background: rgba(8, 18, 28, 0.45);
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
}

.pin-overlay.is-open,
.pin-overlay:not([hidden]) {
  display: grid;
  animation: pin-fade-in 0.28s ease;
}

.pin-overlay[hidden] {
  display: none !important;
}

.pin-sheet {
  position: relative;
  width: min(100%, 22.5rem);
  padding: 1.35rem 1.2rem 1.1rem;
  border-radius: 32px;
  text-align: center;
  color: var(--ink);
  background:
    linear-gradient(
      165deg,
      rgba(255, 255, 255, 0.62) 0%,
      rgba(255, 255, 255, 0.28) 42%,
      rgba(255, 255, 255, 0.18) 100%
    );
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 -1px 0 rgba(2, 48, 71, 0.06) inset,
    0 28px 60px rgba(2, 48, 71, 0.22),
    0 8px 20px rgba(2, 48, 71, 0.12);
  backdrop-filter: blur(40px) saturate(1.7);
  -webkit-backdrop-filter: blur(40px) saturate(1.7);
  animation: pin-sheet-in 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

body.night .pin-sheet {
  background:
    linear-gradient(
      165deg,
      rgba(60, 80, 100, 0.55) 0%,
      rgba(24, 38, 54, 0.72) 50%,
      rgba(14, 24, 36, 0.78) 100%
    );
  border-color: rgba(231, 241, 247, 0.22);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 28px 60px rgba(0, 0, 0, 0.45),
    0 8px 20px rgba(0, 0, 0, 0.28);
}

.pin-sheet::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto 1px;
  height: 42%;
  border-radius: 31px 31px 40% 40%;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.45),
    rgba(255, 255, 255, 0)
  );
  pointer-events: none;
}

body.night .pin-sheet::before {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.12),
    rgba(255, 255, 255, 0)
  );
}

.pin-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(2, 48, 71, 0.08);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  z-index: 1;
}

body.night .pin-close {
  background: rgba(231, 241, 247, 0.1);
}

.pin-icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 0.35rem;
  filter: drop-shadow(0 6px 10px rgba(2, 48, 71, 0.18));
}

.pin-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.pin-sheet h2 {
  margin: 0.2rem 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.pin-msg {
  margin: 0 0 1rem;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.35;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 0.85rem;
  margin: 0.35rem 0 1.15rem;
}

.pin-dots span {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  border: 1.5px solid rgba(2, 48, 71, 0.28);
  background: rgba(255, 255, 255, 0.35);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

body.night .pin-dots span {
  border-color: rgba(231, 241, 247, 0.35);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.pin-dots span.filled {
  background: linear-gradient(180deg, #4cc9f0, #219ebc);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(33, 158, 188, 0.45);
  transform: scale(1.08);
}

.pin-dots.shake {
  animation: pin-shake 0.42s ease;
}

.pin-dots.error span.filled {
  background: linear-gradient(180deg, #ff8a80, #e63946);
  box-shadow: 0 4px 12px rgba(230, 57, 70, 0.4);
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  max-width: 17.5rem;
  margin: 0 auto;
}

.pin-pad button {
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.55),
    rgba(255, 255, 255, 0.22)
  );
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 8px 18px rgba(2, 48, 71, 0.1);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    background 0.12s ease,
    box-shadow 0.12s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body.night .pin-pad button {
  border-color: rgba(231, 241, 247, 0.16);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.14),
    rgba(255, 255, 255, 0.05)
  );
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 8px 18px rgba(0, 0, 0, 0.25);
}

.pin-pad button:active {
  transform: scale(0.94);
  background: linear-gradient(
    180deg,
    rgba(33, 158, 188, 0.28),
    rgba(33, 158, 188, 0.12)
  );
}

.pin-pad button.pin-key-ghost {
  font-size: 1.05rem;
  background: rgba(2, 48, 71, 0.05);
  box-shadow: none;
  border-color: transparent;
}

body.night .pin-pad button.pin-key-ghost {
  background: rgba(231, 241, 247, 0.06);
}

.pin-error {
  margin: 0.85rem 0 0;
  color: #e63946;
  font-weight: 800;
  font-size: 0.88rem;
  min-height: 1.2em;
}

.pin-cancel {
  margin-top: 0.75rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0.45rem 0.75rem;
}

@keyframes pin-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pin-sheet-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pin-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-8px);
  }
  40% {
    transform: translateX(8px);
  }
  60% {
    transform: translateX(-5px);
  }
  80% {
    transform: translateX(5px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pin-overlay,
  .pin-sheet,
  .pin-dots.shake {
    animation: none;
  }
}

.up {
  color: #16a34a;
}
.down {
  color: #dc2626;
}

@media (max-width: 640px) {
  .panel {
    padding: 0.75rem;
    border-radius: 20px;
  }

  .brand {
    font-size: clamp(2.6rem, 15vw, 4rem);
  }

  .hero {
    padding-top: 0.85rem;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
    padding: 0.65rem 0.75rem;
  }

  .score-card .team-score {
    font-size: 1.85rem;
  }

  .member-row .pct {
    font-size: 0.9rem;
  }

  .kids {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quiz-options {
    grid-template-columns: 1fr 1fr;
  }

  .stat-pills {
    max-width: 100%;
  }

  .section-head.row-between {
    flex-direction: column;
    align-items: stretch;
  }

  .chart-filters,
  .mode-toggle,
  .cal-nav {
    width: 100%;
    justify-content: center;
  }

  .footer {
    padding: 0.1rem 0.75rem 0.2rem;
  }

  main {
    gap: 0.65rem;
  }

  .add-form {
    margin-bottom: 1.1rem;
  }

  .quiz-section {
    margin-bottom: 0;
  }
}

/* Night: cards / chips that were hard-coded white */
body.night .cap-tag,
body.night .pill,
body.night .rest-card,
body.night .legend-chip,
body.night .quiz-stat-chip,
body.night .kid-card,
body.night .podium-card,
body.night .team-board,
body.night .member-row,
body.night .legend-team,
body.night .weather-card,
body.night .btn-ghost,
body.night .tug-mid,
body.night .mode,
body.night .chart-filter {
  background: rgba(18, 32, 48, 0.92);
  color: var(--ink);
}

body.night .legend-team.mali {
  background: rgba(127, 29, 29, 0.28);
  border-color: rgba(239, 68, 68, 0.35);
}

body.night .legend-team.veliki {
  background: rgba(19, 78, 74, 0.28);
  border-color: rgba(45, 212, 191, 0.3);
}

body.night .member-row {
  background: rgba(10, 20, 32, 0.92);
  box-shadow: inset 0 0 0 1px rgba(231, 241, 247, 0.06);
}

body.night .score-card.veliki {
  background: linear-gradient(165deg, rgba(15, 118, 110, 0.28), rgba(18, 32, 48, 0.95));
}

body.night .score-card.mali {
  background: linear-gradient(165deg, rgba(185, 28, 28, 0.28), rgba(18, 32, 48, 0.95));
}

body.night .chart-wrap {
  background: linear-gradient(180deg, rgba(18, 32, 48, 0.95), rgba(10, 20, 32, 0.9));
}

body.night .quiz-stat-card.gold {
  background: #1a2218;
  border-color: rgba(255, 196, 60, 0.55);
}

body.night .jump-nav a:hover,
body.night .jump-nav a:focus-visible {
  background: rgba(255, 183, 3, 0.18);
}

body.night .cal-cell.is-seed {
  background: linear-gradient(165deg, rgba(251, 133, 0, 0.18), rgba(18, 32, 48, 0.9));
}

body.night .cal-cell.selected {
  background: rgba(251, 133, 0, 0.22);
}

body.night .weight-table tbody tr:hover {
  background: rgba(251, 133, 0, 0.12);
}

body.night .toast {
  background: #e7f1f7;
  color: #0b1724;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
