/* Home: logo over the stage, profile dock below (sidebar on desktop). */

.home-hero {
  position: absolute;
  top: 0;
  left: 0; right: 0;
  padding: calc(var(--topbar-h) + var(--safe-t) + 4px) 16px 16px;
  text-align: center;
  pointer-events: none;
  /* The LED wall behind the logo is the brightest thing on screen: a soft scrim keeps the title and tagline legible. */
  background: linear-gradient(180deg, rgba(6, 6, 15, 0.8) 0%, rgba(6, 6, 15, 0.55) 65%, rgba(6, 6, 15, 0) 100%);
}
.logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.7rem, 8.4vw, 3.6rem);
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--c-text);
  text-shadow: 0 0 24px rgba(0, 240, 255, 0.6), 0 3px 0 rgba(0, 0, 0, 0.6);
  animation: logo-in 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.logo-b { color: var(--c-pink); font-size: 0.5em; vertical-align: 0.35em; text-shadow: 0 0 18px rgba(255, 0, 110, 0.8); }
.logo-c { color: var(--c-cyan); }
@keyframes logo-in { from { opacity: 0; transform: translateY(-18px) scale(0.92); letter-spacing: 0.2em; } }

.home-tagline {
  display: inline-block;
  max-width: 34em;
  margin-top: 10px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(6, 6, 15, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: clamp(0.8rem, 3.4vw, 1rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--c-text);
  text-wrap: balance;
}

/* Name + 🎲: the die never steals width from the field it sits next to. */
.name-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.name-dice { font-size: 1.15rem; }

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}
.avatar-btn {
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  border-radius: 12px;
  border: 1.5px solid transparent;
  background: var(--field);
  font-size: clamp(1.15rem, 5.4vw, 1.5rem);
  line-height: 1;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.avatar-btn:hover { background: rgba(255, 255, 255, 0.12); }
.avatar-btn.is-selected {
  border-color: var(--c-cyan);
  background: rgba(0, 240, 255, 0.16);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.45);
  transform: scale(1.1);
}

.home-actions { display: flex; flex-direction: column; gap: 14px; margin-top: 2px; }
.join-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.code-input {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.3em;
  text-align: center;
  text-transform: uppercase;
}
.code-input::placeholder { letter-spacing: 0.12em; font-weight: 500; font-size: 0.8rem; }
.home.is-invited .code-input { border-color: var(--c-cyan); box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.18); }

/* Short phones: a little more dock and tighter paddings so both avatar rows stay visible. */
@media (max-height: 700px) and (orientation: portrait) {
  .panel.home-dock { max-height: 52%; gap: 8px; padding-top: 12px; }
  .home-dock .dock-body { gap: 8px; }
  .home-actions { gap: 12px; }
  .home-dock .btn-lg { min-height: 50px; }
}
/* An invite (/?r=CODE) puts a preview banner above the name field, which on a 360–375 px phone pushes the avatar
   grid out of the scrolling body — the one control the guest came here to use. The invited layout gets the short-phone
   compaction at any height plus a budget that covers the banner, so both rows stay inside .dock-body. */
@media (orientation: portrait) {
  .home.is-invited .panel.home-dock { max-height: 64%; gap: 8px; padding-top: 12px; }
  .home.is-invited .home-dock .dock-body { gap: 8px; }
  .home.is-invited .home-actions { gap: 12px; }
  .home.is-invited .home-dock .btn-lg { min-height: 50px; }
}

@media (orientation: landscape) and (min-width: 700px) {
  .home-hero {
    padding-top: calc(var(--topbar-h) + var(--safe-t) + 12px);
    right: var(--sidebar-w);
  }
  .logo { font-size: clamp(2rem, 5vw, 4.2rem); }
  .avatar-grid { gap: 8px; }
}

/* Invite preview (/?r=CODE): what the code leads to, before the join. */
.invite-card {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(0, 240, 255, 0.08);
  border: 1.5px solid rgba(0, 240, 255, 0.45);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.3;
  animation: fade-in 0.25s ease both;
}
.invite-card-icon { flex: none; font-size: 1.3rem; }
.invite-card[data-kind="ok"] { background: rgba(0, 255, 136, 0.08); border-color: rgba(0, 255, 136, 0.55); }
.invite-card[data-kind="watch"] { background: rgba(255, 204, 0, 0.08); border-color: rgba(255, 204, 0, 0.5); }
.invite-card[data-kind="bad"] { background: rgba(255, 51, 85, 0.08); border-color: rgba(255, 51, 85, 0.5); color: #ffd9df; }
.invite-card[data-kind="wait"] { color: var(--c-dim); }
@media (max-width: 480px) {
  .invite-card { padding: 8px 10px; font-size: 0.78rem; }
}

/* Shown while the socket is down: explains the disabled PLAY / JOIN. */
.home-conn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  color: var(--c-yellow);
  font-size: 0.85rem;
  font-weight: 600;
}
.home-conn .pulse-dot { margin-right: 0; background: var(--c-yellow); box-shadow: 0 0 10px var(--c-yellow); }
