/* 두뇌 실험실 — calculator/pick/test 페이지와 동일 팔레트(블루), 모바일 우선 */
* { 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; word-break: keep-all; }
.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;
}

/* 게임 목록 */
.home-intro { text-align: center; font-size: 14px; color: #666; margin-bottom: 14px; word-break: keep-all; }
.game-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.game-card {
  background: #fff; border: 1px solid #e0e6ea; border-radius: 14px;
  padding: 18px 14px; text-align: center; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); touch-action: manipulation;
  transition: transform 0.12s, box-shadow 0.12s; font-family: inherit;
}
.game-card:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(52,152,219,0.18); }
.game-card .g-icon { font-size: 40px; line-height: 1.2; }
.game-card .g-tag {
  display: inline-block; font-size: 11px; font-weight: bold; color: #2980B9;
  background: #EBF5FB; border-radius: 10px; padding: 2px 10px; margin: 6px 0 4px;
}
.game-card h3 { font-size: 16px; color: #2C3E50; margin-bottom: 4px; }
.game-card p { font-size: 12px; color: #888; word-break: keep-all; }
.game-card .g-best { font-size: 11px; color: #aab4bc; margin-top: 8px; }

/* 게임 진행 화면 */
#view-game { background: #fff; border-radius: 14px; padding: 18px 16px 22px; box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
.game-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
#game-title { font-size: 15px; font-weight: bold; color: #2C3E50; }
#game-quit { border: none; background: none; color: #99A3A4; font-size: 13px; cursor: pointer; padding: 4px; }
.g-info { font-size: 13px; color: #666; text-align: center; word-break: keep-all; margin-bottom: 10px; }
.rx-meta { text-align: center; font-size: 13px; color: #3498DB; font-weight: bold; margin-bottom: 12px; min-height: 20px; }

/* 반응속도 */
.rx-area {
  width: 100%; min-height: 300px; border: none; border-radius: 14px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  color: #fff; transition: background 0.1s;
}
.rx-area .rx-main { font-size: 34px; font-weight: bold; }
.rx-area .rx-sub { font-size: 14px; opacity: 0.9; padding: 0 14px; word-break: keep-all; }
.rx-area.idle { background: #3498DB; }
.rx-area.wait { background: #E74C3C; }
.rx-area.go { background: #27AE60; }
.rx-area.early { background: #E67E22; }
.rx-area.between { background: #5DADE2; }
.rx-area.done { background: #2C3E50; }

/* 숫자 기억 */
.num-box { min-height: 220px; display: flex; align-items: center; justify-content: center; }
.num-display {
  font-size: 44px; font-weight: bold; color: #2C3E50; letter-spacing: 6px;
  font-variant-numeric: tabular-nums; text-align: center; word-break: break-all; padding: 0 8px;
}
.num-ok { font-size: 20px; font-weight: bold; color: #27AE60; }
.num-form { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 340px; }
.num-input {
  width: 100%; padding: 14px; font-size: 22px; text-align: center; letter-spacing: 4px;
  border: 2px solid #BDE0F5; border-radius: 12px; font-family: inherit;
  font-variant-numeric: tabular-nums;
}
.num-input:focus { outline: none; border-color: #3498DB; }

/* 순서 기억 */
.seq-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  max-width: 340px; margin: 0 auto;
}
.seq-grid.locked .seq-tile { cursor: default; }
.seq-tile {
  aspect-ratio: 1; border: none; border-radius: 12px; background: #D6EAF8;
  cursor: pointer; touch-action: manipulation; transition: background 0.12s;
}
.seq-tile.lit { background: #3498DB; }
.seq-tile.good { background: #27AE60; }
.seq-tile.bad { background: #E74C3C; }

/* 색감 구별 */
.chroma-grid { display: grid; gap: 6px; max-width: 380px; margin: 0 auto; }
.chroma-tile {
  aspect-ratio: 1; border: none; border-radius: 10px; cursor: pointer;
  touch-action: manipulation;
}
.chroma-tile.reveal { outline: 4px solid #2C3E50; outline-offset: -4px; }

/* 결과 카드 */
.result-card {
  background: #fff; border-radius: 16px; padding: 22px 18px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08); text-align: center;
}
.result-badge {
  display: inline-block; font-size: 12px; font-weight: bold; color: #fff;
  background: linear-gradient(135deg, #2C3E50, #3498DB); border-radius: 12px; padding: 4px 14px;
}
.result-emoji { font-size: 64px; line-height: 1.3; margin-top: 10px; }
.result-name { font-size: 22px; font-weight: bold; color: #2C3E50; word-break: keep-all; }
.result-score { font-size: 34px; font-weight: bold; color: #3498DB; margin-top: 4px; font-variant-numeric: tabular-nums; }
.result-test { font-size: 13px; color: #99A3A4; margin-top: 4px; }
.result-msg { font-size: 14px; color: #444; word-break: keep-all; margin-top: 12px; }
.result-detail { font-size: 12px; color: #99A3A4; margin-top: 8px; word-break: break-all; }
.result-best {
  margin-top: 14px; background: #F8FAFB; border: 1px solid #e0e6ea; border-radius: 10px;
  padding: 10px 14px; font-size: 13px; color: #2C3E50; word-break: keep-all;
}
.result-best.new { background: #FEF9E7; border-color: #F1C40F; font-weight: bold; }
.result-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.btn {
  border: 1px solid #3498DB; background: #fff; color: #2980B9;
  border-radius: 10px; padding: 12px 18px; font-size: 15px; cursor: pointer;
  touch-action: manipulation; font-family: inherit;
}
.btn.primary { background: #3498DB; color: #fff; font-weight: bold; }
.btn.primary:active { background: #2C81BA; }
.ad-wrap { margin-top: 18px; display: flex; justify-content: center; min-height: 0; }

/* 다른 게임 추천 */
.other-tests { margin-top: 16px; text-align: center; }
.other-title { font-size: 14px; font-weight: bold; color: #2C3E50; margin-bottom: 8px; }
.other-btn {
  display: block; width: 100%; margin: 6px 0; padding: 12px; font-size: 14px;
  background: #fff; border: 1px solid #BDE0F5; border-radius: 10px; color: #2C3E50;
  cursor: pointer; touch-action: manipulation; font-family: inherit; word-break: keep-all;
}
.other-btn:hover { background: #EBF5FB; }

/* 설명/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 { word-break: keep-all; }
.info-card p + p { margin-top: 8px; }
.info-card ul { padding-left: 20px; }
.info-card li { margin: 4px 0; word-break: keep-all; }
.type-list { font-size: 13px; color: #555; word-break: keep-all; }

.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; }
  .game-grid { grid-template-columns: repeat(4, 1fr); }
  .result-actions { flex-direction: row; }
  .result-actions .btn { flex: 1; }
}
