:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --sidebar-bg: #f4f4f5;
  --hover-bg: #e9e9eb;
  --text: #18181b;
  --muted: #71717a;
  --border: #e4e4e7;
  --active-bg: #18181b;
  --active-text: #ffffff;
  --sub-active-bg: #dbeaf3;
  --live-bg: #1d4ed8;
  --live-text: #ffffff;
  --wip-bg: #52525b;
  --wip-text: #ffffff;
  --ok: #15803d;
  --link: #2563eb;
  --sidebar-width: 300px;
  --topbar-height: 52px;
  --tabbar-height: 58px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111113;
    --surface: #18181b;
    --sidebar-bg: #18181b;
    --hover-bg: #27272a;
    --text: #f4f4f5;
    --muted: #a1a1aa;
    --border: #2e2e33;
    --active-bg: #f4f4f5;
    --active-text: #18181b;
    --sub-active-bg: #1e3a4c;
    --live-bg: #2563eb;
    --live-text: #ffffff;
    --wip-bg: #3f3f46;
    --wip-text: #e4e4e7;
    --ok: #4ade80;
    --link: #7aa7ff;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--link);
}

.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.logo {
  font-weight: 800;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

/* ---------- PC: 왼쪽 사이드메뉴 ---------- */

.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.sidebar .logo {
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
}

.side-nav {
  flex: 1;
  padding: 12px 10px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.side-link span {
  flex: 1;
}

.side-link .icon:last-child {
  width: 16px;
  height: 16px;
}

.side-link:hover {
  background: var(--hover-bg);
}

.side-link.is-active {
  background: var(--active-bg);
  color: var(--active-text);
}

.side-sub {
  margin: 0 0 8px;
  padding: 2px 0 0 20px;
  list-style: none;
}

.side-sub a {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.875rem;
  text-decoration: none;
}

.side-sub a:hover {
  background: var(--hover-bg);
}

.side-sub a[aria-current="page"] {
  background: var(--sub-active-bg);
  font-weight: 700;
}

.sidebar .account {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

/* ---------- 계정 영역 ---------- */

.account {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.username {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 닉네임을 누르면 열리는 메뉴 (프로필 변경 / 로그아웃) */
.account-menu {
  position: relative;
  flex: 1;
  min-width: 0;
}

.account-menu summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.account-menu summary::-webkit-details-marker {
  display: none;
}

.account-menu summary:hover,
.account-menu[open] summary {
  background: var(--hover-bg);
}

.account-menu summary .icon {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.account-menu-list {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 20;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.account-menu-list a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.account-menu-list a:hover {
  background: var(--hover-bg);
}

.kakao-btn {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 8px;
  background: #fee500;
  color: #191919;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.kakao-btn:hover {
  opacity: 0.9;
}

.sidebar .kakao-btn {
  flex: 1;
  padding: 10px 12px;
  text-align: center;
}

/* ---------- 본문 ---------- */

.content {
  max-width: 1120px;
  margin-left: var(--sidebar-width);
  padding: 32px 28px 0;
}

.page-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.page-title .icon {
  width: 26px;
  height: 26px;
}

.lead {
  margin: 0 0 28px;
  font-size: 0.9375rem;
}

.panel {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.panel-title {
  margin: 0 0 16px;
  font-size: 1.0625rem;
  font-weight: 700;
}

.rows {
  margin: 0 -24px -24px;
  padding: 0;
  list-style: none;
}

.row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 24px;
  border-top: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}

.rows li:last-child .row {
  border-radius: 0 0 14px 14px;
}

.row:hover {
  background: var(--sidebar-bg);
}

.row-no {
  width: 24px;
  font-weight: 700;
  text-align: center;
}

.row-title {
  flex: 1;
  font-size: 0.9375rem;
  font-weight: 700;
}

.row .icon {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.empty {
  margin: 0;
  padding: 32px 0;
  color: var(--muted);
  font-size: 0.9375rem;
  text-align: center;
}

.panel + .panel {
  margin-top: 20px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- 작성 폼 ---------- */

.form-row {
  display: flex;
  gap: 12px;
}

.field {
  flex: 1;
  min-width: 0;
  margin-bottom: 12px;
}

.field-game {
  flex: 0 0 220px;
}

.field label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.8125rem;
  font-weight: 600;
}

.form input[type="text"],
.form input[type="date"],
.form select,
.form textarea {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
}

.form textarea {
  resize: vertical;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: 2px solid var(--text);
  outline-offset: -1px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.btn {
  padding: 9px 20px;
  border: 0;
  border-radius: 8px;
  background: var(--active-bg);
  color: var(--active-text);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

.btn:hover {
  opacity: 0.85;
}

.btn-text {
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
  white-space: nowrap;
}

.btn-text:hover {
  background: var(--hover-bg);
  color: var(--text);
}

.login-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

.login-prompt p {
  margin: 0;
}

/* ---------- 방명록 / 버그리포트 목록 ---------- */

.entry {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 24px;
  border-top: 1px solid var(--border);
}

.entry .avatar {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.avatar-empty {
  display: block;
  border-radius: 50%;
  background: var(--hover-bg);
}

.entry-body {
  flex: 1;
  min-width: 0;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0 0 4px;
  font-size: 0.875rem;
}

.entry-meta span {
  color: var(--muted);
  font-size: 0.8125rem;
}

.entry-content {
  margin: 0;
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}

.badge {
  display: inline-block;
  flex-shrink: 0;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-open {
  background: var(--sub-active-bg);
}

/* 게임 진행 상태: 검토중 → 번역중 → 식자중 → 확인중 → 배포중
   단계마다 색이 하나씩 있고 (--status), 뱃지와 게임 페이지의 진행 상태 패널이 같이 씁니다. */
.status-review, .badge-status-review { --status: #52525b; }
.status-translate, .badge-status-translate { --status: #7c3aed; }
.status-typeset, .badge-status-typeset { --status: #0f766e; }
.status-check, .badge-status-check { --status: #c2410c; }
.status-release, .badge-status-release { --status: #1d4ed8; }

@media (prefers-color-scheme: dark) {
  /* 어두운 바탕에서 막대와 점이 묻히지 않게 조금 밝게 */
  .status-review { --status: #a1a1aa; }
  .status-translate { --status: #a78bfa; }
  .status-typeset { --status: #2dd4bf; }
  .status-check { --status: #fb923c; }
  .status-release { --status: #60a5fa; }
}

[class*="badge-status-"] {
  background: var(--status);
  /* 관리자가 색을 바꾸면 바탕에 맞는 글자색이 --status-text 로 같이 옵니다. */
  color: var(--status-text, #ffffff);
}

/* ---------- 게임 페이지의 진행 상태 패널 ---------- */

.progress-panel {
  margin-bottom: 20px;
  padding: 24px 28px;
}

.progress-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.progress-head .panel-title {
  margin: 0 0 2px;
}

.progress-now {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.progress-now strong {
  margin-left: 4px;
  color: var(--status);
  font-weight: 700;
}

.progress-percent {
  margin: 0;
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.progress-percent span {
  margin-left: 2px;
  color: var(--muted);
  font-size: 1.125rem;
  font-weight: 700;
}

/* 단계 표시: 점을 선으로 이은 모양 */
.stepper {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stepper li {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* 앞 단계의 점에서 이 단계의 점까지 잇는 선 */
.stepper li + li::before {
  content: "";
  position: absolute;
  top: 15px;
  right: 50%;
  left: -50%;
  height: 3px;
  background: var(--border);
}

.stepper li.is-done + li::before {
  background: var(--status);
}

.step-dot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
}

.step-dot .icon {
  width: 16px;
  height: 16px;
  stroke-width: 3;
}

.stepper li.is-done .step-dot {
  border-color: var(--status);
  background: var(--status);
  color: var(--surface);
}

.stepper li.is-current .step-dot {
  border-color: var(--status);
  color: var(--status);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--status) 22%, transparent);
}

.step-label {
  color: var(--muted);
  font-size: 0.8125rem;
  white-space: nowrap;
}

.stepper li.is-done .step-label {
  color: var(--text);
}

/* 단계 이름 아래의 설명 */
.step-note {
  margin-top: -4px;
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
  text-align: center;
  word-break: keep-all;
}

.stepper li.is-current .step-note {
  color: var(--text);
}

.stepper li.is-current .step-label {
  color: var(--status);
  font-weight: 700;
}

/* 지금 단계의 진행률 */
.progress-meter {
  margin-top: 24px;
}

.progress-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--hover-bg);
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  min-width: 10px;
  border-radius: 999px;
  background: var(--status);
}

.progress-bar span[style="width: 0%"] {
  min-width: 0;
}

.progress-caption {
  display: flex;
  justify-content: space-between;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

/* 관리자: 상태 변경 */
.progress-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 24px -28px -24px;
  padding: 14px 28px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 14px 14px;
  background: var(--sidebar-bg);
}

.progress-form-label {
  margin-right: auto;
  font-size: 0.8125rem;
  font-weight: 600;
}

.progress-form select {
  width: 120px;
  padding: 7px 10px;
  font-size: 0.875rem;
}

.percent-input {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 0.875rem;
}

.form input[type="number"] {
  width: 68px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  text-align: right;
}

@media (max-width: 768px) {
  .progress-panel {
    padding: 18px 16px;
  }

  .progress-percent {
    font-size: 1.875rem;
  }

  .step-dot {
    width: 28px;
    height: 28px;
  }

  .stepper li + li::before {
    top: 13px;
  }

  .step-label {
    font-size: 0.6875rem;
  }

  .step-note {
    padding: 0 2px;
    font-size: 0.625rem;
  }

  .progress-form {
    margin: 18px -16px -18px;
    padding: 12px 16px;
  }

  .progress-form-label {
    flex-basis: 100%;
  }
}

.side-sub .badge {
  padding: 1px 8px;
  font-size: 0.6875rem;
}

.badge-resolved {
  background: var(--hover-bg);
  color: var(--muted);
}

.report-game {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}

.row-meta {
  color: var(--muted);
  font-size: 0.8125rem;
  white-space: nowrap;
}

/* ---------- 한글패치 ---------- */

.panel-title .badge {
  margin-left: 6px;
  vertical-align: middle;
}

/* 플랫폼 뱃지: 흰 글자가 읽히는 진한 색으로 플랫폼마다 구분 */
.badge-platform {
  align-self: center;
  border-radius: 6px;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.badge-platform-win { background: #0067c0; }
.badge-platform-pc98 { background: #8a6a2f; }
.badge-platform-nds { background: #be185d; }
.badge-platform-3ds { background: #c62828; }
.badge-platform-vita { background: #0f766e; }
.badge-platform-psp { background: #6d28d9; }
.badge-platform-ps3 { background: #52525b; }
.badge-platform-ss { background: #c2410c; }
.badge-platform-dos { background: #15803d; }
.badge-platform-ps1 { background: #64748b; }
.badge-platform-ps2 { background: #1e3a8a; }

.field-platform {
  flex: 0 0 160px;
}

.field-date {
  flex: 0 0 190px;
}

/* 패치 폼: 게임명 + 플랫폼 줄 */
.target-list {
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.target-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.target-row input[type="text"] {
  flex: 1;
  min-width: 0;
}

.target-row select {
  flex: 0 0 130px;
  width: auto;
}

/* 패치 목록: 패치 이름 아래 게임명 + 플랫폼 */
.patch-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}

.patch-targets li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.patch {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
}

.patch-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}

.patch-title {
  min-width: 0;
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.patch-date {
  margin-right: auto;
  color: var(--muted);
  font-size: 0.8125rem;
  white-space: nowrap;
}

.patch-files {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.patch-files li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9375rem;
}

.patch-files li .icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.patch-file-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.file-downloads {
  color: var(--muted);
  font-size: 0.8125rem;
  white-space: nowrap;
}

.patch-file-actions {
  display: flex;
  gap: 6px;
}

.btn-small {
  padding: 4px 12px;
  font-size: 0.8125rem;
}

a.btn-text {
  text-decoration: none;
}

/* 패치 수정: 등록된 파일 이름 바꾸기 / 삭제 */
.file-edit-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.file-edit-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.file-edit-list input[type="text"] {
  flex: 1;
  min-width: 0;
}

.file-remove {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 0.8125rem;
  white-space: nowrap;
  cursor: pointer;
}

.panel > .login-prompt + .rows {
  margin-top: 8px;
}

/* ---------- 버그리포트 게시판 ---------- */

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-head .panel-title {
  margin: 0;
}

.btn {
  display: inline-block;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.btn-outline {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.btn-outline:hover {
  background: var(--hover-bg);
  opacity: 1;
}

.board {
  margin: 0 -24px -24px;
}

.board-head,
.board-row {
  display: grid;
  grid-template-columns: 56px 64px minmax(0, 1fr) 120px 96px;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
}

.board-head {
  height: 44px;
  background: var(--sidebar-bg);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.board-row {
  min-height: 56px;
  padding-top: 12px;
  padding-bottom: 12px;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 0.9375rem;
  text-decoration: none;
}

.board-row:last-child {
  border-radius: 0 0 14px 14px;
}

.board-row:hover {
  background: var(--sidebar-bg);
}

.col-no,
.col-status,
.col-date {
  text-align: center;
}

.board-row .col-no,
.board-row .col-author,
.board-row .col-date {
  color: var(--muted);
  font-size: 0.8125rem;
}

.col-author {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-row .col-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.report-title {
  min-width: 0;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-count {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 0.8125rem;
}

.file-count .icon {
  width: 14px;
  height: 14px;
}

/* ---------- 버그리포트 글 보기 ---------- */

.post-head {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.post-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
}

.post-title {
  margin: 0 0 10px;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.post-head .entry-meta {
  align-items: center;
  margin: 0;
}

.post-content {
  min-height: 120px;
  padding: 24px 0;
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}

.attachments {
  padding: 16px;
  border-radius: 10px;
  background: var(--sidebar-bg);
}

.attachments h3 {
  margin: 0 0 8px;
  font-size: 0.875rem;
}

.attachments ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.attachments li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 0.875rem;
}

.attachments li .icon {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.attachments li a,
.attachments li > span:not(.file-size) {
  min-width: 0;
  overflow-wrap: anywhere;
}

.file-size {
  color: var(--muted);
  font-size: 0.8125rem;
  white-space: nowrap;
}

.attachments-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.post-actions > :first-child {
  margin-right: auto;
}

/* ---------- 첨부파일 드롭존 ---------- */

.field-label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.8125rem;
  font-weight: 600;
}

.dropzone {
  padding: 28px 16px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone.is-dragover {
  border-color: var(--text);
  background: var(--sub-active-bg);
}

.dropzone p {
  margin: 0;
}

.dropzone-text {
  font-size: 0.9375rem;
}

.dropzone-hint {
  margin-top: 4px !important;
  color: var(--muted);
  font-size: 0.8125rem;
}

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.upload-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.upload-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 4px 12px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
}

.upload-name {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-size,
.upload-status {
  color: var(--muted);
  font-size: 0.8125rem;
  white-space: nowrap;
}

.upload-item.is-error .upload-status {
  color: #e5484d;
  white-space: normal;
}

.upload-item progress {
  grid-column: 1 / -1;
  width: 100%;
  height: 4px;
  border: 0;
  border-radius: 2px;
  background: var(--hover-bg);
  accent-color: var(--text);
  appearance: none;
}

.upload-item progress::-webkit-progress-bar {
  border-radius: 2px;
  background: var(--hover-bg);
}

.upload-item progress::-webkit-progress-value {
  border-radius: 2px;
  background: var(--text);
}

.upload-item progress::-moz-progress-bar {
  border-radius: 2px;
  background: var(--text);
}

.upload-item.is-done progress,
.upload-item.is-error progress {
  display: none;
}

.form-actions {
  gap: 8px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin-top: 20px;
}

.pagination a {
  min-width: 34px;
  padding: 5px 8px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.875rem;
  text-align: center;
  text-decoration: none;
}

.pagination a:hover {
  background: var(--hover-bg);
}

.pagination a[aria-current="page"] {
  background: var(--active-bg);
  color: var(--active-text);
}

.error-msg {
  margin: 0 0 24px;
  padding: 12px 16px;
  border: 1px solid #e5484d;
  border-radius: 8px;
  background: var(--surface);
  color: #e5484d;
}

.ok-msg {
  margin: 0 0 24px;
  padding: 12px 16px;
  border: 1px solid var(--ok);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ok);
}

/* ---------- 프로필 변경 ---------- */

.profile-form {
  max-width: 520px;
}

.profile-photo {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.profile-photo .avatar {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.form input[type="file"] {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 0.875rem;
}

.form input:disabled {
  background: var(--sidebar-bg);
  color: var(--muted);
}

.field-hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
}

.site-footer {
  margin-top: 48px;
  padding: 20px 0;
  color: var(--muted);
  font-size: 0.8125rem;
}

.site-footer p {
  margin: 0;
}

/* ---------- 모바일: 상단 바 + 하단 버튼 ---------- */

.topbar,
.tabbar {
  display: none;
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: var(--topbar-height);
    padding: 0 16px;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border);
  }

  .topbar .logo {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar .account {
    flex-shrink: 0;
  }

  .topbar .username {
    max-width: 96px;
  }

  /* 상단 바에서는 메뉴가 아래로, 오른쪽 맞춤으로 열립니다. */
  .topbar .account-menu-list {
    top: calc(100% + 6px);
    bottom: auto;
    left: auto;
    min-width: 150px;
  }

  .content {
    margin-left: 0;
    padding: 20px 16px calc(var(--tabbar-height) + env(safe-area-inset-bottom));
  }

  .page-title {
    font-size: 1.375rem;
  }

  .page-title .icon {
    width: 22px;
    height: 22px;
  }

  .lead {
    margin-bottom: 20px;
  }

  .panel {
    padding: 18px 16px;
  }

  .rows {
    margin: 0 -16px -18px;
  }

  .row {
    gap: 12px;
    padding: 16px;
  }

  .entry {
    padding: 16px;
  }

  .board {
    margin: 0 -16px -18px;
  }

  .patch {
    padding: 16px;
  }

  .board-head {
    display: none;
  }

  /* 모바일: 상태+제목 한 줄, 그 아래 번호·작성자·날짜 */
  .board-row {
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: 4px 10px;
    padding: 14px 16px;
  }

  .board-row .col-status {
    grid-row: 1;
    grid-column: 1;
  }

  .board-row .col-title {
    grid-row: 1;
    grid-column: 2 / -1;
    flex-wrap: wrap;
    gap: 2px 8px;
  }

  .board-row .report-title {
    flex-basis: 100%;
    white-space: normal;
  }

  .board-row .col-no,
  .board-row .col-author,
  .board-row .col-date {
    grid-row: 2;
    text-align: left;
  }

  .board-row .col-no::before {
    content: "#";
  }

  .upload-item {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .upload-status {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .field-game,
  .field-platform,
  .field-date {
    flex: none;
  }

  .patch-head {
    flex-wrap: wrap;
    gap: 6px 10px;
  }

  /* 파일 줄: 이름 한 줄, 그 아래 크기·횟수·버튼 */
  .patch-files li {
    flex-wrap: wrap;
    gap: 6px 10px;
  }

  .patch-file-name {
    flex-basis: calc(100% - 28px);
  }

  .patch-file-actions {
    margin-left: auto;
  }

  .file-edit-list li {
    flex-wrap: wrap;
    gap: 6px 12px;
  }

  .file-edit-list input[type="text"] {
    flex-basis: 100%;
  }

  .tabbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10;
    display: flex;
    gap: 6px;
    height: calc(var(--tabbar-height) + env(safe-area-inset-bottom));
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
    background: var(--sidebar-bg);
    border-top: 1px solid var(--border);
  }

  .tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.6875rem;
    font-weight: 600;
    text-decoration: none;
  }

  .tab[aria-current="page"] {
    background: var(--active-bg);
    color: var(--active-text);
  }
}

/* ---------- 다운로드 대기 화면 ---------- */

.queue-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
}

.queue-box {
  width: 100%;
  max-width: 460px;
}

.queue-box .logo {
  display: block;
  margin-bottom: 16px;
  text-align: center;
}

.queue-file {
  margin: 0 0 20px;
  font-size: 0.9375rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.queue-file .file-size {
  margin-left: 6px;
  font-weight: 400;
}

.queue-status {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.queue-detail {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.875rem;
}

/* ---------- 게임 페이지 탭 (한글패치 | 게임소개) ---------- */

.tabs {
  display: flex;
  gap: 4px;
  margin: -8px 0 16px;
  border-bottom: 1px solid var(--border);
}

.tabs a {
  margin-bottom: -1px;
  padding: 10px 16px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.tabs a:hover {
  color: var(--text);
}

.tabs a[aria-current="page"] {
  border-bottom-color: var(--text);
  color: var(--text);
}

/* ---------- 게임소개 ---------- */

.about {
  display: flex;
  align-items: flex-start;
  gap: 28px;
}

.about-image {
  flex: 0 0 260px;
  margin: 0;
}

.about-image img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.about-image figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.about-body {
  flex: 1;
  min-width: 0;
  font-size: 0.9375rem;
}

.about-title {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 700;
}

.about-title span {
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.about-body p {
  margin: 0 0 12px;
}

.about-facts {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px 16px;
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
}

.about-facts dt {
  color: var(--muted);
  font-weight: 600;
}

.about-facts dd {
  margin: 0;
}

.about-heading {
  margin: 28px 0 8px;
  font-size: 1rem;
  font-weight: 700;
}

.about-details {
  margin: 0;
  padding-left: 20px;
  font-size: 0.9375rem;
}

.about-details li {
  margin-bottom: 4px;
}

.about-sources {
  margin: 24px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8125rem;
}

@media (max-width: 768px) {
  .about {
    flex-direction: column;
    gap: 16px;
  }

  .about-image {
    flex: none;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
  }
}

/* ---------- 관리자: 게임 목록 순서 변경 / 설정 ---------- */

.game-order-hint {
  margin: -8px 0 12px;
}

.game-list li {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.game-list .row {
  flex: 1;
  min-width: 0;
  padding-left: 8px;
  border-top: 0;
}

.drag-handle {
  align-self: stretch;
  padding: 0 6px 0 20px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 1.125rem;
  line-height: 1;
  cursor: grab;
  touch-action: none;
}

.drag-handle:hover {
  color: var(--text);
}

.game-list li.is-dragging {
  position: relative;
  z-index: 1;
  background: var(--sub-active-bg);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.game-list li.is-dragging .drag-handle {
  cursor: grabbing;
}

.game-settings {
  margin-right: 16px;
}

/* ---------- 에디터로 쓴 글 (패치 설명) ---------- */

.rich {
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}

.rich > :first-child {
  margin-top: 0;
}

.rich > :last-child {
  margin-bottom: 0;
}

.rich p,
.rich ul,
.rich ol,
.rich blockquote,
.rich pre,
.rich table {
  margin: 0 0 10px;
}

.rich h2,
.rich h3,
.rich h4 {
  margin: 18px 0 8px;
  font-weight: 700;
  line-height: 1.4;
}

.rich h2 { font-size: 1.125rem; }
.rich h3 { font-size: 1rem; }
.rich h4 { font-size: 0.9375rem; }

.rich ul,
.rich ol {
  padding-left: 22px;
}

.rich img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.rich blockquote {
  padding: 4px 14px;
  border-left: 3px solid var(--border);
  color: var(--muted);
}

.rich pre {
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--sidebar-bg);
  overflow-x: auto;
}

.rich table {
  border-collapse: collapse;
  max-width: 100%;
}

.rich th,
.rich td {
  padding: 6px 10px;
  border: 1px solid var(--border);
}

.rich hr {
  border: 0;
  border-top: 1px solid var(--border);
}

/* 에디터 (TinyMCE) 테두리를 폼의 다른 칸과 맞춥니다. */
.form .tox-tinymce {
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* ---------- 관리자: 뱃지 색상 설정 ---------- */

.badge-colors {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.badge-colors li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
}

.badge-preview {
  min-width: 72px;
  text-align: center;
}

.badge-colors input[type="color"] {
  width: 40px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
}

.badge-color-code {
  color: var(--muted);
  font-size: 0.8125rem;
}

#badge-form > .form-actions {
  margin-top: 20px;
}

/* ---------- 게임 이름 옆 최신 버전 (배포중인 게임) ---------- */

.game-version {
  display: inline-block;
  max-width: 100%;
  margin-left: 6px;
  padding: 1px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.side-game-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-sub .game-version {
  flex-shrink: 1;
  min-width: 0;
  margin-left: 0;
  padding: 0 6px;
  font-size: 0.6875rem;
}

.page-title .game-version {
  font-size: 0.875rem;
  padding: 2px 10px;
}
