/* GTA VI poster palette: violet, hot pink, sunset orange, turquoise. */
/* Kept outside the custom-theme gate: the glass slider reads this tint. */
html:is([data-theme="gta6"], [data-theme-decor="gta6"], .theme-gta6) {
  --glass-window-rgb: 74, 32, 120;
}

@font-face {
  font-family: "Orbit Poster";
  src: url("/fonts/RussoOne-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

html[data-theme="gta6"]:not([data-theme-custom]),
html[data-theme-decor="gta6"]:not([data-theme-custom]),
html.theme-gta6:not([data-theme-custom]){
  --rail: #2a1458;
  --sidebar: #4a2178;
  --sidebar-head: #3a1870;
  --accent: #ff4f93;
  --accent-hover: #ff6aa8;
  --accent-soft: rgba(255, 79, 147, 0.18);
  --accent-mark: #3ad7e6;
  --mention-bg: rgba(255, 79, 147, 0.24);
  --login-bg: #3a1870;
  --login-glow: rgba(255, 122, 69, 0.45);
  --text-strong: #2a1458;
  --glass-window-bg: rgba(74, 32, 120, 0.28);
  --body-bg: #3a1870;
  --on-wallpaper-text: #fff7fb !important;
  --theme-chrome-text: #ffffff;
  --theme-name-text: #ffe4f2;
  --on-wallpaper-muted: #f6e9ff !important;
  --on-wallpaper-chip: rgba(12, 3, 24, 0.62) !important;
  --on-wallpaper-glow: transparent !important;
  --on-wallpaper-line: rgba(255, 214, 236, 0.38) !important;
}

/* Chat Wallpaper. --theme-chat-image replaces the built-in picture when the configurator sets one. */
html[data-theme="gta6"]:not([data-theme-custom]) .chat-wallpaper,
html[data-theme-decor="gta6"]:not([data-theme-custom]) .chat-wallpaper,
html.theme-gta6:not([data-theme-custom]) .chat-wallpaper{
  background-color: #6e4ad8 !important;
  background-image: var(--theme-chat-image, url('/wallpapers/gta6/chat/beach.jpg')) !important;
  background-position: var(--theme-chat-position, center center) !important;
  background-size: var(--theme-chat-size, cover) !important;
  background-repeat: var(--theme-chat-repeat, no-repeat) !important;
}

/* Sidebar */
html[data-theme="gta6"]:not([data-theme-custom]) .sidebar,
html[data-theme-decor="gta6"]:not([data-theme-custom]) .sidebar,
html.theme-gta6:not([data-theme-custom]) .sidebar{
  isolation: isolate;
  background-color: #4a2178 !important;
  background-image: linear-gradient(180deg, rgba(36, 12, 72, 0.28) 0%, rgba(36, 12, 72, 0.04) 36%, rgba(36, 12, 72, 0) 62%), url('/wallpapers/gta6/side/palms.jpg') !important;
  background-position: center, center bottom !important;
  background-size: cover, cover !important;
  background-repeat: no-repeat, no-repeat !important;
  border-right: 1px solid rgba(255, 79, 147, 0.16) !important;
}

html[data-theme="gta6"]:not([data-theme-custom]) .sidebar-header,
html[data-theme-decor="gta6"]:not([data-theme-custom]) .sidebar-header,
html.theme-gta6:not([data-theme-custom]) .sidebar-header{
  background: transparent !important;
}

html[data-theme="gta6"]:not([data-theme-custom]) .sidebar-footer,
html[data-theme-decor="gta6"]:not([data-theme-custom]) .sidebar-footer,
html.theme-gta6:not([data-theme-custom]) .sidebar-footer{
  background: linear-gradient(180deg, transparent, rgba(42, 16, 84, 0.55)) !important;
}

/* Navigation Rail */
html[data-theme="gta6"]:not([data-theme-custom]) .team-rail,
html[data-theme-decor="gta6"]:not([data-theme-custom]) .team-rail,
html.theme-gta6:not([data-theme-custom]) .team-rail{
  background-color: #2a1458 !important;
  background-image: linear-gradient(180deg, #2a1458 0%, #4a2178 100%) !important;
  border-right: 1px solid rgba(255, 79, 147, 0.2) !important;
}

/* Rail Logo & Team Mark */
html:is([data-theme="gta6"], [data-theme-decor="gta6"], .theme-gta6) :is(.rail-home, .sidebar-team-mark) > img[src*="/logo.png"] {
  content: url('/wallpapers/gta6-logo.jpg') !important;
  object-fit: cover !important;
  border-radius: 50%;
}

html:is([data-theme="gta6"], [data-theme-decor="gta6"], .theme-gta6) :is(.team-name, .channel-title, #channel-name) {
  font-family: "Orbit Poster", "Russo One", sans-serif !important;
  letter-spacing: 0.02em;
}
html:is([data-theme="gta6"], [data-theme-decor="gta6"], .theme-gta6) .team-name {
  color: var(--theme-sidebar-text, #ffffff) !important;
}
html:is([data-theme="gta6"], [data-theme-decor="gta6"], .theme-gta6) :is(.channel-title, #channel-name, .channel-title-dialogues) {
  color: var(--theme-chrome-text, #ffffff) !important;
}
html:is([data-theme="gta6"], [data-theme-decor="gta6"], .theme-gta6) .msg-name {
  color: var(--theme-name-text, #ffe4f2) !important;
}
html:is([data-theme="gta6"], [data-theme-decor="gta6"], .theme-gta6) .profile-visit :is(h2, .visit-name input, #card-role) {
  color: var(--theme-chrome-text, #ffffff) !important;
  border-bottom-color: rgba(255, 228, 242, 0.35);
}
html:is([data-theme="gta6"], [data-theme-decor="gta6"], .theme-gta6) .profile-visit :is(#card-handle, #card-status, .card-presence) {
  color: var(--theme-name-text, #ffe4f2) !important;
}
html:is([data-theme="gta6"], [data-theme-decor="gta6"], .theme-gta6) .section-head > span:first-child {
  font-family: "Orbit Poster", "Russo One", sans-serif !important;
  letter-spacing: 0.12em;
  opacity: 0.95;
  color: #fff;
}

/* Rail Active Item / Indicators */
html[data-theme="gta6"]:not([data-theme-custom]) .team-rail .team-mark.active,
html[data-theme="gta6"]:not([data-theme-custom]) .team-rail .rail-item.active{
  box-shadow: 0 0 12px rgba(255, 79, 147, 0.55), inset 0 0 0 2px #ff4f93 !important;
}

/* Sidebar Filter / Search */
html[data-theme="gta6"]:not([data-theme-custom]) .sidebar .filter,
html[data-theme-decor="gta6"]:not([data-theme-custom]) .sidebar .filter,
html.theme-gta6:not([data-theme-custom]) .sidebar .filter{
  background: rgba(255, 255, 255, 0.07) !important;
  border: 1px solid rgba(255, 79, 147, 0.32) !important;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.25) !important;
  color: #f5edff !important;
}
html[data-theme="gta6"]:not([data-theme-custom]) .sidebar .filter::placeholder,
html[data-theme-decor="gta6"]:not([data-theme-custom]) .sidebar .filter::placeholder,
html.theme-gta6:not([data-theme-custom]) .sidebar .filter::placeholder{
  color: #ffe4f2 !important;
}

/* Sidebar Navigation Items */
html[data-theme="gta6"]:not([data-theme-custom]) .sidebar .nav-item,
html[data-theme-decor="gta6"]:not([data-theme-custom]) .sidebar .nav-item,
html.theme-gta6:not([data-theme-custom]) .sidebar .nav-item{
  color: #ddd6fe;
  transition: all 0.15s ease;
}

html[data-theme="gta6"]:not([data-theme-custom]) .sidebar .nav-item:hover,
html[data-theme-decor="gta6"]:not([data-theme-custom]) .sidebar .nav-item:hover,
html.theme-gta6:not([data-theme-custom]) .sidebar .nav-item:hover{
  background: rgba(255, 79, 147, 0.14) !important;
  color: #ffffff !important;
}

html[data-theme="gta6"]:not([data-theme-custom]) .sidebar .nav-item.active,
html[data-theme-decor="gta6"]:not([data-theme-custom]) .sidebar .nav-item.active,
html.theme-gta6:not([data-theme-custom]) .sidebar .nav-item.active{
  background: linear-gradient(90deg, rgba(255, 79, 147, 0.35) 0%, rgba(139, 92, 246, 0.22) 100%) !important;
  box-shadow: inset 3px 0 0 #ff4f93, 0 2px 10px rgba(255, 79, 147, 0.25) !important;
  color: #ffffff !important;
  font-weight: 600;
}

html[data-theme="gta6"]:not([data-theme-custom]) .sidebar .nav-item.active .badge,
html[data-theme-decor="gta6"]:not([data-theme-custom]) .sidebar .nav-item.active .badge,
html.theme-gta6:not([data-theme-custom]) .sidebar .nav-item.active .badge{
  background: #ff4f93 !important;
  color: #ffffff !important;
  box-shadow: 0 0 8px rgba(255, 79, 147, 0.6) !important;
}

/* Channel Header & Composer Shell */
html[data-theme="gta6"]:not([data-theme-custom]) .channel-header,
html[data-theme="gta6"]:not([data-theme-custom]) .composer-shell,
html[data-theme-decor="gta6"]:not([data-theme-custom]) .channel-header,
html[data-theme-decor="gta6"]:not([data-theme-custom]) .composer-shell,
html.theme-gta6:not([data-theme-custom]) .channel-header,
html.theme-gta6:not([data-theme-custom]) .composer-shell{
  background: rgba(48, 18, 92, 0.78) !important;
  border: 1px solid rgba(255, 154, 90, 0.4) !important;
  box-shadow: inset 0 1px 0 rgba(255, 196, 150, 0.28), 0 4px 22px rgba(42, 16, 84, 0.35) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  backdrop-filter: blur(16px) !important;
}

html[data-theme="gta6"]:not([data-theme-custom]) .channel-title,
html[data-theme-decor="gta6"]:not([data-theme-custom]) .channel-title,
html.theme-gta6:not([data-theme-custom]) .channel-title{
  color: #ffffff !important;
  font-weight: 700 !important;
  letter-spacing: 0.2px;
}

html[data-theme="gta6"]:not([data-theme-custom]) .channel-topic,
html[data-theme-decor="gta6"]:not([data-theme-custom]) .channel-topic,
html.theme-gta6:not([data-theme-custom]) .channel-topic{
  color: #ffe4f2 !important;
}

/* Composer Input & Send Button */
html[data-theme="gta6"]:not([data-theme-custom]) .composer-input,
html[data-theme-decor="gta6"]:not([data-theme-custom]) .composer-input,
html.theme-gta6:not([data-theme-custom]) .composer-input{
  color: #f5edff !important;
}

html:is([data-theme="gta6"], [data-theme-decor="gta6"], .theme-gta6) :is(.composer-attach-src, .composer-fmt-btn, .composer .icon-btn, .composer-tools .icon-btn) {
  color: var(--theme-chrome-text, #ffffff) !important;
}
html:is([data-theme="gta6"], [data-theme-decor="gta6"], .theme-gta6) .composer-format {
  border-bottom-color: rgba(255, 255, 255, 0.28);
}

html[data-theme="gta6"]:not([data-theme-custom]) #composer-send,
html[data-theme-decor="gta6"]:not([data-theme-custom]) #composer-send,
html.theme-gta6:not([data-theme-custom]) #composer-send{
  background: linear-gradient(135deg, #ff4f93 0%, #f43f5e 50%, #f97316 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 14px rgba(255, 79, 147, 0.5) !important;
  border: none !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

html[data-theme="gta6"]:not([data-theme-custom]) #composer-send:hover,
html[data-theme-decor="gta6"]:not([data-theme-custom]) #composer-send:hover,
html.theme-gta6:not([data-theme-custom]) #composer-send:hover{
  transform: scale(1.05);
  box-shadow: 0 3px 18px rgba(255, 79, 147, 0.65) !important;
}

/* Glass Chat Window Frame */
@media (min-width: 801px) {
  html[data-theme="gta6"]:not([data-theme-custom]).chat-chrome-overlay .main::after,
  html[data-theme-decor="gta6"]:not([data-theme-custom]).chat-chrome-overlay .main::after,
  html.theme-gta6:not([data-theme-custom]).chat-chrome-overlay .main::after,
  html[data-theme="gta6"]:not([data-theme-custom]) .main::after,
  html[data-theme-decor="gta6"]:not([data-theme-custom]) .main::after,
  html.theme-gta6:not([data-theme-custom]) .main::after {
    background: var(--glass-window-bg, rgba(16, 7, 30, 0.62)) !important;
    border: 1px solid rgba(255, 79, 147, 0.22) !important;
    box-shadow: inset 0 0 0 1px rgba(255, 79, 147, 0.12), inset 0 1px 12px rgba(255, 79, 147, 0.08), 0 12px 35px rgba(8, 2, 18, 0.55) !important;
  }
}

/* Messages styling. Bubbles are .msg / .msg.mine, not incoming/outgoing. */
html[data-theme="gta6"]:not([data-theme-custom]) .msg.mine:not(.image-only, .emoji-only, .video-note-only, .task-only, .poll-only) .msg-bubble,
html[data-theme-decor="gta6"]:not([data-theme-custom]) .msg.mine:not(.image-only, .emoji-only, .video-note-only, .task-only, .poll-only) .msg-bubble,
html.theme-gta6:not([data-theme-custom]) .msg.mine:not(.image-only, .emoji-only, .video-note-only, .task-only, .poll-only) .msg-bubble{
  background: linear-gradient(135deg, #ff4f93 0%, #ff7a45 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 12px rgba(255, 79, 147, 0.32) !important;
}

html[data-theme="gta6"]:not([data-theme-custom]) .msg:not(.mine):not(.image-only, .emoji-only, .video-note-only, .task-only, .poll-only) .msg-bubble,
html[data-theme-decor="gta6"]:not([data-theme-custom]) .msg:not(.mine):not(.image-only, .emoji-only, .video-note-only, .task-only, .poll-only) .msg-bubble,
html.theme-gta6:not([data-theme-custom]) .msg:not(.mine):not(.image-only, .emoji-only, .video-note-only, .task-only, .poll-only) .msg-bubble{
  background: rgba(42, 20, 84, 0.9) !important;
  color: #f5f3ff !important;
  border: 1px solid rgba(255, 79, 147, 0.2) !important;
  backdrop-filter: blur(8px) !important;
}

html:is([data-theme="gta6"], [data-theme-decor="gta6"], .theme-gta6) :is(.msg.emoji-only, .msg.image-only, .msg.video-note-only) .msg-bubble {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme="gta6"]:not([data-theme-custom]) .msg.mine .msg-time,
html[data-theme-decor="gta6"]:not([data-theme-custom]) .msg.mine .msg-time,
html.theme-gta6:not([data-theme-custom]) .msg.mine .msg-time{
  color: rgba(255, 255, 255, 0.82) !important;
}

html:is([data-theme="gta6"], [data-theme-decor="gta6"], .theme-gta6):not([data-theme-custom]) .msg.mine :is(.msg-body, .msg-body a, .msg-name, .mention){
  color: #ffffff !important;
}
html:is([data-theme="gta6"], [data-theme-decor="gta6"], .theme-gta6):not([data-theme-custom]) .msg:not(.mine) :is(.msg-body, .msg-body a, .msg-name){
  color: #fff7fb !important;
}
html:is([data-theme="gta6"], [data-theme-decor="gta6"], .theme-gta6) :is(.user-menu, .user-menu-row, .user-menu-id strong){
  color: #2a1458 !important;
}
html:is([data-theme="gta6"], [data-theme-decor="gta6"], .theme-gta6) .user-menu-row.selected{
  color: #c4186a !important;
}

/* Message Meta & Action Links */
html[data-theme="gta6"]:not([data-theme-custom]) .msg-author,
html[data-theme-decor="gta6"]:not([data-theme-custom]) .msg-author,
html.theme-gta6:not([data-theme-custom]) .msg-author{
  color: #ff8a4a !important;
  font-weight: 600;
}

html[data-theme="gta6"]:not([data-theme-custom]) .msg-time,
html[data-theme-decor="gta6"]:not([data-theme-custom]) .msg-time,
html.theme-gta6:not([data-theme-custom]) .msg-time{
  color: #ffe4f2 !important;
}

/* Mentions & Badges */
html[data-theme="gta6"]:not([data-theme-custom]) .mention-pill,
html[data-theme-decor="gta6"]:not([data-theme-custom]) .mention-pill,
html.theme-gta6:not([data-theme-custom]) .mention-pill{
  background: rgba(255, 79, 147, 0.22) !important;
  color: #ff60a8 !important;
  border: 1px solid rgba(255, 79, 147, 0.4) !important;
}

/* Buttons / Actions */
html[data-theme="gta6"]:not([data-theme-custom]) .btn.primary,
html[data-theme-decor="gta6"]:not([data-theme-custom]) .btn.primary,
html.theme-gta6:not([data-theme-custom]) .btn.primary{
  background: linear-gradient(135deg, #ff4f93 0%, #f43f5e 60%, #f97316 100%) !important;
  border: none !important;
  box-shadow: 0 2px 12px rgba(255, 79, 147, 0.45) !important;
}

/* Theme preview in Settings */
html[data-theme="gta6"]:not([data-theme-custom]) .theme-choice-preview-gta6,
html[data-theme-decor="gta6"]:not([data-theme-custom]) .theme-choice-preview-gta6,
html.theme-gta6:not([data-theme-custom]) .theme-choice-preview-gta6{
  background: url('/wallpapers/gta6/chat/beach.jpg') center / cover !important;
}
.theme-choice-preview-gta6 {
  background: url('/wallpapers/gta6/chat/beach.jpg') center / cover !important;
}
.theme-choice-preview-gta6 .theme-choice-side {
  background: rgba(24, 9, 44, 0.45) !important;
}

/* Mobile responsive */
@media (max-width: 800px) {
  html[data-theme="gta6"]:not([data-theme-custom]) .chat-wallpaper,
  html[data-theme-decor="gta6"]:not([data-theme-custom]) .chat-wallpaper,
  html.theme-gta6:not([data-theme-custom]) .chat-wallpaper {
    background-position: center center !important;
  }

  html[data-theme="gta6"].ios-device:not([data-theme-custom]) .sidebar,
  html[data-theme="gta6"]:not([data-theme-custom]) .sidebar,
  html[data-theme-decor="gta6"].ios-device:not([data-theme-custom]) .sidebar,
  html[data-theme-decor="gta6"]:not([data-theme-custom]) .sidebar,
  html.theme-gta6.ios-device:not([data-theme-custom]) .sidebar,
  html.theme-gta6:not([data-theme-custom]) .sidebar{
    background-image: linear-gradient(180deg, rgba(36, 12, 72, 0.28) 0%, rgba(36, 12, 72, 0.04) 36%, rgba(36, 12, 72, 0) 62%), url('/wallpapers/gta6/side/palms.jpg') !important;
    background-position: center, center bottom !important;
    background-size: cover, cover !important;
    background-repeat: no-repeat, no-repeat !important;
  }

  html[data-theme="gta6"].chat-chrome-overlay:not([data-theme-custom]) .main::after,
  html[data-theme-decor="gta6"].chat-chrome-overlay:not([data-theme-custom]) .main::after,
  html.theme-gta6.chat-chrome-overlay:not([data-theme-custom]) .main::after{
    background: var(--glass-window-bg, rgba(16, 7, 30, 0.62)) !important;
    border: 1px solid rgba(255, 79, 147, 0.22) !important;
    box-shadow: inset 0 0 0 1px rgba(255, 79, 147, 0.12), 0 8px 24px rgba(8, 2, 18, 0.45) !important;
  }

  html[data-theme="gta6"]:not([data-theme-custom]) .channel-header,
  html[data-theme="gta6"]:not([data-theme-custom]) .composer-shell,
  html[data-theme-decor="gta6"]:not([data-theme-custom]) .channel-header,
  html[data-theme-decor="gta6"]:not([data-theme-custom]) .composer-shell,
  html.theme-gta6:not([data-theme-custom]) .channel-header,
  html.theme-gta6:not([data-theme-custom]) .composer-shell{
    border-radius: 14px !important;
  }

  /* Keep the desktop type scale: the phone menu otherwise enlarges the list. */
  html:is([data-theme="gta6"], [data-theme-decor="gta6"], .theme-gta6) #chat-nav .nav-item {
    font-size: calc(14px * var(--text-scale, 1));
    font-weight: 400;
  }
  html:is([data-theme="gta6"], [data-theme-decor="gta6"], .theme-gta6) #chat-nav .section-head > span:first-child {
    font-family: "Orbit Poster", "Russo One", sans-serif !important;
    font-size: calc(12px * var(--text-scale, 1));
    letter-spacing: 0.12em;
  }
  html:is([data-theme="gta6"], [data-theme-decor="gta6"], .theme-gta6) :is(.team-name, .channel-title, #channel-name) {
    font-family: "Orbit Poster", "Russo One", sans-serif !important;
    font-size: calc(16px * var(--text-scale, 1));
    letter-spacing: 0.02em;
  }
  html:is([data-theme="gta6"], [data-theme-decor="gta6"], .theme-gta6) .sidebar-footer .sidebar-me-name {
    font-size: calc(14px * var(--text-scale, 1));
    font-weight: 700;
  }
}
