* {
  box-sizing: border-box;
}

body {
  background: radial-gradient(circle at top, #1a1f3a, #0f1222 60%);
  color: white;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100dvh;
  margin: 0;
  display: block;
  overflow-x: hidden;
  overflow-y: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  background:
    linear-gradient(rgba(8, 10, 20, 0.52), rgba(8, 10, 20, 0.68)),
    url("../images/neexty-auth-bg.webp");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}

#app {
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 18px 20px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

body:has(#profileView:not(.hidden)),
body:has(#chatListView:not(.hidden)),
body:has(#chatView:not(.hidden)),
body:has(#creditsShopView:not(.hidden)) {
  overflow-y: auto;
}

body:has(#loginView:not(.hidden)),
body:has(#registerView:not(.hidden)),
body:has(#appView:not(.hidden)) {
  overflow-y: hidden;
}

body:has(#loginView:not(.hidden))::before,
body:has(#registerView:not(.hidden))::before {
  opacity: 1;
}



#profileView:not(.hidden) {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  min-height: calc(100vh - 40px);
  display: block;
}

body:has(#profileView:not(.hidden)) #app {
  max-width: 980px;
  padding-left: 28px;
  padding-right: 28px;
}

body:has(#loginView:not(.hidden)) #app,
body:has(#registerView:not(.hidden)) #app {
  max-width: 560px;
  padding-left: 28px;
  padding-right: 28px;
}

.app-brand-row {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  flex: 0 0 auto;
}

.app-brand-logo {
  width: min(100%, 210px);
  height: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.28));
}

.app-brand-auth {
  margin-top: 0;
  margin-bottom: 14px;
}

.app-brand-profile {
  margin-top: 2px;
  margin-bottom: 16px;
}

.app-brand-app {
  margin-top: 0;
  margin-bottom: 10px;
}

.app-brand-auth .app-brand-logo {
  width: min(100%, 184px);
}

.app-brand-profile .app-brand-logo {
  width: min(100%, 160px);
}

.app-brand-app .app-brand-logo {
  width: min(100%, 142px);
}



h1 {
  margin-bottom: 6px;
  font-size: 28px;
}

#status {
  margin-bottom: 14px;
  font-size: 14px;
  opacity: 0.85;
}

.view {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

#profileView.view {
  max-width: 100%;
}

#loginView:not(.hidden),
#registerView:not(.hidden),
#appView:not(.hidden) {
  min-height: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#profileView:not(.hidden),
#chatListView:not(.hidden),
#chatView:not(.hidden),
#creditsShopView:not(.hidden) {
  min-height: auto;
  display: block;
}


.hidden {
  display: none;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: none;
  margin-bottom: 10px;
  font-size: 14px;
  font-family: inherit;
}

select {
  background: white;
  color: #111;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

button {
  padding: 12px 20px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.1s ease, opacity 0.1s ease;
}

button:active {
  transform: scale(0.97);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 14px;
}

.link {
  margin-top: 10px;
  font-size: 13px;
  color: #00e0b8;
  cursor: pointer;
  text-decoration: underline;
}

.error {
  margin-top: 10px;
  font-size: 13px;
  color: #ff4d6d;
}

.secondary {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.danger {
  background: linear-gradient(135deg, #666, #333);
  color: white;
}

#btnStart {
  background: linear-gradient(135deg, #00e0b8, #00bfa6);
  color: #001d19;
}

#btnNext {
  background: linear-gradient(135deg, #ff4d6d, #ff2f5e);
  color: white;
}

.timer {
  font-size: 20px;
  font-weight: bold;
  margin: 8px 0;
  color: #ffd4dd;
}

.credits-badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 10px;
  background: #111;
  color: #fff;
  font-size: 14px;
  margin: 8px 0 10px;
}

.videos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

video {
  width: 100%;
  height: 240px;
  background: #000;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Placeholder visual cuando no hay stream */
video:empty::before {
  content: "Cámara no conectada";
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 12px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(25, 215, 195, 0.08), transparent 28%),
    radial-gradient(circle at bottom, rgba(255, 77, 109, 0.08), transparent 30%),
    rgba(3, 6, 14, 0.68);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(10px);
  padding: 20px;
}

.modal-card {
  background:
    linear-gradient(180deg, rgba(19, 24, 42, 0.98), rgba(10, 14, 28, 0.98));
  color: #fff;
  padding: 28px 24px 22px;
  border-radius: 24px;
  width: min(92vw, 420px);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 26px 56px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(14px);
  animation: modalPop 0.22s ease-out;
}

.modal-card h3 {
  margin: 0 0 10px;
  font-size: 1.5rem;
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.modal-card p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.84);
}

.modal-card button {
  margin-top: 16px;
  padding: 12px 18px;
  min-width: 112px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff4d6d, #ff2f5e);
  color: white;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.96rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.modal-card .controls,
.modal-card .modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
}

.modal-card .controls button,
.modal-card .modal-actions button {
  margin-top: 0;
}

.modal-card button.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

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

@media (max-width: 640px) {
  .modal-card {
    padding: 24px 18px 18px;
    border-radius: 20px;
    width: min(92vw, 360px);
  }

  .modal-card h3 {
    font-size: 1.32rem;
  }

  .modal-card p {
    font-size: 0.95rem;
  }

  .modal-card button {
    min-width: 100px;
    font-size: 0.92rem;
  }
}

/* Chat */
.chat-messages {
  min-height: 250px;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px;
  margin: 10px 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: white;
  text-align: left;
}

.chat-message {
  max-width: 78%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  word-break: break-word;
}

.chat-message.is-new {
  animation: chatMessageAppear 0.25s ease;
}

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

.chat-message.me {
  background: linear-gradient(135deg, #00e0b8, #00bfa6);
  color: #001d19;
}

.chat-message.other {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.chat-message-row {
  display: flex;
  margin-bottom: 8px;
}

.chat-message-row.me {
  justify-content: flex-end;
}

.chat-message-row.other {
  justify-content: flex-start;
}

.chat-author {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
  opacity: 0.85;
}

.chat-author-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.chat-time {
  font-size: 11px;
  opacity: 0.7;
  white-space: nowrap;
}

.chat-body {
  font-size: 14px;
  white-space: pre-wrap;
  line-height: 1.4;
}

.chat-empty {
  text-align: center;
  opacity: 0.8;
  padding: 20px 10px;
}

.chat-compose {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
}

.chat-compose textarea {
  min-height: 80px;
  resize: vertical;
  border-radius: 12px;
  border: none;
  padding: 12px;
  font-size: 14px;
  font-family: inherit;
}

#btnSendMessage {
  background: linear-gradient(135deg, #00e0b8, #00bfa6);
  color: #001d19;
}

.chat-emoji-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 6px;
}

.emoji-btn {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-size: 18px;
  line-height: 1;
}

.emoji-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.chat-rules-hint {
  font-size: 12px;
  opacity: 0.75;
  margin-bottom: 8px;
  text-align: center;
}

.chat-notice {
  font-size: 13px;
  color: #ffd166;
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.28);
  padding: 8px 10px;
  border-radius: 10px;
  text-align: left;
}

.chat-notice.hidden {
  display: none;
}

/* Chat list */
.chat-list-item {
  display: flex;
  position: relative;
  align-items: center;
  gap: 12px;
  padding: 16px 82px 16px 16px;
  border-radius: 18px;
  margin-bottom: 12px;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.05));
  color: white;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 24px rgba(0,0,0,0.16);
  transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
  overflow: hidden;
}

.chat-list-item:hover {
  background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.08));
  border-color: rgba(0, 224, 184, 0.18);
  box-shadow: 0 14px 30px rgba(0,0,0,0.22);
  transform: translateY(-2px);
}

.chat-list-item:not(:last-child)::after {
  display: none;
}

.chat-list-item.is-unread {
  background: rgba(0, 224, 184, 0.08);
  border-color: rgba(0, 224, 184, 0.16);
}

.chat-list-avatar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(135deg, #00e0b8, #00bfa6);
  color: #062b25;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-list-main {
  flex: 1;
  min-width: 0;
}

.chat-list-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.chat-list-name {
  font-weight: 600;
  font-size: 15px;
  color: white;
  letter-spacing: 0.2px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-list-name.has-unread {
  font-weight: 700;
}

.chat-list-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.chat-list-time {
  font-size: 12px;
  opacity: 0.72;
  white-space: nowrap;
}

.chat-list-preview {
  font-size: 13px;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-list-preview.has-unread {
  font-weight: 700;
  opacity: 1;
}

.chat-unread-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #ff4d6d;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

#chatHeader {
  font-weight: 700;
  margin-bottom: 10px;
  opacity: 0.95;
}

.message-toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(92vw, 420px);
  z-index: 9999;
  animation: messageToastIn 0.18s ease;
}

.message-toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(20, 24, 40, 0.96);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(8px);
}

.message-toast-icon {
  font-size: 20px;
  line-height: 1;
  flex: 0 0 auto;
}

.message-toast-text {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.message-toast-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-toast-preview {
  font-size: 13px;
  opacity: 0.86;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-toast-action {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 10px;
  border: none;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #00e0b8, #00bfa6);
  color: #001d19;
}

@keyframes messageToastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.chat-new-indicator {
  position: sticky;
  bottom: 10px;
  display: flex;
  justify-content: center;
  margin-top: 8px;
  z-index: 5;
}

.chat-new-indicator button {
  padding: 8px 14px;
  border-radius: 20px;
  border: none;
  background: linear-gradient(135deg, #00e0b8, #00bfa6);
  color: #001d19;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

/* Credits shop / checkout */
#creditsShopView {
  padding-bottom: 28px;
}

#creditsShopStatus {
  margin-bottom: 12px;
  font-size: 14px;
  opacity: 0.85;
}

#creditsPackListSection,
#creditsCheckoutSection {
  width: 100%;
  margin-top: 14px;
}

#creditsCheckoutSection {
  animation: checkoutFadeIn 0.18s ease;
}

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

.credits-checkout-card {
  text-align: left;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  margin-top: 4px;
}

.credits-checkout-header {
  margin-bottom: 14px;
}

.credits-checkout-header h2 {
  margin: 0 0 4px;
  font-size: 20px;
  line-height: 1.2;
}

#creditsCheckoutHint {
  margin: 0;
  font-size: 13px;
  opacity: 0.78;
  line-height: 1.4;
}

.credits-checkout-summary {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 14px;
}

.credits-checkout-summary::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #00e0b8, #00bfa6);
  border-radius: 10px;
}

.credits-pack-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #00e0b8, #00bfa6);
  color: #001d19;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.credits-checkout-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  font-size: 14px;
}

.credits-checkout-row:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.credits-checkout-row span {
  opacity: 0.8;
}

.credits-checkout-row strong {
  font-size: 14px;
  text-align: right;
  line-height: 1.35;
  word-break: break-word;
}

.credits-checkout-total-row {
  margin-top: 4px;
  padding-top: 12px;
}

.credits-checkout-total-row span {
  font-size: 15px;
  font-weight: 700;
  opacity: 0.95;
}

.credits-checkout-total-row strong {
  font-size: 18px;
  font-weight: 800;
  color: #00e0b8;
}

#cardBrickSection {
  margin-top: 14px;
  text-align: left;
}

#creditsShopPaymentStatus {
  margin-bottom: 10px;
  font-size: 13px;
  opacity: 0.85;
  line-height: 1.4;
}

#cardBrickContainer {
  min-height: 220px;
  width: 100%;
  overflow: visible;
}

.credits-checkout-controls {
  margin-top: 14px;
}

/* Responsive */
@media (max-width: 520px) {
  body {
    padding: 0;
  }

  #app {
    max-width: 100%;
    padding: 16px 14px 24px;
  }

  .view {
    max-width: 100%;
  }

  .credits-checkout-card {
    padding: 14px;
    border-radius: 14px;
  }

  .credits-checkout-header h2 {
    font-size: 18px;
  }

  .credits-checkout-row {
    font-size: 13px;
  }

  .credits-checkout-row strong {
    font-size: 13px;
  }

#app {
  max-width: 100%;
  min-height: 100dvh;
  padding: 14px 14px 14px;
}

#loginView:not(.hidden),
#registerView:not(.hidden),
#appView:not(.hidden) {
  min-height: auto;
  justify-content: center;
}

#profileView:not(.hidden),
#chatListView:not(.hidden),
#chatView:not(.hidden),
#creditsShopView:not(.hidden) {
  min-height: auto;
  display: block;
}

.app-brand-auth {
  margin-bottom: 12px;
}

.app-brand-profile {
  margin-bottom: 14px;
}

.app-brand-app {
  margin-bottom: 8px;
}

.app-brand-auth .app-brand-logo {
  width: min(100%, 170px);
}

.app-brand-profile .app-brand-logo {
  width: min(100%, 148px);
}

.app-brand-app .app-brand-logo {
  width: min(100%, 132px);
}

.auth-card {
  border-radius: 24px;
  padding: 22px 18px 20px;
}

.auth-title {
  font-size: 2.25rem;
}

.auth-subtitle {
  font-size: 0.98rem;
  margin-bottom: 20px;
}



  .credits-pack-price {
    font-size: 14px;
  }



  .credits-pack-pill {
    font-size: 10px;
    padding: 6px 9px;
  }

   .credits-pack-credits {
    font-size: 12px;
  }

    .credits-pack-main {
    column-gap: 10px;
    row-gap: 8px;
  }







.chat-list-item {
  padding: 14px 74px 14px 14px;
}

  .credits-pack-title {
    font-size: 15px;
  }


  .credits-pack-corner-tag {
    top: 10px;
    right: -46px;
    width: 136px;
    font-size: 10px;
    padding: 6px 0;
  }


}


@media (max-width: 420px) {
  .app-brand-auth .app-brand-logo {
    width: min(100%, 158px);
  }

  .app-brand-profile .app-brand-logo {
    width: min(100%, 142px);
  }

  .app-brand-app .app-brand-logo {
    width: min(100%, 126px);
  }

  video {
    height: 180px;
  }

  h1 {
    font-size: 24px;
  }
}

.credits-pack-card {
  position: relative;
}

.credits-pack-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 18px 0 0 18px;
  background: linear-gradient(180deg, #00e0b8, #00bfa6);
  opacity: 0.95;
}

.credits-pack-main {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title price"
    "credits pill";
  column-gap: 14px;
  row-gap: 10px;
  align-items: start;
}

.credits-pack-title {
  grid-area: title;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: #fff;
  line-height: 1.2;
  min-width: 0;
}





.credits-pack-price {
  grid-area: price;
  font-size: 15px;
  font-weight: 800;
  color: #00e0b8;
  white-space: nowrap;
  text-align: right;
  position: relative;
  z-index: 1;
  align-self: start;
}



.credits-pack-credits {
  grid-area: credits;
  font-size: 13px;
  opacity: 0.9;
  align-self: center;
}

.credits-pack-pill {
  grid-area: pill;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  align-self: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(0, 224, 184, 0.14);
  color: #b8fff1;
  border: 1px solid rgba(0, 224, 184, 0.18);
  white-space: nowrap;
}

.credits-pack-card.is-selected {
  border-color: rgba(0, 224, 184, 0.28);
  box-shadow: 0 16px 34px rgba(0,0,0,0.26);
  background: linear-gradient(180deg, rgba(0,224,184,0.12), rgba(255,255,255,0.06));
}

.credits-pack-card.is-selected::before {
  width: 6px;
}

.credits-pack-selected-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #00e0b8, #00bfa6);
  color: #001d19;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.2px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.2);
}

.credits-pack-corner-tag {
  position: absolute;
  top: 12px;
  right: -42px;
  width: 140px;
  padding: 6px 0;
  text-align: center;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.2px;
  white-space: nowrap;
  transform: rotate(34deg);
  transform-origin: center;
  z-index: 3;
  background: linear-gradient(135deg, #ffd166, #ffb703);
  color: #2a1a00;
  border: 1px solid rgba(255, 209, 102, 0.24);
  box-shadow: 0 8px 18px rgba(0,0,0,0.18);
}

/* =========================
   APP VIEW / ROULETTE
========================= */

#appView.view {
  max-width: 100%;
}

body:has(#appView:not(.hidden)) #app {
  max-width: 1180px;
  padding: 18px 20px 18px;
}

#appView:not(.hidden) {
  width: 100%;
  min-height: 100dvh;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.roulette-shell {
  width: 100%;
  max-width: 1120px;
  min-height: calc(100dvh - 36px);
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 14px;
  align-items: stretch;
}

.roulette-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 2px 0;
}

.roulette-brand-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
}

.roulette-brand {
  justify-content: flex-start;
  margin-bottom: 0;
}

.roulette-top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

#appView .roulette-credits-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  margin: 0;
  border-radius: 999px;
  background: rgba(10, 12, 20, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.roulette-menu {
  position: relative;
}

.roulette-menu summary {
  list-style: none;
}

.roulette-menu summary::-webkit-details-marker {
  display: none;
}

.roulette-menu-trigger {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(10, 12, 20, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
  font-size: 1rem;
  font-weight: 700;
}

.roulette-menu[open] .roulette-menu-trigger {
  background: rgba(18, 22, 38, 0.96);
}

.roulette-menu-sheet {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(86vw, 280px);
  padding: 10px;
  border-radius: 18px;
  background: rgba(16, 20, 36, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 30;
}

.roulette-menu-btn {
  width: 100%;
}

.roulette-video-stage {
  min-height: 0;
  display: flex;
  align-items: stretch;
}

.roulette-video-card {
  position: relative;
  flex: 1;
  min-height: 0;
  height: clamp(460px, 72dvh, 780px);
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 18%, rgba(0, 224, 184, 0.12), transparent 28%),
    radial-gradient(circle at 82% 78%, rgba(255, 77, 109, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(10, 14, 28, 0.98), rgba(5, 8, 18, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 24px 54px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.roulette-video-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.05), transparent 42%),
    linear-gradient(
      90deg,
      rgba(8, 12, 24, 0.92) 0%,
      rgba(14, 18, 32, 0.72) 18%,
      rgba(14, 18, 32, 0.28) 36%,
      rgba(14, 18, 32, 0.28) 64%,
      rgba(14, 18, 32, 0.72) 82%,
      rgba(8, 12, 24, 0.92) 100%
    );
  pointer-events: none;
}

.roulette-empty-state {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 92px 32px 88px;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
}

.roulette-empty-state.is-hidden {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.985);
}

.roulette-empty-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(10, 12, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 16px;
  backdrop-filter: blur(8px);
}

.roulette-empty-title {
  margin: 0 0 12px;
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: #fff;
  max-width: 680px;
}

.roulette-empty-text {
  max-width: 560px;
  margin: 0 0 20px;
  font-size: 0.98rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82);
}

.roulette-empty-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.roulette-empty-hints span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
  font-size: 0.84rem;
  font-weight: 700;
  backdrop-filter: blur(6px);
}



.roulette-video-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 18px;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.22),
    rgba(0, 0, 0, 0.02) 24%,
    rgba(0, 0, 0, 0) 45%
  );
}

.roulette-match-status {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 146px;
  max-width: calc(100% - 148px);
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(10, 12, 20, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.16);
}

#appView #status.roulette-status-text {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.15;
  font-weight: 700;
  opacity: 0.98;
  color: #fff;
}

#appView .roulette-timer.timer {
  margin: 0;
  min-height: 32px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  border-radius: 999px;
  background: rgba(255, 77, 109, 0.16);
  color: #ffd4dd;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#appView .roulette-timer.hidden,
#appView .roulette-timer.timer.hidden {
  display: none !important;
}

.roulette-local-pip {
  position: absolute;
  z-index: 4;
  right: 24px;
  bottom: 24px;
  width: 220px;
  aspect-ratio: 16 / 9;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(8, 10, 18, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.32);
  transition: opacity 220ms ease, transform 220ms ease;
}

.roulette-empty-state:not(.is-hidden) ~ .roulette-local-pip {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.96);
}

#appView #localVideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  object-fit: contain;
  object-position: center center;
  border: none;
  border-radius: 0;
}

#appView #remoteVideo {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  background: transparent;
  object-fit: contain;
  object-position: center center;
  border: none;
  border-radius: 0;
}

.roulette-video-card.is-remote-ready #remoteVideo {
  animation: remoteVideoFadeIn 0.34s ease;
}

@keyframes remoteVideoFadeIn {
  from {
    opacity: 0.18;
    transform: scale(1.015);
    filter: saturate(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: saturate(1);
  }
}

.roulette-local-label {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(10, 12, 20, 0.66);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
  backdrop-filter: blur(8px);
}

.roulette-main-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 12px;
  align-items: center;
}

#appView .roulette-primary-btn,
#appView .roulette-next-btn,
#appView .roulette-like-btn {
  min-height: 56px;
  border-radius: 18px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
}

#appView .roulette-primary-btn {
  background: linear-gradient(135deg, #00e0b8, #00bfa6);
  color: #001d19;
}

#appView .roulette-next-btn {
  background: linear-gradient(135deg, #ff4d6d, #ff2f5e);
  color: #fff;
}

#appView .roulette-like-btn {
  background: linear-gradient(135deg, rgba(255, 77, 109, 0.16), rgba(255,255,255,0.08));
  color: #fff;
  border: 1px solid rgba(255, 77, 109, 0.16);
}

#appView .roulette-like-btn:disabled,
#appView .roulette-next-btn:disabled,
#appView .roulette-primary-btn:disabled {
  opacity: 0.45;
}

.roulette-bottom-dock {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 6px 0 8px;
}

.roulette-dock-btn {
  min-width: 160px;
  min-height: 48px;
  border-radius: 999px;
  background: rgba(12, 16, 30, 0.9);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.roulette-dock-btn-accent {
  background: linear-gradient(135deg, rgba(0,224,184,0.2), rgba(0,191,166,0.14));
  color: #cffff5;
  border-color: rgba(0, 224, 184, 0.16);
}

.roulette-video-card.is-live {
  animation: rouletteLiveEnter 0.34s ease both;
}

@keyframes rouletteLiveEnter {
  from {
    opacity: 0.84;
    transform: scale(0.992);
    filter: saturate(0.88);
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: saturate(1);
  }
}

@media (min-width: 901px) {
  .roulette-shell {
  position: relative;
  }

  .roulette-video-card {
    height: clamp(500px, 74dvh, 820px);
  }

  .roulette-video-card::before {
background:
  radial-gradient(circle at center, rgba(255, 255, 255, 0.05), transparent 40%),
  radial-gradient(circle at 22% 50%, rgba(0, 224, 184, 0.08), transparent 26%),
  radial-gradient(circle at 78% 50%, rgba(255, 77, 109, 0.08), transparent 26%),
  linear-gradient(
    90deg,
    rgba(7, 10, 20, 0.98) 0%,
    rgba(10, 14, 26, 0.9) 16%,
    rgba(16, 20, 36, 0.42) 34%,
    rgba(16, 20, 36, 0.42) 66%,
    rgba(10, 14, 26, 0.9) 84%,
    rgba(7, 10, 20, 0.98) 100%
  );
  }



  .roulette-bottom-dock {
    position: fixed;
    right: 28px;
    top: 50%;
    transform: translateY(90px);
    z-index: 25;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 12px;
    padding: 0;
  }

  .roulette-dock-btn {
    min-width: 170px;
    min-height: 50px;
  }
}

/* APP VIEW responsive */
@media (max-width: 900px) {
  body:has(#appView:not(.hidden)) #app {
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }

  .roulette-shell {
    max-width: 100%;
  }



.roulette-local-pip {
  border-radius: 18px;
}

  .roulette-main-actions {
    grid-template-columns: 1fr 1fr;
  }

  #appView .roulette-like-btn {
    grid-column: 1 / -1;
  }
}


@media (max-width: 640px) {
  body:has(#appView:not(.hidden)) #app {
    padding: 10px 12px 12px;
  }

  .roulette-shell {
    min-height: calc(100dvh - 18px);
    gap: 10px;
    grid-template-rows: auto 1fr auto auto;
  }

    body::before {
    background-position: center 35%;
    background-size: cover;
  }

  .roulette-topbar {
    gap: 10px;
    align-items: center;
  }

  .roulette-top-actions {
    gap: 8px;
  }

  #appView .roulette-credits-badge {
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.88rem;
  }

  .roulette-menu-trigger {
    width: 38px;
    height: 38px;
  }

.roulette-video-card {
  border-radius: 22px;
  height: clamp(400px, 62dvh, 680px);
}






  .roulette-empty-state {
    padding: 86px 18px 132px;
  }

  .roulette-empty-badge {
    margin-bottom: 12px;
  }

  .roulette-empty-title {
    font-size: 1.28rem;
    margin-bottom: 10px;
  }

  .roulette-empty-text {
    font-size: 0.9rem;
    margin-bottom: 14px;
    max-width: 300px;
  }

  .roulette-empty-hints {
    gap: 8px;
    max-width: 290px;
  }

  .roulette-empty-hints span {
    font-size: 0.8rem;
  }

.roulette-video-overlay {
  padding: 14px;
}

.roulette-match-status {
  gap: 6px;
  min-width: 132px;
  max-width: calc(100% - 142px);
  padding: 10px 12px;
  border-radius: 16px;
}

#appView #status.roulette-status-text {
  font-size: 0.9rem;
}

#appView .roulette-timer.timer {
  min-height: 30px;
  padding: 0 11px;
  font-size: 0.88rem;
}

.roulette-local-pip {
  right: 16px;
  bottom: 16px;
  width: 96px;
  aspect-ratio: 9 / 16;
  border-radius: 16px;
}

  .roulette-local-label {
    left: 8px;
    bottom: 8px;
    font-size: 0.68rem;
    padding: 4px 7px;
  }

  .roulette-main-actions {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  #appView .roulette-primary-btn,
  #appView .roulette-next-btn,
  #appView .roulette-like-btn {
    min-height: 48px;
    font-size: 0.92rem;
    border-radius: 16px;
    padding: 0 12px;
  }

  #appView .roulette-like-btn {
    grid-column: 1 / -1;
  }

  .roulette-bottom-dock {
    gap: 8px;
    padding-top: 0;
  }

  .roulette-dock-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    font-size: 0.88rem;
  }
}


@media (max-width: 420px) {

.roulette-video-card {
  height: clamp(370px, 60dvh, 560px);
}

.roulette-local-pip {
  right: 14px;
  bottom: 14px;
  width: 88px;
}

  #appView .roulette-primary-btn,
  #appView .roulette-next-btn,
  #appView .roulette-like-btn {
    font-size: 0.86rem;
  }

  .roulette-dock-btn {
    font-size: 0.84rem;
  }
}




#appView .controls {
  display: none !important;
}

#appView .videos {
  display: none !important;
}

/* =========================
   AUTH VIEWS
========================= */

#loginView:not(.hidden),
#registerView:not(.hidden) {
  min-height: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-card {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 30px 28px 24px;
  border-radius: 28px;
background: linear-gradient(
  180deg,
  rgba(18, 24, 46, 0.78),
  rgba(10, 14, 28, 0.68)
);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
}

.auth-title {
  margin: 0 0 12px;
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
}


.auth-subtitle {
  margin: 0 auto 26px;
  max-width: 340px;
  font-size: 1rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 2px;
  text-align: left;
}

.auth-label {
  display: block;
  width: 100%;
  text-align: left;
  padding-left: 4px;
  font-size: 0.96rem;
  font-weight: 700;
  color: #ffffff;
}

#loginView input,
#registerView input {
  width: 100%;
  background: rgba(255,255,255,0.97);
  color: #111;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 15px 18px;
  margin-bottom: 0;
  font-size: 16px;
  font-family: inherit;
  text-align: left;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  outline: none;
}

#loginView input::placeholder,
#registerView input::placeholder {
  color: #7a7a7a;
}

#loginView input:focus,
#registerView input:focus {
  border-color: rgba(0, 224, 184, 0.45);
  box-shadow:
    0 0 0 3px rgba(0, 224, 184, 0.14),
    0 10px 24px rgba(0, 0, 0, 0.16);
}

.auth-primary-btn {
  width: 100%;
  border: none;
  border-radius: 18px;
  padding: 15px 18px;
  margin-top: 4px;
  font-size: 1rem;
  font-weight: 800;
  background: linear-gradient(135deg, #00e0b8, #00bfa6);
  color: #001d19;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.2);
}

.auth-switch-text {
  margin: 18px 0 0;
  text-align: center;
  font-size: 0.98rem;
  color: rgba(255,255,255,0.84);
}

.auth-switch-link {
  color: #19d7c3;
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.auth-switch-link:hover,
.auth-switch-link:focus {
  color: #35e6d3;
  opacity: 1;
}

.auth-switch-link:active {
  transform: scale(0.98);
}

.view-anim-enter {
  animation: viewFadeSlideIn 0.28s ease both;
}

@keyframes viewFadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =========================
   PROFILE ONBOARDING
========================= */

#profileView {
  padding: 28px 20px 42px;
}

.profile-onboarding-card {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 6px 0 0;
  box-shadow: none;
  backdrop-filter: none;
}

.profile-onboarding-card h1 {
  margin: 0 0 8px;
  text-align: center;
  font-size: clamp(1.75rem, 2.25vw, 2.25rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.profile-onboarding-subtitle {
  max-width: 620px;
  margin: 0 auto 22px;
  text-align: center;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.92rem;
  line-height: 1.4;
}

.profile-form-section {
  margin-bottom: 26px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.profile-form-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ffd4df;
}

.profile-form-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(
    to right,
    rgba(255, 212, 223, 0.28),
    rgba(255, 255, 255, 0.04)
  );
}

.profile-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
}

.profile-field-full {
  grid-column: 1 / -1;
}

.profile-field-label {
  display: block;
  margin: 0 0 8px;
  padding-left: 4px;
  text-align: left;
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
}

#profileView textarea,
#profileView input,
#profileView select {
  width: 100%;
  background: rgba(255, 255, 255, 0.97);
  color: #111;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 14px 16px;
  font-size: 15px;
  margin-bottom: 0;
  box-sizing: border-box;
  outline: none;
  font-family: inherit;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

#profileView textarea {
  min-height: 118px;
  resize: vertical;
}

#profileView textarea::placeholder,
#profileView input::placeholder {
  color: #7a7a7a;
}

#profileView textarea:focus,
#profileView input:focus,
#profileView select:focus {
  border-color: rgba(255, 212, 223, 0.75);
  box-shadow:
    0 0 0 3px rgba(255, 212, 223, 0.18),
    0 10px 24px rgba(0, 0, 0, 0.16);
}

#profileView select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #444 50%),
    linear-gradient(135deg, #444 50%, transparent 50%);
  background-position:
    calc(100% - 24px) calc(50% - 3px),
    calc(100% - 18px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 46px;
}

.profile-save-btn {
  width: 100%;
  max-width: 340px;
  display: block;
  margin: 8px auto 0;
  border: none;
  border-radius: 18px;
  padding: 15px 18px;
  font-size: 0.96rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

button.is-loading {
  opacity: 0.9;
  cursor: wait;
  position: relative;
}

button.is-loading::after {
  content: "";
  width: 16px;
  height: 16px;
  margin-left: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: rgba(255, 255, 255, 0.95);
  display: inline-block;
  vertical-align: middle;
  animation: profileBtnSpin 0.75s linear infinite;
}


@keyframes profileBtnSpin {
  to {
    transform: rotate(360deg);
  }
}

.profile-onboarding-hint {
  max-width: 700px;
  margin: 16px auto 0;
  text-align: center;
  font-size: 0.98rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
}

@media (max-width: 900px) {
  .profile-onboarding-card {
    max-width: 720px;
  }
}

@media (max-width: 640px) {
  #profileView {
    padding: 20px 16px 34px;
  }

  .profile-onboarding-card {
    max-width: 100%;
  }

.profile-onboarding-subtitle {
  margin-bottom: 20px;
  font-size: 0.92rem;
}

  .profile-fields-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

#profileView textarea,
#profileView input,
#profileView select {
  border-radius: 17px;
  padding: 14px 15px;
  font-size: 15px;
}

  .profile-save-btn {
    max-width: 100%;
  }

.profile-onboarding-card h1 {
  font-size: 1.82rem;
  line-height: 1.08;
}

.profile-form-section-title {
  font-size: 0.82rem;
}

.profile-field-label {
  font-size: 0.9rem;
  padding-left: 2px;
  text-align: left;
}

  .app-brand-auth {
    margin-top: 4px;
    margin-bottom: 16px;
  }

  .app-brand-profile {
    margin-bottom: 16px;
  }

  .app-brand-app {
    margin-bottom: 12px;
  }

  .app-brand-auth .app-brand-logo {
    width: min(100%, 170px);
  }

  .app-brand-profile .app-brand-logo {
    width: min(100%, 150px);
  }

  .app-brand-app .app-brand-logo {
    width: min(100%, 132px);
  }

.auth-card {
  max-width: 100%;
  border-radius: 24px;
  padding: 24px 20px 20px;
}
.auth-title {
  font-size: 2.05rem;
  margin-bottom: 10px;
}

.auth-subtitle {
  font-size: 0.97rem;
  margin-bottom: 22px;
}

.auth-label {
  padding-left: 2px;
  font-size: 0.95rem;
}

#loginView input,
#registerView input {
  padding-left: 18px;
  padding-right: 18px;
}


}


.profile-field-error {
  min-height: 18px;
  margin-top: 7px;
  font-size: 0.82rem;
  line-height: 1.25;
  color: #ff9fb3;
  text-align: left;
}

.profile-field-has-error {
  border-color: rgba(255, 120, 150, 0.9) !important;
  box-shadow:
    0 0 0 3px rgba(255, 120, 150, 0.14),
    0 10px 24px rgba(0, 0, 0, 0.16) !important;
}

/* =========================
   GLOBAL VIEW LOADING
========================= */

.view-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  align-items: center;
  justify-content: center;
  background: rgba(7, 10, 20, 0.58);
  backdrop-filter: blur(6px);
  padding: 20px;
}

.view-loading-overlay:not(.hidden) {
  display: flex;
}

.view-loading-overlay.hidden {
  display: none !important;
}

.view-loading-box {
  min-width: 220px;
  max-width: 320px;
  padding: 22px 20px;
  border-radius: 20px;
  background: rgba(22, 27, 48, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.view-loading-spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ffffff;
  animation: viewLoadingSpin 0.8s linear infinite;
}

.view-loading-text {
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
}

@keyframes viewLoadingSpin {
  to {
    transform: rotate(360deg);
  }
}

#remoteAudio {
  display: none;
}

.qa-snapshot-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 6;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 77, 109, 0.92);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  pointer-events: none;
}

/* =========================
   ADMIN DASHBOARD
========================= */

.admin-body {
  overflow-y: auto;
}

.admin-body #app.admin-app-shell {
  max-width: 1320px;
  min-height: 100dvh;
  padding: 28px 24px 42px;
  justify-content: flex-start;
}

.admin-view {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  text-align: left;
}

.admin-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 24px;
  padding: 4px 2px 0;
}

.admin-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.92);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.admin-title {
  margin: 0 0 8px;
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.admin-subtitle {
  max-width: 720px;
  margin: 0;
  color: rgba(255,255,255,0.8);
  font-size: 1rem;
  line-height: 1.55;
}

.admin-hero-meta {
  min-width: 240px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.admin-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(0, 224, 184, 0.14);
  color: #cffff5;
  border: 1px solid rgba(0, 224, 184, 0.18);
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}

.admin-status-pill.is-error {
  background: rgba(255, 77, 109, 0.14);
  color: #ffd6de;
  border-color: rgba(255, 77, 109, 0.22);
}

.admin-status-soft {
  font-size: 13px;
  color: rgba(255,255,255,0.68);
}

.admin-section {
  margin-bottom: 26px;
}

.admin-section-head {
  margin-bottom: 14px;
}

.admin-section-head h2 {
  margin: 0 0 4px;
  font-size: 1.22rem;
  line-height: 1.12;
}

.admin-section-head p {
  margin: 0;
  color: rgba(255,255,255,0.72);
  font-size: 0.94rem;
}

.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.admin-metric-card {
  padding: 16px 16px 14px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.045));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 16px 34px rgba(0,0,0,0.22);
  backdrop-filter: blur(10px);
}

.admin-metric-card.is-accent {
  background:
    linear-gradient(180deg, rgba(0,224,184,0.14), rgba(255,255,255,0.05));
  border-color: rgba(0,224,184,0.18);
}

.admin-metric-card.is-good {
  background:
    linear-gradient(180deg, rgba(0,224,184,0.12), rgba(255,255,255,0.05));
}

.admin-metric-card.is-danger {
  background:
    linear-gradient(180deg, rgba(255,77,109,0.12), rgba(255,255,255,0.05));
}

.admin-metric-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.72);
  margin-bottom: 10px;
  font-weight: 800;
}

.admin-metric-value {
  font-size: 1.35rem;
  line-height: 1.08;
  font-weight: 900;
  color: #fff;
}

.admin-calls-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.admin-call-card {
  padding: 18px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(0,224,184,0.08), transparent 24%),
    radial-gradient(circle at bottom right, rgba(255,77,109,0.08), transparent 26%),
    linear-gradient(180deg, rgba(18,24,42,0.92), rgba(10,14,28,0.92));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 18px 40px rgba(0,0,0,0.24);
}

.admin-call-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.admin-call-room {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 4px;
}

.admin-call-id {
  font-size: 13px;
  color: rgba(255,255,255,0.72);
}

.admin-call-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(0,224,184,0.14);
  color: #cffff5;
  border: 1px solid rgba(0,224,184,0.16);
  font-size: 12px;
  font-weight: 800;
}

.admin-badge-soft {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.92);
  border-color: rgba(255,255,255,0.08);
}

.admin-call-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.admin-call-meta div,
.admin-recent-grid div {
  padding: 12px 12px 10px;
  border-radius: 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.06);
}

.admin-call-meta span,
.admin-recent-grid span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.66);
  font-weight: 800;
  margin-bottom: 8px;
}

.admin-call-meta strong,
.admin-recent-grid strong {
  display: block;
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.35;
}

.admin-ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-call-telemetry-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.admin-telemetry-user {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.06);
}

.admin-telemetry-user-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.admin-telemetry-user-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: #fff;
}

.admin-last-update,
.admin-muted {
  font-size: 12px;
  color: rgba(255,255,255,0.68);
}

.admin-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.admin-telemetry-item {
  padding: 10px 10px 9px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

.admin-telemetry-item span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.64);
  margin-bottom: 6px;
  font-weight: 800;
}

.admin-telemetry-item strong {
  font-size: 0.92rem;
  color: #fff;
  line-height: 1.2;
}

.admin-telemetry-item strong.is-ok {
  color: #8ff7df;
}

.admin-telemetry-item strong.is-bad {
  color: #ffb1c0;
}

.admin-telemetry-empty {
  color: rgba(255,255,255,0.72);
  font-size: 0.92rem;
  line-height: 1.5;
}

.admin-recent-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.admin-recent-card {
  padding: 16px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.04));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 14px 30px rgba(0,0,0,0.18);
}

.admin-recent-main {
  margin-bottom: 12px;
}

.admin-recent-title {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}

.admin-recent-subtitle {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
}

.admin-recent-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-empty-state {
  padding: 28px 20px;
  border-radius: 22px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.035));
  border: 1px solid rgba(255,255,255,0.08);
}

.admin-empty-title {
  font-size: 1.02rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: #fff;
}

.admin-empty-text {
  color: rgba(255,255,255,0.72);
  font-size: 0.95rem;
  line-height: 1.5;
}

@media (max-width: 1180px) {
  .admin-metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-call-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-recent-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .admin-body #app.admin-app-shell {
    padding: 20px 16px 32px;
  }

  .admin-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-hero-meta {
    min-width: 0;
    align-items: flex-start;
  }

  .admin-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-call-telemetry-wrap {
    grid-template-columns: 1fr;
  }

  .admin-telemetry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .admin-title {
    font-size: 1.9rem;
  }

  .admin-metrics-grid {
    grid-template-columns: 1fr;
  }

  .admin-call-meta {
    grid-template-columns: 1fr;
  }

  .admin-recent-grid {
    grid-template-columns: 1fr;
  }

  .admin-telemetry-grid {
    grid-template-columns: 1fr 1fr;
  }

  .admin-call-card,
  .admin-recent-card,
  .admin-metric-card {
    border-radius: 18px;
  }
}

@media (max-width: 420px) {
  .admin-telemetry-grid {
    grid-template-columns: 1fr;
  }
}

.admin-recent-snapshots,
.admin-active-snapshots {
  margin-top: 12px;
}

.admin-active-snapshots-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  color: rgba(255,255,255,0.9);
  font-size: 0.92rem;
  font-weight: 700;
}

.admin-snapshot-empty {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.64);
}

.admin-snapshot-thumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.admin-snapshot-thumb {
  width: 52px;
  height: 52px;
  min-width: 52px;
  min-height: 52px;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  box-shadow: none;
  flex: 0 0 auto;
}

.admin-snapshot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.admin-snapshot-more {
  height: 34px;
  min-width: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 0.78rem;
  font-weight: 800;
  flex: 0 0 auto;
}

.admin-snapshot-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
}

.admin-snapshot-modal.hidden {
  display: none;
}

.admin-snapshot-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 18, 0.82);
  backdrop-filter: blur(6px);
}

.admin-snapshot-modal-card {
  position: relative;
  width: min(92vw, 960px);
  max-height: 90vh;
  margin: 4vh auto 0;
  padding: 16px;
  border-radius: 22px;
  background: rgba(15, 20, 35, 0.96);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 24px 56px rgba(0,0,0,0.34);
}

.admin-snapshot-modal-meta {
  margin-bottom: 12px;
  color: rgba(255,255,255,0.82);
  font-size: 0.92rem;
  font-weight: 700;
}

.admin-snapshot-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 20px;
  font-weight: 800;
}

.admin-snapshot-gallery-card {
  width: min(94vw, 1100px);
}

.admin-snapshot-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-height: calc(90vh - 90px);
  overflow-y: auto;
  padding-right: 4px;
}

.admin-snapshot-gallery-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 18px;
  padding: 12px;
}

.admin-snapshot-gallery-label {
  margin-bottom: 10px;
  color: rgba(255,255,255,0.82);
  font-size: 0.88rem;
  font-weight: 700;
}

.admin-snapshot-gallery-item img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  display: block;
  border-radius: 14px;
  background: #000;
}

.admin-recent-card-compact {
  padding: 14px 18px;
}

.admin-recent-grid-compact {
  grid-template-columns: 1.1fr 0.9fr 1fr 0.6fr 1fr;
  gap: 12px;
  align-items: stretch;
}

.admin-call-card-compact {
  padding: 14px 18px;
}

.admin-call-meta-compact {
  grid-template-columns: 1fr 1fr 0.7fr 1.3fr 0.8fr 0.8fr;
  gap: 12px;
  margin-bottom: 0;
}

.admin-recent-grid-compact div small,
.admin-call-meta-compact div small {
  display: block;
  margin-top: 6px;
  color: rgba(255,255,255,0.62);
  font-size: 0.8rem;
  line-height: 1.2;
}

.admin-recent-preview-col {
  display: flex;
  align-items: center;
  min-height: 52px;
}

.admin-inline-btn {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.08);
  font-weight: 700;
  font-size: 0.88rem;
  width: 100%;
  justify-content: center;
}

.admin-inline-btn:disabled {
  opacity: 0.5;
}

.admin-telemetry-modal-card {
  width: min(94vw, 980px);
}

.admin-telemetry-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.admin-telemetry-detail-card {
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 14px;
}

.admin-telemetry-detail-title {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
}

.admin-telemetry-detail-empty {
  color: rgba(255,255,255,0.72);
  font-size: 0.92rem;
}

.admin-telemetry-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.admin-telemetry-detail-grid div {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.06);
}

.admin-telemetry-detail-grid span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.64);
  font-weight: 800;
  margin-bottom: 6px;
}

.admin-telemetry-detail-grid strong {
  display: block;
  font-size: 0.92rem;
  color: #fff;
}

.admin-snapshot-count-cell,
.admin-center-metric {
  text-align: center;
}

.admin-snapshot-count-cell span,
.admin-snapshot-count-cell strong,
.admin-center-metric span,
.admin-center-metric strong {
  text-align: center;
}

@media (max-width: 1180px) {
  .admin-call-meta-compact,
  .admin-recent-grid-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .admin-call-meta-compact,
  .admin-recent-grid-compact,
  .admin-telemetry-modal-grid,
  .admin-telemetry-detail-grid,
  .admin-snapshot-gallery {
    grid-template-columns: 1fr;
  }
}







