/* ===========================================================
   WASM Performance Benchmark — Styles
   Theme: Dark mode · Premium · Glassmorphism
   =========================================================== */

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

:root {
  --primary: #654FF0;
  --primary-light: #A29BFE;
  --accent: #00CEC9;
  --bg: #0B0E11;
  --bg-card: rgba(20, 24, 32, 0.7);
  --border: rgba(101, 79, 240, 0.15);
  --glass-border: rgba(255, 255, 255, 0.06);
  --text: #E8E6F0;
  --text-muted: #8B8A9E;
  --text-dim: #5A5872;
  --success: #00B894;
  --danger: #FF6B6B;
  --js-color: #F7DF1E;
  --wasm-color: #654FF0;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 220ms ease;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.5; }
.app-container { max-width: 900px; margin: 0 auto; padding: 24px 20px 60px; }

/* Header */
.app-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.logo-group { display: flex; align-items: center; gap: 12px; }
.app-header h1 { font-size: 1.35rem; font-weight: 700; background: linear-gradient(135deg, var(--primary-light), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.tagline { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }
.header-actions { display: flex; align-items: center; gap: 8px; }

.algo-select { background: rgba(0,0,0,0.3); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-family: var(--font); font-size: 0.8rem; padding: 6px 10px; outline: none; }

/* Buttons */
.btn { border: none; cursor: pointer; font-family: var(--font); font-weight: 600; border-radius: var(--radius-sm); transition: all var(--transition); }
.btn-sm { font-size: 0.78rem; padding: 6px 14px; }
.btn-xs { font-size: 0.7rem; padding: 3px 8px; }
.btn-accent { background: var(--accent); color: #0B0E11; }
.btn-accent:hover { background: #00B5B0; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: rgba(101,79,240,0.08); color: var(--text); }

/* Score Grid */
.score-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; margin-bottom: 24px; }
.score-card { background: var(--bg-card); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 20px; text-align: center; backdrop-filter: blur(12px); }
.sc-badge { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 3px 10px; border-radius: 999px; display: inline-block; margin-bottom: 10px; }
.js-card .sc-badge { background: rgba(247,223,30,0.15); color: var(--js-color); }
.sc-badge.wasm { background: rgba(101,79,240,0.15); color: var(--wasm-color); }
.sc-time { font-size: 1.6rem; font-weight: 800; }
.sc-label { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }
.vs-card { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 80px; }
.vs-label { font-size: 0.8rem; font-weight: 700; color: var(--text-dim); }
.speedup { font-size: 1.2rem; font-weight: 800; color: var(--accent); }

/* Chart */
.chart-section { background: var(--bg-card); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; backdrop-filter: blur(12px); }
.section-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 14px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.chart-container { display: flex; gap: 20px; align-items: flex-end; height: 160px; }
.bar-group { flex: 1; text-align: center; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bar-wrapper { flex: 1; width: 60px; display: flex; align-items: flex-end; }
.bar { width: 100%; border-radius: 6px 6px 0 0; transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); min-height: 4px; }
.js-bar { background: linear-gradient(180deg, var(--js-color), #D4C51A); }
.wasm-bar { background: linear-gradient(180deg, var(--wasm-color), #4B3BC2); }
.bar-label { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); margin-top: 6px; }

/* History */
.history-section { background: var(--bg-card); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 16px; backdrop-filter: blur(12px); }
.history-list { display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow-y: auto; }
.history-item { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 8px; padding: 8px 10px; background: rgba(0,0,0,0.2); border-radius: var(--radius-sm); font-size: 0.75rem; align-items: center; }
.history-item .algo { font-weight: 600; }
.history-item .js-t { color: var(--js-color); }
.history-item .wasm-t { color: var(--wasm-color); }
.history-item .su { color: var(--accent); font-weight: 700; }

/* Progress */
.progress { display: flex; align-items: center; gap: 10px; justify-content: center; padding: 16px; margin-top: 16px; font-size: 0.85rem; color: var(--text-muted); }
.progress.hidden { display: none; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(101,79,240,0.2); border-radius: 3px; }

/* Responsive */
@media (max-width: 600px) {
  .score-grid { grid-template-columns: 1fr; }
  .app-header { flex-direction: column; align-items: flex-start; }
  .chart-container { height: 120px; }
}
