/* play-room.css (MIT)
   v-play-room-v0.1 v-play-together-v0.1 v-play-mesh-stub-v0.1
   A toy shelf under the stars. Darker garden glass. No new colors. */

#tab-play-room {
  overflow-x: hidden;
  max-width: 100%;
}

.fl-play {
  position: relative;
  box-sizing: border-box;
  max-width: 820px;
  margin: 0 auto;
  padding: 8px 16px 40px;
  overflow-x: hidden;
  color: var(--text-primary);
  font-family: var(--font), Inter, sans-serif;
}

.fl-play-sky {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1.2px 1.2px at 12% 18%, rgba(255, 255, 255, 0.55), transparent 60%),
    radial-gradient(1px 1px at 70% 12%, rgba(255, 255, 255, 0.4), transparent 60%),
    radial-gradient(1.3px 1.3px at 40% 36%, rgba(255, 255, 255, 0.45), transparent 60%),
    radial-gradient(1px 1px at 84% 42%, rgba(255, 255, 255, 0.32), transparent 60%),
    radial-gradient(1.2px 1.2px at 22% 70%, rgba(255, 255, 255, 0.38), transparent 60%),
    radial-gradient(1px 1px at 60% 82%, rgba(255, 255, 255, 0.34), transparent 60%),
    radial-gradient(1.1px 1.1px at 90% 78%, rgba(255, 255, 255, 0.3), transparent 60%);
}

.fl-play-main {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.fl-play [hidden] {
  display: none !important;
}

.fl-play-heading {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: normal;
  font-size: 2rem;
  line-height: 1.2;
  color: var(--text-primary);
}

.fl-play-intro,
.fl-play-help,
.fl-play-status,
.fl-play-note,
.fl-play p {
  margin: 0 0 12px;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.fl-play-status {
  min-height: 1.4em;
  color: var(--text-primary);
}

.fl-play-glass,
.fl-play-card,
.fl-play-row,
.fl-play-seat,
.fl-play-ledger,
.fl-play-players,
.fl-play-composer,
.fl-play-object {
  box-sizing: border-box;
  max-width: 100%;
  background: rgba(16, 18, 36, 0.95);
  border: 1px solid rgba(200, 210, 230, 0.08);
  border-radius: 12px;
  color: var(--text-primary);
}

@supports ((backdrop-filter: blur(13px)) or (-webkit-backdrop-filter: blur(13px))) {
  .fl-play-glass,
  .fl-play-card,
  .fl-play-row,
  .fl-play-seat,
  .fl-play-ledger,
  .fl-play-players,
  .fl-play-composer,
  .fl-play-object {
    background: rgba(16, 18, 36, 0.88);
    -webkit-backdrop-filter: blur(13px);
    backdrop-filter: blur(13px);
  }
}

.fl-play-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 12px;
  margin: 0 0 16px;
}

.fl-play-card {
  display: block;
  width: 100%;
  margin: 0;
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.fl-play-card.is-mind { box-shadow: inset 3px 0 0 var(--success); }
.fl-play-card.is-guest { box-shadow: inset 3px 0 0 var(--accent); }

.fl-play-kind {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.fl-play-kind svg {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}

.fl-play-card-title,
.fl-play-object h2,
.fl-play h2 {
  margin: 0 0 6px;
  color: var(--text-primary);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: normal;
  overflow-wrap: anywhere;
}

.fl-play-who {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.fl-play-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 12px;
}

.fl-play-dot.is-mind { background: var(--success); }
.fl-play-dot.is-guest { background: var(--accent); }

.fl-play-meta,
.fl-play-seal,
.fl-play-psi,
.fl-play-time {
  color: var(--text-secondary);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.fl-play-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.fl-play button,
.fl-play select {
  box-sizing: border-box;
  min-height: 44px;
  min-width: 44px;
  max-width: 100%;
  padding: 12px 16px;
  overflow-wrap: anywhere;
  white-space: normal;
  border-radius: 12px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
}

.fl-play button.fl-play-card {
  background: rgba(16, 18, 36, 0.95);
  color: var(--text-primary);
  text-align: left;
}

.fl-play button.fl-play-btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
}

@supports ((backdrop-filter: blur(13px)) or (-webkit-backdrop-filter: blur(13px))) {
  .fl-play button.fl-play-card {
    background: rgba(16, 18, 36, 0.88);
    -webkit-backdrop-filter: blur(13px);
    backdrop-filter: blur(13px);
  }
}

.fl-play-field {
  display: block;
  margin: 0 0 10px;
  color: var(--text-primary);
}

.fl-play-field span {
  display: block;
  margin: 0 0 4px;
  color: var(--text-primary);
}

.fl-play input,
.fl-play textarea {
  box-sizing: border-box;
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(200, 210, 230, 0.08);
  background: rgba(16, 18, 36, 0.95);
  color: var(--text-primary);
  font: inherit;
  font-size: 1rem;
}

.fl-play textarea { min-height: 96px; resize: vertical; }

.fl-play input::placeholder,
.fl-play textarea::placeholder {
  color: var(--text-secondary);
  opacity: 1;
}

.fl-play-composer,
.fl-play-object,
.fl-play-players,
.fl-play-ledger {
  padding: 14px;
  margin: 0 0 16px;
}

.fl-play-row {
  padding: 12px;
  margin: 0 0 8px;
}

.fl-play-row.is-mind { box-shadow: inset 3px 0 0 var(--success); }
.fl-play-row.is-guest { box-shadow: inset 3px 0 0 var(--accent); }

.fl-play [data-addition-text] {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.fl-play-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 0 0 12px;
}

.fl-play-seat {
  padding: 12px;
  text-align: center;
}

.fl-play-seat strong {
  display: block;
  color: var(--text-primary);
  font-weight: 600;
}

.fl-play-you {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--text-primary);
}

.fl-play-fold { margin: 8px 0 0; }

@media (min-width: 800px) {
  .fl-play-board {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr);
    align-items: stretch;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .fl-play-sky { animation: fl-play-sky 7.8s ease-in-out infinite; }
  .fl-play-card.fl-play-new { animation: fl-play-breath 2.6s ease-in-out 3; }
  .fl-play-seat.is-speaking { animation: fl-play-breath 2.6s ease-in-out infinite; }
}

@keyframes fl-play-breath {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); box-shadow: 0 0 16px var(--success); }
}

@keyframes fl-play-sky {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.9; }
}

@media (prefers-reduced-motion: reduce) {
  .fl-play-sky,
  .fl-play-card,
  .fl-play-seat,
  .fl-play-new,
  .fl-play-seat.is-speaking {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

/* While the Play Room is open, the update notice sits at the bottom, above the chat bar and clear of Send. Other rooms keep the house position. The page still fades it. Top does not slide, so the notice does not cross the header. */
body:has(#tab-play-room.active) #toast.toast,
body:has(#tab-play-room.active) #toast.toast.show {
  top: auto;
  bottom: 4.5rem;
  transition: opacity var(--transition-md), transform var(--transition-md);
}

@media (max-width: 600px) {
  body:has(#tab-play-room.active) #toast.toast,
  body:has(#tab-play-room.active) #toast.toast.show {
    /* One line, under the welcome line and above the leave buttons. */
    bottom: calc(100vh - 419px);
    width: auto;
    max-width: calc(100vw - 24px);
    padding: 8px 12px;
    line-height: 1.2;
    white-space: nowrap;
  }
}

/* At 640 by 400 the header, the tab bar, and the heading fill the width. The notice sits at the bottom right, beside the heading and clear of Send. */
@media (max-height: 420px) and (min-width: 601px) {
  body:has(#tab-play-room.active) #toast.toast,
  body:has(#tab-play-room.active) #toast.toast.show {
    top: auto;
    bottom: 0.25rem;
    left: auto;
    right: 8.5rem;
    width: auto;
    max-width: 16rem;
    padding: 8px 12px;
    line-height: 1.2;
    transform: none;
  }
}

@media (max-width: 420px) {
  .fl-play {
    padding-top: 20px;
    padding-right: 16px;
    padding-bottom: 112px;
    padding-left: 16px;
  }

  .fl-play-heading {
    box-sizing: border-box;
    padding-top: 12px;
    padding-right: 120px;
    max-width: 100%;
  }

  #fl-play-players h2 {
    box-sizing: border-box;
    padding-top: 8px;
    padding-right: 120px;
    padding-left: 56px;
    max-width: 100%;
  }
}
