/* =======================================================
   FLASH ARCHIVE — dark / grayscale tistory skin
   ======================================================= */

:root {
  --bg: #0a0a0a;
  --bg-elevated: #121212;
  --bg-card: #151515;
  --border: #2a2a2a;
  --border-soft: #1c1c1c;
  --text: #ececec;
  --text-dim: #9a9a9a;
  --text-faint: #5c5c5c;
  --radius: 10px;
  --header-h: 58px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
}

html { scrollbar-color: #2a2a2a var(--bg); scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }
::selection { background: #333; color: #fff; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI",
    "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
button, input { font-family: inherit; }

#skin-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------------- header ---------------- */

#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 100;
  background: rgba(9, 9, 9, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.header-inner {
  max-width: 1600px;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text);
  white-space: nowrap;
}

.category-nav {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.category-nav::-webkit-scrollbar { display: none; }
.category-nav ul,
.category-nav ol {
  display: flex;
  align-items: center;
  gap: 18px;
  list-style: none;
  white-space: nowrap;
}
.category-nav li {
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px;
  list-style: none;
  white-space: nowrap !important;
  flex-shrink: 0;
}
/* 카테고리 위젯은 원래 세로 사이드바용이라 항목 사이에 <br>이나
   글개수용 하위 목록(최근 글 등), '신규글' N 배지가 딸려오는 경우가
   있어, 가로 메뉴로 쓸 때는 줄바꿈 요소·하위 목록·배지를 전부 숨긴다.
   티스토리 기본 스타일이 나중에 로드되어 우선순위가 밀릴 수 있어
   !important 로 확실히 덮어쓴다. */
.category-nav br { display: none !important; }
.category-nav li ul,
.category-nav li ol,
.category-nav li li,
.category-nav img,
.category-nav [class*="new" i],
.category-nav [class*="icon" i] {
  display: none !important;
}
.category-nav li > * {
  display: inline-flex !important;
  align-items: center !important;
  white-space: nowrap !important;
  vertical-align: middle;
}
.category-nav a {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.category-nav a:hover { color: var(--text); }
.category-nav span,
.category-nav em {
  font-size: 10.5px;
  color: var(--text-faint);
  white-space: nowrap;
}

/* ---------------- main ---------------- */

#site-main {
  flex: 1;
  padding-top: var(--header-h);
}

/* ---------------- list page (game grid) ---------------- */

.list-page {
  max-width: 1600px;
  margin: 0 auto;
  padding: 32px clamp(16px, 4vw, 48px) 80px;
}

.list-search {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto 34px;
  padding: 6px 8px 6px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.list-search:focus-within {
  border-color: #4a4a4a;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45), 0 0 0 3px rgba(255, 255, 255, 0.05);
}
.list-search-icon {
  flex-shrink: 0;
  font-size: 18px;
  color: var(--text-faint);
}
.list-search:focus-within .list-search-icon { color: var(--text-dim); }
.list-search input[type="text"] {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 14.5px;
  padding: 13px 0;
}
.list-search input[type="text"]::placeholder { color: var(--text-faint); }
.list-search-btn {
  flex-shrink: 0;
  height: 38px;
  padding: 0 20px;
  border-radius: 999px;
  border: 0;
  background: var(--bg-elevated);
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease;
}
.list-search-btn:hover { color: var(--text); background: #232323; }

.list-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 22px;
  min-height: 1px;
}
.list-conform:empty,
.list-count:empty { display: none; }
.list-count { color: var(--text-faint); font-size: 12px; }

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.game-card {
  position: relative;
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.game-card:hover {
  transform: translateY(-3px);
  border-color: #3c3c3c;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}

.thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #1c1c1c, #0c0c0c);
  overflow: hidden;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.02);
  transition: transform 0.35s ease, filter 0.35s ease;
}
.game-card:hover .thumb img {
  transform: scale(1.06);
  filter: saturate(1) contrast(1.05);
}

.game-card-info { padding: 12px 14px 14px; }
.game-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.game-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 10.5px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.game-category { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-date { flex-shrink: 0; }

.empty-msg {
  text-align: center;
  color: var(--text-faint);
  padding: 100px 0;
  font-size: 14px;
}

.paging {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 48px;
}
.paging a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--border-soft);
  color: var(--text-dim);
  font-size: 12px;
}
.paging a:hover { color: var(--text); border-color: var(--border); }
.paging a.page-num[href=""],
.paging a[class*="no_more"],
.paging a[class*="noMore"] {
  opacity: 0.3;
  pointer-events: none;
}

/* ---------------- game view (post detail / play page) ---------------- */

.game-view {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px clamp(12px, 3vw, 32px) 60px;
}

.game-view-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 2px;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.game-view.ui-idle .game-view-topbar {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}
.back-link { font-size: 13px; color: var(--text-dim); }
.back-link:hover { color: var(--text); }
.game-view-category {
  font-size: 11px;
  color: var(--text-faint);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}
.game-view-category:hover { color: var(--text-dim); border-color: #3a3a3a; }

.game-view-title {
  font-size: clamp(18px, 2.2vw, 23px);
  font-weight: 700;
  margin: 6px 2px 16px;
  color: var(--text);
  transition: opacity 0.5s ease;
}
.game-view.ui-idle .game-view-title { opacity: 0.3; }

.game-stage {
  position: relative;
  width: 100%;
  max-width: 960px;
  max-height: 80vh;
  /* 실제 게임 크기(가로:세로)에 맞춰 skin.html 스크립트가 이 값을
     자동으로 덮어쓴다. 못 읽어왔을 때의 기본값은 4:3. */
  aspect-ratio: 4 / 3;
  margin: 0 auto;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px #1e1e1e;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* 전체화면 상태에서는 화면 전체를 채운다. 안쪽 게임(object/embed)은
   항상 width/height 100%이고 게임 자체(Ruffle/Flash)가 원본 비율을
   유지한 채 그 안에서 알아서 레터박스로 맞춰주기 때문에, 여기서
   비율 제한을 풀어줘도 게임이 찌그러지지 않고 화면에 꽉 차게 커진다. */
.game-stage:fullscreen,
.game-stage:-webkit-full-screen,
.game-stage:-ms-fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  aspect-ratio: auto !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.game-stage iframe,
.game-stage object,
.game-stage embed,
.game-stage video,
.game-stage img,
.game-stage canvas,
.game-stage ruffle-object,
.game-stage ruffle-embed,
.game-stage ruffle-player {
  width: 100% !important;
  height: 100% !important;
  border: 0;
  display: block;
}
/* Ruffle는 <object>/<embed> 태그를 그대로 두지 않고 자체 커스텀 엘리먼트
   (ruffle-object 등)로 교체해서 렌더링한다. 위에서 태그 이름을 나열해도
   Ruffle 버전에 따라 이름이 달라지면 못 잡을 수 있어서, .game-stage 바로
   아래 자식 요소는 (전체화면 버튼만 빼고) 무조건 꽉 채우도록 한 번 더
   보정한다 — 이게 실제로 "전체화면인데 안쪽 게임 화면에 여백이 크게
   남는" 문제의 진짜 원인이었을 가능성이 높다. */
.game-stage > *:not(.fullscreen-btn) {
  width: 100% !important;
  height: 100% !important;
}
.game-stage p:empty { display: none; }

.fullscreen-btn {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(20, 20, 20, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #eee;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.55;
  backdrop-filter: blur(6px);
  transition: opacity 0.25s ease, background 0.25s ease;
  z-index: 5;
}
.fullscreen-btn:hover { opacity: 1; background: rgba(32, 32, 32, 0.9); }
.game-view.ui-idle .fullscreen-btn { opacity: 0; pointer-events: none; }

/* ---------------- article content blocks ----------------
   글 본문(.article-content 안, [##_article_rep_desc_##])에서
   자유롭게 조합해 쓰는 컴포넌트 클래스들.
   예: .game-stage(게임 임베드) + .article-body(소개/정보 글) 등
------------------------------------------------------------ */

.article-content { margin-top: 4px; }

.article-body {
  max-width: 760px;
  margin: 30px auto 0;
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.8;
}
.article-body p { margin: 0 0 14px; }
.article-body a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }

.post-lead {
  font-size: 15.5px;
  color: var(--text);
  margin: 0 0 22px;
}

.section-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 30px 0 10px;
}
.section-label:first-child { margin-top: 0; }

.game-meta-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px 22px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  margin: 0;
}
.game-meta-box dt {
  font-size: 10.5px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.game-meta-box dd {
  font-size: 13.5px;
  color: var(--text);
  margin: 0;
}

.stars { letter-spacing: 2px; font-size: 13px; color: #3c3c3c; }
.stars .filled { color: var(--text); }

.play-cta {
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
  margin: 14px 0 8px;
}

.recommend-box {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 0;
}
.recommend-box ul { list-style: disc; padding-left: 18px; margin: 0; }
.recommend-box li { font-size: 13.5px; color: var(--text-dim); margin-bottom: 6px; }
.recommend-box li:last-child { margin-bottom: 0; }

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}
.post-tags span, .post-tags a {
  font-size: 11.5px;
  color: var(--text-faint);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 4px 12px;
}
.post-tags a:hover { color: var(--text-dim); border-color: #3a3a3a; }

.game-view-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  font-size: 12px;
  color: var(--text-faint);
}
.game-view-comment-count { color: var(--text-dim); }
.tag-label { color: var(--text-faint); }
.tag-label a { color: var(--text-dim); }
.tag-label a:hover { color: var(--text); }

.game-view-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 28px;
}
.prev-post, .next-post {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  min-width: 0;
}
.next-post { text-align: right; align-items: flex-end; }
.prev-post:hover, .next-post:hover { border-color: #3a3a3a; background: var(--bg-elevated); }
.nav-label { font-size: 10.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; }
.nav-title {
  font-size: 13px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.protected-box {
  max-width: 360px;
  margin: 60px auto;
  padding: 28px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  text-align: center;
  color: var(--text-dim);
}
.protected-box p { margin-bottom: 14px; font-size: 13px; }
.protected-box label { display: block; font-size: 11px; color: var(--text-faint); margin-bottom: 6px; }
.protected-box input[type="password"] {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 10px;
  outline: none;
}
.protected-box button {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
}
.protected-box button:hover { border-color: #3a3a3a; }

/* ---------------- comments ---------------- */

.comment-area {
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
  color: var(--text-dim);
  font-size: 13px;
}
.comment-area textarea,
.comment-area input[type="text"],
.comment-area input[type="password"] {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 9px 11px;
  outline: none;
}
.comment-area button,
.comment-area input[type="submit"] {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
}
.comment-area button:hover,
.comment-area input[type="submit"]:hover { border-color: #3a3a3a; }
.comment-area a { color: var(--text-dim); }
.comment-area a:hover { color: var(--text); }

/* ---------------- footer ---------------- */

#site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 30px 20px;
  text-align: center;
  color: var(--text-faint);
  font-size: 11.5px;
  letter-spacing: 0.02em;
}

/* ---------------- responsive ---------------- */

@media (max-width: 720px) {
  .header-inner { gap: 12px; padding: 0 14px; }
  .category-nav { display: none; }
  .list-search { max-width: 100%; margin-bottom: 24px; }
  .list-search-btn { padding: 0 14px; }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .game-stage { max-width: 100%; max-height: 60vh; }
  .game-view-nav { grid-template-columns: 1fr; }
  .next-post { text-align: left; align-items: flex-start; }
}

/* ---------------- 티스토리 플랫폼 삽입 요소 숨기기 ---------------- */

/* 화면 하단/구석에 뜨는 기본 툴바(메뉴) 버튼 — 게임 화면을 가려서 숨김 */
.btn_menu_toolbar.btn_menu_type2,
[class*="btn_menu_toolbar"] {
  display: none !important;
}

/* 글 하단에 자동으로 붙는 "OO 카테고리의 다른 글" 박스 — 즉시 안 보이게 처리
   (박스 전체 숨김은 JS에서 한 번 더 처리, 이건 깜빡임 방지용 즉시 차단) */
[class*="another_category"] {
  display: none !important;
}

/* ---------------- 첨부파일 목록(글 본문) ----------------
   티스토리 기본 첨부파일 박스는 밝은 테마 기준이라 다크 배경에서
   글자/아이콘이 거의 안 보인다. 다운로드 링크(kakaocdn.net)를
   기준으로 강제로 다시 스타일링한다. 옆에 붙는 "링크 복사" 버튼은
   skin.html 하단 스크립트가 만들어 넣는다. */
.article-content a[href*="kakaocdn.net"],
.article-body a[href*="kakaocdn.net"] {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 14px 16px !important;
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  color: var(--text) !important;
  text-decoration: none !important;
  font-size: 13.5px !important;
  /* 티스토리 기본 마크업이 이 링크를 카드 전체를 덮는 절대위치
     오버레이로 만들어두는 경우가 있어, 옆의 복사 버튼이 그 밑에
     깔려 클릭이 안 먹는 문제를 막기 위해 위치 속성을 초기화 */
  position: static !important;
  inset: auto !important;
  width: auto !important;
  height: auto !important;
  z-index: auto !important;
}
.article-content a[href*="kakaocdn.net"] *,
.article-body a[href*="kakaocdn.net"] * {
  color: var(--text) !important;
  opacity: 1 !important;
  fill: var(--text-dim) !important;
  position: static !important;
}
.gk-attach-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}
.gk-copy-btn {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.gk-copy-btn:hover { color: var(--text); background: #232323; border-color: #3a3a3a; }
.gk-copy-btn svg { width: 17px; height: 17px; display: block; pointer-events: none; }
.gk-copy-btn.is-copied { color: #e8e8e8; border-color: #4a4a4a; }
