/* 복불복 내기 도구 — calculator 페이지와 동일 팔레트(블루), 모바일 우선 */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Malgun Gothic', sans-serif;
  background: #f5f5f5; color: #333; line-height: 1.55;
  padding-bottom: 130px; /* 하단 AdFit 고정 배너 여백 */
}

.site-header {
  background: linear-gradient(135deg, #2C3E50, #3498DB);
  color: #fff; padding: 22px 16px 26px; text-align: center;
}
.site-header h1 { font-size: 24px; margin-bottom: 6px; }
.site-header .subtitle { font-size: 14px; opacity: 0.9; }
.site-header nav { margin-top: 12px; font-size: 13px; }
.site-header nav a { color: #cfe7fa; text-decoration: none; margin: 0 8px; }
.site-header nav a:hover { text-decoration: underline; }

.container { max-width: 760px; margin: 0 auto; padding: 20px 14px; }

.section-title {
  font-size: 17px; font-weight: bold; color: #2C3E50;
  border-left: 4px solid #3498DB; padding-left: 12px; margin: 28px 0 12px;
}

/* 탭 */
.tabs { display: flex; gap: 8px; margin-top: -34px; }
.tab {
  flex: 1; padding: 12px 4px; font-size: 15px; font-weight: bold; cursor: pointer;
  border: none; border-radius: 12px 12px 0 0; background: #dbe6ef; color: #5c7288;
  touch-action: manipulation;
}
.tab.active { background: #fff; color: #2C3E50; box-shadow: 0 -2px 8px rgba(0,0,0,0.06); }

.tool-panel {
  background: #fff; border-radius: 0 0 12px 12px; padding: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: #555; margin-bottom: 4px; font-weight: bold; }
.field input[type="text"] {
  width: 100%; font-size: 16px; padding: 10px 12px;
  border: 2px solid #BDE0F5; border-radius: 10px; outline: none;
}
.field input[type="text"]:focus { border-color: #3498DB; }
.hint { font-size: 12px; color: #999; margin-top: 3px; }

.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.presets button {
  border: 1px solid #BDE0F5; background: #EBF5FB; color: #2980B9;
  border-radius: 14px; padding: 5px 12px; font-size: 13px; cursor: pointer;
}
.presets button:hover { background: #D6EAF8; }

.btn {
  border: 1px solid #3498DB; background: #fff; color: #2980B9;
  border-radius: 10px; padding: 10px 18px; font-size: 15px; cursor: pointer;
  touch-action: manipulation;
}
.btn.primary { background: #3498DB; color: #fff; font-weight: bold; }
.btn.primary:active { background: #2C81BA; }
.btn.big { width: 100%; padding: 13px 0; font-size: 17px; }

/* 사다리 */
#ladder-stage { margin-top: 16px; }
#ladder-top, #ladder-bottom { display: flex; justify-content: space-between; gap: 4px; }
.name-chip {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: #fff; border: 2px solid #3498DB; border-radius: 8px;
  font-size: 12px; font-weight: bold; padding: 6px 2px; cursor: pointer;
}
.name-chip.done { opacity: 0.45; }
.slot-chip {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-align: center; font-size: 12px; font-weight: bold; color: #888;
  background: #F0F3F5; border-radius: 8px; padding: 6px 2px;
}
.slot-chip.hit { background: #FDEBD0; color: #CA6F1E; }
.slot-chip.miss { background: #EAECEE; color: #99A3A4; }
.canvas-wrap { display: flex; justify-content: center; margin: 6px 0; }
#ladder-actions { margin-top: 10px; display: flex; gap: 8px; }
#ladder-actions .btn { flex: 1; }
.stage-tip { font-size: 12px; color: #999; text-align: center; margin-top: 6px; }

/* 돌림판 */
#wheel-stage { margin-top: 16px; text-align: center; }
.wheel-winner {
  font-size: 26px; font-weight: bold; color: #2C3E50; text-align: center;
  background: #FEF9E7; border: 2px dashed #F1C40F; border-radius: 12px; padding: 16px;
}

/* 제비뽑기 */
#draw-stage { margin-top: 16px; }
#draw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.draw-card {
  height: 100px; border: none; border-radius: 10px; cursor: pointer;
  background: linear-gradient(135deg, #2C3E50, #3498DB); color: #fff;
  font-size: 22px; font-weight: bold; touch-action: manipulation;
  transition: transform 0.15s;
}
.draw-card:not(.flip):hover { transform: translateY(-3px); }
.draw-card.flip { background: #F8FAFB; border: 2px solid #d8dde2; cursor: default; }
.draw-card .card-back { color: #7f8c8d; font-size: 15px; word-break: keep-all; }
.draw-card .card-back.hit { color: #CA6F1E; }

/* 결과 패널 + 광고 */
.result-panel {
  margin-top: 16px; background: #F8FAFB; border: 1px solid #e0e6ea;
  border-radius: 12px; padding: 16px; text-align: center;
}
.result-title { font-size: 17px; font-weight: bold; color: #2C3E50; margin-bottom: 10px; }
.result-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
.result-table td { border-bottom: 1px solid #eef2f4; padding: 8px 12px; font-size: 14px; }
.result-table td:first-child { font-weight: bold; color: #2C3E50; text-align: left; }
.result-table td:last-child { text-align: right; color: #99A3A4; }
.result-table td.hit { color: #CA6F1E; font-weight: bold; }
.result-actions { display: flex; gap: 8px; margin-top: 12px; }
.result-actions .btn { flex: 1; }
.ad-wrap { margin-top: 18px; display: flex; justify-content: center; min-height: 0; }

/* 설명/FAQ */
.info-card {
  background: #fff; border-radius: 10px; padding: 16px 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06); margin-bottom: 12px; font-size: 14px;
}
.info-card h3 { font-size: 15px; color: #2C3E50; margin-bottom: 6px; }
.info-card p + p { margin-top: 8px; }
.info-card ul { padding-left: 20px; }
.info-card li { margin: 4px 0; }

.site-footer { text-align: center; font-size: 12px; color: #888; padding: 24px 16px 8px; }
.site-footer a { color: #2980B9; text-decoration: none; }

@media (min-width: 768px) {
  body { padding-bottom: 120px; }
  .name-chip, .slot-chip { font-size: 13px; }
}
