/* ===========================================
   F1 FORMULA 1 - MINIMALIST CHAT WIDGET
   Theme: Clean, technical, race-inspired
   =========================================== */

/* === TYPOGRAPHY === */
@import url("https://fonts.googleapis.com/css2?family=Titillium+Web:wght@300;400;600;700;900&family=JetBrains+Mono:wght@400;500;600;700&family=Outfit:wght@400;500;600;700;800;900&family=Share+Tech+Mono&family=Rajdhani:wght@300;400;500;600;700&family=Orbitron:wght@400;500;600;700;800;900&display=swap");

@font-face {
  font-family: "Formula1";
  src: url("../fonts/Formula1-Regular_web_0.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "Formula1";
  src: url("../fonts/Formula1-Display-Bold-Bold.ttf.woff") format("woff");
  font-weight: 700;
  font-style: normal;
}


/* === DESIGN TOKENS === */
:root {
  /* F1 Core Colors */
  --f1-red: #d80d0d;
  --f1-red-rgb: 216, 13, 13;
  --f1-white: #ffffff;
  --f1-black: #0f1014;
  --f1-black-rgb: 15, 16, 20;
  --f1-dark: #1a1a2e;
  --f1-gray-100: #f0f0f0;
  --f1-gray-200: #c8c8c8;
  --f1-gray-300: #8c8c8c;
  --f1-gray-400: #505060;
  --f1-gray-500: #38384a;
  --f1-gray-600: #2a2a3c;
  --f1-gray-700: #1e1e30;

  /* Accent Colors */
  --f1-green: #00d2be;
  --f1-green-rgb: 0, 210, 190;
  --f1-yellow: #ffd700;
  --f1-yellow-rgb: 255, 215, 0;
  --f1-purple: #9b59b6;
  --f1-blue: #3498db;

  /* Sector Colors */
  --sector-best: #a855f7;
  --sector-personal: #22c55e;
  --sector-slower: #eab308;

  /* Custom VIP Tokens */
  --takeru-yellow: var(--f1-yellow);
  --takeru-yellow-rgb: var(--f1-yellow-rgb);

  /* Backgrounds */
  --bg-dark: var(--f1-black);
  --bg-panel: var(--f1-dark);
  --bg-overlay: rgba(21, 21, 30, 0.85);
  --bg-solid: rgba(15, 16, 20, 0.99);

  /* Text */
  --text-bright: var(--f1-white);
  --text-dim: rgba(255, 255, 255, 0.7);
  --text-stroke: none;

  /* Glows - Minimal */
  --glow-yellow: none;
  --glow-cyan: none;
  --glow-red: none;

  /* VIP */
  --vip-gold: #8A29A4;
  --vip-glow: none;

  /* Dimensions */
  --container-width: 340px;
  --username-size: 1.1rem;
  --message-size: 0.9rem;

  /* Animation */
  --transition-speed: 0.3s;
  --transition-ease: cubic-bezier(0.4, 0, 0.2, 1);

  /* XP System Colors (override) */
  --xp-primary: var(--f1-red);
  --xp-primary-rgb: var(--f1-red-rgb);
  --xp-primary-dark: #b00500;
  --xp-primary-light: #ff2d22;
  --xp-accent: #8A29A4;
  --xp-bg: var(--f1-black);
  --xp-text: var(--f1-white);
  --xp-text-secondary: rgba(255, 255, 255, 0.5);

  /* Fonts */
  --font-f1turbo: "Formula1", "Titillium Web", sans-serif;
  --font-orbitron: "Outfit", "Titillium Web", sans-serif;
  --font-rajdhani: "Titillium Web", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

/* === RESET & BASE === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background-color: transparent;
  color: var(--text-bright);
  font-family: "Titillium Web", sans-serif;
  min-height: 100vh;
  padding: 0;
  overflow: hidden; /* Prevent scrolls from any widget */
}

/* === UTILITY === */
.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
  transform: translateX(-15px);
}

/* =========================================
   WATCH TIME BADGE (LURK)
   ========================================= */
.time-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--f1-green-rgb), 0.08);
  border: 1px solid rgba(var(--f1-green-rgb), 0.3);
  color: var(--f1-green);
  padding: 2px 8px;
  font-size: 10px;
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  height: auto;
}

.time-badge .label {
  margin-right: 4px;
  opacity: 0.7;
  font-size: 9px;
}

/* === KEYFRAMES (Minimal / Clean) === */
@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

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

@keyframes fadeOutSmooth {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-8px); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutLeft {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-20px); }
}

@keyframes pingPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@keyframes dataFlow {
  0% { left: -30%; }
  100% { left: 100%; }
}

@keyframes cyberEQ {
  0%, 100% { height: 3px; opacity: 0.05; }
  50% { height: 18px; opacity: 0.25; }
}

@keyframes digitalRain {
  0% { background-position: 0 0, 20px 20px; }
  100% { background-position: 0 40px, 20px 80px; }
}

@keyframes gradientFlow {
  0%, 100% { background-position: 0% 0%; }
  50% { background-position: 0% 100%; }
}

@keyframes decryptPulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

@keyframes scanlines {
  0% { background-position: 0 0; }
  100% { background-position: 0 4px; }
}

@keyframes usernameGlow {
  0%, 100% { color: var(--f1-white); }
}

@keyframes adminGlow {
  0%, 100% { color: var(--f1-white); }
}

@keyframes topBadgePulse {
  0%, 100% { border-color: var(--f1-red); }
}

@keyframes adminBadgePulse {
  0%, 100% { border-color: var(--f1-red); }
}

@keyframes activeBorderPulse {
  0%, 100% { border-color: rgba(var(--f1-red-rgb), 0.2); }
}

@keyframes activeBorderPulseCyan {
  0%, 100% { border-color: rgba(var(--f1-green-rgb), 0.2); }
}

@keyframes redBarPulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

@keyframes fadeInSlide {
  0% { opacity: 0; transform: translateX(-20px); }
  100% { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOutSlide {
  0% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(-20px); }
}


/* ===========================================
   CONTAINER - F1 Timing Panel
   =========================================== */
.container-wrapper {
  perspective: 600px;
  perspective-origin: left center;
  position: absolute;
  left: 0;
  bottom: 20%;
  transform: scale(1.27);
  transform-origin: bottom left;
}

.container {
  width: var(--container-width);
  background: rgba(var(--f1-black-rgb), 0.99);
  position: relative;
  overflow: visible;
  display: flex;
  flex-direction: column;

  min-height: 405px;
  height: 405px;
  max-height: 405px;

  /* 3D HUD effect - Positive rotation to compress RIGHT side */
  transform: translateX(0) rotateY(5deg) scale(1) !important;
  transform-origin: left center;

  /* Cyberpunk corner cuts - Bottom Right cut (subtle) */
  clip-path: none;
  border-radius: 8px;

  /* Subtle border and shadow */
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.03);

  /* Smooth transitions */
  transition: opacity 0.4s ease, transform 0.4s ease;
  opacity: 1;
  will-change: opacity, transform;
}

.container.hidden {
  opacity: 0 !important;
  transform: translateX(-10px) rotateY(5deg) scale(0.99) !important;
  pointer-events: none;
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.container:not(.hidden) {
  opacity: 1;
  transform: translateX(0) rotateY(5deg) scale(1);
}

/* No decorative ::before / ::after */
.container::before {
  display: none;
}

.container::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 5;
  background: none !important;
}

/* Pinned Announcement Component (Top of Screen - Large F1 Broadcast Style) */
.pinned-announcement-top {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  pointer-events: none;
  animation: pinTopDropIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pinTopDropIn {
  from {
    opacity: 0;
    transform: translate(-50%, -24px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

.pinned-announcement-top__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  background: rgba(15, 16, 20, 0.96);
  backdrop-filter: blur(12px);
  border: 2px solid rgba(0, 210, 190, 0.55);
  border-bottom: 4px solid var(--f1-green);
  border-radius: 10px;
  padding: 12px 28px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.75), 0 0 25px rgba(0, 210, 190, 0.22);
  max-width: 90vw;
}

.pinned-announcement-top__badge {
  font-family: var(--font-f1turbo, "Formula1", sans-serif);
  font-size: 18px;
  font-weight: 800;
  color: #0f1014;
  background: var(--f1-green);
  padding: 4px 14px;
  border-radius: 6px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 0 14px rgba(0, 210, 190, 0.5);
}

.pinned-announcement-top__text {
  font-family: "Outfit", "Titillium Web", sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.5px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

/* Particles - hidden in F1 theme */
.particles-bg {
  display: none !important;
}

/* Status variants (keep classes for JS) */
.container.status-red,
.container.top-user,
.container.vip-user,
.container.admin-user,
.container.ranked-user {
  opacity: 1;
  transform: translateX(0) rotateY(5deg) scale(1);
}

/* ===========================================
   STATUS BAR - Race Header Strip
   =========================================== */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 12px;
  background: var(--f1-black);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  height: 34px;
  min-height: 34px;
  box-sizing: border-box;
  border-radius: 8px 8px 0 0;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--f1-gray-400);
  border-radius: 50%;
  animation: statusPulse 2s ease-in-out infinite;
}

.status-text,
.status-bar .status-text {
  display: none !important;
}

.status-divider {
  display: none;
}

.status-code {
  display: block;
  color: #8c8c8c;
  font-family: var(--font-f1turbo);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 400;
  margin-left: auto;
  text-align: right;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Status Bar variants */
.container.status-red .status-bar {
  border-bottom: 2px solid rgb(31, 31, 37);
}

.container.status-red .status-dot {
  background: var(--f1-red);
}

/* ===========================================
   HEADER - Driver Card
   =========================================== */
.header {
  padding: 14px 16px 16px 8px;
  position: relative;
  background: transparent;
  min-height: 158px;
  height: 158px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

/* ===========================================
   USER IDENTITY - Driver Name
   =========================================== */
.user-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  background-color: transparent;
  overflow: hidden;
  transition: opacity 0.4s ease-out;
}

.user-identity__badges {
  display: none !important;
}

.user-identity__icon {
  display: block;
  height: 24px;
  max-width: 60px;
  width: auto;
  margin-right: 0;
  filter: none;
  object-fit: contain;
  flex: 0 0 auto;
  transition: opacity 0.4s ease-out;
}

.user-identity__name,
.driver-name {
  margin: 0;
  font-family: var(--font-f1turbo);
  font-weight: 700;
  text-transform: uppercase;
  font-style: normal;
  font-size: var(--username-size);
  color: var(--f1-white);
  letter-spacing: 1px;
  text-shadow: none;
  position: relative;
  white-space: nowrap;
  line-height: 1.6;
  border-right: none;
  height: 1.6em;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: visible;
  transition: opacity 0.4s ease-out;
}

/* Size variants */
.user-identity__name.small-text,
.driver-name.small-text {
  font-size: 1.15rem !important;
  letter-spacing: 1.5px;
}

.user-identity__name.extra-small-text,
.driver-name.extra-small-text {
  font-size: 0.95rem !important;
  letter-spacing: 1px;
}

.user-identity__badges {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-left: auto;
  gap: 6px;
  flex: 0 0 auto;
  min-width: max-content;
}

/* ===========================================
   BADGE STYLES - Clean F1 Tag
   =========================================== */
.badge,
.user-badge {
  display: none;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 10px;
  text-transform: uppercase;
  white-space: nowrap;
  position: relative;
  border-radius: 4px;
}

/* VIP Badge */
.badge.vip,
.user-badge.vip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--f1-white);
  background: rgba(var(--f1-red-rgb), 0.15);
  border: 1px solid rgba(var(--f1-red-rgb), 0.4);
  padding: 4px 10px;
  border-radius: 4px;
}

.badge.vip::before,
.user-badge.vip::before {
  content: none;
}

/* TOP Badge */
.badge.top-user,
.user-badge.top-user {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--f1-white);
  background: var(--f1-red);
  border: none;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 4px;
  animation: none;
}

.badge.top-user::before,
.user-badge.top-user::before {
  content: none;
}

/* Admin Badge */
.badge.admin,
.user-badge.admin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--f1-white);
  background: linear-gradient(135deg, var(--f1-red), #ff2d22);
  border: none;
  padding: 4px 10px;
  font-size: 10px;
  border-radius: 4px;
}

.badge.admin::before,
.user-badge.admin::before {
  content: none;
}

/* Ranked Badge */
.badge.ranked,
.user-badge.ranked {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 4px 10px;
  border-radius: 4px;
}

.badge.ranked::before,
.user-badge.ranked::before {
  content: none;
}

/* ===========================================
   RANK ICONS & NUMBERS (F1 Edition)
   =========================================== */
.user-identity__rank-number {
  font-family: "Formula1", sans-serif;
  font-size: 18px;
  font-weight: 400;
  color: var(--f1-white);
  background: var(--f1-red);
  min-width: 40px;
  height: 40px;
  text-align: center;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  line-height: 1 !important;
  padding-top: 0px !important; /* Visual correction for F1 font center */
  transition: opacity 0.4s ease-out;
}

.user-identity__rank-number:empty {
  display: none;
}
[id^="rank-icon"] {
  display: none;
  width: 14px;
  height: 14px;
  background-color: var(--f1-green);
  position: relative;
}

.icon-admin { background-color: var(--f1-red) !important; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.icon-admin::after { content: "⚡"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -55%); font-size: 8px; color: #000; }

.icon-skull { clip-path: polygon(20% 0, 80% 0, 100% 30%, 80% 100%, 20% 100%, 0 30%); }
.icon-skull::after { content: ""; position: absolute; top: 3px; left: 3px; right: 3px; bottom: 3px; background: #000; clip-path: polygon(20% 0, 80% 0, 100% 30%, 80% 100%, 20% 100%, 0 30%); }
.icon-corp { background-color: var(--f1-yellow) !important; clip-path: polygon(20% 100%, 20% 20%, 40% 20%, 40% 10%, 60% 10%, 60% 20%, 80% 20%, 80% 100%); }
.icon-sword { background-color: var(--f1-yellow) !important; clip-path: polygon(10% 0, 0 10%, 40% 50%, 0 90%, 10% 100%, 50% 60%, 90% 100%, 100% 90%, 60% 50%, 100% 10%, 90% 0, 50% 40%); }
.icon-eye { border: 1px solid var(--f1-yellow); border-radius: 50%; background: transparent !important; }
.icon-eye::after { content: ""; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 4px; height: 4px; background: var(--f1-yellow); border-radius: 50%; }
.icon-cross { background-color: var(--f1-red) !important; clip-path: polygon(35% 0, 65% 0, 65% 35%, 100% 35%, 100% 65%, 65% 65%, 65% 100%, 35% 100%, 35% 65%, 0 65%, 0 35%, 35% 35%); }
.icon-chip { background-color: var(--f1-green) !important; clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 80% 100%, 80% 80%, 20% 80%, 20% 100%, 0% 100%, 0% 80%, 20% 80%, 20% 20%, 0% 20%); }
.icon-oni { background-color: var(--f1-red) !important; clip-path: polygon(20% 0, 80% 0, 100% 40%, 80% 100%, 50% 80%, 20% 100%, 0 40%); }
.icon-med { background-color: var(--f1-red) !important; clip-path: circle(50% at 50% 50%); }
.icon-med::after { content: "+"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -55%); color: #000; font-weight: bold; font-size: 10px; }
.icon-target { border: 1px solid var(--f1-red); border-radius: 50%; background: transparent !important; display: flex; align-items: center; justify-content: center; }
.icon-target::before { content: ""; width: 100%; height: 1px; background: var(--f1-red); position: absolute; }
.icon-target::after { content: ""; height: 100%; width: 1px; background: var(--f1-red); position: absolute; }
.icon-gun { background-color: var(--f1-yellow) !important; clip-path: polygon(0 0, 70% 0, 100% 30%, 100% 60%, 70% 60%, 70% 100%, 30% 100%, 30% 30%, 0 30%); }
.icon-tech { background-color: var(--text-dim) !important; clip-path: polygon(0 0, 50% 0, 100% 50%, 50% 100%, 0 100%, 0 50%, 25% 25%); }

/* ===========================================
   USER ROLE STYLES
   =========================================== */
.container.vip-user {
  border-left: none;
  border-radius: 8px;
}

.container.vip-user .user-identity__name,
.container.vip-user .driver-name {
  color: var(--f1-white) !important;
  text-shadow: none !important;
  filter: none !important;
}

.container.top-user {
  border-left: none;
  border-radius: 8px;
}

.container.top-user .user-identity__name,
.container.top-user .driver-name {
  color: var(--f1-white);
  text-shadow: none;
}

.container.top-user .quote {
  border-left: none;
}

.container.admin-user {
  border-left: none;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.container.admin-user .user-identity__name,
.container.admin-user .driver-name {
  color: var(--f1-white) !important;
  text-shadow: none !important;
}

.container.admin-user .user-identity__icon {
  filter: none;
}

.container.admin-user .status-bar {
  background: var(--f1-black);
  border-bottom: 2px solid rgb(31, 31, 37);
}

.container.admin-user .status-text {
  color: var(--f1-red);
}

.container.ranked-user {
  border-left: none;
  border-radius: 8px;
}

.container.ranked-user .user-identity__name,
.container.ranked-user .driver-name {
  color: var(--text-bright);
  text-shadow: none;
}

/* Status Red message styling */
.container.status-red .quote {
  color: #fff;
}

/* ===========================================
   HEADER DECORATIONS
   =========================================== */
.watch-time-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: rgba(var(--f1-green-rgb), 0.08);
  border: 1px solid rgba(var(--f1-green-rgb), 0.3);
  color: var(--f1-green);
  padding: 2px 8px;
  font-size: 11px;
  font-family: var(--font-f1turbo);
  font-weight: 400;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.watch-time-container .label {
  font-size: 10px;
  opacity: 0.7;
  margin-right: 2px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-f1turbo);
  font-weight: 400;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.5px;
  padding: 3px 8px;
  margin-top: 5px;
  text-transform: uppercase;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
}

/* ===========================================
   DATA STREAM - Divider Line
   =========================================== */
.data-stream {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  width: 100%;
  margin: 0;
}

.data-stream::before,
.stream-line,
.stream-line::after {
  display: none;
}

/* ===========================================
   MESSAGE - Main Content
   =========================================== */
.quote {
  padding: 18px 16px;
  min-height: 100px;
  flex: 1;
  overflow: hidden;
  display: block;
  font-size: var(--message-size);
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--font-f1turbo);
  font-weight: 400;
  letter-spacing: 0.1px;
  line-height: 1.65;
  white-space: pre-line;
  word-break: break-word;
  border-left: none !important;
  border-right: none;
  position: relative;
  background: transparent;
}

/* No quote marks */
.quote::before,
.quote::after {
  display: none;
}

.quote strong {
  color: var(--f1-red);
  font-weight: 700;
}

/* ===========================================
   EMOTES
   =========================================== */
.emote-img {
  display: inline-block;
  vertical-align: middle;
  margin: 0 3px;
  height: 1.5em !important;
  width: auto !important;
  filter: none;
}

.quote.emote-only::after {
  display: none;
}

.quote.emote-only {
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.quote.emote-large .emote-img {
  height: 3.5em !important;
}

.quote.emote-medium .emote-img {
  height: 2.5em !important;
}

/* ===========================================
   DECRYPTION ANIMATION (Simplified)
   =========================================== */
.decrypting {
  font-family: var(--font-f1turbo) !important;
  font-weight: 400;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--f1-green) !important;
  border-right: 2px solid var(--f1-green);
  background: rgba(var(--f1-green-rgb), 0.03);
  line-height: 1.6 !important;
}

.user-identity__name.decrypting,
.driver-name.decrypting {
  height: 1.6em !important;
}

.container:has(.decrypting) .equalizer {
  opacity: 0;
}

/* ===========================================
   FOOTER
   =========================================== */
.footer-tech {
  margin-top: auto;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: transparent !important;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--font-f1turbo);
  font-size: 9px;
  font-weight: 400;
}

.tech-line {
  display: flex;
  align-items: center;
  gap: 5px;
}

.tech-line.left .bracket {
  color: var(--f1-gray-400);
}

.tech-line.left .tech-data {
  color: var(--f1-gray-300);
  letter-spacing: 0.5px;
}

.tech-line.right {
  color: var(--f1-green);
  display: none;
}

.container.idle-mode .tech-line.right {
  display: flex;
}

.tech-data {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.5px;
}

.bracket {
  color: var(--f1-gray-400);
  opacity: 0.5;
  font-size: 10px;
}

.ping-indicator {
  width: 5px;
  height: 5px;
  background: var(--f1-green);
  border-radius: 50%;
  animation: pingPulse 1.5s ease-in-out infinite;
}

/* ===========================================
   CUSTOM USER IMAGES
   =========================================== */
#custom-user-image img {
  display: block;
  max-height: 55px;
  position: relative;
  border-radius: 4px;
}

.admin-user #custom-user-image img {
  border: 1px solid rgba(var(--f1-red-rgb), 0.4);
}

.top-user #custom-user-image img {
  border: 1px solid rgba(var(--f1-red-rgb), 0.4);
}

.vip-user #custom-user-image img {
  border: 1px solid rgba(var(--f1-green-rgb), 0.4);
}

/* ===========================================
   XP SYSTEM - Timing Bar Style
   =========================================== */
.xp-display,
.xp-section {
  position: relative;
  padding: 5px 0;
  margin: 14px -16px;
  width: calc(100% + 32px);
  height: auto;
  min-height: 60px;
  overflow: visible;
}

.xp-bar,
.xp-bar-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Level Container - Clean F1 badge */
.xp-bar__level,
.xp-level-container {
  display: flex;
  align-items: baseline;
  gap: 3px;
  background: #1d1e22;
  padding: 4px 16px;
  clip-path: none;
  border-radius: 0;
  min-width: 56px;
  transform: translateY(-8px);
}

.xp-bar__level-label,
.xp-level-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 1px;
}

.xp-bar__level-value,
.xp-level-value {
  font-family: "Outfit", sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--f1-white);
  line-height: 1;
}

/* Progress Container */
.xp-bar__progress,
.xp-progress-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  transform: translateY(-4px);
}

/* Track */
.xp-bar__track,
.xp-progress-bar {
  position: relative;
  height: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  overflow: hidden;
  border-radius: 0;
}

/* Ghost & Fill */
.xp-bar__ghost,
.xp-bar__fill,
.xp-progress-ghost,
.xp-progress-fill,
.xp-progress-glow {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
}

.xp-bar__ghost,
.xp-progress-ghost {
  width: 0%;
  background: rgba(255, 255, 255, 0.2) !important;
  opacity: 1 !important;
  box-shadow: none !important;
  border-right: 1px solid rgba(255, 255, 255, 0.4);
  z-index: 1;
  transition: none !important;
  border-radius: 0;
}

.xp-bar__fill,
.xp-progress-fill {
  width: 0%;
  background: var(--f1-red) !important;
  background-size: initial !important;
  animation: none !important;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
  box-shadow: none;
  overflow: hidden;
  position: relative;
  border-radius: 0;
}

.xp-bar__fill::after,
.xp-progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
  pointer-events: none;
  animation: none;
}

@keyframes liquidFlow {
  0%, 100% { background-position: 100% 50%; }
  50% { background-position: 0% 50%; }
}

@keyframes liquidPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.xp-progress-glow {
  display: none;
}

/* Progress Text */
.xp-bar__text,
.xp-progress-text {
  display: flex;
  gap: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

.xp-bar__current,
.xp-current {
  color: var(--f1-white);
  font-weight: 600;
}

.xp-bar__divider,
.xp-divider {
  color: rgba(255, 255, 255, 0.2);
}

.xp-bar__next,
.xp-next {
  color: var(--f1-gray-300);
}

.xp-bar__suffix,
.xp-suffix {
  color: #fff;
  font-weight: 700;
  margin-left: 2px;
}

/* XP Gain */
.xp-bar__gain,
.xp-gain-container {
  position: relative;
  min-width: 40px;
  height: 100%;
}

.xp-gain-indicator {
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(0);
  font-family: "Outfit", sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: #8a29a4;
  opacity: 0;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.2s ease-out, transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.xp-gain-indicator.show {
  opacity: 1;
  transform: translateY(-120%);
  animation: none;
}

.xp-gain-indicator.fade-out {
  opacity: 0;
}

/* XP Info */
.xp-info,
.xp-title-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 5px;
  padding-left: 15px;
  padding-right: 15px;
}

.xp-info__title,
.xp-title-text {
  font-family: var(--font-f1turbo);
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-shadow: none;
}

.xp-title-icon {
  display: none !important;
}

/* ===========================================
   XP LEVEL UP - Clean Alert
   =========================================== */
.xp-levelup,
.xp-levelup-inline {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--f1-red);
  clip-path: none;
  border-radius: 4px;
  opacity: 0;
  transform: scaleX(0);
  pointer-events: none;
}

.xp-levelup.show,
.xp-levelup-inline.show {
  animation: levelUpSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.xp-levelup.hiding,
.xp-levelup-inline.hiding {
  animation: levelUpSlideOut 0.3s ease-in forwards;
}

@keyframes levelUpSlideIn {
  0% { opacity: 0; transform: scaleX(0); }
  100% { opacity: 1; transform: scaleX(1); }
}

@keyframes levelUpSlideOut {
  0% { opacity: 1; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(0); }
}

.xp-levelup__star,
.levelup-star {
  font-size: 14px;
  color: var(--f1-white);
  background: rgba(255, 255, 255, 0.2);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.xp-levelup__text,
.levelup-text {
  font-family: "Outfit", sans-serif;
  font-size: 11px;
  font-weight: 800;
  color: var(--f1-white);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.xp-levelup__chevrons,
.levelup-chevrons {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: bold;
}

.xp-levelup__number,
.levelup-number {
  font-family: "Outfit", monospace;
  font-size: 22px;
  font-weight: 900;
  color: var(--f1-red);
  background: var(--f1-white);
  padding: 2px 12px;
  line-height: 1.2;
  border-radius: 3px;
}

/* Level Up Widget Effect */
.container.level-up-effect {
  animation: containerLevelUp 0.5s ease-out;
}

@keyframes containerLevelUp {
  0%, 100% { filter: brightness(1); }
  30% { filter: brightness(1.15); }
}

/* ===========================================
   STREAK STYLES
   =========================================== */
.xp-info__streak,
.xp-streak {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  margin-left: auto;
  font-family: var(--font-f1turbo);
  font-weight: 400;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  height: 22px;
  overflow: hidden;
  white-space: nowrap;
}

.xp-streak::before,
.xp-achievements::before {
  content: none;
}

.streak-label {
  display: none;
}

.streak-days {
  color: #15151e;
  background: #36d639;
  font-family: var(--font-f1turbo);
  font-size: 9px !important;
  font-weight: 400;
  padding: 0 10px;
  height: 100%;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  display: flex !important;
  align-items: center;
  justify-content: center;
  height: 22px !important;
}

.streak-mult {
  color: #fff;
  background: #8A29A4;
  font-family: var(--font-f1turbo);
  font-size: 9px !important;
  font-weight: 400;
  padding: 0 10px;
  height: 100%;
  transition: all 0.3s ease;
  display: flex !important;
  align-items: center;
  justify-content: center;
  height: 22px !important;
}

.streak-mult:not([style*="opacity: 0.5"]) {
  animation: none;
}

@keyframes mult-pulse {
  0%, 100% { opacity: 1; }
}

/* ===========================================
   ACHIEVEMENT BAR
   =========================================== */
.xp-achievements {
  display: flex;
  justify-content: flex-start !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  width: 100%;
  margin-top: 5px;
}

.achievement-bar-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

.achievement-label {
  font-family: var(--font-f1turbo);
  font-weight: 400;
  color: var(--xp-text-secondary) !important;
  text-shadow: none !important;
  background: none !important;
  padding-left: 0 !important;
  flex-shrink: 0 !important;
}

.achievement-bar-track {
  height: 6px !important;
  background: rgba(255, 255, 255, 0.07) !important;
  border: none !important;
  border-radius: 2px;
  flex-grow: 1 !important;
  min-width: 50px !important;
  width: auto !important;
  margin: 0 8px !important;
  position: relative;
  overflow: hidden;
}

.achievement-bar-fill {
  height: 100% !important;
  display: block;
  background: linear-gradient(90deg, #5c2a68 0%, #7d3f8c 100%) !important;
  background-size: initial !important;
  box-shadow: none !important;
  animation: none !important;
  opacity: 0.9 !important;
  border-radius: 2px;
  transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.achievement-bar-text {
  color: rgba(255, 255, 255, 0.5) !important;
  text-shadow: none !important;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  min-width: fit-content !important;
  line-height: 1 !important;
}

#xp-achievements-container-wrapper {
  position: absolute;
  bottom: 0px;
  left: 0;
  width: 100%;
  padding: 0 16px;
  padding-bottom: 6px;
  box-sizing: border-box;
  z-index: 10;
  pointer-events: none;
}

/* ===========================================
   NETWORK ACTIVITY
   =========================================== */
.network-activity {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
  background: transparent;
  padding: 0;
  border: none;
}

.net-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 7px;
  color: var(--f1-gray-400);
  opacity: 0.5;
  letter-spacing: 0.5px;
}

.net-led {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.05s ease-out, box-shadow 0.05s ease-out;
  position: relative;
}

.net-led:not(.active) {
  transition: background 0.6s ease-in, box-shadow 0.6s ease-in;
}

.net-led.rx.active {
  background: var(--f1-green) !important;
  box-shadow: 0 0 4px var(--f1-green) !important;
}

.net-led.tx.active {
  background: var(--f1-red) !important;
  box-shadow: 0 0 4px var(--f1-red) !important;
}

/* ===========================================
   GOLD MODE (Subscriber)
   =========================================== */
.container.gold-mode-active .xp-bar__level,
.container.gold-mode-active .xp-level-container {
 /* background: linear-gradient(135deg, #6a1b9a, #8a29a4, #b342cc, #8a29a4, #6a1b9a) !important;*/
  border: none !important;
  box-shadow: none !important;
  animation: none !important;
}

.container.gold-mode-active .xp-bar__level::after,
.container.gold-mode-active .xp-level-container::after {
  display: none;
}

.container.gold-mode-active .xp-bar__level-label,
.container.gold-mode-active .xp-level-label {
  color: #ffffff !important;
  font-weight: 800 !important;
  text-shadow: none !important;
  z-index: 2;
}

.container.gold-mode-active .xp-bar__level-value,
.container.gold-mode-active .xp-level-value {
  color: #ffffff !important;
  text-shadow: none !important;
  font-weight: 900 !important;
  z-index: 2;
}

.container.gold-mode-active .xp-bar__fill,
.container.gold-mode-active .xp-progress-fill {
  background: linear-gradient(90deg, #6a1b9a, #8a29a4, #b342cc, #8a29a4, #6a1b9a) !important;
  box-shadow: none !important;
  animation: none !important;
}

.container.gold-mode-active .badge,
.container.gold-mode-active .user-badge {
  background: rgba(138, 41, 164, 0.15) !important;
  border: 1px solid rgba(138, 41, 164, 0.5) !important;
  border-left: 3px solid #8A29A4 !important;
  color: #b342cc !important;
  box-shadow: none !important;
  border-radius: 4px;
}

.container.gold-mode-active .user-identity__icon {
  filter: none !important;
  background: transparent !important;
}

.container.gold-mode-active .status-text,
.container.gold-mode-active .xp-info__title,
.container.gold-mode-active .xp-title-text {
  color: #8A29A4 !important;
  text-shadow: none;
}

@keyframes goldCircuitryFlow {
  0%, 100% { background-position: 0% 50%; }
}

@keyframes goldPulse {
  0%, 100% { opacity: 1; }
}

/* ===========================================
   BRO NOTIFICATION
   =========================================== */
.bro-notification {
  margin-top: 8px;
  background: var(--f1-gray-700);
  border: 1px solid rgba(138, 41, 164, 0.2);
  border-left: 3px solid #8A29A4;
  padding: 8px 12px;
  position: relative;
  overflow: hidden;
  animation: slideInLeft 0.4s ease forwards;
  border-radius: 4px;
  width: 100%;
  margin-bottom: 5px;
}

.bro-notification.hiding {
  opacity: 0;
  transform: translateX(-15px);
  transition: all 0.4s ease;
}

.bro-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.bro-title {
  color: #8A29A4;
  font-family: var(--font-f1turbo);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 10px;
}

.bro-count {
  color: #fff;
  font-family: var(--font-f1turbo);
  font-weight: 400;
  font-size: 9px;
}

.bro-progress-container {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}

.bro-progress-fill {
  height: 100%;
  background: #8A29A4;
  width: 0%;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 2px;
}

/* ===========================================
   STREAK OWNER BADGE
   =========================================== */
.streak-owner-badge {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

/* ===========================================
   GLITCH FX (Disabled in F1 theme)
   =========================================== */
.fx-glitch {
  animation: none;
}

@keyframes fx-glitch-anim {
  0%, 100% { transform: none; }
}

/* ===========================================
   RECONNECTED TAG
   =========================================== */
.reconnected-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  color: var(--f1-green);
  letter-spacing: 0.5px;
  margin-right: 8px;
  padding: 2px 8px;
  background: rgba(var(--f1-green-rgb), 0.06);
  border-left: 2px solid rgba(var(--f1-green-rgb), 0.4);
  border-radius: 3px;
}

.reconnected-icon {
  font-size: 12px;
  color: var(--f1-green);
}

.reconnected-text {
  color: rgba(255, 255, 255, 0.6);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===========================================
   CONTAINER SHAKE (Minimal)
   =========================================== */
@keyframes widget-shake {
  0%, 100% { transform: translateX(0) scale(1) !important; }
  25% { transform: translateX(-1px) scale(1) !important; }
  75% { transform: translateX(1px) scale(1) !important; }
}

.container.shake-impact {
  animation: widget-shake 0.35s ease-in-out;
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 400px) {
  :root {
    --container-width: 300px;
    --username-size: 1.2rem;
    --message-size: 1.1rem;
  }

  .quote {
    padding: 14px;
    min-height: 80px;
  }

  .header {
    padding: 12px;
  }
}

/* Hide popup legacy */
.level-up-popup {
  display: none !important;
}

/* ===========================================
   CONTAINER > * z-index (from base)
   =========================================== */
.container > *:not(.container::before):not(.container::after) {
  position: relative;
}

/* ===========================================
   STATUS BAR - Race Header Strip
   =========================================== */
.status-bar {
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(15, 16, 20, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
}

.status-code {
  display: inline-block;
  color: #8c8c8c;
  font-family: var(--font-f1turbo);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.network-activity {
  display: flex;
  align-items: center;
  gap: 4px;
}

.net-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #333;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.net-led.rx.active {
  background: #00d2be;
  box-shadow: 0 0 6px #00d2be;
}

.net-led.tx.active {
  background: #ffd700;
  box-shadow: 0 0 6px #ffd700;
}

.status-text,
.status-divider {
  display: none !important;
}

/* ===========================================
   RACE MODES & LIVE XP BOOST BADGE
   =========================================== */
.race-mode-badge {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-left: auto;
  font-family: "Share Tech Mono", "JetBrains Mono", monospace;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.race-mode-badge.boost-vsc {
  background: rgba(255, 208, 0, 0.2);
  color: #ffd000;
  border: 1px solid rgba(255, 208, 0, 0.85);
  box-shadow: 0 0 10px rgba(255, 208, 0, 0.35);
}

.race-mode-badge.boost-safety-car {
  background: rgba(255, 153, 0, 0.28);
  color: #ffffff;
  border: 1px solid #ff9900;
  box-shadow: 0 0 12px rgba(255, 153, 0, 0.55);
  animation: sc-pulse 1.8s infinite ease-in-out;
}

.race-mode-badge.boost-red-flag {
  background: rgba(225, 6, 0, 0.38);
  color: #ffffff;
  border: 1px solid #ff1801;
  box-shadow: 0 0 16px rgba(255, 24, 1, 0.75);
  animation: red-flag-pulse 1.2s infinite alternate;
}

.race-mode-badge.boost-qualy {
  background: rgba(0, 242, 254, 0.25);
  color: #00f2fe;
  border: 1px solid #00f2fe;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.6);
}

@keyframes sc-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(0.98); }
}

@keyframes red-flag-pulse {
  from { box-shadow: 0 0 8px rgba(255, 24, 1, 0.5); transform: scale(1); }
  to { box-shadow: 0 0 18px rgba(255, 24, 1, 0.95); transform: scale(1.01); }
}
