/* Control del dueño (iPhone) — mobile first */
.remote {
  min-height: 100dvh;
  padding: max(12px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  max-width: 560px; margin-inline: auto;
  font-size: 16px;
}

.r-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.r-logo { height: 64px; width: auto; }
.r-head { flex-wrap: nowrap; }
.r-head .r-logo { margin-right: auto; }
.r-mute { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid #ffffff22; background: var(--space-2); color: var(--ink); }
.r-mute svg { width: 22px; height: 22px; }
.r-mute .off, .r-mute[aria-pressed="true"] .on { display: none; }
.r-mute[aria-pressed="true"] .off { display: block; }
.r-mute[aria-pressed="true"] { background: var(--danger); border-color: transparent; }
.r-status {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  border: 1.5px solid #ffffff22; background: var(--space-2); font-weight: 800; font-size: .85rem;
}
.r-status i { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.r-status[data-s="online"] { border-color: #c6ff0066; }
.r-status[data-s="online"] i { background: var(--lime); }

.card { background: var(--space-2); border: 1.5px solid #8b2cff40; border-radius: var(--r-lg); padding: 18px; }
.r-h { margin: 0 0 14px; font: 800 1.5rem/1 var(--f-display); display: flex; align-items: center; gap: 10px; }
.badge { display: inline-grid; place-items: center; min-width: 1.8em; height: 1.8em; padding: 0 .6em; border-radius: 999px; background: var(--lime); color: var(--space); font-size: .8em; }

/* Enlace */
.r-pair { margin-bottom: 16px; }
.r-pair h1 { margin: 0 0 6px; font: 800 1.5rem/1.1 var(--f-display); }
.r-pair p { margin: 0 0 14px; color: var(--ink-2); line-height: 1.45; }
.r-pair-form { display: flex; gap: 10px; }
.r-pair-form input {
  flex: 1; min-width: 0; padding: 14px; border-radius: var(--r-md); border: 2px solid #8b2cff88; background: var(--space);
  font: 800 1.6rem/1 var(--f-display); letter-spacing: .3em; text-transform: uppercase; text-align: center;
}

/* Formulario */
.r-new { display: grid; gap: 16px; }
.r-new .r-h { margin: 0; }
.field { display: grid; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field > span, .field legend { padding: 0; font-weight: 800; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.field legend { margin-bottom: 8px; }
.field input, .field select {
  width: 100%; padding: 14px 16px; border-radius: var(--r-md);
  border: 2px solid #ffffff1f; background: var(--space); font-size: 1.15rem; font-weight: 700;
}
#name { font: 400 1.6rem/1.1 var(--f-name); padding: 14px 16px; }
.field input:focus, .field select:focus { border-color: var(--violet); outline: none; box-shadow: 0 0 0 4px #8b2cff44; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-games { display: grid; grid-template-columns: 1fr 1fr; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.chip span {
  display: flex; align-items: center; gap: 8px; height: 100%; padding: 12px 14px; border-radius: var(--r-md);
  border: 2px solid #ffffff1f; background: var(--space); font-weight: 800; line-height: 1.15;
  transition: transform .15s var(--bounce), background .15s, border-color .15s;
}
.chip svg { width: 24px; height: 24px; flex: none; color: var(--c, var(--violet)); --hole: var(--space); }
.chip small { display: block; font-weight: 700; color: var(--ink-3); font-size: .78rem; }
.chip input:checked + span { background: var(--violet); border-color: var(--violet-soft); box-shadow: inset 0 3px 0 #ffffff33; }
.chip input:checked + span svg { --hole: var(--violet); }
.chip input:checked + span small { color: var(--lime); }
.chip input:focus-visible + span { outline: 3px solid var(--lime); outline-offset: 2px; }
.chip:active span { transform: scale(.96); }
.chip-pack span { flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 16px; font: 800 1.25rem/1 var(--f-display); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 999px; border: 0; font-weight: 800; text-decoration: none;
  transition: transform .15s var(--bounce), opacity .15s;
}
.btn svg { width: 20px; height: 20px; }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .4; }
.btn-lime { background: var(--lime); color: var(--space); box-shadow: 0 5px 0 #7fa300; }
.btn-lime:active { box-shadow: 0 1px 0 #7fa300; transform: translateY(4px); }
.btn-big { width: 100%; padding: 18px; font: 800 1.3rem/1 var(--f-display); }
.btn-ghost { background: transparent; border: 1.5px solid #ffffff2e; color: var(--ink); }
.btn-sm { padding: 9px 14px; font-size: .9rem; }
.r-hint { margin: -4px 0 0; min-height: 1.2em; text-align: center; color: var(--ink-3); font-size: .9rem; }
.r-hint.err { color: var(--danger); font-weight: 800; }

/* Lista */
.r-list { margin: 26px 0; }
#list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.row {
  --c: var(--violet);
  display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; align-items: center;
  padding: 14px 14px 12px 18px; border-radius: var(--r-md);
  background: linear-gradient(160deg, var(--violet), var(--violet-deep));
  box-shadow: inset 0 3px 0 #ffffff30; position: relative; overflow: hidden;
}
.row.new { animation: rowIn .45s var(--bounce) both; }
@keyframes rowIn { from { transform: translateY(10px) scale(.96); opacity: 0; } }
.row-who { min-width: 0; }
.row-name { display: block; font: 400 1.35rem/1.1 var(--f-name); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-game { display: flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 800; color: #ffffffcc; }
.row-game svg { width: 16px; height: 16px; color: var(--c); --hole: var(--violet-deep); }
.row-time { font: 800 2rem/1 var(--f-display); font-variant-numeric: tabular-nums; text-align: right; }
.row-bar { grid-column: 1 / -1; height: 5px; border-radius: 9px; background: #07060f66; overflow: hidden; }
.row-bar i { display: block; height: 100%; background: var(--lime); transform-origin: left; }
.row-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.row-actions button {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 8px 6px; border: 0; border-radius: 12px; background: #07060f55; font-weight: 800; font-size: .88rem;
}
.row-actions button svg { width: 18px; height: 18px; }
.row-actions .danger { color: #ffc2cd; }
.row[data-s="warn"] { box-shadow: inset 0 3px 0 #ffffff30, 0 0 0 3px var(--lime); }
.row[data-s="warn"] .row-time { color: var(--lime); }
.row[data-s="pause"] { filter: saturate(.5); }
.row[data-s="pause"] .row-time { opacity: .7; }
.row[data-s="done"] { background: var(--lime); color: var(--space); }
.row[data-s="done"] .row-game { color: #07060fcc; }
.row[data-s="done"] .row-game svg { --hole: var(--lime); }
.row[data-s="done"] .row-actions button { background: #07060f1f; color: var(--space); }
.row[data-s="done"] .row-actions .primary { background: var(--space); color: var(--lime); }
.r-empty { margin: 0; padding: 22px; text-align: center; color: var(--ink-3); border: 2px dashed #ffffff1f; border-radius: var(--r-md); }

/* Día */
.r-day-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.r-day-k { display: block; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 800; }
.r-day-top b { font: 800 1.2rem/1.2 var(--f-display); }
.r-day-total { font: 800 2rem/1 var(--f-display) !important; color: var(--lime); }
details summary { margin-top: 10px; cursor: pointer; color: var(--violet-soft); font-weight: 800; }
.r-log { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 6px; font-size: .92rem; }
.r-log li { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #ffffff12; }
.r-log time { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.r-log button { border: 0; background: none; color: var(--ink-3); padding: 6px; }
.r-hist { font-size: .88rem; color: var(--ink-2); margin-bottom: 12px; }
.r-hist p { margin: 4px 0; display: flex; justify-content: space-between; }

.r-foot { display: grid; justify-items: center; gap: 22px; margin-top: 22px; }

/* Ajustes (hoja inferior) */
.sheet {
  width: 100%; max-width: 560px; max-height: 92dvh; margin: auto auto 0; padding: 0;
  border: 0; border-radius: 26px 26px 0 0; background: var(--space-2); color: var(--ink);
}
.sheet::backdrop { background: #07060fcc; backdrop-filter: blur(4px); }
.sheet[open] { animation: up .35s var(--ease); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet form { padding: 18px 16px max(24px, env(safe-area-inset-bottom)); display: grid; gap: 12px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet h2 { margin: 0; font: 800 1.6rem/1 var(--f-display); }
.sheet h3 { margin: 14px 0 0; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--lime); }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: #ffffff14; font-size: 1.1rem; }
.set-rows { display: grid; gap: 8px; }
.set-row { display: grid; grid-template-columns: 44px 1fr 44px; gap: 8px; align-items: center; }
.set-row.pack { grid-template-columns: 1fr 1fr 44px; }
.set-row input, .set-row select { width: 100%; min-width: 0; padding: 11px 12px; border-radius: 12px; border: 2px solid #ffffff1f; background: var(--space); font-weight: 700; }
.set-row input[type="color"] { padding: 4px; height: 44px; }
.set-row .del { height: 44px; border: 0; border-radius: 12px; background: #ff4d6d22; color: #ffc2cd; font-weight: 800; }
.set-row label { position: relative; }
.set-row label small { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 800; pointer-events: none; }
.switch { display: flex; gap: 12px; align-items: center; padding: 10px 0; font-weight: 700; }
.switch input { width: 24px; height: 24px; accent-color: var(--lime); flex: none; }
.sheet-actions { display: grid; gap: 12px; justify-items: center; margin-top: 8px; }

.toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 20;
  transform: translate(-50%, 140%); padding: 12px 20px; border-radius: 999px;
  background: var(--lime); color: var(--space); font-weight: 800; box-shadow: 0 10px 30px #0008;
  transition: transform .35s var(--bounce); max-width: calc(100% - 32px); text-align: center;
}
.toast.show { transform: translate(-50%, 0); }

/* El ícono del juego siempre se ve, aunque su color sea el mismo violeta del fondo */
.chip input:checked + span svg { color: var(--lime); }
.row-game svg { width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: var(--space); --hole: var(--space); }
.row[data-s="done"] .row-game svg { --hole: var(--space); }
.set-row.pack label:first-child small { left: 12px; right: auto; }
.set-row.pack label:first-child input { padding-left: 26px; }

/* Juegos fijos (taca-taca, pesca) */
.r-fixed { display: grid; gap: 10px; margin-top: 16px; }
.r-fixed:empty { display: none; }
.fixed-row { list-style: none; margin: 0; padding: 0; }
.fix { display: grid; gap: 12px; padding: 14px 16px; }
.fix-top { display: flex; align-items: center; gap: 10px; }
.fix-top b { font: 400 1.35rem/1.1 var(--f-name); flex: 1; }
.fix-top .row-game svg { width: 30px; height: 30px; padding: 4px; border-radius: 50%; background: var(--space); color: var(--c); }
.fix-free { padding: 5px 12px; border-radius: 999px; background: #c6ff0022; color: var(--lime); font-weight: 800; font-size: .85rem; }
.fix-btns { display: grid; gap: 8px; }
.fix-btns .btn { width: 100%; padding: 14px; font-size: 1.05rem; }
.btn-wide { width: 100%; padding: 14px; font-size: 1.05rem; }
.fix-note { margin: 0; font-size: .85rem; color: var(--ink-3); }
.chips-games.one { grid-template-columns: 1fr; }

/* Ajustes: opciones por juego */
.set-game { display: grid; gap: 8px; padding: 10px; border-radius: 14px; background: #ffffff08; }
.set-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; }
.set-opts .switch { padding: 0; grid-column: 1 / -1; }
.set-opts select, .set-opts input { width: 100%; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 2px solid #ffffff1f; background: var(--space); font-weight: 700; }
.set-opts .price { position: relative; }
.set-opts .price input { padding-left: 26px; }
.set-opts .price small { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 800; }
