* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #10243e;
  font-family: "Comic Sans MS", "Chalkboard SE", "Segoe UI", cursive, sans-serif;
  -webkit-user-select: none;
  user-select: none;
}

#game {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  touch-action: none;
  display: block;
}

.hidden {
  display: none !important;
}

/* ---------- popups (start + select) ---------- */
#startPopup, #selectPopup {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: linear-gradient(180deg, #a5dcff 0%, #d9f3d0 100%);
  padding: 20px;
  text-align: center;
  cursor: pointer;
}

.deco {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 30px;
  pointer-events: none;
}
.deco.right {
  left: auto;
  right: 16px;
}

.deco .balloon {
  width: 62px;
  height: auto;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.25));
  animation: bob 2.4s ease-in-out infinite;
}
.deco .balloon.b2 { width: 50px; animation-delay: -1.2s; }
.deco .balloon.b3 { width: 56px; animation-delay: -0.6s; }
.deco .balloon.b4 { width: 48px; animation-delay: -1.8s; }

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

.title {
  color: #1e90ff;
  font-size: 46px;
  line-height: 1.15;
  letter-spacing: 1px;
  text-shadow:
    2px 2px 0 #ffffff,
    4px 4px 0 rgba(30, 144, 255, 0.25);
  -webkit-text-stroke: 1.5px #1573cc;
  margin-bottom: 4px;
}
.title.small {
  font-size: 40px;
}

.hint {
  color: #33507a;
  font-size: 18px;
  line-height: 1.45;
  max-width: 400px;
}

#startBtn {
  font-family: inherit;
  font-size: 24px;
  font-weight: bold;
  letter-spacing: 1px;
  color: #ffffff;
  background: linear-gradient(180deg, #4db2ff 0%, #1e90ff 100%);
  border: none;
  border-radius: 999px;
  padding: 16px 40px;
  box-shadow: 0 6px 0 #1573cc, 0 12px 20px rgba(30, 144, 255, 0.4);
  cursor: pointer;
  transition: transform 0.08s ease;
  margin-top: 8px;
  -webkit-tap-highlight-color: transparent;
}
#startBtn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #1573cc, 0 6px 12px rgba(30, 144, 255, 0.4);
}

/* ---------- character select ---------- */
#selectPopup {
  cursor: default;
}

.chars {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
}

.charCard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 128px;
  padding: 16px 10px 14px;
  background: #ffffff;
  border: 4px solid #bfe0ff;
  border-radius: 22px;
  box-shadow: 0 6px 0 rgba(30, 110, 200, 0.25);
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.charCard svg {
  width: 92px;
  height: 104px;
  animation: bob 2.4s ease-in-out infinite;
}
.charCard:nth-child(2) svg { animation-delay: -0.8s; }
.charCard:nth-child(3) svg { animation-delay: -1.6s; }

.charCard span {
  font-family: inherit;
  font-size: 20px;
  font-weight: 700;
  color: #33507a;
  letter-spacing: 1px;
}

.charCard:hover {
  transform: translateY(-4px) scale(1.04);
  border-color: #42a5f5;
  box-shadow: 0 9px 0 rgba(30, 110, 200, 0.3);
}

.charCard:active {
  transform: translateY(2px) scale(0.97);
  box-shadow: 0 3px 0 rgba(30, 110, 200, 0.3);
}
