/* Paperlogy 웹폰트 (jsDelivr CDN) */
@font-face {
  font-family: 'Paperlogy';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-4Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Paperlogy';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-7Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ============================================
   공통 템플릿 스타일 — 10개 사이트 공용
   색상 변수만 바꾸면 사이트별 테마 변경 가능
   ============================================ */
:root {
  --bg: #0f172a;
  --card: #1e293b;
  --card-2: #273449;
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --accent: #22c55e;
  --border: #334155;
  --radius: 14px;
  --maxw: 720px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Paperlogy', -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* 헤더 */
.site-header { padding: 32px 0 24px; text-align: center; }
.site-header h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; }
.subtitle { color: var(--text-dim); margin-top: 8px; font-size: 0.95rem; }

/* 카드 */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 16px 0;
}
.card h2 { font-size: 1.2rem; margin-bottom: 16px; }
.card h3 { font-size: 1.05rem; margin: 20px 0 10px; }

/* 입력 필드 */
.field { margin-bottom: 16px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
label { display: block; font-size: 0.9rem; color: var(--text-dim); margin-bottom: 6px; font-weight: 600; }
input[type="text"], input[type="number"], select {
  width: 100%;
  padding: 12px 14px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.15s;
}
input:focus, select:focus { outline: none; border-color: var(--primary); }
.hint { font-size: 0.78rem; color: var(--text-dim); margin-top: 5px; }

/* 체크박스 옵션 */
.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 8px;
  cursor: pointer;
}
.check-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--primary);
  cursor: pointer;
}
.check-label span { font-weight: 600; }

/* 버튼 */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 8px;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
  width: 100%;
  padding: 12px;
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-top: 10px;
}
.btn-secondary:hover { border-color: var(--primary); background: #2d3a52; }
.btn-secondary:active { transform: translateY(1px); }

/* 결과 강조 */
.result-highlight {
  text-align: center;
  background: linear-gradient(135deg, rgba(34,197,94,0.12), rgba(99,102,241,0.12));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}
.result-label { display: block; color: var(--text-dim); font-size: 0.9rem; }
.result-value { display: block; font-size: 2.2rem; font-weight: 800; color: var(--accent); margin-top: 6px; }

/* 게임: 입력 행 */
.guess-row { display: flex; gap: 10px; align-items: flex-end; }
.guess-row .field { flex: 1; margin-bottom: 0; }
.guess-row .btn-primary { width: auto; flex: 0 0 auto; margin-top: 0; padding: 12px 22px; }

/* 게임 상태 표시줄 */
.game-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.92rem;
}
.game-status .status-item span { color: var(--text-dim); }
.game-status .status-item strong { color: var(--text); margin-left: 6px; font-variant-numeric: tabular-nums; }

/* 게임 메시지 */
.game-message {
  text-align: center;
  font-weight: 700;
  padding: 14px;
  border-radius: 10px;
  margin-bottom: 16px;
}
.game-message.win { background: rgba(34,197,94,0.15); color: var(--accent); border: 1px solid rgba(34,197,94,0.4); }
.game-message.info { background: var(--card-2); color: var(--text-dim); border: 1px solid var(--border); }
.game-message.error { background: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.4); }
.game-message.lose { background: rgba(239,68,68,0.18); color: #fca5a5; border: 1px solid rgba(239,68,68,0.45); }

/* 시도 기록 리스트 */
.history-list { list-style: none; margin: 0; padding: 0; }
.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.history-item .try-no {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 50%;
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 700;
}
.history-item .try-guess {
  flex: 1;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}
.history-item .try-result { flex: 0 0 auto; display: flex; gap: 6px; }
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}
.badge.strike { background: rgba(34,197,94,0.18); color: #4ade80; }
.badge.ball { background: rgba(99,102,241,0.18); color: #a5b4fc; }
.badge.out { background: rgba(148,163,184,0.15); color: var(--text-dim); }
.badge.hit { background: rgba(234,179,8,0.18); color: #fde047; }

.history-empty { color: var(--text-dim); font-size: 0.9rem; text-align: center; padding: 12px 0; }

/* 콘텐츠 영역 */
.content p { margin-bottom: 12px; color: var(--text); }
.content ul { margin: 10px 0 16px 20px; }
.content li { margin-bottom: 6px; }
.content details {
  background: var(--card-2); border-radius: 10px; padding: 12px 16px; margin-bottom: 10px;
}
.content summary { cursor: pointer; font-weight: 600; }
.content details p { margin-top: 10px; color: var(--text-dim); }

/* 광고 슬롯 */
.ad-slot {
  position: relative;
  min-height: 100px;
  background: repeating-linear-gradient(45deg, #1a2438, #1a2438 10px, #1c2740 10px, #1c2740 20px);
  border: 1px dashed var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px auto;
}
.ad-top { margin-top: 8px; }
.ad-inline { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.ad-label { font-size: 0.72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }

/* 푸터 */
.site-footer { padding: 32px 0 40px; text-align: center; border-top: 1px solid var(--border); margin-top: 24px; }
.footer-tools { font-size: 0.88rem; color: var(--text-dim); margin-bottom: 12px; }
.footer-tools a:not(.tool-chip) { color: var(--primary); text-decoration: none; margin: 0 8px; }
.footer-tools a:not(.tool-chip):hover { text-decoration: underline; }
.copyright { font-size: 0.8rem; color: var(--text-dim); }

/* 반응형 */
@media (max-width: 480px) {
  .site-header h1 { font-size: 1.4rem; }
  .result-value { font-size: 1.8rem; }
  .field-row { flex-direction: column; gap: 0; }
  .guess-row { flex-direction: column; align-items: stretch; }
  .guess-row .btn-primary { width: 100%; margin-top: 8px; }
}

/* ===== 푸터 도구·게임 칩 (이모지 나열형) ===== */
.footer-tools-title { font-size: 0.95rem; font-weight: 700; color: var(--text); margin-bottom: 14px; }
.tool-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tool-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--card-2, #273449);
  border: 1px solid var(--border, #334155);
  border-radius: 999px;
  color: var(--text, #e2e8f0);
  font-size: 0.86rem; font-weight: 600;
  text-decoration: none;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.tool-chip:hover {
  transform: translateY(-2px);
  border-color: var(--primary, #6366f1);
  background: var(--card, #1e293b);
}
.tool-chip .chip-emoji { font-size: 1.05rem; line-height: 1; }
@media (max-width: 480px) {
  .tool-chip { padding: 7px 11px; font-size: 0.8rem; }
}

/* 푸터 칩 카테고리 분류 */
.chip-group { margin-bottom: 16px; }
.chip-cat {
  display: block; font-size: 0.82rem; font-weight: 700;
  color: var(--text-dim, #94a3b8); margin-bottom: 10px;
  letter-spacing: 0.02em;
}
.chip-group:last-child { margin-bottom: 0; }
