/* eastsea-hotdeal — Dark mode game deals (Phase 3) */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #1c2333;
  --bg-hover: #242d3d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --border-color: #30363d;
  --accent-green: #3fb950;
  --accent-red: #f85149;
  --accent-blue: #58a6ff;
  --accent-purple: #bc8cff;
  --accent-orange: #d29922;
  --accent-yellow: #f2cc60;
  --badge-free: #238636;
  --badge-lowest: #8957e5;
  --badge-hot: #da3633;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

header {
  padding: 2.5rem 0 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.logo {
  font-size: 2rem;
  font-weight: 700;
  font-family: 'Righteous', sans-serif;
  background: linear-gradient(135deg, #f85149 0%, #d29922 50%, #3fb950 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

.logo-icon { font-size: 2rem; }

.subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.update-time {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.home-link {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: color 0.2s;
}

.home-link:hover { color: var(--text-primary); }

.tab-nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  padding: 0 0.5rem;
}

.tab-btn {
  padding: 0.5rem 1.1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.84rem;
  font-weight: 500;
  font-family: inherit;
}

.tab-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent-blue);
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
}

.tab-btn .count {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  margin-left: 0.35rem;
}

/* Filter bar */
.filter-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.filter-check {
  font-size: 0.86rem;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  padding: 0.38rem 0.85rem;
}

.filter-check input {
  accent-color: var(--accent-green);
}

.sort-group {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.sort-label {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.sort-select {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  font-size: 0.84rem;
}

.deals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}

.deal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  overflow: hidden;
  transition: all 0.25s;
  display: flex;
  flex-direction: row;
  position: relative;
}

.deal-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-blue);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.deal-thumb {
  width: 140px;
  min-height: 130px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  position: relative;
  overflow: hidden;
}

.deal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.deal-thumb .no-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--text-muted);
}

.badges {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 2;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-free { background: var(--badge-free); color: #fff; }
.badge-lowest { background: var(--badge-lowest); color: #fff; }
.badge-hot { background: var(--badge-hot); color: #fff; }

.badge-history-low {
  background: linear-gradient(135deg, #f0c420, #f85149);
  color: #fff;
  font-weight: 700;
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 4px rgba(240, 196, 32, 0.4); }
  50% { box-shadow: 0 0 12px rgba(240, 196, 32, 0.8); }
}

.badge-upcoming { background: var(--accent-orange); color: #111; }

.deal-info {
  padding: 0.85rem 0.95rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.deal-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.33rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.deal-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.79rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

/* Review badges */
.review-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 9999px;
  padding: 0.16rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.review-gold {
  background: rgba(242, 204, 96, 0.18);
  border-color: rgba(242, 204, 96, 0.45);
  color: #f2cc60;
}

.review-positive {
  background: rgba(63, 185, 80, 0.16);
  border-color: rgba(63, 185, 80, 0.35);
  color: #4bc862;
}

.review-mixed {
  background: rgba(210, 153, 34, 0.16);
  border-color: rgba(210, 153, 34, 0.35);
  color: #f0b54a;
}

.review-negative {
  background: rgba(248, 81, 73, 0.16);
  border-color: rgba(248, 81, 73, 0.35);
  color: #ff8f89;
}

/* Korean language badge */
.badge-korean {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.15rem 0.48rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #8bd4ff;
  background: rgba(88, 166, 255, 0.14);
  border: 1px solid rgba(88, 166, 255, 0.34);
}

/* Metacritic badge */
.metacritic-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7rem;
  height: 1.3rem;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 800;
  border: 1px solid transparent;
}

.mc-good {
  color: #65d36e;
  background: rgba(63, 185, 80, 0.14);
  border-color: rgba(63, 185, 80, 0.35);
}

.mc-mixed {
  color: #f3cb5d;
  background: rgba(210, 153, 34, 0.14);
  border-color: rgba(210, 153, 34, 0.35);
}

.mc-bad {
  color: #ff8f89;
  background: rgba(248, 81, 73, 0.14);
  border-color: rgba(248, 81, 73, 0.35);
}

.deal-store { color: var(--text-muted); }

/* Sparkline area */
.sparkline-area {
  min-height: 42px;
  margin: 0.2rem 0 0.32rem;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.sparkline-canvas {
  display: block;
  opacity: 0.95;
}

.deal-price {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: auto;
}

.price-current {
  font-size: 1.24rem;
  font-weight: 700;
  color: var(--accent-green);
}

.price-current.free { color: var(--accent-green); }

.price-original {
  font-size: 0.86rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.price-cut {
  display: inline-block;
  background: var(--accent-green);
  color: #00160a;
  padding: 0.1rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.73rem;
  font-weight: 700;
  margin-left: auto;
}

.deal-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.5rem;
  color: var(--accent-blue);
  text-decoration: none;
  font-size: 0.79rem;
  font-weight: 500;
  transition: gap 0.2s;
}

.deal-link:hover {
  gap: 0.5rem;
  text-decoration: underline;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
  font-size: 1.125rem;
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.loading {
  text-align: center;
  padding: 4rem;
  color: var(--text-secondary);
}

.loading-spinner {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border-color);
}

footer a {
  color: var(--accent-blue);
  text-decoration: none;
}

footer a:hover { text-decoration: underline; }

.stats-bar {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
  color: var(--text-secondary);
  font-size: 0.79rem;
  flex-wrap: wrap;
}

.stats-bar .stat {
  display: flex;
  align-items: center;
  gap: 0.28rem;
}

.stats-bar .stat-value {
  color: var(--text-primary);
  font-weight: 600;
}

@media (max-width: 768px) {
  .container { padding: 0 1rem; }
  header { padding: 1.5rem 0 1rem; }
  .logo { font-size: 1.5rem; }

  .home-link {
    position: static;
    justify-content: center;
    margin-bottom: 0.5rem;
  }

  .deals-grid { grid-template-columns: 1fr; }
  .deal-thumb { width: 108px; min-height: 98px; }

  .tab-btn {
    padding: 0.38rem 0.86rem;
    font-size: 0.79rem;
  }

  .filter-bar {
    justify-content: center;
  }

  .sparkline-area {
    min-height: 38px;
  }
}

@media (max-width: 480px) {
  .deal-thumb { width: 90px; min-height: 90px; }
  .deal-title { font-size: 0.9rem; }
  .price-current { font-size: 1.08rem; }
  .tab-nav { gap: 0.35rem; }

  .review-badge,
  .badge-korean,
  .metacritic-badge {
    font-size: 0.67rem;
  }
}
