:root {
  --bg: #0b0d14;
  --surface: #131722;
  --surface-2: #1a2030;
  --border: rgba(255, 255, 255, 0.09);
  --text: #f8fafc;
  --text-sub: #94a3b8;
  --text-muted: #64748b;
  --amber: #ff6b00;
  --amber-light: #f59e0b;
  --amber-soft: rgba(255, 107, 0, 0.14);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: rgba(15, 23, 42, 0.09);
  --text: #0f172a;
  --text-sub: #475569;
  --text-muted: #64748b;
  --amber: #ea580c;
  --amber-light: #f59e0b;
  --amber-soft: rgba(234, 88, 12, 0.1);
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  transition: background 0.25s ease, color 0.25s ease;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 18px;
}

/* Sticky Header */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 13, 20, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .sticky-header {
  background: rgba(248, 250, 252, 0.88);
}

.header-inner {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon { font-size: 24px; }
.logo-text-wrap { display: flex; flex-direction: column; line-height: 1.15; }
.logo-title { font-size: 17px; font-weight: 900; letter-spacing: -0.02em; }
.logo-sub { font-size: 10px; font-weight: 700; color: var(--amber-light); letter-spacing: 0.08em; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-header-cta {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 13px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s ease;
}
.btn-header-cta:hover {
  border-color: var(--amber);
  color: var(--amber-light);
}

.main-content {
  padding-top: 26px;
  padding-bottom: 64px;
}

/* Intro + 스낵 도감 */
.intro-strip {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
}
.intro-copy h1 {
  font-size: clamp(22px, 3.2vw, 30px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.28;
  margin-bottom: 6px;
}
.amber-text { color: var(--amber-light); }
.intro-copy p {
  font-size: 15px;
  color: var(--text-sub);
}

.snack-dex-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 15px 18px;
  box-shadow: var(--shadow);
}
.dex-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 8px;
}
.dex-label { font-weight: 700; color: var(--text-sub); }
.dex-top strong { color: var(--amber-light); }
.dex-bar-track {
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}
.dex-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--amber), var(--amber-light));
  border-radius: 999px;
  transition: width 0.4s ease;
}
.dex-stamps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.dex-stamp {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.dex-stamp.done {
  background: var(--amber-soft);
  color: var(--amber-light);
  border-color: rgba(245, 158, 11, 0.4);
}

/* 히어로 추천 스낵 */
.hero-featured {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 28px;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--amber), var(--amber-light));
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.hero-content h2 {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.hero-content p {
  font-size: 15px;
  color: var(--text-sub);
  margin-bottom: 12px;
}
.hero-meta {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 20px;
}
.btn-play-hero {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--amber), var(--amber-light));
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  padding: 13px 24px;
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(255, 107, 0, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-play-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(255, 107, 0, 0.45);
}

.hero-art-card {
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  background: #0f172a;
  border: 2px solid rgba(245, 158, 11, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.hero-art-card .illus-svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.hero-featured:hover .hero-art-card .illus-svg {
  transform: scale(1.04);
}
.art-glow {
  position: absolute;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(255, 107, 0, 0.35), transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.art-emoji { font-size: 48px; position: relative; z-index: 1; margin-bottom: 6px; }
.art-label { font-size: 13px; font-weight: 900; letter-spacing: 0.1em; color: #fbbf24; position: relative; z-index: 1; }
.art-sub { font-size: 12px; color: #cbd5e1; position: relative; z-index: 1; margin-top: 3px; }

/* 카테고리 필터 바 */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.category-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.category-pills::-webkit-scrollbar { display: none; }

.pill {
  white-space: nowrap;
  background: var(--surface);
  color: var(--text-sub);
  border: 1px solid var(--border);
  padding: 9px 15px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s ease;
}
.pill:hover { border-color: var(--amber); color: var(--text); }
.pill.active {
  background: var(--amber);
  color: #fff;
  border-color: var(--amber);
}

.sort-select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
}

/* 게임 카드 그리드 (모바일 1열 / PC 3열) */
.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 46px;
}

.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.game-card:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: var(--shadow);
}
.game-card.is-soon { opacity: 0.78; }

.card-thumb {
  aspect-ratio: 16 / 9;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0f172a;
}
.thumb-illus {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.illus-svg {
  width: 100%;
  height: 100%;
  display: block;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.game-card:hover .illus-svg {
  transform: scale(1.06);
}
.thumb-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, transparent 45%, rgba(0, 0, 0, 0.22) 100%);
  pointer-events: none;
}
@keyframes floatCoin {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
}
.illus-float {
  animation: floatCoin 2.8s ease-in-out infinite;
}
.thumb-amber { background: linear-gradient(135deg, #451a03, #9a3412); }
.thumb-purple { background: linear-gradient(135deg, #2e1065, #6d28d9); }
.thumb-cyan { background: linear-gradient(135deg, #083344, #0e7490); }
.thumb-emerald { background: linear-gradient(135deg, #022c22, #047857); }
.thumb-pink { background: linear-gradient(135deg, #500724, #be185d); }

.thumb-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  font-size: 11px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 7px;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.badge-best { background: #ef4444; }
.badge-new { background: #10b981; }
.badge-soon { background: rgba(15, 23, 42, 0.85); color: #cbd5e1; border: 1px solid rgba(255, 255, 255, 0.15); }

.thumb-played-mark {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.95);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.thumb-emoji { font-size: 38px; margin-bottom: 4px; }
.thumb-sub { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; color: rgba(255, 255, 255, 0.8); }

.card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card-cat {
  font-size: 11px;
  font-weight: 700;
  color: var(--amber-light);
  margin-bottom: 4px;
}
.card-title {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.card-summary {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 14px;
  flex: 1;
}
.card-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.card-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
}
.card-btn-live {
  background: var(--amber-soft);
  color: var(--amber-light);
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.card-btn-live:hover {
  background: var(--amber);
  color: #fff;
}
.card-btn-soon {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* 공략/세계관 가이드 (SEO & 애드센스) */
.guide-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px;
}
.guide-header { margin-bottom: 18px; }
.guide-header h2 { font-size: 19px; font-weight: 800; margin-bottom: 4px; }
.guide-header p { font-size: 13px; color: var(--text-sub); }

.accordion-list { display: flex; flex-direction: column; gap: 10px; }
.acc-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.acc-trigger {
  width: 100%;
  background: transparent;
  color: var(--text);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
}
.acc-panel {
  padding: 0 16px 16px;
  font-size: 13px;
  color: var(--text-sub);
  display: none;
}
.acc-item.open .acc-panel { display: block; }
.acc-panel ul { padding-left: 18px; margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }

/* 푸터 */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 26px 0;
  font-size: 13px;
  color: var(--text-muted);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-links { display: flex; gap: 16px; }
.footer-links a:hover { color: var(--amber-light); }

/* 모달 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 13, 0.78);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.hidden { display: none !important; }
.modal-box {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.modal-close {
  background: transparent;
  color: var(--text-sub);
  font-size: 18px;
}
.modal-sub { font-size: 13px; color: var(--text-sub); margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 6px; color: var(--text-sub); }
.form-textarea, .form-input {
  width: 100%;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 14px;
}
.btn-submit-modal {
  width: 100%;
  background: linear-gradient(135deg, var(--amber), var(--amber-light));
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  padding: 12px;
  border-radius: 10px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #fff;
  border: 1px solid var(--amber);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  z-index: 200;
}

/* 반응형 */
@media (max-width: 900px) {
  .games-grid { grid-template-columns: repeat(2, 1fr); }
  .intro-strip { grid-template-columns: 1fr; }
  .hero-featured { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .games-grid { grid-template-columns: 1fr; }
  .hero-featured { padding: 20px; }
}
