/* Eix · vista mòbil */

body.view-mobil {
  font-size: 1.125rem;
  background: var(--paper-soft);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: #14213d;
  color: #ffffff;
}

.topbar-title {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.topbar-me {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.avatar-small {
  --avatar-size: 32px;
  box-shadow: 0 0 0 2px #ffffff;
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px;
}

main:focus {
  outline: none;
}

.panel {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 20px 16px 24px;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.15);
}

.panel h1 {
  font-size: 1.6rem;
  margin: 0 0 16px;
}

label,
legend {
  display: block;
  font-weight: 700;
  margin: 16px 0 4px;
}

.help {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: 1rem;
}

input[type="text"] {
  width: 100%;
  min-height: 56px;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  font-size: 1.25rem;
}

#code-input {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 1.6rem;
  font-weight: 700;
}

input[aria-invalid="true"] {
  border-color: var(--danger);
  border-width: 3px;
}

.error {
  color: var(--danger);
  font-weight: 700;
  margin: 8px 0 0;
}

.error::before {
  content: "⚠ ";
}

.notice {
  padding: 12px 14px;
  border-left: 6px solid var(--accent);
  background: #eff6ff;
  margin: 0 0 12px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  margin-top: 20px;
  padding: 12px 16px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  font-size: 1.25rem;
  font-weight: 700;
  background: #ffffff;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* ── Tria d'avatar ── */
.choice-set {
  border: 0;
  margin: 8px 0 0;
  padding: 0;
}

.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.choice {
  position: relative;
  margin: 0;
  font-weight: 600;
}

/* El botó de ràdio cobreix tota la targeta, invisible: s'hi pot tocar a qualsevol punt. */
.choice-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.choice-input:disabled {
  cursor: not-allowed;
}

.choice-body {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
}

.choice input:checked + .choice-body {
  border-color: var(--accent);
  border-width: 4px;
  background: #eff6ff;
}

.choice input:checked + .choice-body .choice-text::after {
  content: " ✓";
}

.choice input:focus-visible + .choice-body {
  outline: 4px solid var(--focus);
  outline-offset: 2px;
}

.choice.is-taken .choice-body {
  border-style: dashed;
  color: var(--ink-soft);
  background: var(--paper-soft);
  cursor: not-allowed;
}

.choice.is-taken .choice-icon,
.choice.is-taken .choice-swatch {
  opacity: 0.45;
}

.choice-taken {
  font-weight: 400;
  font-style: italic;
}

.choice-icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  color: var(--ink);
}

.choice-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.choice-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--swatch);
  border: 2px solid var(--ink);
  flex: none;
}

.preview {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  margin-top: 16px;
  font-weight: 700;
}

.avatar-preview {
  --avatar-size: 56px;
}

/* ── Dins la sala ── */
.hello {
  margin: 0 0 8px;
  font-weight: 700;
  color: var(--ink-soft);
}

.avatar-hero {
  --avatar-size: 96px;
  margin: 8px 0 16px;
  box-shadow: 0 0 0 3px var(--ink);
}

.big-message {
  font-size: 1.3rem;
  font-weight: 600;
}

.muted {
  color: var(--ink-soft);
}

.eyebrow {
  margin: 0 0 6px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.95rem;
}

.options {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.btn-option {
  justify-content: flex-start;
  margin-top: 0;
  text-align: left;
  font-size: 1.35rem;
}

.btn-option .option-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 2px solid currentColor;
  border-radius: 50%;
  flex: none;
  font-size: 1.3rem;
}

.btn-option .option-text {
  flex: 1;
}

.btn-option .option-state {
  font-size: 1rem;
  font-weight: 700;
}

.btn-option.is-chosen {
  background: #14213d;
  border-color: #14213d;
  color: #ffffff;
  border-width: 4px;
}

.status {
  min-height: 1.5em;
  margin: 16px 4px 0;
  font-weight: 700;
}

.status:empty {
  margin: 0;
}
