/* ===========================================================
   CARIOCA — Tema "Mesa de Carioca"
   Paño verde + oro + cartas crema + serif elegante.
   =========================================================== */
:root {
  --serif: ui-serif, "New York", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Paño (fondo) */
  --felt-base: #0e5c3a;
  --felt-top: rgba(255, 255, 255, 0.10);
  --felt-vignette: rgba(0, 0, 0, 0.34);

  /* Texto sobre el paño */
  --on-felt: #f4ecd6;
  --on-felt-dim: rgba(244, 236, 214, 0.72);
  --on-felt-faint: rgba(244, 236, 214, 0.45);

  /* Cartas (superficies) */
  --card: #f6eedd;
  --card-2: #ece0c4;
  --card-edge: rgba(255, 255, 255, 0.65);
  --ink: #2a2419;
  --ink-2: #6f6249;
  --ink-3: #a89a7c;
  --separator: rgba(60, 50, 28, 0.14);

  /* Acentos */
  --gold: #b98b2e;          /* oro legible sobre crema */
  --gold-bright: #e7b85c;   /* oro sobre paño */
  --gold-grad-a: #ecc878;
  --gold-grad-b: #cf9f3e;
  --tinto: #b0322b;
  --tinto-soft: rgba(176, 50, 43, 0.12);

  --navbar-bg: rgba(9, 58, 38, 0.72);
  --tabbar-bg: rgba(9, 58, 38, 0.82);
  --radius: 20px;
  --radius-sm: 13px;
  --navbar-h: 50px;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.18), 0 10px 28px rgba(0,0,0,0.20);
}

@media (prefers-color-scheme: dark) {
  :root {
    --felt-base: #08311f;
    --felt-top: rgba(255, 255, 255, 0.05);
    --felt-vignette: rgba(0, 0, 0, 0.55);

    --card: #16271d;
    --card-2: #1f3327;
    --card-edge: rgba(255, 255, 255, 0.06);
    --ink: #f1e7cf;
    --ink-2: rgba(241, 231, 207, 0.66);
    --ink-3: rgba(241, 231, 207, 0.40);
    --separator: rgba(241, 231, 207, 0.13);

    --gold: #e7b85c;
    --gold-bright: #f0c674;
    --navbar-bg: rgba(6, 33, 21, 0.78);
    --tabbar-bg: rgba(6, 33, 21, 0.86);
    --shadow-card: 0 1px 2px rgba(0,0,0,0.4), 0 12px 30px rgba(0,0,0,0.45);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--on-felt);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.35;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
  background-color: var(--felt-base);
  background-image:
    radial-gradient(130% 80% at 50% -10%, var(--felt-top), rgba(0,0,0,0) 60%),
    radial-gradient(120% 120% at 50% 115%, var(--felt-vignette), rgba(0,0,0,0) 55%);
  background-attachment: fixed;
  min-height: 100vh;
}

button { font-family: inherit; cursor: pointer; color: inherit; }
input { font-family: inherit; }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 4px;
  min-height: var(--navbar-h);
  padding: calc(env(safe-area-inset-top)) 8px 0;
  background: var(--navbar-bg);
  backdrop-filter: saturate(160%) blur(20px);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  border-bottom: 0.5px solid rgba(231, 184, 92, 0.22);
}
.nav-title {
  text-align: center;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.01em;
  color: var(--on-felt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 4px;
  min-height: var(--navbar-h);
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-side { display: flex; align-items: center; min-height: var(--navbar-h); }
.nav-side.right { justify-content: flex-end; }
.nav-btn {
  background: none; border: 0;
  color: var(--gold-bright);
  font-size: 17px; padding: 8px;
  display: inline-flex; align-items: center; gap: 3px;
  border-radius: 10px;
  transition: transform .12s ease, opacity .12s ease;
}
.nav-btn:active { transform: scale(0.92); opacity: 0.6; }
.nav-btn.strong { font-weight: 600; }
.nav-btn:disabled { color: var(--on-felt-faint); }
.nav-btn svg { width: 24px; height: 24px; display: block; }
.nav-btn.icon { padding: 6px; }

/* ---------- Content ---------- */
.content {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: calc(env(safe-area-inset-bottom) + 96px);
}
.section-title {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--gold-bright);
  margin: 24px 6px 9px;
}
.hint { color: var(--on-felt-dim); font-size: 14px; margin: 12px 6px 0; }
.detail-line { color: var(--ink-2); font-size: 14px; padding: 4px 16px 12px; }

/* Animación de entrada (suave, respeta accesibilidad) */
@media (prefers-reduced-motion: no-preference) {
  .content > * { animation: riseIn .4s cubic-bezier(.2,.7,.3,1) both; }
  .content > *:nth-child(2) { animation-delay: .04s; }
  .content > *:nth-child(3) { animation-delay: .08s; }
  .content > *:nth-child(4) { animation-delay: .12s; }
  .content > *:nth-child(5) { animation-delay: .16s; }
  @keyframes riseIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}

/* ---------- Tarjetas ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  color: var(--ink);
  box-shadow: var(--shadow-card);
  border-top: 1px solid var(--card-edge);
}
.list {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--ink);
  box-shadow: var(--shadow-card);
  border-top: 1px solid var(--card-edge);
}
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; position: relative; width: 100%;
  text-align: left; background: none; border: 0; color: inherit; font-size: 17px;
  transition: background .15s ease;
}
.row + .row::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0;
  border-top: 0.5px solid var(--separator);
}
.row.tappable:active { background: var(--card-2); }
.row .grow { flex: 1; min-width: 0; }
.row .chevron { color: var(--ink-3); font-size: 20px; font-family: var(--serif); }
.row .value { color: var(--ink-2); }
.row .lead-accent { color: var(--gold); }

h2.card-h { font-family: var(--serif); font-size: 21px; margin: 0 0 12px; color: var(--ink); font-weight: 600; }

/* ---------- Tarjeta de partida (home) ---------- */
.game-card {
  display: block; width: 100%; text-align: left;
  background: var(--card); color: var(--ink);
  border: 0; border-top: 1px solid var(--card-edge);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px;
  box-shadow: var(--shadow-card);
  transition: transform .14s ease, box-shadow .14s ease;
}
.game-card:active { transform: scale(0.985); }
.game-card .gc-head { display: flex; align-items: flex-start; gap: 10px; }
.game-card .gc-title { font-family: var(--serif); font-weight: 600; font-size: 19px; flex: 1; min-width: 0; }
.game-card .gc-sub { color: var(--ink-2); font-size: 13px; margin-top: 4px; }
.dots { display: flex; align-items: center; gap: 5px; margin-top: 11px; flex-wrap: wrap; }
.dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(0,0,0,0.06) inset; flex: 0 0 auto; }
.dot-name { font-size: 12.5px; color: var(--ink-2); margin-left: 2px; }
.gc-leader { display: flex; align-items: center; gap: 6px; margin-top: 11px; font-size: 13.5px; color: var(--ink-2); }
.gc-leader .crown { color: var(--gold); }
.badge-done {
  font-size: 11px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  color: #3c2f10; background: linear-gradient(180deg, var(--gold-grad-a), var(--gold-grad-b));
  padding: 3px 9px; border-radius: 20px; white-space: nowrap; flex: 0 0 auto;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.progress-track { height: 6px; background: var(--card-2); border-radius: 6px; margin-top: 12px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold-grad-a), var(--gold-grad-b)); border-radius: 6px; transition: width .5s cubic-bezier(.2,.7,.3,1); }

/* ---------- Standings ---------- */
.standings-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.standings-head h2 { font-family: var(--serif); font-size: 22px; margin: 0; color: var(--ink); font-weight: 600; }
.standings-head .meta { color: var(--ink-2); font-size: 13px; }
.stand-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; position: relative; }
.stand-row + .stand-row { border-top: 0.5px solid var(--separator); }
.rank {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 14px; font-weight: 700; flex: 0 0 auto;
  color: #2a2008;
}
.rank.r0 { background: linear-gradient(180deg, #f0d27e, #cf9f3e); }
.rank.r1 { background: linear-gradient(180deg, #e4e4ea, #b9bcc6); }
.rank.r2 { background: linear-gradient(180deg, #e2b07e, #b87a44); color: #fff; }
.rank.rn { background: var(--card-2); color: var(--ink-2); }
.stand-dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; }
.stand-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.stand-name.lead { font-weight: 600; }
.stand-pts { font-family: var(--serif); font-size: 21px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.stand-pts .u { font-family: var(--sans); color: var(--ink-3); font-weight: 400; font-size: 12px; margin-left: 3px; }
.winner-banner {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(231,184,92,0.18), rgba(231,184,92,0.08));
  border: 1px solid rgba(185,139,46,0.35);
  color: var(--gold); font-weight: 700; font-family: var(--serif); font-size: 16px;
  display: flex; align-items: center; gap: 8px;
}
@media (prefers-reduced-motion: no-preference) {
  .winner-banner { animation: glow 2.6s ease-in-out infinite; }
  @keyframes glow {
    0%,100% { box-shadow: 0 0 0 rgba(231,184,92,0); }
    50% { box-shadow: 0 0 18px rgba(231,184,92,0.30); }
  }
}

/* ---------- Tabla de puntaje ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; margin: 0 -2px; }
.score-table { border-collapse: collapse; width: 100%; }
.score-table th, .score-table td {
  padding: 11px 8px; text-align: center; font-size: 15px;
  border-bottom: 0.5px solid var(--separator);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.score-table thead th { font-size: 11px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.03em; }
.score-table thead .ph { display: inline-flex; align-items: center; gap: 5px; }
.score-table thead .ph .dot { width: 9px; height: 9px; }
.score-table th.round, .score-table td.round {
  position: sticky; left: 0; z-index: 1; background: var(--card);
  text-align: left; min-width: 152px; max-width: 184px;
}
.score-table tbody tr.round-row { cursor: pointer; }
.score-table tbody tr.round-row:active td, .score-table tbody tr.round-row:active th.round { background: var(--card-2); }
.round-cell { display: flex; align-items: center; gap: 8px; }
.round-num { color: var(--ink-3); font-family: var(--serif); font-size: 13px; font-weight: 700; min-width: 16px; }
.round-name { overflow: hidden; text-overflow: ellipsis; font-weight: 500; color: var(--ink); }
.round-cell .pencil { color: var(--ink-3); margin-left: auto; flex: 0 0 auto; }
.round-cell .pencil.add { color: var(--gold); }
.round-cell .pencil svg { width: 16px; height: 16px; display: block; }
.cell-empty { color: var(--ink-3); }
.col-lead { background: rgba(231, 184, 92, 0.12); }
.col-lead.head { color: var(--gold) !important; }
.score-table tr.total-row th, .score-table tr.total-row td {
  font-family: var(--serif); font-weight: 700; font-size: 17px;
  border-bottom: none; border-top: 1.5px solid var(--separator); color: var(--ink);
}

/* ---------- Gráfico de evolución ---------- */
.chart-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 12px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.legend-item .dot { width: 10px; height: 10px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axis { stroke: var(--separator); stroke-width: 1; }
.chart .grid { stroke: var(--separator); stroke-width: 1; stroke-dasharray: 2 4; }
.chart .axis-label { fill: var(--ink-3); font-size: 9px; font-family: var(--sans); }
@media (prefers-reduced-motion: no-preference) {
  .chart polyline { stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: draw 1.1s ease forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
}

/* ---------- Botones ---------- */
.btn {
  display: block; width: 100%; padding: 15px; border: 0; border-radius: 15px;
  font-size: 17px; font-weight: 700; margin-top: 12px;
  color: #34280b; background: linear-gradient(180deg, var(--gold-grad-a), var(--gold-grad-b));
  box-shadow: 0 2px 8px rgba(0,0,0,0.22); transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(0.98); opacity: 0.92; }
.btn:disabled { opacity: 0.45; }
.btn.secondary {
  background: var(--card); color: var(--gold);
  border: 1px solid rgba(185,139,46,0.4); box-shadow: var(--shadow-card);
}
.btn.danger { background: var(--card); color: var(--tinto); border: 1px solid rgba(176,50,43,0.35); box-shadow: var(--shadow-card); }
.btn.ghost { background: rgba(244,236,214,0.10); color: var(--on-felt); box-shadow: none; border: 1px solid var(--on-felt-faint); }

/* ---------- Formularios ---------- */
.field { display: flex; align-items: center; gap: 10px; padding: 13px 16px; position: relative; }
.field + .field::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 0.5px solid var(--separator); }
.field input[type="text"], .field input[type="number"] {
  flex: 1; min-width: 0; border: 0; background: none; color: var(--ink);
  font-size: 17px; padding: 2px 0; outline: none;
}
.field input::placeholder { color: var(--ink-3); }
.field .num {
  flex: 0 0 auto; width: 92px; text-align: right; font-variant-numeric: tabular-nums;
  background: var(--card-2); border-radius: 10px; padding: 9px 11px;
  font-family: var(--serif); font-size: 18px; font-weight: 600;
}
.field .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 9px; color: var(--ink); }
.field .u { color: var(--ink-2); font-size: 15px; }
.field .add-row { color: var(--gold); }
.round-edit { display: flex; flex-direction: column; gap: 4px; padding: 11px 12px; position: relative; }
.round-edit + .round-edit::before { content: ""; position: absolute; top: 0; left: 12px; right: 0; border-top: 0.5px solid var(--separator); }
.round-edit input.name { font-size: 17px; font-weight: 500; border: 0; background: none; color: var(--ink); outline: none; padding: 2px 0; }
.round-edit input.detail { font-size: 14px; color: var(--ink-2); border: 0; background: none; outline: none; padding: 2px 0; }
.round-edit-row { display: flex; align-items: flex-start; gap: 8px; }
.move-btns { display: flex; flex-direction: column; gap: 3px; flex: 0 0 auto; }
.move-btns button { background: var(--card-2); border: 0; color: var(--gold); width: 32px; height: 25px; border-radius: 8px; font-size: 12px; }
.move-btns button:disabled { color: var(--ink-3); }
.icon-btn { background: none; border: 0; color: var(--ink-3); padding: 8px; border-radius: 10px; display: inline-flex; align-items: center; transition: transform .12s ease; }
.icon-btn:active { transform: scale(0.85); }
.icon-btn.danger { color: var(--tinto); }
.icon-btn svg { width: 20px; height: 20px; display: block; }

/* ---------- Estadísticas ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat-tile { background: var(--card); border-radius: var(--radius-sm); padding: 15px 16px; box-shadow: var(--shadow-card); border-top: 1px solid var(--card-edge); }
.stat-tile .big { font-family: var(--serif); font-size: 30px; font-weight: 700; color: var(--ink); line-height: 1; }
.stat-tile .lbl { color: var(--ink-2); font-size: 12.5px; margin-top: 6px; }
.lead-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; }
.lead-row + .lead-row { border-top: 0.5px solid var(--separator); }
.lead-main { flex: 1; min-width: 0; }
.lead-name { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); }
.lead-sub { color: var(--ink-2); font-size: 12.5px; margin-top: 3px; }
.lead-wins { text-align: right; flex: 0 0 auto; }
.lead-wins .n { font-family: var(--serif); font-size: 20px; font-weight: 700; color: var(--ink); }
.lead-wins .l { color: var(--ink-3); font-size: 11px; }
.winbar { height: 5px; background: var(--card-2); border-radius: 5px; margin-top: 7px; overflow: hidden; max-width: 160px; }
.winbar > div { height: 100%; background: linear-gradient(90deg, var(--gold-grad-a), var(--gold-grad-b)); }

/* ---------- Estado vacío ---------- */
.empty { text-align: center; padding: 54px 26px 20px; }
.empty .glyph { font-size: 60px; filter: drop-shadow(0 6px 12px rgba(0,0,0,0.3)); }
.empty h2 { font-family: var(--serif); font-size: 24px; margin: 16px 0 6px; color: var(--on-felt); }
.empty p { color: var(--on-felt-dim); margin: 0 auto 22px; max-width: 320px; }
.empty .btn { max-width: 300px; margin-left: auto; margin-right: auto; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: space-around; align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--tabbar-bg);
  backdrop-filter: saturate(160%) blur(20px);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  border-top: 0.5px solid rgba(231, 184, 92, 0.22);
}
.tab {
  flex: 1; background: none; border: 0; color: var(--on-felt-faint);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 0 7px; font-size: 11px; font-weight: 600;
  transition: color .15s ease, transform .12s ease;
}
.tab:active { transform: scale(0.94); }
.tab svg { width: 25px; height: 25px; display: block; }
.tab.on { color: var(--gold-bright); }

/* ---------- Marca / hero / ilustración ---------- */
.hero { text-align: center; padding: 12px 16px 6px; }
.hero.slim { padding: 4px 16px 8px; }
.illus-fan { width: 168px; height: auto; display: block; margin: 0 auto; }
.hero.slim .illus-fan { width: 92px; }
.empty .illus-fan { width: 184px; margin-bottom: 4px; }
.wordmark { font-family: var(--serif); font-weight: 700; font-size: 34px; letter-spacing: 0.01em; color: var(--on-felt); margin: 14px 0 2px; }
.tagline { color: var(--on-felt-dim); font-size: 14.5px; margin: 4px 0 0; }

/* Adorno de pintas (estilo Lira Popular) */
.flourish { display: flex; align-items: center; justify-content: center; gap: 11px; margin: 14px 0 4px; color: var(--gold-bright); font-size: 16px; }
.flourish span { line-height: 1; }
.flourish .r { color: var(--tinto); }
.flourish::before, .flourish::after { content: ""; height: 1px; width: 40px; background: linear-gradient(90deg, transparent, var(--gold-bright)); opacity: 0.55; }
.flourish::before { transform: scaleX(-1); }
.card .flourish { color: var(--gold); }
.card .flourish::before, .card .flourish::after { background: linear-gradient(90deg, transparent, var(--gold)); }

/* ---------- Avatares (inicial + color del jugador) ---------- */
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 700; font-size: 14px; color: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.28), 0 1px 2px rgba(0,0,0,0.2);
  text-shadow: 0 1px 1px rgba(0,0,0,0.25);
}
.avatar.sm { width: 26px; height: 26px; font-size: 12px; }
.avatar.lg { width: 38px; height: 38px; font-size: 17px; }

/* ---------- Brillo dorado del ganador ---------- */
.winner-banner .wb {
  background: linear-gradient(90deg, var(--gold), #f3d585, var(--gold));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
@media (prefers-reduced-motion: no-preference) {
  .winner-banner .wb { background-size: 200% auto; animation: shimmer 3s linear infinite; }
  @keyframes shimmer { to { background-position: 200% center; } }
}

/* ---------- v3: marca de agua, orla, confeti, emojis, sonido ---------- */
.felt-pattern { position: fixed; inset: 0; z-index: -1; color: var(--on-felt); opacity: 0.05; pointer-events: none; }
.felt-pattern svg { width: 100%; height: 100%; display: block; }

.confetti-canvas { position: fixed; inset: 0; z-index: 100; pointer-events: none; }

/* Orla tipo naipe en las tarjetas */
.card, .game-card { position: relative; }
.card::after, .game-card::after {
  content: ""; position: absolute; inset: 7px; border-radius: 13px;
  border: 1px solid rgba(185, 139, 46, 0.30); pointer-events: none;
}
@media (prefers-color-scheme: dark) {
  .card::after, .game-card::after { border-color: rgba(231, 184, 92, 0.22); }
}

/* Avatar con emoji */
.avatar.has-emoji { font-size: 16px; text-shadow: none; }
.avatar.sm.has-emoji { font-size: 13px; }
.avatar.lg.has-emoji { font-size: 20px; }
.avatar-btn { background: none; border: 0; padding: 0; flex: 0 0 auto; border-radius: 50%; transition: transform .12s ease; }
.avatar-btn:active { transform: scale(0.88); }

/* Selector de emoji */
.emoji-picker { display: flex; flex-wrap: wrap; gap: 7px; padding: 4px 16px 14px; }
.emoji-opt {
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--separator);
  background: var(--card-2); font-size: 20px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--gold); font-family: var(--serif); font-weight: 700; transition: transform .1s ease;
}
.emoji-opt:active { transform: scale(0.88); }

/* ---------- v4: acciones, color, cara a cara, racha ---------- */
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.btn-grid .btn { margin-top: 0; }

.color-dot-btn { background: none; border: 0; padding: 6px; flex: 0 0 auto; border-radius: 50%; transition: transform .12s ease; }
.color-dot-btn:active { transform: scale(0.85); }
.color-picker { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 16px 14px; }
.color-swatch {
  width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid transparent;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.3), 0 1px 2px rgba(0,0,0,0.2);
  transition: transform .1s ease;
}
.color-swatch.on { border-color: var(--gold); }
.color-swatch:active { transform: scale(0.85); }

.h2h-controls { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.h2h-sel {
  flex: 1; min-width: 0; background: var(--card-2); color: var(--ink);
  border: 1px solid var(--separator); border-radius: 10px; padding: 10px;
  font-size: 15px; font-family: var(--sans); -webkit-appearance: none; appearance: none;
}
.h2h-vs { color: var(--gold); font-family: var(--serif); font-weight: 700; font-size: 16px; }
.h2h-result { display: flex; align-items: center; }
.h2h-side { flex: 1; text-align: center; }
.h2h-side .n { font-family: var(--serif); font-size: 30px; font-weight: 700; color: var(--ink); }
.h2h-side .l { color: var(--ink-2); font-size: 12.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h2h-mid { flex: 0 0 auto; color: var(--ink-3); font-size: 12px; padding: 0 8px; text-align: center; }
.streak { color: var(--tinto); font-weight: 700; }

/* ---------- v5: familia, chips, perfil, logros ---------- */
.roster-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--card); border: 1px solid rgba(185, 139, 46, 0.3); border-radius: 22px;
  padding: 5px 13px 5px 5px; color: var(--ink); box-shadow: var(--shadow-card);
  font-size: 14.5px; font-weight: 500; transition: transform .1s ease;
}
.chip:active { transform: scale(0.93); }

.profile-head { display: flex; align-items: center; gap: 14px; }
.profile-head .profile-name {
  flex: 1; min-width: 0; border: 0; background: none; color: var(--ink);
  font-family: var(--serif); font-size: 24px; font-weight: 700; outline: none; padding: 2px 0;
}

.badges { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.badge { background: var(--card-2); border-radius: 13px; padding: 14px 12px 13px; text-align: center; }
.badge-ic { font-size: 30px; line-height: 1; }
.badge-t { font-weight: 700; color: var(--ink); font-size: 14px; margin-top: 7px; }
.badge-d { color: var(--ink-2); font-size: 11.5px; margin-top: 3px; line-height: 1.3; }
.badge.locked { opacity: 0.42; filter: grayscale(0.85); }
