/**
 * 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-border-strong: rgba(0, 0, 0, 0.8);
  --color-collapsible-bg: rgba(0, 100, 255, 1);
  --color-collapsible-header: transparent;
  --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;
}

@property --cc-lift {
  syntax: '<length>';
  inherits: false;
  initial-value: 0px;
}

@property --cc-press {
  syntax: '<number>';
  inherits: false;
  initial-value: 1;
}

@property --cc-tilt {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}



/* ===========================================
   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: 'Game Boy 1989';
  src: url('/fonts/game_boy_1989.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@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;
}

.chat-pill-header {
  height: 48px;
  flex-shrink: 0;
  background: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

body.is-mobile .chat-pill-header {
  height: auto;
  padding: 4px 4px 0 4px;
}

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

.chat-pill-header .dock-pill {
  cursor: pointer;
}

/* Nuke-time pill: don't squeeze the digits the way the big countdown does,
   but pin each character to a fixed width so the pill doesn't twitch as the
   timer ticks. */
.chat-pill-nuke-time {
  font-variant-numeric: tabular-nums;
}
.chat-pill-nuke-time .nuke-digit {
  width: 1ch;
}
.chat-pill-nuke-time .nuke-sep {
  width: 0.5ch;
}
.chat-pill-nuke-time .nuke-ms {
  width: 1ch;
  font-size: 0.85em;
}

.chat-page-header {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.chat-secondary-header {
  height: 61px;
  flex-shrink: 0;
  background: transparent;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 16px;
  padding: 8px 16px;
  box-sizing: border-box;
}

body.is-mobile .chat-secondary-header {
  height: 44px;
  padding: 4px;
  gap: 4px;
}

/* Hide the mobile-only chat / utility buttons on desktop. */
body:not(.is-mobile) .chat-secondary-mobile-btn {
  display: none;
}

/* Mobile: only one main panel is visible at a time. Default = profile.
   The chat / utility buttons in the secondary header swap which panel shows
   by toggling `mv-chat` / `mv-utility` on the body. */
body.is-mobile .chat-panel,
body.is-mobile .player-panel,
body.is-mobile .utility-column {
  display: none !important;
}

body.is-mobile.mv-chat .profile-panel,
body.is-mobile.mv-utility .profile-panel,
body.is-mobile.mv-leaderboard .profile-panel {
  display: none !important;
}

body.is-mobile.mv-chat .chat-panel {
  display: flex !important;
}

body.is-mobile.mv-utility .utility-column {
  display: flex !important;
}

body.is-mobile.mv-leaderboard .player-panel {
  display: flex !important;
}

/* Mini calling card on mobile — scaled to 0.8 so it stays 16:3 (192×36)
   and the pfp scales with it. */
body.is-mobile #chat-secondary-header-card .cc-entry {
  width: 192px;
  height: 36px;
  min-height: 36px;
  max-height: 36px;
}

body.is-mobile #chat-secondary-header-card .cc-pfp-wrapper {
  width: 30px;
  height: 30px;
  margin: 3px;
}

body.is-mobile #chat-secondary-header-card .cc-pfp {
  width: 30px;
  height: 30px;
}

body.is-mobile #chat-secondary-header-card .cc-pfp-border {
  width: 38px;
  height: 38px;
}

body.is-mobile #chat-secondary-header-card .cc-info {
  left: 36px;
}

body.is-mobile #chat-secondary-header-card .cc-name {
  font-size: 10px;
}

body.is-mobile #chat-secondary-header-card .cc-rank,
body.is-mobile #chat-secondary-header-card .cc-balance,
body.is-mobile #chat-secondary-header-card .cc-dpr {
  font-size: 8px;
}

body.is-mobile #chat-secondary-header-card .cc-top {
  font-size: 10px;
}

body.is-mobile #chat-secondary-header-card .cc-bottom {
  font-size: 8px;
}

body.is-mobile #chat-secondary-header-card .cc-level-icon {
  width: 14px;
  height: 14px;
}

body.is-mobile #chat-secondary-header-card .online-dot {
  width: 6px;
  height: 6px;
  top: -5px;
  left: -6px;
}

/* Mini action buttons on mobile — 80% scale to match the mini card. */
body.is-mobile .chat-secondary-action-btn {
  width: 36px;
  height: 36px;
}

body.is-mobile .chat-secondary-action-inner {
  width: 30px;
  height: 30px;
}

body.is-mobile .chat-secondary-action-inner svg {
  width: 16px;
  height: 16px;
}

.notif-wrapper {
  position: relative;
  display: inline-flex;
}

.notif-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 297px;
  max-height: 60vh;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--color-gray-6);
  border-radius: 4px;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.4),
    0 12px 32px rgba(0, 0, 0, 0.5);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition:
    opacity 0.16s ease,
    visibility 0s linear 0.16s,
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 200;
}

.notif-popover::-webkit-scrollbar {
  display: none;
}

.notif-wrapper:hover .notif-popover,
.notif-popover:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    opacity 0.16s ease,
    visibility 0s linear 0s,
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.notif-popover-list {
  display: flex;
  flex-direction: column;
}

.chat-secondary-action-btn {
  width: 45px;
  height: 45px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(44, 44, 44, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--color-gray-6);
  border-radius: 4px;
  color: var(--color-white);
  cursor: pointer;
  padding: 0;
  position: relative;
  --cc-lift: 0px;
  --cc-press: 1;
  transform: translateY(var(--cc-lift)) scale(var(--cc-press));
  transition:
    --cc-lift 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    --cc-press 0.2s cubic-bezier(0.34, 1.4, 0.64, 1),
    background 0.25s ease,
    border-color 0.2s ease,
    box-shadow 0.08s ease;
  box-shadow:
    0 3px 0 rgba(0, 0, 0, 0.5),
    0 1px 2px rgba(0, 0, 0, 0.2);
}

@media (hover: hover) {
  .chat-secondary-action-btn:hover {
    --cc-lift: -1.5px;
    --cc-press: 1.01;
    background: rgba(44, 44, 44, 0.9);
    border-color: color-mix(in srgb, var(--current-user-color, var(--color-gray-6)) 75%, var(--color-gray-6));
    box-shadow:
      0 3px 0 rgba(0, 0, 0, 0.6),
      0 4px 16px rgba(0, 0, 0, 0.5);
  }
  .chat-secondary-action-btn:hover .chat-secondary-action-inner {
    transform: rotate(1deg);
  }
  .chat-secondary-action-btn:hover .chat-secondary-action-inner::after {
    transform: rotate(1deg);
  }
}

/* Frozen banner image — single first-frame snapshot rendered to canvas so
   even if the source becomes animated (GIF/APNG), only one frame shows. */
.chat-secondary-notif-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.4;
  border-radius: 3px;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.25s ease;
}

@media (hover: hover) {
  .chat-secondary-action-btn:hover .chat-secondary-notif-bg {
    opacity: 0.8;
  }
}

.chat-secondary-notif-btn:active .chat-secondary-notif-bg {
  opacity: 1;
}

.chat-secondary-action-inner {
  position: relative;
  isolation: isolate;
  width: 37px;
  height: 37px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  box-sizing: border-box;
  transform-origin: center center;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 1;
}

.chat-secondary-action-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.45) 0%,
    rgba(255, 255, 255, 0.16) 50%,
    rgba(0, 0, 0, 0.08) 100%);
  pointer-events: none;
  mix-blend-mode: overlay;
  transform-origin: center center;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-secondary-action-inner svg {
  position: relative;
  z-index: 1;
}

.chat-page-header .chat-pill-header {
  width: 100%;
  border: none;
  border-radius: 0;
  margin: 0 auto;
}

.chat-panels-row {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: stretch;
  gap: 16px;
  padding: 8px 16px 8px 16px;
}

.utility-column {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-self: flex-start;
}

.utility-panel {
  width: 100%;
  flex: 0 0 auto;
  border: none;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: transparent;
  box-sizing: border-box;
}

/* Sections inside utility panels are always open — collapsing is disabled
   so the panel hugs the natural content height. */
.utility-panel .player-panel-section,
.utility-panel .player-panel-section.collapsed {
  grid-template-rows: 1fr;
  margin: -2px 0 0 0;
}

.utility-panel .player-panel-section.collapsed > .section-inner {
  padding-top: 8px;
  padding-bottom: 8px;
}

.utility-panel .panel-nav-item {
  pointer-events: none;
  padding-left: 12px;
  padding-right: 12px;
}

.player-panel,
.profile-panel,
.chat-panel {
  width: 264px;
  flex-shrink: 0;
  border: none;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.player-panel { background: transparent; }
.profile-panel { background: transparent; width: 320px; }
.chat-panel { background: transparent; width: 375px; }

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

.chat-panel {
  transition: margin-right 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}



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

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

.chat-sub-header {
  display: none;
  flex-direction: column;
  gap: 0;
  padding: 0;
  position: absolute;
  top: 4px;
  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 */
.chat-messages {
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  padding: 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;
}

.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: 100%;
}

.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;
}
/* Message rows */
.chat-message-row {
  display: flex;
  align-items: flex-end;
  gap: var(--spacing-sm);
  align-self: flex-start;
  max-width: 100%;
  width: 100%;
  margin-bottom: var(--spacing-sm);
}

.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: 100%;
  width: 100%;
  margin-bottom: var(--spacing-sm);
}

.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-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-content,
.msg-content {
  color: var(--color-text-primary);
  font-weight: 600;
  word-break: break-word;
  white-space: pre-wrap;
  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;
}

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

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


/* 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); }


/* 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); }

.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-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;
}

.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 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;
}
/* 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;
}
/* 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;
  pointer-events: none;
}

/* Both the XP bar and the inventory drawer are global overlays. They only
   make sense on the chat page — hide them on signin / onboarding for both
   desktop and mobile. */
body:not(.page-chat) .chat-xp-bar,
body:not(.page-chat) .mobile-inv-drawer {
  display: none !important;
}

/* Mobile: XP bar lives at the top of the screen above the pill header,
   since the bottom is now occupied by the inventory drawer. */
body.is-mobile .chat-xp-bar {
  top: 0;
  bottom: auto;
}

body.is-mobile .chat-pill-header {
  padding-top: 12px;
}

.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); }
}

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

@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 {
  padding: 0;
  margin: 0;
  transition: width 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.player-panel-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  overscroll-behavior: contain;
  padding: 0 11px 12px 11px;
  min-height: 0;
}

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

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

.panel-header {
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  background: transparent;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 12px;
  position: relative;
  border-bottom: 1px solid var(--color-white);
}

/* Side panel is always visible (center focal point) — hide close button and the
   duplicate calling card that sits in the chat panel's top-right. */
.profile-panel-close {
  display: none;
}
.header-profile-square {
  display: none;
}

.panel-header-nuke-time {
  font-family: var(--font-digital);
  font-size: 28px;
  color: var(--color-white);
  font-weight: 700;
  white-space: nowrap;
}

.chat-header-nuke-time {
  display: none;
  align-items: center;
  height: 45px;
  font-family: var(--font-digital);
  font-size: 28px;
  color: var(--color-white);
  font-weight: 700;
  white-space: nowrap;
  position: absolute;
  top: 38px;
  left: 8px;
  z-index: 3;
  pointer-events: none;
}

.chat-header-nuke-time .nuke-sep,
.chat-header-nuke-time .nuke-digit,
.chat-header-nuke-time .nuke-ms {
  font-family: inherit;
  color: inherit;
}


.panel-header-nuke-time .nuke-sep,
.panel-header-nuke-time .nuke-digit,
.panel-header-nuke-time .nuke-ms {
  font-family: inherit;
  color: inherit;
}

.panel-header-search {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--color-gray-6);
  border-radius: 6px;
  color: var(--color-white);
  font-family: inherit;
  font-size: var(--font-size-sm);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.panel-header-search::placeholder {
  color: var(--color-gray-7);
}

.panel-header-search:focus {
  border-color: var(--color-white);
  background: rgba(255, 255, 255, 0.1);
}

.panel-header-search::-webkit-search-cancel-button {
  -webkit-appearance: none;
  cursor: pointer;
  height: 14px;
  width: 14px;
  background: var(--color-gray-7);
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'><line x1='18' y1='6' x2='6' y2='18'/><line x1='6' y1='6' x2='18' y2='18'/></svg>");
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'><line x1='18' y1='6' x2='6' y2='18'/><line x1='6' y1='6' x2='18' y2='18'/></svg>");
  mask-size: contain;
  -webkit-mask-size: contain;
}

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

.player-panel-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 0;
  flex-shrink: 0;
}

.panel-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 0;
  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;
  text-transform: uppercase;
  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 .notifications-empty {
  font-size: var(--font-size-sm);
  color: var(--color-gray-8);
  text-align: center;
  padding: 4px;
  display: block;
}

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

.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: 0 0 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);
  font-weight: 700;
  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: visible;
  background: rgba(44, 44, 44, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  justify-content: space-between;
  position: relative;
  --cc-lift: 0px;
  --cc-press: 1;
  --cc-tilt: 0deg;
  transform: translateY(var(--cc-lift)) rotate(var(--cc-tilt)) scale(var(--cc-press));
  transition:
    --cc-lift 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    --cc-press 0.2s cubic-bezier(0.34, 1.4, 0.64, 1),
    --cc-tilt 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.25s ease,
    border-color 0.2s ease,
    box-shadow 0.08s ease;
  box-shadow:
    0 3px 0 rgba(0, 0, 0, 0.5),
    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);
}

#leaderboard-content .cc-entry {
  width: 100%;
}


/* Hit-area extension into the 8px gap between rows so hover snaps to the
   nearest card. Each card's ::before adds 4px above and 4px below itself —
   neighbors' pseudos meet exactly at the gap midpoint with no overlap or
   uncovered region. */
.leaderboard-list .cc-entry::before,
#chat-secondary-header-card .cc-entry::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -4px;
  bottom: -4px;
  z-index: -1;
}

/* When hovered, the card lifts ~1.5px which would carry the pseudo up too,
   leaving a gap below the cursor and triggering a hover/unhover loop.
   Extend the pseudo's bottom edge by the lift amount so the hit area stays
   anchored to the cursor's position regardless of the card's translation. */
.leaderboard-list .cc-entry:hover::before,
#chat-secondary-header-card .cc-entry:hover::before {
  bottom: -6px;
}

/* 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);
    --cc-lift: -1.5px;
    --cc-press: 1.01;
    border-color: color-mix(in srgb, var(--cc-profile-color, var(--color-gray-6)) 75%, var(--color-gray-6));
    box-shadow:
      0 3px 0 rgba(0, 0, 0, 0.6),
      0 4px 16px rgba(0, 0, 0, 0.5);
  }

  .cc-entry.active:hover {
    --cc-lift: -1px;
    --cc-press: 1;
  }
  .cc-entry:hover .cc-name,
  .cc-entry:hover .cc-rank,
  .cc-entry:hover .cc-balance,
  .cc-entry:hover .cc-dpr {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  }
  .cc-entry:hover .cc-pfp {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.45);
  }
}


/* Held-down state while the pointer is pressing the card */
.cc-entry.cc-pressed {
  --cc-press: 0.97;
  border-color: color-mix(in srgb, var(--cc-profile-color, var(--color-gray-6)) 45%, var(--color-gray-6));
  box-shadow:
    0 2px 0 rgba(0, 0, 0, 0.4),
    0 0 0 rgba(0, 0, 0, 0);
  transition:
    --cc-press 0.08s ease-out,
    --cc-lift 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.25s ease,
    box-shadow 0.16s cubic-bezier(0.45, 0.05, 0.55, 0.95);
}

/* Rebound animation fires on pointer release */
.cc-entry.cc-rebound {
  animation: cc-rebound 0.42s cubic-bezier(0.45, 0.05, 0.55, 0.95);
}

/* Active card: muted press/rebound, no pfp tilt — already here, less to do.
   Box-shadow intentionally not set here so .cc-entry.active's box-shadow
   wins (later in source than .cc-pressed) — the active card's outline stays
   put when pressed instead of retracting. */
.cc-entry.active.cc-pressed {
  --cc-press: 0.99;
}

.cc-entry.cc-rebound-soft {
  animation: cc-rebound-soft 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes cc-rebound-soft {
  0%   { --cc-press: 0.99; --cc-tilt: 0deg; }
  100% { --cc-press: 1;    --cc-tilt: 0deg; }
}

.cc-entry.cc-rebound-soft .cc-pfp,
.cc-entry.cc-rebound-soft .cc-pfp-wrapper::after {
  animation: cc-pfp-shake 0.36s ease-in-out;
}

@keyframes cc-pfp-shake {
  0%   { transform: rotate(0deg); }
  18%  { transform: rotate(-5deg); }
  36%  { transform: rotate(4deg); }
  54%  { transform: rotate(-3deg); }
  72%  { transform: rotate(2deg); }
  88%  { transform: rotate(-1deg); }
  100% { transform: rotate(0deg); }
}

.cc-entry.active.cc-pressed .cc-pfp,
.cc-entry.active.cc-pressed .cc-pfp-wrapper::after {
  transform: rotate(0deg);
}

/* Persistent (lighter) version of the hover lift on the currently-active card */
.cc-entry.active {
  border-color: color-mix(in srgb, var(--cc-profile-color, var(--color-gray-6)) 45%, var(--color-gray-6));
  box-shadow:
    0 3px 0 rgba(0, 0, 0, 0.55),
    0 2px 8px rgba(0, 0, 0, 0.3);
}
.cc-entry.active .cc-name,
.cc-entry.active .cc-rank,
.cc-entry.active .cc-balance,
.cc-entry.active .cc-dpr {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.cc-entry.active .cc-pfp {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* PFP */

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

/* Subtle gel sheen */
.cc-pfp-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.45) 0%,
    rgba(255, 255, 255, 0.16) 50%,
    rgba(0, 0, 0, 0.08) 100%);
  pointer-events: none;
  z-index: 3;
  mix-blend-mode: overlay;
  transform-origin: center center;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (hover: hover) {
  .cc-entry:hover .cc-pfp-wrapper::after {
    transform: rotate(-2deg);
  }
}

.cc-entry.cc-pressed .cc-pfp-wrapper::after {
  transform: rotate(-4deg);
  transition: transform 0.1s ease-out;
}

.cc-pfp {
  width: 37px;
  height: 37px;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transform-origin: center center;
  transition:
    box-shadow 0.08s ease,
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (hover: hover) {
  .cc-entry:hover .cc-pfp {
    transform: rotate(-2deg);
  }
}

.cc-entry.cc-pressed .cc-pfp {
  transform: rotate(-4deg);
  transition:
    box-shadow 0.08s ease,
    transform 0.1s ease-out;
}

.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: 3px;
  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;
  transition: text-shadow 0.08s ease;
}

.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, text-shadow 0.08s ease;
}

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

.cc-balance {
  font-family: var(--font-conduit);
  font-size: 9px;
  font-weight: 700;
  color: var(--color-nuke-success);
  transition: text-shadow 0.08s ease;
}

.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, text-shadow 0.08s 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: #00b53d;
  flex-shrink: 0;
  vertical-align: middle;
}

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

.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); }
}

/* Card release: 0.98 → 1 with a soft spring ease (overshoot lives in the cubic-bezier) */
@keyframes cc-rebound {
  0%   { --cc-press: 0.97;   }
  28%  { --cc-press: 1.018;  }
  52%  { --cc-press: 0.995;  }
  72%  { --cc-press: 1.003;  }
  88%  { --cc-press: 0.9995; }
  100% { --cc-press: 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 is a static flex child of .chat-panels-row on desktop (always visible).
   Shared sizing (width, border, radius) comes from the unified .player-panel/.profile-panel/.chat-panel rule above.
   Background is set in its dedicated rule above. Mobile overrides bring back clip-path slide-in. */

.profile-panel-banner-top {
  width: 100%;
  height: 88px;
  flex-shrink: 0;
  position: relative;
  background: transparent;
  z-index: 1;
}

.profile-panel-banner-top img,
.profile-panel-banner-top .banner-bio,
.profile-panel-username-row .profile-bio {
  display: none;
}


.profile-panel-username-row {
  position: absolute;
  top: 14px;
  left: 96px;
  right: 96px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  z-index: 5;
  pointer-events: none;
}

.profile-panel-username-row > * {
  pointer-events: auto;
}

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

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

.profile-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;
}

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

.profile-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;
}

.profile-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;
}

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

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

/* Side panel PFP — anchored to the top of the header area now that the
   banner has been removed. */
.profile-panel > .profile-panel-pfp-border {
  position: absolute;
  top: 8px;
  left: 10px;
  width: 84px;
  height: 84px;
  z-index: 4;
  pointer-events: none;
}

.profile-panel > .profile-panel-pfp-border::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 6px;
  width: 72px;
  height: 72px;
  border-radius: 4px;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.45) 0%,
    rgba(255, 255, 255, 0.16) 50%,
    rgba(0, 0, 0, 0.08) 100%);
  pointer-events: none;
  z-index: 5;
  mix-blend-mode: overlay;
}

.profile-panel > .profile-panel-pfp {
  position: absolute;
  top: 14px;
  left: 16px;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  z-index: 3;
}

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

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

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

/* --- Redesigned side panel: stats + bottom actions --- */

.profile-panel-view {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.sp-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
}

.sp-stat-hero {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--color-gray-6);
  border-radius: 8px;
  backdrop-filter: blur(12px);
}

.sp-stat-hero .stat-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-gray-8);
  font-weight: 600;
}

.sp-stat-hero .stat-value {
  font-family: var(--font-digital, var(--font-conduit));
  font-size: 22px;
  font-weight: 700;
  color: var(--color-white);
  line-height: 1.1;
}

.sp-stat-compact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--color-gray-5);
  border-radius: 8px;
}

.sp-stat-compact-grid .stat-box {
  padding: 4px 0;
  background: transparent;
  border: none;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  min-width: 0;
}

.sp-stat-compact-grid .stat-label {
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-gray-8);
  font-weight: 600;
}

.sp-stat-compact-grid .stat-value {
  font-size: 11px;
  color: var(--color-white);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.sp-stat-compact-grid .stat-level-icon {
  width: 12px;
  height: 12px;
}

.sp-bottom {
  margin-top: auto;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sp-primary-actions {
  display: flex;
  gap: 8px;
}

.sp-primary-btn {
  flex: 1;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--color-gray-6);
  border-radius: 8px;
  color: var(--color-white);
  font-family: var(--font-conduit);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}

.sp-primary-btn:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  border-color: var(--color-gray-7);
}

.sp-primary-btn:active {
  transform: translateY(1px);
}

.sp-inventory-strip {
  display: none;
}

/* ============ Mobile inventory drawer ============ */

.mobile-inv-drawer {
  position: fixed;
  bottom: 12px;
  left: 0;
  right: 0;
  padding: 0 12px;
  pointer-events: none;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  touch-action: none;
}

/* Desktop: drawer collapses to a small arrow tab. Hover to expand.
   Mobile: full-width drawer with a drag handle. Tap or swipe up to expand. */
.mobile-inv-tab {
  display: none;
}

body.is-mobile .mobile-inv-drawer {
  pointer-events: auto;
  bottom: 0;
  padding: 0;
  width: 100%;
  background: var(--color-gray-2);
  transform: translateY(calc(100% - 16px));
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  touch-action: none;
}

body.is-mobile .mobile-inv-drawer.expanded {
  transform: translateY(0);
}

body.is-mobile .mobile-inv-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 16px;
  background: transparent;
  flex-shrink: 0;
}

body.is-mobile .mobile-inv-tab svg {
  display: none;
}

body.is-mobile .mobile-inv-tab::after {
  content: '';
  width: 40px;
  height: 4px;
  background: var(--color-gray-7);
  border-radius: 2px;
}

body.is-mobile .mobile-inv-slots {
  width: 100%;
  max-width: none;
  border-radius: 0;
  margin: 0;
  padding: 12px;
  background: transparent;
  box-shadow: none;
}

body:not(.is-mobile) .mobile-inv-drawer {
  pointer-events: auto;
  left: 12px;
  right: auto;
  bottom: 0;
  width: 320px;
  padding: 0;
  align-items: flex-start;
  transform: translateY(calc(100% - 30px));
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

body:not(.is-mobile) .mobile-inv-drawer:hover {
  transform: translateY(-8px);
}

body:not(.is-mobile) .mobile-inv-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 22px;
  background: var(--color-gray-2);
  border-radius: 8px 8px 0 0;
  color: var(--color-gray-9);
  cursor: pointer;
  transition: color 0.15s ease;
}

body:not(.is-mobile) .mobile-inv-drawer:hover .mobile-inv-tab {
  color: var(--color-white);
}

.mobile-inv-slots {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 320px;
  padding: 8px;
  background: var(--color-gray-2);
  border-radius: 0 0 8px 8px;
  pointer-events: auto;
}

.mobile-inv-slots .inventory-slot {
  width: auto;
  height: auto;
  aspect-ratio: 1;
  padding: 0;
}

.inventory-slot.empty .slot-add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 22px;
  font-weight: 300;
  color: var(--color-gray-7);
  cursor: pointer;
  transition: color 0.15s ease;
}

.inventory-slot.empty:hover .slot-add {
  color: var(--color-white);
}

.mobile-inv-action-bubble {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--color-gray-6);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  transform: translateX(-50%);
  z-index: 1;
}

.mobile-inv-action-bubble[hidden] {
  display: none;
}

.mobile-inv-action-btn {
  width: 90px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--color-gray-6);
  border-radius: 6px;
  color: var(--color-white);
  font-family: var(--font-conduit);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease;
}

.mobile-inv-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.mobile-inv-action-btn:active {
  transform: translateY(1px);
}

.mobile-inv-toast {
  position: fixed;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%);
  max-width: 320px;
  padding: 10px 14px;
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--color-nuke-danger);
  border-radius: 8px;
  color: var(--color-white);
  font-family: var(--font-conduit);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 250;
}

.mobile-inv-toast.visible {
  opacity: 1;
}

/* Override the default fixed-width inventory slot dimensions so the slots
   fit the 4-column grid at any panel width. */
.sp-inventory-strip .inventory-slot {
  width: auto;
  height: auto;
  aspect-ratio: 1;
  padding: 0;
}

.sp-inventory-strip .inventory-slot {
  aspect-ratio: 1;
  width: auto;
  height: auto;
  border-radius: 8px;
  background: var(--color-gray-1);
  border: 1px solid var(--color-gray-5);
}

/* --- Redesigned settings: inline color picker --- */

.sp-settings-section {
  padding: 12px 0;
}

.sp-settings-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-gray-8);
  margin: 0 0 8px 0;
  font-weight: 600;
}

.sp-color-preview {
  width: 56px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--color-gray-6);
  margin-bottom: 10px;
  background: #FFFFFF;
}

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

.sp-color-swatch {
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s ease, border-color 0.15s ease;
}

.sp-color-swatch:hover {
  transform: scale(1.04);
}

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

.sp-settings-bottom {
  margin-top: auto;
  padding: 12px 0;
}

/* --- Polished notifications (tight uniform rhythm) --- */

.profile-panel-content .notifications-list {
  padding: 12px 0;
  gap: 6px;
}

.profile-panel-content .notif-item,
.notif-popover .notif-item,
#mission-list .notif-item {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-gray-5);
  border-radius: 8px;
  font-size: 12px;
}

.profile-panel-content .notif-item.unread,
.notif-popover .notif-item.unread,
#mission-list .notif-item.unread {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--color-gray-6);
}

.profile-panel-content .notif-item-title,
.notif-popover .notif-item-title,
#mission-list .notif-item-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 4px;
}

.profile-panel-content .notif-item-message,
.notif-popover .notif-item-message,
#mission-list .notif-item-message {
  font-size: 12px;
  line-height: 1.45;
  color: var(--color-gray-9, var(--color-white));
  margin: 0;
}

.profile-panel-content .notif-item-time,
.notif-popover .notif-item-time,
#mission-list .notif-item-time {
  font-size: 10px;
  color: var(--color-gray-8);
  margin-top: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-panel-content .notif-item-effects,
.notif-popover .notif-item-effects,
#mission-list .notif-item-effects {
  margin-top: 6px;
  padding: 6px 8px;
  background: var(--color-gray-2);
  border-radius: 4px;
  font-size: 11px;
}

.profile-panel-content .notifications-empty,
.notif-popover .notifications-empty,
#mission-list .notifications-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--color-gray-8);
  font-size: 12px;
}

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

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

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

#profile-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;
}

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

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

.profile-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;
}

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

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

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

.profile-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 .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 --- */

/* Side panel is now a sibling of chat-panel — no chat-panel.profile-panel-open adjustments needed on desktop.
   Mobile overrides below still use .profile-panel-open + .open for the clip-path slide-in. */


/* ---- 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;
}

/* --- 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; }
}



/* ============ 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;
}


/* ===========================================
   BOOMBOY DEVICE (skeuomorphic)
   =========================================== */

.boomboy-device {
  --bb-chassis-base: #5a646c;
  --bb-chassis-light: #6e7982;
  --bb-chassis-dark: #454d54;
  --bb-bezel-color: #121415;
  --bb-button-base: #e4e6e8;
  --bb-button-dark: #d0d3d6;
  --bb-accent-yellow: #dca326;
  --bb-accent-yellow-dark: #a87915;
  --bb-well-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.6), inset 0 1px 2px rgba(0, 0, 0, 0.4);
  /* Injection-molded plastic grain — fractal noise, grayscale, ~1px orange-peel */
  --bb-paint-grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='240' height='240' filter='url(%23g)' opacity='0.45'/></svg>");
  /* Shiny bezel grain — finer, softer, lower intensity than chassis */
  --bb-bezel-grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='b'><feTurbulence type='fractalNoise' baseFrequency='1.5' numOctaves='1' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='160' height='160' filter='url(%23b)' opacity='0.22'/></svg>");

  --bb-scale: 1;
  width: 380px;
  height: 640px;
  flex-shrink: 0;
  align-self: center;
  transform: scale(var(--bb-scale));
  transform-origin: top left;
  background-color: var(--bb-chassis-base);
  background-image:
    var(--bb-paint-grain),
    linear-gradient(to bottom right, var(--bb-chassis-light), var(--bb-chassis-base) 40%, var(--bb-chassis-dark));
  background-size: 240px 240px, 100% 100%;
  background-repeat: repeat, no-repeat;
  background-blend-mode: soft-light, normal;
  border-radius: 16px 16px 60px 16px;
  position: relative;
  box-shadow:
    /* Chamfer hairlines — top lit, bottom + right in shadow, left neutral */
    inset  0  1px 0 rgba(255, 255, 255, 0.18),
    inset  0 -1px 0 rgba(0, 0, 0, 0.48),
    inset -1px 0  0 rgba(0, 0, 0, 0.32),
    /* Face bevel — highlight radiates from the top-left corner, not a full left line */
    inset 5px 5px 4px 2px rgba(255, 255, 255, 0.10),
    inset -7px -7px 5px 3px rgba(0, 0, 0, 0.32),
    /* Ambient floor drop — hard-edged, low */
    0 4px 0 rgba(0, 0, 0, 0.2);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  font-family: 'Courier New', Courier, monospace;
}

.boomboy-device * {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-drag: none;
}

/* Temporarily hidden — remove this rule to bring the boomboy back. */
.boomboy-device {
  display: none !important;
}

/* Horizontal seam — 2px dark upper lip (with gaps where verticals pass through)
   + 2px bright lower lip (full width). Gaps let the vertical rails flow through
   the horizontal's body without being cut, turning three separate etches into
   one continuous T-junction system. */
.boomboy-device::before {
  content: '';
  position: absolute;
  top: 24px;
  left: 2px;
  right: 2px;
  height: 6px;
  background-color: transparent;
  background-image:
    /* Dark top lip with two 6px gaps aligned to the vertical grooves */
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.3) 0,
      rgba(0, 0, 0, 0.3) 28px,
      transparent 28px,
      transparent 34px,
      rgba(0, 0, 0, 0.3) 34px,
      rgba(0, 0, 0, 0.3) calc(100% - 34px),
      transparent calc(100% - 34px),
      transparent calc(100% - 28px),
      rgba(0, 0, 0, 0.3) calc(100% - 28px),
      rgba(0, 0, 0, 0.3) 100%
    ),
    /* Bright bottom lip — full width, unbroken */
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.14),
      rgba(255, 255, 255, 0.14)
    );
  background-size: 100% 2px, 100% 2px;
  background-position: 0 0, 0 100%;
  background-repeat: no-repeat, no-repeat;
  box-sizing: border-box;
  z-index: 1;
}

/* Two vertical seams — extended down through the horizontal's body so each
   vertical's rails reach the horizontal's bright bottom, forming continuous
   corners at the T-junctions. */
.boomboy-device::after {
  content: '';
  position: absolute;
  top: 0;
  left: 30px;
  right: 30px;
  height: 26px;
  pointer-events: none;
  background-image: linear-gradient(
    90deg,
    /* Left groove: dark left | transparent | bright right */
    rgba(0, 0, 0, 0.3) 0,
    rgba(0, 0, 0, 0.3) 2px,
    transparent 2px,
    transparent 4px,
    rgba(255, 255, 255, 0.14) 4px,
    rgba(255, 255, 255, 0.14) 6px,
    transparent 6px,
    /* Right groove: dark left | transparent | bright right — same L→R order */
    transparent calc(100% - 6px),
    rgba(0, 0, 0, 0.3) calc(100% - 6px),
    rgba(0, 0, 0, 0.3) calc(100% - 4px),
    transparent calc(100% - 4px),
    transparent calc(100% - 2px),
    rgba(255, 255, 255, 0.14) calc(100% - 2px),
    rgba(255, 255, 255, 0.14) 100%
  );
}

.boomboy-device .screen-housing {
  background-color: var(--bb-bezel-color);
  background-image:
    linear-gradient(135deg,
      rgba(255, 255, 255, 0.05) 0%,
      rgba(255, 255, 255, 0) 32%,
      rgba(255, 255, 255, 0) 68%,
      rgba(255, 255, 255, 0.035) 100%),
    var(--bb-bezel-grain);
  background-size: 100% 100%, 160px 160px;
  background-repeat: no-repeat, repeat;
  background-blend-mode: screen, soft-light;
  border-radius: 6px 6px 30px 6px;
  padding: 33px 30px 48px 30px;
  margin-top: 24px;
  box-shadow:
    inset 0 4px 10px rgba(0, 0, 0, 0.5),
    inset 0 1px 2px rgba(0, 0, 0, 0.55),
    0 2px 3px rgba(255, 255, 255, 0.08);
  position: relative;
}

.boomboy-device .screen-glass {
  width: 100%;
  height: auto;
  aspect-ratio: 10 / 8.7;
  background-color: #13181a;
  background-image:
    /* Dot-matrix horizontal grid lines — whisper-faint */
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.05) 0px,
      rgba(0, 0, 0, 0.05) 1px,
      transparent 1px,
      transparent 3px
    ),
    /* Dot-matrix vertical grid lines — whisper-faint */
    repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.05) 0px,
      rgba(0, 0, 0, 0.05) 1px,
      transparent 1px,
      transparent 3px
    ),
    /* RGB subpixel tint — R | G | B vertical stripes aligned with grid pitch */
    repeating-linear-gradient(
      90deg,
      rgba(255, 80, 80, 0.05) 0px,
      rgba(255, 80, 80, 0.05) 1px,
      rgba(80, 255, 120, 0.05) 1px,
      rgba(80, 255, 120, 0.05) 2px,
      rgba(80, 120, 255, 0.06) 2px,
      rgba(80, 120, 255, 0.06) 3px
    ),
    /* Backlight — uniform phosphor-green tint (no gradient = flat screen read) */
    linear-gradient(
      180deg,
      rgba(120, 210, 140, 0.06),
      rgba(120, 210, 140, 0.06)
    );
  border-radius: 4px;
  position: relative;
  box-shadow: 0 0 0 2px #0a0b0b;
  overflow: hidden;
}

.boomboy-device .boomboy-wordmark {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;
  text-align: center;
  font-family: 'Game Boy 1989', 'Courier New', Courier, monospace;
  font-size: 24px;
  letter-spacing: 2px;
  --bb-wordmark-ink: rgba(255, 255, 255, 0.14);
  color: var(--bb-wordmark-ink);
  -webkit-text-stroke: 0.6px var(--bb-wordmark-ink);
  text-stroke: 0.6px var(--bb-wordmark-ink);
  text-transform: uppercase;
  pointer-events: none;
  user-select: none;
}

.boomboy-device .screen-content {
  position: absolute;
  inset: 0;
  padding: 12px 14px;
  color: #9bbc0f;
  font-family: 'Berkeley Mono', 'Courier New', Courier, monospace;
  font-size: 13px;
  line-height: 1.4;
  text-shadow: 0 0 4px rgba(155, 188, 15, 0.35);
  overflow: hidden;
  z-index: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

.boomboy-device .boomboy-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  justify-content: center;
}

.boomboy-device .boomboy-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  line-height: 1;
}

.boomboy-device .boomboy-stat-label {
  font-size: 12px;
  letter-spacing: 1.5px;
  opacity: 0.72;
}

.boomboy-device .boomboy-stat-value {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
  text-align: right;
}

.boomboy-device .glass-reflection {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 40%, rgba(0, 0, 0, 0.2) 100%);
  pointer-events: none;
  z-index: 10;
}

.boomboy-device .brand-text {
  position: absolute;
  bottom: 12px;
  left: 30px;
  color: rgba(255, 255, 255, 0.3);
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: bold;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.8);
}

.boomboy-device .battery-light {
  position: absolute;
  top: 40px;
  left: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bb-accent-yellow);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.5),
    0 0 4px var(--bb-accent-yellow),
    0 0 10px var(--bb-accent-yellow);
  border: 1px solid #111;
}

.boomboy-device .controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 1;
  padding: 0 10px;
}

.boomboy-device .d-pad-container {
  position: relative;
  width: 100px;
  height: 100px;
  background: var(--bb-chassis-dark);
  border-radius: 50%;
  box-shadow: var(--bb-well-shadow);
  display: flex;
  justify-content: center;
  align-items: center;
}

.boomboy-device .d-pad {
  position: relative;
  width: 80px;
  height: 80px;
  clip-path: polygon(33% 0, 67% 0, 67% 33%, 100% 33%, 100% 67%, 67% 67%, 67% 100%, 33% 100%, 33% 67%, 0 67%, 0 33%, 33% 33%);
  background: linear-gradient(135deg, var(--bb-button-base), var(--bb-button-dark));
  box-shadow:
    -2px -2px 4px rgba(255, 255, 255, 0.4) inset,
    2px 2px 4px rgba(0, 0, 0, 0.2) inset,
    0 4px 6px rgba(0, 0, 0, 0.6);
  transition: transform 0.1s;
  cursor: pointer;
}

.boomboy-device .d-pad::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.15));
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.boomboy-device .d-pad:active {
  transform: scale(0.97) translateY(2px);
}

.boomboy-device .action-buttons {
  display: flex;
  gap: 15px;
  transform: rotate(-20deg);
}

.boomboy-device .button-well {
  width: 50px;
  height: 50px;
  background: var(--bb-chassis-dark);
  border-radius: 50%;
  box-shadow: var(--bb-well-shadow);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.boomboy-device .action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff, var(--bb-button-base) 40%, var(--bb-button-dark));
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.8),
    inset 0 -2px 3px rgba(0, 0, 0, 0.2),
    0 6px 8px -2px rgba(0, 0, 0, 0.5),
    0 2px 4px rgba(0, 0, 0, 0.4);
  position: relative;
  cursor: pointer;
  transition: all 0.05s;
}

.boomboy-device .action-btn:active {
  transform: translateY(4px);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.5),
    inset 0 -1px 2px rgba(0, 0, 0, 0.2),
    0 2px 2px -1px rgba(0, 0, 0, 0.5),
    0 1px 1px rgba(0, 0, 0, 0.4);
}

.boomboy-device .btn-label {
  position: absolute;
  bottom: -20px;
  right: -5px;
  color: rgba(0, 0, 0, 0.6);
  font-size: 12px;
  font-weight: bold;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: rotate(20deg);
}

.boomboy-device .system-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 10px;
}

.boomboy-device .sys-btn-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: rotate(-15deg);
}

.boomboy-device .sys-well {
  width: 46px;
  height: 18px;
  background: var(--bb-chassis-dark);
  border-radius: 9px;
  box-shadow: var(--bb-well-shadow);
  padding: 2px;
}

.boomboy-device .sys-btn {
  width: 100%;
  height: 100%;
  border-radius: 7px;
  background: linear-gradient(135deg, #eec054, var(--bb-accent-yellow) 50%, var(--bb-accent-yellow-dark));
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.6),
    inset 0 -1px 2px rgba(0, 0, 0, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: all 0.05s;
}

.boomboy-device .sys-btn:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 0 2px rgba(0, 0, 0, 0.4),
    0 0 1px rgba(0, 0, 0, 0.2);
}

.boomboy-device .sys-label {
  color: rgba(0, 0, 0, 0.6);
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 1px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.1);
  text-transform: uppercase;
}

.boomboy-device .boomboy-actions {
  display: flex;
  flex-direction: column;
  gap: 36px;
  justify-content: center;
  align-items: center;
  margin-top: 4px;
  transform: rotate(-20deg);
}

/* Stagger: blue (top) leans left, red (bottom) leans right */
.boomboy-device .boomboy-actions .boomboy-btn-well:first-child {
  transform: translate(-50px, 2px);
}
.boomboy-device .boomboy-actions .boomboy-btn-well:last-child {
  transform: translate(44px, 4px);
}

.boomboy-device .boomboy-btn-well {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  background: #141618;
  border-radius: 22px;
  box-shadow:
    inset 0 3px 6px rgba(0, 0, 0, 0.7),
    inset 0 1px 2px rgba(0, 0, 0, 0.9),
    0 1px 0 rgba(255, 255, 255, 0.05);
}

.boomboy-device .boomboy-btn {
  width: 160px;
  height: 46px;
  border-radius: 20px;
  border: none;
  padding: 0;
  cursor: pointer;
  background-color: #34393e;
  background-image:
    /* Dome sheen — bright, tight, clearly domed */
    radial-gradient(ellipse 62% 55% at 50% 15%, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0) 65%),
    linear-gradient(180deg, #3e4347 0%, #363b40 60%, #2c3136 100%);
  box-shadow:
    /* Stronger diffused upper glow */
    inset 0 4px 10px rgba(255, 255, 255, 0.18),
    /* Light ambient occlusion */
    inset 0 0 6px rgba(0, 0, 0, 0.22),
    /* Softened underside — slightly deeper now so the dome pops more by contrast */
    inset 0 -6px 14px rgba(0, 0, 0, 0.26),
    /* Bottom-edge bloom */
    inset 0 -1px 3px rgba(0, 0, 0, 0.5),
    /* Elevated contact shadow */
    0 3px 6px rgba(0, 0, 0, 0.45);
  transition: transform 0.12s cubic-bezier(0.34, 1.4, 0.64, 1),
              box-shadow 0.12s ease,
              background-color 0.08s ease;
}

.boomboy-device .boomboy-btn:active {
  /* Pushed in — pure shading change, no movement */
  background-color: #2a2f33;
  box-shadow:
    /* Stronger AO — well walls now "own" more of the button */
    inset 0 0 10px rgba(0, 0, 0, 0.42),
    /* Inset top shadow — well's rim casts onto the recessed face */
    inset 0 3px 6px rgba(0, 0, 0, 0.35),
    inset 0 -3px 8px rgba(0, 0, 0, 0.28),
    inset 0 -1px 3px rgba(0, 0, 0, 0.4),
    /* Contact shadow collapses — button no longer proud of the well */
    0 0 0 rgba(0, 0, 0, 0);
}

/* Top button — blue matte silicone */
.boomboy-device .boomboy-btn-well:first-child .boomboy-btn {
  background-color: #2f4a68;
  background-image: linear-gradient(180deg, #4a6480 0%, #3a5472 55%, #28405c 100%);
}

.boomboy-device .boomboy-btn-well:first-child .boomboy-btn:active {
  background-color: #203650;
}

/* Bottom button — red matte silicone */
.boomboy-device .boomboy-btn-well:last-child .boomboy-btn {
  background-color: #4a1e1e;
  background-image: linear-gradient(180deg, #743838 0%, #5e2828 55%, #421a1a 100%);
}

.boomboy-device .boomboy-btn-well:last-child .boomboy-btn:active {
  background-color: #38161a;
}

.boomboy-device .speaker-grill {
  position: absolute;
  bottom: 36px;
  right: 40px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  transform: rotate(-20deg);
}

.boomboy-device .speaker-hole {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #111;
  box-shadow:
    inset 0 2px 3px rgba(0, 0, 0, 0.8),
    0 1px 1px rgba(255, 255, 255, 0.1);
}

.boomboy-device .boomboy-resize-handle {
  position: absolute;
  right: 8px;
  bottom: 10px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  color: rgba(255, 255, 255, 0.22);
  cursor: nwse-resize;
  z-index: 5;
  touch-action: none;
  user-select: none;
  transition: color 0.12s ease;
}

.boomboy-device .boomboy-resize-handle:hover,
.boomboy-device .boomboy-resize-handle.is-dragging {
  color: rgba(255, 255, 255, 0.5);
}

.boomboy-device .volume-cutout {
  position: absolute;
  left: -8px;
  top: 200px;
  width: 16px;
  height: 80px;
  background: #2a2e31;
  border-radius: 8px 0 0 8px;
  box-shadow: inset 4px 0 8px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  border-right: 1px solid rgba(0, 0, 0, 0.5);
  z-index: -1;
}

.boomboy-device .volume-wheel-container {
  position: absolute;
  left: -12px;
  top: 210px;
  width: 24px;
  height: 60px;
}

.boomboy-device .wheel-texture {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 12px;
  background: repeating-linear-gradient(
    0deg,
    #111 0px,
    #111 2px,
    #333 3px,
    #444 5px,
    #111 6px
  );
  background-size: 100% 200%;
  transition: background-position 0.1s linear;
}

.boomboy-device .wheel-lighting {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 12px;
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(255, 255, 255, 0.6) 20%,
    rgba(255, 255, 255, 0) 40%,
    rgba(0, 0, 0, 0.8) 80%,
    rgba(0, 0, 0, 0.9) 100%
  );
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.boomboy-device .volume-label {
  position: absolute;
  left: 10px;
  top: 210px;
  color: rgba(0, 0, 0, 0.5);
  font-size: 9px;
  font-weight: bold;
  transform: rotate(-90deg);
  transform-origin: left top;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.1);
  letter-spacing: 1px;
}

