/* Treasure Map, World Detail, profiles and setup screens. */

/* ---------- profiles ---------- */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

.profile-card {
  background: var(--card);
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  min-height: 190px;
  transition: transform 0.1s;
}

.profile-card:active {
  transform: scale(0.97);
}

.profile-name {
  font-weight: 800;
  font-size: 1.2rem;
}

.profile-meta {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.profile-add {
  background: rgba(255, 255, 255, 0.6);
  border: 3px dashed #7dd3fc;
  box-shadow: none;
}

.profile-plus {
  font-size: 3rem;
  line-height: 1;
  color: var(--secondary);
}

.screen-footer {
  margin-top: auto;
  display: flex;
  justify-content: center;
}

/* ---------- setup ---------- */
.steps {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.step {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
}

.step.current {
  background: var(--primary);
  transform: scale(1.3);
}

.step.done {
  background: var(--good);
}

.band-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
}

.band-card {
  background: var(--card);
  border: 4px solid transparent;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  text-align: center;
}

.band-card.selected {
  border-color: var(--primary);
}

.band-emoji {
  font-family: var(--emoji);
  font-size: 3rem;
}

.band-name {
  font-weight: 800;
  font-size: 1.25rem;
}

.band-ages {
  font-weight: 700;
  color: var(--secondary);
}

.band-desc {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}

.avatar-choice {
  font-family: var(--emoji);
  font-size: 3rem;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 4px solid transparent;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.avatar-choice.selected {
  border-color: var(--primary);
  transform: scale(1.08);
}

/* ---------- tutorial ---------- */
.tutorial {
  justify-content: center;
  align-items: center;
  text-align: center;
}

.tutorial-icon {
  font-family: var(--emoji);
  font-size: 5rem;
  animation: pop-in 0.4s;
}

/* ---------- treasure map ---------- */
.sea {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 68dvh;
  margin: 0 auto;
  border-radius: 28px;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.25) 0 2px, transparent 3px) 0 0 / 40px 40px,
    radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.18) 0 2px, transparent 3px) 0 0 / 56px 56px,
    linear-gradient(160deg, #38bdf8, #0284c7 60%, #0369a1);
  box-shadow: inset 0 0 0 6px #fde68a, inset 0 0 0 10px #b45309, var(--shadow);
  overflow: hidden;
}

.map-route {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.route {
  fill: none;
  stroke: rgba(255, 255, 255, 0.45);
  stroke-width: 0.9;
  stroke-dasharray: 2 2;
  vector-effect: non-scaling-stroke;
  stroke-width: 4px;
}

.route.open {
  stroke: #fef08a;
}

.compass-deco {
  position: absolute;
  right: 4%;
  bottom: 3%;
  font-family: var(--emoji);
  font-size: 2.4rem;
  opacity: 0.85;
  animation: spin-slow 20s linear infinite;
}

@keyframes spin-slow {
  to {
    transform: rotate(360deg);
  }
}

.island {
  position: absolute;
  transform: translate(-50%, -50%);
  width: clamp(104px, 28%, 170px);
  aspect-ratio: 1.2;
  border: none;
  border-radius: 50% 46% 52% 44%;
  background: radial-gradient(ellipse at 50% 60%, #fde68a 0 55%, #fbbf24 56% 64%, rgba(255, 255, 255, 0.6) 65% 70%, transparent 71%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  cursor: pointer;
  filter: drop-shadow(0 6px 0 rgba(3, 105, 161, 0.6));
  transition: transform 0.15s;
  padding: 0;
}

.island:hover,
.island:focus-visible {
  transform: translate(-50%, -50%) scale(1.06);
}

.island-emoji {
  font-family: var(--emoji);
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  line-height: 1;
}

.island-name {
  font-weight: 800;
  font-size: clamp(0.7rem, 2.6vw, 0.95rem);
  color: #78350f;
  background: rgba(255, 255, 255, 0.85);
  padding: 1px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.island-progress {
  font-size: 0.75rem;
  font-weight: 700;
  color: #92400e;
}

.island.locked {
  filter: grayscale(0.8) brightness(0.9) drop-shadow(0 6px 0 rgba(3, 105, 161, 0.6));
}

.island.complete .island-name {
  background: #bbf7d0;
  color: #14532d;
}

.island.next::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 4px dashed #fef08a;
  animation: spin-slow 12s linear infinite;
}

.island-piece {
  position: absolute;
  top: 2px;
  right: 8px;
  font-family: var(--emoji);
}

.island-marker {
  position: absolute;
  top: -30px;
  animation: bob 1.6s ease-in-out infinite;
}

.map-pieces {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  padding: 6px 14px;
  border-radius: 999px;
  width: fit-content;
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
}

.map-pieces-label {
  font-weight: 700;
  font-size: 0.9rem;
}

.piece {
  font-family: var(--emoji);
  font-size: 1.5rem;
  opacity: 0.4;
}

.piece.have {
  opacity: 1;
}

.map-kiki {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.map-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
}

.nav-btn {
  border-radius: 20px;
  padding: 6px 0;
  flex-direction: column;
  gap: 2px;
}

.nav-icon {
  font-family: var(--emoji);
  font-size: 1.6rem;
  line-height: 1;
}

.nav-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #0c4a6e;
}

/* ---------- world detail ---------- */
.world-screen {
  background: linear-gradient(180deg, color-mix(in srgb, var(--world) 28%, transparent), transparent 55%);
}

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

.world-emoji {
  font-family: var(--emoji);
  font-size: 4rem;
  line-height: 1;
}

.world-focus {
  margin: 4px 0 8px;
  color: var(--ink-soft);
  font-weight: 700;
}

.world-count {
  font-size: 0.9rem;
  margin: 6px 0 0;
}

.world-locked {
  text-align: center;
  padding: 30px 0;
}

.level-path {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.level-node {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 4px 12px;
  position: relative;
}

.level-node.right {
  margin-left: 18%;
}

.level-node.left {
  margin-right: 18%;
}

.level-btn {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 5px solid #fff;
  background: var(--world);
  color: #fff;
  font-weight: 900;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.25);
  display: grid;
  place-items: center;
}

.level-btn:active {
  transform: translateY(3px);
  box-shadow: none;
}

.level-btn.locked {
  background: #94a3b8;
  font-size: 1.3rem;
}

.level-btn.done {
  background: var(--good);
}

.level-btn.next {
  animation: pulse-ring 1.6s ease-out infinite;
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 5px 0 rgba(0, 0, 0, 0.25), 0 0 0 0 rgba(249, 115, 22, 0.7);
  }
  100% {
    box-shadow: 0 5px 0 rgba(0, 0, 0, 0.25), 0 0 0 18px rgba(249, 115, 22, 0);
  }
}

.level-clue {
  position: absolute;
  bottom: -8px;
  right: -10px;
  font-family: var(--emoji);
  font-size: 1.2rem;
  background: #fff;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
}

.level-title {
  font-weight: 700;
  background: rgba(255, 255, 255, 0.85);
  padding: 4px 10px;
  border-radius: 10px;
}
