:root {
  --bg: #0b0f19;
  --card-bg: rgba(17, 25, 40, 0.65);
  --border: rgba(255, 255, 255, 0.08);
  --primary: #4f46e5;
  --glow-p: rgba(79, 70, 229, 0.4);
  --accent: #06b6d4;
  --glow-a: rgba(6, 182, 212, 0.4);
  --text: #f3f4f6;
  --muted: #9ca3af;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}
.background-decor {
  position: absolute; width: 100%; height: 100%; z-index: -1; overflow: hidden;
}
.blob {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.3;
  animation: float 8s infinite alternate ease-in-out;
}
.blob-1 { width: 300px; height: 300px; background: var(--primary); top: 10%; left: 10%; }
.blob-2 { width: 250px; height: 250px; background: var(--accent); bottom: 10%; right: 10%; animation-delay: -4s; }
@keyframes float { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(30px, 30px) scale(1.15); } }
.container { width: 100%; max-width: 440px; padding: 20px; z-index: 1; }
header { text-align: center; margin-bottom: 20px; }
h1 {
  font-family: 'Outfit', sans-serif; font-size: 2.2rem; font-weight: 800;
  background: linear-gradient(135deg, #fff 40%, var(--accent) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.subtitle { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }
.glass-card {
  background: var(--card-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border); border-radius: 24px; padding: 28px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
.range-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 auto 20px auto; max-width: 240px; }
.input-group { display: flex; flex-direction: column; gap: 4px; text-align: center; }
.input-group label { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; color: var(--muted); }
.input-group input {
  width: 100%; max-width: 100%; background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px; color: var(--text); font-size: 0.9rem; text-align: center; outline: none; transition: all 0.2s;
}
.input-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow-a); }
.display-container {
  text-align: center; background: rgba(0,0,0,0.25); border-radius: 20px;
  padding: 16px; margin-bottom: 20px; border: 1px solid rgba(255,255,255,0.02);
}
#number-display {
  font-family: 'Outfit', sans-serif; font-size: clamp(2.2rem, 12vw, 4.2rem); font-weight: 800;
  text-shadow: 0 0 20px var(--glow-a); transition: transform 0.15s ease-out;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.timestamp { font-size: 0.7rem; color: var(--muted); margin-top: 6px; }
.glowing-btn {
  width: 100%; padding: 14px; border-radius: 14px; border: none;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-size: 1rem; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 15px var(--glow-p); transition: all 0.2s;
}
.glowing-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px var(--glow-p), 0 0 10px var(--glow-a); }
.glowing-btn:active { transform: translateY(1px); }
.stats-section { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 20px; }
h3 { font-family: 'Outfit', sans-serif; font-size: 1rem; font-weight: 600; margin-bottom: 12px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-card {
  background: rgba(255,255,255,0.02); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 6px; text-align: center; display: flex; flex-direction: column; gap: 2px;
}
.stat-label { font-size: 0.6rem; color: var(--muted); text-transform: uppercase; }
.stat-value { font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-section { margin-top: 20px; }
.history-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.text-btn {
  background: none; border: none; color: var(--muted); font-size: 0.75rem;
  cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: all 0.2s;
}
.text-btn:hover { color: #fff; background: rgba(255,255,255,0.05); }
.history-list { display: flex; flex-direction: column; gap: 6px; max-height: 120px; overflow-y: auto; }
.history-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; background: rgba(255,255,255,0.03); border-radius: 8px;
  font-size: 0.8rem; animation: slideIn 0.2s ease-out;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
.history-num { font-weight: 600; font-family: 'Outfit', sans-serif; color: var(--accent); }
.history-time { color: var(--muted); font-size: 0.7rem; }
.empty-history { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 12px 0; }
footer { text-align: center; margin-top: 20px; color: var(--muted); font-size: 0.7rem; }
