:root {
  --bg: #0d0f14;
  --bg-card: #161922;
  --bg-card-hover: #1d212d;
  --border: #262b38;
  --text: #e6e8ee;
  --text-dim: #9aa0b0;
  --accent: #6c8cff;
  --accent-soft: #2a3354;
  --live: #36d399;
  --wip: #fbbf24;
  --published: #a78bfa;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Segoe UI", Roboto, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
main { max-width: 1100px; margin: 0 auto; padding: 0 20px 80px; }

/* header / footer */
.site-head { max-width: 1100px; margin: 0 auto; padding: 48px 20px 24px; }
.brand { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.tagline { color: var(--text-dim); margin: 6px 0 0; font-size: 15px; }
.site-foot { text-align: center; color: var(--text-dim); font-size: 13px; padding: 40px 20px; border-top: 1px solid var(--border); margin-top: 40px; }

/* intro */
.intro { color: var(--text-dim); margin: 8px 0 28px; max-width: 720px; }
.intro .count { color: var(--text); font-size: 14px; margin-top: 12px; }

/* grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-4px); background: var(--bg-card-hover); border-color: var(--accent-soft); }
.card-thumb { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: #0a0c11; display: block; }
.card-thumb--empty { display: flex; align-items: center; justify-content: center; font-size: 48px; opacity: .35; }
.card-body { padding: 16px 18px 18px; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-title-row h2 { font-size: 18px; margin: 0; letter-spacing: -0.01em; }
.card-tagline { color: var(--text-dim); font-size: 14px; margin: 6px 0 12px; }

/* tags + badges */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; color: var(--text-dim); background: #0e1118; border: 1px solid var(--border); padding: 2px 9px; border-radius: 999px; }
.badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge-live { color: #04231a; background: var(--live); }
.badge-wip { color: #2a1f00; background: var(--wip); }
.badge-published { color: #1a0f33; background: var(--published); }

/* empty */
.empty { color: var(--text-dim); text-align: center; padding: 80px 20px; border: 1px dashed var(--border); border-radius: var(--radius); }

/* detail */
.detail { max-width: 820px; margin: 0 auto; }
.back { color: var(--text-dim); font-size: 14px; display: inline-block; margin: 8px 0 24px; }
.back:hover { color: var(--accent); }
.detail-head { display: flex; align-items: center; gap: 14px; }
.detail-head h1 { font-size: 32px; margin: 0; letter-spacing: -0.02em; }
.detail-tagline { color: var(--text-dim); font-size: 17px; margin: 10px 0 16px; }
.links { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 8px; }
.btn { background: var(--accent); color: #0a0c11; font-weight: 700; font-size: 14px; padding: 9px 16px; border-radius: 10px; transition: opacity .15s; }
.btn:hover { opacity: .85; }

/* screenshots */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 28px 0; }
.shot { margin: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: #0a0c11; }
.shot img { width: 100%; display: block; }

/* description */
.description { margin-top: 8px; }
.description h2, .description h3, .description h4 { letter-spacing: -0.01em; }
.description code { background: #0e1118; border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; font-size: 0.9em; }
.description a { color: var(--accent); text-decoration: underline; }

/* meta */
.meta { display: flex; flex-wrap: wrap; gap: 24px; margin: 32px 0 0; padding-top: 20px; border-top: 1px solid var(--border); }
.meta dt { color: var(--text-dim); font-size: 12px; margin: 0; }
.meta dd { margin: 2px 0 0; font-size: 14px; }

@media (max-width: 560px) {
  .site-head { padding-top: 32px; }
  .detail-head h1 { font-size: 26px; }
}

/* ===== 게임 바로 플레이 / 툴 실행 (추가) ===== */
.card { position: relative; }
.card-cover { display: block; }
.card-body { display: block; }
.card-play { position: absolute; top: 12px; right: 12px; opacity: 0; transition: opacity .15s; }
.card:hover .card-play { opacity: 1; }
.play-pill { border: 0; cursor: pointer; font-weight: 700; font-size: 13px; padding: 8px 14px; border-radius: 999px;
  background: var(--accent); color: #08101f; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.play-pill:hover { filter: brightness(1.08); }

.play-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 8px; align-items: center; }
.btn-play { background: var(--accent); color: #08101f; font-size: 16px; font-weight: 800; padding: 13px 26px; border: 0; cursor: pointer; }
.btn-play:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { font-size: 13px; padding: 7px 13px; }
button.btn { font-family: inherit; cursor: pointer; }

/* 툴 / 에디터 섹션 */
.tools-sec { margin: 36px 0 8px; padding-top: 24px; border-top: 1px solid var(--border); }
.tools-sec h3 { margin: 0 0 14px; font-size: 18px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tool-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.tool-name { font-weight: 700; font-size: 15px; }
.tool-desc { color: var(--text-dim); font-size: 13px; margin: 4px 0 10px; }
.tool-actions { display: flex; gap: 8px; }

/* 임베드 오버레이 (게임/툴을 페이지 안에서 실행) */
#embed-root { position: fixed; inset: 0; z-index: 1000; }
.embed-backdrop { position: absolute; inset: 0; background: rgba(3,5,10,.82); backdrop-filter: blur(3px); }
.embed-modal { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: #05070c; border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.6); display: flex; flex-direction: column; max-width: 96vw; max-height: 94vh; }
.embed-port { width: 412px; height: 860px; max-height: 92vh; }
.embed-land { width: min(1100px, 94vw); height: min(720px, 88vh); }
.embed-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 12px; background: #0c0f16; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.embed-title { font-size: 14px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.embed-actions { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.embed-newtab { font-size: 13px; color: var(--text-dim); }
.embed-newtab:hover { color: var(--accent); }
.embed-close { background: transparent; border: 0; color: var(--text-dim); font-size: 18px; cursor: pointer; line-height: 1; }
.embed-close:hover { color: #fff; }
.embed-stage { flex: 1 1 auto; background: #000; }
.embed-frame { width: 100%; height: 100%; border: 0; display: block; }

@media (max-width: 480px) {
  .embed-port { width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
  .embed-modal { border-radius: 0; }
}
