/* Musvisto · Styles of the account, groups and player screens (login, welcome, new group, join, invite,
   members, home, more, rules, group settings, players, player, me). Colours only through app.css variables. */

/* Shared bits */
.ico { width: 22px; height: 22px; flex: none; display: block; }
.chev { width: 20px; height: 20px; color: var(--ink-soft); }
.button .ico { width: 24px; height: 24px; margin-right: 10px; }
.button.small .ico { width: 20px; height: 20px; margin-right: 8px; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); margin-top: 16px; }
.stack.tight { gap: 8px; margin-top: 0; }
.back { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 4px; font-weight: 600; text-decoration: none; }
.legend.j { margin-top: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.you { font-weight: 400; color: var(--ink-soft); font-size: 14px; }
.pill.static { cursor: default; min-height: 32px; padding: 0 12px; font-size: 14px; color: var(--ink-soft); }
.row-actions.one { grid-template-columns: minmax(0, 1fr); }
.row-actions.tight { margin: 0; padding: 0 16px 12px; }
.view > header h1 { font-size: clamp(30px, 8.5vw, 40px); }
.view > header p { text-wrap: pretty; }
.clamp1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }

/* Forms: fieldsets that look like fields, choice pills, swatches, templates */
fieldset.field.plain { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
fieldset.field.plain > legend { padding: 0; margin-bottom: 8px; font-size: 15px; font-weight: 600; }
fieldset.field.plain > small { display: block; margin-top: 8px; color: var(--ink-soft); font-size: 14px; }
.field select { appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.choice5 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choice, .avatar-opt, .swatch, .template { position: relative; display: block; cursor: pointer; }
.choice input, .avatar-opt input, .swatch input, .template input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.choice span { display: flex; align-items: center; justify-content: center; height: 48px; padding: 0 6px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface); font-size: clamp(14px, 3.9vw, 16px); font-weight: 600; text-align: center; }
.choice input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.choice input:focus-visible + span, .swatch input:focus-visible + span, .template input:focus-visible + span,
.avatar-opt input:focus-visible + img { outline: 2px solid var(--focus); outline-offset: 2px; }
.choice input:disabled + span, .swatch input:disabled + span { opacity: 0.6; cursor: default; }
.swatches { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; max-width: 360px; }
.swatch span { display: block; aspect-ratio: 1; min-height: 44px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 3px var(--surface); border: 2px solid transparent; }
.swatch input:checked + span { border-color: var(--ink); }
.templates { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.template span { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 84px; padding: 12px 16px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.template b { font-weight: 600; }
.template small { color: var(--ink-soft); font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.template input:checked + span { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.crest-row { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.crest-actions { display: grid; gap: 8px; }
.segments.two, .segments.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.segments.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: none; }
fieldset.field.plain .segments { margin: 0; max-width: none; }
.segments input:disabled + span { opacity: 0.7; }
.prefs { display: grid; gap: 20px; }

/* Sign-in and join */
.view.auth { max-width: 480px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 24px 0 8px;
  font-family: "Bricolage Grotesque", system-ui, sans-serif; font-weight: 600; font-size: 22px; }
.auth-brand img { width: 40px; height: 40px; border-radius: 10px; }
.auth-head { margin: 24px 0 20px; text-align: center; }
.auth-head .crest { margin: 0 auto 16px; }
.auth-head h1 { font-size: clamp(30px, 8.5vw, 40px); }
.auth-head p { margin: 0 auto; max-width: 34ch; color: var(--ink-soft); text-wrap: pretty; }
.auth .notice { margin: 0 0 16px; }
.auth .card + .button, .auth .card + .row-actions { margin-top: 16px; }
.auth .button.big + .button.big { margin-top: var(--gap); }
.code-input { text-align: center; font-size: 28px !important; letter-spacing: 0.3em; font-variant-numeric: tabular-nums; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--ink-soft); font-size: 14px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-note { margin: 8px 4px 0; font-size: 14px; color: var(--ink-soft); text-align: center; text-wrap: pretty; }
.auth-demo { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.auth-demo .button { padding: 8px 6px; font-size: clamp(14px, 3.9vw, 16px); }
.auth-lang { margin-top: 32px; }
.list-row.as-button { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.list-row.card.plain { padding: 10px 16px; border-radius: var(--radius); }

/* Invite */
.qr-card { display: flex; flex-direction: column; align-items: center; text-align: center; }
.qr { width: min(240px, 70vw); aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #fff; }
.qr svg { display: block; width: 100%; height: 100%; }
.link-text { margin: 8px 0 0; max-width: 100%; font-size: 14px; color: var(--ink-soft); overflow-wrap: anywhere; user-select: all; }
.button.wa { background: #1f7a4a; color: #fff; }

/* Members */
.request { padding-bottom: 4px; }
.list-row.flat { min-height: 64px; }
.role-pick select { min-height: 44px; max-width: 9.5em; padding: 6px 32px 6px 12px; border: 1px solid var(--line); border-radius: 12px;
  background-color: var(--surface); color: var(--ink); font: inherit; font-size: 15px; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }

/* Home */
.home-actions { display: grid; gap: var(--gap); margin-top: 8px; }
.button.hero { min-height: 88px; font-size: clamp(22px, 6.4vw, 26px); border-radius: 24px; }
.button.hero .ico { width: 30px; height: 30px; }
.button.tall { flex-direction: column; gap: 6px; height: 96px; padding: 10px 8px; font-size: clamp(15px, 4.2vw, 17px); line-height: 1.2; }
.button.tall .ico { margin: 0; }
.tile b.clamp1 { font-size: clamp(17px, 5vw, 22px); line-height: 1.15; }
.ico-box { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--stone); color: var(--accent); }
:root[data-tema="oscuro"] .ico-box { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
@media (prefers-color-scheme: dark) { :root:not([data-tema="claro"]) .ico-box { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); } }
.game-row { display: grid; grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr); align-items: center; gap: 8px; height: 76px;
  padding: 8px 14px; color: var(--ink); text-decoration: none; }
.game-row .side { display: grid; gap: 2px; min-width: 0; }
.game-row .side b { font-weight: 400; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.game-row .side.b { text-align: right; }
.game-row .side.won b { font-weight: 700; }
.game-row .side.a.won b { color: var(--accent); }
.game-row .side.b.won b { color: var(--pair-b); }
.game-row .mid { display: grid; justify-items: center; text-align: center; }
.game-row .mid b { font-size: 18px; font-variant-numeric: tabular-nums; }
.game-row .mid small { font-size: 13px; color: var(--ink-soft); }

/* More */
.more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.more-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 92px; padding: 8px 4px;
  border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; text-align: center; }
.more-tile .ico { width: 26px; height: 26px; color: var(--accent); }
.more-tile span { font-size: clamp(13px, 3.7vw, 15px); font-weight: 600; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Player */
.profile-head { display: flex; flex-direction: column; align-items: center; text-align: center; }
.profile-head .avatar.lg { width: 112px; height: 112px; margin: 8px 0 12px; }
.profile-head h1 { margin-bottom: 4px; overflow-wrap: anywhere; }
.pill-row.center { justify-content: center; margin-top: 8px; }
.bio { margin: 16px 0 0; }
.results { list-style: none; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; margin: 0; padding: 0; }
.res { display: grid; place-items: center; height: 36px; border-radius: 10px; font-size: 14px; font-weight: 700; background: var(--surface); color: var(--ink-soft); }
.res.G { background: var(--accent); color: var(--accent-ink); }
.res.P { background: color-mix(in srgb, var(--pair-b) 18%, var(--surface)); color: var(--pair-b); }
.photo-row { display: flex; align-items: center; gap: 16px; margin: 8px 0 16px; }
.avatar-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.avatar-opt img { display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: 50%; border: 3px solid transparent; }
.avatar-opt input:checked + img { border-color: var(--accent); }
.sheet h2 { margin-bottom: 16px; }
.tile b { white-space: nowrap; }
.tile b.clamp1 { white-space: normal; }
@media (max-width: 380px) { .grid3 .tile b { font-size: 23px; } }
