/* ── 폰트 ── */
@font-face {
  font-family: 'Pretendard';
  src: url('../../fonts/PretendardVariable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ── CSS 변수 ── */
:root {
  --color-header-bg: #1A1A2E;
  --color-hero-start: #1E3A5F;
  --color-hero-end: #2B5FA8;
  --color-orange: #FF8C00;
  --color-orange-light: #FFA500;
  --color-purple: #7B2FBE;
  --color-bg-light: #F5F5F5;
  --color-text: #222222;
  --color-recommended-bg: #E8EFF8;
  --color-costume-bg: #F0E8F8;

  /* 뱃지 색상 */
  --badge-gray: #888888;
  --badge-purple: #7B2FBE;
  --badge-blue: #2E6DA4;
  --badge-green: #2E8B57;
  --badge-orange: #E07B00;
  --badge-navy: #334896;
  --badge-teal: #1A8FA0;
  --badge-red: #C0392B;

  --font-main: 'Pretendard', 'Noto Sans KR', 'Malgun Gothic', Arial, sans-serif;
  --radius-btn: 8px;
  --radius-card: 12px;
  --shadow-card: 0 3px 8px rgba(0, 0, 0, 0.1);
  --max-width: 900px;
}

/* ── 리셋 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-main); color: var(--color-text); background: #fff; min-width: 1280px; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-main); }
img { max-width: 100%; }

/* ── 아이콘/버튼 ── */
.icon-btn { font-size: 16px; padding: 4px; border-radius: 4px; }
.icon-btn:hover { background: #f0f0f0; }
.btn-signup {
  padding: 5px 12px;
  font-size: 13px;
  color: #555;
}
.btn-nickname {
  padding: 5px 12px;
  font-size: 14px;
  color: #555;
}
.btn-signup:hover { color: #111; }
.btn-login {
  padding: 5px 14px;
  border: 1.5px solid #111;
  border-radius: var(--radius-btn);
  font-size: 13px;
  font-weight: 600;
  background: #fff;
  color: #111;
}
.btn-login:hover { background: #111; color: #fff; }
.btn-charge {
  padding: 5px 14px;
  border: 1.5px solid var(--color-orange);
  border-radius: var(--radius-btn);
  font-size: 13px;
  font-weight: 600;
  background: var(--color-orange);
  color: #fff;
}
.btn-charge:hover { background: var(--color-orange-light); border-color: var(--color-orange-light); }

/* ── 상단 고정 래퍼 (top-bar + header 묶음) ── */
.sticky-top-wrapper {
  position: sticky;
  top: 0;
  z-index: 200;
}

/* ── 헤더 ── */
.header {
  background: #fff;
  position: relative;
  transition: box-shadow 0.3s;
}
.header.scrolled {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}
.header__inner {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 72px;
}
.header__logo { flex-shrink: 0; }
.header__logo img { display: block; }
.header__nav { display: flex; gap: 90px; flex: 1; justify-content: center; }
.header__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.nav-item { display: flex; align-items: center; }
.nav-link {
  color: #333;
  font-size: 20px;
  font-weight: 500;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.nav-link:hover, .nav-link.active {
  color: #111;
  border-bottom-color: var(--color-orange);
}

/* ── 메가 메뉴 ── */
.mega-menu {
  background: rgba(26, 26, 46, 0.97);
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.2s ease;
}
.mega-menu.open {
  max-height: 80px;
  opacity: 1;
}
.mega-menu__inner {
  position: relative;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
}
.mega-menu__panel {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  flex-direction: row;
  gap: 36px;
  align-items: center;
}
.mega-menu__panel.active {
  display: flex;
}
.mega-menu__link {
  color: #ccc;
  font-size: 15px;
  font-weight: 350;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.mega-menu__link:hover {
  color: #fff;
  border-bottom-color: var(--color-orange);
}

/* ── 공통 섹션 ── */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 0px;
}
.section__title {
  font-size: 24px;
  font-weight: 400;
  margin-left: 6px;
  margin-bottom: 6px;
  padding-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.section__title a { color: var(--color-orange); font-size: 14px; }
.section__title a.title-link { color: #000; font-size: inherit; text-decoration: none; }

/* ── 뱃지 ── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 400;
  color: #fff;
}
.badge--gray   { background: var(--badge-gray); }
.badge--purple { background: var(--badge-purple); }
.badge--blue   { background: var(--badge-blue); }
.badge--green  { background: var(--badge-green); }
.badge--orange { background: var(--badge-orange); }
.badge--navy   { background: var(--badge-navy); }
.badge--teal   { background: var(--badge-teal); }
.badge--red    { background: var(--badge-red); }

/* ── CKEditor5 콘텐츠 공통 스타일 ── */
.ck-content p { margin: 0.5em 0; }
.ck-content ul,
.ck-content ol { padding-left: 1.5em; margin: 0.5em 0; }
.ck-content li { list-style: revert; margin: 0.2em 0; }
.ck-content h2,
.ck-content h3,
.ck-content h4 { font-weight: 700; margin: 0.8em 0 0.3em; }
.ck-content blockquote { border-left: 3px solid #ccc; padding-left: 1em; color: #666; margin: 0.5em 0; }

/* ── 탭 ── */
.tab-group { display: flex; gap: 4px; margin-bottom: 12px; justify-content: flex-end; }
.tab-btn {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: #666;
  background: #eee;
  transition: all 0.2s;
}
.tab-btn:hover { background: #ddd; }
.tab-btn.active {
  background: var(--color-purple);
  color: #fff;
}

/* ── 푸터 ── */
.footer {
  background: #2a2a2a;
  color: #aaa;
  text-align: center;
  padding: 24px 16px;
  font-size: 12px;
  line-height: 1.8;
}
.footer__links {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.footer__links a:hover { color: #fff; }
.footer__links span { color: #555; }
.footer__info { margin-bottom: 16px; }
.footer__logo {
  font-size: 18px;
  font-weight: 700;
  color: #666;
  letter-spacing: 4px;
}

/* ── 플레이스홀더 이미지 ── */
.placeholder {
  background: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 13px;
  border-radius: 4px;
}

/* ════════════════════════════════════════
   공통 컴포넌트: 게임 시작 카드
════════════════════════════════════════ */
.game-start-card {
  position: relative;
  overflow: visible;
  border-radius: 20px;
  padding: 0px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.game-start-card__bg {
  position: absolute;
  inset: 5px;
  top: 10px;
  height: auto;
  z-index: 0;
}
.game-start-card > *:not(.game-start-card__bg) {
  position: relative;
  z-index: 1;
}
.game-start-card__label {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--color-orange), var(--color-orange-light));
  padding: 4px 18px;
  border-radius: 20px;
}
.game-start-card__hint {
  font-size: 12px;
  margin-top: -2px;
  margin-bottom: 10px;
  color: #aaa;
}
.btn-game-start {
  position: relative;
  width: 100%;
}
.btn-game-start-textimg {
  position: absolute;
  top: -5px;
  transform: translateX(4px) translateY(5px);
  display: block;
  width: none;
  transition: filter 0.2s;
}
.btn-game-start-textimg__click {
  position: absolute;
  top: -5px;
  transform: translateX(4px) translateY(5px);
  display: block;
  opacity: 0;
  pointer-events: none;
}
@keyframes click-flash {
  0%   { opacity: 1; }
  80%  { opacity: 1; }
  100% { opacity: 0; }
}
.btn-game-start-textimg__click.is-playing {
  animation: click-flash 0.4s ease-out forwards;
}
.btn-download {
  position: relative;
  display: block;
  width: 100%;
}
.btn-download img {
  width: 100%;
  height: auto;
  display: block;
}
.btn-download__hover {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
}
.btn-download:hover .btn-download__default { opacity: 0; }
.btn-download:hover .btn-download__hover   { opacity: 1; }
.btn-start {
  position: absolute;
  top: -5px;
  transform: translateX(110px);
  display: block;
  width: none;
  transition: filter 0.2s;
}
.btn-start img {
  display: block;
  width: 75%;
  height: auto;
  transition: opacity 0.2s;
}
.btn-start__hover {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
}
.btn-start:hover .btn-start__default { opacity: 0; }
.btn-start:hover .btn-start__hover   { opacity: 1; }

/* 로그인 전: 위젯 */
.login-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 12px !important;
}
.login-widget__title {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  text-align: center;
}
.login-widget__btn {
  display: block;
  width: 100%;
  padding: 13px 0;
  background: #1A1A2E;
  color: #fff;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s;
}
.login-widget__btn:hover { background: #2B2B4E; }
.login-widget__links {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.login-widget__links a {
  color: #777;
  text-decoration: none;
}
.login-widget__links a:hover { color: #222; }
.login-widget__links span { color: #ccc; }
.login-error {
  font-size: 12px;
  color: #e74c3c;
  background: #fdf0ef;
  border-radius: 5px;
  padding: 6px 10px;
  margin-bottom: 4px;
}

/* 로그아웃 버튼 (링크처럼 보이는 버튼) */
.btn-link {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: #777;
  cursor: pointer;
  font-family: inherit;
}
.btn-link:hover { color: #333; }

.character-box {
  width: 100%;
  border-top: 1px solid #f0f0f0;
  padding: 10px 0 2px;
  color: #222;
}
.character-box__name {
  font-size: 38px;
  text-align: center;
  font-weight: 700;
  margin-bottom: 2px;
}
.character-box__info {
  font-size: 16px;
  text-align: center;
  color: #999;
  margin-bottom: 8px;
}
.character-box__star {
  display: flex;
  align-items: center;
  border: 4px solid;
  border-color: #ffb300;
  border-radius: 12px;
  padding: 5px 10px 8px;
  width: 100%;
  margin-left: 40px;
  width: 200px;
  margin-bottom: 7px;
}
.star-icon {
  color: orange;
  font-size: 22px;
  line-height: 1;
  width: 32px;
  height: 32px;
}
.star-amount {
  flex: 1;
  color: orange;
  text-align: right;
  font-weight: 600;
  font-size: 22px;
  padding-right: 5px;
  margin-right: 10px;
  line-height: 1;
}
.star-plus {
  background: orange;
  border: none;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s;
}
.star-plus:hover { background: rgb(255, 196, 0); }
.character-box__links {
  font-size: 14px;
  color: #aaa;
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
}
.character-box__links a { color: #777; }
.character-box__links a:hover { color: #333; }
.character-box__no-char {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  padding: 12px 0 14px;
  gap: 10px;
}
.character-box__no-char-msg {
  font-size: 13px;
  color: #aaa;
  text-align: center;
  line-height: 1.6;
}
.character-box__no-char-btn {
  font-size: 13px;
  color: #fff;
  background: #888;
  border-radius: 20px;
  padding: 5px 16px;
  transition: background 0.2s;
}
.character-box__no-char:hover .character-box__no-char-btn {
  background: #555;
}

/* ── 푸터 링크 버튼 (a 태그와 동일 스타일) ── */
.footer__link-btn {
  background: none; border: none; padding: 0;
  font: inherit; color: inherit; cursor: pointer;
  text-decoration: none;
}
.footer__link-btn:hover { text-decoration: underline; }

/* ── 법적 문서 모달 (이용약관 / 개인정보처리방침 공용) ── */
.privacy-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.privacy-modal-overlay.is-open { display: flex; }
.privacy-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 780px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
}
.privacy-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 18px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}
.privacy-modal__title { font-size: 20px; font-weight: 700; color: #222; margin: 0; }
.privacy-modal__close {
  background: none; border: none; font-size: 22px; color: #888;
  cursor: pointer; padding: 4px 8px; line-height: 1;
  border-radius: 4px; transition: color 0.15s, background 0.15s;
}
.privacy-modal__close:hover { color: #222; background: #f5f5f5; }
.privacy-modal__body {
  overflow-y: auto; padding: 28px; flex: 1;
  font-size: 15px; color: #444; line-height: 1.8;
}
.privacy-modal__body h3 { font-size: 17px; font-weight: 700; color: #222; margin: 24px 0 8px; }
.privacy-modal__body h4 { font-size: 15px; font-weight: 600; color: #333; margin: 14px 0 6px; }
.privacy-modal__body p { margin: 8px 0; }
.privacy-modal__body ul { margin: 6px 0 10px; padding-left: 22px; }
.privacy-modal__body li { margin: 4px 0; }
.privacy-modal__date { color: #888; font-size: 14px; margin-bottom: 14px !important; }
.privacy-modal__updated {
  margin-top: 24px !important; color: #888; font-size: 13px;
  border-top: 1px solid #eee; padding-top: 14px;
}
.privacy-modal__footer {
  padding: 18px 28px; border-top: 1px solid #eee;
  display: flex; justify-content: flex-end; flex-shrink: 0;
}
.privacy-modal__confirm {
  background: #222; color: #fff; border: none; border-radius: 8px;
  padding: 12px 40px; font-size: 16px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.privacy-modal__confirm:hover { background: #444; }

/* ════════════════════════════════════════
   공통 히어로 배너
════════════════════════════════════════ */
.news-hero {
  width: 100%;
  height: 220px;
  background: url('/static/images/background/bg_news.png') center/cover no-repeat;
  background-color: #1E3A5F;
  position: relative;
  display: flex;
  align-items: flex-end;
}
.news-hero__inner {
  max-width: 1500px;
  margin: 0 auto;
  width: 100%;
  padding: 0 40px 16px;
}
.news-hero__label {
  font-size: 30px;
  font-weight: 100;
  color: rgba(255,255,255,0.7);
  margin-bottom: 1px;
}
.news-hero__title {
  font-size: 40px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

/* ════════════════════════════════════════
   공통 사이드바
════════════════════════════════════════ */
.news-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 110px;
}

/* 최신 뉴스 위젯 */
.side-news {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 16px;
  background: #fafafa;
}
.side-news__title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.side-news__title a { color: var(--color-orange); font-size: 13px; }
.side-news__list { list-style: none; display: flex; flex-direction: column; gap: 0; }
.side-news__item { border-bottom: 1px solid #eee; }
.side-news__item:last-child { border-bottom: none; }
.side-news__item a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 4px;
  font-size: 13px;
  color: #444;
  transition: color 0.15s;
}
.side-news__item a:hover { color: #111; }
.side-news__text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
