/* 웹폰트 설정 */
@font-face {
    font-family: 'GangwonEduSaeeum_OTFMediumA';
    src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_2201-2@1.0/GangwonEduSaeeum_OTFMediumA.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --text-color: #111111;
  --accent-color: #ff3b58;
  --panel: #f5f5f7;
  --border: #ececf0;
  --card-surface: #f8f8fb;
  --input-surface: #f3f4f8;
  --shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: #ffffff;
  color: var(--text-color);
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}

body { 
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* NAV */

nav {
    position: fixed;  /* 🔥 화면 상단에 고정 */
    top: 0;
    left: 0;
    width: 100%;  /* 🔥 전체 너비 사용 */
    background-color: #f4f4f4;
    padding: 10px 0;  /* 🔥 위아래 여백 설정 */
    z-index: 1000;  /* 🔥 다른 요소보다 위로 배치 */
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: flex-end;
    margin: 0;
    padding: 0;
    padding-right: 20px; /* 🔥 오른쪽 정렬 시 여백 추가 */
}

nav ul li {
    display: inline;
}

nav ul li a {
    color: rgb(62, 62, 62);
    text-decoration: none;
    padding: 8px 12px;
    font-size: 14px;
    font-family: 'GangwonEduSaeeum_OTFMediumA', Arial, sans-serif;
}

nav ul li a:hover {
    background-color: #555;
    color: white;
}


/* ADS */
.ad-container {
    width: 100%;
    height: auto; /* 가변 크기 설정 */
    min-height: 90px; /* 최소 높이 유지 */
    display: flex; 
    justify-content: center; /* 중앙 정렬 */
    align-items: center; /* 광고가 중앙에 위치하도록 설정 */
    overflow: auto; /* 광고가 넘칠 경우 숨김 */
    margin-top: 60px; /* 🔥 광고 위아래로 20px 간격 추가 */
    margin-bottom: 20px; /* 🔥 광고 위아래로 20px 간격 추가 */
}
.adsbygoogle {
    display: block;
    width: 100%;
    height: auto !important; /* 광고 높이 자동 조정 */
}

.footer-ad-container {
    width: 100%;
    min-height: 90px; /* 🔥 하단 광고 공간 확보 */
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
    margin-top: 30px; /* 🔥 광고 위아래로 20px 간격 추가 */
}

/* APP SHELL */
.run-lab {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 12px;
}

.app-shell {
  width: 360px;
  min-height: 550px;
  height: auto;
  background: #ffffff;
  border-radius: 32px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 12px;
}

/* CONTROL PANEL */
.control-panel {
  background: var(--panel);
  border-radius: 20px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-head p:first-child {
  font-size: 18px;
  font-weight: 700;
}

.panel-desc {
  font-size: 12px;
  color: #6b7280;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.panel-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: #6b7280;
}

.panel-field select,
.panel-field input[type="color"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 6px;
  font-size: 12px;
  background: #ffffff;
}

.panel-toggles {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #4b5563;
}

/* INPUT FIELDS */
.input-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.input-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: #6b7280;
}

.input-field input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 6px 8px;
  font-size: 12px;
  background: var(--input-surface);
  color: #374151;
}

.input-field input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 59, 88, 0.35);
  border-color: var(--accent-color);
}

/* BUTTONS */
.action-row {
  display: flex;
  gap: 8px;
}

.primary-btn,
.ghost-btn {
  flex: 1;
  border-radius: 999px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 12px;
  cursor: pointer;
}

.primary-btn {
  background: var(--accent-color);
  color: #ffffff;
}

.ghost-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: #6b7280;
}

/* RESULT CARD (NRC STYLE) */
.record-card {
  flex: 1;
  background: #ffffff;
  border-radius: 24px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: none;
}

/* DISTANCE */
.distance-number {
  font-size: 64px;
  font-weight: 800;
  color: #111111;
}

/* METRICS GRID */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

/* METRIC (NRC 완전 화이트, 테두리/배경 없음) */
.metric {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 10px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* METRIC TEXT */
.metric-value {
  font-size: 20px;
  font-weight: 700;
  color: #111111;
  line-height: 1.2;
}

.metric-label {
  font-size: 12px;
  font-weight: 500;
  color: #9ca3af;
  margin-top: 4px;
}

/* HELP */
.helper-text {
  font-size: 11px;
  color: #9ca3af;
  text-align: center;
}

/* COUPANG */
.coupang-slot {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: auto;
  margin-bottom: 16px;
}

/* HIDDEN */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.ad-container {
  margin-top: 48px !important;
}

/* ANIMATIONS */
@keyframes bounce {
  0% { transform: translateY(10px); opacity: 0; }
  40% { transform: translateY(-12px); opacity: 1; }
  70% { transform: translateY(4px); }
  100% { transform: translateY(0); }
}
@keyframes snap {
  0% { transform: scale(0.95); opacity: 0; }
  60% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes smooth-rise {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}
