/* =========================
   History UI (히스토리)
========================= */

#history-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: currentColor;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

#history-btn:hover {
  background-color: rgba(0,0,0,0.05);
  transform: scale(1.05);
}

body.dark-mode #history-btn:hover {
  background-color: rgba(255,255,255,0.08);
}

/* 아이콘 */
#history-btn img {
  width: 22px;
  height: 22px;
  filter: brightness(0.9);
}

body.dark-mode #history-btn img {
  filter: brightness(1.1);
}

/* ===== 히스토리 모달 ===== */
.history-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 420px;
  max-width: 92%;
  max-height: 75vh;
  transform: translate(-50%, -50%);
  background-color: #ffffff;
  color: #000;
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  z-index: 3000;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

body.dark-mode .history-modal {
  background-color: #111827;
  color: #e5e7eb;
}

/* 헤더 */
.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #ddd;
  font-weight: bold;
}

body.dark-mode .history-header {
  border-color: #374151;
}

.history-close-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: inherit;
}

/* 내용 */
.history-content {
  padding: 14px 16px;
  overflow-y: auto;
  font-size: 14px;
}

/* 날짜 제목 */
.history-date {
  font-weight: bold;
  margin-bottom: 10px;
  font-size: 15px;
}

/* 게임 박스 */
.history-group {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background-color: #f3f4f6;
}

body.dark-mode .history-group {
  background-color: #1f2937;
}

.history-game-title {
  font-weight: 600;
  margin-bottom: 6px;
}

/* 키워드 리스트 */
.history-keyword {
  padding-left: 6px;
  font-size: 13px;
  color: #333;
}

body.dark-mode .history-keyword {
  color: #d1d5db;
}

/* 총 횟수 */
.history-count {
  margin-top: 6px;
  font-size: 12px;
  color: #555;
}

body.dark-mode .history-count {
  color: #9ca3af;
}

/* 비어있을 때 */
.history-empty {
  text-align: center;
  opacity: 0.6;
  padding: 30px 0;
}
