:root {
  --primary: #ff4757;
  --primary-dark: #e84118;
  --secondary: #2f3542;
  --bg: #1e272e;
  --text: #ffffff;
  --text-dim: #ced6e0;
  --accent: #ffa502;
  --gray: #747d8c;
}

body {
  font-family: 'Noto Sans KR', sans-serif;
  background-color: var(--bg);
  /* 고급스러운 다크 모드 그라데이션 및 패턴 */
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(255, 71, 87, 0.08), transparent 25%), 
    radial-gradient(circle at 85% 30%, rgba(255, 165, 2, 0.08), transparent 25%);
  color: var(--text);
  margin: 0;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  line-height: 1.6;
  overflow-x: hidden; /* 배경 장식 넘침 방지 */
}

/* Background Decorations (Floating Icons) */
.bg-shapes {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.shape {
  position: absolute;
  font-size: 4rem;
  opacity: 0.1; /* 은은하게 */
  animation: floatBackground 10s infinite ease-in-out;
}

.shape-1 { top: 10%; left: 10%; animation-duration: 12s; }
.shape-2 { top: 20%; right: 15%; animation-duration: 15s; font-size: 3rem; }
.shape-3 { bottom: 15%; left: 20%; animation-duration: 18s; animation-delay: 2s; }
.shape-4 { bottom: 10%; right: 10%; animation-duration: 14s; font-size: 5rem; }

@keyframes floatBackground {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(10deg); }
}

/* Hero Mascot */
.hero-mascot {
  font-size: 6rem;
  margin-bottom: -10px;
  filter: drop-shadow(0 0 15px rgba(255, 71, 87, 0.6));
  animation: bounceMascot 2s infinite ease-in-out;
  display: inline-block;
}

@keyframes bounceMascot {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

/* Lang Switcher */
.lang-switch {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 100;
}

#langBtn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid var(--gray);
  color: var(--text);
  padding: 8px 15px;
  border-radius: 20px;
  cursor: pointer;
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 0.9rem;
  transition: all 0.2s;
  backdrop-filter: blur(5px);
}

#langBtn:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.container {
  max-width: 600px;
  width: 100%;
  text-align: center;
  margin-top: 40px;
  z-index: 1; /* 배경 위에 표시 */
}

header h1 {
  font-family: 'Jua', sans-serif;
  font-size: 3.5rem;
  color: var(--primary);
  text-shadow: 2px 2px 0 #000;
  margin-bottom: 0.5rem;
  letter-spacing: -1px;
}

header p {
  font-size: 1.3rem;
  color: var(--text-dim);
  font-weight: 400;
  white-space: pre-wrap;
}

/* Glassmorphism Card Style */
.glass-effect {
  background: rgba(47, 53, 66, 0.85); /* 반투명 */
  backdrop-filter: blur(12px); /* 흐림 효과 */
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.card {
  border-radius: 20px;
  padding: 2rem;
  margin: 2rem 0;
}

.section {
  margin-bottom: 1.8rem;
  text-align: left;
}

.section h3 {
  margin: 0 0 12px 0;
  color: var(--accent);
  font-size: 1.4rem;
  font-family: 'Jua', sans-serif;
}

.btn-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
}

.select-btn {
  background-color: rgba(30, 39, 46, 0.8);
  border: 2px solid var(--gray);
  color: var(--text-dim);
  padding: 12px 10px;
  border-radius: 12px;
  cursor: pointer;
  font-family: 'Jua', sans-serif;
  font-size: 1.2rem;
  transition: all 0.2s;
}

.select-btn:hover {
  border-color: var(--primary);
  color: var(--text);
  background-color: rgba(255, 71, 87, 0.1);
}

.select-btn.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 0 15px rgba(255, 71, 87, 0.5);
  transform: scale(1.05);
}

.divider {
  height: 2px;
  background-color: var(--gray);
  margin: 25px 0;
  opacity: 0.2;
}

.btn-primary {
  width: 100%;
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 1.2rem;
  font-size: 1.8rem;
  border-radius: 15px;
  cursor: pointer;
  font-family: 'Jua', sans-serif;
  transition: all 0.1s;
  box-shadow: 0 6px 0 #b33939;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.btn-primary:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #b33939;
}

.btn-primary:disabled {
  background-color: var(--gray);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background-color: var(--accent);
  border: none;
  color: #000;
  padding: 1rem 1.5rem;
  font-size: 1.3rem;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 1.5rem;
  font-family: 'Jua', sans-serif;
  transition: all 0.2s;
  width: 100%;
  box-shadow: 0 4px 0 #cc8400;
  font-weight: bold;
}

.btn-secondary:hover {
  background-color: #ffb121;
  transform: translateY(-2px);
}

.btn-secondary:active {
  transform: translateY(2px);
  box-shadow: none;
}

.result-card {
  color: #2f3542;
  border-radius: 20px;
  padding: 2.5rem;
  text-align: left;
  margin-top: 2rem;
  position: relative;
  border: 5px solid var(--accent);
  background: rgba(255, 255, 255, 0.95); /* 결과창은 가독성 위해 밝게 */
}

.result-card h2 {
  color: var(--primary);
  margin-top: 0;
  text-align: center;
  border-bottom: 2px dashed #ddd;
  padding-bottom: 15px;
  font-family: 'Jua', sans-serif;
  font-size: 2rem;
}

#loading {
  text-align: center;
  padding: 2rem;
}

.spinner {
  display: inline-block;
  width: 50px;
  height: 50px;
  border: 5px solid rgba(0,0,0,0.1);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 1rem;
}

.markdown-body {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 1.1rem;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: keep-all;
  font-weight: 500;
}

/* Info Article for AdSense Quality */
.info-article {
  margin-top: 4rem;
  text-align: left;
  padding: 2.5rem;
  border-radius: 20px;
  color: #ced6e0;
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 1rem;
}

.info-article h3 {
  color: var(--accent);
  font-family: 'Jua', sans-serif;
  font-size: 1.6rem;
  margin-top: 1.8rem;
}

footer {
  margin-top: 4rem;
  padding-bottom: 2rem;
  color: #747d8c;
  font-size: 1rem;
}

.footer-links a {
  color: #ced6e0;
  text-decoration: none;
  margin: 0 15px;
  font-weight: bold;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hidden {
  display: none !important;
}

@media (max-width: 400px) {
  .btn-group {
    grid-template-columns: 1fr 1fr;
  }
  header h1 {
    font-size: 2.5rem;
  }
}
