:root {
  /* Mystical Palette */
  --color-bg-deep: #0f0c29;
  --color-bg-mid: #302b63;
  --color-bg-light: #24243e;
  --color-text-main: #e0e0e0;
  --color-text-sub: #a0a0c0;
  --color-accent-gold: #ffd700;
  --color-accent-glow: rgba(138, 43, 226, 0.6);
  --glass-panel: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --font-serif: 'Nanum Myeongjo', serif;
  --font-sans: 'Noto Sans KR', sans-serif;
  --radius-lg: 20px;
}

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

body {
  background: linear-gradient(to bottom, var(--color-bg-deep), var(--color-bg-mid), var(--color-bg-light));
  color: var(--color-text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}

/* Starfield Animation */
.starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 3px),
    radial-gradient(white, rgba(255,255,255,.15) 1px, transparent 2px),
    radial-gradient(white, rgba(255,255,255,.1) 2px, transparent 3px);
  background-size: 550px 550px, 350px 350px, 250px 250px;
  background-position: 0 0, 40px 60px, 130px 270px;
  animation: starMove 100s linear infinite;
  z-index: -1;
  opacity: 0.6;
}

@keyframes starMove {
  from { transform: translateY(0); }
  to { transform: translateY(-550px); }
}

.app-wrapper {
  width: 100%;
  max-width: 600px; /* Mobile-focused width */
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  z-index: 10;
}

.main-header {
  text-align: center;
  margin-bottom: 20px;
}

.brand h1 {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 0 15px var(--color-accent-glow);
  margin-bottom: 8px;
}

.brand h1 span {
  color: var(--color-accent-gold);
  font-size: 0.8em;
  vertical-align: middle;
}

.subtitle {
  font-size: 0.95rem;
  color: var(--color-text-sub);
  letter-spacing: 0.05em;
}

/* Glass Panels */
.content-container {
  background: var(--glass-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: all 0.5s ease;
}

/* Input Section */
.dream-input-section {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

label {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--color-text-main);
  margin-left: 5px;
}

textarea {
  width: 100%;
  height: 150px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 15px;
  color: white;
  font-size: 1rem;
  resize: none;
  font-family: var(--font-sans);
  line-height: 1.6;
  transition: border-color 0.3s;
}

textarea:focus {
  outline: none;
  border-color: var(--color-accent-gold);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

/* Buttons */
.primary-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 50px;
  padding: 16px;
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s;
  box-shadow: 0 4px 15px rgba(118, 75, 162, 0.4);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(118, 75, 162, 0.6);
}

.btn-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-25deg);
  animation: shine 3s infinite;
}

@keyframes shine {
  100% { left: 200%; }
}

/* Results Section */
.hidden {
  display: none;
}

.analysis-box {
  text-align: center;
  margin-bottom: 25px;
}

.analysis-box h3 {
  font-family: var(--font-serif);
  color: var(--color-accent-gold);
  margin-bottom: 10px;
}

.typing-effect {
  font-size: 0.95rem;
  color: var(--color-text-main);
  min-height: 1.6em;
}

/* Lotto Balls */
.lotto-numbers {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}

.ball {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffffff, #e0e0e0); /* Default white-ish */
  color: #333;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3), inset -2px -2px 6px rgba(0,0,0,0.1);
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  opacity: 0;
  transform: scale(0.5);
}

/* Ball Colors based on Lotto standard */
.ball.range-1 { background: radial-gradient(circle at 30% 30%, #fbc400, #e1b000); color: white; text-shadow: 0 1px 2px rgba(0,0,0,0.3); } /* 1-10 Yellow */
.ball.range-2 { background: radial-gradient(circle at 30% 30%, #69c, #48a); color: white; } /* 11-20 Blue */
.ball.range-3 { background: radial-gradient(circle at 30% 30%, #ff7272, #e05050); color: white; } /* 21-30 Red */
.ball.range-4 { background: radial-gradient(circle at 30% 30%, #aaa, #888); color: white; } /* 31-40 Grey */
.ball.range-5 { background: radial-gradient(circle at 30% 30%, #b0d840, #90b820); color: white; } /* 41-45 Green */

@keyframes popIn {
  to { opacity: 1; transform: scale(1); }
}

.lucky-message {
  text-align: center;
  font-family: var(--font-serif);
  color: var(--color-text-sub);
  margin-top: 20px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.secondary-btn {
  background: transparent;
  border: 1px solid var(--color-text-sub);
  color: var(--color-text-sub);
  padding: 10px 20px;
  border-radius: 50px;
  margin-top: 30px;
  width: 100%;
  cursor: pointer;
  transition: all 0.3s;
}

.secondary-btn:hover {
  border-color: white;
  color: white;
  background: rgba(255,255,255,0.1);
}

.main-footer {
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
  margin-top: auto;
}

@media (max-width: 480px) {
  .brand h1 { font-size: 2rem; }
  .ball { width: 38px; height: 38px; font-size: 1rem; }
}
