/* Lobby/welcome screen redesign. Loaded after style.css + mobile-theme.css,
   so rules here intentionally re-declare shared selectors (#welcome, .intro,
   h1, input, button…) to restyle the join screen without touching markup
   client.js depends on. Mobile-first: base rules target small screens,
   the min-width query below layers on the desktop layout. */

#welcome{
  display:flex;align-items:center;justify-content:center;padding:20px;
  background:
    radial-gradient(120% 90% at 15% -10%,rgba(80,180,255,.22),transparent 60%),
    radial-gradient(140% 100% at 100% 115%,rgba(255,120,60,.28),transparent 55%),
    linear-gradient(160deg,#060b14 0%,#0b1522 45%,#0a1220 100%);
}
#welcome.hidden{display:none}

.intro{
  position:relative;max-width:520px;width:100%;
  padding:26px 22px 28px;border-radius:22px;
  background:linear-gradient(180deg,rgba(18,28,44,.82),rgba(10,17,28,.86));
  border:1px solid rgba(140,190,220,.18);
  box-shadow:0 30px 90px rgba(0,0,0,.55),inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
  color:#eaf3fa;
}

.intro .pill{
  border-color:rgba(140,190,220,.4);color:#bfe3ff;background:rgba(255,255,255,.04);
}
.intro .pill.age-badge{
  border-color:#ff9a63;color:#ffc9a0;background:rgba(255,110,50,.12);font-weight:700;
}

#match-picker{color:#9fb6c9}
#match-picker b{color:#eaf3fa}

.intro h1{
  color:#f4faff;letter-spacing:-2px;
  background:linear-gradient(100deg,#ffffff 20%,#bfe6ff 55%,#8fc6ff 80%);
  -webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;
  text-shadow:0 12px 40px rgba(60,140,255,.25);
}
.intro p{color:#a9bdd0}

/* --- Hero row: rotating ball preview + live player count ---------------- */
#lobby-hero{
  display:flex;align-items:center;gap:16px;margin:20px 0 6px;
  padding:12px;border-radius:16px;
  background:rgba(255,255,255,.03);border:1px solid rgba(140,190,220,.14);
}
#lobby-stage{
  position:relative;flex:none;width:96px;height:96px;border-radius:50%;
  background:radial-gradient(circle at 35% 30%,rgba(140,210,255,.35),rgba(10,16,26,0) 70%);
  display:flex;align-items:center;justify-content:center;
}
#lobby-stage::before{
  content:'';position:absolute;inset:0;border-radius:50%;
  border:1px solid rgba(140,210,255,.35);
  box-shadow:0 0 30px rgba(90,180,255,.25);
  animation:lobby-ring-spin 12s linear infinite;
}
/* style.css has a global `canvas{position:fixed;inset:0;width:100%;height:100%}`
   rule (for #game); override it here or the preview blows up to fullscreen. */
#lobby-ball{position:static!important;inset:auto!important;width:100%!important;height:100%!important;display:block;border-radius:50%}
#lobby-stage{overflow:hidden}
.lobby-stage-fallback{background:radial-gradient(circle at 35% 30%,#8fd0ff,#274160 60%,#0b1522 100%)}

#lobby-live{
  display:flex;flex-direction:column;line-height:1.15;
}
#lobby-live b{
  font-size:30px;letter-spacing:-1px;color:#8fe6a8;
  text-shadow:0 0 18px rgba(80,230,140,.45);
}
#lobby-live b::before{
  content:'';display:inline-block;width:9px;height:9px;margin-right:8px;border-radius:50%;
  background:#4ef08a;box-shadow:0 0 10px #4ef08a;vertical-align:middle;
  animation:lobby-pulse 1.6s ease-in-out infinite;
}
#lobby-live span{font-size:11px;color:#8fa6ba;text-transform:uppercase;letter-spacing:.6px}

@keyframes lobby-pulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.35;transform:scale(.7)}}
@keyframes lobby-ring-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){#lobby-stage::before{animation:none}#lobby-live b::before{animation:none}}

/* --- Form -------------------------------------------------------------- */
.intro label{color:#8fa6ba}
.intro input{
  background:rgba(255,255,255,.06);border:1px solid rgba(140,190,220,.3);color:#eaf3fa;
}
.intro input::placeholder{color:#6f8598}
.intro select#team{background:rgba(255,255,255,.06);border:1px solid rgba(140,190,220,.3);color:#eaf3fa}

/* Big, glowing "Spill" call to action. */
.lobby-cta{
  background:linear-gradient(135deg,#ff7a45,#ff4d6d);
  min-height:52px;padding:15px 22px;font-size:16px;letter-spacing:.2px;
  box-shadow:0 12px 34px rgba(255,90,90,.4);
  transition:transform .15s ease,box-shadow .15s ease;
}
.lobby-cta:hover{transform:translateY(-1px) scale(1.015);box-shadow:0 16px 42px rgba(255,90,90,.5)}
.lobby-cta:active{transform:translateY(0) scale(.98)}

.intro .instructions{color:#8fa6ba}
.intro .instructions kbd{background:rgba(255,255,255,.08);color:#eaf3fa}

.lobby-quicklink{
  display:block;width:100%;margin-top:16px;
  background:transparent;border:1.5px solid rgba(140,190,220,.4);color:#bfe3ff;
}
.lobby-quicklink:hover{background:rgba(140,190,220,.1)}

.intro .share-row small{color:#8fa6ba}
#share-link{background:rgba(255,255,255,.08)}

#mobile-join{background:rgba(255,255,255,.03);border-radius:12px;padding:10px}
#mobile-join b{color:#eaf3fa}
#mobile-join p{color:#8fa6ba}
#join-url{color:#8fd0ff}

#lobby-close{
  background:transparent;border:1px solid rgba(140,190,220,.35);color:#bfe3ff;
  min-height:40px;
}

/* --- Desktop layout ------------------------------------------------------ */
@media(min-width:820px) and (min-height:560px){
  .intro{max-width:640px;padding:40px 44px 44px}
  #lobby-hero{gap:22px;padding:16px}
  #lobby-stage{width:132px;height:132px}
  #lobby-live b{font-size:38px}
}

/* --- First-run onboarding: 3-step skippable tour, shown once per device ---
   Non-modal banner pinned to the top of .intro (not a full-screen overlay):
   the welcome screen is always shown on a first visit now, so this must never
   cover the name field or the "Spill" button underneath it. */
#first-run{
  position:relative;z-index:5;margin:0 0 16px;
}
.first-run-card{
  display:flex;align-items:center;gap:12px;width:100%;padding:12px 14px;border-radius:14px;text-align:left;
  background:linear-gradient(180deg,rgba(24,36,54,.96),rgba(12,20,32,.96));
  border:1px solid rgba(140,190,220,.28);box-shadow:0 10px 30px rgba(0,0,0,.35);color:#eaf3fa;
}
.first-run-icon{font-size:26px;line-height:1;flex-shrink:0}
.first-run-card p{flex:1;margin:0;font-size:13px;line-height:1.4;color:#dce9f2}
.first-run-dots{display:none}
.first-run-actions{display:flex;flex-direction:column;gap:6px;flex-shrink:0}
.first-run-skip{background:transparent;border:1px solid rgba(140,190,220,.4);color:#bfe3ff;padding:6px 10px;font-size:11px}
.first-run-next{background:linear-gradient(135deg,#ff7a45,#ff4d6d);color:#fff;padding:6px 10px;font-size:11px}
@media(min-width:820px) and (min-height:560px){
  .first-run-icon{font-size:32px}
  .first-run-card p{font-size:14px}
}

.intro .lobby-poster{display:block;width:100%;height:auto;max-height:240px;object-fit:cover;border-radius:16px;margin:0 0 18px}#mobile-join{display:flex;gap:16px;align-items:center;margin-top:20px}#mobile-join img{flex:none;background:white;border-radius:8px}#mobile-join a{overflow-wrap:anywhere}
