

* { box-sizing: border-box; }

/* =====================
   THEME VARIABLES
===================== */
:root {
  --bg-main: radial-gradient(circle at top, #1e293b, #020617);
  --card-bg: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  --card-soft: rgba(255,255,255,0.12);
  --text-main: #ffffff;
  --text-sub: #cbd5f5;
  --border-soft: rgba(255,255,255,0.15);
}

[data-theme="light"] {
  --bg-main: linear-gradient(180deg, #f8fafc, #e5e7eb);
  --card-bg: #ffffff;
  --card-soft: #e2e8f0;
  --text-main: #020617;
  --text-sub: #334155;
  --border-soft: #cbd5e1;
}

/* =====================
   BASE
===================== */
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui;
  background: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  transition: background 0.4s ease, color 0.4s ease;
  padding: 40px 0;
}

.main-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.container {
  width: 100%;
  max-width: 760px;
  padding: 40px;
  border-radius: 20px;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
  position: relative;
}

.header-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px; /* Add some margin to separate it from the subtitle */
}

/* =====================
   HEADER
===================== */
h1 {
  margin: 0;
  font-size: 42px;
  font-weight: 800;
}

.subtitle {
  margin-top: 10px;
  color: var(--text-sub);
}

.main-link {
    color: var(--text-main);
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    padding: 10px 16px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    transition: background-color 0.2s ease;
}

.main-link:hover {
    background-color: var(--card-soft);
}

/* =====================
   THEME TOGGLE
===================== */
.theme-toggle {
  /* position: absolute; */
  /* top: 24px; */
  /* right: 24px; */
  background: none;
  border: 1px solid var(--border-soft);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
}

/* =====================
   MAIN BUTTON
===================== */
button.main {
  margin-top: 30px;
  padding: 18px 30px;
  font-size: 18px;
  font-weight: 700;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  color: #020617;
  background: linear-gradient(135deg, #facc15, #fde047);
  box-shadow: 0 10px 30px rgba(250,204,21,0.5);
}

/* =====================
   RESULTS
===================== */
.results {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 카드 단위 */
.set-card {
  background: var(--card-soft);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 16px 18px 18px;
  animation: fadeUp 0.6s ease forwards;
  transition: transform .2s ease, box-shadow .2s ease;
}

.set-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
}

/* 카드 헤더 */
.set-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.set-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  color: white;
}

/* 번호 줄 */
.set {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ball {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #020617;
}

/* 번호대별 색상 */
.yellow { background: radial-gradient(circle at top, #fff9c2, #facc15); box-shadow: 0 0 12px rgba(250,204,21,.9); }
.blue   { background: radial-gradient(circle at top, #dbeafe, #60a5fa); box-shadow: 0 0 12px rgba(96,165,250,.9); }
.red    { background: radial-gradient(circle at top, #fee2e2, #f87171); box-shadow: 0 0 12px rgba(248,113,113,.9); }
.gray   { background: radial-gradient(circle at top, #d1d5db, #9ca3af); box-shadow: 0 0 12px rgba(156,163,175,.9); }
.green  { background: radial-gradient(circle at top, #dcfce7, #4ade80); box-shadow: 0 0 12px rgba(74,222,128,.9); }

/* =====================
   FOOTER
===================== */
.logic {
  margin-top: 40px;
  font-size: 14px;
  color: var(--text-sub);
}

footer {
  margin-top: 30px;
  font-size: 12px;
  color: var(--text-sub);
  text-align: center;
}

/* =====================
   ANIMATION
===================== */
 @keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =====================
   FORM STYLES
===================== */
.form-container {
    width: 100%;
    max-width: 760px;
    padding: 40px;
}

.form-container h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: var(--text-sub);
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    background-color: var(--card-soft);
    color: var(--text-main);
    font-size: 16px;
    font-family: 'Inter', system-ui;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #facc15;
    box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.3);
}

#form-status {
    margin-top: 20px;
    font-size: 14px;
}

.form-container button.main {
    padding: 14px 24px;
    font-size: 16px;
    box-shadow: 0 5px 20px rgba(250,204,21,0.4);
}


/* =====================
   RESPONSIVE
===================== */
 @media (max-width: 768px) {
  .container, .form-container { padding: 28px; }
  h1 { font-size: 32px; }
  .ball { width: 44px; height: 44px; font-size: 16px; }
}

 @media (max-width: 480px) {
  .container, .form-container { padding: 20px; border-radius: 16px; }
  h1 { font-size: 26px; }
  .subtitle { font-size: 14px; }
  .ball { width: 40px; height: 40px; font-size: 15px; }
  .theme-toggle { top: 16px; right: 16px; font-size: 12px; }
}
/* =====================
   ANIMAL TEST
===================== */
.result-container {
    margin-top: 40px;
    display: flex;
    gap: 40px;
    align-items: center;
    justify-content: center;
}

#webcam-container canvas {
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.label-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
}

/* =====================
   HOW-TO SECTION
===================== */
.how-to-list {
  padding-left: 20px;
  list-style: none;
  counter-reset: how-to-counter;
}

.how-to-list li {
  counter-increment: how-to-counter;
  margin-bottom: 20px;
  position: relative;
  padding-left: 40px;
}

.how-to-list li::before {
  content: counter(how-to-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #facc15, #fde047);
  color: #020617;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.color-guide {
  list-style: none;
  padding-left: 0;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.color-guide li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 0;
  margin-bottom: 0;
}

.color-guide li::before {
  display: none;
}

.ball-small {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

/* =====================
   SHARE BUTTONS
===================== */
.share-buttons-container {
  margin-top: 30px;
  text-align: center;
}

.share-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  justify-content: center;
}

.share-button {
  background: none;
  border: 1px solid var(--border-soft);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.share-button:hover {
  background-color: var(--card-soft);
}

.share-button img {
  width: 20px;
  height: 20px;
}

