/* Settings: bottom sheet on phones, right-hand panel on desktop. Game group (lobby only) + this-device group. */

.sheet {
  position: relative;
  width: 100%;
  max-height: 88%;
  display: flex;
  flex-direction: column;
  border-width: 1px 0 0;
  border-radius: 22px 22px 0 0;
  background: var(--glass-strong);
  animation: sheet-up 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.05) both;
}
.sheet::before {
  content: '';
  position: absolute;
  top: 8px; left: 50%;
  width: 44px; height: 4px;
  margin-left: -22px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
}
@keyframes sheet-up { from { transform: translateY(100%); } }

.sheet-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px max(18px, var(--safe-r)) 10px max(18px, var(--safe-l));
}
.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 6px max(18px, var(--safe-r)) calc(24px + var(--safe-b)) max(18px, var(--safe-l));
}
.sheet-note {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 204, 0, 0.1);
  border: 1px solid rgba(255, 204, 0, 0.35);
  color: #ffe9a3;
  font-size: 0.85rem;
}

.settings-group { display: flex; flex-direction: column; gap: 18px; }
.settings-group + .settings-group { padding-top: 18px; border-top: 1px solid var(--field-line); }
.settings-group-title {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-cyan);
}

.switch-list { display: flex; flex-direction: column; border-radius: 14px; border: 1px solid var(--field-line); overflow: hidden; }
.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 14px;
  border: 0;
  background: var(--field);
  text-align: left;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.switch-row + .switch-row { border-top: 1px solid var(--field-line); }
.switch-row:hover { background: rgba(255, 255, 255, 0.09); }
.switch-row:focus-visible { outline-offset: -3px; }
.switch-row-icon { font-size: 1.15rem; line-height: 1; }
.switch-row-label { flex: 1; min-width: 0; font-weight: 600; font-size: 0.95rem; }
/* Remembered but not audible on a remote: dimmed, still switchable. */
.switch-row.is-idle { opacity: 0.5; }
.switch {
  position: relative;
  flex: none;
  width: 46px; height: 28px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.16);
  transition: background 0.18s ease, box-shadow 0.18s ease;
}
.switch-knob {
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  transition: transform 0.18s cubic-bezier(0.3, 1.3, 0.5, 1);
}
.switch-row[aria-checked="true"] .switch { background: var(--c-cyan); box-shadow: 0 0 14px rgba(0, 240, 255, 0.5); }
.switch-row[aria-checked="true"] .switch-knob { transform: translateX(18px); }

.segment-plain { text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-size: 0.9rem; }

.api-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed rgba(0, 240, 255, 0.35);
  background: rgba(0, 240, 255, 0.04);
}
.api-box-title {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-cyan);
}
.api-box-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.api-status { font-size: 0.82rem; font-weight: 600; color: var(--c-dim); }
.api-status[data-state="ok"], .api-status[data-state="configured"], .api-status[data-state="cleared"] { color: var(--c-green); }
.api-status[data-state="badKey"] { color: var(--c-red); }
.api-status[data-state="badModel"] { color: var(--c-yellow); }

@media (orientation: landscape) and (min-width: 700px) {
  .sheet-wrap:not(.dialog-wrap) { align-items: stretch; justify-content: flex-end; }
  .sheet {
    width: min(460px, 92%);
    max-height: none;
    border-width: 0 0 0 1px;
    border-radius: 0;
    animation-name: sheet-side;
  }
  .sheet::before { display: none; }
  @keyframes sheet-side { from { transform: translateX(100%); } }
}

/* Host: the room's members, each with "remove" (spectators and players without a visible plate included). */
.member-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.member-row { --seat: var(--c-cyan); display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 4px 0; }
.member-row + .member-row { border-top: 1px solid var(--field-line); }
.member-avatar {
  width: 34px; height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--seat) 30%, #0a0b1c);
  box-shadow: 0 0 0 1.5px var(--seat);
  font-size: 1.15rem;
}
.member-name { flex: 1 1 auto; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-kick { flex: none; color: #ffb3c0; }

.segment[data-twists="all"].is-on { background: #b6ff3b; color: #0b1400; box-shadow: 0 0 18px rgba(182, 255, 59, 0.45); }

/* "Install the app" (CONTRACTS §13): a quiet row, only while the browser offers an install. */
.install-row { border-radius: 14px; border: 1px solid var(--field-line); }
.install-row .switch-row-label { display: flex; flex-direction: column; gap: 2px; }
.install-row-hint { font-size: 0.78rem; font-weight: 500; color: var(--c-dim); }
