/* Base del proyecto */
[hidden] { display: none !important; }
img { max-width: 100%; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }

/* Layout: una sola columna tipo teléfono (máx. 440px), cabecera arriba, contenido que scrollea y barra de pestañas abajo. En escritorio queda centrada. */
:root {
  --bg: #0D1110;
  --bar: #1A2221;
  --card: #222B2A;
  --line: #5B6664;
  --chip: #13483A;
  --field: #262C2B;
  --mint: #2EF2C6;
  --mint-ink: #06231D;
  --pink: #F230E8;
  --fg: #FFFFFF;
  --muted: #9CA8A5;
  --danger: #FF7A87;
  --bubble-in: #222B2A;
  --bubble-out: #3B4241;
  --display: 'Archivo Black', 'Arial Black', Impact, sans-serif;
  --body: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 16px; line-height: 1.4;
  margin: 0; padding: 0; display: flex; justify-content: center; align-items: stretch;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.muted { color: var(--muted); }
.grow { flex: 1; }

#app {
  position: relative; width: 100%; max-width: 440px; height: 100%; max-height: 920px; align-self: center;
  display: flex; flex-direction: column; background: var(--bg); overflow: hidden;
}
@media (min-width: 480px) { #app { border: 1px solid #263130; border-radius: 28px; height: min(100%, 880px); } }

.g { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* Cabecera */
.bar { height: 64px; flex: none; display: flex; align-items: center; gap: 14px; background: var(--bar);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.bar h1 { font-size: 20px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ib { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: #D5DDDB; flex: none; }
.ib:hover { background: #ffffff12; }
.bar .ib:first-child { margin-left: -8px; }
.bar .ib:last-child { margin-right: -8px; }
.bar .logo-s { display: grid; flex: none; }

/* Contenido */
.screen { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-top: 24px; padding-bottom: 28px; }
.screen.flush { padding: 0 0 28px; }
.screen > .g, .screen.flush > .g { padding-top: 0; }
.stack { display: flex; flex-direction: column; gap: 24px; }

/* Barra de pestañas */
.tabs { height: 64px; flex: none; display: flex; background: var(--bar); border-top: 1px solid #ffffff0d;
  padding-left: max(8px, env(safe-area-inset-left, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px)); }
.tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font-size: 12px; font-weight: 700; position: relative; }
.tabs button.on { color: var(--mint); }
.tabs .dot { position: absolute; top: 8px; left: calc(50% + 8px); min-width: 18px; height: 18px; border-radius: 9px; background: var(--pink);
  color: var(--mint-ink); font-size: 11px; display: grid; place-items: center; padding: 0 5px; }

/* Campos */
.fg { display: flex; flex-direction: column; gap: 8px; }
.fg > label, .lbl { font-size: 18px; font-weight: 500; }
.hint { font-size: 14px; color: var(--muted); margin-top: -4px; }
.box { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 56px; padding: 7px 12px; border: 0; border-radius: 4px; background: var(--field); }
.box:focus-within { box-shadow: 0 0 0 2px var(--mint); }
.box input { flex: 1; min-width: 110px; background: transparent; border: 0; outline: 0; padding: 8px 0; font-size: 16px; }
.field { width: 100%; min-height: 56px; padding: 0 12px; border: 0; border-radius: 4px; background: var(--field); outline: 0; font-size: 16px; }
.field:focus { box-shadow: 0 0 0 2px var(--mint); }
textarea.field { padding: 14px 12px; min-height: 112px; resize: vertical; line-height: 1.45; }
.field-row { position: relative; }
.field-row .field { padding-right: 52px; }
.field-row .ib { position: absolute; right: 6px; top: 8px; color: var(--mint); }
.err { color: var(--danger); font-size: 14px; min-height: 0; }
.err:empty { display: none; }
.count { align-self: flex-end; font-size: 13px; color: var(--muted); margin-top: -4px; }

.chip { display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 12px 0 16px; border-radius: 20px; background: var(--chip); color: var(--mint); font-size: 16px; white-space: nowrap; }
.chip.ro { padding: 0 16px; }
.chip button { display: grid; place-items: center; color: var(--mint); width: 24px; height: 24px; border-radius: 50%; }
.chip.match, button.chip.sel { box-shadow: inset 0 0 0 2px #30F2C3; }
button.chip { padding: 0 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sugs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.sugs::-webkit-scrollbar { display: none; }
.sugs:empty { display: none; }
.sug { flex: none; height: 32px; padding: 0 12px; border-radius: 16px; border: 1px dashed #2EF2C655; color: var(--muted); font-size: 14px; }
.sug:hover { color: var(--mint); border-color: var(--mint); }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 56px; border-radius: 28px; background: var(--mint); color: var(--mint-ink); font-size: 16px; font-weight: 500; }
.btn:hover { filter: brightness(1.06); }
.btn.alt { background: #263130; color: var(--mint); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid #FF7A8755; }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--mint) var(--p, 12%), #2A3634 var(--p, 12%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--mint); margin-top: -10px; border: 0; }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: #2A3634; }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--mint); }
input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--mint); border: 0; }
.dist { display: flex; justify-content: space-between; align-items: baseline; font-size: 18px; font-weight: 500; }
.dist output { font-weight: 400; color: #E7EDEB; font-variant-numeric: tabular-nums; }

/* Avatares */
.av { --s: 56px; width: var(--s); height: var(--s); border-radius: 50%; flex: none; position: relative; overflow: hidden; display: grid; place-items: center;
  background:
    repeating-radial-gradient(circle at 30% 120%, #ffffff10 0 2px, transparent 2px 14px),
    linear-gradient(150deg, hsl(var(--h) 58% 40%), hsl(calc(var(--h) + 45) 62% 18%)); }
.av span { font-family: var(--display); font-size: calc(var(--s) * 0.42); color: #ffffffdd; line-height: 1; }
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av.sq { border-radius: 8px; }

/* Tarjetas de músicos */
.list { display: flex; flex-direction: column; gap: 16px; }
.mcard { display: flex; gap: 16px; padding: 12px; background: var(--card); border-radius: 8px; cursor: pointer; align-items: center; }
.mcard:hover { background: #283332; }
.mc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mc-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.mc-top h3 { font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pct { flex: none; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--chip); color: var(--mint); font-variant-numeric: tabular-nums; }
.mc-ins { color: var(--mint); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-bot { display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
.heart { width: 32px; height: 32px; display: grid; place-items: center; color: var(--muted); margin: -4px -4px -4px 0; border-radius: 50%; }
.heart.on { color: var(--mint); }
.count-line { color: var(--muted); font-size: 15px; margin-bottom: -8px; }

/* Perfil de otro músico */
.hero { position: relative; height: 200px; overflow: hidden; display: flex; align-items: flex-end;
  background:
    radial-gradient(circle at 78% 20%, hsl(calc(var(--h) + 30) 70% 45% / 0.55), transparent 55%),
    repeating-radial-gradient(circle at 20% 110%, #ffffff0d 0 2px, transparent 2px 22px),
    linear-gradient(160deg, hsl(var(--h) 55% 30%), #0D1110 95%); }
.hero .big { position: absolute; right: -8px; top: -30px; font-family: var(--display); font-size: 220px; line-height: 1; color: #ffffff12; pointer-events: none; }
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 110px; background: linear-gradient(to top, #0D1110ee, transparent); }
.hero .heart { position: absolute; top: 14px; right: max(12px, env(safe-area-inset-right, 0px)); z-index: 2; width: 40px; height: 40px; color: #fff; background: #0D111066; border-radius: 50%; margin: 0; }
.hero .heart.on { color: var(--mint); }
.hero .av { position: absolute; top: 24px; left: 16px; --s: 72px; border: 3px solid #0D1110; z-index: 1; }
.pname { padding-top: 0; margin-top: -48px; position: relative; z-index: 2; display: flex; flex-direction: column; gap: 4px; }
.pname h2 { font-size: 30px; font-weight: 500; line-height: 1.15; }
.pname .row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pname .ins { color: var(--mint); font-size: 16px; }
.sect { display: flex; flex-direction: column; gap: 8px; }
.sect > h3 { font-size: 16px; font-weight: 500; color: var(--muted); }
.sect p { font-size: 18px; line-height: 1.35; }
.affinity { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 8px; background: var(--card); font-size: 15px; }
.affinity b { font-size: 24px; font-weight: 700; color: var(--mint); font-variant-numeric: tabular-nums; }
.links { display: flex; gap: 24px; }
.links a { display: block; width: 40px; height: 40px; border-radius: 50%; }
.links svg { display: block; }

/* Chat */
.thread { display: flex; gap: 16px; align-items: center; padding: 12px 0; cursor: pointer; width: 100%; text-align: left; }
.thread .t-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.thread .t-body b { font-weight: 500; font-size: 16px; }
.thread .t-body span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread .t-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; color: var(--muted); font-size: 14px; align-self: flex-start; margin-top: 4px; font-variant-numeric: tabular-nums; }
.badge { min-width: 28px; height: 20px; border-radius: 4px; background: var(--pink); color: var(--mint-ink); font-size: 13px; font-weight: 500; display: grid; place-items: center; padding: 0 6px; }
.note { text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 20px; }
.msgs { display: flex; flex-direction: column; gap: 16px; }
.msg { display: flex; flex-direction: column; gap: 6px; max-width: 78%; }
.msg.in { align-items: flex-start; }
.msg.out { align-items: flex-end; align-self: flex-end; }
.bub { padding: 13px 14px; border-radius: 16px; font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.msg.in .bub { background: var(--bubble-in); border-bottom-left-radius: 4px; }
.msg.out .bub { background: var(--bubble-out); border-bottom-right-radius: 4px; }
.msg time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.typing .bub { display: flex; gap: 4px; padding: 16px 14px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.composer { flex: none; display: flex; gap: 16px; align-items: center; padding-top: 12px; padding-bottom: 14px; background: var(--bg);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.composer .inp { flex: 1; min-width: 0; display: flex; align-items: center; height: 48px; background: #3F4544; border-radius: 4px; padding: 0 4px 0 12px; }
.composer input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; font-size: 16px; }
.composer input::placeholder { color: #A8B2B0; }
.composer .ib { color: var(--mint); }
.round { width: 48px; height: 48px; border-radius: 50%; background: var(--mint); color: var(--mint-ink); display: grid; place-items: center; flex: none; }

/* Estados vacíos */
.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 56px 24px 0; color: var(--muted); }
.empty h2 { color: var(--fg); font-size: 20px; font-weight: 500; }
.empty p { max-width: 30ch; }
.empty .btn { width: auto; padding: 0 28px; margin-top: 8px; }

/* Foto de perfil */
.photo { align-self: center; position: relative; width: 96px; height: 96px; }
.photo .av { --s: 96px; }
.photo .edit { position: absolute; right: 0; bottom: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--mint); color: var(--mint-ink); display: grid; place-items: center; border: 2px solid var(--bg); }
.linkf { display: flex; align-items: center; gap: 12px; }
.linkf svg { flex: none; }

/* Login y presentación */
.splash { position: absolute; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background: url('assets/splash.jpg') center / cover no-repeat, #0A0D0D;
  transition: opacity .5s; }
.splash.out { opacity: 0; pointer-events: none; }
.word { font-family: var(--display); font-size: 40px; letter-spacing: 0.01em; }
.login { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 40px; padding-block: 40px;
  background: radial-gradient(circle at 80% 0%, #2EF2C61a, transparent 50%), radial-gradient(circle at 0% 100%, #F230E81a, transparent 50%), var(--bg); }
.brand { display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.brand p { color: var(--muted); max-width: 26ch; }
.btns { display: flex; flex-direction: column; gap: 24px; }
.sbtn { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px; border-radius: 28px; background: #263130; color: var(--mint); font-weight: 500; font-size: 16px; width: 100%; }
.sbtn:hover { background: #2D3A38; }
.legal { font-size: 12px; color: var(--muted); text-align: center; }

/* Modales, hojas y avisos */
.scrim { position: absolute; inset: 0; z-index: 40; background: #000000a6; display: flex; align-items: flex-end; }
.sheet { width: 100%; background: #1F2928; border-radius: 20px 20px 0 0; padding-top: 20px; padding-bottom: max(20px, env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 16px; max-height: 85%; overflow-y: auto; }
.sheet h2 { font-size: 18px; font-weight: 500; }
.sheet p { color: var(--muted); font-size: 15px; }
.sheet .opt { display: flex; align-items: center; gap: 14px; height: 52px; font-size: 16px; text-align: left; width: 100%; }
.sheet .opt.danger { color: var(--danger); }
.sheet .acts { display: flex; gap: 12px; }
.sheet .acts .btn { height: 48px; }
.brow { display: flex; align-items: center; gap: 12px; }
.brow b { flex: 1; font-weight: 500; }
.brow .btn { width: auto; height: 36px; padding: 0 16px; font-size: 14px; }
.toast { position: absolute; left: 50%; bottom: 84px; transform: translate(-50%, 12px); z-index: 70; background: #E8EFED; color: #0D1110; padding: 12px 18px; border-radius: 22px; font-size: 14px; font-weight: 500;
  opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .splash, .toast { transition: none; } .typing i { animation: none; opacity: .7; } }
