:root {
  --primary-color: #D69989;   /* Muted Terracotta */
  --secondary-color: #A3766D; /* Warm Brick/Brown */
  --bg-gradient-start: #EBD9CB; /* Softest Beige */
  --bg-gradient-end: #E9CBB9;   /* Light Peach/Tan */
  --text-color: #5B5C5C;      /* Deep Gray */
  --card-bg: rgba(255, 255, 255, 0.92);
  --shadow-color: rgba(91, 92, 92, 0.15); /* Using text color for subtle shadow */
  --font-title: 'Jua', sans-serif;
  --font-body: 'Noto Sans KR', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
  color: var(--text-color);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
}

.container {
  background-color: var(--card-bg);
  border-radius: 24px;
  box-shadow: 0 10px 30px var(--shadow-color);
  padding: 40px;
  max-width: 500px;
  width: 100%;
  text-align: center;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

header {
  margin-bottom: 30px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.title {
  font-family: var(--font-title);
  font-size: 3rem; /* Adjusted to 3rem as requested */
  color: var(--primary-color);
  margin-bottom: 10px;
  text-shadow: 2px 2px 0px #fff, 4px 4px 0px rgba(0,0,0,0.05);
  word-break: keep-all;
  white-space: nowrap;
  line-height: 1.2;
  width: 100%;
  text-align: center;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-color);
  opacity: 0.8;
  word-break: keep-all;
  text-align: center;
}

/* Upload Section */
.upload-section {
  display: flex;
  flex-direction: column;
  gap: 15px;
  transition: all 0.3s ease;
}

.drop-zone {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 80px 20px; /* Increased from 40px to 80px for larger size */
  border: 3px dashed #d1d8e0;
  border-radius: 20px;
  background-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 250px; /* Added min-height */
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary-color);
  background-color: #fdf6f4;
  transform: scale(1.02);
}

.drop-zone-content {
  pointer-events: none;
}

.upload-icon {
  font-size: 4rem; /* Increased icon size */
  display: block;
  margin-bottom: 15px;
}

.drop-zone p {
  font-weight: 700;
  font-size: 1.2rem; /* Slightly increased font size */
  color: var(--secondary-color);
  opacity: 0.7;
  line-height: 1.5;
}

.hidden-input {
  display: none;
}

/* Preview Section */
.preview-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  animation: fadeIn 0.5s ease;
}

.image-wrapper {
  position: relative;
  width: 280px; /* Increased from 200px */
  height: 280px; /* Increased from 200px */
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 5px 15px var(--shadow-color);
  margin: 0 auto 20px;
}

.image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.result-image-wrapper {
  width: 220px; /* Increased from 150px */
  height: 220px; /* Increased from 150px */
  border-radius: 50%;
  border: 5px solid var(--primary-color);
}

/* Scanning Animation */
.scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background-color: var(--secondary-color);
  box-shadow: 0 0 10px var(--secondary-color), 0 0 20px var(--secondary-color);
  opacity: 0.8;
  z-index: 10;
}

.scan-animation {
  animation: scan 2s linear infinite;
}

@keyframes scan {
  0% { top: -5%; }
  50% { top: 105%; }
  100% { top: -5%; }
}


/* Buttons */
button {
  font-family: var(--font-title);
  font-size: 1.4rem;
  padding: 15px 30px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  color: white;
  width: 100%;
}

.btn-primary {
  background-color: var(--primary-color);
  box-shadow: 0 4px 0 #b37e71, 0 8px 15px rgba(214, 153, 137, 0.4);
}

.btn-primary:active {
  transform: translateY(4px);
  box-shadow: 0 0px 0 #b37e71, 0 4px 10px rgba(214, 153, 137, 0.4);
}

.btn-primary:hover {
  background-color: #cc8b7a;
}

.btn-secondary {
  background-color: var(--secondary-color);
  box-shadow: 0 4px 0 #855f58, 0 8px 15px rgba(163, 118, 109, 0.4);
  margin-top: 10px;
}

.btn-secondary:active {
  transform: translateY(4px);
  box-shadow: 0 0px 0 #855f58, 0 4px 10px rgba(163, 118, 109, 0.4);
}

.btn-secondary:hover {
  background-color: #946961;
}

.btn-small {
  font-size: 1.1rem;
  padding: 10px 20px;
  background-color: #95a5a6;
  box-shadow: 0 4px 0 #7f8c8d;
}

.btn-small:hover {
  background-color: #7f8c8d;
}

.btn-small:active {
  box-shadow: 0 0px 0 #7f8c8d;
}

.hidden {
  display: none !important;
}

/* Loading Section */
.loading-section {
  padding: 20px 0;
  animation: fadeIn 0.5s ease;
}

.loading-section p {
  font-weight: bold;
  font-size: 1.2rem;
  color: var(--primary-color);
  margin-top: 10px;
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

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

@keyframes popIn {
  0% { opacity: 0; transform: scale(0.8); }
  70% { transform: scale(1.1); }
  100% { opacity: 1; transform: scale(1); }
}

/* Result Section */
.result-section {
  display: flex;
  flex-direction: column;
  gap: 10px; /* Reduced gap from 15px */
  align-items: center;
  animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Share Module */
.module_sharepc {
  width: 100%;
  margin: 20px 0;
  padding: 20px;
  background-color: #f9f9f9;
  border-radius: 16px;
  border: 1px solid #eee;
}

.tit_module {
  display: block;
  font-family: var(--font-title); /* Unified title font */
  font-size: 1.2rem;
  color: var(--secondary-color);
  margin-bottom: 15px;
  text-align: center;
}

.list_share {
  display: flex;
  justify-content: center;
  gap: 15px; /* Reverted to 15px */
  list-style: none;
  padding: 0;
}

.link_share {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  gap: 5px;
  transition: transform 0.2s ease;
}

.link_share:hover {
  transform: translateY(-3px);
}

.ico_share {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  color: white;
  font-weight: bold;
}

.ico_naverblog { background-color: #03C75A; font-family: sans-serif; }
.ico_facebook { background-color: #1877F2; font-family: sans-serif; }
.ico_x { background-color: #000000; }
.ico_url { background-color: #95a5a6; font-size: 1.4rem; }
.ico_download { background-color: #e67e22; font-size: 1.2rem; }

.share_text {
  font-family: var(--font-body); /* Unified body font */
  font-size: 0.8rem;
  color: var(--text-color);
  font-weight: 500;
}

.score-container {
  display: flex;
  flex-direction: row; /* Single line */
  justify-content: center;
  align-items: baseline; /* Align by text baseline */
  gap: 15px; /* Space between label and score */
  margin-bottom: 5px; /* Reduced from 20px to 5px */
}

.score-label {
  font-family: var(--font-title);
  font-size: 2.8rem; /* Increased from 2.2rem */
  color: var(--primary-color);
}

.score-wrapper {
  display: flex;
  align-items: baseline;
}

.score {
  font-family: var(--font-title);
  font-size: 5.5rem; /* Increased from 4rem */
  color: var(--primary-color);
  line-height: 1;
}

.percent {
  font-family: var(--font-title);
  font-size: 2.8rem; /* Increased from 2.2rem */
  color: var(--primary-color);
  margin-left: 2px;
}

.result-title {
  font-family: var(--font-title);
  font-size: 2rem;
  color: var(--secondary-color);
  margin-top: 5px;
}

.result-title:empty {
  display: none; /* Hide if empty to remove unintended gaps */
}

.result-desc {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 600; /* Made slightly bolder */
  line-height: 1.6;
  color: var(--text-color);
  background: none; /* Removed gray background */
  padding: 0; /* Removed padding */
  border-radius: 0; /* Removed border-radius */
  width: 100%;
  word-break: keep-all;
  text-align: center; /* Center align text */
  margin-top: 0; /* Ensure no top margin */
}

.download-btn {
  margin-top: 20px;
  background-color: var(--primary-color);
  box-shadow: 0 4px 0 #b37e71, 0 8px 15px rgba(214, 153, 137, 0.4);
  font-family: var(--font-title);
}

.download-btn:hover {
  background-color: #cc8b7a;
}

.download-btn:active {
  transform: translateY(4px);
  box-shadow: 0 0px 0 #b37e71, 0 4px 10px rgba(214, 153, 137, 0.4);
}

footer {
  margin-top: 40px;
  font-size: 0.9rem;
  color: #888;
}

@media (max-width: 480px) {
  .title {
    font-size: 2.2rem;
    white-space: normal; /* Allow wrap if screen is very narrow */
    word-break: keep-all;
  }
  .score {
    font-size: 4rem;
  }
}