body.player .player-main { max-width: 540px; margin: 0 auto; padding: 12px; }

/* Team-tinted body: mix the team color at low opacity into the normal purple
   gradient. Stays dark enough that white text reads cleanly. */
body.team-tinted {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--team-color, #4b2eaa) 25%, var(--bg-1)) 0%,
    color-mix(in srgb, var(--team-color, #4b2eaa) 15%, var(--bg-2)) 100%);
}

/* Team color swatches in settings drawer. */
.swatch-row { display: flex; flex-direction: column; gap: 6px; padding: 6px 0; }
.swatch-label { color: var(--dim); font-size: 0.85rem; }
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  max-width: 100%;
}
button.swatch {
  width: 100%;
  aspect-ratio: 1;
  min-height: 28px;
  padding: 0;
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.08s;
}
button.swatch:hover:not(:disabled) { transform: scale(1.1); }
button.swatch.selected {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.35), 0 0 12px rgba(255,255,255,0.4);
}
button.swatch:disabled { opacity: 0.45; cursor: not-allowed; }
.mini-status {
  display: flex; justify-content: space-between; gap: 10px;
  color: var(--dim); font-size: 0.9rem; margin-bottom: 10px;
}
.mini-status strong { color: var(--fg); }
.active-banner {
  background: var(--panel-solid); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px; text-align: center; font-size: 1.1rem;
}

.guesser-hint { margin-top: 12px; text-align: center; }
.phone-timer { font-size: 2.6rem; font-weight: 800; margin-top: 10px; }
.phone-timer.warning { color: var(--danger); }
.big-timer { font-size: 3.2rem; }

.card-view {
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  color: #211a04; border-radius: 16px; padding: 24px;
  margin: 10px 0; text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.card-topic { text-transform: uppercase; letter-spacing: 0.1em; color: #64748b; font-weight: 700; font-size: 0.9rem; }
.card-subject { font-size: 2.4rem; font-weight: 900; margin: 10px 0; line-height: 1.15; }
.card-mode { color: #64748b; font-weight: 700; }

#rolledFace, #performMode { font-weight: 800; }
.mode-SHOW #rolledFace, .mode-SHOW #performMode { color: var(--show); }
.mode-ONE_SYLLABLE #rolledFace, .mode-ONE_SYLLABLE #performMode { color: var(--one-syllable); }
.mode-FREESTYLE #rolledFace, .mode-FREESTYLE #performMode { color: var(--freestyle); }

/* --- slot picker --- */
#slotPicker .row { flex-direction: column; align-items: stretch; gap: 10px; }
.slot-btn { width: 100%; padding: 16px 20px; font-size: 1.1rem; text-align: left; }
button.slot-btn.ghost { color: var(--fg); opacity: 0.75; }
button.slot-btn.ghost::after { content: ' \2014 switch here'; color: var(--dim); font-weight: 400; }

/* --- players roster (used both in lobby and in the drawer) --- */
.players-mini { display: flex; gap: 8px; flex-wrap: wrap; }
.players-mini .pm {
  background: var(--panel-solid); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; font-size: 0.95rem; cursor: pointer;
  transition: filter 0.1s;
}
.players-mini .pm:hover { filter: brightness(1.2); }
.players-mini .pm.active { outline: 2px solid var(--accent); }
.players-mini .pm.ready { border-color: var(--good); }
.players-mini .pm .ptname { font-weight: 700; }
.players-mini .pm .ptteam { color: var(--dim); font-size: 0.8rem; margin-left: 6px; }

/* --- topbar right (room code + gear) --- */
button.gear {
  background: transparent;
  border: 1px solid var(--border);
  padding: 6px 12px;
  font-size: 1.3rem;
  line-height: 1;
  border-radius: 8px;
}
button.gear:hover { background: rgba(255,255,255,0.08); }

/* --- settings drawer --- */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0,0,0,0.5);
  opacity: 0; transition: opacity 0.2s;
}
.drawer-backdrop.open { opacity: 1; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 91;
  width: min(420px, 100vw);
  background: var(--panel-solid);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 20px rgba(0,0,0,0.5);
  padding: 0;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--panel-solid); z-index: 1;
}
.drawer-head h2 { margin: 0; }
.drawer-head button { padding: 6px 12px; font-size: 1.2rem; }

.drawer-card {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.drawer-card h3 { color: var(--accent); font-size: 0.95rem; margin-bottom: 10px; }
.drawer-card label {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 6px 0;
}
.drawer-card label input[type=text],
.drawer-card label input[type=number],
.drawer-card label select { width: 160px; max-width: 60%; }
.drawer-card .row { margin-top: 10px; }
.drawer-card a.link { margin-left: auto; align-self: center; }
.drawer-card button { flex-shrink: 0; }
