/* Login, registration and the player profile. Base styles live in ../style.css */
.login h1 { font-size: 24px; }
.names { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.names .tile { padding: 12px; }
.staff-toggle { width: 100%; text-align: left; font-weight: 700; }
.staff #staff { margin-top: 10px; }

.hello h1 { font-size: 22px; margin-bottom: 2px; }

.team-row { margin-bottom: 10px; }
.team-row .slot { width: auto; flex: 1; min-width: 0; padding: 8px 10px; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.pick-grid { margin-top: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); max-height: 60vh; overflow-y: auto; padding-right: 2px; }
.pick-grid .tile { padding: 8px; }
.pick-grid .title.small { font-size: 14px; }

.stats { gap: 6px; margin-top: 6px; }
.stat { flex: 1; min-width: 70px; text-align: center; background: var(--bg); border-radius: 10px; padding: 8px 4px; }
.stat .big-text { font-size: 20px; font-weight: 800; }
.danger-zone { border-color: #f3c0bb; }

/* ---------- New trainer (newTrainer.js): screen 1 the name, screen 2 the starter ---------- */
.newtrainer.step-in { animation: step-in .3s ease-out; }
@keyframes step-in { from { opacity: 0; transform: translateY(8px); } }
.next-row { display: flex; justify-content: flex-end; }
button.next-arrow {
  display: inline-flex; align-items: center; gap: 10px; border-radius: 999px;
  padding: 14px 22px 14px 28px; font-size: 20px; box-shadow: 0 4px 12px rgba(227, 53, 13, .3);
}
button.next-arrow .arrow { font-size: 26px; line-height: 1; transition: transform .2s ease; }
button.next-arrow:not(:disabled):hover .arrow { transform: translateX(4px); }
button.next-arrow:disabled { box-shadow: none; }

.pick-head { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.pick-head .nt-back { flex: none; white-space: nowrap; }
.pick-head h2 { margin: 0; font-size: clamp(17px, 5.4vw, 20px); white-space: nowrap; outline: none; }
.pick-hint { margin-bottom: 10px; }
.nt-note { margin: 4px 0 0; text-align: center; }
/* a phone on its side: keep the room for the Pokemon */
@media (max-height: 520px) {
  .newtrainer.pick .steps, .newtrainer.pick .pick-hint, .newtrainer.pick .nt-note { display: none; }
}

/* the carousel: native horizontal scrolling with snap, so a swipe feels like the phone's own.
   It takes the height the screen has left under the header (vh first for browsers without dvh;
   every slide's content is absolutely placed, so the track must always get a height). */
.starter-carousel { position: relative; max-width: 520px; margin: 0 auto; }
.starter-track {
  display: flex; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  border-radius: var(--radius); scrollbar-width: none; outline: none;
  height: clamp(260px, calc(100vh - 270px), 500px);
  height: clamp(260px, calc(100dvh - 270px), 500px);
}
/* inside a modal sheet (Create a Team, Add member) the sheet's heading and padding come off too */
.modal .starter-track {
  height: clamp(260px, calc(92vh - 290px), 460px);
  height: clamp(260px, calc(92dvh - 290px), 460px);
}
.starter-track::-webkit-scrollbar { display: none; }
.starter-track:focus-visible { box-shadow: 0 0 0 3px var(--accent); }

.starter-slide {
  position: relative; flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always;
  overflow: hidden; container-type: size;
}
.starter-bg { position: absolute; inset: 0; }
.starter-bg svg { width: 100%; height: 100%; display: block; }

/* name, types and a line about it, over the sky */
.starter-info {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: calc(100% - 28px); max-width: 380px;
  background: rgba(255, 255, 255, .88); border-radius: 12px; padding: 8px 12px; text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.starter-info .nm { font-size: 22px; font-weight: 800; line-height: 1.15; }
.starter-info .type { margin: 3px 2px 0; }
.starter-info .desc { font-size: 13px; color: #3a4150; margin-top: 4px; line-height: 1.3; }

/* the Pokemon on a little platform; the whole thing is the tap target. It stands clear of the
   Select button below and the info card above (--mon is its size; plain viewport units for
   browsers without container units). */
button.starter-mon {
  --mon: min(48vw, 30vh, 200px);
  position: absolute; left: 50%; bottom: max(21%, 92px); transform: translateX(-50%);
  width: var(--mon); height: var(--mon); padding: 0; border: none; border-radius: 50%;
  display: flex; align-items: flex-end; justify-content: center;
  -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}
@supports (width: 1cqh) {
  button.starter-mon { --mon: min(56cqw, calc(100cqh - 210px), 220px); }
}
button.starter-mon, button.starter-mon:hover { background: none; }
button.starter-mon:focus-visible { outline: 3px solid #1f2430; outline-offset: 4px; box-shadow: 0 0 0 8px #fff; }
.starter-ground {
  position: absolute; left: 50%; bottom: -6%; transform: translateX(-50%);
  width: 108%; height: 24%; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, var(--pad-top) 0 55%, var(--pad-rim) 56% 100%);
  box-shadow: 0 6px 10px rgba(0, 0, 0, .22);
}
.starter-slide .starter-sprite {
  position: relative; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated;
  pointer-events: none; -webkit-user-drag: none;
  transform-origin: 50% 100%; animation: starter-bob 1.8s ease-in-out infinite;
}
.starter-slide .starter-sprite.fallback {
  width: 70%; height: 70%; margin-bottom: 12%; font-size: calc(var(--mon) / 3); animation: none;
}
@keyframes starter-bob { 50% { transform: translateY(-3%); } }

/* tapped: a hop (listed last so it wins over the bob while it plays), a glowing ring on the platform */
.starter-slide.hop .starter-sprite { animation: starter-bob 1.8s ease-in-out infinite, starter-hop .55s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes starter-hop { 0% { transform: translateY(0) scale(1, 1); } 25% { transform: translateY(0) scale(1.08, .9); } 55% { transform: translateY(-18%) scale(.95, 1.06); } 100% { transform: translateY(0) scale(1, 1); } }
.starter-slide.chosen .starter-ground {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .95), 0 0 18px 6px var(--glow), 0 6px 10px rgba(0, 0, 0, .22);
  animation: starter-glow 1.4s ease-in-out infinite;
}
@keyframes starter-glow { 50% { box-shadow: 0 0 0 4px rgba(255, 255, 255, .7), 0 0 26px 10px var(--glow), 0 6px 10px rgba(0, 0, 0, .22); } }
.starter-slide.chosen .starter-sprite { filter: drop-shadow(0 0 6px rgba(255, 255, 255, .9)); }

/* bottom: a hint until it is tapped, then the Select button pops up in the same place */
.starter-foot { position: absolute; left: 12px; right: 12px; bottom: 12px; display: grid; justify-items: center; }
.starter-foot > * { grid-area: 1 / 1; }
.starter-tap {
  align-self: end; padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 700;
  background: rgba(20, 30, 24, .72); color: #fff; animation: starter-nudge 1.6s ease-in-out infinite;
}
@keyframes starter-nudge { 50% { transform: translateY(-4px); } }
button.starter-select {
  max-width: 340px; box-shadow: 0 6px 16px rgba(0, 0, 0, .3);
  visibility: hidden; opacity: 0; transform: translateY(30px) scale(.9);
  transition: opacity .2s ease, transform .3s cubic-bezier(.3, 1.5, .5, 1), visibility 0s .3s;
}
.starter-slide.chosen .starter-tap { visibility: hidden; }
.starter-slide.chosen button.starter-select {
  visibility: visible; opacity: 1; transform: none; transition: opacity .2s ease, transform .3s cubic-bezier(.3, 1.5, .5, 1);
}

/* a short scene: no description line, a slimmer Select button, the Pokemon a little lower */
@container (max-height: 380px) {
  .starter-info { padding: 6px 10px; }
  .starter-info .nm { font-size: 20px; }
  .starter-info .desc { display: none; }
  button.starter-select { padding: 12px; font-size: 18px; }
  button.starter-mon { bottom: max(21%, 72px); --mon: min(56cqw, calc(100cqh - 158px), 200px); }
}

/* each habitat's platform colours and glow */
.hab-grassland { --pad-top: #b8e88e; --pad-rim: #6db352; --glow: rgba(140, 230, 90, .85); }
.hab-mountain { --pad-top: #b59a86; --pad-rim: #7c6152; --glow: rgba(255, 140, 50, .85); }
.hab-waters-edge { --pad-top: #f7e6b2; --pad-rim: #d7b06c; --glow: rgba(90, 200, 255, .85); }

/* scenery motion (starterArt.js) */
.starter-bg .sa-drift { animation: sa-drift 14s ease-in-out infinite alternate; }
.starter-bg .sa-drift.slow { animation-duration: 22s; animation-direction: alternate-reverse; }
@keyframes sa-drift { to { transform: translateX(26px); } }
/* each tuft and the palm's fronds sway about their own root */
.starter-bg .sa-tuft { transform-box: fill-box; transform-origin: 50% 100%; animation: sa-sway 3s ease-in-out infinite; }
.starter-bg .sa-tuft:nth-child(2n) { animation-delay: -1.5s; }
.starter-bg .sa-fronds { transform-box: fill-box; transform-origin: 50% 70%; animation: sa-sway 3.4s ease-in-out infinite; }
@keyframes sa-sway { 50% { transform: rotate(3deg); } }
.starter-bg .sa-wave { animation: sa-wave 3.2s ease-in-out infinite; }
.starter-bg .sa-wave.late { animation-delay: -1.6s; }
@keyframes sa-wave { 50% { transform: translateX(-10px); opacity: .3; } }
.starter-bg .sa-foam { animation: sa-foam 4s ease-in-out infinite; }
@keyframes sa-foam { 50% { transform: translateY(5px); opacity: .55; } }
.starter-bg .sa-puff { transform-box: fill-box; transform-origin: center; animation: sa-puff 4.5s ease-out infinite; }
.starter-bg .sa-puff.late { animation-delay: -1.5s; }
.starter-bg .sa-puff.later { animation-delay: -3s; }
@keyframes sa-puff { 0% { transform: translateY(14px) scale(.5); opacity: 0; } 30% { opacity: .75; } 100% { transform: translateY(-34px) scale(1.5); opacity: 0; } }
.starter-bg .sa-ember { animation: sa-ember 3.6s ease-out infinite; }
.starter-bg .sa-ember.late { animation-delay: -1.2s; }
.starter-bg .sa-ember.later { animation-delay: -2.4s; }
@keyframes sa-ember { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-90px); opacity: 0; } }
.starter-bg .sa-lava { animation: sa-lava 2.4s ease-in-out infinite; }
@keyframes sa-lava { 50% { opacity: .55; } }

/* arrows over the scene for mouse users, dots underneath */
button.starter-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; padding: 0 0 3px;
  border-radius: 50%; font-size: 28px; line-height: 1; background: rgba(255, 255, 255, .85); color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2); display: flex; align-items: center; justify-content: center;
}
@media (hover: hover) { button.starter-arrow:hover { background: #fff; color: var(--accent); } }
@media (hover: none) { button.starter-arrow { width: 34px; height: 34px; font-size: 24px; opacity: .8; } }
button.starter-arrow:disabled { opacity: 0; pointer-events: none; }
button.starter-arrow.prev { left: 8px; }
button.starter-arrow.next { right: 8px; }

/* finger-sized buttons around small dots */
.starter-dots { display: flex; justify-content: center; margin-top: 4px; }
.starter-dots .dot, .starter-dots .dot:hover { position: relative; width: 40px; height: 32px; padding: 0; background: none; }
.starter-dots .dot::before {
  content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 10px; height: 10px; border-radius: 999px; background: #cfd4de; transition: width .25s ease, background .25s ease;
}
.starter-dots .dot.on::before { width: 28px; background: var(--accent); }
.starter-dots .dot:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }

@media (prefers-reduced-motion: reduce) {
  .newtrainer.step-in, .starter-slide .starter-sprite, .starter-tap, .starter-bg * { animation: none !important; }
  .starter-slide.chosen .starter-ground { animation: none; }
  button.starter-select, .starter-slide.chosen button.starter-select, .starter-dots .dot::before { transition: none; }
}
