/**
 * NUKE – Main Stylesheet
 * Dark theme · Monospace typography
 *
 * Grayscale reference:
 *   gray-1  #0e0e0e  Body/content background
 *   gray-2  #1a1a1a  Cards, inputs, raised surfaces
 *   gray-3  #2a2a2a  Borders, hover states, elevated surfaces
 *   gray-4  #bdbdbd  Bright text on dark (nav links)
 *   gray-5  #9e9e9e  Muted text (timestamps, hints)
 *   gray-6  #aaaaaa  Secondary text (descriptions, labels)
 *   gray-7  #333333  Strong borders, button hover
 *   gray-8  #252525  Button surfaces, interactive elements
 *   gray-9  #181818  Header, deep surfaces
 */

/* ===========================================
   1. VARIABLES & THEMING
   =========================================== */
:root {
  /* Theme */
  --color-nuke-primary: #ed1c24;
  --color-nuke-primary-hover: #c41920;
  --color-nuke-accent: #fff200;
  --color-nuke-success: #00a651;
  --color-nuke-success-hover: #008c44;
  --color-nuke-danger: #ed1c24;
  --color-nuke-warning: #ff9900;
  --color-nuke-link: #4a9eed;

  /* Semantic */
  --color-self-message: var(--color-gray-6);
  --color-border-strong: rgba(0, 0, 0, 0.8);
  --color-collapsible-bg: rgba(0, 100, 255, 1);
  --color-collapsible-header: red;
  --color-text-secondary: #9e9e9e;
  --color-text-muted: #757575;
  --color-text-primary: var(--color-white);
  --color-border: #2a2a2a;
  --color-success: #00a651;
  --color-danger: #ed1c24;

  /* Neutral gray ramp (tight dark end, Notion-style) */
  --color-black: #000000;
  --color-gray-1: #191919;
  --color-gray-2: #1e1e1e;
  --color-gray-3: #252525;
  --color-gray-4: #2c2c2c;
  --color-gray-5: #333333;
  --color-gray-6: #3d3d3d;
  --color-gray-7: #4f4f4f;
  --color-gray-8: #7a7a7a;
  --color-gray-9: #9a9a9a;
  --color-gray-10: #b0b0b0;
  --color-gray-11: #ebebeb;
  --color-gray-12: #f5f5f5;
  --color-white: #ffffff;
  --color-text: var(--color-gray-11);

  /* Layout */
  --header-height: 56px;
  --border-width: 2px;
  --spacing: 16px;
  --spacing-sm: 8px;
  --spacing-lg: 24px;
  --border-radius: 4px;

  /* Icons */
  --level-icon-sm: 18px;

  /* Typography */
  --font-mono: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-digital: 'DS Digital', monospace;
  --font-bank-gothic: 'Inter', sans-serif;
  --font-conduit: 'Inter', sans-serif;
  --font-top-secret: 'Inter', sans-serif;
  --font-elegant-typewriter: 'Inter', sans-serif;
  --font-numeric: 'Nunito', sans-serif;
  --font-size-xs: 10px;
  --font-size-sm: 12px;
  --font-size-md: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 20px;
  --font-size-xxl: 24px;
  --line-height: 1.5;
}



/* ===========================================
   2. FONTS
   =========================================== */
@font-face {
  font-family: 'Berkeley Mono';
  src: url('/fonts/BerkeleyMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Berkeley Mono';
  src: url('/fonts/BerkeleyMono-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'DS Digital';
  src: url('/fonts/DS-DIGI.TTF') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'DS Digital';
  src: url('/fonts/DS-DIGIB.TTF') format('truetype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'DS Digital';
  src: url('/fonts/DS-DIGII.TTF') format('truetype');
  font-weight: 400;
  font-style: italic;
}

@font-face {
  font-family: 'DS Digital';
  src: url('/fonts/DS-DIGIT.TTF') format('truetype');
  font-weight: 700;
  font-style: italic;
}

@font-face {
  font-family: 'Arial Rounded';
  src: url('/fonts/arialroundedmtbold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Bank Gothic';
  src: url('/fonts/BankGothic Md BT.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'Bank Gothic';
  src: url('/fonts/BankGothic Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Conduit ITC';
  src: url('/fonts/Conduit ITC Light Regular.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'Conduit ITC';
  src: url('/fonts/Conduit ITC Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Conduit ITC';
  src: url('/fonts/Conduit ITC Medium Regular.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'Conduit ITC';
  src: url('/fonts/Conduit ITC Black Regular.otf') format('opentype');
  font-weight: 900;
  font-style: normal;
}

@font-face {
  font-family: 'Top Secret';
  src: url('/fonts/Top Secret.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Elegant Typewriter';
  src: url('/fonts/ELEGANT TYPEWRITER Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'Elegant Typewriter';
  src: url('/fonts/ELEGANT TYPEWRITER Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Elegant Typewriter';
  src: url('/fonts/ELEGANT TYPEWRITER Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Elegant Typewriter';
  src: url('/fonts/ELEGANT TYPEWRITER Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
}

@font-face {
  font-family: 'Impact';
  src: url('/fonts/impact.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Impact';
  src: url('/fonts/Impacted.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Impact Unicode';
  src: url('/fonts/unicode.impact.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

/* ===========================================
   3. RESET & UTILITIES
   =========================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--font-size-md);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  -webkit-user-select: none;
  user-select: none;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  font-size: var(--font-size-md);
  background: var(--color-gray-1);
  color: var(--color-text);
  line-height: var(--line-height);
  min-height: 100vh;
}


a { color: inherit; text-decoration: none; }
button { font-family: inherit; font-weight: 400; font-size: var(--font-size-md); color: var(--color-text-primary); cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-weight: 400; font-size: var(--font-size-md); color: var(--color-text-primary); }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; }

.hidden { display: none !important; }

/* ===========================================
   4. LAYOUT
   =========================================== */

/* Shell */
.app-wrapper {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
  max-width: 100vw;
}

.layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
}

.content {
  flex: 1;
  min-width: 0;
  padding: var(--spacing-lg);
  position: relative;
  background: transparent;
}




.nav-link {
  position: relative;
  padding: 8px 16px;
  border-radius: var(--border-radius);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-gray-4);
  white-space: nowrap;
  transition: all 0.2s;
}

.nav-link:hover {
  color: var(--color-white);
  background: var(--color-gray-8);
}

.nav-link.active {
  color: var(--color-white);
  background: var(--color-nuke-primary);
}

.nav-link.hidden,
.nav-link-hidden {
  display: none !important;
}

/* Page containers */
.signin-container,
.onboarding-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* ===========================================
   5. SHARED COMPONENTS
   =========================================== */

/* Typography */
.username {
  font-family: var(--font-conduit);
  font-size: var(--font-size-xxl);
  font-weight: 500;
  color: var(--color-white);
  margin: 0;
  padding: 0;
  line-height: 1;
  -webkit-text-stroke: 5px rgba(0, 0, 0, 0.5);
  paint-order: stroke fill;
  cursor: pointer;
}

.page-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
}

.section-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-bottom: var(--spacing);
  color: var(--color-text);
}

.nuke-time {
  display: block;
  text-align: center;
  font-family: var(--font-digital);
  font-size: 66px;
  font-weight: 700;
  color: var(--color-nuke-primary);
  margin: 0 0 var(--spacing);
  font-variant-numeric: tabular-nums;
}

.nuke-digit {
  display: inline-block;
  width: 0.48em;
  text-align: center;
}

.nuke-sep {
  display: inline-block;
  width: 0.2em;
  text-align: center;
}

.nuke-ms {
  display: inline-block;
  width: 0.48em;
  text-align: center;
  font-size: 0.55em;
  vertical-align: baseline;
  margin-left: 0.05em;
}

.online-count {
  font-size: var(--font-size-sm);
  color: var(--color-nuke-success);
  line-height: 1;
}

/* Stats */
.stats-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--spacing);
  margin-bottom: var(--spacing-lg);
}

/* XP bars */
.xp-bar {
  height: 8px;
  background: var(--color-gray-3);
  border-radius: 4px;
  margin-top: 8px;
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  background: var(--color-nuke-primary);
  width: 0%;
  transition: width 0.3s;
}

/* Buttons */
.action-btn {
  padding: 12px 24px;
  background: var(--color-gray-8);
  color: var(--color-text-primary);
  border-radius: var(--border-radius);
  font-size: var(--font-size-sm);
  font-weight: 700;
  transition: all 0.2s;
}

.action-btn:hover:not(:disabled) { background: var(--color-gray-7); }
.action-btn:disabled { cursor: not-allowed; }

.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
.action-btn.primary { background: var(--color-nuke-primary); }
.action-btn.primary:hover:not(:disabled) { background: var(--color-nuke-primary-hover); }
.action-btn.accent { background: var(--color-nuke-success); }
.action-btn.accent:hover:not(:disabled) { background: var(--color-nuke-success-hover); }

/* Modals */
.modal-overlay,
.profile-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--color-gray-2);
  color: var(--color-white);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin-bottom: var(--spacing);
}

.modal-actions {
  display: flex;
  gap: var(--spacing);
  margin-top: var(--spacing-lg);
}

.modal-btn {
  flex: 1;
  padding: 12px;
  font-weight: 700;
  border-radius: var(--border-radius);
  transition: all 0.2s;
}

.modal-btn.primary { background: var(--color-nuke-primary); color: var(--color-white); }
.modal-btn.secondary { background: var(--color-gray-7); color: var(--color-white); }

/* Badges & tags */
.notif-badge {
  display: inline-block;
  background: var(--color-nuke-primary);
  color: var(--color-white);
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  border-radius: 8px;
  padding: 0 4px;
  margin-left: 4px;
  vertical-align: middle;
}

/* Collapsible sections */
.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 0 8px;
  border: none;
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-white);
  background: var(--color-collapsible-header);
  cursor: pointer;
  user-select: none;
}
.collapsible-header .toggle-icon { transition: transform 0.2s ease; }
.collapsible-header.collapsed .toggle-icon { transform: rotate(-90deg); }
.collapsible-content {
  padding: 8px;
  background: var(--color-collapsible-bg);
  border: none;
  margin-bottom: 0;
}
.collapsible-header.collapsed + .collapsible-content { visibility: hidden; height: 0; overflow: hidden; pointer-events: none; }
.collapsible-header.collapsed { border-bottom: none; margin-bottom: 0; }


/* ===========================================
   6. SIGN IN
   =========================================== */

/* Hide header, XP bar, and shop border when on signin/onboarding page */
body:has(.signin-container:not(.hidden)) .header,

body:has(.signin-container:not(.hidden)) .content,
body:has(.onboarding-container:not(.hidden)) .content {
  background-color: var(--color-black);
}



.signin-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
}

.signin-content {
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.signin-title {
  font-size: var(--font-size-xxl);
  margin-bottom: var(--spacing);
  color: var(--color-white);
}

.signin-description {
  color: var(--color-gray-6);
  margin-bottom: var(--spacing-lg);
}

.wallet-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing);
}

.wallet-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing);
  padding: 16px;
  background: var(--color-gray-9);
  color: var(--color-white);
  border: var(--border-width) solid var(--color-gray-7);
  border-radius: var(--border-radius);
  font-weight: 700;
  transition: all 0.2s;
}

.wallet-btn:hover:not(:disabled) {
  background: var(--color-gray-8);
  border-color: var(--color-nuke-primary);
}

.wallet-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.wallet-btn.not-installed { opacity: 0.5; }

.signin-status {
  margin-top: var(--spacing-lg);
  padding: var(--spacing);
  background: transparent;
  border-radius: var(--border-radius);
  color: var(--color-gray-6);
}

.signin-status .status-text::after {
  content: '';
  display: inline-block;
  width: 12px;
  text-align: left;
  animation: signin-dots 1.2s steps(4, end) infinite;
}

@keyframes signin-dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

.signin-error {
  margin-top: var(--spacing);
  padding: var(--spacing);
  background: rgba(237, 28, 36, 0.1);
  color: var(--color-nuke-danger);
  border-radius: var(--border-radius);
}

/* ===========================================
   7. ONBOARDING
   =========================================== */
.onboarding-container { max-width: 800px; display: flex; align-items: center; justify-content: center; min-height: 100%; }
.onboarding-content { padding: var(--spacing-lg); width: 100%; }

.onboarding-title {
  font-size: var(--font-size-xxl);
  text-align: center;
  margin-bottom: var(--spacing);
  color: var(--color-white);
}

.onboarding-banner {
  display: block;
  max-width: 280px;
  margin: 0 auto var(--spacing-lg);
  border-radius: var(--border-radius);
}

.onboarding-description {
  text-align: center;
  color: var(--color-gray-6);
  margin-bottom: var(--spacing-lg);
}

.onboarding-section { margin-bottom: var(--spacing-lg); }

.onboarding-section-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
  color: var(--color-text);
  text-align: center;
}

.onboarding-hint {
  font-size: var(--font-size-sm);
  color: var(--color-gray-5);
  margin-bottom: var(--spacing);
}

.onboarding-error {
  padding: var(--spacing);
  background: rgba(237, 28, 36, 0.1);
  color: var(--color-nuke-danger);
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing);
  text-align: center;
}

.onboarding-selected {
  font-weight: 700;
  color: var(--color-nuke-primary);
  text-align: center;
  min-height: 24px;
}

.onboarding-input-group { max-width: 400px; margin: 0 auto; }

.onboarding-input {
  width: 100%;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: var(--font-size-lg);
  font-weight: 400;
  border: var(--border-width) solid var(--color-gray-3);
  border-radius: var(--border-radius);
  background: var(--color-gray-2);
  color: var(--color-white);
}

.onboarding-input:focus {
  outline: none;
  border-color: var(--color-nuke-primary);
}

.onboarding-username-error {
  margin-top: var(--spacing-sm);
  font-size: var(--font-size-sm);
  color: var(--color-nuke-danger);
}

.onboarding-actions {
  display: flex;
  justify-content: center;
  margin-top: var(--spacing-lg);
}

.onboarding-actions .action-btn {
  min-width: 200px;
  padding: 16px 32px;
  font-size: var(--font-size-lg);
}

.onboarding-fee-notice {
  text-align: center;
  margin-top: var(--spacing);
  font-size: var(--font-size-sm);
  color: var(--color-gray-5);
}

/* ===========================================================================
   CHAT PANEL
   =========================================================================== */

/* --- Chat Panel: Layout --- */

/* Lock scroll when chat is open */
body:has(.chat-container:not(.hidden)) {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.content:has(.chat-container:not(.hidden)) {
  padding: 0;
  overflow: hidden;
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  width: 100%;
  position: relative;
  overflow: hidden;
  padding-bottom: 8px;
}

.top-header {
  height: 40px;
  flex-shrink: 0;
  background: transparent;
  margin-left: 264px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 0 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.top-header::-webkit-scrollbar {
  display: none;
}

/* header pill zoom transitions applied via inline style (entry/exit only) */

.top-header .dock-pill,
.mobile-pill-header .dock-pill {
  cursor: pointer;
}

.chat-layout {
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 0;
  margin-left: 264px;
}

.left-sidebar {
  display: none;
}

/* --- Chat Panel: Container --- */

.chat-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  position: relative;
  transition: margin-right 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  margin-right: 16px;
  margin-bottom: 8px;
}



.chat-panel.emoji-open {
  margin-right: 288px;
}

/* --- Chat Panel: Sub-Header --- */

.chat-sub-header {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  z-index: 2;
  background: transparent;
  border-bottom: none;
  transition: right 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.subheader-logo {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--color-gray-8);
  cursor: pointer;
  padding: 0;
  display: none;
}

.header-info-bar {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: transparent;
  padding: 0 12px;
}

/* --- Chat Panel: Header --- */


.header-menu-btn {
  background: transparent;
  border: none;
  color: var(--color-gray-8);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
}

.header-profile-square {
  position: absolute;
  top: 8px;
  right: 8px;
  transition: right 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
  width: auto;
  padding-bottom: 0;
  background: transparent;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

/* Header card — cc-entry overrides for header context */
/* Mirrored layout: pfp + username + balance on the RIGHT, rank + dpr on the LEFT */

.header-profile-square .cc-entry {
  flex-direction: row-reverse;
}

.header-profile-square .cc-pfp-wrapper {
  z-index: 2;
}

.header-profile-square .cc-pfp-wrapper .pfp-notif-badge {
  z-index: 3;
}

.header-profile-square .cc-info {
  left: 0;
  right: 45px;
  padding: 4px 4px 2px 2px;
}

.header-profile-square .cc-top,
.header-profile-square .cc-bottom {
  flex-direction: row-reverse;
}

.header-profile-square .cc-name {
  justify-content: flex-end;
}

.header-profile-square .cc-rank {
  margin-left: 0;
  margin-right: auto;
}

.header-profile-square .cc-dpr-pill {
  margin-left: 2px;
  margin-right: auto;
}

.header-profile-square .cc-dpr {
  margin-left: 0;
  margin-right: auto;
}

/* Banner is now on the visual left — flip the gradient mask direction */
.header-profile-square .cc-banner-img {
  mask-image: none;
  -webkit-mask-image: none;
}

/* Header PFP border — animated APNG, frozen on first frame, animates on hover */

.header-pfp-border {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  z-index: 3;
  pointer-events: none;
}

/* Notification badge on header PFP */

.pfp-notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--color-nuke-primary);
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  border-radius: 8px;
}

.pfp-notif-badge:empty {
  display: none;
}

.header-season-title {
  font-family: 'Inter', sans-serif; font-weight: 900;
  font-size: var(--font-size-xxl);
  font-weight: 400;
  color: var(--color-white);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.header-season-number {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-gray-8);
}

.header-online-count {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
}

.header-nuke-time-bar {
  font-family: var(--font-digital);
  font-size: 22px;
  font-weight: 700;
  color: var(--color-white);
  font-variant-numeric: tabular-nums;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.header-jackpot-bar {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-nuke-accent);
}

.header-jackpot-label {
  color: var(--color-gray-8);
}

/* --- Chat Panel: Messages --- */

/* Message area */
@property --mask-top {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 8%;
}

@property --mask-bottom {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 6%;
}

.chat-messages {
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  padding: 60px 16px calc(var(--dock-height, 40px) + 12px) 12px;
  margin-right: 0;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: transparent;
  scrollbar-width: thin;
  scrollbar-color: var(--color-gray-7) transparent;
  overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(
    to bottom,
    black 0%,
    black calc(100% - var(--mask-bottom)),
    transparent 98%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    black 0%,
    black calc(100% - var(--mask-bottom)),
    transparent 98%,
    transparent 100%
  );
}

.chat-messages::-webkit-scrollbar { display: none; }
.chat-messages { scrollbar-width: none; }

.chat-messages > * { margin-right: 0; }

/* Messages */
.chat-message {
  padding: 4px 8px;
  margin-bottom: var(--spacing-sm);
  background: var(--color-gray-3);
  border-radius: 4px 12px 12px 4px;
  align-self: flex-start;
  max-width: min(520px, 80%);
}

@media screen and (min-width: 769px) {
  .chat-message {
    padding: 5px 9px;
  }
  .msg-time {
    bottom: -2px;
    right: 3px;
  }
  .msg-inline-balance {
    bottom: 2px;
    right: 3px;
  }
}

.chat-message:last-child { margin-bottom: 0; }
.chat-message-head { border-top-left-radius: 12px; }
.chat-message-tail {
  border-bottom-left-radius: 0;
  position: relative;
  margin-bottom: 0;
}

.chat-message-tail::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -6px;
  width: 6px;
  height: 10px;
  background: var(--color-gray-3);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 10'%3E%3Cpath d='M6 0 L6 10 L0 10 Q5 10 6 0Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 10'%3E%3Cpath d='M6 0 L6 10 L0 10 Q5 10 6 0Z'/%3E%3C/svg%3E");
  mask-size: contain;
  -webkit-mask-size: contain;
}
.chat-message-self {
  text-align: left;
  border-radius: 12px 4px 4px 12px;
  background: var(--color-self-message);
}
.chat-message-self.chat-message-head { border-top-right-radius: 12px; }
.chat-message-self.chat-message-tail {
  border-bottom-right-radius: 0;
}
.chat-message-self.chat-message-tail::after {
  left: auto;
  right: -6px;
  background: var(--color-self-message);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 10'%3E%3Cpath d='M0 0 L0 10 L6 10 Q1 10 0 0Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 10'%3E%3Cpath d='M0 0 L0 10 L6 10 Q1 10 0 0Z'/%3E%3C/svg%3E");
}
.chat-message-self .msg-header { justify-content: flex-end; }

/* Message rows */
.chat-message-row {
  display: flex;
  align-items: flex-end;
  gap: var(--spacing-sm);
  align-self: flex-start;
  max-width: min(520px, 80%);
  margin-bottom: var(--spacing-sm);
}

.chat-message-row-self {
  align-self: flex-end;
}

.chat-message-row .chat-message {
  align-self: auto;
  max-width: none;
  margin-bottom: 0;
  min-width: 0;
  overflow: visible;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.05));
}

.chat-message-row .msg-pfp { position: sticky; bottom: 8px; align-self: flex-end; }

/* Message groups (sequential messages from same sender) */
.chat-message-group {
  display: flex;
  align-items: flex-end;
  gap: var(--spacing-sm);
  align-self: flex-start;
  max-width: min(520px, 80%);
  margin-bottom: var(--spacing-sm);
}

.chat-message-group-self { align-self: flex-end; }

.chat-group-bubbles {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.05));
}

.chat-group-bubbles .chat-message {
  align-self: flex-start;
  max-width: 100%;
  margin-bottom: 0;
  min-width: 0;
  overflow: visible;
}

.chat-message-group-self .chat-group-bubbles .chat-message {
  align-self: flex-end;
}

.chat-group-pfp {
  width: 40px;
  flex-shrink: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
}

.chat-group-pfp .msg-pfp { position: sticky; bottom: 8px; }

/* History indicators */
.history-loading-indicator {
  text-align: center;
  padding: 8px;
  color: var(--color-gray-5);
  font-size: 0.85em;
}

.history-end-marker {
  text-align: center;
  padding: 8px;
  color: var(--color-gray-5);
  font-size: 0.8em;
  border-bottom: none;
  margin-bottom: 8px;
}


  /* Headers & Content */
/* Message content */
.chat-message-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: 4px;
}

/* --- Chat Bubble: Username (top-left of bubble header) --- */
.msg-sender {
  font-family: var(--font-conduit);
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--color-white);
  line-height: 1;
  white-space: nowrap;
}

/* --- Chat Bubble: Clan tag (next to username) --- */
.msg-bio {
  font-family: var(--font-conduit);
  font-size: var(--font-size-lg);
  font-weight: 900;
  color: var(--color-white);
  -webkit-text-stroke: 3px rgba(0, 0, 0, 0.5);
  paint-order: stroke fill;
}

.chat-content,
.msg-content {
  color: var(--color-text-primary);
  font-weight: 600;
  word-break: break-word;
  font-size: var(--font-size-sm);
  opacity: 0.75;
}

.msg-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0;
  margin-bottom: 0;
}

.msg-header-line1 {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.msg-header-line2 {
  display: flex;
  align-items: center;
  gap: var(--spacing);
}

.msg-header .msg-pfp {
  flex-shrink: 0;
}

/* --- Chat Bubble: Level container (DPR + level icon, top-right of header) --- */
.msg-level {
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
  margin-left: auto;
  flex-shrink: 0;
}

/* --- Chat Bubble: Level icon (small image next to DPR) --- */
.msg-level-icon {
  width: var(--level-icon-sm);
  height: var(--level-icon-sm);
  vertical-align: middle;
  position: relative;
  top: -1px;
  object-fit: contain;
  display: block;
}

/* --- Chat Bubble: Level number --- */
.msg-level-num {
  font-family: var(--font-conduit);
  font-size: var(--font-size-lg);
  font-weight: 900;
  color: var(--color-white);
  line-height: 1;
  -webkit-text-stroke: 3px rgba(0, 0, 0, 0.5);
  paint-order: stroke fill;
}

/* --- Chat Bubble: Balance (bottom-right of tail messages) --- */
.msg-balance {
  font-family: var(--font-conduit);
  font-size: 9px;
  font-weight: 700;
  color: var(--color-nuke-success);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* --- Chat Bubble: DPR percentage (top-right header, next to level icon) --- */
.msg-dpr {
  font-family: var(--font-conduit);
  font-size: 9px;
  font-weight: 700;
  color: var(--color-white);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  opacity: 0.6;
  position: relative;
  top: 1px;
}

/* --- Chat Bubble: Stake label --- */
.msg-stake {
  font-size: var(--font-size-sm);
  font-weight: 400;
  color: var(--color-text-muted);
}

.lv-low {
  position: relative;
  top: -1px;
}

.msg-level-icon.lv-low {
  top: -1px;
}

/* --- Chat Bubble: Message body container --- */
.msg-body {
  position: relative;
}

.msg-media-wrapper + .msg-body { padding-top: var(--spacing-sm); }

.msg-time-spacer {
  display: inline;
  visibility: hidden;
  font-size: var(--font-size-xs);
  padding-left: 2px;
}

/* --- Chat Bubble: Balance spacer (invisible, reserves space for text wrapping) --- */
.msg-balance-spacer {
  display: inline;
  visibility: hidden;
  font-family: var(--font-conduit);
  font-size: 9px;
  font-weight: 700;
  padding-left: 6px;
}

.msg-link {
  color: var(--color-nuke-link);
  font-weight: 600;
  text-decoration: underline;
}

.msg-slash-cmd {
  color: #7df9ff;
  cursor: pointer;
}

.msg-mention {
  color: #7df9ff;
  font-weight: 700;
  cursor: pointer;
}

/* --- Chat Bubble: Inline balance position (absolute bottom-right of tail messages) --- */
.msg-inline-balance {
  position: absolute;
  bottom: 1px;
  right: 2px;
  white-space: nowrap;
  pointer-events: none;
}

.msg-time {
  position: absolute;
  bottom: -3px;
  right: 2px;
  font-family: var(--font-digital);
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--color-text);
  opacity: 0.35;
  white-space: nowrap;
  pointer-events: none;
}

/* Tail messages: show balance, hide timestamp */
.chat-message-tail .msg-time,
.chat-message-tail .msg-time-spacer-time {
  display: none;
}

/* Non-tail messages: show timestamp, hide balance */
.chat-message:not(.chat-message-tail) .msg-inline-balance,
.chat-message:not(.chat-message-tail) .msg-balance-spacer {
  display: none;
}

/* Nuclear fallout: show timestamp, hide balance on tail messages */
.chat-message-tail.no-balance .msg-time,
.chat-message-tail.no-balance .msg-time-spacer-time {
  display: initial;
}

.chat-message-tail.no-balance .msg-inline-balance,
.chat-message-tail.no-balance .msg-balance-spacer {
  display: none;
}

/* Self messages: always show timestamp, never balance */
.chat-message-self .msg-inline-balance,
.chat-message-self .msg-balance-spacer {
  display: none;
}

.chat-message-self .msg-time,
.chat-message-self .msg-time-spacer-time {
  display: inline;
}

.msg-pfp,
.msg-pfp-spacer {
  width: 37px;
  height: 37px;
  flex-shrink: 0;
}

.msg-pfp {
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  object-fit: cover;
  cursor: pointer;
}


/* --- Chat Panel: Context Menu & Reactions --- */
/* Context menu */
.chat-context-menu {
  position: fixed;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.chat-context-react-pill {
  display: flex;
  border-radius: 999px;
  background: var(--color-gray-2);
  border: none;
  overflow: hidden;
  width: fit-content;
}

.chat-context-react-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s;
}

.chat-context-react-btn:hover {
  background: var(--color-gray-3);
}

.chat-context-react-expand {
  color: var(--color-text-secondary);
  transition: color 0.15s, background 0.15s;
}
.chat-context-react-expand:hover {
  color: var(--color-white);
}

.chat-context-react-expanded {
  width: 258px;
  max-height: 220px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--color-gray-2);
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.chat-context-react-expanded-inner {
  max-height: 220px;
  overflow-y: auto;
  padding: 0;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.chat-context-react-expanded-inner::-webkit-scrollbar {
  display: none;
}
.chat-context-react-collapse-wrap {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 0;
  display: flex;
  justify-content: flex-end;
}
.chat-context-react-collapse {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text-secondary);
}
.chat-context-react-expanded .emoji-category-label {
  font-size: 12px;
  padding: 8px 8px 2px 8px;
  background: var(--color-gray-2);
}
.chat-context-react-expanded .emoji-category-label:first-child {
  padding-top: 4px;
}
.chat-context-react-expanded .emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
  gap: 0;
}
.chat-context-react-expanded .emoji-grid-item {
  height: 32px;
  font-size: 16px;
  display: grid;
  place-items: center;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
}
.chat-context-react-expanded .emoji-grid-item:hover {
  background: var(--color-gray-3);
}

.chat-context-actions {
  min-width: 120px;
  width: fit-content;
  padding: 4px 0;
  border: none;
  border-radius: 8px;
  background: var(--color-gray-2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.chat-context-menu-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-white);
}

.chat-context-menu-item:hover { background: var(--color-gray-3); }

/* Reactions */
.msg-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.msg-reaction-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--font-size-sm);
  background: var(--color-gray-3);
  border-radius: 12px;
  padding: 4px 8px;
}

.msg-reaction-emoji {
  line-height: 1;
  position: relative;
  top: 1px;
}

.msg-reaction-count {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  line-height: 1;
}

.msg-reaction-pfp {
  display: none;
}


  /* Updates & Retries */
.chat-message-update {
  align-self: center;
  text-align: center;
  padding: 4px var(--spacing);
  color: var(--color-white);
  font-size: var(--font-size-sm);
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
}

.chat-message-update .msg-update-content { margin-right: var(--spacing-sm); }
.chat-message-update .msg-reactions { justify-content: center; }
.chat-message-update .msg-time { font-size: var(--font-size-sm); color: var(--color-text); opacity: 0.35; }

.chat-retry-link { color: var(--color-nuke-primary); cursor: pointer; text-decoration: underline; }
.chat-retry-link:hover { color: var(--color-white); }


  /* Replies */
.chat-reply-preview {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0 8px;
}

.chat-reply-preview-sender {
  padding: 2px 0;
  font-size: var(--font-size-md);
  color: var(--color-white);
}

.chat-reply-preview-content {
  padding: 2px 0;
  font-size: var(--font-size-md);
  color: var(--color-gray-5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-reply-preview-text {
  min-width: 0;
  overflow: hidden;
}

.chat-reply-cancel {
  background: none;
  border: none;
  color: var(--color-gray-5);
  cursor: pointer;
  font-size: var(--font-size-md);
  padding: 2px 0;
  flex-shrink: 0;
}

/* Reply quotes */
.msg-reply-quote {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  border-left: 2px solid var(--color-white);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px 4px 4px 2px;
  padding: 4px 8px;
  margin-top: 4px;
  margin-bottom: 4px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  cursor: pointer;
}

.msg-reply-quote:hover { color: var(--color-white); }

@media screen and (min-width: 769px) {
  .msg-reply-quote {
    padding: 5px 9px;
    margin-top: 5px;
    margin-bottom: 5px;
  }
}

.msg-reply-sender { display: flex; align-items: baseline; font-family: var(--font-conduit); font-size: var(--font-size-lg); font-weight: 500; color: var(--color-white); line-height: 1.2; margin-bottom: 2px; }
.msg-reply-content {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.chat-message-highlight { animation: msg-jiggle 0.3s ease-out; }

.msg-row-highlight {
  position: absolute;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.01);
  pointer-events: none;
}
.msg-row-highlight-fade {
  animation: msg-row-fade 1200ms ease-out forwards;
}
@keyframes msg-row-fade {
  0%, 30% { opacity: 1; }
  100%    { opacity: 0; }
}


/* --- Chat Panel: Emoji Panel --- */
.emoji-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 288px;
  height: 100dvh;
  background: transparent;
  overflow: hidden;
  z-index: 101;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
  pointer-events: none;
}

.emoji-panel.open {
  transform: translateX(0);
  pointer-events: auto;
}

.emoji-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 16px;
  flex-shrink: 0;
}

.emoji-panel-close {
  background: none;
  border: none;
  color: var(--color-white);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.emoji-panel-close:hover {
  color: var(--color-white);
  background: var(--color-gray-3);
}

.emoji-panel-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-white);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.emoji-panel-content {
  flex: 1;
  overflow-y: auto;
  scrollbar-color: var(--color-gray-7) transparent;
}

.emoji-category-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-gray-5);
  padding: 8px 8px 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  background: var(--color-gray-2);
  z-index: 1;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 0 8px 8px;
}

.emoji-grid-item {
  font-size: 20px;
  padding: 4px;
  background: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  line-height: 1;
}

.emoji-grid-item:hover {
  background: var(--color-gray-3);
}


/* --- Chat Panel: Input Dock --- */

  /* Input */
.dock-wrapper {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  align-items: flex-end;
}

.mobile-pill-header {
  display: none;
}

.chat-nuke-banner {
  font-family: 'Impact', sans-serif;
  font-size: 64px;
  font-weight: 400;
  color: var(--color-white);
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: center;
  padding: 12px 0;
}

.chat-pill-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: var(--spacing-sm);
}

.chat-pill-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: var(--spacing-sm);
}

.chat-pill-group .chat-pill-wrapper {
  margin-bottom: 0;
}

.dock-pill {
  height: 20px;
  border-radius: 9px;
  border: none;
  padding: 0 10px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: default;
  user-select: none;
  transform-origin: top center;
}

/* Mobile: smooth the hard opacity toggle between chat-pill and header-pill. */
@media screen and (max-width: 768px) {
  .chat-pill,
  .mobile-pill-header .dock-pill {
    transition: opacity 120ms linear;
  }
}

.chat-pill {
  transform-origin: top center;
  height: auto;
  padding: 6px 10px;
  border-radius: 12px;
}

.pill-red { background: #6e1a1a; color: #ff8080; }
.pill-orange { background: #6e3a1a; color: #ffb380; }
.pill-blue { background: #1a3a6e; color: #80b3ff; }
.pill-purple { background: #4a1a6e; color: #c080ff; }
.pill-green { background: #1a6e2e; color: #80ff99; }
.pill-yellow { background: #6e5a1a; color: #ffe080; }
.pill-transparent { background: transparent; color: var(--color-white); font-size: 10px; }

/* Event message bubbles — user-triggered system events with colored backgrounds */
.chat-message[data-pill-id] {
  transform-origin: top center;
}

.chat-message.event-nuke { background: #6e1a1a; color: #ff8080; }
.chat-message.event-nuke .msg-content { color: #ff8080; opacity: 1; }
.chat-message.event-staked { background: #1a3a6e; color: #80b3ff; }
.chat-message.event-staked .msg-content { color: #80b3ff; opacity: 1; }
.chat-message.event-unstaked { background: #6e3a1a; color: #ffb380; }
.chat-message.event-unstaked .msg-content { color: #ffb380; opacity: 1; }
.chat-message.event-purchase { background: #6e5a1a; color: #ffe080; }
.chat-message.event-purchase .msg-content { color: #ffe080; opacity: 1; }
.chat-message.event-positive { background: #1a6e2e; color: #80ff99; }
.chat-message.event-positive .msg-content { color: #80ff99; opacity: 1; }
.chat-message.event-negative { background: #6e1a1a; color: #ff8080; }
.chat-message.event-negative .msg-content { color: #ff8080; opacity: 1; }
.chat-message.event-neutral { background: #1a3a6e; color: #80b3ff; }
.chat-message.event-neutral .msg-content { color: #80b3ff; opacity: 1; }
.chat-message.event-equipment { background: #1a3a6e; color: #80b3ff; }
.chat-message.event-equipment .msg-content { color: #80b3ff; opacity: 1; }
.chat-message.event-shielded { background: #1a6e2e; color: #80ff99; }
.chat-message.event-shielded .msg-content { color: #80ff99; opacity: 1; }
.chat-message.event-computron { background: #4a1a6e; color: #c080ff; }
.chat-message.event-computron .msg-content { color: #c080ff; opacity: 1; }

/* Event bubble DPR → type color, keeps existing 0.6 opacity */
.chat-message.event-staked .msg-dpr,
.chat-message.event-neutral .msg-dpr,
.chat-message.event-equipment .msg-dpr { color: #80b3ff; }
.chat-message.event-unstaked .msg-dpr { color: #ffb380; }
.chat-message.event-purchase .msg-dpr { color: #ffe080; }
.chat-message.event-positive .msg-dpr,
.chat-message.event-shielded .msg-dpr { color: #80ff99; }
.chat-message.event-negative .msg-dpr { color: #ff8080; }

/* Event bubble balance → type color + 0.6 opacity (matching DPR) */
.chat-message.event-staked .msg-balance,
.chat-message.event-neutral .msg-balance,
.chat-message.event-equipment .msg-balance { color: #80b3ff; opacity: 0.6; }
.chat-message.event-unstaked .msg-balance { color: #ffb380; opacity: 0.6; }
.chat-message.event-purchase .msg-balance { color: #ffe080; opacity: 0.6; }
.chat-message.event-positive .msg-balance,
.chat-message.event-shielded .msg-balance { color: #80ff99; opacity: 0.6; }
.chat-message.event-negative .msg-balance { color: #ff8080; opacity: 0.6; }

/* Event bubble timestamp → type color, keeps existing 0.35 opacity */
.chat-message.event-staked .msg-time,
.chat-message.event-neutral .msg-time,
.chat-message.event-equipment .msg-time { color: #80b3ff; }
.chat-message.event-unstaked .msg-time { color: #ffb380; }
.chat-message.event-purchase .msg-time { color: #ffe080; }
.chat-message.event-positive .msg-time,
.chat-message.event-shielded .msg-time { color: #80ff99; }
.chat-message.event-negative .msg-time { color: #ff8080; }

/* Event bubble tail → match bubble background */
.chat-message.event-staked.chat-message-tail::after,
.chat-message.event-neutral.chat-message-tail::after,
.chat-message.event-equipment.chat-message-tail::after { background: #1a3a6e; }
.chat-message.event-unstaked.chat-message-tail::after { background: #6e3a1a; }
.chat-message.event-purchase.chat-message-tail::after { background: #6e5a1a; }
.chat-message.event-positive.chat-message-tail::after,
.chat-message.event-shielded.chat-message-tail::after { background: #1a6e2e; }
.chat-message.event-nuke.chat-message-tail::after,
.chat-message.event-negative.chat-message-tail::after { background: #6e1a1a; }

.chat-dock {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: rgba(44, 44, 44, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: none;
  border-radius: 12px;
  box-shadow: none;
  padding: 0;
  gap: 0;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.05));
}

.chat-dock.dock-jiggle {
  animation: dock-focus-jiggle 0.3s ease;
}

@keyframes dock-focus-jiggle {
  0%   { transform: rotate(0deg) scale(1); }
  25%  { transform: rotate(-0.05deg) scale(1.006); }
  50%  { transform: rotate(0.05deg) scale(1.009); }
  75%  { transform: rotate(-0.02deg) scale(1.003); }
  100% { transform: rotate(0deg) scale(1); }
}

@keyframes dock-focus-jiggle-mobile {
  0%   { scale: 1; }
  25%  { scale: 1.006; }
  50%  { scale: 1.009; }
  75%  { scale: 1.003; }
  100% { scale: 1; }
}

.dock-dropdown-area {
  padding: 0 4px 4px 4px;
  margin-top: -4px;
  flex-shrink: 0;
}

.dock-dropdown-area:empty {
  display: none;
}


.chat-input-area {
  display: flex;
  align-items: center;
  min-height: 40px;
  position: relative;
  padding: 0 8px;
  background: transparent;
  border-radius: 12px;
}


/* Plus menu — popup above the dock */
.chat-input-bubble {
  display: flex;
  align-items: flex-end;
  flex: 1;
  min-width: 0;
  background: transparent;
  border-radius: 0;
  min-height: 32px;
  margin: 0;
  border: none;
  gap: 4px;
}

.chat-input-bubble .chat-text-input {
  background: transparent;
  padding: 6px 0 6px 8px;
  font-size: var(--font-size-sm);
  margin: 0;
  border-radius: 0;
}

/* Action buttons sit 4px above the bubble bottom so they line up with the text's
   last-line center, instead of the bubble bottom edge */
.chat-input-bubble .chat-action-btn,
.chat-input-bubble .send-voice-slot {
  margin-bottom: 4px;
}

/* Emoji + image sit 1px higher than the slot to optically align with the slot's icons */
.chat-input-bubble #chat-emoji-btn,
.chat-input-bubble #chat-image-btn {
  margin-bottom: 5px;
}

/* When the textarea grows to multi-line, bump the buttons up a bit more so they
   stay visually centered with the bottom-most line of text */
.chat-input-bubble.multi-line .chat-action-btn,
.chat-input-bubble.multi-line .send-voice-slot {
  margin-bottom: 8px;
}

.chat-input-bubble.multi-line #chat-emoji-btn,
.chat-input-bubble.multi-line #chat-image-btn {
  margin-bottom: 9px;
}

/* Send/Voice crossfade slot */
.send-voice-slot {
  position: relative;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  transition: width 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.75);
}

.send-voice-slot.send-active {
  width: 40px;
}

.send-voice-slot > button {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.1s ease, transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.75);
}

/* Voice button fills the slot */
.send-voice-slot > #chat-voice-btn {
  left: 0;
}

/* Microphone icon is visually top-heavy — nudge it down to match the other svgs */
#chat-voice-btn svg {
  transform: translateY(2px);
}

/* Send button keeps its own width, right-aligned */
.send-voice-slot > .chat-send-btn {
  width: 38px;
}

.send-voice-slot > button.slot-hidden {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}


.chat-action-row-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-gray-3);
  border: none;
  border-radius: 12px;
  color: var(--color-gray-9);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

.chat-action-row-btn:hover {
  color: var(--color-white);
}

/* ---- Smart button (outside dock, right side) ---- */
.chat-smart-btn {
  height: 40px;
  padding: 0 14px;
  margin-left: 6px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-weight: 900;
  font-size: var(--font-size-sm);
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  overflow: hidden;
  background: var(--color-nuke-primary);
  color: var(--color-text-primary);
  border: 0;
  transition: all 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.chat-smart-btn.accent {
  background: var(--color-nuke-success);
}

.chat-smart-btn:hover:not(:disabled) {
  filter: brightness(1.1);
}

.chat-smart-btn:active:not(:disabled) {
  filter: brightness(0.92);
  transform: translateY(1px);
  transition: all 0.06s ease;
}

.chat-smart-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

/* Hidden — scale out */
.chat-smart-btn.smart-btn-hidden {
  transform: scale(0);
  opacity: 0;
  width: 0;
  min-width: 0;
  padding: 0;
  margin-left: 0;
  overflow: hidden;
  pointer-events: none;
  box-shadow: none;
  border: 0;
}

/* ---- Send button (inside input bubble) ---- */
.chat-send-btn {
  border-radius: 12px;
  cursor: pointer;
  padding: 0;
  background: var(--color-nuke-primary);
  color: var(--color-white);
  border: 0;
}

.chat-send-btn svg {
  stroke-width: 4;
  flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
  filter: brightness(1.1);
}

.chat-send-btn:active:not(:disabled) {
  filter: brightness(0.92);
  transform: translateY(1px);
  transition: all 0.06s ease;
}




.chat-input-hint-container {
  padding: 0 0 8px;
  background: var(--color-gray-2);
  position: absolute;
  bottom: 58px;
  left: 0;
  right: 0;
  z-index: 2;
  transform: translateZ(0);
  display: none;
}

.chat-text-input {
  flex: 1;
  padding: 6px 8px;
  background: transparent;
  color: var(--color-text-primary);
  border: none;
  font-size: var(--font-size-md);
  font-weight: 600;
  outline: none;
  min-height: 32px;
  max-height: 120px;
  resize: none;
  font-family: inherit;
  line-height: 20px;
  overflow-y: hidden;
  display: block;
  box-sizing: border-box;
}

.chat-text-input::placeholder {
  color: rgba(158, 158, 158, 0.6);
}

.chat-text-input.error::placeholder {
  color: #ff8080;
}

.command-ghost {
  position: absolute;
  left: 0;
  top: 0;
  height: 40px;
  display: none;
  align-items: center;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: var(--font-size-sm);
  font-weight: 400;
  pointer-events: none;
  white-space: nowrap;
}

.command-ghost:not(:empty) {
  display: flex;
}

.chat-text-input:disabled {
  opacity: 1;
}

.chat-input-area svg {
  width: 14px;
  height: 14px;
}

.chat-image-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  margin-right: 8px;
  background: transparent;
  color: var(--color-gray-5);
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  transition: color 0.2s;
  order: 0;
}

.chat-image-btn:hover { color: var(--color-white); }

.chat-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 4px;
  margin-right: 2px;
  background: transparent;
  color: rgba(158, 158, 158, 0.6);
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  transition: color 0.2s;
}

.chat-action-btn:hover { color: var(--color-white); }
.chat-action-btn.recording { color: var(--color-nuke-danger); animation: pulse 1s infinite; }


/* /use command dropdown */
.use-command-dropdown {
  display: grid;
  grid-template-rows: repeat(3, auto);
  grid-auto-flow: column;
  background: transparent;
  position: relative;
  gap: 0;
}

.dropdown-scroll-track {
  position: absolute;
  right: 2px;
  top: 4px;
  bottom: 4px;
  width: 6px;
  background: transparent;
  border-radius: 3px;
}

.dropdown-scroll-thumb {
  position: absolute;
  width: 100%;
  background: var(--color-gray-8);
  border-radius: 3px;
  min-height: 8px;
  transition: top 0.15s ease, height 0.15s ease;
}

/* Tiles layout — horizontal row of item cards (like inventory/shop) */
.use-command-tiles {
  display: flex;
  flex-direction: row;
  gap: 8px;
  padding: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.use-command-tiles::-webkit-scrollbar {
  display: none;
}

.use-command-tiles .item-card.active {
  border-color: var(--color-nuke-primary);
  background: rgba(237, 28, 36, 0.08);
}

.use-command-tiles:not(.keyboard-nav) .item-card:hover {
  border-color: var(--color-nuke-primary);
}

.use-command-tiles .inventory-slot.empty {
  pointer-events: none;
}

.use-command-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  border-radius: 8px;
  color: rgba(158, 158, 158, 0.6);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  color: var(--color-gray-5);
  width: fit-content;
}

.use-command-dropdown-item.active {
  background: var(--color-gray-5);
  color: var(--color-white);
}

.use-command-dropdown:not(.keyboard-nav) .use-command-dropdown-item:hover {
  background: var(--color-gray-5);
  color: var(--color-white);
}


  /* Media Controls */
.chat-media-controls {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-sm);
}

.media-btn {
  padding: 8px 16px;
  background: var(--color-gray-3);
  color: var(--color-white);
  font-weight: 700;
  font-size: var(--font-size-sm);
  border-radius: var(--border-radius);
  transition: all 0.2s;
}

.media-btn:hover:not(:disabled) { background: var(--color-gray-7); }
.media-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.media-btn.recording { background: var(--color-nuke-danger); animation: pulse 1s infinite; }

/* Media preview */
.chat-media-preview {
  display: flex;
  align-items: center;
  gap: var(--spacing);
  padding: var(--spacing);
  background: var(--color-gray-2);
  position: relative;
}

.preview-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-content img {
  max-width: 200px;
  max-height: 150px;
  border-radius: var(--border-radius);
  object-fit: contain;
}

.preview-cancel-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  color: var(--color-gray-5);
  background: transparent;
  transition: color 0.2s;
}

.preview-cancel-btn:hover { color: var(--color-white); }


/* --- Chat Panel: Recording --- */
/* Recording indicator */
.chat-recording-indicator {
  display: flex;
  align-items: center;
  gap: var(--spacing);
  padding: var(--spacing);
  background: var(--color-gray-2);
  position: absolute;
  bottom: 58px;
  left: 0;
  right: 0;
  z-index: 2;
}

.recording-dot {
  width: 12px;
  height: 12px;
  background: var(--color-nuke-danger);
  border-radius: 50%;
  animation: blink 1s infinite;
}

.recording-time {
  color: var(--color-white);
  font-weight: 700;
  font-size: var(--font-size-lg);
  min-width: 50px;
}

.recording-btn {
  padding: 8px 12px;
  background: var(--color-nuke-primary);
  color: var(--color-white);
  font-weight: 700;
  font-size: var(--font-size-sm);
  border-radius: var(--border-radius);
  transition: background 0.2s;
}

.recording-btn:hover { background: var(--color-nuke-primary-hover); }
.recording-btn.cancel { background: var(--color-gray-6); }
.recording-btn.cancel:hover { background: var(--color-gray-5); }


  /* Media & Images */
/* Message media */
.msg-media-wrapper { position: relative; }

.msg-image-container {
  margin: calc(-1 * var(--spacing-sm)) calc(-1 * var(--spacing)) 0;
}

.chat-message-image-only {
  padding: 0;
  overflow: hidden;
  background: transparent;
}

.chat-message-image-only .msg-header {
  margin: 0;
  padding: 8px var(--spacing) 2px;
}

.chat-message-image-only .msg-image-container {
  margin: 0;
}

.chat-message-image-only .msg-image {
  border-radius: 0;
  width: 100%;
}

.chat-message-image-only.chat-message {
  overflow: hidden;
}
/* Image bare (no header, no text) — uniform 4px corners to match tail edge */
.chat-message-image-bare.chat-message {
  border-radius: 4px;
  background: transparent;
}
.chat-message-image-bare.chat-message-tail {
  border-radius: 4px;
}
.chat-message-image-bare.chat-message-tail::after {
  display: none;
}
.chat-message-image-bare.chat-message-self.chat-message-tail::after {
  display: none;
}
/* Image only with tail — both bottom corners match 4px */
.chat-message-image-only.chat-message-tail {
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
}
.chat-message-image-only.chat-message-tail::after {
  display: none;
}
.chat-message-image-only.chat-message-self.chat-message-tail {
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
}
.chat-message-image-only.chat-message-self.chat-message-tail::after {
  display: none;
}
/* Image with header above — unround top edges of image */
.chat-message-image-has-header .msg-image {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
/* Image with text below — unround bottom edges of image */
.chat-message-image-has-text .msg-image {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.chat-message-image-has-text .msg-image-container {
  margin-bottom: 0;
}

.msg-image-loading {
  padding: var(--spacing-sm) var(--spacing);
  color: var(--color-gray-5);
  font-size: var(--font-size-md);
}

.msg-image {
  max-width: 100%;
  max-height: 400px;
  height: auto;
  border-radius: 4px;
  display: block;
  cursor: pointer;
}

/* Image lightbox */
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(4px);
  cursor: pointer;
}
.image-lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

.msg-time-overlay {
  position: absolute;
  bottom: 12px;
  right: 0;
  color: var(--color-gray-5);
  font-size: var(--font-size-sm);
}


  /* Voice */
.msg-voice-container {
  margin-top: var(--spacing-sm);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
  background: var(--color-gray-3);
  border-radius: var(--border-radius);
  max-width: 300px;
}

.voice-play-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  background: var(--color-nuke-primary);
  color: var(--color-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-sm);
  transition: background 0.2s;
  flex-shrink: 0;
}

.voice-play-btn:hover { background: var(--color-nuke-primary-hover); }
.voice-play-btn:disabled { background: var(--color-gray-6); cursor: not-allowed; }

.voice-progress-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.voice-progress {
  height: 4px;
  background: var(--color-gray-5);
  border-radius: 2px;
  overflow: hidden;
}

.voice-progress-fill {
  height: 100%;
  background: var(--color-nuke-primary);
  width: 0%;
  transition: width 0.1s linear;
}

.voice-time {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-sm);
  color: var(--color-gray-4);
}


/* --- Chat Panel: Scroll Button --- */

.chat-scroll-btn {
  position: absolute;
  bottom: 56px;
  right: calc(var(--spacing) - 4px);
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  color: rgba(158, 158, 158, 0.6);
  background: rgba(44, 44, 44, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  cursor: pointer;
  transform: translateY(0);
  transition: transform 0.15s ease, color 0.2s, background 0.2s, opacity 0.1s ease 0.05s;
}

.chat-panel:has(.collapsible-header:not(.collapsed)) .chat-scroll-btn {
  display: none;
}

.chat-scroll-btn.offscreen {
  transform: translateY(60px);
  opacity: 0;
  transition: transform 0.15s ease, opacity 0.1s ease 0.05s;
  pointer-events: none;
}

.chat-scroll-btn:hover {
  background: var(--color-gray-3);
  color: var(--color-white);
}


/* --- Chat Panel: XP Bar --- */
/* Drawer */
.chat-xp-bar {
  height: 8px;
  background: transparent;
  overflow: hidden;
  flex-shrink: 0;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.chat-xp-fill {
  height: 100%;
  background: #c0762d;
  width: 0%;
  transition: width 1.2s linear, background 0.5s ease;
}

.chat-xp-fill.xp-loss {
  background: #c02d2d;
}


/* --- Chat Panel: Animations --- */

@keyframes msg-jiggle {
  0%   { transform: scale(1); }
  25%  { transform: scale(1.08); }
  50%  { transform: scale(0.97); }
  75%  { transform: scale(1.02); }
  100% { transform: scale(1); }
}

@keyframes msg-slide-in {
  0% { transform: translate(-24px, 20px) scale(0.95) rotate(0deg); }
  20% { transform: translate(4px, -4px) scale(1.02) rotate(var(--tilt, -0.8deg)); }
  40% { transform: translate(-2px, 3px) scale(0.99) rotate(0.5deg); }
  60% { transform: translate(1px, -1px) scale(1.005) rotate(-0.25deg); }
  80% { transform: translate(0, 0) scale(1) rotate(0.1deg); }
  100% { transform: translate(0, 0) scale(1) rotate(0deg); }
}

.chat-message-new {
  animation: msg-slide-in-other 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-message-row-self .chat-message-new,
.chat-message-group-self .chat-message-new,
.chat-message-new.chat-message-self,
.chat-message-row-self.chat-message-new,
.chat-message-group-self.chat-message-new {
  animation: msg-slide-in 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-message-new.chat-message-self {
  background: var(--color-self-message);
  background-attachment: unset;
}

@keyframes msg-slide-in-other {
  0% { transform: translateY(20px) scale(0.95) rotate(0deg); }
  20% { transform: translateY(-4px) scale(1.02) rotate(var(--tilt, -0.8deg)); }
  40% { transform: translateY(3px) scale(0.99) rotate(0.5deg); }
  60% { transform: translateY(-1px) scale(1.005) rotate(-0.25deg); }
  80% { transform: translateY(0) scale(1) rotate(0.1deg); }
  100% { transform: translateY(0) scale(1) rotate(0deg); }
}

/* ===========================================
   PLAYER PANEL
   =========================================== */

/* --- Player Panel: Container --- */

.player-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 264px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
}

.player-panel-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  overscroll-behavior: contain;
  padding: 0 12px 106px 12px;
  min-height: 0;
  -webkit-mask-image: linear-gradient(
    to bottom,
    black 0%,
    black calc(100% - 35px),
    transparent calc(100% - 35px)
  );
  mask-image: linear-gradient(
    to bottom,
    black 0%,
    black calc(100% - 35px),
    transparent calc(100% - 35px)
  );
}

.player-panel-scroll::-webkit-scrollbar {
  display: none;
}

/* --- Player Panel: Header --- */

.panel-header {
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  background: red;
  justify-content: center;
  padding: 0 16px;
}

.panel-header-title {
  font-family: 'Impact', sans-serif;
  font-size: var(--font-size-xxl);
  font-weight: 400;
  color: var(--color-white);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.player-panel-close {
  display: none;
}

/* --- Player Panel: Nav --- */

.player-panel-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 0;
  flex-shrink: 0;
  border-bottom: 1px solid var(--color-gray-5);
}

.panel-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 2px;
  max-height: 50px;
  overflow: hidden;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--color-gray-8);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s,
              border-radius 0.3s cubic-bezier(0.34, 1.4, 0.64, 1),
              max-height 0.25s cubic-bezier(0.34, 1.4, 0.64, 1),
              opacity 0.15s ease-out,
              padding 0.2s ease-out, margin 0.2s ease-out;
}

.panel-nav-item:hover,
.panel-nav-item:has(+ .player-panel-section:not(.collapsed)) {
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-white);
}

.panel-nav-item:hover {
  border-radius: 12px;
}

.panel-nav-item:has(+ .player-panel-section:not(.collapsed)) {
  border-radius: 12px 12px 0 0;
}

/* When any section is expanded, collapse the other inactive nav buttons so the
   active button + its uncollapsed section fill the nav area alone. */
.player-panel-nav:has(> .player-panel-section:not(.collapsed))
  .panel-nav-item:not(:has(+ .player-panel-section:not(.collapsed))) {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: 0;
  pointer-events: none;
}

/* --- Player Panel: Collapsible Sections --- */

.player-panel-section {
  display: grid;
  grid-template-rows: 1fr;
  flex-shrink: 0;
  background: rgba(44, 44, 44, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 0 0 12px 12px;
  margin: -2px 0 8px 0;
  transition: grid-template-rows 0.3s cubic-bezier(0.34, 1.4, 0.64, 1),
              margin 0.2s ease-out;
}

.player-panel-section.collapsed {
  grid-template-rows: 0fr;
  margin: 0;
}

.player-panel-section > .section-inner {
  overflow: hidden;
  min-height: 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  transition: padding-top 0.2s ease-out, padding-bottom 0.2s ease-out;
}

.player-panel-section.collapsed > .section-inner {
  padding-top: 0;
  padding-bottom: 0;
}


/* Presale content overrides — stack the 4 stat boxes vertically, tighten spacing */
.player-panel-section .stats-panel { grid-template-columns: 1fr; gap: 8px; margin-bottom: 8px; }
.player-panel-section .stat-box { padding: 8px; }
.player-panel-section .presale-progress-bar { margin-bottom: 12px; }
.player-panel-section .presale-user-section,
.player-panel-section .presale-contribute-section { padding: 8px; margin-bottom: 12px; }
.player-panel-section .section-title { font-size: var(--font-size-sm); margin-bottom: 8px; }
.player-panel-section .presale-input { padding: 8px; font-size: var(--font-size-sm); }
.player-panel-section .presale-input-group { gap: 6px; }
.player-panel-section .action-btn { padding: 8px 12px; font-size: var(--font-size-sm); }
.player-panel-section .presale-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 4px 8px;
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--color-text-secondary);
}

/* Missions content overrides — strip beige parchment theme */
.player-panel-section #mission-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.player-panel-section .notif-item-message {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
  padding: 4px;
}
.player-panel-section .notifications-empty {
  font-size: var(--font-size-sm);
  color: var(--color-gray-8);
  text-align: center;
  padding: 4px;
  display: block;
}

/* Clan content overrides */
.player-panel-section #clan-content { padding: 0; background: transparent; border: 0; }
.player-panel-section .clan-form input { font-size: var(--font-size-sm); }

.player-panel-shop-grid {
  display: grid;
  grid-template-columns: repeat(4, 50px);
  gap: 8px;
  justify-content: start;
}

/* Size override: match .dock-inventory .inventory-slot */
.player-panel-shop-grid .item-card {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  box-sizing: border-box;
}

/* Empty placeholder cards — match the empty inventory slot look */
.player-panel-shop-grid .item-card-empty {
  border: none;
  border-style: none;
  background: var(--color-gray-1);
  opacity: 1;
}

/* Hide the divider inside the panel — pawn grid just gets matching gap */
.player-panel-section .shop-divider { display: none; }
.player-panel-section #grid-pawn { margin-top: 8px; }

.player-panel-shop-grid .shop-modal-empty {
  grid-column: 1 / -1;
  color: var(--color-gray-9);
  font-size: 12px;
  padding: 4px;
}

/* --- Player Panel: Leaderboard --- */

/* Header & Controls */

.player-panel-leaderboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  flex-shrink: 0;
  border-bottom: none;
  position: relative;
}

.panel-nav-item.panel-nav-label {
  cursor: default;
  color: var(--color-gray-8);
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.panel-nav-item.panel-nav-label:hover {
  background: transparent;
  color: var(--color-gray-8);
}

.leaderboard-online-count {
  font-size: var(--font-size-xs);
  color: var(--color-nuke-success);
}

/* Sorting & filtering styles removed from UI — logic kept in leaderboard.ts */

/* List & Rows */

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  padding: 4px 0;
  border-bottom: none;
  font-size: var(--font-size-sm);
  font-weight: 400;
  color: var(--color-text-secondary);
}

.leaderboard-row:last-child {
  border-bottom: none;
}

.leaderboard-value {
  flex-shrink: 0;
  text-align: right;
  font-weight: 600;
  color: var(--color-nuke-accent);
  padding-left: 8px;
}

/* States */

.leaderboard-empty {
  font-size: var(--font-size-sm);
  font-weight: 400;
  color: var(--color-text-muted);
  text-align: center;
  padding: 12px 0;
}

.leaderboard-loading {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  text-align: center;
  padding: 12px 0;
}

/* --- Player Panel: Calling Cards --- */
/* Reusable component — used in leaderboard, will be used site-wide */
/* JS: calling-card.ts applies onerror="this.style.display='none'" on pfp img */
/* JS: leaderboard.ts applies .style.color for profile colors on hover/active */

/* Entry Container */

.cc-entry {
  display: flex;
  align-items: center;
  gap: 0;
  cursor: pointer;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(44, 44, 44, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  justify-content: space-between;
  position: relative;
  transition: background 0.25s ease, transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  width: 240px;
  height: 45px;
  min-height: 45px;
  max-height: 45px;
  border: 1px solid var(--color-gray-6);
}

/* Season pass tier borders */
.cc-entry.cc-tier-core {
  border-color: var(--color-gray-6);
}

.cc-entry.cc-tier-plus,
.cc-entry.cc-tier-plutonium {
  overflow: visible;
}

.cc-entry.cc-tier-plus::after,
.cc-entry.cc-tier-plutonium::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  z-index: 4;
  opacity: 0.5;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
}

.cc-entry.cc-tier-plus::after {
  background: linear-gradient(135deg, #7a7a85, #c0c0cc, #9090a0, #d0d0dd, #858590);
}

.cc-entry.cc-tier-plutonium::after {
  background: linear-gradient(135deg, #b8860b, #ffd700, #daa520, #ffe44d, #b8860b);
}

@media (hover: hover) {
  .cc-entry:hover {
    background: rgba(44, 44, 44, 0.9);
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  }
}

.cc-entry:active,
.cc-entry.active {
  background: rgba(44, 44, 44, 1);
  animation: cc-press 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}

/* PFP */

.cc-pfp-wrapper {
  position: relative;
  width: 37px;
  height: 37px;
  flex-shrink: 0;
  margin: 4px;
  z-index: 2;
}

.cc-pfp {
  width: 37px;
  height: 37px;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.cc-pfp-border {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(calc(-50% - 1px), -50%);
  width: 48px;
  height: 48px;
  z-index: 1;
  pointer-events: none;
}

/* Banner */

.cc-banner {
  width: 180px;
  height: 100%;;
  margin: 0;
  padding: 4px 6px;
  border-bottom: none;
  border-radius: 0;
  cursor: pointer;
  position: static;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.cc-banner-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  opacity: 0.4;
  border-radius: inherit;
  z-index: 1;
  transition: opacity 0.25s ease;
  mask-image: linear-gradient(to right, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.2) 20%, black 50%);
  -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.2) 20%, black 50%);
}

@media (hover: hover) {
  .cc-entry:hover .cc-banner-img {
    opacity: 0.8;
  }
}

.cc-entry:active .cc-banner-img,
.cc-entry.active .cc-banner-img {
  opacity: 1;
}

/* Info Overlay */

.cc-info {
  position: absolute;
  left: 45px;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2px;
  padding: 4px 2px 2px 4px;
  z-index: 3;
}

.cc-top,
.cc-bottom {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 4px;
}

.cc-top {
  font-size: var(--font-size-sm);
  line-height: 1;
}

.cc-bottom {
  font-size: 10px;
  color: var(--color-gray-6);
  gap: 8px;
}

/* Stats & Labels */

.cc-rank {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  color: var(--color-gray-6);
  margin-left: auto;
}

.cc-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  white-space: nowrap;
  font-family: var(--font-conduit);
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--color-white);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.25s ease;
}

.cc-level-icon {
  width: var(--level-icon-sm);
  height: var(--level-icon-sm);
  flex-shrink: 0;
}

.cc-clan-tag {
  margin-left: 0;
}

.cc-balance {
  font-family: var(--font-conduit);
  font-size: 9px;
  font-weight: 700;
  color: var(--color-nuke-success);
}

.cc-dpr-pill {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  margin-right: 2px;
  background: transparent;
  border-radius: 999px;
  padding: 2px 4px 2px 8px;
  transition: background 0.25s ease;
}

.cc-entry:active .cc-dpr-pill,
.cc-entry.active .cc-dpr-pill {
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@media (hover: hover) {
  .cc-entry:hover .cc-dpr-pill {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

.cc-dpr {
  font-family: var(--font-conduit);
  font-size: 9px;
  font-weight: 700;
  color: var(--color-white);
  opacity: 0.6;
  margin-left: auto;
  transition: opacity 0.15s ease;
}

.cc-entry:active .cc-dpr,
.cc-entry.active .cc-dpr {
  opacity: 1;
}

@media (hover: hover) {
  .cc-entry:hover .cc-dpr {
    opacity: 1;
  }
}

/* Numeric font (Nunito) + tabular digits for all number-displaying elements */
.cc-rank,
.msg-balance, .msg-level-num,
.stat-value, .profile-pending-rewards,
.mission-timer,
.leaderboard-value, .leaderboard-online-count,
.presale-user-value, .presale-input,
.slot-charges, .item-ammo-label,
.notif-badge-count {
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
}

.online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-nuke-success);
  flex-shrink: 0;
  vertical-align: middle;
}

.cc-pfp-wrapper .online-dot {
  position: absolute;
  top: -4px;
  left: -4px;
  width: 10px;
  height: 10px;
  z-index: 2;
}

/* --- Player Panel: Dock --- */

.player-panel-dock-wrapper {
  position: absolute;
  bottom: 20px;
  left: 12px;
  right: 12px;
  z-index: 10;
}

.player-panel-dock {
  width: 100%;
  height: 66px;
  background: rgba(44, 44, 44, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: none;
  border-radius: 12px;
  box-shadow: none;
}

.dock-inventory {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  height: 100%;
}

.dock-inventory .inventory-slot {
  width: 50px;
  height: 50px;
  border-radius: 8px;
}

.sidebar-logo {
  height: 52px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-icons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 32px;
}

.sidebar-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--color-white);
  cursor: pointer;
  padding: 0;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}

.sidebar-icon {
  position: relative;
}

.sidebar-icon:hover {
  background: rgba(255,255,255,0.08);
}


.sidebar-icon::after {
  content: attr(title);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 4px;
  padding: 4px 8px;
  background: #000;
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  font-weight: 600;
  white-space: nowrap;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 10;
}

.sidebar-icon:hover::after {
  opacity: 1;
}

.mlg-logo {
  display: block;
  width: calc(100% - 32px);
  margin: 8px auto var(--spacing);
}


/* Profile dropdown (inside notification-header) */
#profile-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 382px;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--color-gray-2);
  border: 1px solid var(--color-gray-5);
  border-radius: 0 0 8px 8px;
  z-index: 200;
  padding: 0;
  scrollbar-width: none;
}

#profile-dropdown::-webkit-scrollbar {
  display: none;
}

/* ===========================================
   9. SHOP PANEL (shop, inventory, pawn, radio)
   =========================================== */

/* Shop grid */
.shop-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px;
}

.shop-empty {
  width: 100%;
  text-align: center;
  padding: var(--spacing-lg);
  color: var(--color-gray-6);
}

.shop-divider {
  margin: 12px 0;
}

.slot-icon { color: var(--color-text-primary); font-weight: 400; font-size: var(--font-size-xxl); }
.inventory-slot.equipped .slot-icon { filter: invert(1); }

.effect-positive { color: var(--color-nuke-success); }
.effect-negative { color: var(--color-nuke-danger); }

/* Shop categories */
.shop-jiggle { animation: shop-jiggle 0.5s ease; }

@keyframes shop-jiggle {
  0%   { transform: translateX(0); }
  15%  { transform: translateX(-4px); }
  30%  { transform: translateX(4px); }
  45%  { transform: translateX(-3px); }
  60%  { transform: translateX(3px); }
  75%  { transform: translateX(-1px); }
  90%  { transform: translateX(1px); }
  100% { transform: translateX(0); }
}

/* Pill landing bounce — overshoot + damped settle */
@keyframes cc-press {
  0%   { transform: scale(1); }
  40%  { transform: scale(0.98); }
  70%  { transform: scale(1.01); }
  100% { transform: scale(1); }
}

@keyframes pill-land {
  0%   { transform: scale(1); }
  25%  { transform: scale(1.08); }
  50%  { transform: scale(0.97); }
  75%  { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.dock-pill.pill-landed {
  animation: pill-land 0.3s ease-out;
}

/* Pawn action */
.pawn-action {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing);
}

.pawn-action .action-btn {
  width: 100%;
}

.pawn-select {
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: var(--border-radius);
  background: var(--color-gray-2);
  color: var(--color-white);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  font-weight: 400;
}

/* Radio */
.radio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
}

.radio-bar {
  margin-top: 0;
  position: relative;
  display: none;
}

#radio-section {
  position: relative;
}

.radio-dial {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--spacing);
  margin-bottom: var(--spacing-lg);
}

.station-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--spacing-lg);
  background: var(--color-gray-9);
  border: none;
  border-radius: var(--border-radius);
  color: var(--color-white);
  cursor: pointer;
  transition: all 0.2s;
}

.station-btn:hover {
  background: var(--color-gray-8);
  border-color: var(--color-nuke-accent);
}

.station-btn.active {
  background: var(--color-nuke-primary);
  border-color: var(--color-nuke-primary);
}

.station-freq {
  font-size: var(--font-size-xxl);
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
}

.station-info { font-size: var(--font-size-sm); color: var(--color-gray-4); }
.station-btn.active .station-info { color: var(--color-white); }

.radio-now-playing {
  background: var(--color-gray-9);
  padding: var(--spacing-lg);
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-lg);
  text-align: center;
}

.now-playing-label { color: var(--color-gray-5); margin-right: var(--spacing); }

.now-playing-song {
  color: var(--color-nuke-accent);
  font-weight: 700;
  font-size: var(--font-size-lg);
}

.radio-controls { margin-bottom: var(--spacing-lg); }

.radio-listeners-section {
  background: var(--color-gray-2);
  padding: var(--spacing);
  border-radius: var(--border-radius);
}

.radio-listeners {
  max-height: 300px;
  overflow-y: auto;
}

.radio-listener {
  display: grid;
  grid-template-columns: 1fr 80px 1fr;
  gap: var(--spacing);
  padding: var(--spacing-sm);
  border-bottom: none;
}

.radio-listener:last-child { border-bottom: none; }

.listener-name { font-weight: 700; }
.listener-station { color: var(--color-nuke-primary); font-weight: 700; text-align: center; }

.listener-song {
  color: var(--color-gray-6);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.radio-no-listeners {
  color: var(--color-gray-5);
  text-align: center;
  padding: var(--spacing-lg);
}

.radio-disconnected,
.radio-error,
.radio-empty {
  text-align: center;
  padding: calc(var(--spacing-lg) * 2);
  color: var(--color-gray-6);
}

.radio-error { color: var(--color-nuke-danger); }


/* ===========================================
   PROFILE PANEL (Side Panel)
   =========================================== */

/* --- Profile Panel: Container --- */
.side-panel {
  position: fixed;
  top: 40px;
  right: 16px;
  width: 400px;
  height: calc(100dvh - 40px - 16px);
  background: transparent;
  border-radius: 12px;
  overflow: hidden;
  z-index: 101;
  display: flex;
  flex-direction: column;
  transform: translateX(calc(100% + 16px));
  transition: transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
  pointer-events: none;
}

.side-panel.open {
  transform: translateX(0);
  pointer-events: auto;
}

.side-panel-banner-top {
  width: 100%;
  height: 100px;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  background: var(--color-gray-5);
  z-index: 1;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 100'%3E%3Crect width='400' height='100' fill='white'/%3E%3Crect x='12' y='60' width='80' height='80' rx='2' fill='black'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 100'%3E%3Crect width='400' height='100' fill='white'/%3E%3Crect x='12' y='60' width='80' height='80' rx='2' fill='black'/%3E%3C/svg%3E");
  mask-size: 100% 100%;
  -webkit-mask-size: 100% 100%;
  mask-mode: luminance;
  -webkit-mask-mode: luminance;
}

.side-panel-banner-top img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


.side-panel-username-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 16px;
  margin-top: 44px;
  flex-shrink: 0;
}

.side-panel-username-left {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.side-panel-nav-btns {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 2px;
  z-index: 2;
}

.side-panel-nav-btn {
  background: var(--color-gray-5);
  border: none;
  color: var(--color-white);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.side-panel-nav-btn.active {
  background: var(--color-nuke-primary);
}

.side-panel-nav-btn {
  position: relative;
}

.notif-badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  background: var(--color-nuke-primary);
  color: var(--color-white);
  font-size: 9px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
  border-radius: 7px;
  pointer-events: none;
}

.side-panel-close {
  background: var(--color-nuke-primary);
  border: none;
  color: var(--color-white);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.side-panel-close:hover {
  color: var(--color-white);
}

.side-panel-username-row .username {
  margin: 0;
}

/* Side panel PFP — fixed, overlaps banner */
.side-panel > .side-panel-pfp-border {
  position: absolute;
  top: 100px;
  left: 10px;
  width: 84px;
  height: 84px;
  transform: translateY(-50%);
  z-index: 4;
  pointer-events: none;
}

.side-panel > .side-panel-pfp {
  position: absolute;
  top: 100px;
  left: 16px;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 4px;
  transform: translateY(-50%);
  z-index: 3;
}

.side-panel-profile .side-panel-banner {
  width: calc((100% - 12px) * 4 / 5);
  aspect-ratio: 4 / 1;
  margin-top: 0;
}

.side-panel-inventory {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 4px 0;
}

.side-panel-inventory .inventory-slot {
  aspect-ratio: 1;
}

.side-panel-header {
  height: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 12px;
}

.side-panel-content {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: none;
  padding: 0 16px;
}

.side-panel-content::-webkit-scrollbar {
  display: none;
}

#side-panel-view-notifs {
  height: 100%;
}

/* Settings view */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-gray-3);
  border: 1px solid var(--color-gray-4);
  border-radius: 4px;
  color: var(--color-white);
  font-family: var(--font-conduit);
  font-size: var(--font-size-sm);
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.settings-item:hover {
  background: var(--color-gray-4);
}

.settings-item:active {
  background: var(--color-gray-5);
}

.settings-gate {
  font-size: 10px;
  font-weight: 400;
  color: var(--color-gray-8);
  margin-left: auto;
}

.side-panel-content .profile-dropdown-bank {
  padding: 8px 0;
}

.side-panel-tabs {
  display: flex;
  border-bottom: none;
  flex-shrink: 0;
}

.side-panel-tab {
  flex: 1;
  padding: 10px 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--color-text-muted);
  font-family: var(--font-conduit);
  font-size: var(--font-size-sm);
  font-weight: 400;
  cursor: pointer;
  text-align: center;
}

.side-panel-tab:hover {
  color: var(--color-white);
}

.side-panel-tab.active {
  color: var(--color-white);
  border-bottom-color: var(--color-white);
}

.side-panel-tab-content {
  display: none;
}

.side-panel-tab-content.active {
  display: block;
}



/* --- Profile Panel: Header & Navigation --- */
.notification-header {
  height: 34px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  background: transparent;
  border-radius: 0;
  position: relative;
}

/* --- Profile Panel: Banner & PFP --- */
.profile-header-row,
.profile-bio-row {
  position: relative;
  overflow: visible;
}

.profile-header-row::before,
.profile-bio-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.44) 0px,
      rgba(0, 0, 0, 0.44) 1px,
      transparent 1px,
      transparent 2px
    ),
    linear-gradient(
      0deg,
      transparent 0%,
      rgba(255, 255, 255, 0.16) 50%,
      transparent 100%
    );
  background-size: 100% 100%, 100% 80px;
  animation: crt-scroll 16s linear infinite;
  pointer-events: none;
  z-index: 1;
}

.profile-header-row > *,
.profile-bio-row > * {
  position: relative;
  z-index: 2;
}

/* --- Profile Panel: Username & Info --- */
.profile-header-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 0;
  width: 100%;
  padding: 4px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3) 0%, rgba(194, 255, 226, 0.24) 25%, rgba(194, 255, 226, 0.24) 75%, rgba(255, 255, 255, 0.3) 100%);
  border: none;
}

.profile-pfp-img {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 4px;
  background: var(--color-gray-2);
  object-fit: cover;
  cursor: pointer;
}

.profile-pending-rewards {
  position: relative;
  top: 2px;
  min-width: 0;
  margin: -4px 0;
  overflow: hidden;
  font-family: var(--font-conduit);
  font-size: var(--font-size-lg);
  font-weight: 500;
  color: var(--color-white);
  white-space: nowrap;
  text-overflow: ellipsis;
  -webkit-text-stroke: 3px rgba(0, 0, 0, 0.5);
  paint-order: stroke fill;
}

.profile-header-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-banner-area {
  width: 100%;
  aspect-ratio: 4 / 1;
  background: var(--color-gray-8);
  overflow: hidden;
  cursor: pointer;
  margin-top: 2px;
  position: relative;
  z-index: 2;
}

.profile-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-bio-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 8px;
  padding: 2px 8px;
  border: none;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3) 0%, rgba(194, 255, 226, 0.24) 35%, rgba(194, 255, 226, 0.24) 65%, rgba(255, 255, 255, 0.3) 100%);
  cursor: pointer;
}

.profile-status-icons {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.profile-status-icons svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.profile-level {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin: -4px 0;
  margin-left: 8px;
  -webkit-text-stroke: 3px rgba(0, 0, 0, 0.5);
  paint-order: stroke fill;
}

.profile-level > .stat-level-icon {
  position: relative;
  z-index: 2;
}

.profile-level > .stat-value {
  font-family: var(--font-conduit);
  font-size: var(--font-size-lg);
  font-weight: 500;
  color: var(--color-white);
  position: relative;
  top: 2.5px;
}

.username-row {
  display: flex;
  align-items: baseline;
  min-width: 0;
}

.profile-bio {
  font-family: var(--font-conduit);
  color: var(--color-white);
  font-size: var(--font-size-xxl);
  font-weight: 500;
  margin: 0;
  padding: 0;
  line-height: 1;
  -webkit-text-stroke: 5px rgba(0, 0, 0, 0.5);
  paint-order: stroke fill;
  max-width: 6ch;
  overflow: hidden;
  white-space: nowrap;
  flex-shrink: 0;
}

.banner-bio {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-conduit);
  font-size: var(--font-size-xxl);
  font-weight: 500;
  color: var(--color-white);
  -webkit-text-stroke: 3px rgba(0, 0, 0, 1);
  paint-order: stroke fill;
  white-space: nowrap;
  text-transform: uppercase;
  z-index: 1;
  pointer-events: none;
}

.bio-edit-icon {
  margin-right: 4px;
  color: var(--color-gray-5);
  vertical-align: baseline;
  position: relative;
  top: 1px;
}

.profile-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing);
  margin-bottom: var(--spacing-lg);
}

/* --- Profile Panel: Profile Display --- */
.profile-modal {
  background: var(--color-gray-2);
  border: var(--border-width) solid var(--color-gray-4);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.profile-modal-title {
  font-weight: 700;
  font-size: var(--font-size-lg);
  color: var(--color-white);
  margin-bottom: var(--spacing);
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: var(--spacing-sm);
}

.asset-grid-item {
  aspect-ratio: 1;
  border: none;
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
}

.asset-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-grid {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.banner-grid-item {
  width: 50%;
  aspect-ratio: 4 / 1;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.2s;
}

.banner-grid-item:hover {
  opacity: 0.8;
}

.banner-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bio-modal-textarea {
  width: 100%;
  min-height: 100px;
  background: var(--color-gray-3);
  color: var(--color-white);
  border: var(--border-width) solid var(--color-gray-4);
  border-radius: var(--border-radius);
  padding: var(--spacing);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  font-weight: 400;
  resize: vertical;
}

.bio-char-count {
  font-size: var(--font-size-sm);
  color: var(--color-gray-5);
  text-align: right;
  margin-top: 4px;
}

.color-preview-name {
  font-weight: 700;
  font-size: var(--font-size-lg);
  text-align: center;
  margin-bottom: var(--spacing);
}

.color-swatch-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-sm);
}

.color-swatch {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: border-color 0.15s;
}

.color-swatch:hover {
  border-color: var(--color-gray-5);
}

.color-swatch.active {
  border-color: var(--color-white);
}

/* --- Profile Panel: Stats --- */
.stat-box {
  padding: var(--spacing);
  background: var(--color-gray-1);
  border: none;
  border-radius: var(--border-radius);
  text-align: center;
}

.stat-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 400;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.stat-value {
  display: block;
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text-primary);
}

.stat-level-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.item-count {
  font-size: var(--font-size-sm);
  color: var(--color-gray-6);
}

/* Page headers */
.inventory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing);
  border-bottom: none;
}

/* --- Profile Panel: Bank --- */
.profile-dropdown-content {
  padding: 8px;
}

.profile-dropdown-bank {
  padding: 8px;
}

.profile-dropdown-bank .bank-modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.profile-dropdown-bank .action-btn {
  flex: 1;
}

/* Bank actions (used in profile dropdown) */
.bank-modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.bank-modal-actions .chat-smart-btn {
  flex: 1;
  margin: 0;
  height: 36px;
}
.bank-modal-actions .action-btn {
  flex: 1;
}

.bank-level-icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin-right: 4px;
}

.action-row-spacer {
  flex: 1;
}

.presale-action-buttons {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

#inventory-count {
  color: var(--color-gray-9);
  font-size: 12px;
}

.bank-xp-bar {
  height: 4px;
  background: var(--color-gray-4);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}

.bank-xp-fill {
  height: 100%;
  background: linear-gradient(to right, #c0762d, #eac374);
  width: 0%;
  transition: width 0.5s ease;
}

/* ============ Inventory Modal ============ */
.inventory-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
}
.inventory-modal-overlay.modal-animate-in { animation: mission-bg-in 0.15s ease-out; }
.inventory-modal-overlay.closing { animation: mission-bg-out 0.12s ease-in forwards; }
.inventory-modal-overlay.hidden { display: none; }
.inventory-modal {
  width: 328px;
  display: flex;
  flex-direction: column;
  background: transparent;
}
.inventory-modal-overlay.modal-animate-in .inventory-modal { animation: mission-in 0.12s cubic-bezier(0.16, 1, 0.3, 1); }
.inventory-modal-overlay.closing .inventory-modal { animation: mission-out 0.1s ease-in forwards; }
.inventory-modal-header {
  padding: 8px 16px;
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-white);
  background: var(--color-gray-3);
  border: none;
  border-radius: 8px 8px 0 0;
}
.inventory-modal-body {
  background: var(--color-gray-2);
  border: none;
  border-radius: 0 0 8px 8px;
  padding: 8px;
}
.inventory-modal-body .inventory-slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.inventory-modal-body .inventory-slot {
  aspect-ratio: 1;
}

/* --- Profile Panel: Inventory --- */
.inventory-slots {
  display: flex;
  gap: 16px;
  padding: 16px;
  margin-bottom: var(--spacing-lg);
  background: #1a2a4a;
  border-radius: 4px;
}

.inventory-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  padding: var(--spacing);
  box-sizing: border-box;
  border: none;
  border-radius: 2px;
  background: var(--color-gray-1);
  cursor: pointer;
  transition: all 0.2s;
}

.inventory-slot:hover { border-color: var(--color-nuke-primary); }
.inventory-slot.empty { cursor: default; }

.inventory-slot.selected {
  border-color: var(--color-nuke-primary);
  background: rgba(237, 28, 36, 0.05);
}

.slot-number {
  position: absolute;
  top: 4px;
  left: 8px;
  font-size: var(--font-size-sm);
  font-weight: 400;
  color: var(--color-text-muted);
}

.slot-empty-text { color: var(--color-text-muted); font-size: var(--font-size-sm); font-weight: 400; }
.slot-item-type { font-weight: 700; font-size: var(--font-size-lg); text-align: center; }

.inventory-tooltip {
  position: fixed;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: none;
  border-radius: 4px;
  background: var(--color-gray-2);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.inventory-tooltip.visible { opacity: 1; pointer-events: auto; }
.inventory-tooltip-icon { font-size: 20px; }
.inventory-tooltip-name { font-weight: 700; color: var(--color-white); }
.inventory-tooltip-tags { display: flex; gap: 4px; }

.item-card {
  width: 72px;
  height: 72px;
  border: none;
  border-radius: 0;
  padding: var(--spacing);
  box-sizing: border-box;
  background: var(--color-gray-1);
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
}

.item-card:hover { border-color: var(--color-nuke-primary); }
.item-card.keyboard-selected { border-color: var(--color-nuke-primary); background: rgba(237, 28, 36, 0.1); }
.item-card-empty { border-style: dashed; opacity: 0.3; pointer-events: none; }

.item-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing);
}

.item-type { font-weight: 700; font-size: var(--font-size-lg); }
.item-price { color: var(--color-nuke-primary); font-weight: 700; }
.item-ammo-label { font-size: var(--font-size-sm); font-weight: 700; color: var(--color-text-primary); }

.item-effects {
  font-size: var(--font-size-sm);
  color: var(--color-gray-6);
  margin-bottom: var(--spacing);
}

.item-effect {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}

.item-tag.weapon { background: #7c3aed; color: var(--color-white); }
.item-tag.pawned { background: #d97706; color: var(--color-white); }


/* --- Profile Panel: Notifications --- */
/* Pin notifications to bottom of profile content */
#profile-content {
  display: flex;
  flex-direction: column;
}

/* Notification header bar */
.notification-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  font-size: var(--font-size-md);
  border-bottom: none;
}

.notif-rotate-item { display: none; }
.notif-rotate-item.active { display: inline; }

.notif-season {
  font-family: var(--font-conduit);
  font-size: var(--font-size-xl);
  font-weight: 900;
  color: var(--color-white);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.notif-online {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
}

.notif-jackpot {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-nuke-accent);
}

.notif-info {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
}

.notifications-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#notifications-count {
  display: inline-block;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--color-nuke-primary);
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  border-radius: 8px;
}

#notifications-count:empty {
  display: none;
}


.notifications-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing);
}

.notifications-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
}

.notifications-count {
  font-size: var(--font-size-sm);
  color: var(--color-gray-5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.notifications-list::-webkit-scrollbar {
  display: none;
}

.notifications-empty {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  font-weight: 400;
  padding: var(--spacing);
  text-align: center;
}

.notif-item {
  position: relative;
  padding: var(--spacing);
  background: var(--color-gray-1);
  font-size: var(--font-size-sm);
  transition: background 0.15s;
}

.notif-item.unread {
  background: var(--color-gray-2);
}

.notif-unread-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--color-nuke-success, #4caf50);
  border-radius: 50%;
}

.notif-item, .notif-item * { color: var(--color-white); }
.notif-item-title { font-weight: 700; margin-bottom: 2px; color: var(--color-white); }
.notif-item-message { color: var(--color-white); font-size: var(--font-size-sm); line-height: 1.4; }
.notif-item-time { color: var(--color-white); font-size: var(--font-size-sm); margin-top: 4px; }
.notif-item[data-type="mission"] { border-left: none; background: none; padding: 0; }

.notif-item-effects {
  margin-top: 4px;
  padding: 4px var(--spacing-sm);
  background: var(--color-gray-2);
  border-radius: var(--border-radius);
  font-size: var(--font-size-sm);
  color: var(--color-white);
}

.notif-item-effects span { display: inline-block; margin-right: var(--spacing-sm); }


.notif-mention-quote {
  margin-top: 4px;
  padding: 4px 8px;
  background: var(--color-gray-2);
  border-left: 2px solid var(--color-nuke-link);
  color: var(--color-gray-6, var(--color-white));
  font-style: italic;
}

.notifications-header-text-wrapper {
  overflow: hidden;
  min-width: 0;
}

#notifications-header-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  font-weight: 400;
  font-size: var(--font-size-md);
  color: var(--color-text-primary);
}

.notif-header-quote {
  margin-left: 8px;
  color: var(--color-gray-5);
  font-style: italic;
}
.notif-header-quote::before {
  content: '"';
}
.notif-header-quote::after {
  content: '"';
}

/* --- Profile Panel: Missions --- */

@keyframes mission-bg-in {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes mission-bg-out {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes mission-in {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes mission-out {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0; }
}

.mission-footer {
  display: flex;
  align-items: center;
  padding: 8px 4px 0;
  margin-top: 6px;
  border-top: 1px solid var(--color-gray-5);
  gap: 8px;
}

.mission-streak {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.mission-streak-count {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--color-text-primary);
}

.mission-timer {
  flex: 1;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: var(--font-size-sm);
  color: var(--color-gray-8);
  text-align: right;
}

/* --- Profile Panel: Customization --- */

/* --- Profile Panel: Chat Panel Adjustments --- */
.chat-panel.side-panel-open {
  margin-right: 428px;
}

.chat-panel.side-panel-open .chat-sub-header {
  right: -428px;
}

.chat-panel.side-panel-open .header-profile-square {
  right: -412px;
  visibility: hidden;
  transition: right 0.35s cubic-bezier(0.34, 1.4, 0.64, 1), visibility 0s linear 0.175s;
}


/* ---- Keyboard Shortcuts Panel ---- */
.shortcuts-panel {
  position: fixed;
  bottom: 12px;
  left: 12px;
  z-index: 1000;
  background: var(--color-gray-2);
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  min-width: 220px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.shortcuts-panel.hidden { display: none; }

.shortcuts-title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.shortcuts-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  font-size: var(--font-size-sm);
  font-weight: 400;
  color: var(--color-text-secondary);
}

.shortcuts-key {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  background: var(--color-gray-3);
  border: none;
  border-radius: 4px;
  padding: 2px 6px;
  margin-right: 12px;
}



/* --- 11d. Clan --- */

.clan-container {
  width: 100%;
  padding: 8px;
  background: var(--color-collapsible-bg);
  border: none;
  margin-bottom: 8px;
}

.clan-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.clan-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.clan-info-row .clan-value {
  color: var(--color-white);
  font-weight: 600;
}

.clan-tag {
  font-weight: 700;
  font-size: var(--font-size-sm);
  padding: 1px 4px;
  border-radius: 2px;
}

.clan-color-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 2px;
  border: none;
  vertical-align: middle;
}

.clan-invite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: none;
  font-size: var(--font-size-sm);
}

.clan-invite-row:last-child {
  border-bottom: none;
}

.clan-invite-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-white);
}

.notif-item.clan-invite-notif .clan-invite-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.clan-invite-actions {
  display: flex;
  gap: 4px;
}

.clan-invite-actions button {
  padding: 2px 8px;
  font-size: var(--font-size-sm);
  cursor: pointer;
  border: none;
  background: var(--color-gray-2);
  color: var(--color-white);
  border-radius: 2px;
}

.clan-invite-actions button:hover {
  background: var(--color-gray-3);
}

.clan-invite-actions button.accept-btn {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #000;
}

.clan-invite-actions button.decline-btn {
  background: var(--color-danger);
  border-color: var(--color-danger);
}

.clan-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.clan-form input {
  padding: 4px 8px;
  font-size: var(--font-size-sm);
  background: var(--color-gray-2);
  border: none;
  color: var(--color-white);
  border-radius: 2px;
}

.clan-form input::placeholder {
  color: var(--color-text-muted);
}

.clan-section-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 8px;
  margin-bottom: 4px;
}

.clan-empty-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  text-align: center;
  padding: 8px 0;
}


/* --- 11g. Presale --- */

.presale-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing);
  border-bottom: var(--border-width) solid var(--color-gray-3);
}

.presale-status-value {
  font-weight: 700;
  font-size: var(--font-size-sm);
  padding: 4px 12px;
  border-radius: var(--border-radius);
}

.presale-status-value.active {
  background: rgba(0, 166, 81, 0.1);
  color: var(--color-nuke-success);
}

.presale-status-value.inactive {
  background: var(--color-gray-2);
  color: var(--color-gray-6);
}

.presale-stats { margin-bottom: var(--spacing); }

.presale-progress-bar {
  height: 8px;
  background: var(--color-gray-3);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: var(--spacing-lg);
}

.presale-progress-fill {
  height: 100%;
  background: var(--color-nuke-success);
  width: 0%;
  transition: width 0.3s;
}

.presale-user-section {
  padding: var(--spacing);
  background: var(--color-gray-1);
  border: var(--border-width) solid var(--color-gray-3);
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-lg);
}

.presale-user-stats {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.presale-user-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

.presale-user-label { font-size: var(--font-size-sm); font-weight: 400; color: var(--color-text-muted); }
.presale-user-value { font-size: var(--font-size-sm); font-weight: 700; color: var(--color-text-primary); }

.presale-claim-section {
  padding: var(--spacing);
  text-align: center;
}

.presale-contribute-section {
  padding: var(--spacing);
  background: var(--color-gray-1);
  border: var(--border-width) solid var(--color-gray-3);
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-lg);
}

.presale-input-group {
  display: flex;
  gap: var(--spacing);
}

.presale-input-group .action-btn {
  flex-shrink: 0;
}

.presale-input {
  flex: 1;
  min-width: 0;
  padding: 12px;
  border: var(--border-width) solid var(--color-gray-3);
  border-radius: var(--border-radius);
  background: var(--color-gray-2);
  color: var(--color-text-primary);
  font-family: var(--font-mono);
  font-size: var(--font-size-md);
  font-weight: 400;
}

.presale-input:focus {
  outline: none;
  border-color: var(--color-nuke-primary);
}

.presale-inactive-notice {
  text-align: center;
  padding: var(--spacing-lg);
  color: var(--color-gray-6);
  background: var(--color-gray-1);
  border: var(--border-width) solid var(--color-gray-3);
  border-radius: var(--border-radius);
}

/* ===========================================
   12. ADMIN
   =========================================== */

/* --- Mention Toast --- */

.mention-toast {
  display: none;
}

.mention-toast-label {
  font-family: var(--font-conduit);
  font-size: var(--font-size-xxl);
  font-weight: 500;
  color: var(--color-white);
  -webkit-text-stroke: 5px rgba(0, 0, 0, 0.5);
  paint-order: stroke fill;
  text-transform: capitalize;
  text-align: center;
  margin-bottom: -4px;
}

.mention-toast-card {
  position: relative;
  display: block;
  width: 100%;
}

.mention-toast-card .profile-header-row,
.mention-toast-card .profile-bio-row {
  animation: none;
}


.mention-toast-card .profile-bio-row {
  margin-bottom: 0;
}

.notification-header-toast-clip {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 400px;
  overflow: hidden;
  pointer-events: none;
}

.notification-header .mention-toast {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
  left: 0;
  right: 0;
  width: 100%;
  transform: translateY(-100%);
  transition: transform 0.15s ease-out;
  pointer-events: auto;
}

.notification-header .mention-toast-visible {
  transform: translateY(4px);
}


/* ===========================================
   13. ANIMATIONS
   =========================================== */
@keyframes crt-scroll {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 0 0, 0 80px; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.7; }
}

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

/* ===========================================
   14. RESPONSIVE
   =========================================== */
@media screen and (max-width: 768px) {
  .top-header .dock-pill { display: none; }

  .chat-pill {
    white-space: normal;
    height: auto;
    min-height: 20px;
    max-width: calc(100% - 24px);
    text-align: left;
    padding: 4px 10px;
    font-size: 14px;
  }

  /* Player Panel: Mobile */
  .player-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 264px;
    height: 100dvh;
    background: var(--color-gray-1);
    z-index: 50;
    display: flex;
    flex-direction: column;
    clip-path: inset(0 100% 0 0);
    transition: clip-path 0.25s ease;
  }

  .chat-container:has(.player-panel-open) .player-panel {
    clip-path: inset(0 0 0 0);
  }

  .player-panel-close {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--color-white);
    cursor: pointer;
    padding: 4px;
    margin-left: auto;
  }


  /* Chat Panel: Mobile */
  .subheader-logo {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .top-header {
    display: none;
    margin-left: 0;
  }

  .chat-layout {
    margin-left: 0;
    transition: transform 0.25s ease;
    position: relative;
    z-index: 60;
  }

  .chat-layout.player-panel-open {
    transform: translateX(264px);
  }

  .chat-content,
  .msg-content {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    font-weight: 600;
  }

  .msg-sender {
    font-size: 14px;
  }

  .chat-context-menu-item {
    font-size: 14px;
  }

  .chat-nuke-banner {
    font-size: 48px;
  }

  .chat-sub-header {
    background: var(--color-gray-1);
    height: 49px;
  }

  .mobile-pill-header {
    position: absolute;
    top: 49px;
    left: 0;
    right: 0;
    height: 30px;
    background: var(--color-gray-1);
    border-bottom: 1px solid var(--color-gray-3);
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .mobile-pill-header::-webkit-scrollbar {
    display: none;
  }

  /* DEBUG: blue line = bottom of pill header */
  .mobile-pill-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: blue;
    z-index: 999;
  }

  .header-profile-square {
    top: 8px;
    right: 8px;
  }

  .header-profile-square .cc-entry {
    width: 192px;
    height: 36px;
    min-height: 36px;
    max-height: 36px;
  }

  .header-profile-square .cc-pfp-wrapper {
    width: 30px;
    height: 30px;
    margin: 3px;
  }

  .header-profile-square .cc-pfp {
    width: 30px;
    height: 30px;
  }

  .header-profile-square .cc-pfp-border {
    width: 34px;
    height: 34px;
  }

  .msg-pfp {
    width: 30px;
    height: 30px;
  }

  .chat-group-pfp {
    width: 30px;
  }

  .msg-reaction-badge {
    font-size: 14px;
  }

  .msg-reaction-count {
    font-size: 14px;
  }

  .pill-transparent {
    font-size: 12px;
  }

  .chat-message {
    padding: 5px 10px;
  }

  .chat-input-bubble .chat-text-input {
    font-size: 14px;
  }

  .chat-panel {
    border: none;
    border-radius: 0;
    margin-right: 0;
    margin-bottom: 0;
  }


  /* Profile Panel: Mobile */
  .side-panel {
    top: 0;
    right: 0;
    width: 100%;
    height: 100dvh;
    background: var(--color-gray-1);
    border-top: none;
    border-left: none;
    border-radius: 0;
    transform: translateX(100%);
    transition: transform 0.25s ease-out;
  }

  .side-panel.open {
    transform: translateX(0);
  }

  .chat-panel.side-panel-open {
    margin-right: 0;
  }

  .chat-panel.side-panel-open .chat-sub-header {
    right: 0;
  }

  .chat-panel.side-panel-open .header-profile-square {
    right: 16px;
  }

  .dock-wrapper {
    bottom: calc(12px + var(--keyboard-offset, 0px));
    left: 12px;
    right: 12px;
  }





  .content {
    padding: var(--spacing);
  }

  .content {
    background-color: var(--color-gray-1);
  }
  .stats-panel { grid-template-columns: repeat(2, 1fr); }
  .shop-grid { grid-template-columns: 1fr; }
  .onboarding-input-group { max-width: 100%; }

  .chat-emoji-btn,
  .emoji-panel,
  .header-menu-btn {
    display: none !important;
  }

  .chat-panel {
    padding-top: 0;
  }

  .chat-messages {
    padding-left: 12px;
    padding-right: 12px;
    padding-top: 4px;
    top: 75px;
    margin-right: 0;
    scrollbar-width: none;
  }

  .chat-messages::-webkit-scrollbar {
    display: none;
  }

  /* DEBUG: red line = top of chat cutoff */
  .chat-messages::before {
    content: '';
    flex: 1;
    border-top: 1px solid red;
  }


  .chat-messages > * {
    margin-right: 0;
  }

  .chat-message,
  .chat-message-row,
  .chat-message-group {
    max-width: 95%;
  }





  .chat-scroll-btn {
    bottom: 64px;
    right: 12px;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  .chat-scroll-btn.offscreen {
    transform: translateY(50px);
    opacity: 0;
    pointer-events: none;
  }

  .chat-panel:has(.use-command-dropdown) .chat-scroll-btn {
    transform: translateY(-32px);
  }

  .chat-panel:has(.use-command-dropdown) .chat-scroll-btn.offscreen {
    transform: translateY(50px);
    opacity: 0;
  }

  /* Drawer is moved to body on mobile — hide when chat page isn't active */
  /* Position hint container above the absolute input area on mobile */
  .chat-input-hint-container {
    position: absolute;
    bottom: 56px;
    left: 0;
    right: 0;
    padding: 0;
    margin: 0;
  }



  /* Chat Panel: Mobile Animations */
  @keyframes msg-slide-in {
    0% { transform: translateY(20px) scale(0.95) rotate(0deg); }
    20% { transform: translateY(-4px) scale(1.02) rotate(var(--tilt, -0.8deg)); }
    40% { transform: translateY(3px) scale(0.99) rotate(0.5deg); }
    60% { transform: translateY(-1px) scale(1.005) rotate(-0.25deg); }
    80% { transform: translateY(0) scale(1) rotate(0.1deg); }
    100% { transform: translateY(0) scale(1) rotate(0deg); }
  }

}


/* ============ Announcement Popup ============ */

.announcement-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
}

.announcement-popup-content {
  background: var(--bg-primary, #1a1a1a);
  border: 1px solid var(--border-color, #333);
  border-radius: 8px;
  padding: 24px;
  max-width: 360px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.announcement-popup-header {
  font-size: 16px;
  font-weight: bold;
  color: var(--text-primary, #fff);
}

.announcement-popup-desc {
  font-size: 13px;
  color: var(--text-secondary, #999);
  margin: 0;
}

.announcement-msg-input {
  background: var(--bg-secondary, #222);
  border: 1px solid var(--border-color, #444);
  border-radius: 4px;
  color: var(--color-white);
  padding: 8px 10px;
  font-size: var(--font-size-md);
  font-weight: 400;
  font-family: inherit;
}

.announcement-confirm-btn {
  background: var(--accent-color, #4a9eff);
  color: var(--color-white);
  border: none;
  border-radius: 4px;
  padding: 12px;
  font-size: var(--font-size-md);
  font-weight: 400;
  cursor: pointer;
  font-family: inherit;
}

.announcement-confirm-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.announcement-cancel-btn {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--border-color, #444);
  border-radius: 4px;
  padding: 8px;
  font-size: var(--font-size-sm);
  font-weight: 400;
  cursor: pointer;
  font-family: inherit;
}

.announcement-status {
  font-size: 12px;
  color: var(--text-secondary, #999);
  min-height: 1em;
}

/* ============ Announcement Overlay (Radio) ============ */

.announcement-overlay {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9000;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid var(--accent-color, #4a9eff);
  border-radius: 8px;
  padding: 12px 24px;
  color: var(--color-white);
  font-size: 14px;
  pointer-events: none;
  animation: announcement-pulse 1.5s ease-in-out infinite;
}

@keyframes announcement-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ============ Item Preview Modal ============ */
.item-preview-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
}

.item-preview-modal {
  position: relative;
  width: 280px;
  background: var(--color-gray-1);
  border-radius: 12px;
  padding: 24px 20px 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.item-preview-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--color-gray-8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.item-preview-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-white);
}

.item-preview-icon {
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  margin-bottom: 12px;
}

.item-preview-name {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-white);
  text-align: center;
  margin-bottom: 12px;
}

.item-preview-description {
  font-size: var(--font-size-sm);
  color: var(--color-gray-8);
  text-align: center;
  line-height: 1.4;
  margin-bottom: 20px;
  min-height: 40px;
}

.item-preview-buy-btn,
.item-preview-action-btn {
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  font-size: var(--font-size-md);
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s;
  color: var(--color-white);
}

.item-preview-buy-btn {
  width: 100%;
  background: var(--color-nuke-primary);
}

.item-preview-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}

.item-preview-action-btn {
  flex: 1;
}

.item-preview-action-btn.primary {
  background: var(--color-nuke-primary);
}

.item-preview-action-btn.secondary {
  background: var(--color-gray-4);
}

.item-preview-buy-btn:hover,
.item-preview-action-btn:hover {
  filter: brightness(1.1);
}

.item-preview-buy-btn:active,
.item-preview-action-btn:active {
  filter: brightness(0.92);
}

/* ============ Test Panel ============ */
.test-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100dvh;
  background: var(--color-gray-2);
  overflow: hidden;
  z-index: 101;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  pointer-events: none;
}

.test-panel.open {
  transform: translateX(0);
  pointer-events: auto;
}

.test-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 16px;
  flex-shrink: 0;
}

.test-panel-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-white);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.test-panel-close {
  background: none;
  border: none;
  color: var(--color-white);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.test-panel-close:hover {
  background: var(--color-gray-3);
}

.test-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  scrollbar-width: none;
}

.test-panel-content::-webkit-scrollbar {
  display: none;
}

.test-panel-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  color: var(--color-gray-8);
  cursor: pointer;
  border-radius: var(--border-radius);
  transition: color 0.2s;
}

.test-panel-toggle:hover {
  color: var(--color-white);
}

/* ============ Column Grid ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(8, 1fr); gap: 16px; }
}

@media (max-width: 768px) {
  .grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}

/* ============ Mobile Modal Overrides ============ */
@media screen and (max-width: 768px) {
  .inventory-modal {
    width: 90vw;
  }
}

/* ============ Mobile Wallet Themes ============ */
/* Wallet-detected themes applied via body.theme-{wallet} class on mobile.
   Styles intentionally left empty — add per-wallet overrides here. */
