@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --bg-canvas: #050505;
  --bg-surface: #0D0D0D;
  --bg-card: #121212;
  --bg-card-hover: #181818;
  --bg-card-elevated: #1F1F1F;
  --bg-glass: rgba(18, 18, 18, 0.8);
  --bg-input: #0A0A0A;

  --border-subtle: rgba(231, 160, 10, 0.12);
  --border-medium: rgba(231, 160, 10, 0.25);
  --border-glow: rgba(231, 160, 10, 0.45);

  --accent-brand: #E7A00A;
  --accent-brand-light: #FCD34D;
  --accent-blurple: #5865f2;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;

  --text-primary: #FFFFFF;
  --text-secondary: #A7A7A7;
  --text-muted: #6B7280;

  --discord-bg: #313338;
  --discord-embed-bg: #2b2d31;
  --discord-text: #dbdee1;
  --discord-text-muted: #949ba4;
  --discord-blurple: #5865f2;
  --discord-green: #248046;
  --discord-red: #da373c;
  --discord-gray: #4e5058;

  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Fira Code', monospace;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.65);
  --shadow-glow: 0 0 30px rgba(231, 160, 10, 0.25);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background: var(--bg-canvas);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Layout Shell */
#app-shell {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
aside.sidebar {
  width: 280px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 100;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-brand), var(--accent-blurple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.4);
}

.brand-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #fff, #c4b5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-version {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  padding: 2px 6px;
  border-radius: 6px;
  display: inline-block;
  margin-top: 2px;
}

/* Server Selector Dropdown */
.guild-picker {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.guild-picker-btn {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.2s;
}

.guild-picker-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
}

.guild-icon-small {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-blurple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.guild-name-display {
  flex: 1;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sidebar Nav */
nav.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 12px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.2), rgba(88, 101, 242, 0.08));
  border-color: rgba(124, 58, 237, 0.3);
  font-weight: 600;
}

.nav-item .nav-icon {
  font-size: 18px;
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-badge {
  margin-left: auto;
  font-size: 11px;
  background: rgba(124, 58, 237, 0.25);
  color: #c4b5fd;
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 600;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.15); }
}

/* Main Content Area */
main.main-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: radial-gradient(circle at 80% 10%, rgba(124, 58, 237, 0.08), transparent 50%),
              radial-gradient(circle at 20% 90%, rgba(6, 182, 212, 0.05), transparent 50%),
              var(--bg-canvas);
}

/* Top Navigation Bar */
header.top-header {
  height: 68px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(15, 18, 26, 0.8);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  flex-shrink: 0;
}

.page-headline {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.telemetry-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.telemetry-pill strong {
  color: var(--accent-emerald);
}

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 16px;
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
}

/* Content Container */
.content-scrollable {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

/* Tab Views */
.tab-view {
  display: none;
  animation: fadeIn 0.25s ease-out forwards;
}

.tab-view.active {
  display: block;
}

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

/* Metrics Overview Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.metric-card {
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-glow);
}

.metric-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.metric-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: rgba(124, 58, 237, 0.15);
  color: var(--accent-brand-light);
}

.metric-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

.metric-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Glass Card Container */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 24px;
}

.glass-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.glass-card-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.glass-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Form Controls */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-input, .form-select, .form-textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  transition: all 0.2s;
  width: 100%;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent-brand);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* Custom Toggle Switches */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.toggle-info h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.toggle-info p {
  font-size: 12px;
  color: var(--text-secondary);
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-input);
  border: 1px solid var(--border-medium);
  transition: .25s;
  border-radius: 26px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  transition: .25s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-brand);
  border-color: var(--accent-brand);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--accent-brand), var(--accent-blurple));
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
  transition: all 0.2s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.45);
}

.btn-secondary {
  background: var(--bg-card-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger:hover {
  background: rgba(244, 63, 94, 0.25);
}

/* ===================================================
   EMBED STUDIO: Dual-Pane Live Discord Simulator
   =================================================== */
.embed-studio-container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 1200px) {
  .embed-studio-container {
    grid-template-columns: 1fr;
  }
}

.studio-editor {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.accordion-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
}

.accordion-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  transition: background 0.2s;
}

.accordion-header:hover {
  background: rgba(255, 255, 255, 0.04);
}

.accordion-title {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.accordion-body {
  padding: 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Color Swatches */
.color-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-swatch-picker {
  -webkit-appearance: none;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
}

.color-swatch-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}
.color-swatch-picker::-webkit-color-swatch {
  border: 1px solid var(--border-medium);
  border-radius: 8px;
}

.preset-swatches {
  display: flex;
  gap: 6px;
}

.preset-color-dot {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.15s;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.preset-color-dot:hover {
  transform: scale(1.15);
}

/* Fields Builder Grid */
.fields-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field-item-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ===================================================
   DISCORD SIMULATION PREVIEW (Pixel-Perfect Accuracy)
   =================================================== */
.studio-preview-pane {
  position: sticky;
  top: 20px;
}

.preview-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.preview-badge {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.discord-window {
  background: var(--discord-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.discord-channel-header {
  background: #2b2d31;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #dbdee1;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.discord-channel-header span.hash {
  color: #80848e;
  font-size: 16px;
}

.discord-chat-viewport {
  padding: 20px 16px;
  min-height: 240px;
  max-height: 700px;
  overflow-y: auto;
}

.discord-message-group {
  display: flex;
  gap: 16px;
}

.discord-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-blurple);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  overflow: hidden;
}

.discord-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.discord-message-body {
  flex: 1;
  min-width: 0;
}

.discord-message-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.discord-username {
  font-weight: 600;
  font-size: 15px;
  color: #f2f3f5;
  cursor: pointer;
}

.discord-username:hover {
  text-decoration: underline;
}

.discord-bot-badge {
  background: var(--discord-blurple);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.discord-timestamp {
  font-size: 12px;
  color: var(--discord-text-muted);
}

.discord-plain-text {
  font-size: 14px;
  line-height: 1.4;
  color: var(--discord-text);
  margin-bottom: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* The Embed Card */
.discord-embed-card {
  background: var(--discord-embed-bg);
  border-left: 4px solid var(--accent-blurple);
  border-radius: 4px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  max-width: 520px;
}

.embed-main-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.embed-author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #f2f3f5;
}

.embed-author img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.embed-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.embed-title a {
  color: #00a8fc;
  text-decoration: none;
}
.embed-title a:hover {
  text-decoration: underline;
}

.embed-description {
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--discord-text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Fields Grid inside Embed */
.embed-fields-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.embed-field-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.embed-field-cell.full-width {
  grid-column: 1 / -1;
}

.embed-field-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #f2f3f5;
}

.embed-field-value {
  font-size: 13px;
  color: var(--discord-text);
  white-space: pre-wrap;
  word-break: break-word;
}

.embed-thumbnail-box {
  width: 80px;
  height: 80px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

.embed-thumbnail-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.embed-large-image {
  margin-top: 8px;
  max-width: 100%;
  border-radius: 4px;
  overflow: hidden;
}

.embed-large-image img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  display: block;
}

.embed-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--discord-text-muted);
  margin-top: 4px;
}

.embed-footer img {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

/* Discord ActionRow Buttons Simulation */
.discord-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  max-width: 520px;
}

.discord-btn {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 4px;
  border: none;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.discord-btn:hover {
  opacity: 0.85;
}

.discord-btn.primary { background-color: var(--discord-blurple); }
.discord-btn.secondary { background-color: var(--discord-gray); }
.discord-btn.success { background-color: var(--discord-green); }
.discord-btn.danger { background-color: var(--discord-red); }
.discord-btn.link {
  background-color: var(--discord-gray);
  text-decoration: none;
}

/* Discord Select Menu Simulation */
.discord-select-menu {
  background: var(--discord-embed-bg);
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  padding: 10px 14px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  color: var(--discord-text-muted);
  max-width: 520px;
  cursor: pointer;
}

/* Modal Popup */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Free Game Deal Card */
.deal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
}

.deal-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-glow);
}

.deal-thumb {
  height: 140px;
  width: 100%;
  object-fit: cover;
  background: #000;
}

.deal-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.deal-platform-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(124, 58, 237, 0.2);
  color: #c4b5fd;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  align-self: flex-start;
}

.deal-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.deal-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  padding: 12px 20px;
  box-shadow: var(--shadow-md);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideToast 0.3s ease-out forwards;
}

.toast.success { border-left: 4px solid var(--accent-emerald); }
.toast.error { border-left: 4px solid var(--accent-rose); }

@keyframes slideToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Chips / Tag Badges (Blacklisted words) */
.chip-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px;
  min-height: 48px;
}

.chip {
  background: rgba(124, 58, 237, 0.2);
  border: 1px solid rgba(124, 58, 237, 0.4);
  color: #c4b5fd;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip-remove {
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  transition: color 0.15s;
}
.chip-remove:hover {
  color: var(--accent-rose);
}

/* Leaderboard Table */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border-subtle);
}

.leaderboard-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
}

.rank-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}
.rank-badge.gold { background: #f59e0b; color: #000; box-shadow: 0 0 12px rgba(245, 158, 11, 0.4); }
.rank-badge.silver { background: #94a3b8; color: #000; }
.rank-badge.bronze { background: #b45309; color: #fff; }
.rank-badge.normal { background: var(--bg-card-elevated); color: var(--text-secondary); }

/* Category Cards */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.category-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s;
}

.category-card:hover {
  border-color: var(--border-glow);
}

/* Permit Matrix */
.permit-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}
.permit-5 { background: rgba(244, 63, 94, 0.2); color: #fda4af; border: 1px solid rgba(244, 63, 94, 0.4); }
.permit-4 { background: rgba(245, 158, 11, 0.2); color: #fde68a; border: 1px solid rgba(245, 158, 11, 0.4); }
.permit-3 { background: rgba(124, 58, 237, 0.2); color: #c4b5fd; border: 1px solid rgba(124, 58, 237, 0.4); }
.permit-2 { background: rgba(6, 182, 212, 0.2); color: #a5f3fc; border: 1px solid rgba(6, 182, 212, 0.4); }
.permit-1 { background: rgba(16, 185, 129, 0.2); color: #a7f3d0; border: 1px solid rgba(16, 185, 129, 0.4); }

/* ==========================================================================
   DISCORD BOT PROFILE & RICH PRESENCE POPOUT (AUTHENTIC LUXURY THEME)
   ========================================================================== */
.discord-profile-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1024px) {
  .discord-profile-layout {
    grid-template-columns: 1fr;
  }
}

.discord-profile-card {
  background: #111214;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(231, 160, 10, 0.3);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(231, 160, 10, 0.15);
  position: relative;
}

.discord-profile-banner {
  height: 125px;
  background: linear-gradient(135deg, #18140B 0%, #080808 50%, #2A1F0A 100%);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(231, 160, 10, 0.2);
}

.discord-profile-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(231, 160, 10, 0.35) 1px, transparent 1px);
  background-size: 16px 16px;
  opacity: 0.5;
}

.discord-profile-header {
  padding: 0 18px 16px;
  position: relative;
}

.discord-avatar-container {
  position: relative;
  width: 86px;
  height: 86px;
  margin-top: -44px;
  margin-bottom: 12px;
}

.discord-avatar-img {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  border: 6px solid #111214;
  background: #000;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  object-fit: cover;
}

.discord-status-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 4px solid #111214;
  background: #23A55A; /* Discord online green */
}

.discord-status-dot.idle { background: #F0B232; }
.discord-status-dot.dnd { background: #F23F43; }
.discord-status-dot.invisible { background: #80848E; }

.discord-badges-container {
  position: absolute;
  top: 14px;
  right: 18px;
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 8px;
  border-radius: 8px;
}

.discord-badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--gold-primary);
}

.discord-user-details {
  background: #2B2D31;
  border-radius: 12px;
  padding: 16px;
  margin-top: 10px;
}

.discord-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.discord-display-name {
  font-size: 18px;
  font-weight: 800;
  color: #FFFFFF;
  font-family: var(--font-display);
}

.discord-bot-badge {
  background: #5865F2;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.discord-handle {
  font-size: 13px;
  color: #949BA4;
  margin-bottom: 12px;
}

.discord-profile-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 14px 0;
}

.discord-profile-section-title {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  color: #B5BAC1;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

/* Rich Presence Activity Box */
.discord-activity-card {
  background: #1E1F22;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  border-left: 3px solid var(--gold-primary);
}

.discord-activity-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #111214;
  border: 1px solid rgba(231, 160, 10, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.discord-activity-info {
  min-width: 0;
  flex: 1;
}

.discord-activity-type {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--gold-primary);
}

.discord-activity-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #F2F3F5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 2px 0;
}

.discord-activity-details {
  font-size: 12px;
  color: #949BA4;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* About Me Markdown Render Box */
.discord-bio-rendered {
  font-size: 13px;
  color: #DBDEE1;
  line-height: 1.5;
  white-space: pre-line;
  background: #1E1F22;
  padding: 12px;
  border-radius: 8px;
  border-left: 3px solid #5865F2;
}

.discord-bio-rendered h1, .discord-bio-rendered h2 {
  font-size: 14px;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 4px;
}

.discord-bio-rendered blockquote {
  border-left: 3px solid #4E5058;
  padding-left: 8px;
  color: #949BA4;
  margin: 6px 0;
}


