@charset "UTF-8";

/* ==========================================================================
   한울온 — public stylesheet
   바닐라 CSS. 전처리기·프레임워크·외부 폰트 로드 없음.
   토큰은 .omc/plans/hanulon-visual-direction.md 및 승인된 HTML 시안 기준.
   .panel / .field / .button / .form-grid / .admin-table 은 운영자 화면과
   공유하는 유틸리티다. 이름과 동작을 임의로 바꾸지 말 것.
   ========================================================================== */

:root {
  /* 바탕 — 따뜻한 백색 */
  --bg: #f7f6ef;
  --surface: #fffdf6;
  --surface-sunk: #eeefe6;

  /* 글자 — 짙은 남색 */
  --ink: #182e33;
  --muted: #64726e;
  --muted-strong: #53655d;

  /* 주요 행동 — 청록색 */
  --accent: #176759;
  --accent-dark: #124e44;
  --accent-soft: #e5ecdb;
  --accent-tint: #eaf0e1;

  /* 보조 포인트 — 라임색 */
  --accent-lime: #d7ed85;
  --accent-lime-deep: #a0bc51;

  /* 로고 On 색: 라임 점과 같은 계열. 크림 3.45 / 흰색 3.74 / 어두운 배경 4.78 (WCAG 대비) */
  --brand-on: #6f8f1a;
  --brand-mark: #176759;

  /* 진한 배경(ink) 위 글자색, 주요 버튼(accent) 위 글자색. 어두운 테마에서는 배경과 글자가 서로 뒤집힌다. */
  --on-ink: #fff;
  --on-accent: #fff;

  /* 게임 실행 화면 바탕: 테마와 상관없이 항상 어둡다. */
  --stage: #182e33;

  /* 보조면 */
  --warm: #f0e4d8;
  --warm-line: #e7d8c9;

  --line: #d9ded4;
  --line-strong: #bdc8bc;

  --focus: #d17b41;
  --danger: #a3352a;
  --danger-soft: #f8eae6;
  --danger-line: #e5c4ba;
  --ok: #176759;
  --ok-soft: #e7f0e2;

  /* 좋아요(하트)·즐겨찾기(별) */
  --like: #d0344e;
  --like-soft: #fbe9ec;
  --like-line: #efc0c8;
  --fav: #b7791f;
  --fav-soft: #fbf1dc;
  --fav-line: #ead3a4;

  /* 순위 깃발(인기 순위 카드·순위표): 금·은·동, 4위부터 청록. 테마와 상관없이 같다. */
  --rank-gold: #f2b705;
  --rank-gold-ink: #4a3300;
  --rank-silver: #b8c0c9;
  --rank-silver-ink: #26303a;
  --rank-bronze: #c4773e;
  --rank-bronze-ink: #33190a;
  --rank-teal: #176759;
  --rank-teal-ink: #eaf7c2;

  --radius: 8px;
  --radius-sm: 5px;
  --radius-pill: 100px;

  --wrap: 1296px;   /* 좌우 48px 여백을 빼면 본문 1,200px */
  --gutter: 48px;

  /* Pretendard Variable 은 /fonts/pretendard/ 에서 직접 서비스한다(SIL OFL-1.1).
     로드 전·실패 시에는 기기별 한글 시스템 폰트로 대체된다. */
  --font-sans: "Pretendard Variable", "Pretendard", -apple-system,
    BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic",
    "Noto Sans KR", "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", "Nanum Myeongjo", serif;

  --tap: 44px;
}

/* --------------------------------------------------------------- 기본값 -- */

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 var(--font-sans);
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 {
  word-break: keep-all;
  overflow-wrap: break-word;
  letter-spacing: -0.5px;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; color: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

/* --------------------------------------------------------------- 보조 -- */

.sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  top: -80px;
  left: 12px;
  z-index: 50;
  background: var(--surface);
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-weight: 700;
}
.skip:focus { top: 10px; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.note {
  font-size: 12px;
  color: var(--muted);
  margin: 9px 0;
  line-height: 1.7;
}

.muted { color: var(--muted); }

/* ------------------------------------------------------------- 고지 바 -- */

.demo-bar {
  background: var(--ink);
  color: var(--on-ink);
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.035em;
  padding: 7px 15px;
}

/* --------------------------------------------------------------- 헤더 -- */

.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.site-header__row {
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 92px;
}

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; min-height: var(--tap); }
.brand:hover { color: inherit; }
.brand__mark { width: 31px; height: 31px; flex-shrink: 0; }
/* 로고 글자는 영문 "HanulON" 워드마크. 자간은 글자 크기에 비례(em)해야 모바일 축소에도 균형이 유지된다. */
.brand__word { font-size: 28px; font-weight: 800; letter-spacing: -0.045em; line-height: 1.1; }
/* 로고 "HanulOn" 의 On 은 색으로 구분한다. --accent 가 아니라 전용 변수(--brand-on)를 쓴다:
   운영 화면은 --accent 를 검정으로 덮어써서, 그걸 따르면 On 이 Hanul 과 같은 검은색이 되어 버린다.
   값은 밝은 배경(크림·흰색)과 어두운 배경 모두에서 대비 3:1 이상(큰 글자 기준)을 만족하는 색이다. */
.brand__on { color: var(--brand-on); }

.site-nav {
  display: flex;
  gap: 22px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.site-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 12px 0; }
.site-nav__icon { width: 16px; height: 16px; flex: 0 0 auto; }
.site-nav a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }

.search-form {
  display: flex;
  align-items: center;
  background: var(--surface-sunk);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  height: 46px;
  margin-left: auto;
  min-width: 200px;
  width: 340px;
}
.search-form:focus-within { border-color: var(--accent); }
.search-form input {
  min-width: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: none;
  padding: 0 16px;
}
.search-form input::placeholder { color: var(--muted); }
.search-form button {
  width: 48px;
  height: 100%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

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

.linkish {
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.header-actions form { display: inline-flex; }

/* ------------------------------------------------ 내 계정 팝업 -- */

.account-menu { position: relative; }
.account-menu__button {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: var(--tap); padding: 0 10px 0 6px;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--ink);
  font-size: 13px; font-weight: 700; cursor: pointer; list-style: none; user-select: none;
}
.account-menu__button::-webkit-details-marker { display: none; }
.account-menu__button:hover, .account-menu[open] > .account-menu__button { border-color: var(--line-strong); background: var(--surface-sunk); }
.account-menu__avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 800;
}
.account-menu__caret { transition: transform .15s; }
.account-menu[open] .account-menu__caret { transform: rotate(180deg); }

.account-menu__panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30;
  width: 260px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 36px rgba(12, 22, 26, 0.16);
}
.account-menu__profile { display: grid; gap: 2px; padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; min-width: 0; }
.account-menu__profile strong { font-size: 14px; overflow-wrap: anywhere; }
.account-menu__profile span { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.account-menu__item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: var(--tap);
  padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 600; text-align: left; cursor: pointer;
}
.account-menu__item:hover { background: var(--surface-sunk); color: var(--ink); }
.account-menu__panel form { display: block; }

.account-menu__theme { margin: 6px 0; padding: 8px 10px; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.account-menu__theme[hidden] { display: none; }
.account-menu__theme legend { padding: 0; font-size: 12px; font-weight: 700; color: var(--muted); float: left; width: 100%; margin-bottom: 8px; }
.account-menu__theme label { display: inline-block; width: calc(50% - 3px); }
.account-menu__theme input { position: absolute; opacity: 0; pointer-events: none; }
.account-menu__theme span {
  display: block; text-align: center; padding: 9px 0; font-size: 13px; font-weight: 700;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted-strong); cursor: pointer;
}
.account-menu__theme input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.account-menu__theme input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.brand__mark path[stroke] { stroke: var(--brand-mark); }

@media (max-width: 860px) {
  .account-menu__label { display: none; }
  .account-menu__button { padding-right: 8px; }
  .account-menu__panel { width: min(280px, calc(100vw - 32px)); }
}

/* --------------------------------------------------------------- 알림 -- */

.alert {
  margin: 20px 0;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.alert--ok { background: var(--ok-soft); border-color: #c9ddc4; color: var(--accent-dark); }
.alert--error { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.alert ul { margin: 8px 0 0; padding-left: 18px; }
.alert li { margin-top: 3px; }

/* --------------------------------------------------------------- 버튼 -- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
}
.button:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--on-accent); }

.button--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.button--ghost:hover { background: var(--surface-sunk); color: var(--ink); border-color: var(--ink); }

.button--quiet {
  background: transparent;
  border-color: transparent;
  color: var(--ink);
  padding: 12px 10px;
  min-height: var(--tap);
}
.button--quiet:hover { background: var(--surface-sunk); color: var(--ink); }

.button--danger { background: var(--danger); border-color: var(--danger); }
.button--danger:hover { background: #8a2b22; border-color: #8a2b22; }

.button--block { width: 100%; }
.button--small { min-height: 38px; padding: 8px 14px; font-size: 13px; }

.button:disabled,
.button[aria-disabled="true"],
.button--disabled {
  background: var(--surface-sunk);
  border-color: var(--line);
  color: var(--muted);
  cursor: not-allowed;
  pointer-events: none;
}

.icon-button {
  min-height: var(--tap);
  min-width: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.icon-button:hover { background: var(--surface-sunk); color: var(--ink); }

/* ------------------------------------------------------------ 폼 요소 -- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.panel + .panel { margin-top: 20px; }
/* 로그인·회원가입·비밀번호 찾기/재설정·인증 안내·계정 화면은 <main> 바로 아래에 패널 하나가 놓인다.
   위쪽 여백이 없으면 헤더에 붙어 보인다. 직계 자식(main > .panel)으로 좁혀서, 같은 .panel 을 쓰는
   운영 화면(사이드바 안의 카드)에는 영향이 없다. 아래쪽은 푸터와 떨어지도록 같이 둔다. */
main > .panel { margin-top: 48px; margin-bottom: 0; }
main > .panel + .panel { margin-top: 20px; }
/* 아래 여백은 마지막 패널에만 준다(모든 패널에 주면 여백 겹침으로 이어지는 패널 사이가 48px 로 벌어진다). */
main > .panel:last-child { margin-bottom: 48px; }
.panel__title { font-size: 18px; margin: 0 0 4px; }
.panel__desc { font-size: 13px; color: var(--muted); margin: 0 0 18px; }

.field { display: block; margin-bottom: 18px; }
.field > label,
.field__label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}
.field__hint { display: block; font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.field__error { display: block; font-size: 12px; color: var(--danger); font-weight: 700; margin: 6px 0 0; }
.field__required { color: var(--danger); margin-left: 3px; }

.field input[type="text"],
.field input[type="search"],
.field input[type="email"],
.field input[type="password"],
.field input[type="url"],
.field input[type="number"],
.field input[type="date"],
.field select,
.field textarea,
.input,
.select {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.7; }
.field input:focus,
.field select:focus,
.field textarea:focus,
.input:focus,
.select:focus { border-color: var(--accent); }

.field--invalid input,
.field--invalid select,
.field--invalid textarea,
[aria-invalid="true"] { border-color: var(--danger) !important; }

.field--check { display: flex; align-items: center; gap: 9px; }
.field--check input { width: 18px; height: 18px; accent-color: var(--accent); }
.field--check label { margin: 0; font-weight: 400; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
}
.form-grid > .field--full { grid-column: 1 / -1; }
/* 가입 동의 안내(회원가입·Google 로그인) */
.auth-consent { margin: 4px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.auth-consent a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.google-login-button + .auth-consent { margin-top: 10px; text-align: center; }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}
.form-actions--end { justify-content: flex-end; }

/* --------------------------------------------------------- 운영자 표 -- */

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--surface);
}
.admin-table caption { text-align: left; font-size: 13px; color: var(--muted); padding-bottom: 10px; }
.admin-table th,
.admin-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.admin-table thead th {
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: var(--surface-sunk);
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
.admin-table tbody tr:hover { background: var(--accent-tint); }
.admin-table td.is-numeric { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table .row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-table__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.status-dot::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--muted);
}
.status-dot--published::before { background: var(--accent); }
.status-dot--draft::before { background: var(--focus); }
.status-dot--hidden::before,
.status-dot--archived::before { background: var(--line-strong); }

/* --------------------------------------------------------------- 배지 -- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  line-height: 1.4;
  padding: 3px 8px;
  border-radius: 3px;
  background: #e9ede2;
  color: #4d5f57;
  white-space: nowrap;
}
.badge--run { background: transparent; color: var(--accent); font-weight: 700; padding-left: 0; padding-right: 0; }
.badge--external { color: #8a5a2f; }
.badge--warn { background: var(--warm); color: #7d5330; }
.badge--preview { background: var(--ink); color: var(--on-ink); font-weight: 700; letter-spacing: 0.04em; }
.badge--demo { background: var(--accent-lime); color: #3c4a1e; font-weight: 700; }

/* --------------------------------------------------------------- 카드 -- */

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* 작은 카드 그리드(메인의 "새로 만나는 게임"): 한 줄에 5장. */
.grid--compact { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px 14px; }
.grid--compact .card__body { padding-top: 9px; }
.grid--compact .card__title { font-size: 14px; line-height: 1.35; }
.grid--compact .card__go { font-size: 13px; }
.grid--compact .card__maker { font-size: 10.5px; margin: 1px 0 6px; }
.grid--compact .card__meta { gap: 4px; font-size: 10px; }
.grid--compact .badge { padding: 2px 6px; font-size: 10px; }

.card { display: block; min-width: 0; }
.card:hover { color: inherit; }

.card__art {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 7px;
  background: var(--accent-soft);
  border: 1px solid var(--line);
}
.card__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}
.card:hover .card__art img { transform: scale(1.035); }

.card__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--muted);
  background: var(--accent-soft);
  text-align: center;
  padding: 10px;
}

/* 인기 순위: 카드 왼쪽 위에 걸린 깃발. 1~3위는 금·은·동, 4위부터는 청록. */
.card__rank {
  position: absolute;
  left: 10px;
  top: 0;
  z-index: 1;
  width: 40px;
  height: 50px;
  padding-top: 6px;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 25px;
  font-weight: 900;
  font-style: italic;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
  line-height: 1.15;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%);
  /* 위쪽은 살짝 밝게, 아래쪽은 어둡게 해서 입체감을 준다 */
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.38) 0, rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, 0.14) 100%);
  background-color: var(--rank-bg, #176759);
  color: var(--rank-ink, #f1f9d8);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}
.card__rank--1 { --rank-bg: var(--rank-gold); --rank-ink: var(--rank-gold-ink); font-size: 29px; width: 44px; height: 56px; }
.card__rank--2 { --rank-bg: var(--rank-silver); --rank-ink: var(--rank-silver-ink); font-size: 27px; }
.card__rank--3 { --rank-bg: var(--rank-bronze); --rank-ink: var(--rank-bronze-ink); font-size: 27px; }
.card__rank--n { --rank-bg: var(--rank-teal); --rank-ink: var(--rank-teal-ink); text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3); }

.card__body { padding: 12px 1px 0; }
.card__titleline { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card__title { font-size: 17px; margin: 0; font-weight: 700; }
.card__go { font-size: 15px; color: var(--muted); flex-shrink: 0; }
.card:hover .card__go { color: var(--accent); }
.card__maker { font-size: 11px; color: var(--muted); margin: 2px 0 8px; }
.card__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
}

/* --------------------------------------------------------- 홈 히어로 -- */

.intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding: 43px 0 30px;
}
.intro h1 {
  font-size: 37px;
  line-height: 1.3;
  letter-spacing: -1.8px;
  margin: 4px 0 0;
  font-weight: 800;
}
.intro h1 em { font-style: normal; color: var(--accent); }
.intro p { font-size: 13px; color: var(--muted); margin: 0 0 5px; }

.featured { display: grid; grid-template-columns: 1.65fr 1fr; gap: 20px; }
.featured--single { grid-template-columns: 1fr; }
.featured--single .feature { grid-template-columns: 1.15fr 1fr; }

.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid var(--line);
  min-height: 236px;
  text-align: left;
}
.feature:hover { color: inherit; }
.feature__copy {
  padding: 26px 0 23px 26px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.feature__chip {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.1px;
  background: var(--ink);
  color: var(--on-ink);
  padding: 4px 9px;
  border-radius: 3px;
}
.feature h2 { font-size: 26px; line-height: 1.3; letter-spacing: -1px; margin: 14px 0 5px; }
.feature p { font-size: 12px; color: var(--muted-strong); margin: 0; }
.feature__arrow { margin-top: auto; padding-top: 17px; font-size: 12px; font-weight: 700; }
.feature__art { height: 100%; overflow: hidden; }
.feature__art img { width: 100%; height: 100%; object-fit: cover; }

.feature--second {
  background: var(--warm);
  border-color: var(--warm-line);
  grid-template-columns: 1.05fr 1fr;
}
.feature--second .feature__chip { background: transparent; color: #866344; padding: 0; }
.feature--second h2 { font-size: 22px; }
.feature--second .feature__copy { padding-left: 24px; }

/* ------------------------------------------- 에디터 추천 히어로 슬라이드 -- */

.hero-slider { position: relative; margin-top: 28px; }
.hero-slider__track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  border-radius: var(--radius);
}
.hero-slider__track::-webkit-scrollbar { display: none; }
/* 풀블리드 슬라이드: 이미지가 칸 전체를 채우고, 왼쪽 아래 어두운 그라데이션 위에 글(칩·제목·소개·버튼)을 얹는다.
   제목은 이 글 한 곳에만 나온다(이미지 옆에 같은 글을 또 두지 않는다). */
.hero-slide {
  position: relative;
  display: block;
  flex: 0 0 100%;
  min-width: 0;
  height: 400px;
  overflow: hidden;
  scroll-snap-align: start;
  border-radius: var(--radius);
  background: var(--stage);
  color: #fff;
  text-align: left;
}
.hero-slide:hover { color: #fff; }
.hero-slide__art { position: absolute; inset: 0; overflow: hidden; }
/* 커버는 16:9 인데 데스크톱 칸은 더 넓다(약 3.3:1). 화면 폭 전체를 채우도록 위아래를 적절히 잘라서(cover)
   보여준다. 모바일은 칸 자체가 16:9(아래 미디어쿼리)라 실제로는 잘리지 않는다. */
.hero-slide__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;   /* 배너 이미지의 큰 제목 글자가 보통 위쪽에 있어 그쪽을 살린다 */
  transition: transform 0.5s ease;
}
.hero-slide:hover .hero-slide__img { transform: scale(1.02); }
.hero-slide::after {
  /* 글은 왼쪽 전체 높이 어디에 있어도(세로 가운데) 읽히게 왼쪽을 어둡게 하고,
     버튼은 항상 오른쪽 아래에 있으니 그 자리도 따로 어둡게 한다. */
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 20, 18, 0.86) 0%, rgba(8, 20, 18, 0.6) 34%, rgba(8, 20, 18, 0) 66%),
    radial-gradient(ellipse at 100% 100%, rgba(8, 20, 18, 0.65) 0%, rgba(8, 20, 18, 0) 42%);
  pointer-events: none;
}
.hero-slide__copy {
  position: absolute;
  z-index: 1;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  max-width: min(560px, 70%);
  /* 왼쪽 여백을 넓혀 ‹ 버튼(12~54px 자리) 위로 글이 겹치지 않게 한다. */
  padding: 0 24px 0 76px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.hero-slide__chip {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  padding: 5px 10px;
  border-radius: 4px;
  background: var(--accent-lime);
  color: #1d2b0a;
}
.hero-slide__title {
  margin: 0;
  font-size: 40px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -1.4px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}
.hero-slide__summary {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.92);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}
.hero-slide__meta {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}
/* 버튼은 글 블록과 분리해 항상 오른쪽 아래에 고정한다(배너·일반 모드 공통). */
.hero-slide__cta {
  position: absolute;
  z-index: 1;
  right: 76px;   /* › 버튼(12~54px 자리) 위로 겹치지 않게 */
  bottom: 24px;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-pill);
  background: #fff;
  color: #10201d;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}
.hero-slide:hover .hero-slide__cta { background: var(--accent-lime); }

.hero-slider__nav {
  position: absolute;
  top: calc(50% - 30px);
  z-index: 2;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(12, 22, 26, 0.2);
  cursor: pointer;
}
.hero-slider__nav:hover { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.hero-slider__nav--prev { left: 12px; }
.hero-slider__nav--next { right: 12px; }

.hero-slider__bar { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 12px; }
.hero-slider__dots { display: flex; align-items: center; gap: 2px; }
.hero-dot {
  position: relative;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.hero-dot::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--line-strong);
  transform: translate(-50%, -50%);
  transition: width 0.2s, background 0.2s;
}
.hero-dot:hover::before { background: var(--muted); }
.hero-dot[aria-current="true"]::before { width: 24px; background: var(--accent); }
.hero-slider__pause {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted-strong);
  cursor: pointer;
}
.hero-slider__pause:hover { color: var(--ink); border-color: var(--ink); }
.hero-slider__pause .i-play { display: none; }
.hero-slider__pause[aria-pressed="true"] .i-pause { display: none; }
.hero-slider__pause[aria-pressed="true"] .i-play { display: block; }

@media (max-width: 860px) {
  /* 데스크톱과 같은 방식(왼쪽만 어둡게)으로 이미지 위에 글을 겹친다. ::after 는 데스크톱 것을 그대로 쓴다. */
  .hero-slide { height: 320px; }
  .hero-slide__copy { padding: 0 20px; }
  .hero-slide--banner .hero-slide__chip { font-size: 10px; padding: 4px 8px; }
  .hero-slide__title { font-size: 22px; letter-spacing: -0.6px; }
  .hero-slide__summary { font-size: 13px; -webkit-line-clamp: 2; }
  .hero-slide__meta { font-size: 12px; }
  .hero-slide__cta { right: 20px; bottom: 20px; }   /* 나비게이션 화살표가 없으니 여백을 그만큼 줄인다 */
  .hero-slider__nav { display: none; }   /* 좁은 화면에서는 스와이프와 점으로 넘긴다 */
}

/* ------------------------------------------------------------- 섹션 -- */

.section { padding-top: 42px; }
.section__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 19px;
}
.section__head h2 { font-size: 23px; letter-spacing: -0.8px; margin: 0; }
.section__head h2 span {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 13px;
  color: var(--muted);
  margin-left: 10px;
  letter-spacing: 0;
}
.section__head p { font-size: 11px; color: var(--muted); margin: 3px 0 0; }
.section__more {
  font-size: 12px;
  font-weight: 700;
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

/* --------------------------------------------------------- 장르 칩 -- */

.browse {
  margin-top: 43px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.browse.browse--top { margin-top: 28px; margin-bottom: 0; }
.browse h2 { font-size: 20px; margin: 0; letter-spacing: -0.6px; }
.browse p { font-size: 12px; color: var(--muted); margin: 2px 0 0; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 9px 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  font-size: 12px;
  background: transparent;
  white-space: nowrap;
}
.chip:hover { background: var(--surface-sunk); color: var(--ink); }
.chip[aria-current="true"],
.chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-ink);
}
.chip[aria-current="true"]:hover { background: var(--ink); color: var(--on-ink); }

/* --------------------------------------------------------- 탐색 결과 -- */

.results { padding-top: 38px; min-height: 55vh; }
.results h1 { font-size: 30px; margin: 0 0 18px; letter-spacing: -1px; }
.results__lead { margin: -10px 0 18px; color: var(--muted-strong); font-size: 15px; }

.results__search { display: flex; gap: 10px; max-width: 620px; margin: 0 0 20px; }
.results__search input {
  flex: 1;
  min-width: 0;
  min-height: var(--tap);
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.results__search input:focus { border-color: var(--accent); }

.results__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 24px 0 18px;
  color: var(--muted);
  font-size: 13px;
}
.results__bar label { display: inline-flex; align-items: center; gap: 8px; }
.results__bar select {
  min-height: var(--tap);
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 4px;
  color: var(--ink);
}

.empty {
  padding: 56px 24px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.empty h2 { font-size: 22px; margin: 0 0 10px; }
.empty p { color: var(--muted); font-size: 14px; margin: 0 auto 20px; max-width: 46ch; }
.empty__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* 페이지네이션 (Laravel 기본 마크업 대응) */
.pagination-area { margin-top: 36px; }
.pagination-area nav { display: flex; justify-content: center; }
.pagination-area svg { width: 18px; height: 18px; }
.pagination-area .pagination,
.pagination-area ul {
  display: flex;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
  justify-content: center;
}
.pagination-area li > *,
.pagination-area li span,
.pagination-area li a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--tap);
  min-height: var(--tap);
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14px;
}
.pagination-area li a:hover { background: var(--surface-sunk); color: var(--ink); }
.pagination-area li[aria-current] > *,
.pagination-area li .active,
.pagination-area .active > * {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-ink);
}
.pagination-area li span.is-disabled {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
}
.pagination-area .hidden { display: none; }
/* Tailwind 전제 마크업의 잔여 문단 숨김 */
.pagination-area p.text-sm.text-gray-700 { display: none; }

/* --------------------------------------------------------------- 상세 -- */

.crumb { font-size: 12px; color: var(--muted); padding: 27px 0; }
.crumb a { text-decoration: underline; }
.crumb span { margin: 0 8px; }

.detail-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 42px;
  align-items: center;
}
.detail-hero__art {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  position: relative;
}
.detail-hero__art img { width: 100%; height: 100%; object-fit: cover; }
.detail-hero h1 { font-size: 36px; line-height: 1.25; letter-spacing: -1.5px; margin: 10px 0 8px; }
.detail-hero__maker { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.detail-hero__meta { display: flex; gap: 6px; flex-wrap: wrap; }
.detail-hero__summary { font-size: 15px; color: var(--muted-strong); margin: 20px 0; line-height: 1.8; }
.detail-hero .button { width: 100%; }

.detail-nav {
  display: flex;
  gap: 30px;
  border-bottom: 1px solid var(--line);
  margin-top: 35px;
  overflow-x: auto;
}
.detail-nav a { padding: 17px 0; font-size: 13px; font-weight: 700; white-space: nowrap; }

.detail-body { max-width: 850px; padding-top: 28px; }
.detail-columns { display: flex; align-items: flex-start; gap: 36px; }
.detail-columns .detail-body { flex: 1 1 auto; min-width: 0; max-width: none; }
.detail-ad { flex: 0 0 min(30%, 300px); min-width: 0; padding-top: 28px; }
.detail-body section { scroll-margin-top: 20px; margin-bottom: 40px; }
.detail-body h2 { font-size: 22px; letter-spacing: -0.6px; margin: 0 0 12px; }
.detail-body p { color: var(--muted-strong); line-height: 1.9; }
.prose { white-space: pre-line; }

.howto {
  background: var(--accent-tint);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.howto h3 { margin: 0 0 7px; font-size: 14px; }
.howto p { margin: 0 0 4px; font-size: 13px; color: var(--muted-strong); }
.howto p:last-child { margin-bottom: 0; }

/* 스크린샷 캐러셀: 한 줄에 --per-view 장(기본 3). 넘어가는 장은 ‹ › 버튼·스와이프로 옆에서 본다. */
.screens-carousel { position: relative; }
.screens {
  --per-view: 3;
  --gap: 16px;
  display: flex;
  gap: var(--gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.screens::-webkit-scrollbar { display: none; }
.screens button {
  flex: 0 0 calc((100% - (var(--per-view) - 1) * var(--gap)) / var(--per-view));
  min-width: 0;
  scroll-snap-align: start;
  padding: 0;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  display: block;
}
/* 이미지의 height 속성(360)이 aspect-ratio 보다 우선하므로 height:auto 로 풀어야 16:9 가 적용된다. */
.screens button img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.screens button:hover { border-color: var(--accent); }

.screens-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(12, 22, 26, 0.18);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}
.screens-nav[hidden] { display: none; }
.screens-nav:hover:not(:disabled) { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.screens-nav:disabled { opacity: 0; pointer-events: none; }
.screens-nav--prev { left: -14px; }
.screens-nav--next { right: -14px; }

.notice-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 20px 22px;
  font-size: 14px;
  color: var(--muted-strong);
}
.notice-box--warn { background: var(--warm); border-color: var(--warm-line); color: #6f4c2b; }

/* ---------------------------------------------------------- 라이트박스 -- */

dialog.lightbox {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  padding: 22px;
  max-width: 960px;
  width: calc(100% - 32px);
  box-shadow: 0 25px 80px rgba(24, 46, 51, 0.19);
}
dialog.lightbox::backdrop { background: rgba(17, 43, 51, 0.68); }
.lightbox__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lightbox__top h2 { font-size: 18px; margin: 0; }
.lightbox__stage {
  margin-top: 14px;
  background: var(--accent-soft);
  border-radius: 7px;
  overflow: hidden;
}
.lightbox__stage img { width: 100%; max-height: 66vh; object-fit: contain; background: var(--accent-soft); }
.lightbox__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}
.lightbox__caption { text-align: center; flex: 1; min-width: 0; }

/* --------------------------------------------------------------- 플레이 -- */

.play-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.button--fullscreen {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 18px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--accent-lime-deep);
  background: var(--accent-lime);
  color: #1d2b0a;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(160, 188, 81, 0.45);
  animation: fullscreen-glow 2.4s ease-out 3;   /* 처음에 세 번만 살짝 빛나 눈에 띄게 한다 */
}
.button--fullscreen:hover { background: var(--accent-lime-deep); border-color: var(--accent-lime-deep); color: #10190a; }
.button--fullscreen[hidden] { display: none; }
@keyframes fullscreen-glow {
  0% { box-shadow: 0 0 0 0 rgba(160, 188, 81, 0.75), 0 4px 14px rgba(160, 188, 81, 0.45); }
  70% { box-shadow: 0 0 0 12px rgba(160, 188, 81, 0), 0 4px 14px rgba(160, 188, 81, 0.45); }
  100% { box-shadow: 0 0 0 0 rgba(160, 188, 81, 0), 0 4px 14px rgba(160, 188, 81, 0.45); }
}
@media (prefers-reduced-motion: reduce) { .button--fullscreen { animation: none; } }
@media (max-width: 639px) {
  /* 모바일: 더 크고 잘 보이게. 좁으면 제목 줄 아래로 내려가 한 줄을 다 쓴다. */
  .button--fullscreen { min-height: 48px; padding: 0 20px; font-size: 15px; }
}

.play-bar__title { font-size: 17px; margin: 0; flex: 1; min-width: 0; }
.play-bar__back { font-size: 13px; font-weight: 700; min-height: var(--tap); display: inline-flex; align-items: center; }

.play-stage {
  /* 창 높이가 낮으면 max-height 때문에 16:9 폭이 줄어든다. 그때 왼쪽에 붙지 않고 가운데 오도록 좌우 auto. */
  margin: 20px auto;
  background: var(--stage);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 230px);
}
.play-stage iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--stage);
}
.play-stage:fullscreen,
.play-stage:-webkit-full-screen { max-height: none; aspect-ratio: auto; height: 100%; border-radius: 0; }

/* 가상 전체화면: 네이티브 전체화면이 안 되는 브라우저(iPhone Safari 등)에서 게임 영역이 화면 전체를 덮는다. */
.play-stage.is-fullscreen-fallback {
  position: fixed;
  inset: 0;
  z-index: 1000;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  max-height: none;
  aspect-ratio: auto;
  border-radius: 0;
}
html.is-stage-open, html.is-stage-open body { overflow: hidden; }
.play-stage__exit {
  /* 전체화면 닫기: 위쪽 가운데의 ✕ 탭. 게임들이 메뉴·소리 버튼을 주로 양쪽 위 구석에 두므로 가운데에 둔다. */
  position: absolute;
  top: env(safe-area-inset-top, 0px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: grid;
  place-items: center;
  width: 48px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: rgba(12, 22, 26, 0.72);
  color: #fff;
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.play-stage__exit[hidden] { display: none; }

.play-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  color: #e8f0df;
  background: var(--stage);
  font-size: 14px;
  padding: 24px;
}
.play-status[hidden] { display: none; }
.play-status small { color: #9db3a6; font-size: 12px; }

.play-foot {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  align-items: flex-start;
  padding-bottom: 20px;
}
.play-foot__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* 웹 광고 줄(components/ad-row): 칸 비율은 --ad-ratio(1:1·3:1), 칸 수는 --ad-cols.
   광고임을 칸마다 표기하고, 광고가 하나도 없는 줄은 컴포넌트가 아예 그리지 않는다.
   빈 칸은 넓은 화면에서 자리만 지켜 칸 번호(왼쪽·가운데·오른쪽)가 바뀌지 않게 하고, 좁은 화면에서는 빠진다. */
.ad-row { display: grid; grid-template-columns: repeat(var(--ad-cols), minmax(0, 1fr)); gap: 16px; margin: 28px 0; }
.ad-row--stack { grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 0; }
.ad-row--stack + .ad-row--stack { margin-top: 12px; }
/* 칸이 컨테이너다: 아래 @container 규칙이 칸 크기에 맞춰 타일(.ad-tile 자신 포함)을 바꾼다. */
.ad-cell { min-width: 0; aspect-ratio: var(--ad-ratio); container-type: size; }
.ad-cell--empty { visibility: hidden; }
.ad-row--stack .ad-cell--empty { display: none; }

.ad-tile { position: relative; display: flex; width: 100%; height: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease; }
a.ad-tile:hover { border-color: var(--line-strong); box-shadow: 0 6px 18px rgba(15, 23, 20, .08); color: var(--ink); }
.ad-tile__label { position: absolute; top: 8px; left: 8px; z-index: 1; padding: 1px 6px; border-radius: 4px; background: rgba(15, 23, 20, .62); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .04em; line-height: 1.5; }
.ad-tile__image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--accent-soft); }
.ad-tile--text { background: var(--accent-tint); }
.ad-tile--text .ad-tile__label { position: static; align-self: flex-start; margin: 10px 0 0 12px; background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
.ad-tile__copy { display: flex; flex: 1; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; padding: 10px 14px 10px 10px; }
.ad-tile__title { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 15px; line-height: 1.35; }
.ad-tile__body { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: var(--muted-strong); font-size: 12.5px; line-height: 1.5; }
.ad-tile__button { align-self: flex-start; display: inline-flex; align-items: center; min-height: 26px; margin-top: 2px; padding: 0 10px; border-radius: var(--radius-pill); background: var(--accent); color: var(--on-accent); font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.ad-tile__google { width: 100%; height: 100%; }
.ad-tile [hidden] { display: none; }

/* 칸 크기에 맞춰 글자 줄을 줄인다(작은 3:1 칸은 제목 위주). */
@container (max-height: 120px) {
  .ad-tile__body { -webkit-line-clamp: 1; }
  .ad-tile__button { display: none; }
}
@container (max-height: 84px) {
  .ad-tile__body { display: none; }
  .ad-tile__title { font-size: 14px; }
}
@container (min-height: 220px) {
  .ad-tile--text { flex-direction: column; }
  .ad-tile--text .ad-tile__copy { justify-content: flex-end; gap: 8px; padding: 16px 18px 18px; }
  .ad-tile__title { font-size: 19px; -webkit-line-clamp: 3; }
  .ad-tile__body { font-size: 13.5px; -webkit-line-clamp: 4; }
  .ad-tile__button { min-height: 32px; padding: 0 13px; font-size: 12px; }
}

/* 게임 플레이: 「다시 불러오기」 줄 바로 아래 네 칸 */
.ad-row--game-play { margin: 8px 0 40px; }

.play-intro {
  max-width: 620px;
  margin: 40px auto 60px;
  text-align: center;
}
.play-intro h1 { font-size: 30px; margin: 10px 0 6px; letter-spacing: -1px; }
.play-intro__maker { color: var(--muted); font-size: 13px; margin: 0 0 24px; }
.play-intro .howto { text-align: left; margin-bottom: 24px; }

@media (max-width: 900px) {
  .detail-columns { display: block; }
  .detail-ad { padding-top: 0; margin: 0 0 32px; }
  /* 상세 오른쪽 단이 본문 아래로 내려오면: 사각은 너무 커지지 않게, 3:1 은 화면 폭으로 */
  .detail-ad .ad-row--game-detail-square { max-width: 360px; }
}

/* 좁은 화면: 여러 칸짜리 줄은 한 칸씩 옆으로 넘겨 본다(빈 칸은 빠진다). 광고가 하나뿐이면 폭을 다 쓴다. */
@media (max-width: 639px) {
  .ad-row:not(.ad-row--stack) {
    display: flex; gap: 12px; margin-inline: calc(var(--gutter) * -1); padding: 0 var(--gutter) 4px;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: none;
  }
  .ad-row:not(.ad-row--stack)::-webkit-scrollbar { display: none; }
  .ad-row:not(.ad-row--stack) .ad-cell { flex: 0 0 86%; scroll-snap-align: start; }
  .ad-row--single:not(.ad-row--stack) .ad-cell { flex-basis: 100%; }
  .ad-cell--empty { display: none; }
}

/* --------------------------------------------------------------- 푸터 -- */

.site-footer {
  margin-top: 48px;
  padding: 28px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
.site-footer__row { display: flex; justify-content: space-between; gap: 24px; }
.site-footer strong { font-size: 18px; color: var(--ink); display: block; }
.site-footer__links { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer__links a,
.site-footer__links span {
  font-size: 11px;
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
}
.site-footer__copy { margin-top: 12px; font-size: 10px; }

/* ----------------------------------------------------------- 반응형 -- */

@media (max-width: 1200px) {
  :root { --gutter: 32px; }
  .site-header__row { gap: 22px; }
  .site-nav { gap: 16px; }
  .search-form { width: 260px; }
}

@media (max-width: 1199px) {
  .grid.grid--compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.grid--compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .intro h1 { font-size: 32px; }
  .feature { min-height: 220px; }
  .feature h2 { font-size: 23px; }
  .feature--second h2 { font-size: 20px; }
  .detail-hero { grid-template-columns: 1fr; gap: 24px; }
  .detail-hero h1 { font-size: 32px; }
  .detail-hero__art { aspect-ratio: 16 / 9; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  :root { --gutter: 22px; }

  .site-header__row {
    flex-wrap: wrap;
    gap: 12px;
    min-height: 0;
    /* .wrap 의 좌우 여백을 덮어쓰지 않도록 세로 여백만 지정한다. */
    padding-top: 16px;
    padding-bottom: 16px;
  }
  /* 모바일 헤더의 터치 대상은 모두 최소 44px 를 유지한다. */
  .site-header .button--small { min-height: var(--tap); }
  .site-nav a { min-height: var(--tap); display: inline-flex; align-items: center; }
  .brand { margin-right: auto; }
  .brand__word { font-size: 26px; }
  .site-nav { order: 3; font-size: 12px; gap: 18px; margin-right: auto; }
  .header-actions { order: 2; }
  /* 테두리 포함 46px → 내부 버튼이 44px 터치 높이를 확보한다. */
  .search-form { order: 4; width: 100%; height: 46px; margin-left: 0; }

  .intro { display: block; padding: 27px 0 23px; }
  .intro h1 { font-size: 28px; }
  .intro p { margin: 11px 0 0; }

  .featured { grid-template-columns: 1fr; gap: 12px; }
  .feature { min-height: 200px; }
  .feature--second { min-height: 160px; }
  .feature__copy { padding: 22px 0 20px 22px; }
  .feature h2 { font-size: 24px; }
  .feature--second h2 { font-size: 21px; }

  .section { padding-top: 30px; }
  .section__head h2 { font-size: 21px; }
  .section__head h2 span { display: none; }

  .browse { display: block; margin-top: 30px; }
  .browse .chips { margin-top: 16px; }
  .chip { padding: 8px 15px; }

  .results h1 { font-size: 26px; }
  .detail-nav { gap: 22px; }

  /* 이동 경로도 손가락으로 누를 수 있는 크기를 확보한다. */
  .crumb { padding: 8px 0 14px; }
  .crumb a { display: inline-flex; align-items: center; min-height: var(--tap); }

  .site-footer__row { display: block; }
  .site-footer__links { margin-top: 12px; gap: 14px; }

  .play-stage { max-height: none; }
  .play-foot { display: block; }
  .play-foot__actions { margin-top: 14px; }
}

@media (max-width: 639px) {
  .card__rank { width: 34px; height: 44px; font-size: 21px; padding-top: 5px; }
  .card__rank--1 { width: 38px; height: 49px; font-size: 24px; }
  .card__rank--2, .card__rank--3 { font-size: 22px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
  .grid.grid--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card__title { font-size: 15px; }
  .card__meta { gap: 4px; font-size: 10px; }
  .screens { --per-view: 2; --gap: 10px; }
  .screens-nav--prev { left: 4px; }
  .screens-nav--next { right: 4px; }
  .detail-hero h1 { font-size: 28px; }
  .detail-hero__summary { margin: 14px 0; }
}

@media (max-width: 399px) {
  :root { --gutter: 17px; }
  .grid { grid-template-columns: 1fr; }
  .grid.grid--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 10px; }
  .screens { --per-view: 1; }
  .intro h1 { font-size: 25px; }
  .feature { grid-template-columns: 1fr; min-height: 0; }
  .feature__art { max-height: 150px; }
  .feature h2 { font-size: 21px; }
  .feature__copy { padding: 20px 20px 18px; }
  .results__search { display: block; }
  .results__search .button { width: 100%; margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .site-header, .site-footer, .demo-bar, .detail-nav, .skip { display: none; }
}


/* ==========================================================================
   어두운 테마 (html[data-theme="dark"]). 헤더 "내 계정" 팝업의 테마 선택이 이 속성을 켠다.
   색은 대부분 위의 토큰으로만 쓰이므로 토큰만 덮으면 화면 전체가 바뀐다. 토큰으로 못 만든
   하드코딩 색(배지·경고 등)만 아래에서 따로 바꾼다.
   ========================================================================== */

html[data-theme="dark"] { color-scheme: dark; }

html[data-theme="dark"] {
  --bg: #0f1a1d;
  --surface: #162428;
  --surface-sunk: #0b1315;

  --ink: #e8efe9;
  --muted: #9db0a8;
  --muted-strong: #b6c5be;

  --accent: #3fae9a;
  --accent-dark: #58c4af;
  --accent-soft: #1b3a36;
  --accent-tint: #172f2d;

  --accent-lime: #d7ed85;
  --accent-lime-deep: #a0bc51;
  --brand-on: #b5d45a;
  --brand-mark: #3fae9a;

  --on-ink: #0f1a1d;
  --on-accent: #08201b;

  --warm: #33291f;
  --warm-line: #4a3b2c;

  --line: #2a3b40;
  --line-strong: #3d5158;

  --focus: #e39a63;
  --danger: #ef8a7d;
  --danger-soft: #3a1f1c;
  --danger-line: #6b3a34;
  --ok: #58c4af;
  --ok-soft: #173029;

  --like: #ff7d92;
  --like-soft: #3a1c23;
  --like-line: #6d3340;
  --fav: #f2c45a;
  --fav-soft: #33291a;
  --fav-line: #5e4a26;
}

html[data-theme="dark"] .brand__mark path[stroke] { stroke: var(--brand-mark); }
html[data-theme="dark"] .alert--ok { border-color: #2f5a4c; }
html[data-theme="dark"] .button--danger { color: #2a0d0a; }
html[data-theme="dark"] .button--danger:hover { background: #f4a297; border-color: #f4a297; }
html[data-theme="dark"] .badge { background: #223338; color: #b6c5be; }
html[data-theme="dark"] .badge--external { color: #e0b48a; }
html[data-theme="dark"] .badge--warn { background: var(--warm); color: #e8c39a; }
html[data-theme="dark"] .badge--demo { background: #4a5a1e; color: #eaf5b8; }
html[data-theme="dark"] .feature--second .feature__chip { color: #e0b48a; }
html[data-theme="dark"] .notice-box--warn { color: #e8c39a; }
html[data-theme="dark"] dialog.lightbox { box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6); }
html[data-theme="dark"] img { opacity: 0.92; }

/* 회원 문의 */
.inquiry-link { border: 0; padding: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; }
.inquiry-dialog { width: min(560px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 24px; border: 1px solid var(--line, #d6e3de); border-radius: 20px; background: var(--bg, #fff); color: var(--ink, #18372e); }
.inquiry-dialog::backdrop { background: rgb(0 0 0 / 55%); }
.inquiry-dialog__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.inquiry-dialog__header h2 { margin: 0; }
.inquiry-form { display: grid; gap: 16px; }
.inquiry-form .field { display: grid; gap: 6px; }
.inquiry-form input, .inquiry-form select, .inquiry-form textarea { width: 100%; min-width: 0; }
.inquiry-form button:disabled { opacity: .5; cursor: not-allowed; }

.inquiry-notice { padding: 16px; border-radius: 8px; background: var(--surface-sunk); line-height: 1.7; }
.inquiry-notice a { text-decoration: underline; }

/* 내 플레이 기록 */
.plays-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.plays-head__desc { margin: 4px 0 0; font-size: 14px; }
.plays-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 20px 0 0; }
.plays-summary > div { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--accent-soft); }
.plays-summary dt { font-size: 13px; color: var(--muted); }
.plays-summary dd { margin: 4px 0 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.plays-list { list-style: none; margin: 0; padding: 0; }
.plays-item {
  display: grid; grid-template-columns: 128px minmax(0, 1fr) auto auto; gap: 16px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.plays-item:first-child { padding-top: 0; }
.plays-item__art { display: block; width: 128px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 7px; background: var(--accent-soft); border: 1px solid var(--line); }
.plays-item__art img { width: 100%; height: 100%; object-fit: cover; }
.plays-item__title { font-weight: 700; font-size: 16px; color: inherit; }
.plays-item__meta { margin: 4px 0 0; font-size: 13px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.plays-item__stats { display: flex; gap: 18px; margin: 0; }
.plays-item__stats dt { font-size: 12px; color: var(--muted); }
.plays-item__stats dd { margin: 2px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.plays-item__actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.plays-item__actions form { margin: 0; }
.plays-item__delete, .plays-clear .linkish { font-size: 12px; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; }
.plays-item__closed { font-size: 12px; }
.plays-clear { margin: 18px 0 0; text-align: right; }
@media (max-width: 639px) {
  .plays-head { flex-direction: column; gap: 8px; }
  .plays-summary { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .plays-summary > div { padding: 10px; }
  .plays-summary dd { font-size: 17px; }
  .plays-item { grid-template-columns: 96px minmax(0, 1fr); gap: 10px 12px; }
  .plays-item__art { width: 96px; }
  .plays-item__stats { grid-column: 2; }
  .plays-item__actions { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
}

/* ---------------------------------------------------- 좋아요 · 즐겨찾기 -- */

.reactions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.reactions form { display: contents; }
.reaction {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.reaction:hover { border-color: var(--ink); background: var(--surface-sunk); }
.reaction--share .reaction__icon { color: var(--muted-strong); }
.reaction[hidden] { display: none; }
.reaction__icon { flex: none; color: var(--muted); }
.reaction__icon path { fill-opacity: 0; transition: fill-opacity .15s ease; }
.reaction__count { font-variant-numeric: tabular-nums; color: var(--muted-strong); }

.reaction--like[aria-pressed="true"] { border-color: var(--like-line); background: var(--like-soft); color: var(--like); }
.reaction--like[aria-pressed="true"] .reaction__icon,
.reaction--like[aria-pressed="true"] .reaction__count { color: var(--like); }
.reaction--favorite[aria-pressed="true"] { border-color: var(--fav-line); background: var(--fav-soft); color: var(--ink); }
.reaction--favorite[aria-pressed="true"] .reaction__icon { color: var(--fav); }
.reaction[aria-pressed="true"] .reaction__icon path { fill-opacity: 1; }
.reaction[aria-busy="true"] { cursor: progress; }

/* 누를 때 아이콘이 톡 튀어 오른다(움직임 줄이기 설정이면 아래 전역 규칙이 끈다). */
.reaction.is-popping .reaction__icon { animation: reaction-pop .38s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes reaction-pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) { .reaction.is-popping .reaction__icon { animation: none; } }

/* 플레이 화면 상단 막대: 아이콘과 숫자만. 제목이 좁아지면 버튼들이 다음 줄로 내려간다. */
.play-bar .play-bar__title { flex: 1 1 200px; }
.reactions--compact { margin: 0; gap: 6px; }
.play-bar__icons { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.play-bar__icons .reactions--compact { display: contents; }
.play-bar__icons .reaction--board { padding: 0 12px; }
.reactions--compact .reaction { padding: 0 12px; gap: 6px; }

/* 게임 카드의 좋아요 수 */
.card__likes { display: inline-flex; align-items: center; gap: 3px; color: var(--like); font-weight: 700; font-variant-numeric: tabular-nums; }
.card__likes svg { flex: none; }

/* 알림(토스트): 화면 아래 가운데에 잠깐 나타난다. */
.toast-region {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1000;
  transform: translateX(-50%);
  width: min(440px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 12px 16px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--on-ink);
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
  pointer-events: auto;
  animation: toast-in .18s ease-out;
}
.toast[hidden] { display: none; }
.toast__action {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-lime);
  color: #1d2b0a;
  font-weight: 800;
}
.toast__action:hover { color: #1d2b0a; background: var(--accent-lime-deep); }
.toast__close { flex: none; min-width: 36px; min-height: 36px; color: inherit; opacity: .75; font-size: 16px; }
.toast__close:hover { opacity: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 내 즐겨찾기 */
.plays-head__links { display: inline-flex; flex-wrap: wrap; }
.favorites-count { margin: 16px 0 0; font-size: 14px; color: var(--muted-strong); font-weight: 700; }
.favorites-item { display: flex; flex-direction: column; min-width: 0; }
.favorites-item__remove { margin: 4px 0 0; }
.favorites-item__remove .linkish { gap: 5px; padding: 0 2px; font-size: 12px; color: var(--muted); }
.favorites-item__remove .linkish svg { color: var(--fav); }
.favorites-item__remove .linkish:hover { color: var(--danger); }

@media (max-width: 639px) {
  .reactions { margin-top: 12px; }
  .reactions:not(.reactions--compact) .reaction { flex: 1 1 0; justify-content: center; }
  .toast-region { bottom: 16px; }
}

/* ==========================================================================
   순위표 (게임 상세 #leaderboard) · 내 최고 기록
   ========================================================================== */
.lb { position: relative; }
.lb[aria-busy="true"] { opacity: .6; transition: opacity .15s ease; }
.lb__controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0 0 14px; }
.lb__board-form { display: flex; align-items: center; gap: 8px; margin: 0; min-width: 0; flex: 1 1 260px; }
.lb__board-label { font-size: 13px; font-weight: 700; color: var(--muted-strong); white-space: nowrap; }
.lb__board-form select {
  min-height: var(--tap); min-width: 0; flex: 1 1 auto; max-width: 360px;
  padding: 0 36px 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 700;
}
.lb__chips, .lb__periods { display: flex; flex-wrap: wrap; gap: 6px; }
.lb__chip, .lb__period {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--muted-strong); font-size: 13px; font-weight: 700; white-space: nowrap;
}
.lb__chip:hover, .lb__period:hover { border-color: var(--ink); color: var(--ink); }
.lb__chip[aria-current="true"], .lb__period[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.lb__periods { padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface-sunk); gap: 2px; }
.lb__period { border-color: transparent; background: transparent; min-height: 34px; }
.lb__period[aria-current="true"] { border-color: var(--ink); }

.detail-body .lb__caption { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 0 0 10px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.lb__caption strong { color: var(--ink); }
.lb__caption span + span::before { content: "·"; margin-right: 10px; color: var(--line-strong); }

.lb__list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.lb__row, .lb__me {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 84px; align-items: center; gap: 12px;
  padding: 9px 16px; font-variant-numeric: tabular-nums;
}
.lb__row + .lb__row { border-top: 1px solid var(--line); }
.lb__row.is-me { background: var(--accent-tint); box-shadow: inset 3px 0 0 var(--accent); }
.lb__rank {
  display: inline-flex; align-items: flex-start; justify-content: center; width: 30px; height: 36px; padding-top: 5px;
  font-size: 16px; font-weight: 900; font-style: italic; letter-spacing: -.5px; line-height: 1;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .38) 0, rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, .14) 100%);
  background-color: var(--rank-bg); color: var(--rank-ink);
}
.lb__rank--1 { --rank-bg: var(--rank-gold); --rank-ink: var(--rank-gold-ink); }
.lb__rank--2 { --rank-bg: var(--rank-silver); --rank-ink: var(--rank-silver-ink); }
.lb__rank--3 { --rank-bg: var(--rank-bronze); --rank-ink: var(--rank-bronze-ink); }
.lb__rank--n { clip-path: none; background: none; color: var(--muted-strong); font-style: normal; font-weight: 800; padding-top: 0; align-items: center; height: 28px; }
.lb__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: var(--ink); }
.lb__you { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: var(--radius-pill); background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 800; vertical-align: 2px; }
.lb__guest { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: var(--radius-pill); border: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 700; vertical-align: 2px; }
.lb__score { font-weight: 800; font-size: 15px; color: var(--ink); text-align: right; white-space: nowrap; }
/* 승률 순위표: 점수 아래에 승률·승무패 */
.lb__detail { display: block; margin-top: 1px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.lb__date { font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; }
.lb__empty { margin: 0; padding: 28px 16px; border: 1px dashed var(--line-strong); border-radius: 10px; text-align: center; background: var(--surface); }
.detail-body .lb__empty { color: var(--muted-strong); line-height: 1.6; }
.lb__me { margin-top: 10px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-soft); grid-template-columns: minmax(0, 1fr) auto 84px; }
.lb__me-label { font-weight: 800; color: var(--accent-dark); }
.detail-body .lb__me--none { display: block; margin: 10px 0 0; padding: 10px 16px; border: 1px dashed var(--line-strong); background: transparent; font-size: 13px; line-height: 1.6; color: var(--muted-strong); }
.lb__me--none a { text-decoration: underline; font-weight: 700; color: var(--accent); }
.detail-body .lb__note { margin: 10px 0 0; font-size: 12px; line-height: 1.6; color: var(--muted); }

/* 플레이 화면 상단의 "순위표" 바로가기 */
.reaction--board { text-decoration: none; }
.reaction--board .reaction__icon { color: var(--fav); }

/* 내 최고 기록 */
.records-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.records-game { padding: 0 0 18px; border-bottom: 1px solid var(--line); }
.records-game:last-child { border-bottom: 0; padding-bottom: 0; }
.records-game__head { display: grid; grid-template-columns: 128px minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.records-table { width: 100%; margin: 12px 0 0; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.records-table th, .records-table td { padding: 9px 10px; border-top: 1px solid var(--line); text-align: left; }
.records-table { table-layout: fixed; }
.records-table thead th:nth-child(1) { width: 42%; }
.records-table thead th:nth-child(2) { width: 22%; }
.records-table thead th:nth-child(3) { width: 16%; }
.records-table thead th { border-top: 0; font-size: 12px; font-weight: 700; color: var(--muted); padding-top: 0; }
.records-table tbody th { font-weight: 700; }
.records-table tbody th a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.records-table__score { font-weight: 800; white-space: nowrap; }
.records-table__rank, .records-table__date { white-space: nowrap; }
.records-table__date { color: var(--muted); font-size: 13px; }
.records-rank { font-weight: 800; color: var(--accent-dark); }
.records-rank--top { display: inline-block; padding: 1px 8px; border-radius: var(--radius-pill); background: var(--rank-gold); color: var(--rank-gold-ink); }

@media (max-width: 639px) {
  .lb__controls { flex-direction: column; align-items: stretch; }
  .lb__board-form { flex: none; }
  .lb__board-form select { max-width: none; }
  .lb__periods { align-self: flex-start; }
  .lb__row, .lb__me { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 4px 10px; padding: 9px 12px; }
  .lb__me { grid-template-columns: minmax(0, 1fr) auto; }
  .lb__row .lb__date { grid-column: 2; grid-row: 2; text-align: left; margin-top: -2px; }
  .lb__me .lb__date { grid-column: 1 / -1; text-align: left; }
  .lb__rank { grid-row: 1 / span 2; }
  .records-game__head { grid-template-columns: 96px minmax(0, 1fr); }
  .records-game__head .plays-item__art { width: 96px; }
  .records-game__play { grid-column: 1 / -1; justify-self: start; }
  .records-table { table-layout: auto; }
  .records-table thead { display: none; }
  .records-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 9px 0; border-top: 1px solid var(--line); }
  .records-table th, .records-table td { padding: 0; border: 0; }
  .records-table__score { text-align: right; }
  .records-table__rank { grid-column: 1; font-size: 13px; }
  .records-table__rank::before { content: "전체 순위 "; color: var(--muted); font-weight: 600; }
  .records-table__date { text-align: right; }
  .reaction--board .reaction__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* --------------------------------------------------------- 클라우드 저장 -- */

/* 플레이 화면의 작은 저장 상태(☁ 저장됨 · 방금). 눈에 띄지 않게 흐린 글씨로 둔다. */
.cloud-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.cloud-status[hidden] { display: none; }
.cloud-status__icon { flex: none; color: var(--ok); }
.cloud-status--busy .cloud-status__icon { opacity: .55; }
.cloud-status--error .cloud-status__icon { color: var(--muted); }
/* 플레이 화면 막대: 좋아요·즐겨찾기와 같은 크기의 아이콘 칸. 저장 상태는 말풍선(title)과 화면 읽기용 글자로 알린다. */
.cloud-status--icon {
  justify-content: center;
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  cursor: default;
}
.cloud-status--icon.cloud-status--error { border-color: var(--line); }

/* 저장된 게임 목록 */
.saves-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.saves-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.saves-item__art { width: 96px; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: var(--stage); display: block; }
.saves-item__art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.saves-item__title { margin: 0 0 4px; font-size: 16px; }
.saves-item__title a { color: inherit; text-decoration: none; }
.saves-item__meta { margin: 0; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.saves-item__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.saves-item__actions form { margin: 0; }
@media (max-width: 639px) {
  .saves-item { grid-template-columns: 80px minmax(0, 1fr); }
  .saves-item__art { width: 80px; }
  .saves-item__actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* 플레이 화면 상단(모바일): 1줄 제목, 2줄 아이콘 묶음 + 전체화면(오른쪽 끝).
   버튼 높이와 세로 위치를 한 줄로 맞춘다(모바일의 .reactions 위쪽 여백이 압축 막대에도 붙어 어긋났었다). */
@media (max-width: 639px) {
  .play-bar { gap: 10px 8px; padding: 12px 0; }
  .play-bar .play-bar__title { flex: 1 1 calc(100% - 110px); }
  /* 아이콘 묶음(순위표·저장·좋아요·즐겨찾기·공유하기)은 제목 아래 줄에, 전체화면은 같은 줄 오른쪽 끝에. */
  .play-bar__icons { order: 1; gap: 5px; }
  .play-bar__icons .reaction, .play-bar__icons .cloud-status--icon, .play-bar__icons .reaction--board { min-width: 40px; padding: 0 10px; }
  .play-bar .button--fullscreen { order: 2; margin-left: auto; min-height: var(--tap); padding: 0 12px; gap: 6px; font-size: 14px; }
}

/* 회원가입 보안 문자 */
.captcha__row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.captcha__img { display: block; width: 200px; height: 64px; border: 1px solid var(--line); border-radius: 8px; background: #f6f4ee; }
.captcha__refresh { display: inline-flex; align-items: center; gap: 6px; }
.captcha input { text-transform: uppercase; letter-spacing: 0.12em; max-width: 220px; }
/* 스팸 방지용 숨은 칸: 화면·보조기기 모두에서 빼되 display:none 은 쓰지 않는다(일부 프로그램이 건너뜀). */
.hp-field { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* 릴리즈: "바로 플레이" 옆 ▾(예전 버전 고르기)와 게임 상세의 릴리즈 목록 */
.play-split { position: relative; display: flex; gap: 6px; align-items: stretch; }
.play-split > .button--block { flex: 1 1 auto; width: auto; }
.detail-hero .play-split .button { width: auto; }
.play-versions { position: static; flex: 0 0 auto; }
.play-versions > summary { list-style: none; }
.play-versions > summary::-webkit-details-marker { display: none; }
.play-versions__toggle { height: 100%; min-width: 50px; padding: 0 14px; cursor: pointer; }
.play-versions__toggle svg { transition: transform .15s ease; }
.play-versions[open] .play-versions__toggle svg { transform: rotate(180deg); }
.play-versions__menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20;
  width: min(320px, 100%); padding: 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .14);
}
.play-versions__head { margin: 2px 6px 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.play-versions__menu ul { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; }
.play-versions__menu a { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; min-height: var(--tap); padding: 10px; border-radius: 8px; color: var(--ink); }
.play-versions__menu a:hover, .play-versions__menu a:focus-visible { background: var(--surface-sunk); }
.play-versions__menu strong { font-size: 14px; }
.play-versions__menu small { font-size: 12px; color: var(--muted); white-space: nowrap; }
.play-versions__note { margin: 6px 6px 2px !important; font-size: 11.5px; line-height: 1.5 !important; color: var(--muted) !important; }

.release-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.release { border-bottom: 1px solid var(--line); }
.release__head { display: flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 12px 4px; cursor: pointer; list-style: none; }
.release__head::-webkit-details-marker { display: none; }
.release__head:hover .release__version { text-decoration: underline; }
.release__chev { flex: none; color: var(--muted); transition: transform .15s ease; }
.release__item[open] .release__chev { transform: rotate(90deg); }
.release__version { font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.release__date { margin-left: auto; flex: none; font-size: 13px; color: var(--muted); }
.release__body { padding: 0 4px 14px 28px; }
.release__notes { margin: 0; }
.release__play { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--accent); text-decoration: underline; }
.badge--current { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.badge--version { margin-left: 6px; vertical-align: middle; font-size: 12px; }

/* 헤더 위 한 줄 공지(운영 화면 "공지 관리") */
.site-notice { padding: 9px 16px; text-align: center; }
.site-notice + .site-notice { border-top: 1px solid rgba(255, 255, 255, .18); }
.site-notice__text { margin: 0 auto; max-width: 1200px; font-size: 14px; font-weight: 700; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: inherit; }
.site-notice--row { border-radius: 8px; padding: 7px 12px; text-align: left; }
.site-notice--row .site-notice__text { max-width: 420px; margin: 0; font-size: 13px; }
@media (max-width: 640px) { .site-notice { padding: 8px 12px; } .site-notice__text { font-size: 13px; } }

/* 댓글: 채팅 입력창 + 프로필 동그라미가 있는 카드 목록 */
.comment-avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 16px; font-weight: 800; color: #fff; line-height: 1;
  background: var(--accent); box-shadow: 0 0 0 3px var(--bg);
}
.comment-avatar--0 { background: #176759; }
.comment-avatar--1 { background: #2f6db5; }
.comment-avatar--2 { background: #c0574a; }
.comment-avatar--3 { background: #8a5cb8; }
.comment-avatar--4 { background: #d9822b; }
.comment-avatar--5 { background: #3d8f8a; }
.comment-avatar--6 { background: #b8507e; }
.comment-avatar--7 { background: #6b7d2e; }
.comment-avatar--none { background: var(--surface-sunk); color: var(--muted); box-shadow: 0 0 0 3px var(--bg), inset 0 0 0 1px var(--line); }

.comment-composer { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 28px; flex-wrap: wrap; }
.comment-composer__box {
  flex: 1 1 0; min-width: 0;
  border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.comment-composer__box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.comment-composer__box.field--invalid { border-color: var(--danger); }
.comment-composer__box textarea {
  display: block; width: 100%; min-height: 84px; max-height: 320px; resize: none;
  padding: 14px 16px 6px; border: 0; border-radius: 16px 16px 0 0; background: transparent;
  color: var(--ink); font: inherit; font-size: 15px; line-height: 1.6; outline: none;
}
.comment-composer__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 8px 16px; }
.comment-composer__count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.comment-composer__send { border-radius: 999px; padding-left: 16px; padding-right: 18px; gap: 6px; }
.comment-composer__error { flex: 1 0 100%; margin: 0 0 0 52px !important; }
.comment-composer--gate { align-items: center; padding: 16px; border: 1px dashed var(--line-strong); border-radius: 16px; background: var(--surface); }
.comment-gate p { margin: 0; }
.comment-gate__actions { display: flex; align-items: center; gap: 14px; margin-top: 10px !important; }
.comment-composer--gate .comment-gate { flex: 1 1 0; min-width: 0; }

.comment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.comment-item { display: flex; gap: 12px; align-items: flex-start; }
.comment-card {
  position: relative; flex: 1 1 0; min-width: 0;
  padding: 14px 16px 12px; border: 1px solid var(--line); border-radius: 4px 16px 16px 16px;
  background: var(--surface);
}
.comment-item--mine .comment-card { background: var(--accent-tint); border-color: transparent; }
.comment-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0 0 4px !important; line-height: 1.4 !important; }
.comment-meta__name { font-size: 14px; color: var(--ink); }
.comment-meta__me { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: var(--on-accent); }
.comment-meta__time { font-size: 12px; color: var(--muted); }
.comment-body { margin: 0 !important; color: var(--ink) !important; line-height: 1.75 !important; overflow-wrap: anywhere; }
.comment-hidden { flex: 1 1 0; margin: 0 !important; padding: 12px 16px; border: 1px dashed var(--line); border-radius: 4px 16px 16px 16px; font-size: 13px; }

.comment-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 12px; margin-top: 8px; }
.comment-actions form { margin: 0; }
.comment-actions--social { align-items: center; gap: 4px 16px; }
.comment-actions--social > form { display: inline-flex; }
.comment-actions--social button[aria-pressed="true"] { color: var(--accent); }
.comment-like-count { cursor: default; }
.comment-reply-form[open] { flex: 1 0 100%; min-width: 0; }
.comment-reply-form[open] .comment-subform { display: block; width: 100%; box-sizing: border-box; }
.comment-reply-form[open] .comment-subform textarea { min-height: 84px; resize: vertical; }
.comment-actions--social > .comment-report { margin-left: auto; }
.comment-action {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 2px;
  border: 0; background: none; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 700;
  cursor: pointer; list-style: none;
}
.comment-action__icon { display: inline-grid; flex: none; width: 14px; height: 14px; place-items: center; margin-right: 6px; font-size: 15px; line-height: 1; }
.comment-action::-webkit-details-marker { display: none; }
.comment-action:hover, details[open] > .comment-action { color: var(--ink); text-decoration: underline; }
.comment-action--danger:hover { color: var(--danger); }
.comment-edit[open], .comment-report[open] { flex: 1 0 100%; }
.comment-subform { margin-top: 8px; padding: 12px; border-radius: 12px; background: var(--surface-sunk); }
.comment-subform .field { margin: 0; }
.comment-subform textarea { width: 100%; border-radius: 10px; }
.comment-subform__bar { display: flex; justify-content: flex-end; margin-top: 8px; }
.comment-replies { list-style: none; display: grid; gap: 10px; margin: 14px 0 0; padding: 14px 0 0 14px; border-top: 1px solid var(--line); }
.comment-reply { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.comment-card--reply { padding: 11px 13px 10px; background: var(--surface-sunk); }
.comment-item--mine .comment-card--reply { background: var(--accent-tint); }
.comment-empty { margin: 4px 0 0 52px; }

@media (max-width: 560px) {
  .comment-avatar { width: 34px; height: 34px; font-size: 14px; }
  .comment-composer, .comment-item { gap: 10px; }
  .comment-composer__error { margin-left: 44px !important; }
  .comment-empty { margin-left: 0; }
}

/* 언어 선택(바닥글) */
.site-footer__bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.site-footer__bottom .site-footer__copy { margin-top: 0; }
.locale-menu { position: relative; }
.locale-menu__button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--ink); font-size: 13px; font-weight: 700; cursor: pointer; list-style: none;
}
.locale-menu__button::-webkit-details-marker { display: none; }
.locale-menu__button:hover, .locale-menu[open] > .locale-menu__button { border-color: var(--line-strong); background: var(--surface-sunk); }
.locale-menu__list {
  position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 30; min-width: 180px;
  list-style: none; margin: 0; padding: 6px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); box-shadow: 0 12px 30px rgba(0, 0, 0, .14);
}
.locale-menu__list a { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: var(--tap); padding: 8px 10px; border-radius: 8px; color: var(--ink); font-size: 14px; }
.locale-menu__list a:hover, .locale-menu__list a:focus-visible { background: var(--surface-sunk); }
.locale-menu__list a.is-current { font-weight: 800; color: var(--accent); }
.locale-menu__list small { font-size: 11px; font-weight: 700; color: var(--muted); }

/* 내 계정: 위쪽 프로필 + 탭, 내 정보의 두 열 정보 */
.account-head { display: flex; align-items: center; gap: 12px; margin: 40px 0 16px; }
.account-head__avatar {
  flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-size: 20px; font-weight: 800;
}
.account-head__who { display: grid; gap: 2px; min-width: 0; }
.account-head__who strong { font-size: 18px; overflow-wrap: anywhere; }
.account-head__who span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

.account-tabs {
  display: flex; gap: 4px; margin: 0 0 20px; border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.account-tabs::-webkit-scrollbar { display: none; }
.account-tabs__tab {
  flex: none; display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 16px;
  margin-bottom: -1px; border-bottom: 2px solid transparent;
  color: var(--muted); font-size: 14px; font-weight: 700; white-space: nowrap;
}
.account-tabs__tab:hover { color: var(--ink); }
.account-tabs__tab.is-current { color: var(--ink); border-bottom-color: var(--accent); }
.account-tabs + .panel { margin-top: 0; }

.account-info { margin: 12px 0 0; }
.account-info__row {
  display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 4px 20px; align-items: center;
  padding: 14px 0; border-top: 1px solid var(--line);
}
.account-info__row:first-child { border-top: 0; }
.account-info__row--form { align-items: start; }
.account-info__row--form dt { padding-top: 11px; }
.account-info dt { margin: 0; font-size: 14px; font-weight: 700; color: var(--muted-strong); }
.account-info dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; overflow-wrap: anywhere; }
.account-info dd .account-name { flex: 1 1 auto; }
.account-name { margin: 0; max-width: 480px; }
.account-name__line { display: flex; gap: 8px; }
.account-name__line input { flex: 1 1 auto; min-width: 0; }
.account-name__line .button { flex: none; }
.account-name .field__hint, .account-name .field__error { margin: 6px 0 0; }
.account-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.account-badge--ok { background: var(--accent-tint); color: var(--accent); }
.account-badge--warn { background: var(--warm); color: #7d5330; }
.account-manage { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 8px; }

@media (max-width: 560px) {
  .account-head { margin-top: 24px; }
  .account-info__row { grid-template-columns: 1fr; gap: 6px; padding: 12px 0; }
  .account-info__row--form dt { padding-top: 0; }
}

/* 안내 페이지 본문(마크다운을 HTML 로 바꾼 것): 읽기 좋은 폭과 문단·제목·목록 모양 */
.page-body { max-width: 760px; font-size: 15px; line-height: 1.85; color: var(--muted-strong); overflow-wrap: anywhere; }
.page-body > :first-child { margin-top: 0; }
.page-body p { margin: 0 0 14px; }
.page-body h2 { margin: 36px 0 12px; font-size: 20px; line-height: 1.4; letter-spacing: -0.4px; color: var(--ink); }
.page-body h3 { margin: 28px 0 10px; font-size: 17px; line-height: 1.45; color: var(--ink); }
.page-body h4 { margin: 22px 0 8px; font-size: 15px; color: var(--ink); }
.page-body ol, .page-body ul { margin: 0 0 16px; padding-left: 1.4em; }
.page-body li { margin: 0 0 8px; padding-left: 2px; }
.page-body li > p { margin: 0 0 6px; }
.page-body li::marker { color: var(--muted); font-weight: 700; }
.page-body strong { color: var(--ink); }
.page-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.page-body hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.page-body blockquote { margin: 0 0 16px; padding: 10px 16px; border-left: 3px solid var(--line-strong); background: var(--surface-sunk); border-radius: 0 8px 8px 0; }
.page-body blockquote p:last-child { margin-bottom: 0; }
.page-body code { padding: 1px 5px; border-radius: 4px; background: var(--surface-sunk); font-size: .92em; }
.page-body table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 14px; }
.page-body th, .page-body td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.page-body th { background: var(--surface-sunk); color: var(--ink); }
.badge--lang { background: #fdf0d8; color: #8a5a1c; font-weight: 700; }
html[data-theme="dark"] .badge--lang { background: #3a2e1a; color: #f0c98a; }

/* --------------------------------------------------------- 인기 게임 랭킹 -- */
/* games/popular: 기간 탭, TOP 3 시상대(2·1·3), 4위부터 목록. 순위 변동은 ▲(오름·빨강) ▼(내림·파랑) – NEW 🔥급상승.
   색만으로 구분하지 않도록 기호·글자를 함께 쓴다. 등장 애니메이션은 '동작 줄이기'에서 끈다. */
:root { --rank-up: #c8323f; --rank-down: #2f5d94; }
html[data-theme="dark"] { --rank-up: #ff7a85; --rank-down: #7fb0ec; }

.rank-page { padding: 38px 0 72px; } /* 위 여백·제목은 .results(게임 찾기·랭킹 게임)와 같다 */
.rank-hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0 24px; }
.rank-hero h1 { font-size: 30px; margin: 0 0 18px; letter-spacing: -1px; }
.rank-periods { margin-bottom: 18px; }
.rank-periods { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface-sunk); }
.rank-periods a { min-width: 64px; padding: 8px 16px; border-radius: var(--radius-pill); color: var(--muted-strong); font-size: 14px; font-weight: 700; text-align: center; text-decoration: none; }
.rank-periods a:hover { color: var(--ink); }
.rank-periods a[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
.rank-meta { margin: 0 0 28px; color: var(--muted); font-size: 13px; }

/* 순위 변동 */
.rank-change { display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-change--up { color: var(--rank-up); }
.rank-change--down { color: var(--rank-down); }
.rank-change--same { color: var(--muted); }
.rank-change--new { padding: 1px 6px; border-radius: 4px; background: var(--accent-lime); color: #2b3a0a; font-size: 11px; letter-spacing: .04em; }
.rank-source { display: inline-flex; padding: 1px 7px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); color: var(--muted-strong); font-size: 11px; font-weight: 700; white-space: nowrap; }
.rank-fill-note { margin: -18px 0 26px; padding: 10px 14px; border-radius: 10px; background: var(--accent-tint); color: var(--muted-strong); font-size: 13px; }
.rank-divider { display: flex; align-items: center; gap: 12px; margin: 10px 0 2px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.rank-divider::before, .rank-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.rank-row--filled .rank-row__num { color: var(--muted-strong); }
.rank-hot { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: var(--radius-pill); background: #fdece6; color: #b4361d; font-size: 11.5px; font-weight: 800; white-space: nowrap; }
html[data-theme="dark"] .rank-hot { background: #3a1d16; color: #ffab8f; }

/* 날짜별 플레이 추이 */
.rank-spark { display: block; overflow: visible; }
.rank-spark__bar { fill: var(--line-strong); }
.rank-spark__bar--last { fill: var(--accent); }
.rank-spark__bar:hover { fill: var(--accent-dark); }

/* TOP 3 시상대 */
.rank-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 20px; margin: 0 0 32px; padding: 20px 0 0; list-style: none; }
.podium { min-width: 0; animation: rank-rise .5s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i) * 90ms + 60ms); }
.podium--1 { order: 2; animation-delay: 0ms; }
.podium--2 { order: 1; }
.podium--3 { order: 3; }
.podium__card { position: relative; display: flex; flex-direction: column; overflow: visible; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
.podium__card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(24, 46, 51, .12); color: var(--ink); }
.podium--1 .podium__card { transform: translateY(-18px); border-color: color-mix(in srgb, var(--rank-gold) 60%, var(--line)); box-shadow: 0 18px 40px rgba(242, 183, 5, .18); }
.podium--1 .podium__card:hover { transform: translateY(-21px); }
.podium__art { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 13px 13px 0 0; background: var(--accent-soft); }
.podium__art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.podium__medal { position: absolute; top: -14px; left: 14px; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; border: 3px solid var(--surface); border-radius: 50%;
  background: var(--medal, var(--rank-teal)); color: var(--medal-ink, var(--rank-teal-ink)); font-size: 20px; font-weight: 900; box-shadow: 0 4px 12px rgba(0, 0, 0, .18); overflow: hidden; }
.podium--1 .podium__medal { --medal: var(--rank-gold); --medal-ink: var(--rank-gold-ink); width: 54px; height: 54px; top: -20px; font-size: 24px; overflow: visible; }
.podium--2 .podium__medal { --medal: var(--rank-silver); --medal-ink: var(--rank-silver-ink); }
.podium--3 .podium__medal { --medal: var(--rank-bronze); --medal-ink: var(--rank-bronze-ink); }
.podium__crown { position: absolute; top: -17px; left: 50%; width: 26px; height: 17px; transform: translateX(-50%) rotate(-8deg); fill: var(--rank-gold); stroke: var(--rank-gold-ink); stroke-width: 1; animation: rank-crown 2.6s ease-in-out 1s infinite; }
/* 1위 메달에 한 번 지나가는 빛 */
.podium--1 .podium__medal::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .75) 50%, transparent 65%) -60px 0 / 200% 100% no-repeat; animation: rank-shine 1.4s ease .7s both; }
.podium__body { display: grid; gap: 6px; padding: 16px 16px 14px; }
.podium__changes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 20px; }
.podium__title { font-size: 17px; line-height: 1.35; letter-spacing: -.3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium--1 .podium__title { font-size: 19px; }
.podium__sub { color: var(--muted); font-size: 12.5px; }
.podium__stats { display: flex; gap: 12px; color: var(--muted-strong); font-size: 13px; }
.podium__stats b { color: var(--ink); font-variant-numeric: tabular-nums; }
.podium .rank-spark { width: auto; max-width: 100%; height: 30px; margin-top: 4px; }

/* 4위부터 */
.rank-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.rank-row { display: grid; grid-template-columns: 40px 64px 112px minmax(0, 1fr) auto 170px auto; align-items: center; gap: 14px; padding: 10px 14px 10px 10px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); animation: rank-rise .45s ease both; animation-delay: calc(var(--i) * 35ms + 300ms); }
.rank-row:hover { border-color: var(--line-strong); }
.rank-row__num { color: var(--ink); font-size: 22px; font-weight: 900; text-align: center; font-variant-numeric: tabular-nums; }
.rank-row__change { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.rank-row__art { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 8px; background: var(--accent-soft); }
.rank-row__art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rank-row__main { display: grid; min-width: 0; }
.rank-row__title { overflow: hidden; color: var(--ink); font-size: 15px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.rank-row__title:hover { text-decoration: underline; }
.rank-row__sub { color: var(--muted); font-size: 12.5px; }
.rank-row__score { display: grid; gap: 6px; }
.rank-row__plays { color: var(--muted-strong); font-size: 12.5px; }
.rank-row__plays b { color: var(--ink); font-variant-numeric: tabular-nums; }
.rank-row__bar { display: block; height: 6px; overflow: hidden; border-radius: 3px; background: var(--surface-sunk); }
.rank-row__bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }

@keyframes rank-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes rank-shine { from { background-position: -60px 0; } to { background-position: 80px 0; } }
@keyframes rank-crown { 0%, 100% { transform: translateX(-50%) rotate(-8deg); } 50% { transform: translateX(-50%) translateY(-2px) rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) {
  .podium, .rank-row, .podium__crown, .podium--1 .podium__medal::after { animation: none; }
}

@media (max-width: 1023px) {
  .rank-row { grid-template-columns: 36px 56px 96px minmax(0, 1fr) 140px auto; }
  .rank-row__trend { display: none; }
}
@media (max-width: 860px) {
  .rank-hero h1 { font-size: 26px; }
}
@media (max-width: 760px) {
  .rank-podium { grid-template-columns: minmax(0, 1fr); gap: 26px; padding-top: 24px; }
  .podium--1, .podium--2, .podium--3 { order: 0; }
  .podium--1 .podium__card, .podium--1 .podium__card:hover { transform: none; }
  .podium__card { flex-direction: row; }
  .podium__art { flex: 0 0 42%; aspect-ratio: 16 / 9; border-radius: 13px 0 0 13px; align-self: center; }
  .podium__body { min-width: 0; padding: 12px 14px; }
  .rank-row { grid-template-columns: 30px 88px minmax(0, 1fr) auto; grid-template-areas: "num art main play" "num art score score"; gap: 4px 12px; padding: 10px; }
  .rank-row__num { grid-area: num; font-size: 18px; }
  .rank-row__art { grid-area: art; }
  .rank-row__main { grid-area: main; }
  .rank-row__score { grid-area: score; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; }
  .rank-row__play { grid-area: play; }
  .rank-row__change { position: absolute; }
  .rank-row { position: relative; }
  .rank-row__change { top: 6px; right: 10px; flex-direction: row; }
  .rank-row__play { display: none; }
}

/* 게임 자랑하기(HanulOn.share) 공유 창 */
.share-dialog { width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 20px; border: 1px solid var(--line, #d6e3de); border-radius: 20px; background: var(--bg, #fff); color: var(--ink, #18372e); }
.share-dialog::backdrop { background: rgb(0 0 0 / 60%); }
.share-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.share-dialog__head h2 { margin: 0; font-size: 20px; }
.share-dialog__close { width: 36px; height: 36px; border: 1px solid var(--line, #d6e3de); border-radius: 8px; background: transparent; color: inherit; font-size: 16px; cursor: pointer; }
.share-dialog__img { display: block; width: 100%; height: auto; max-height: 42vh; max-height: 42dvh; object-fit: contain; border-radius: 14px; }
.share-dialog__img[hidden] { display: none; }
.share-dialog__text { margin: 12px 0 16px; line-height: 1.6; white-space: pre-line; }
.share-dialog__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.share-dialog__actions .button { flex: 1 1 120px; justify-content: center; }
.share-dialog__actions [hidden] { display: none; }
.share-dialog__msg { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 14px; line-height: 1.5; }
.share-dialog__msg[hidden], .share-dialog__url[hidden] { display: none; }
.share-dialog__url { display: block; width: 100%; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line, #d6e3de); border-radius: 10px; background: transparent; color: inherit; font: inherit; font-size: 16px; -webkit-user-select: text; user-select: text; }

/* ------------------------------------------------------------- 블로그 -- */

.blog__head h1 { margin: 0; }
.blog__head p { margin: 6px 0 0; font-size: 14px; }
.blog__kinds { margin: 22px 0 26px; }
.blog-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.blog-card__link { display: flex; flex-direction: column; height: 100%; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.blog-card__link:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.blog-card__link:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.blog-card__media { display: block; aspect-ratio: 16 / 9; background: var(--surface-sunk); }
.blog-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-card__placeholder { display: grid; place-items: center; height: 100%; font-weight: 800; font-size: 22px; letter-spacing: -0.5px; color: var(--accent); background: linear-gradient(135deg, var(--accent-tint), var(--surface-sunk)); }
.blog-card__body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 20px; }
.blog-card__meta { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 12px; color: var(--muted); }
.blog-card__title { font-size: 17px; line-height: 1.4; letter-spacing: -0.4px; color: var(--ink); }
.blog-card__excerpt { font-size: 13.5px; line-height: 1.65; color: var(--muted-strong); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.blog-kind { text-decoration: none; }
.blog-kind--launch { background: var(--accent-lime); color: #3c4a1e; font-weight: 700; }
.blog-kind--update { background: var(--accent-tint); color: var(--accent-dark); font-weight: 700; }

.blog-post { max-width: 760px; }
.blog-post__back { margin: 0 0 18px; font-size: 13px; }
.blog-post__back a { color: var(--muted); text-decoration: none; }
.blog-post__back a:hover { color: var(--ink); }
.blog-post__head h1 { margin: 12px 0 0; font-size: 30px; line-height: 1.3; letter-spacing: -0.8px; }
.blog-post__summary { margin: 12px 0 0; font-size: 16px; line-height: 1.7; color: var(--muted-strong); }
.blog-post__cover { margin: 26px 0 0; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9; background: var(--surface-sunk); }
.blog-post__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-post__body { margin-top: 28px; }
.blog-post__body img { max-width: 100%; border-radius: 8px; }
.blog-game { display: flex; align-items: center; gap: 16px; margin: 36px 0 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.blog-game__img { width: 96px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; }
.blog-game__text { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; font-size: 13px; }
.blog-game__text strong { font-size: 15px; color: var(--ink); }
.blog-post__nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 36px 0 0; padding-top: 22px; border-top: 1px solid var(--line); }
.blog-post__nav a { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none; font-size: 12px; }
.blog-post__nav a:hover { border-color: var(--line-strong); }
.blog-post__nav a strong { font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blog-post__nav a.is-next { text-align: right; grid-column: 2; }
@media (max-width: 640px) {
  .blog-post__head h1 { font-size: 24px; }
  .blog-game { flex-wrap: wrap; }
  .blog-game .button { width: 100%; }
  .blog-post__nav { grid-template-columns: 1fr; }
  .blog-post__nav a.is-next { grid-column: auto; }
}

/* 휴대폰 가로: 게임 영역이 화면 높이 안에 다 들어오게(16:9 폭은 그만큼 줄고 가운데 정렬) */
@media (orientation: landscape) and (max-height: 600px) {
  .play-stage { max-height: calc(100vh - 12px); max-height: calc(100dvh - 12px); margin-top: 6px; margin-bottom: 6px; }
}

/* 휴대폰 세로: 16:9 로 두면 폭 390 에서 높이가 200 남짓이라 게임 화면과 버튼이 납작하게 겹친다.
 * 모바일을 지원하는 게임(.play-stage--tall)은 위쪽 바(전체화면 버튼)와 함께 한 화면에 들어오는 높이로 맞춘다.
 * --stage-offset(바 위쪽~게임 영역 위쪽)은 스크립트가 재서 넣는다. */
@media (orientation: portrait) and (max-width: 639px) {
  .play-stage--tall {
    aspect-ratio: auto;
    height: calc(100vh - var(--stage-offset, 130px) - 12px);
    height: calc(100dvh - var(--stage-offset, 130px) - 12px);
    min-height: 420px;
    max-height: none;
    margin-top: 8px;
    margin-bottom: 12px;
  }
}
