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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
  background: #0f1115;
  color: #e6e6e6;
  line-height: 1.5;
  min-height: 100vh;
}

header {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
  background: linear-gradient(180deg, #1a1d24 0%, #0f1115 100%);
}

header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: #888;
  font-size: 0.95rem;
}

.last-updated {
  color: #555;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: #aaa;
}

.filters select {
  background: #1a1d24;
  color: #e6e6e6;
  border: 1px solid #2a2e38;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.95rem;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1rem;
}

.game-card {
  background: #1a1d24;
  border: 1px solid #2a2e38;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  transform: translateY(-2px);
  border-color: #4a90e2;
}

.game-card.imminent {
  border-color: #f5a623;
  box-shadow: 0 0 0 1px rgba(245, 166, 35, 0.3);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid #2a2e38;
}

.category-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-weight: 600;
}

.category-mobile_kr {
  background: rgba(76, 175, 80, 0.15);
  color: #81c784;
}

.category-pc_console_kr {
  background: rgba(33, 150, 243, 0.15);
  color: #64b5f6;
}

.category-global_aaa {
  background: rgba(156, 39, 176, 0.15);
  color: #ba68c8;
}

.category-new_server {
  background: rgba(255, 87, 34, 0.15);
  color: #ff8a65;
}

.dday {
  font-size: 0.8rem;
  font-weight: 700;
  color: #888;
}

.dday.soon {
  color: #f5a623;
}

.dday.today {
  color: #e74c3c;
  animation: pulse 1.5s infinite;
}

.dday.past {
  color: #555;
  font-weight: 500;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.info {
  padding: 0.9rem 1rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.info h3 {
  font-size: 1.05rem;
}

.name-en {
  font-size: 0.8rem;
  color: #777;
  margin-top: -0.3rem;
}

.release-date {
  color: #4a90e2;
  font-size: 0.85rem;
  font-weight: 600;
}

.desc {
  color: #bbb;
  font-size: 0.85rem;
  line-height: 1.4;
}

.meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.2rem;
}

.meta-row {
  font-size: 0.8rem;
  color: #999;
}

.platforms,
.genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  font-size: 0.75rem;
  margin-top: 0.3rem;
}

.platform-tag {
  background: #2a2e38;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  color: #bbb;
}

.genre-tag {
  background: rgba(74, 144, 226, 0.1);
  color: #6ab0e8;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.loading,
.error {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: #888;
}

.error {
  color: #e74c3c;
}

footer {
  text-align: center;
  padding: 2rem 1rem;
  color: #666;
  font-size: 0.85rem;
  border-top: 1px solid #2a2e38;
  margin-top: 3rem;
}

@media (max-width: 480px) {
  header h1 { font-size: 1.5rem; }
  .games-grid { grid-template-columns: 1fr; }
  .filters { flex-direction: column; }
  .filters label { width: 100%; }
  .filters select { width: 100%; }
}

/* --- Detail modal --- */
.game-card { cursor: pointer; }
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 1rem;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: #1a1d24; border: 1px solid #2a2e38;
  border-radius: 12px; width: 90vw; max-width: 560px;
  max-height: 85vh; overflow-y: auto;
  padding: 1.5rem; position: relative;
}
.modal-close {
  position: absolute; top: 0.5rem; right: 0.75rem;
  background: transparent; border: none; color: #aaa;
  font-size: 1.8rem; cursor: pointer; line-height: 1;
  padding: 0.25rem 0.5rem;
}
.modal-close:hover { color: #fff; }
.modal h2 { font-size: 1.3rem; margin-bottom: 0.3rem; }
.modal .name-en { font-size: 0.9rem; margin-bottom: 0.8rem; }
.modal .modal-row { margin: 0.6rem 0; font-size: 0.9rem; color: #ccc; }
.modal .modal-row strong { color: #888; margin-right: 0.4rem; }
.modal .source-link {
  display: inline-block; margin-top: 0.8rem;
  color: #4a90e2; text-decoration: none; font-size: 0.9rem;
}
.modal .source-link:hover { text-decoration: underline; }
body.modal-open { overflow: hidden; }

/* --- Monthly calendar skeleton (Stage 1) --- */
.calendar-view { background:#1a1d24; border:1px solid #2a2e38; border-radius:10px; padding:1rem; margin-bottom:1.5rem; }
#calendar-month-label { text-align:center; font-size:1.15rem; margin-bottom:0.75rem; color:#e6e6e6; }
.calendar-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:4px; }
.calendar-grid .weekday { text-align:center; font-size:0.78rem; color:#888; padding:0.3rem 0; }
.calendar-grid .day { background:#0f1115; border:1px solid #2a2e38; border-radius:6px; padding:0.5rem; min-height:60px; font-size:0.85rem; color:#ccc; }
.calendar-grid .day.other-month { opacity:0.35; }
.calendar-grid .day.today { border-color:#4a90e2; background:rgba(74,144,226,0.15); color:#fff; font-weight:700; }
@media (max-width:480px) { .calendar-grid .day { min-height:44px; font-size:0.75rem; padding:0.3rem; } }
/* Stage 2: per-day dots */
.calendar-grid .day { display:flex; flex-direction:column; }
.day-dots { display:flex; gap:3px; margin-top:auto; padding-top:4px; flex-wrap:wrap; align-items:center; }
.day-dot { width:7px; height:7px; border-radius:50%; display:inline-block; }
.day-dot.category-mobile_kr { background:#81c784; }
.day-dot.category-pc_console_kr { background:#64b5f6; }
.day-dot.category-global_aaa { background:#ba68c8; }
.day-dot.category-new_server { background:#ff8a65; }
.day-dot-more { font-size:0.68rem; color:#aaa; line-height:1; margin-left:1px; }

footer a {
  color: #888;
  text-decoration: none;
  border-bottom: 1px dotted #555;
}
footer a:hover {
  color: #aaa;
}
