/* ======================================================================
   장윤이 게임 모음 - 루트 스타일시트
   ====================================================================== */

:root {
  /* 컬러 */
  --bg-deep: #071021;
  --bg-mid: #0b1422;
  --panel: #0b1220;
  --card: #0e1722;
  --card-hover: #13202e;
  --border: rgba(234, 212, 160, 0.08);
  --border-hover: rgba(62, 166, 255, 0.35);

  --text: #eaf0f8;
  --text-muted: #8fa0b4;
  --text-dim: #5a6b80;

  --accent: #3ea6ff;
  --accent-hot: #eab308;

  /* 타이포 */
  --font-body: 'Pretendard', 'Noto Sans KR', 'Apple SD Gothic Neo', -apple-system, Segoe UI, system-ui, sans-serif;

  /* 크기 */
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-raised: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--border-hover);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(62, 166, 255, 0.06), transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(234, 179, 8, 0.04), transparent 60%),
    linear-gradient(180deg, #071021, #071525);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* ----- 레이아웃 ----- */
.container {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 20px;
}

/* ----- 사이드바 ----- */
.sidebar {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  min-height: 400px;
  align-self: start;
  position: sticky;
  top: 20px;
}
.sidebar-title {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 700;
}
.menu-section { margin-bottom: 20px; }
.menu-section:last-child { margin-bottom: 0; }
.menu-section-title {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}
.menu-items {
  list-style: none;
  padding: 0;
  margin: 0;
}
.menu-items li {
  margin-bottom: 2px;
}
.menu-items a {
  display: block;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
}
.menu-items a:hover {
  background: rgba(62, 166, 255, 0.08);
  color: var(--text);
}
.menu-items a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ----- 메인 콘텐츠 ----- */
.content {
  min-width: 0; /* grid 오버플로우 방지 */
}
.content-header {
  margin-bottom: 24px;
}
.content-title {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.content-sub {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
}

/* ----- 게임 그리드 ----- */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.game-tile {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-raised);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s;
  position: relative;
  cursor: pointer;
}
.game-tile:hover,
.game-tile:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  background: var(--card-hover);
  outline: none;
}
.game-tile:active { transform: translateY(-1px); }

.game-thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--bg-mid);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--border);
}
.game-thumbnail.no-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 900;
  color: var(--text-dim);
}

.game-info {
  padding: 14px 16px 16px;
}
.game-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}
.game-description {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ----- 외부 링크 배지 ----- */
.external-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  background: rgba(0, 0, 0, 0.6);
  color: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ----- 빈 상태 ----- */
.empty {
  color: var(--text-muted);
  padding: 32px 0;
  text-align: center;
  grid-column: 1 / -1;
}

/* ----- 스켈레톤 로더 ----- */
.skeleton {
  pointer-events: none;
}
.skeleton .game-thumbnail {
  background: linear-gradient(90deg, var(--bg-mid) 0%, #152238 50%, var(--bg-mid) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.sk-line {
  height: 12px;
  background: linear-gradient(90deg, var(--bg-mid) 0%, #152238 50%, var(--bg-mid) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
  margin-bottom: 8px;
}
.sk-line.sk-title { height: 16px; width: 60%; }
.sk-line:last-child { width: 90%; margin-bottom: 0; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ----- 반응형 ----- */
@media (max-width: 900px) {
  .container {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px 12px;
  }
  /* 모바일에서는 사이드바 숨김 (그리드 하단에 게임 목록과 중복될 수 있음) */
  .sidebar { display: none; }
  .content-title { font-size: 24px; }
}

@media (max-width: 480px) {
  .game-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .content-title { font-size: 22px; }
  .game-thumbnail { aspect-ratio: 16 / 9; }
}

/* 모션 민감 사용자 배려 */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
