:root {
  /* Orvix Brand Colors */
  --orvix-purple: #8338ec;
  --orvix-purple-bright: #9d4edd;
  --orvix-purple-neon: #a855f7;
  --orvix-dark-purple: #240046;
  --orvix-shadow: #140126;
  --orvix-glow: rgba(131, 56, 236, 0.45);

  /* Twitch Dark Theme Palettes */
  --twitch-bg: #0e0e10;
  --twitch-surface: #18181b;
  --twitch-surface-hover: #1f1f23;
  --twitch-card-border: #26262c;
  --twitch-card-border-hover: #8338ec;
  --twitch-text: #efeff1;
  --twitch-text-muted: #adadb8;
  --twitch-red: #eb0400;
  --twitch-gold: #ffb703;

  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body.twitch-theme {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--twitch-bg);
  color: var(--twitch-text);
  line-height: 1.4;
  overflow-x: hidden;
  padding-bottom: 30px;
}

.app-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Header */
.orvix-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0 8px 0;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.orvix-logo-badge {
  background: #ffffff;
  padding: 4px 10px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(131, 56, 236, 0.45);
  border: 1px solid rgba(131, 56, 236, 0.3);
}

.orvix-logo-img {
  height: 28px;
  width: auto;
  object-fit: contain;
  display: block;
}

.live-pill {
  font-size: 10px;
  font-weight: 800;
  background: rgba(235, 4, 0, 0.15);
  color: var(--twitch-red);
  border: 1px solid rgba(235, 4, 0, 0.35);
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.pulsing-dot {
  width: 6px;
  height: 6px;
  background: var(--twitch-red);
  border-radius: 50%;
  animation: pulseDot 1.4s infinite ease-in-out;
}

@keyframes pulseDot {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 8px var(--twitch-red); }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.btn-orvix-primary {
  background: linear-gradient(135deg, var(--orvix-purple), var(--orvix-purple-bright));
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--orvix-glow);
  transition: transform 0.15s, opacity 0.15s;
}

.btn-orvix-primary:active {
  transform: scale(0.96);
}

/* Category Shelf (Twitch Style) */
.shelf-categories {
  overflow-x: auto;
  scrollbar-width: none;
}
.shelf-categories::-webkit-scrollbar {
  display: none;
}

.shelf-scroll {
  display: flex;
  gap: 8px;
}

.shelf-item {
  background: var(--twitch-surface);
  border: 1px solid var(--twitch-card-border);
  border-radius: 24px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--twitch-text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.shelf-item:hover, .shelf-item.active {
  background: var(--orvix-purple);
  color: #fff;
  border-color: var(--orvix-purple);
  box-shadow: 0 2px 10px var(--orvix-glow);
}

.shelf-icon {
  font-size: 14px;
}

/* Stats Bar */
.orvix-stats-bar {
  background: var(--twitch-surface);
  border: 1px solid var(--twitch-card-border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-val {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
}

.text-neon-purple {
  color: var(--orvix-purple-neon);
}

.stat-sub {
  font-size: 11px;
  color: var(--twitch-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-divider {
  width: 1px;
  height: 24px;
  background: var(--twitch-card-border);
}

/* Twitch Streams Feed */
.twitch-feed {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.feed-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-bar-indicator {
  width: 4px;
  height: 18px;
  background: var(--orvix-purple);
  border-radius: 4px;
  box-shadow: 0 0 8px var(--orvix-glow);
}

.feed-title-wrap h2 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.btn-twitch-icon {
  background: var(--twitch-surface);
  border: 1px solid var(--twitch-card-border);
  color: var(--twitch-text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-twitch-icon:hover {
  background: var(--twitch-surface-hover);
  color: #fff;
}

/* Stream Cards (Twitch 16:9 Thumbnail Preview Style) */
.twitch-streams-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.twitch-card {
  background: var(--twitch-surface);
  border: 1px solid var(--twitch-card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.twitch-card:hover {
  transform: translateY(-2px);
  border-color: var(--twitch-card-border-hover);
  box-shadow: 0 6px 20px rgba(131, 56, 236, 0.25);
}

/* Thumbnail Section (16:9) */
.thumbnail-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  cursor: pointer;
}

.thumbnail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.twitch-card:hover .thumbnail-img {
  transform: scale(1.04);
}

/* Badges on Thumbnail */
.badge-live-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--twitch-red);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  text-transform: uppercase;
}

.badge-viewers-tag {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #efeff1;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.badge-category-tag-thumb {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(36, 0, 70, 0.8);
  border: 1px solid rgba(131, 56, 236, 0.4);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

/* Card Details Section */
.card-details {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stream-meta-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.streamer-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.streamer-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orvix-purple), var(--orvix-dark-purple));
  border: 2px solid var(--orvix-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 0 10px rgba(131, 56, 236, 0.3);
}

.stream-text-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.stream-headline {
  font-size: 14px;
  font-weight: 700;
  color: var(--twitch-text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.streamer-channel-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--twitch-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.verified-icon {
  color: var(--orvix-purple-neon);
}

.stream-category-name {
  font-size: 12px;
  color: var(--twitch-text-muted);
}

/* Tags Pills */
.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.twitch-tag-pill {
  background: rgba(255, 255, 255, 0.06);
  color: var(--twitch-text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
}

/* Card Action Bar */
.card-actions-bar {
  display: grid;
  grid-template-columns: 1.2fr auto auto;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--twitch-card-border);
}

.btn-watch-stream {
  background: linear-gradient(135deg, var(--orvix-purple), #6a11cb);
  color: #fff;
  border: none;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

.btn-watch-stream:hover {
  opacity: 0.92;
}

.btn-watch-stream:active {
  transform: scale(0.98);
}

.btn-chat-stream {
  background: rgba(131, 56, 236, 0.15);
  color: #c792ea;
  border: 1px solid rgba(131, 56, 236, 0.4);
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-chat-stream:hover {
  background: rgba(131, 56, 236, 0.28);
  border-color: rgba(131, 56, 236, 0.7);
}

.btn-chat-stream:active {
  transform: scale(0.98);
}

.btn-donate-stars {
  background: rgba(255, 183, 3, 0.12);
  color: var(--twitch-gold);
  border: 1px solid rgba(255, 183, 3, 0.35);
  padding: 9px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.btn-donate-stars:active {
  transform: scale(0.98);
}

/* Creator Card */
.orvix-creator-card {
  position: relative;
  background: linear-gradient(135deg, #1b0a2a, #120a1f);
  border: 1px solid rgba(131, 56, 236, 0.4);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.creator-card-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.creator-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(131, 56, 236, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.creator-info h3 {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 2px;
}

.creator-info p {
  font-size: 12px;
  color: var(--twitch-text-muted);
  line-height: 1.35;
}

.btn-orvix-glow {
  background: linear-gradient(135deg, var(--orvix-purple), #9d4edd);
  color: #fff;
  border: none;
  padding: 11px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--orvix-glow);
  text-decoration: none;
  display: block;
}

.btn-orvix-glow.full-width {
  width: 100%;
}

.connect-action-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.btn-orvix-secondary {
  background: var(--twitch-surface-hover);
  border: 1px solid var(--twitch-card-border);
  color: #fff;
  padding: 11px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: block;
}

.btn-orvix-secondary:hover {
  background: rgba(131, 56, 236, 0.2);
  border-color: var(--orvix-purple);
}

.btn-orvix-secondary:active {
  transform: scale(0.98);
}

.text-center {
  text-align: center;
}

/* Dev Drawer */
.dev-drawer {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--twitch-card-border);
  border-radius: var(--radius-md);
  padding: 12px;
}

.dev-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--orvix-purple-neon);
}

.text-link {
  background: none;
  border: none;
  color: var(--twitch-text-muted);
  cursor: pointer;
  font-size: 12px;
}

.dev-drawer-body {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dev-tip {
  font-size: 11px;
  color: var(--twitch-text-muted);
}

.dev-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dev-btn {
  background: var(--twitch-surface);
  border: 1px solid var(--twitch-card-border);
  color: var(--twitch-text);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
}

@media (min-width: 500px) {
  .modal-backdrop {
    align-items: center;
    padding: 16px;
  }
}

.modal-backdrop.hidden {
  display: none;
}

.orvix-modal {
  background: var(--twitch-surface);
  border: 1px solid var(--twitch-card-border);
  width: 100%;
  max-width: 480px;
  border-radius: 20px 20px 0 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 500px) {
  .orvix-modal {
    border-radius: 20px;
  }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-title-wrap h3 {
  font-size: 17px;
  font-weight: 800;
}

.modal-close {
  background: none;
  border: none;
  color: var(--twitch-text-muted);
  font-size: 24px;
  cursor: pointer;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stars-grid-select {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.star-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--twitch-card-border);
  color: #fff;
  padding: 10px 4px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.star-chip.active {
  background: rgba(255, 183, 3, 0.2);
  border-color: var(--twitch-gold);
  color: var(--twitch-gold);
}

.orvix-input {
  background: #0e0e10;
  border: 1px solid var(--twitch-card-border);
  border-radius: var(--radius-md);
  padding: 12px;
  color: #fff;
  font-size: 13px;
  outline: none;
}

.orvix-input:focus {
  border-color: var(--orvix-purple);
}

.guide-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.step-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--orvix-purple);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.step-desc {
  font-size: 13px;
  color: var(--twitch-text);
  line-height: 1.4;
}

/* Toast */
.toast-orvix {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--orvix-purple);
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 6px 20px var(--orvix-glow);
  z-index: 2000;
  transition: opacity 0.3s;
}

.toast-orvix.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner-orvix {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(131, 56, 236, 0.2);
  border-top-color: var(--orvix-purple-neon);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 0 auto;
}

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

.loading-state {
  text-align: center;
  padding: 40px 0;
  color: var(--twitch-text-muted);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
