/* Title screen (views/start.js). The top bar is hidden while body.title-screen is set. */
body.title-screen header.sticky { display: none; }
body.title-screen main { padding: 0; max-width: none; }

.title-scene {
  position: fixed; inset: 0; overflow: hidden; user-select: none; -webkit-user-select: none;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  display: flex; align-items: center; justify-content: center;
  background: #8fd3ff;
}
.title-scene.menu { cursor: default; }
.title-scene .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Sky scene: the sky, sun, clouds and hills are scenes/sky.js, styled in css/scenes.css
   (shared with the page backdrop); the sparkles and the bird fly over it. */
.title-scene .sky { position: absolute; inset: 0; pointer-events: none; }

/* The legendary fly-by: right to left (Gen 5 sprites face left), with a gentle swoop. */
.title-scene .bird {
  position: absolute; top: 24%; left: 0; width: 160px; height: 160px; image-rendering: pixelated;
  filter: drop-shadow(0 10px 8px rgba(0, 40, 90, .25));
  animation: title-fly 2.5s cubic-bezier(.45, .05, .55, .95) forwards;
}
@keyframes title-fly {
  0%   { transform: translate(105vw, 10vh) scale(.8) rotate(4deg); }
  30%  { transform: translate(65vw, -2vh) scale(1) rotate(-2deg); }
  60%  { transform: translate(30vw, 8vh) scale(1.1) rotate(3deg); }
  100% { transform: translate(calc(-160px - 8vw), -6vh) scale(1.2) rotate(-6deg); }
}
.title-scene .spark {
  position: absolute; font-style: normal; line-height: 1; pointer-events: none;
  text-shadow: 0 0 6px rgba(255, 255, 255, .9);
  animation: title-spark 1.1s ease-out forwards;
}
@keyframes title-spark {
  0%   { opacity: 1; transform: translate(0, 0) scale(1) rotate(0); }
  100% { opacity: 0; transform: translate(14px, 22px) scale(.3) rotate(120deg); }
}

/* Logo */
.title-center {
  position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center;
  gap: 18px; padding: 16px; width: 100%; max-width: 520px; text-align: center;
}
.title-scene .logo {
  margin: 0; font-family: "Luckiest Guy", "Arial Black", Impact, system-ui, sans-serif; font-weight: 900;
  font-size: clamp(60px, 19vw, 132px); line-height: 1; letter-spacing: .02em; color: #ffcb05;
  transform: rotate(-6deg) skewX(-4deg);
  -webkit-text-stroke: 3px #2a4b9b;
  text-shadow:
    4px 0 #2a4b9b, -4px 0 #2a4b9b, 0 4px #2a4b9b, 0 -4px #2a4b9b,
    3px 3px #2a4b9b, -3px 3px #2a4b9b, 3px -3px #2a4b9b, -3px -3px #2a4b9b,
    6px 8px 0 #1b2f66, 8px 12px 14px rgba(0, 0, 0, .25);
}
.title-scene .logo span { display: inline-block; }
.title-scene.intro .logo { opacity: 0; transform: rotate(-6deg) skewX(-4deg) scale(.2); }
.title-scene.logo-in .logo { animation: title-logo .7s cubic-bezier(.2, 1.4, .4, 1) both; }
.title-scene.still .logo { animation: none; }
@keyframes title-logo {
  0%   { opacity: 0; transform: rotate(-6deg) skewX(-4deg) scale(.2); }
  100% { opacity: 1; transform: rotate(-6deg) skewX(-4deg) scale(1); }
}

.title-scene .tap {
  margin: 8px 0 0; font-size: 24px; font-weight: 800; color: #fff; letter-spacing: .06em;
  text-shadow: 0 2px 0 #2a4b9b, 0 0 10px rgba(0, 40, 120, .45);
  visibility: hidden;
}
.title-scene.logo-in .tap { visibility: visible; animation: title-blink 1.1s steps(1, end) .7s infinite; }
.title-scene.still .tap { animation: none; }
@keyframes title-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.title-buttons { display: none; flex-direction: column; gap: 14px; width: 100%; max-width: 340px; }
.title-scene.menu .title-buttons { display: flex; animation: title-up .35s ease-out both; }
.title-scene.menu .tap { display: none; }
@keyframes title-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.title-btn {
  display: block; text-align: center; font-size: 22px; font-weight: 800; padding: 18px 20px;
  border-radius: 16px; box-shadow: 0 5px 0 rgba(0, 0, 0, .22);
}
.title-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, .22); }
.title-btn.login-btn { background: #2a75bb; }
.title-btn.login-btn:hover { background: #1f5f9c; }
.title-btn.team-btn { background: var(--accent); }
.title-btn.team-btn:hover { background: var(--accent-dark); }
.title-continue { color: #1f3b73; font-weight: 700; font-size: 15px; text-decoration: none; padding: 8px; }

@media (prefers-reduced-motion: reduce) {
  .title-scene .bird, .title-scene .spark, .title-scene .logo, .title-scene .tap, .title-buttons { animation: none !important; }
}

/* ---------- Create a Team (views/teamBuilder.js) and My Party → Add member ---------- */
.back-link { margin: 0 0 8px; }
.back-link a { text-decoration: none; font-weight: 700; }
.team-new h1 { font-size: 24px; }
.team-head { margin: 6px 0 8px; }
.team-head h2 { margin: 0; }
.tb-members { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.tb-empty { margin: 4px 0 8px; }
.tb-member {
  display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 8px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--card);
}
.tb-member.is-leader { border-color: #e8b400; background: #fffbea; }
.tb-member .sprite { width: 52px; height: 52px; }
.tb-info { flex: 1; min-width: 0; }
.tb-info .title { font-weight: 800; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-info .sub { color: var(--muted); font-size: 13px; }
button.tb-star, button.tb-x {
  flex: none; width: 46px; height: 46px; padding: 0; border-radius: 50%; font-size: 24px; line-height: 1;
  background: transparent; border: 1px solid var(--border); color: #b8860b;
}
button.tb-star.on { background: #ffd84d; border-color: #e8b400; color: #6b4a00; }
button.tb-star:hover { background: #fff1b3; }
button.tb-x { color: var(--muted); font-size: 18px; }
button.tb-x:hover { background: #fde8e3; color: var(--low); border-color: var(--low); }
.tb-adds { margin-bottom: 14px; align-items: stretch; flex-wrap: nowrap; }
.tb-adds .tb-add { flex: 1 1 140px; padding: 14px 10px; font-size: 17px; }
.tb-progress {
  margin-bottom: 12px; padding: 10px 12px; border-radius: 10px; background: var(--bg); font-weight: 600;
}
.tb-progress .tb-error { color: var(--low); }
.tb-progress .spin { display: inline-block; animation: tb-spin 1s linear infinite; }
@keyframes tb-spin { to { transform: rotate(360deg); } }
button.tb-go { background: #22a35a; }
button.tb-go:hover { background: #1b8549; }

.ep-search { margin-bottom: 10px; }
.ep-list { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow-y: auto; }
.ep-row .row { flex-wrap: nowrap; }
.ep-row .row > div { flex: 1; min-width: 0; }
.ep-plus { flex: none; font-size: 22px; font-weight: 800; color: var(--accent); }

.am-tabs { display: flex; gap: 6px; margin: 4px 0 14px; }
.am-tabs button { flex: 1; background: var(--bg); color: var(--text); border: 1px solid var(--border); padding: 12px 8px; }
.am-tabs button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
