:root {
  --bg-1: #101827;
  --bg-2: #0b0e14;
  --panel: rgba(15, 23, 42, 0.55);
  --panel-strong: rgba(15, 23, 42, 0.86);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text: #f8fafc;
  --muted: #94a3b8;
  --gold: #ffd166;
  --gold-2: #fbbf24;
  --danger: #f472b6;
  --cyan: #22d3ee;
  --violet: #8b5cf6;
  --pink: #f472b6;
  --purple: #8b5cf6;
  --green: #34d399;
  --radius: 28px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  --font-display: 'Fredoka', 'Inter', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  color: var(--text);
  background: #0b0e14;
  -webkit-font-smoothing: antialiased;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.28;
}

.blob-cyan {
  top: -170px;
  left: -130px;
  width: 540px;
  height: 540px;
  background: #22d3ee;
}

.blob-pink {
  right: -140px;
  bottom: -190px;
  width: 520px;
  height: 520px;
  background: #f472b6;
  opacity: 0.22;
}

.blob-purple {
  top: 34%;
  left: 52%;
  width: 460px;
  height: 460px;
  background: #8b5cf6;
  opacity: 0.2;
}

.app {
  position: relative;
  z-index: 1;
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 52px) clamp(18px, 4vw, 32px) 80px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: clamp(28px, 5vw, 48px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 58px;
  height: 58px;
  color: #fff;
  background: linear-gradient(135deg, #f472b6, #8b5cf6);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(244, 114, 182, 0.26), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  transform: rotate(-4deg);
}

.brand-icon svg {
  width: 30px;
  height: 30px;
}

.brand-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.5vw, 2.7rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
}

.brand-game {
  color: #fff;
}

.brand-lobby {
  color: var(--cyan);
  text-shadow: 0 0 22px rgba(34, 211, 238, 0.7);
}

.brand-subtitle {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.view {
  animation: rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ------------------------------------------------------------------ */
/* Tipografía y utilidades                                             */
/* ------------------------------------------------------------------ */

.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(34, 211, 238, 0.35);
}

.page-hero {
  padding-top: clamp(8px, 3vw, 28px);
}

.page-title {
  margin: 0;
  font-size: clamp(3.2rem, 11vw, 6rem);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.04em;
  background: linear-gradient(120deg, #ffffff, #c9b8ff 42%, #ffd166 78%, #ff8a5c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.page-subtitle {
  max-width: 48ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.muted {
  color: var(--muted);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin: 38px 0 20px;
}

.section-head .muted {
  margin: 0;
  font-size: 0.9rem;
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.mini {
  margin: 0;
  font-size: 0.82rem;
}

/* ------------------------------------------------------------------ */
/* Botones                                                             */
/* ------------------------------------------------------------------ */

.btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 11px 18px;
  border-radius: 13px;
  border: 1px solid transparent;
  cursor: pointer;
  color: #0b0b12;
  letter-spacing: 0.01em;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.99);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.35);
}

.btn.primary {
  background: linear-gradient(120deg, var(--cyan), var(--purple));
  color: #fff;
  box-shadow: 0 10px 28px rgba(34, 211, 238, 0.26);
}

.btn.primary:hover:not(:disabled) {
  box-shadow: 0 16px 38px rgba(139, 92, 246, 0.42);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.13);
  color: var(--text);
}

.btn.ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.11);
}

.btn.danger {
  background: linear-gradient(120deg, #f472b6, #fb7185);
  color: #fff;
  box-shadow: 0 10px 26px rgba(244, 114, 182, 0.26);
}

.btn.danger:hover:not(:disabled) {
  box-shadow: 0 14px 34px rgba(244, 114, 182, 0.42);
}

.btn.big {
  padding: 15px 28px;
  font-size: 15px;
  border-radius: 15px;
}

.btn:focus-visible,
.icon-btn:focus-visible,
.avatar-option:focus-visible,
.create-card:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  font-family: inherit;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.icon-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
}

/* ------------------------------------------------------------------ */
/* Avatares                                                            */
/* ------------------------------------------------------------------ */

.avatar {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.28), transparent 55%),
    var(--avatar-color, var(--violet));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.avatar-lg {
  width: 72px;
  height: 72px;
}

.avatar-md {
  width: 48px;
  height: 48px;
}

.avatar-sm {
  width: 36px;
  height: 36px;
}

.avatar-sm .avatar-fallback {
  font-size: 0.9rem;
}

.avatar-fallback {
  color: #fff;
  font-size: 1.45rem;
  font-weight: 900;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  user-select: none;
}

.avatar-md .avatar-fallback {
  font-size: 1.05rem;
}

.avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-slot {
  display: flex;
}

/* ------------------------------------------------------------------ */
/* Vista 1 · Perfiles                                                  */
/* ------------------------------------------------------------------ */

.profiles-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.profiles-main {
  min-width: 0;
}

.profiles-head {
  margin-top: 0;
  margin-bottom: 20px;
}

.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 0;
}

.profile-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  background: linear-gradient(150deg, rgba(30, 41, 59, 0.55), rgba(15, 23, 42, 0.55));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 30px;
  box-shadow: 0 16px 40px -24px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.24s ease, box-shadow 0.24s ease;
  will-change: transform;
}

.profile-card:hover {
  transform: translateY(-6px) scale(1.05);
  border-color: color-mix(in srgb, var(--card-glow, var(--cyan)) 62%, white 8%);
  box-shadow:
    0 26px 60px -18px color-mix(in srgb, var(--card-glow, var(--cyan)) 52%, transparent),
    0 0 0 1px color-mix(in srgb, var(--card-glow, var(--cyan)) 24%, transparent);
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.profile-info {
  min-width: 0;
}

.profile-name {
  margin: 0;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-stats {
  margin: 5px 0 0;
  font-size: 0.8rem;
}

.profile-stats.in-use {
  color: var(--cyan);
  font-weight: 700;
}

.profile-card-actions {
  display: flex;
  margin-top: auto;
}

.profile-card-actions .btn {
  width: 100%;
}

.create-card {
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 196px;
  color: var(--muted);
  font-family: inherit;
  text-align: center;
  background: rgba(15, 23, 42, 0.28);
  border: 2px dashed rgba(148, 163, 184, 0.34);
  box-shadow: none;
  cursor: pointer;
}

.create-card:hover {
  transform: translateY(-6px) scale(1.03);
  border-color: var(--cyan);
  background: rgba(34, 211, 238, 0.07);
  box-shadow:
    0 0 0 1px rgba(34, 211, 238, 0.28),
    0 22px 52px -22px rgba(34, 211, 238, 0.6);
}

.create-card-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  color: var(--cyan);
  font-size: 2rem;
  line-height: 1;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.32);
  border-radius: 18px;
  text-shadow: 0 0 18px rgba(34, 211, 238, 0.65);
}

.create-card-title {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}

.create-card-hint {
  color: var(--muted);
  font-size: 0.78rem;
}

.records-panel {
  position: sticky;
  top: 24px;
  padding: 22px;
  background: linear-gradient(155deg, rgba(30, 41, 59, 0.58), rgba(15, 23, 42, 0.62));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 30px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.records-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.records-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.records-top {
  padding: 5px 10px;
  color: var(--cyan);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 999px;
}

.records-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.record-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid transparent;
  border-radius: 16px;
}

.record-row.record-first {
  background: linear-gradient(120deg, rgba(255, 209, 102, 0.16), rgba(251, 191, 36, 0.03));
  border-color: rgba(255, 209, 102, 0.55);
  box-shadow: 0 0 26px -10px rgba(255, 209, 102, 0.6);
}

.record-rank {
  width: 18px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

.record-first .record-rank,
.record-first .record-name {
  color: var(--gold);
}

.record-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.record-name {
  overflow: hidden;
  font-size: 0.88rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-meta {
  color: var(--muted);
  font-size: 0.72rem;
}

.record-score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1;
}

.record-score-value {
  color: var(--cyan);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}

.record-first .record-score-value {
  color: var(--gold);
}

.record-score-label {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.62rem;
}

.records-empty {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.55;
  text-align: center;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: clamp(26px, 5vw, 40px) 24px;
  text-align: center;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 26px;
  backdrop-filter: blur(14px);
}

.empty-state h2 {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3.4vw, 1.6rem);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.empty-state p {
  max-width: 40ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.empty-suit {
  color: var(--cyan);
  font-size: 2.6rem;
  line-height: 1;
  text-shadow: 0 0 26px rgba(34, 211, 238, 0.55);
}

/* ------------------------------------------------------------------ */
/* Vista 2 · Hub de juegos                                             */
/* ------------------------------------------------------------------ */

.hub-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  background: linear-gradient(150deg, rgba(30, 41, 59, 0.55), rgba(15, 23, 42, 0.55));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 26px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.active-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.active-profile-info {
  min-width: 0;
}

.active-profile-info .eyebrow {
  margin-bottom: 3px;
}

.hub-name {
  margin: 0;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-score {
  margin: 4px 0 0;
  font-size: 0.86rem;
}

.hub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 13px;
  overflow: hidden;
  padding: 22px;
  background: linear-gradient(150deg, rgba(30, 41, 59, 0.55), rgba(15, 23, 42, 0.55));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 30px;
  box-shadow: 0 16px 40px -24px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.24s ease, box-shadow 0.24s ease;
}

.game-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--purple), var(--pink));
  opacity: 0.9;
}

.game-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(34, 211, 238, 0.38);
  box-shadow: 0 26px 60px -20px rgba(34, 211, 238, 0.36);
}

.game-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.game-card h3 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 4px 10px;
  color: var(--cyan);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 999px;
}

.game-record {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.game-card .btn {
  width: 100%;
  margin-top: auto;
}

/* ------------------------------------------------------------------ */
/* Vista 3 · Editar perfil                                             */
/* ------------------------------------------------------------------ */

.view-topbar {
  margin-bottom: 18px;
}

.panel {
  padding: clamp(22px, 5vw, 34px);
  background: linear-gradient(150deg, rgba(30, 41, 59, 0.58), rgba(15, 23, 42, 0.62));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 30px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.edit-panel {
  max-width: 620px;
  margin: 0 auto;
}

.panel-head {
  margin-bottom: 6px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.field-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.field input {
  width: 100%;
  padding: 14px 16px;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  background: rgba(2, 6, 23, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 13px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input::placeholder {
  color: #64748b;
}

.field input:focus {
  border-color: rgba(34, 211, 238, 0.75);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.16);
}

.avatar-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.avatar-fieldset legend {
  margin-bottom: 10px;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px;
}

.avatar-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 10px 8px;
  font-family: inherit;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.12s;
}

.avatar-option:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.075);
}

.avatar-option.selected {
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.1);
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.08);
}

.avatar-option-label {
  overflow: hidden;
  max-width: 100%;
  font-size: 0.7rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-error {
  min-height: 18px;
  margin: 0;
  color: #ff8fa3;
  font-size: 0.86rem;
  line-height: 1.4;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

/* ------------------------------------------------------------------ */
/* Modal                                                               */
/* ------------------------------------------------------------------ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  width: min(540px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: clamp(20px, 5vw, 28px);
  background: linear-gradient(155deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 30px;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(22px) saturate(130%);
  -webkit-backdrop-filter: blur(22px) saturate(130%);
  animation: rise 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-card-small {
  width: min(440px, 100%);
}

.delete-text {
  margin: 22px 0 16px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.6;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

/* ------------------------------------------------------------------ */
/* Toast                                                               */
/* ------------------------------------------------------------------ */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 100;
  width: max-content;
  max-width: min(440px, calc(100vw - 32px));
  padding: 13px 18px;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.4;
  background: rgba(15, 23, 42, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  transform: translateX(-50%);
  animation: toast-in 0.24s ease;
}

.toast.success {
  background: rgba(6, 44, 36, 0.97);
  border-color: rgba(52, 211, 153, 0.45);
}

.toast.error {
  background: rgba(56, 14, 26, 0.97);
  border-color: rgba(244, 114, 182, 0.5);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 980px) {
  .profiles-layout {
    grid-template-columns: 1fr;
  }

  .records-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .app-header {
    margin-bottom: 28px;
  }

  .brand-icon {
    width: 50px;
    height: 50px;
    border-radius: 16px;
  }

  .brand-icon svg {
    width: 26px;
    height: 26px;
  }

  .hub-header {
    align-items: stretch;
  }

  .hub-actions {
    width: 100%;
  }

  .hub-actions .btn {
    flex: 1 1 0;
  }

  .section-head {
    margin-top: 30px;
  }

  .profiles-head {
    margin-top: 0;
  }

  .form-actions .btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 460px) {
  .profiles-grid {
    grid-template-columns: 1fr;
  }

  .create-card {
    min-height: 168px;
  }

  .avatar-grid {
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  }

  .toast {
    bottom: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
