:root {
  color-scheme: dark;
  /* Paleta tomada de la imagen «Music Lock In»: negro, brasa, rojo, naranja, ámbar, dorado y crema. */
  --ember: #870f02;
  --red: #d12002;
  --orange: #f34c03;
  --amber: #fc9c18;
  --gold: #ffca23;
  --cream: #fef3dc;
  --bg: #0b0807;
  --surface: #16100d;
  --surface-2: #1d1511;
  --surface-3: #271c16;
  --field-bg: #0e0a08;
  --border: #3d2d24;
  --border-strong: #4d3a2f;
  --text: #fdf6ea;
  --muted: #b9aa9c;
  --muted-2: #a8988a;
  --muted-3: #9a8a7d;
  --accent: var(--amber);
  --on-accent: #1c0b02;
  --focus: var(--gold);
  --line: rgba(255,214,180,.09);
  --radius: 22px;
}
*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; }
.page {
  width: min(100% - 32px, 430px);
  margin: 0 auto;
  padding: max(25px, env(safe-area-inset-top)) 0 max(28px, env(safe-area-inset-bottom));
}
header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 850; letter-spacing: -.045em; white-space: nowrap; }
.brandmark { display: grid; place-items: center; width: 34px; height: 34px; background: linear-gradient(160deg, var(--gold) 0%, var(--orange) 55%, var(--red) 100%); border-radius: 11px; color: var(--on-accent); }
.brandmark svg { width: 22px; height: 22px; }
.tiles { margin-top: 28px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile {
  min-width: 0; text-align: left; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; justify-content: space-between; align-items: stretch;
  position: relative; overflow: hidden; isolation: isolate; cursor: pointer;
  color: var(--text); -webkit-tap-highlight-color: transparent;
  transition: transform .16s ease, filter .16s ease, border-color .16s ease;
}
.tile:hover { transform: translateY(-2px); filter: brightness(1.06); }
.tile:active { transform: scale(.985); }
.tile:focus-visible, .close:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.tile::before { content: ""; position: absolute; inset: 0; background: linear-gradient(155deg,rgba(255,255,255,.07), transparent 50%); z-index: -1; pointer-events: none; }
.tile svg { width: 24px; height: 24px; stroke-width: 1.8; }
.tile .topline { display: flex; align-items: flex-start; justify-content: space-between; }
.arrow { opacity: .65; width: 19px !important; height: 19px !important; }
.title { display: block; font-weight: 760; font-size: 17px; line-height: 1.16; letter-spacing: -.035em; position: relative; }
.description { display: block; margin-top: 6px; font-size: 11px; line-height: 1.45; opacity: .75; font-weight: 500; position: relative; }
.profile { min-height: 152px; background: linear-gradient(118deg, #4a0701 0%, #9a1503 48%, #c73a08 100%); border-color: rgba(252,156,24,.28); }
.profile .title { font-size: 21px; }
.profile .description { font-size: 12px; opacity: .83; }
.profile .topline > svg:first-child { width: 30px; height: 30px; }
.profile .orbit { position: absolute; border: 1px solid rgba(255,202,35,.22); width: 120px; height: 120px; border-radius: 50%; right: -38px; top: -46px; pointer-events: none; }
.profile .orbit::after { content: ""; position: absolute; width: 108px; height: 108px; border: 1px solid rgba(255,202,35,.22); border-radius: 50%; top: 6px; left: 6px; }
.artists, .albums { min-height: 152px; background: var(--surface-2); }
.friends { min-height: 152px; background: linear-gradient(150deg, #1d0a04 0%, #3a1205 60%, #5a1a04 100%); border-color: rgba(255,202,35,.22); }
.friends .symbol { color: var(--gold); }
.friends .accent { position: absolute; right: -31px; top: 40px; width: 90px; height: 90px; border-radius: 50%; z-index: -1; opacity: .13; background: var(--gold); }
.artists .symbol { color: var(--amber); }
.albums .symbol { color: #ff7a3d; }
.artists .accent, .albums .accent { position: absolute; right: -31px; top: 40px; width: 90px; height: 90px; border-radius: 50%; z-index: -1; opacity: .11; }
.artists .accent { background: var(--amber); }
.albums .accent { background: var(--orange); }
.rate, .add { min-height: 152px; }
.rate { background: var(--amber); color: var(--on-accent); border-color: var(--amber); }
.add { background: var(--cream); color: #2a1205; border-color: var(--cream); }
.rate .description, .add .description { opacity: .7; }
.rate .arrow, .add .arrow { opacity: .8; }
dialog { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); border-radius: 23px; padding: 23px; width: min(360px, calc(100% - 32px)); box-shadow: 0 25px 90px #0008; }
dialog::backdrop { background: #050302cc; backdrop-filter: blur(3px); }
dialog h2 { font-size: 23px; letter-spacing: -.05em; margin: 0 0 10px; }
dialog p { font-size: 14px; color: var(--muted); line-height: 1.55; margin: 0 0 22px; }
.close { background: var(--accent); color: var(--on-accent); border: none; border-radius: 13px; cursor: pointer; width: 100%; padding: 12px; font-weight: 750; }
@media (min-width: 700px) {
  body { display: grid; align-items: center; padding: 28px 0; background: radial-gradient(ellipse 55% 48% at 50% 45%, #2a0f06 0%, var(--bg) 100%); }
  .page { padding: 24px 0; }
}
@media (max-height: 740px) and (max-width: 699px) {
  .page { padding-top: 16px; }
  .tiles { margin-top: 21px; }
  .profile, .friends, .artists, .albums, .rate, .add { min-height: 140px; }
  .tile { padding: 15px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
  /* Vistas interiores: continuidad visual con la portada original. */
[hidden] { display: none !important; }
.brand-button { border: 0; background: none; color: inherit; display: inline-flex; padding: 6px 8px 6px 0; min-height: 44px; cursor: pointer; border-radius: 12px; }
.brand-button:hover .brandmark { filter: brightness(1.1); }
.page.detail-layout { width: min(100% - 32px, 760px); }
.page.detail-layout header { margin-bottom: 26px; }
.screen { padding-bottom: 28px; }
.eyebrow { color: var(--muted-2); text-transform: uppercase; font-weight: 800; letter-spacing: .13em; font-size: 10px; margin: 0 0 10px; }
.section-heading { margin: 7px 0 21px; font-size: clamp(29px,6vw,37px); line-height: 1.1; letter-spacing: -.055em; }
.section-desc { font-size: 13px; color: var(--muted); line-height: 1.5; margin: -9px 0 20px; }
.back-link { border: 0; background: transparent; color: var(--muted); padding: 7px 0; min-height: 40px; display: inline-flex; gap: 7px; align-items: center; cursor: pointer; font-size: 13px; }
.back-link:hover, .text-link:hover { color: var(--text); }
.back-link svg, .btn svg, .text-link svg { width: 16px; height: 16px; }
/* Trailing chevron in list rows (Buscar perfiles, Mi perfil → Comentarios): fixed size, never grows. */
.row-button > svg { flex: 0 0 18px; width: 18px; height: 18px; color: var(--muted-2); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 21px; padding: 17px; margin: 13px 0; }
.panel-header { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.panel-title { margin: 0; font-size: 17px; font-weight: 750; letter-spacing: -.035em; }
.field { width: 100%; display: block; background: var(--field-bg); border: 1px solid var(--border); color: var(--text); border-radius: 12px; padding: 12px 13px; font: inherit; font-size: 14px; }
.field:focus-visible, .score-button:focus-visible, .tab:focus-visible, .btn:focus-visible, .back-link:focus-visible, .row-button:focus-visible, .text-link:focus-visible, .brand-button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
textarea.field { min-height: 100px; resize: vertical; }
.field-label { display: block; color: var(--muted); font-size: 12px; margin: 14px 0 7px; font-weight: 650; }
.field-help { font-size: 12px; color: var(--muted-2); margin: 7px 0 0; line-height: 1.5; }
.search-wrap { position: relative; margin-bottom: 14px; }
.search-wrap .field { padding-left: 39px; }
.search-wrap svg { position: absolute; left: 13px; top: 12px; width: 17px; height: 17px; color: var(--muted-2); pointer-events: none; }
.result-list { display: flex; flex-direction: column; gap: 9px; }
.row-button { display: flex; width: 100%; gap: 12px; align-items: center; border: 1px solid var(--line); background: var(--surface-2); color: inherit; text-align: left; border-radius: 15px; padding: 10px 12px; cursor: pointer; min-width: 0; }
.row-button:hover { border-color: #6b4a33; background: var(--surface-3); }
.rank-number { width: 21px; flex: 0 0 21px; font-size: 13px; font-weight: 700; color: var(--amber); text-align: center; }
.mini-art { flex: 0 0 51px; width: 51px; height: 51px; display: grid; place-items: center; border-radius: 10px; background: linear-gradient(140deg, var(--cover-start,#d12002),var(--cover-end,#2a0f06)); color: #fff; font-size: 18px; font-weight: 840; letter-spacing: -.07em; }
.mini-art.artist-art { border-radius: 50%; }
.hero-art { width: 105px; height: 105px; flex-basis: 105px; font-size: 29px; border-radius: 16px; }
.hero-art.artist-art { border-radius: 50%; }
.row-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.row-name { font-weight: 730; font-size: 14px; overflow-wrap: anywhere; line-height: 1.25; }
.row-sub { font-size: 11px; color: var(--muted-2); line-height: 1.3; }
.row-stat { text-align: right; flex: 0 0 auto; font-weight: 780; font-size: 15px; font-variant-numeric: tabular-nums; }
.row-stat small { color: var(--muted-2); font-weight: 500; font-size: 10px; display: block; margin-top: 5px; }
.hero { display: flex; align-items: center; gap: 17px; margin: 11px 0 20px; }
.hero-info { min-width: 0; }
.hero-title { font-size: clamp(22px,5.5vw,29px); letter-spacing: -.045em; line-height: 1.1; margin: 0 0 9px; overflow-wrap: anywhere; }
.hero-sub { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.45; }
.stats { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 13px 0 19px; }
.stat { border: 1px solid var(--line); background: var(--surface-2); padding: 16px; border-radius: 16px; }
.stat-label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 9px; }
.stat-value { display: block; font-size: 27px; font-weight: 790; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.stat-foot { display: block; color: var(--muted-2); font-size: 11px; margin-top: 8px; line-height: 1.4; }
.btn { border: 1px solid var(--border-strong); border-radius: 12px; padding: 12px 14px; background: var(--surface-3); color: var(--text); font: inherit; font-weight: 720; font-size: 13px; display: inline-flex; gap: 8px; justify-content: center; align-items: center; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { cursor: not-allowed; opacity: .45; }
.full { width: 100%; }
.toolbar { display:flex; align-items: center; justify-content: space-between; gap: 9px; margin: 15px 0; flex-wrap: wrap; }
.toolbar .field { width: auto; max-width: 100%; flex: 1; min-width: 150px; }
.text-link { background: none; color: var(--accent); border: 0; font: inherit; font-size: 13px; padding: 6px 0; cursor: pointer; text-align: left; }
.track-list { list-style: none; padding: 0; margin: 0; }
.track-row { display:flex; align-items:center; gap: 9px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.track-row:last-child { border-bottom: 0; }
.track-index { width: 20px; flex: 0 0 20px; color: var(--muted-3); font-size: 13px; font-variant-numeric: tabular-nums; text-align: center; }
.track-name { min-width: 0; flex: 1; font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.track-global { flex: 0 0 auto; font-size: 13px; font-weight: 720; font-variant-numeric: tabular-nums; }
.track-play { flex: 0 0 34px; height: 34px; border: 1px solid var(--border-strong); border-radius: 50%; background: transparent; color: var(--muted-2); display:grid; place-items:center; padding:0; opacity: .48; cursor: not-allowed; }
.track-play svg { width: 16px; height: 16px; }
.score-button { border: 1px solid var(--border-strong); background: var(--surface-3); color: var(--text); padding: 7px 8px; border-radius: 10px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 75px; font-size: 12px; cursor: pointer; }
.score-button.scored { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.score-button:hover { filter: brightness(1.15); }
.tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin: 14px 0 17px; }
.tab { border: 1px solid var(--border); background: var(--surface-2); border-radius: 12px; color: var(--muted); text-align: center; font: inherit; font-size: 12px; padding: 11px 7px; cursor: pointer; }
.tab.active { border-color: var(--accent); background: #3a2210; color: #ffd9a8; font-weight: 780; }
.empty { color: var(--muted); font-size: 13px; padding: 16px; border: 1px dashed var(--border-strong); border-radius: 14px; line-height: 1.55; }
.badge-demo { color: var(--muted-2); font-size: 10px; letter-spacing: .03em; border: 1px solid var(--border); border-radius: 99px; padding: 5px 8px; display: inline-flex; align-items: center; }
.notice { font-size: 12px; color: var(--muted); line-height: 1.55; }
.rating-dialog { width: min(400px, calc(100% - 24px)); max-width: 400px; }
.rating-dialog .track-in-modal { color: var(--muted); font-size: 14px; margin: 0 0 19px; }
.slider-label { font-size: 23px; font-weight: 830; margin: 15px 0 17px; letter-spacing: -.04em; color: var(--accent); }
/* Escala vertical de puntuación: +3 arriba, −3 abajo; números y etiquetas siempre visibles. */
.scale { --row: 46px; --pos: 3; position: relative; display: grid; grid-template-columns: 1fr 30px; gap: 10px; margin: 6px 0 4px; padding: 2px; border-radius: 16px; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; cursor: pointer; }
.scale:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.scale-track { grid-column: 2; grid-row: 1; position: relative; justify-self: center; width: 6px; height: calc(var(--row) * 6); margin-top: calc(var(--row) / 2); border-radius: 99px; background: linear-gradient(180deg, var(--ember) 0%, var(--red) 24%, var(--orange) 48%, var(--amber) 72%, var(--gold) 100%); }
.scale-thumb { position: absolute; left: 50%; top: calc(var(--pos) * var(--row)); width: 26px; height: 26px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--cream); border: 5px solid var(--amber); box-shadow: 0 0 0 5px rgba(252,156,24,.2), 0 4px 14px #0009; transition: top .12s ease, opacity .12s ease; }
.scale.is-unset .scale-thumb { opacity: 0; }
.scale-rows { grid-column: 1; grid-row: 1; min-width: 0; list-style: none; margin: 0; padding: 0; display: grid; grid-template-rows: repeat(7, var(--row)); }
.scale-row { display: flex; align-items: center; gap: 14px; padding: 0 14px; border-radius: 12px; color: var(--muted); transition: background-color .12s ease, color .12s ease; }
.scale-row[data-score="0"] { box-shadow: inset 0 1px 0 var(--line), inset 0 -1px 0 var(--line); }
.scale-num { flex: 0 0 32px; text-align: right; font-size: 19px; font-weight: 820; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--text); }
.scale-word { min-width: 0; font-size: 15px; font-weight: 600; line-height: 1.15; overflow-wrap: anywhere; }
.scale-row.selected { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.scale-row.selected .scale-num { color: var(--on-accent); }
.scale-row.selected .scale-word { font-weight: 760; }
@media (hover: hover) { .scale-row:not(.selected):hover { background: var(--surface-3); color: var(--text); } }
@media (max-height: 720px) { .scale { --row: 40px; } .rating-dialog .slider-label { margin: 8px 0 10px; } }
.modal-actions { display:flex; gap:8px; margin-top: 22px; }
.modal-actions .btn { flex:1; }
.modal-feedback { font-size: 12px; min-height: 18px; margin-top: 12px; color: var(--accent); }
.add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.small-heading { font-size: 14px; font-weight: 720; margin: 0 0 11px; }
.stats.single { grid-template-columns: 1fr; }
@media (max-width: 400px) {
  .hero-art { width: 85px; height: 85px; flex-basis:85px; }
  .row-button { padding: 10px; gap: 9px; }
  .mini-art { width: 43px; height: 43px; flex-basis:43px; }
  .track-row { gap: 6px; }
  .score-button { min-width: 66px; }
}

/* --- Adiciones de la app (servidor) --- */
.mini-art { position: relative; overflow: hidden; }
.mini-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.header-user { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.header-user .text-link { font-size: 12px; }
.auth-card { margin-top: 28px; }
.error { color: #ffb4a8; font-size: 12px; min-height: 18px; margin: 10px 0 0; line-height: 1.5; }
.badge-prov { color: var(--gold); border-color: #5c4214; }
.mb-row .row-stat { font-size: 12px; font-weight: 700; color: var(--accent); }
.mb-row[aria-busy="true"] { opacity: .55; pointer-events: none; }
.invite-code { font-family: ui-monospace, monospace; font-size: 15px; background: var(--field-bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-top: 10px; user-select: all; overflow-wrap: anywhere; }
.loading { color: var(--muted); font-size: 13px; padding: 16px 2px; }
.credit { font-size: 11px; color: var(--muted-3); line-height: 1.5; margin-top: 18px; }
.credit a { color: var(--muted); }
.disc-head { list-style: none; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--amber); padding: 16px 0 4px; border-bottom: 1px solid var(--line); }

/* Buscar perfiles: comparación canción por canción (solo lectura). */
.vs-line { color: var(--muted); }
.vs-line.is-missing { color: var(--muted-3); font-style: italic; }
.vs-head { display: grid; grid-template-columns: 1fr 52px 52px; gap: 8px; padding: 0 0 8px 29px; border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 750; letter-spacing: .04em; color: var(--muted-2); }
.vs-head span:not(:first-child) { text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-row { display: grid; grid-template-columns: 20px 1fr 52px 52px; gap: 8px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.vs-row:last-child { border-bottom: 0; }
.vs-row .track-name { font-size: 13px; }
.vs-chip { display: grid; place-items: center; height: 32px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-3); font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; }
.vs-chip.is-empty { background: transparent; border-style: dashed; color: var(--muted-3); font-weight: 600; }
.vs-row.is-same .vs-chip { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.vs-callout { border-color: rgba(252,156,24,.35); background: linear-gradient(160deg, #2a1205 0%, var(--surface) 70%); }
.vs-callout .field-help { margin: 8px 0 14px; }
.disc-head + .vs-row, .vs-row + .disc-head { border-top: 0; }

/* Mi perfil: Configuración de usuario y selector de orden. */
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 13px 0 0; }
.account-item { border: 1px solid var(--line); background: var(--surface-2); border-radius: 13px; padding: 11px 13px; min-width: 0; }
.account-label { font-size: 11px; color: var(--muted-2); font-weight: 650; margin: 0 0 4px; }
.account-value { margin: 0; font-size: 14px; font-weight: 740; color: var(--text); overflow-wrap: anywhere; }
.account-pass { margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); }
.account-pass-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.account-pass-bar .notice { flex: 1 1 200px; }
.pass-form { margin-top: 10px; }
.sort-bar { margin: 0 0 14px; }
@media (max-width: 420px) { .account-grid { grid-template-columns: 1fr; } }
