/* =====================================================
   BlueStream — المكوّنات (components.css)
   النافذة + المواسم والحلقات
   ===================================================== */

/* ===== نافذة التفاصيل ===== */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.82); backdrop-filter: blur(8px); }

.modal-card {
  position: relative; width: min(880px,100%); max-height: 90vh; overflow-y: auto;
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.8);
  animation: pop 0.28s cubic-bezier(0.2,0.9,0.3,1.2);
}
@keyframes pop {
  from { transform: scale(0.93) translateY(14px); opacity: 0; }
  to   { transform: scale(1) translateY(0);     opacity: 1; }
}

.modal-close {
  position: absolute; top: 14px; inset-inline-end: 14px; z-index: 10;
  width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 50%;
  background: rgba(9,9,11,0.8); color: var(--text); font-size: 0.85rem;
  cursor: pointer; transition: background var(--transition), border-color var(--transition);
}
.modal-close:hover { background: var(--surface-2); border-color: var(--border-strong); }

/* الجزء العلوي: خلفية العمل */
.modal-hero { position: relative; aspect-ratio: 16/8.2; min-height: 260px; overflow: hidden; border-radius: 18px 18px 0 0; }
.modal-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.modal-hero-grad {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--bg-raised) 4%, rgba(15,15,19,0.6) 30%, transparent 65%),
    linear-gradient(to left, rgba(15,15,19,0.55) 0%, transparent 45%);
}
.modal-hero-content { position: absolute; bottom: 22px; inset-inline: 26px; z-index: 2; }
.modal-hero-content h2 {
  font-size: clamp(1.4rem,3vw,2.1rem); font-weight: 900; line-height: 1.25;
  margin-bottom: 12px; text-shadow: 0 3px 20px rgba(0,0,0,0.9);
}

.modal-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.badge {
  padding: 4px 13px; border-radius: var(--radius-sm); font-size: 0.78rem; font-weight: 700;
  background: rgba(9,9,11,0.6); color: var(--text-dim); border: 1px solid var(--border);
}
.badge-rating { color: var(--text); border-color: var(--border-strong); }
.badge-type { color: var(--text); background: var(--surface-2); border-color: var(--border-strong); }

.modal-content { padding: 22px 26px 28px; }
.modal-overview { font-size: 0.94rem; line-height: 1.9; color: var(--text-dim); font-weight: 400; }
.modal-notice {
  margin-top: 15px; padding: 12px 17px; border-radius: var(--radius-sm);
  font-size: 0.85rem; line-height: 1.75; color: var(--text-dim);
  background: var(--surface); border: 1px solid var(--border);
}

.watch-options {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
.watch-options h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  font-size: 0.92rem;
  font-weight: 800;
}
.watch-options h3::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-solid);
  box-shadow: var(--accent-glow);
}
.watch-provider-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 13px;
}
.watch-provider {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--surface-2);
}
.watch-provider img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
}
.watch-link {
  display: inline-flex;
  padding: 8px 17px;
  border-radius: var(--radius-pill);
  background: var(--text);
  color: #09090B;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 800;
}

/* ===== المواسم والحلقات ===== */
.episodes-block { margin-top: 26px; }
.episodes-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 14px;
}
.episodes-head h3 { font-size: 1.15rem; font-weight: 800; }
.season-select {
  padding: 9px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 0.9rem; font-weight: 700; cursor: pointer; outline: none;
}
.season-select:focus { border-color: var(--accent-border); }

.episodes-list { display: flex; flex-direction: column; }
.episode-row {
  display: flex; align-items: center; gap: 16px; padding: 14px 12px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  border-bottom: 1px solid var(--border); cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.episode-row:hover { background: var(--surface); border-color: var(--border); }
.episode-row.watching {
  background: var(--surface-2); border-color: var(--border-strong);
}
.episode-row.watched .episode-num { color: var(--accent-solid); }

.episode-num { flex: 0 0 26px; font-size: 1.15rem; font-weight: 800; color: var(--text-faint); text-align: center; }
.episode-thumb {
  position: relative; flex: 0 0 150px; aspect-ratio: 16/9;
  border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2);
}
.episode-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.episode-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 1.3rem; color: var(--text); background: rgba(9,9,11,0.45);
  opacity: 0; transition: opacity var(--transition);
}
.episode-row:hover .episode-play { opacity: 1; }
.episode-progress { position: absolute; bottom: 0; inset-inline: 0; height: 3px; background: rgba(255,255,255,0.12); }
.episode-progress > span { display: block; height: 100%; background: var(--accent-solid); box-shadow: 0 0 8px var(--accent-glow-near); }

.episode-info { flex: 1; min-width: 0; }
.episode-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.episode-name { font-size: 0.96rem; font-weight: 700; }
.episode-runtime { flex-shrink: 0; font-size: 0.76rem; font-weight: 600; color: var(--text-faint); }
.episode-desc {
  font-size: 0.82rem; line-height: 1.65; color: var(--text-dim); font-weight: 400;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* شارة "تشاهدها الآن" — نقطة هوية + توهج */
.episode-badge {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 6px; padding: 2px 10px; border-radius: var(--radius-pill);
  font-size: 0.7rem; font-weight: 800; color: var(--text);
  background: var(--surface-3); border: 1px solid var(--border-strong);
}
.episode-badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-solid); box-shadow: var(--accent-glow);
}
.episode-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.episode-watched-badge {
  color: var(--accent-solid);
  background: var(--surface);
}

/* ===== أزرار نافذة التفاصيل ===== */
.modal-primary-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}
.modal-primary-actions .btn-play,
.modal-primary-actions .btn-info { padding-block: 10px; font-size: 0.86rem; }
.modal-list-action.active {
  background: var(--surface-3);
  border-color: var(--border-strong);
}
.modal-list-action.active::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-inline-end: 7px;
  border-radius: 50%;
  background: var(--accent-solid);
  box-shadow: var(--accent-glow);
}

/* ===== صورة الملف ===== */
.profile-avatar {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 36%;
  color: #fff;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.profile-avatar::after {
  content: "";
  position: absolute;
  inset: 10%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 30%;
  pointer-events: none;
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-avatar.avatar-upload::after { display: none; }
.profile-avatar-sm { width: 32px; height: 32px; font-size: 0.78rem; }
.profile-avatar-md { width: 38px; height: 38px; font-size: 0.86rem; }
.profile-avatar-lg { width: 72px; height: 72px; font-size: 1.35rem; }
.profile-avatar-xl { width: 94px; height: 94px; font-size: 1.8rem; }
.avatar-blue { background: linear-gradient(145deg, #1d4ed8, #111827); }
.avatar-violet { background: linear-gradient(145deg, #6d28d9, #171327); }
.avatar-gold { background: linear-gradient(145deg, #a16207, #21180b); }
.avatar-rose { background: linear-gradient(145deg, #be123c, #241117); }
.avatar-cyan { background: linear-gradient(145deg, #0e7490, #0d2026); }
.avatar-lime { background: linear-gradient(145deg, #4d7c0f, #17200d); }
.avatar-orange { background: linear-gradient(145deg, #c2410c, #27150e); }
.avatar-slate { background: linear-gradient(145deg, #475569, #171a20); }
.avatar-indigo { background: linear-gradient(145deg, #4338ca, #131329); }
.avatar-red { background: linear-gradient(145deg, #b91c1c, #271111); }
.avatar-teal { background: linear-gradient(145deg, #0f766e, #0e2220); }
.avatar-amber { background: linear-gradient(145deg, #b45309, #25190d); }

/* ===== نافذة إدارة الملفات ===== */
.profiles-dialog,
.auth-dialog {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: var(--bg-raised);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.8);
  animation: pop 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
.profiles-dialog-head { padding-inline-end: 42px; }
.dialog-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-faint);
  font-size: 0.7rem;
  font-weight: 800;
}
.dialog-kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-solid);
  box-shadow: var(--accent-glow);
}
.profiles-dialog h2,
.auth-dialog h2 {
  margin: 7px 0 5px;
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 900;
}
.profiles-dialog-head p,
.auth-subtitle {
  color: var(--text-dim);
  font-size: 0.82rem;
  line-height: 1.75;
}
.profiles-manager-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
  margin-top: 25px;
}
.profile-manager-card {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 15px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition:
    transform var(--transition),
    background var(--transition),
    border-color var(--transition);
}
.profile-manager-card:hover,
.profile-manager-card.active {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.profile-manager-card.active .profile-avatar {
  box-shadow: var(--accent-glow);
}
.profile-manager-card strong {
  overflow: hidden;
  max-width: 100%;
  margin-top: 5px;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-manager-card > span:last-child {
  color: var(--text-faint);
  font-size: 0.65rem;
}
.add-profile-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 11px;
  padding: 11px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.add-profile-button:hover:not(:disabled) {
  background: var(--surface);
  color: var(--text);
}
.add-profile-button:disabled { opacity: 0.5; cursor: not-allowed; }
.add-profile-button > span { color: var(--accent-solid); font-size: 1rem; }

.profile-editor {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.profile-editor-preview {
  display: flex;
  align-items: center;
  gap: 17px;
  margin-bottom: 20px;
}
.profile-editor-preview h3 { font-size: 1.05rem; font-weight: 900; }
.profile-editor-preview p {
  margin-top: 4px;
  color: var(--text-faint);
  font-size: 0.72rem;
  line-height: 1.6;
}
.field-label {
  display: block;
  margin: 13px 0 7px;
  color: var(--text-dim);
  font-size: 0.74rem;
  font-weight: 700;
}
.form-input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--bg-raised);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  transition: border-color var(--transition), background var(--transition);
}
.form-input:focus {
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.avatar-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.avatar-preset-button {
  position: relative;
  display: grid;
  place-items: center;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 15px;
  background: transparent;
  cursor: pointer;
}
.avatar-preset-button:hover,
.avatar-preset-button.selected {
  border-color: var(--border-strong);
  background: var(--surface-3);
}
.avatar-preset-button.selected::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  margin: 32px 30px 0 0;
  border-radius: 50%;
  background: var(--accent-solid);
  box-shadow: var(--accent-glow);
}
.profile-upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 17px;
}
.profile-upload-row .btn-info { padding: 9px 19px; font-size: 0.78rem; }
.profile-upload-row small,
.form-field small {
  color: var(--text-faint);
  font-size: 0.67rem;
}
.profile-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 19px;
}
.profile-editor-actions .btn-play,
.profile-editor-actions .btn-info,
.danger-button {
  padding: 9px 21px;
  font-size: 0.8rem;
}
.danger-button {
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-pill);
  background: rgba(239, 68, 68, 0.09);
  color: #fca5a5;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.danger-button:hover { background: rgba(239, 68, 68, 0.15); }
.form-error {
  margin-top: 13px;
  padding: 9px 12px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.07);
  color: #fecaca;
  font-size: 0.74rem;
  line-height: 1.6;
}
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ===== المصادقة ===== */
.auth-dialog { width: min(440px, 100%); padding: 32px; }
.auth-brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--accent-solid);
  font-size: 0.85rem;
  box-shadow: var(--accent-glow);
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 22px 0 17px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
}
.auth-tab {
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-faint);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}
.auth-tab.active {
  background: var(--surface-3);
  color: var(--text);
}
.form-field { margin-bottom: 12px; }
.auth-submit { width: 100%; margin-top: 9px; padding-block: 11px; }

/* ===== الرسائل العائمة ===== */
.toast-region {
  position: fixed;
  z-index: 300;
  inset-inline-start: 18px;
  bottom: 18px;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  max-width: min(360px, calc(100vw - 36px));
  padding: 11px 15px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(23, 23, 28, 0.96);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-inline-end: 8px;
  border-radius: 50%;
  background: var(--accent-solid);
  box-shadow: var(--accent-glow);
}
.toast-error::before { background: #ef4444; box-shadow: none; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 620px) {
  .modal { padding: 10px; }
  .profiles-dialog,
  .auth-dialog { max-height: 94vh; padding: 22px 16px; border-radius: 17px; }
  .profiles-manager-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-editor { padding: 15px; }
  .profile-editor-preview { align-items: flex-start; }
  .profile-upload-row { align-items: flex-start; flex-direction: column; }
  .profile-editor-actions > * { flex: 1; }
  .modal-primary-actions { gap: 7px; }
  .modal-primary-actions .btn-play,
  .modal-primary-actions .btn-info { padding-inline: 16px; }
  .episode-row { align-items: flex-start; gap: 10px; padding-inline: 5px; }
  .episode-thumb { flex-basis: 112px; }
  .episode-desc { -webkit-line-clamp: 1; }
}

/* ===== بوابة الدخول واختيار الملف ===== */
body.app-locked { overflow: hidden; }
.access-gate {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 46px);
  overflow-y: auto;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 0.065), transparent 34%),
    linear-gradient(145deg, #09090b 0%, #0f0f13 100%);
}
.access-gate-glow {
  position: fixed;
  top: 18%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-solid);
  box-shadow: var(--accent-glow);
  transform: translateX(-50%);
  pointer-events: none;
}
.access-gate-card {
  position: relative;
  width: min(100%, 920px);
  padding: clamp(24px, 5vw, 54px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: clamp(20px, 3vw, 30px);
  background: rgba(15, 15, 19, 0.9);
  box-shadow: 0 38px 100px rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(18px);
}
.access-gate-card::before,
.access-gate-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 50%;
  pointer-events: none;
}
.access-gate-card::before {
  top: -210px;
  left: -150px;
  width: 430px;
  height: 430px;
}
.access-gate-card::after {
  right: -110px;
  bottom: -210px;
  width: 330px;
  height: 330px;
}
.access-gate-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: clamp(26px, 4vw, 42px);
  color: var(--text);
}
.access-gate-brand > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--accent-solid);
  font-size: 0.68rem;
  box-shadow: var(--accent-glow);
}
.access-gate-brand strong { font-size: 1rem; font-weight: 900; }
.access-gate-brand b { color: var(--text-dim); font-weight: 500; }
.gate-state {
  width: min(100%, 760px);
  margin: 0 auto;
  text-align: center;
}
.gate-state h1 {
  margin: 7px 0 8px;
  color: var(--text);
  font-size: clamp(1.65rem, 5vw, 3rem);
  font-weight: 900;
  line-height: 1.28;
}
.gate-state > p {
  max-width: 610px;
  margin: 0 auto;
  color: var(--text-dim);
  font-size: clamp(0.78rem, 1.7vw, 0.96rem);
  line-height: 1.9;
}
.gate-state > small {
  display: block;
  margin-top: 18px;
  color: var(--text-faint);
  font-size: 0.66rem;
}
.gate-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-faint);
  font-size: 0.68rem;
  font-weight: 800;
}
.gate-eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-solid);
  box-shadow: var(--accent-glow);
}
.gate-spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 20px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-solid);
  border-radius: 50%;
  box-shadow: 0 0 22px var(--accent-soft);
  animation: spin 0.8s linear infinite;
}
.gate-auth-actions,
.gate-profile-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 26px;
  flex-wrap: wrap;
}
.gate-primary,
.gate-secondary,
.gate-text-button {
  min-height: 43px;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}
.gate-primary {
  border: 1px solid #fff;
  background: #fff;
  color: #09090b;
}
.gate-secondary {
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
}
.gate-text-button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-faint);
}
.gate-primary:hover,
.gate-secondary:hover { transform: translateY(-2px); }
.gate-secondary:hover { border-color: var(--accent-border); }
.gate-account-email { direction: ltr; }
.gate-profile-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
  gap: 10px;
  max-width: 760px;
  margin: 28px auto 0;
}
.gate-profile-card {
  position: relative;
  min-width: 0;
}
.gate-profile-select {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-height: 154px;
  padding: 16px 9px 13px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), border-color var(--transition);
}
.gate-profile-select:hover,
.gate-profile-select:focus-visible {
  border-color: var(--border-strong);
  outline: none;
  background: var(--surface-2);
  transform: translateY(-3px);
}
.gate-profile-select .profile-avatar {
  width: 74px;
  height: 74px;
  font-size: 1.35rem;
}
.gate-profile-select strong {
  width: 100%;
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gate-profile-select span:last-child {
  color: var(--text-faint);
  font-size: 0.61rem;
  font-weight: 600;
}
.gate-profile-select.active {
  border-color: var(--border-strong);
  background: var(--surface);
}
.gate-profile-select.active::after {
  content: "";
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-solid);
  box-shadow: var(--accent-glow);
}
.gate-offline-message {
  margin-top: 10px !important;
  color: #fca5a5 !important;
  font-size: 0.72rem !important;
}

@media (max-width: 760px) {
  .access-gate { align-items: start; padding: 10px; }
  .access-gate-card {
    min-height: calc(100dvh - 20px);
    padding: 24px 14px;
    border-radius: 20px;
  }
  .access-gate-brand { margin-bottom: 30px; }
  .gate-profile-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 52dvh;
    padding: 2px;
    overflow-y: auto;
  }
  .gate-profile-select { min-height: 136px; }
  .gate-profile-select .profile-avatar { width: 64px; height: 64px; }
  .gate-auth-actions > *,
  .gate-profile-actions > * { flex: 1; }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .access-gate-card { width: min(92vw, 860px); }
  .gate-profile-list { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-height: 620px) and (orientation: landscape) {
  .access-gate { align-items: start; }
  .access-gate-card { padding-block: 18px; }
  .access-gate-brand { margin-bottom: 14px; }
  .gate-profile-list {
    grid-template-columns: repeat(5, minmax(90px, 1fr));
    margin-top: 14px;
  }
  .gate-profile-select { min-height: 108px; padding: 9px; }
  .gate-profile-select .profile-avatar { width: 52px; height: 52px; }
  .gate-profile-actions { margin-top: 12px; }
}
