:root {
  --primary-color: #6366f1;
  --secondary-color: #ec4899;
  --accent-color: #f59e0b;
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  --card-bg: rgba(255, 255, 255, 0.05);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --radius: 1.5rem;
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  --glow: 0 0 15px rgba(99, 102, 241, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Pretendard', sans-serif;
}

body {
  background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

.background-texture {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3%3Ffilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

.app-container {
  width: 90%;
  max-width: 500px;
  position: relative;
  z-index: 1;
  padding: 2rem 0;
}

header {
  text-align: center;
  margin-bottom: 3rem;
}

h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.highlight {
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.generator-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 2rem;
  transition: transform 0.3s ease;
}

.ball-container {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  min-height: 60px;
  flex-wrap: wrap;
}

.placeholder-text {
  color: var(--text-secondary);
  font-style: italic;
  display: flex;
  align-items: center;
}

/* Controls */
.controls {
  display: flex;
  justify-content: center;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  padding: 1rem 2.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), var(--glow);
}

.primary-btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2), 0 0 25px rgba(99, 102, 241, 0.6);
}

.primary-btn:active {
  transform: translateY(0) scale(0.98);
}

/* History Section */
.history-section {
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.history-list {
  list-style: none;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0.75rem;
  margin-bottom: 0.5rem;
  animation: slideIn 0.3s ease-out;
}

.history-numbers {
  display: flex;
  gap: 0.4rem;
}

.mini-ball {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.secondary-btn {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  width: 100%;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

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

/* Custom Element Styles for main.js */
lotto-ball {
  display: inline-block;
  perspective: 1000px;
}

@media (max-width: 480px) {
  h1 { font-size: 2.2rem; }
  .generator-card { padding: 1.5rem; }
  .primary-btn { padding: 0.8rem 1.8rem; font-size: 1.1rem; }
}
