:root {
  --bg-start: #ffffff;
  --bg-mid: #e9f4ff;
  --bg-end: #d8ecff;
  --text: #0f172a;
  --muted: rgba(15, 23, 42, 0.6);
  --white: #ffffff;
  --shadow: rgba(15, 23, 42, 0.2);
  --accent: #69a7ff;
  --accent-strong: #2f7bff;
  --card-bg: rgba(255, 255, 255, 0.85);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Outfit", "Segoe UI", sans-serif;
  background: linear-gradient(160deg, var(--bg-start) 0%, var(--bg-mid) 45%, var(--bg-end) 100%);
  color: var(--text);
  min-height: 100vh;
}

body.prehero .shell {
  visibility: hidden;
  pointer-events: none;
}

.heroSelect {
  position: fixed;
  inset: 0;
  min-width: 100vw;
  min-height: 100vh;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--bg-start) 0%, var(--bg-mid) 45%, var(--bg-end) 100%);
  background-color: #f4f9ff;
  overflow: hidden;
  opacity: 0;
  transition: opacity 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

.vantaLayer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.vantaLayer--birds {
  z-index: 8;
  opacity: 0.55;
}

.cloudLayer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.skyCloud {
  --cloud-scale: 1;
  position: absolute;
  width: 70px;
  height: 50px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    rgba(255, 255, 255, 0.92) 55px -12px 0 -8px,
    rgba(255, 255, 255, 0.92) 22px -22px 0 -2px,
    rgba(255, 255, 255, 0.92) 28px 12px 0 -4px,
    rgba(255, 255, 255, 0.92) 55px 14px 0 -10px,
    rgba(255, 255, 255, 0.92) 78px 4px 0 -6px;
  opacity: 0.85;
  filter: drop-shadow(0 10px 18px rgba(13, 46, 90, 0.12));
  transform: translateY(0) scale(var(--cloud-scale));
  animation: cloudFloat 9s ease-in-out infinite;
  transform-origin: center;
}

.skyCloud--1 {
  top: 10%;
  left: 8%;
  --cloud-scale: 1.05;
  animation-duration: 9s;
}

.skyCloud--2 {
  top: 16%;
  left: 26%;
  --cloud-scale: 0.85;
  animation-duration: 11s;
}

.skyCloud--3 {
  top: 9%;
  left: 48%;
  --cloud-scale: 1.2;
  animation-duration: 10s;
}

.skyCloud--4 {
  top: 14%;
  left: 66%;
  --cloud-scale: 0.9;
  animation-duration: 12s;
}

.skyCloud--5 {
  top: 8%;
  left: 78%;
  --cloud-scale: 0.75;
  animation-duration: 8s;
}

.skyCloud--6 {
  top: 18%;
  left: 88%;
  --cloud-scale: 0.7;
  animation-duration: 13s;
}


.heroSelect::after {
  content: "";
  position: absolute;
  inset: -20%;
  background: radial-gradient(45% 45% at 12% 12%, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.25) 35%, transparent 70%);
  opacity: 0;
  transform: translateX(-12%) translateY(-6%);
  pointer-events: none;
  mix-blend-mode: screen;
  z-index: 6;
}

.heroSelect::before {
  content: "";
  position: absolute;
  left: -12%;
  right: -12%;
  bottom: -35%;
  height: 55%;
  background:
    radial-gradient(35% 45% at 12% 100%, rgba(152, 214, 170, 0.35) 0%, rgba(152, 214, 170, 0) 70%),
    radial-gradient(35% 45% at 88% 100%, rgba(152, 214, 170, 0.35) 0%, rgba(152, 214, 170, 0) 70%),
    linear-gradient(180deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 241, 214, 0.9) 45%,
      rgba(250, 227, 186, 0.98) 75%,
      rgba(246, 219, 170, 0.98) 100%);
  z-index: 3;
  pointer-events: none;
}

.heroSelect.visible {
  opacity: 1;
}

.heroSelect.visible::after {
  animation: sunWash 2.6s ease-out 0.2s 1;
}

.heroSelect.hidden {
  opacity: 0;
  pointer-events: none;
}

@keyframes cloudFloat {
  50% {
    transform: translateY(-10px) scale(var(--cloud-scale));
  }
}

.heroBackdrop {
  position: absolute;
  inset: 0;
  background: url('/scoring/assets/greekisland.png') center center / cover no-repeat;
  filter: saturate(1.04) contrast(1.08) brightness(1.04);
  image-rendering: -webkit-optimize-contrast;
  transform: translateZ(0);
  z-index: 1;
}

.heroSelectInner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 26px 24px 18px;
  min-height: 100vh;
  width: min(1200px, 92vw);
  text-align: center;
  position: relative;
  z-index: 7;
}

.heroTop {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
}

.heroTitle {
  font-weight: 900;
  font-size: clamp(34px, 6vw, 60px);
  letter-spacing: 8px;
  color: #ffffff;
  text-transform: uppercase;
  text-shadow:
    0 16px 40px rgba(0, 0, 0, 0.35),
    0 2px 8px rgba(0, 0, 0, 0.25);
}

.heroSubtitle {
  font-weight: 600;
  font-size: clamp(14px, 2.2vw, 20px);
  letter-spacing: 4px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  margin-top: -6px;
}

.heroSelectFooter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(760px, 92vw);
  padding: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  margin-top: auto;
}

.heroPrompt {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.heroGrid {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 900px;
}

.heroCard {
  position: relative;
  width: 140px;
  padding: 10px 10px 8px;
  border-radius: 16px;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
              border-color 280ms ease,
              box-shadow 280ms ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.heroCard:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow:
    0 0 0 1px rgba(96, 175, 255, 0.2),
    0 20px 50px rgba(0, 0, 0, 0.35),
    0 0 40px rgba(96, 175, 255, 0.2);
}

.heroCard:focus {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(96, 175, 255, 0.3),
    0 20px 50px rgba(0, 0, 0, 0.35);
}

.heroGlow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(96, 175, 255, 0.22), transparent 50%);
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}

.heroCard:hover .heroGlow {
  opacity: 1;
}

.heroAvatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.4),
    inset 0 0 20px rgba(0, 0, 0, 0.2);
  transition: border-color 280ms ease, box-shadow 280ms ease;
  object-fit: cover;
}

.heroCard:hover .heroAvatar {
  border-color: rgba(96, 175, 255, 0.6);
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.45),
    0 0 20px rgba(96, 175, 255, 0.2);
}

.markCard .heroAvatarAngry {
  display: none;
}

.markCard .heroAvatarHappy {
  display: block;
}

.markCard:hover .heroAvatarHappy {
  display: none;
}

.markCard:hover .heroAvatarAngry {
  display: block;
}

.heroName {
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.heroHint {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.7);
  animation: heroHintBlink 1.5s ease-in-out infinite;
}

@keyframes heroHintBlink {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

@keyframes sunWash {
  0% {
    opacity: 0;
    transform: translateX(-12%) translateY(-6%);
  }
  35% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: translateX(10%) translateY(4%);
  }
}

.shell {
  width: min(960px, 92vw);
  margin: 0 auto;
  padding: 64px 20px 80px;
  display: grid;
  gap: 28px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brandTitle {
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brandSubtitle {
  font-size: 15px;
  color: var(--muted);
}

.toolGrid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.toolCard {
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: var(--card-bg);
  border-radius: 18px;
  padding: 18px 20px;
  display: grid;
  gap: 12px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  position: relative;
  overflow: hidden;
}

.toolCard::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 40%, rgba(105, 167, 255, 0.18) 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.toolCard:hover {
  transform: translateY(-4px);
  border-color: rgba(105, 167, 255, 0.5);
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.18);
}

.toolCard:hover::after {
  opacity: 1;
}

.toolLabel {
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

.toolTitle {
  font-size: 20px;
  font-weight: 700;
}

.toolDesc {
  font-size: 14px;
  color: var(--muted);
}

.toolCta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--accent-strong);
  font-weight: 700;
}

.toolCta span {
  display: inline-block;
  width: 24px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-strong), transparent);
}

.selectedHero {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px 6px 6px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 18px;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
}

.selectedHeroImg {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(105, 167, 255, 0.6);
  box-shadow: 0 0 12px rgba(105, 167, 255, 0.3);
}

.selectedHeroName {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 2px;
}

@media (max-width: 800px) {
  .heroGrid {
    gap: 10px;
  }
  .heroCard {
    width: 125px;
    padding: 8px 8px 6px;
  }
  .heroAvatar {
    width: 78px;
    height: 78px;
  }
}

@media (max-width: 520px) {
  .heroGrid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .heroCard {
    width: 100%;
  }
  .heroSelectFooter {
    padding: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .heroHint {
    animation: none !important;
  }
  .heroSelect::after {
    animation: none !important;
    opacity: 0;
  }
  .vantaLayer--birds {
    opacity: 0;
  }
  .heroCard {
    transition: none !important;
  }
}
