/* v24 design: clean, social cues, leaderboard */
:root {
  --bg: #ffffff;
  --fg: #000000;
  --accent: #32CD32;
  --muted: #222;
  --grid-gap: 12px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, "Helvetica Neue", Arial;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
}
* { box-sizing: border-box; }
html, body { height: 100vh; margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); overflow: hidden; }

/* Global progress bar */
#progress { position: sticky; top:0; left:0; right:0; z-index:1000; background:#004225; border-bottom: 1px solid #002d1a; }
#progress .bar { 
  height: 10px; 
  background: linear-gradient(135deg, 
    #1f2937 0%, 
    #111827 20%, 
    #0f172a 40%, 
    #030712 60%, 
    #1f2937 80%, 
    #111827 100%
  );
  background-size: 30px 30px;
  position: relative; 
  overflow: hidden; 
  border-bottom: 1px solid #000;
  box-shadow: 
    inset 0 2px 4px rgba(0,0,0,0.6),
    inset 0 -1px 0 rgba(255,255,255,0.05);
  animation: darkRockShift 8s ease-in-out infinite;
}

#progress .bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: -200%;
  width: 30%;
  height: 100%;
  background: radial-gradient(circle, 
    rgba(255,255,255,0.3) 0%, 
    rgba(200,200,255,0.2) 30%, 
    transparent 60%
  );
  animation: rareCrystalGlint 15s ease-in-out infinite;
}

#progress .bar::after {
  content: '';
  position: absolute;
  top: 0;
  right: -200%;
  width: 20%;
  height: 100%;
  background: radial-gradient(circle, 
    rgba(255,255,255,0.4) 0%, 
    rgba(180,180,255,0.3) 40%, 
    transparent 70%
  );
  animation: rareCrystalGlint 20s ease-in-out infinite;
  animation-delay: -8s;
}

@keyframes darkRockShift {
  0%, 100% { background-position: 0 0; }
  50% { background-position: 30px 30px; }
}

@keyframes rareCrystalGlint {
  0%, 85%, 100% { transform: translateX(0); opacity: 0; }
  10%, 75% { opacity: 1; }
  15%, 70% { transform: translateX(600px); opacity: 0.8; }
}
#progress .fill { 
  height: 100%; 
  width: 0%; 
  background: linear-gradient(90deg, 
    rgba(255,255,255,0.8) 0%, 
    rgba(255,255,255,1) 25%, 
    rgba(255,255,255,1) 50%, 
    rgba(255,255,255,1) 75%, 
    rgba(255,255,255,0.8) 100%
  );
  background-size: 200% 100%;
  animation: oceanFlow 8s ease-in-out infinite, calmGlow 6s ease-in-out infinite alternate;
  transition: width .6s ease;
  box-shadow: 
    0 0 15px rgba(255,255,255,0.9),
    0 0 25px rgba(255,255,255,0.7),
    0 0 35px rgba(255,255,255,0.5),
    inset 0 0 12px rgba(255,255,255,0.4);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}


@keyframes oceanFlow {
  0% { background-position: -200% 0; }
  50% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

@keyframes calmGlow {
  0% { 
    box-shadow: 
      0 0 15px rgba(255,255,255,0.9),
      0 0 25px rgba(255,255,255,0.7),
      0 0 35px rgba(255,255,255,0.5),
      inset 0 0 12px rgba(255,255,255,0.4);
  }
  100% { 
    box-shadow: 
      0 0 20px rgba(255,255,255,1),
      0 0 30px rgba(255,255,255,0.8),
      0 0 40px rgba(255,255,255,0.6),
      inset 0 0 18px rgba(255,255,255,0.6);
  }
}

#progress .meta { display:flex; align-items:center; justify-content: space-between; padding: 10px 16px; font-family: var(--mono); font-size: 12px; color: #fff; }
.info-text { flex: 1; max-width: 600px; margin: 0 20px; font-size: 11px; line-height: 1.3; color: #e8f5e8; }
#progress .fomo { 
  font-weight: 700; 
  color: #fff; 
  display: flex;
  align-items: center;
  gap: 12px;
}

.delta-change {
  font-size: 10px;
  background: rgba(255,255,255,0.2);
  padding: 2px 8px;
  border-radius: 12px;
  color: #e8f5e8;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* App layout */
.app { display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(260px, 1fr) minmax(760px, 50vw) minmax(260px, 1fr); gap: var(--grid-gap); height: 85vh; padding: 12px 12px 16px; }

.search-component {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px solid #dee2e6;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 
    0 4px 20px rgba(0,0,0,0.1),
    inset 0 1px 0 rgba(255,255,255,0.5);
  margin-top: 16px;
}

.search-component .component-header {
  background: linear-gradient(135deg, #004225 0%, #00563a 100%);
  color: white;
  padding: 12px 20px;
  font-weight: 600;
}

.search-component .component-body {
  padding: 20px;
  background: rgba(255,255,255,0.8);
}

.header { grid-column: 1 / -1; display:flex; align-items:center; justify-content: space-between; padding: 8px 4px; }
.brand { font-weight: 800; letter-spacing: .5px; }
.tagline { font-family: var(--mono); font-size: 12px; color: #666; text-transform: uppercase; letter-spacing: 1px; }
.header .center { position: absolute; left:50%; transform: translateX(-50%); }
.link-btn { background:none; border:none; color:#111; text-decoration: underline; cursor:pointer; font-weight:600; }
.pill { border:1px solid #ddd; border-radius: 999px; padding: 6px 10px; font-family: var(--mono); }
.actions { display:flex; gap: 10px; align-items:center; }
.badge { border:1px solid #ddd; border-radius: 999px; padding:2px 8px; font-family: var(--mono); font-size: 12px; }

/* Terminal Styling */
.sidebar { padding: 0; background: transparent; border: none; }

.guest-component, .search-terminal, .publish-component {
  background: #fff;
  border: 2px solid #222;
  border-radius: 8px;
  overflow: hidden;
  font-family: var(--sans);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  height: calc(85vh - 120px);
}

.publish-component {
  background: #fff;
  border: 2px solid #222;
  border-radius: 8px;
  overflow: hidden;
  font-family: var(--sans);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  height: calc(85vh - 120px);
}

.component-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 16px 20px;
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
  color: #333;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.terminal-header {
  background: #f8f8f8;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #ddd;
}

.component-title {
  color: #000;
  font-weight: 600;
  font-size: 14px;
}


.component-body {
  padding: 24px;
  background: #fff;
  color: #000;
  height: calc(100% - 70px);
  overflow-y: auto;
}

.publish-component .component-body {
  background: #fff;
  padding: 20px;
  height: calc(100% - 60px);
  overflow-y: auto;
}

.terminal-body {
  padding: 16px;
  background: #fff;
  color: #000;
}

/* Streak Display */
.streak-display {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px;
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.ascii-art {
  font-size: 24px;
  filter: grayscale(1) contrast(2);
}

.streak-info {
  flex: 1;
}

.streak-line, .stat-line {
  margin-bottom: 4px;
  font-size: 12px;
}

.prompt {
  color: #0066cc;
  margin-right: 8px;
}

.value {
  color: #cc6600;
  font-weight: bold;
}

/* Form Styling */
.publish-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.terminal-label {
  color: #0066cc;
  font-size: 12px;
  font-weight: 600;
}

.terminal-input, .terminal-textarea, .terminal-search {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px 10px;
  color: #000;
  font-family: var(--mono);
  font-size: 12px;
}

.terminal-input:focus, .terminal-textarea:focus, .terminal-search:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
}

.terminal-input::placeholder, .terminal-textarea::placeholder, .terminal-search::placeholder {
  color: #666;
}

.terminal-btn {
  background: #fff;
  border: 1px solid #000;
  color: #000;
  padding: 10px 16px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.terminal-btn:hover {
  background: #000;
  color: #fff;
}

.terminal-btn.small {
  padding: 6px 10px;
  font-size: 10px;
}

.terminal-btn.ghost {
  border-color: #999;
  color: #999;
}

.terminal-btn.ghost:hover {
  background: #999;
  color: #fff;
}

.btn-icon {
  font-size: 14px;
}

/* Simple Search Interface */
.simple-search {
  margin-bottom: 24px;
}

.search-input {
  width: 100%;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
  font-family: var(--sans);
  font-size: 14px;
  color: #000;
}

.search-input:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}

.search-btn {
  width: 100%;
  background: #fff;
  border: 1px solid #000;
  color: #000;
  padding: 12px;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 12px;
  transition: all 0.2s;
}

.search-btn:hover {
  background: #000;
  color: #fff;
}

.search-btn.ghost {
  border-color: #999;
  color: #999;
}

.search-btn.ghost:hover {
  background: #999;
  color: #fff;
}

.filter-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

.filter-buttons {
  display: flex;
  gap: 8px;
}

.filter-buttons .search-btn {
  margin-bottom: 0;
}

.quick-stats {
  padding: 16px;
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.stat:last-child {
  margin-bottom: 0;
}

.stat-label {
  font-size: 13px;
  color: #666;
  font-weight: 500;
}

.stat-value {
  font-family: var(--mono);
  font-weight: 600;
  color: #000;
}

/* Feed and Trending Views */
.feed, .trending { padding: 20px; overflow-y: auto; height: calc(85vh - 140px); }
.feed-header, .trending-header { margin-bottom: 20px; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.feed-header h3, .trending-header h3 { margin: 0 0 6px 0; font-size: 18px; font-weight: 600; }

.feed-item, .trending-item { 
  border: 1px solid #eee; 
  border-radius: 8px; 
  padding: 16px; 
  margin-bottom: 16px; 
  cursor: pointer; 
  transition: all 0.2s; 
  background: #fff;
}
.feed-item:hover, .trending-item:hover { border-color: #0066cc; box-shadow: 0 2px 8px rgba(0,102,204,0.1); }

.feed-meta { display: flex; gap: 12px; margin-bottom: 8px; font-size: 11px; text-transform: uppercase; font-family: var(--mono); }
.feed-date { color: #666; }
.feed-merit { color: #cc6600; font-weight: 600; }
.feed-change { font-size: 11px; font-weight: 600; }
.feed-change.positive { color: #004225; }
.feed-change.negative { color: #dc3545; }
.feed-impact { padding: 2px 6px; border-radius: 3px; font-weight: 600; }
.feed-impact.standard { background: #f0f0f0; color: #666; }
.feed-impact.moderate { background: #fff3cd; color: #856404; }
.feed-impact.high { background: #d4edda; color: #155724; }

.feed-title { margin: 0 0 8px 0; font-size: 16px; font-weight: 600; line-height: 1.3; }
.feed-abstract { margin: 0 0 12px 0; color: #666; line-height: 1.4; }
.feed-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.trending-item { display: flex; gap: 16px; align-items: flex-start; }
.trending-rank { 
  font-family: var(--mono); 
  font-weight: 800; 
  font-size: 18px; 
  color: #0066cc; 
  min-width: 40px; 
  text-align: center;
}
.trending-content { flex: 1; }
.trending-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.trending-title { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.3; flex: 1; }
.trending-stats { margin-left: 12px; }
.trending-merit { 
  font-family: var(--mono); 
  font-size: 12px; 
  font-weight: 600; 
  color: #cc6600; 
  white-space: nowrap;
}
.trending-change { 
  font-family: var(--mono); 
  font-size: 11px; 
  font-weight: 600; 
  margin-left: 8px;
}
.trending-change.positive { color: #004225; }
.trending-change.negative { color: #dc3545; }
.trending-abstract { margin: 0 0 8px 0; color: #666; line-height: 1.4; }
.trending-meta { display: flex; justify-content: space-between; align-items: center; font-size: 11px; }
.trending-date { color: #999; font-family: var(--mono); }
.trending-tags { display: flex; gap: 4px; }

.tag { 
  background: #f8f9fa; 
  border: 1px solid #dee2e6; 
  border-radius: 4px; 
  padding: 2px 6px; 
  font-size: 10px; 
  font-family: var(--mono); 
  color: #666;
}

/* Welcome/Guest Component */
.welcome-content h3 { margin: 0 0 12px 0; font-size: 18px; font-weight: 600; }
.welcome-content p { margin: 0 0 20px 0; line-height: 1.5; color: #666; }

.features { margin-bottom: 24px; }
.feature { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.feature-icon { font-size: 16px; }

.auth-buttons { display: flex; gap: 10px; margin-bottom: 16px; }
.auth-btn { 
  flex: 1; 
  padding: 12px; 
  text-align: center; 
  text-decoration: none; 
  border-radius: 6px; 
  font-weight: 600; 
  transition: all 0.2s;
}
.auth-btn.primary { background: #004225; color: #fff; }
.auth-btn.primary:hover { background: #00563a; }
.auth-btn.secondary { background: #fff; color: #000; border: 1px solid #ddd; }
.auth-btn.secondary:hover { background: #f8f9fa; }

.learn-more .small { font-size: 12px; color: #999; margin: 0; text-align: center; }

/* Simple Publish Component */
.streak-info { display: flex; gap: 16px; margin-bottom: 20px; padding: 12px; background: #f8f9fa; border-radius: 6px; }
.streak-item { display: flex; flex-direction: column; align-items: center; }
.streak-label { font-size: 11px; color: #666; margin-bottom: 4px; }
.streak-value { font-family: var(--mono); font-weight: 600; font-size: 16px; }

.simple-publish { display: flex; flex-direction: column; gap: 16px; }

.publish-input, .publish-textarea {
  width: 100%;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px;
  font-family: var(--sans);
  font-size: 14px;
  color: #333;
  margin-bottom: 12px;
  transition: border-color 0.2s ease;
}

.publish-input:focus, .publish-textarea:focus {
  outline: none;
  border-color: #004225;
}

.publish-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.4;
}

.stake-section { 
  padding: 16px; 
  background: #f9f9f9; 
  border: 1px solid #ddd;
  border-radius: 8px; 
  margin: 16px 0;
}
.stake-label { 
  display: block; 
  font-weight: 600; 
  margin-bottom: 12px; 
  font-size: 14px; 
  color: #333;
}
.stake-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.stake-slider { flex: 1; }
.stake-display { font-family: var(--mono); font-weight: 600; min-width: 80px; }
.balance-info { 
  font-size: 12px; 
  color: #666; 
  margin-top: 8px;
}

.publish-btn {
  width: 100%;
  background: #004225;
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.publish-btn:hover {
  background: #00563a;
}

.publish-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Wallet/Portfolio Component */
.wallet-component {
  background: #fff;
  border: 2px solid #222;
  border-radius: 8px;
  overflow: hidden;
  font-family: var(--sans);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  height: calc(85vh - 120px);
}

.wallet-component .component-body {
  background: #fff;
  padding: 20px;
  overflow-y: auto;
}

.wallet-section { margin-bottom: 24px; }

.balance-card { 
  background: linear-gradient(135deg, 
    rgba(160, 82, 45, 0.1) 0%, 
    rgba(139, 69, 19, 0.05) 50%,
    rgba(160, 82, 45, 0.08) 100%
  );
  border: 2px solid #A0522D;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  margin-bottom: 20px;
  color: #333;
  box-shadow: 
    0 4px 12px rgba(160, 82, 45, 0.2),
    inset 0 1px 0 rgba(160, 82, 45, 0.3);
  position: relative;
  overflow: hidden;
}

.balance-amount { margin-bottom: 8px; }
.balance-value { font-size: 32px; font-weight: 700; font-family: var(--mono); }
.balance-currency { font-size: 16px; font-weight: 600; opacity: 0.9; margin-left: 8px; }
.balance-label { font-size: 12px; opacity: 0.8; text-transform: uppercase; letter-spacing: 1px; }

.portfolio-stats { 
  display: grid; 
  grid-template-columns: 1fr 1fr 1fr; 
  gap: 12px; 
  background: #f8f9fa; 
  padding: 16px; 
  border-radius: 8px; 
}

.stat-item { text-align: center; }
.stat-value { 
  display: block; 
  font-size: 18px; 
  font-weight: 700; 
  font-family: var(--mono); 
  color: #333; 
  margin-bottom: 4px; 
}
.stat-label { 
  font-size: 11px; 
  color: #666; 
  text-transform: uppercase; 
  letter-spacing: 0.5px; 
}

.market-section, .discovery-section { 
  margin-bottom: 24px; 
  padding: 16px; 
  background: #f8f9fa; 
  border-radius: 8px; 
}

.section-title { 
  margin: 0 0 16px 0; 
  font-size: 14px; 
  font-weight: 600; 
  color: #333;
}

.market-metrics { display: flex; flex-direction: column; gap: 12px; }
.market-metric { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  padding: 8px 0; 
  border-bottom: 1px solid #e0e0e0; 
}
.market-metric:last-child { border-bottom: none; }

.metric-label { font-size: 12px; color: #666; }
.metric-value { 
  font-family: var(--mono); 
  font-weight: 600; 
  font-size: 13px; 
  color: #333; 
}

.search-controls { display: flex; flex-direction: column; gap: 12px; }
.search-input { 
  width: 100%; 
  padding: 10px; 
  border: 1px solid #ddd; 
  border-radius: 6px; 
  font-size: 13px; 
  background: white; 
}

.search-buttons { display: flex; gap: 8px; }
.search-btn { 
  flex: 1; 
  padding: 8px 12px; 
  border: none; 
  border-radius: 4px; 
  font-size: 12px; 
  font-weight: 600; 
  cursor: pointer; 
  transition: all 0.2s; 
}

.search-btn.primary { background: #004225; color: white; }
.search-btn.primary:hover { background: #00563a; }
.search-btn.secondary { background: #e9ecef; color: #333; }
.search-btn.secondary:hover { background: #dee2e6; }
.search-btn.clear { background: #f8d7da; color: #721c24; }
.search-btn.clear:hover { background: #f5c6cb; }

/* Streak Showcase Component */
.streak-showcase {
  margin-top: 20px;
  padding: 16px;
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.streak-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  gap: 8px;
}

.streak-icon { font-size: 16px; }
.streak-title { 
  font-weight: 600; 
  font-size: 14px; 
  color: #495057; 
  text-transform: uppercase; 
  letter-spacing: 0.5px; 
}

.streak-metrics {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.streak-metric { text-align: center; }
.streak-number {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
  color: #004225;
  margin-bottom: 4px;
}

.streak-desc {
  font-size: 11px;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.streak-divider {
  width: 1px;
  height: 30px;
  background: #dee2e6;
}

/* Legacy support for old module class */
.module { margin-bottom: 14px; }
.module h3 { margin: 0 0 6px 0; font-size: 14px; text-transform: uppercase; letter-spacing: .8px; color: #444; }

.input, select, textarea { width:100%; border:1px solid #ddd; border-radius: 8px; padding: 8px 10px; font-family: var(--mono); }
.btn { border:1px solid #111; background:#fff; color:#111; padding:8px 12px; border-radius: 8px; cursor:pointer; }
.btn.ghost { background:#fff; color:#111; border:1px solid #ddd; }
.btn.block { width:100%; }

.center { display:flex; flex-direction: column; gap: 10px; }
.tabs { 
  display: grid;
  grid-template-rows: auto auto;
  margin-bottom: 20px; 
  gap: 8px; 
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); 
  border-radius: 16px; 
  padding: 16px; 
  border: 2px solid #dee2e6;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.main-tabs {
  display: flex;
  gap: 6px;
}

.class-tabs {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.tab { 
  flex: 1; 
  padding: 14px 20px; 
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%); 
  border: 1px solid #dee2e6;
  border-radius: 8px; 
  cursor: pointer; 
  font-family: var(--sans); 
  font-weight: 600; 
  color: #495057; 
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.class-tab {
  flex: 1;
  padding: 8px 12px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: 1px solid #dee2e6;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 500;
  color: #495057;
  transition: all 0.3s ease;
  font-size: 11px;
  text-transform: capitalize;
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.class-tab:hover {
  background: linear-gradient(135deg, #004225 0%, #00563a 100%);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,66,37,0.3);
}

.class-tab.active {
  background: linear-gradient(135deg, #A0522D 0%, #8B4513 100%);
  color: white;
  box-shadow: 0 3px 8px rgba(160,82,45,0.4);
  transform: translateY(-1px);
}

.tab::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transition: left 0.5s;
}

.tab:hover {
  background: linear-gradient(135deg, #004225 0%, #00563a 100%);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,66,37,0.3);
}

.tab:hover::before {
  left: 100%;
}

.tab.active { 
  background: linear-gradient(135deg, #004225 0%, #00563a 100%);
  color: white;
  box-shadow: 0 6px 16px rgba(0,66,37,0.4);
  transform: translateY(-1px);
  border-color: #004225;
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 3px;
  background: #A0522D;
  border-radius: 2px;
}

#graph-shell { position: relative; border: 1px solid #eee; border-radius: 12px; background:#fff; min-height: 420px; overflow:hidden; }
#ascii { margin:0; padding:12px; line-height:1; white-space: pre; font-family: var(--mono); font-size: 12px; color:#111; }
#status { position:absolute; bottom:8px; left:12px; font-family: var(--mono); font-size: 12px; color:#666; }

.list { border:1px solid #eee; border-radius:12px; background:#fff; padding: 10px; }
.row { display:grid; grid-template-columns: 1fr 120px 180px; gap:10px; padding:8px 6px; border-bottom:1px dashed #eee; align-items:center; }
.row:last-child { border-bottom:0; }
.meta { color:#555; font-family: var(--mono); font-size: 12px; }

.stat { display:flex; align-items:center; justify-content: space-between; padding:6px 0; border-bottom:1px dashed #eee; }
.stat:last-child { border-bottom:0; }
.tagcloud { display:flex; flex-wrap:wrap; gap:6px; }
.tag { border:1px solid #ddd; border-radius:999px; padding:2px 8px; font-family: var(--mono); font-size: 12px; }
.chart { font-family: var(--mono); font-size: 12px; white-space: pre; background:#fafafa; border:1px solid #eee; border-radius: 8px; padding:8px; }

.page { max-width: 900px; margin: 0 auto; padding: 24px 16px; }
.stack { display:flex; flex-direction: column; gap: 12px; }

/* Leaderboard */
.table { border:1px solid #eee; border-radius: 12px; background:#fff; overflow:hidden; }
.thead, .trow { display:grid; grid-template-columns: 60px 2fr 1fr 1fr; gap:10px; padding:10px; border-bottom:1px solid #f1f1f1; }
.thead { background:#fafafa; font-weight:700; }
.trow:last-child { border-bottom:none; }
.rank { font-family: var(--mono); }
.username { font-weight:700; }

/* Profile Section */
.profile-link {
  display: block;
  text-decoration: none;
  color: inherit;
  margin-top: 16px;
}

.profile-preview {
  display: flex;
  align-items: center;
  padding: 16px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px solid #dee2e6;
  border-radius: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.profile-preview:hover {
  background: linear-gradient(135deg, #004225 0%, #00563a 100%);
  color: white;
  border-color: #004225;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,66,37,0.3);
}

.profile-avatar {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #004225 0%, #00563a 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 18px;
  margin-right: 12px;
  flex-shrink: 0;
}

.profile-preview:hover .profile-avatar {
  background: linear-gradient(135deg, #A0522D 0%, #8B4513 100%);
}

.profile-info {
  flex: 1;
}

.profile-name {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
}

.profile-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.status-badge {
  background: #004225;
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.profile-preview:hover .status-badge {
  background: #A0522D;
}

.merit-count {
  color: #666;
  font-weight: 600;
}

.profile-preview:hover .merit-count {
  color: rgba(255,255,255,0.9);
}

.profile-arrow {
  font-size: 20px;
  font-weight: 700;
  color: #004225;
  transition: transform 0.3s ease;
}

.profile-preview:hover .profile-arrow {
  color: white;
  transform: translateX(4px);
}

/* Profile Page Styles */
.profile-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px;
  display: grid;
  gap: 32px;
}

.profile-header {
  display: flex;
  gap: 24px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 32px;
  border-radius: 16px;
  border: 2px solid #dee2e6;
}

.profile-avatar-large {
  width: 120px;
  height: 120px;
  background: linear-gradient(135deg, #004225 0%, #00563a 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 48px;
  flex-shrink: 0;
}

.profile-details {
  flex: 1;
}

.profile-title {
  font-size: 32px;
  font-weight: 700;
  color: #333;
  margin: 0 0 8px 0;
}

.profile-affiliation {
  font-size: 18px;
  color: #666;
  margin: 0 0 24px 0;
}

.profile-stats-row {
  display: flex;
  gap: 32px;
}

.header-stat {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: #004225;
}

.stat-label {
  font-size: 14px;
  color: #666;
  font-weight: 600;
}

.section-heading {
  font-size: 24px;
  font-weight: 700;
  color: #333;
  margin: 0 0 20px 0;
  border-bottom: 3px solid #004225;
  padding-bottom: 8px;
}

/* Achievement Badges */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.achievement-badge {
  background: white;
  border: 2px solid #dee2e6;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
}

.achievement-badge.platinum {
  border-color: #e5e7eb;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  box-shadow: 0 4px 12px rgba(148, 163, 184, 0.3);
}

.achievement-badge.gold {
  border-color: #fbbf24;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.achievement-badge.silver {
  border-color: #9ca3af;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  box-shadow: 0 4px 12px rgba(156, 163, 175, 0.3);
}

.achievement-badge.bronze {
  border-color: #cd7c0e;
  background: linear-gradient(135deg, #fef7ed 0%, #fed7aa 100%);
  box-shadow: 0 4px 12px rgba(205, 124, 14, 0.3);
}

.achievement-badge.pending {
  border-color: #3b82f6;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.achievement-badge.locked {
  border-color: #6b7280;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  opacity: 0.6;
}

.badge-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.badge-title {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
}

.badge-desc {
  font-size: 14px;
  color: #666;
  line-height: 1.4;
}

/* Portfolio Stats */
.portfolio-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.portfolio-metric {
  background: white;
  border: 2px solid #dee2e6;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.metric-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: #004225;
  margin-bottom: 8px;
}

.metric-label {
  font-size: 14px;
  color: #666;
  font-weight: 600;
}

/* Works List */
.works-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.work-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
  border: 2px solid #dee2e6;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
}

.work-item:hover {
  border-color: #004225;
  box-shadow: 0 4px 12px rgba(0,66,37,0.1);
}

.work-rank {
  font-size: 24px;
  font-weight: 700;
  color: #004225;
  min-width: 40px;
}

.work-content {
  flex: 1;
}

.work-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin: 0 0 8px 0;
}

.work-meta {
  font-size: 12px;
  color: #666;
  margin: 0 0 8px 0;
}

.work-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.work-merit {
  font-size: 20px;
  font-weight: 700;
  color: #004225;
  text-align: center;
  min-width: 80px;
}

/* Activity Feed */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 16px;
}

.activity-icon {
  font-size: 24px;
  width: 40px;
  text-align: center;
}

.activity-content {
  flex: 1;
}

.activity-content p {
  margin: 0 0 4px 0;
  font-size: 14px;
  color: #333;
}

.activity-time {
  font-size: 12px;
  color: #666;
}
