/* ==========================================================================
   components — 여러 화면이 함께 쓰는 부품 (한 클래스는 이 파일에서만 정의)
   근거: ../05-컴포넌트/공통부품.md
   ========================================================================== */

/* ==== 버튼 : 4종 × 3크기, 테두리는 전부 1px ============================= */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  height:var(--btn-h); padding:0 var(--gap-lg);
  border:1px solid var(--line-strong); border-radius:var(--r);
  background:transparent; color:var(--text);
  font-size:var(--fs-sm); font-weight:var(--fw-bold); white-space:nowrap; cursor:pointer;
  transition:background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.btn svg{ width:16px; height:16px; }
.btn:hover{ border-color:var(--accent-line); color:var(--accent-fg); }
.btn:disabled, .btn[aria-disabled="true"]{ opacity:.4; pointer-events:none; }

.btn--gold{ background:var(--accent); border-color:var(--accent-line); color:var(--accent-ink); }
.btn--gold:hover{ background:var(--accent-hi); border-color:var(--accent-hi); color:var(--accent-ink); }
.btn--white{ background:var(--text); border-color:var(--text); color:var(--bg); font-weight:var(--fw-regular); }
.btn--white:hover{ background:transparent; color:var(--text); border-color:var(--text); }
.btn--dark{ background:var(--surface); border-color:var(--surface); color:var(--text-sub); }
.btn--dark:hover{ background:var(--surface-2); border-color:var(--surface-2); color:var(--text); }
.btn--blue{ background:var(--private); border-color:var(--private); color:#fff; }
.btn--blue:hover{ background:transparent; color:var(--private); }
.btn--sm{ height:var(--btn-h-sm); padding:0 var(--gap-md); }
.btn--lg{ height:var(--btn-h-lg); padding:0 var(--gap-xl); font-size:var(--fs-lg); }
.btn--block{ width:100%; }
.btn-row{ display:flex; justify-content:center; gap:var(--gap-sm); margin-top:var(--gap-xl); }

/* ==== 섹션 머리 (제목 h2 + 오른쪽 모두보기) ============================== */
.sec + .sec{ margin-top:var(--gap-md); }
.sec__head{ display:flex; justify-content:space-between; align-items:center; min-height:73px; }
.sec__title{ display:flex; align-items:center; gap:12px; font-size:var(--fs-2xl); font-weight:900; letter-spacing:-.01em; }
/* 스포츠 사선 — 제목 앞 기울어진 막대 */
.sec__title::before, .rail__title::before{ content:""; flex:none; width:6px; height:.95em; background:var(--accent); transform:skewX(-16deg); }

/* ==== 게임 그리드 · 게임카드 : 한 종류 (원본 3종 → 통일) ================= */
.game-grid{ display:grid; grid-template-columns:repeat(5,1fr); gap:var(--card-gap); }
.gamecard{
  position:relative; display:block; border-radius:var(--r-lg); overflow:hidden;
  background:var(--surface); box-shadow:var(--shadow-card); cursor:pointer;
}
.gamecard__thumb{ position:relative; aspect-ratio:1; overflow:hidden; background:var(--surface-2); }
.gamecard__thumb img{ width:100%; height:100%; object-fit:cover; transition:transform var(--t); }
.gamecard:hover .gamecard__thumb img{ transform:scale(1.05); }
/* 그림이 아직 없을 때 자리 — 스카이시티 대체 그림 (원본은 PARADISE 로고) */
.gamecard__ph{
  position:absolute; inset:0; display:grid; place-items:center; align-content:center; gap:6px; padding:12px;
  background:linear-gradient(160deg,hsl(var(--h,40) 60% 34%),hsl(var(--h,40) 65% 12%));
  text-align:center;
}
.gamecard__ph b{ font-size:var(--fs-lg); font-weight:900; line-height:1.25; }
.gamecard__ph small{ font-size:var(--fs-xs); color:rgba(255,255,255,.7); letter-spacing:.08em; text-transform:uppercase; }
/* 그림 아래쪽을 어둡게 — 밝은 이미지를 넣어도 글자가 보이게 (원본 --gradient-basic) */
.gamecard__thumb::after{
  content:""; position:absolute; inset:auto 0 0 0; height:40%;
  background:linear-gradient(to bottom,transparent,rgba(0,0,0,.45)); pointer-events:none;
}
/* 호버 — 원본의 골드 테두리 효과 */
.gamecard::before{
  content:""; position:absolute; inset:0; z-index:2; border:2px solid var(--accent-line); border-radius:var(--r-lg);
  opacity:0; transition:opacity var(--t-fast); pointer-events:none;
}
.gamecard:hover::before, .gamecard:focus-visible::before{ opacity:1; }
.gamecard__info{ position:relative; display:flex; align-items:center; gap:6px; height:60px; padding:0 12px 0 var(--gap-lg); }
/* 제목이 아이콘과 겹치지 않게 — 남은 폭만 쓰고 말줄임 (원본 버그 A6) */
.gamecard__title{ flex:1; min-width:0; font-size:var(--fs-sm); font-weight:var(--fw-bold); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.gamecard__act{ flex:none; display:grid; place-items:center; width:28px; height:28px; border-radius:50%; color:var(--text-mute); transition:color var(--t-fast); }
.gamecard__act svg{ width:22px; height:22px; }
.gamecard__act:hover{ color:var(--text); }
.gamecard__act[aria-pressed="true"]{ color:var(--danger); }
.gamecard__ribbon{
  position:absolute; left:-30px; top:12px; z-index:1; width:110px; padding:2px 0;
  transform:rotate(-40deg); text-align:center; font-size:var(--fs-xs); font-weight:900; letter-spacing:.06em;
}
.gamecard__ribbon--best{ background:#1f5bd8; }
.gamecard__ribbon--new{ background:#16a34a; }
.gamecard__vendor{ position:absolute; right:0; top:0; z-index:1; padding:4px 10px; border-bottom-left-radius:14px; background:rgba(0,0,0,.75); font-size:11px; font-weight:var(--fw-bold); color:#fff; }

/* 큰 카드 1장 + 4×2 (슬롯 인기게임) */
.game-feature{ display:grid; grid-template-columns:300px 1fr; gap:var(--gap-sm); }
.game-feature .game-grid{ grid-template-columns:repeat(4,1fr); gap:var(--gap-sm); }
.game-feature > .gamecard .gamecard__thumb{ aspect-ratio:auto; height:calc(100% - 60px); }

/* ==== 카테고리 탭 띠 (아이콘 탭 + 검색 + 게임사) ========================== */
.catbar{ background:var(--bg-deep); }
.catbar.is-stuck{ position:sticky; top:var(--header-h); z-index:5; }
.catbar .inner{ display:flex; flex-wrap:wrap; align-items:flex-end; gap:var(--gap-md) var(--gap-2xl); padding:var(--gap-sm) 0 var(--gap-md); }
.cattabs{ display:flex; gap:var(--gap-md); width:100%; }
.cattab{
  display:grid; justify-items:center; gap:6px; width:75px; padding:6px 0 8px;
  border-bottom:2px solid transparent; font-weight:var(--fw-bold); color:var(--text);
  transition:color var(--t-fast), border-color var(--t-fast);
}
.cattab svg{ width:32px; height:32px; color:var(--text-sub); transition:color var(--t-fast); }
.cattab:hover, .cattab:hover svg{ color:var(--accent-fg); }
.cattab[aria-current="true"]{ border-color:var(--accent-line); color:var(--accent-fg); }
.cattab[aria-current="true"] svg{ color:var(--accent-fg); }
.catbar__tools{ display:flex; gap:var(--gap-sm); }

/* ==== 입력칸 · 검색 · 선택 ============================================== */
.input, .select{
  width:100%; height:var(--input-h); padding:0 14px;
  border:1px solid var(--line); border-radius:var(--r); background:#fff; color:var(--text-on-light);
  font-size:var(--fs-lg);
}
.input::placeholder{ color:#999; }
.input:focus, .select:focus{ outline:none; border-color:var(--accent-line); box-shadow:0 0 0 2px var(--accent-soft); }
.input[readonly]{ background:#e9e9e9; }
.input.is-error{ border-color:var(--danger); }
/* 선택칸 — 브라우저 기본 모양 대신 같은 모양 (원본은 OS 기본 목록) */
.select{
  appearance:none; padding-right:36px; cursor:pointer;
  background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23666' stroke-width='1.6'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center;
}
.select--gold{ background-color:var(--accent); border-color:var(--accent-line); color:var(--accent-ink); }
.search{ position:relative; width:240px; }
.search .input{ padding-right:44px; }
.search button{ position:absolute; right:0; top:0; display:grid; place-items:center; width:44px; height:100%; color:#777; }
.search button svg{ width:22px; height:22px; }
.search--wide{ display:flex; width:auto; }
.search--wide .input{ width:250px; border-radius:var(--r) 0 0 var(--r); }
.search--wide .btn{ width:102px; height:var(--input-h); border-radius:0 var(--r) var(--r) 0; }
.field-clear{ position:relative; }
.field-clear .input{ padding-right:44px; }
/* 지우기 × 는 값이 있을 때만 */
.field-clear .input:placeholder-shown + .field-clear__x{ display:none; }
.field-clear__x{
  position:absolute; right:10px; top:50%; transform:translateY(-50%);
  display:grid; place-items:center; width:24px; height:24px; border-radius:50%;
  background:var(--accent); color:var(--accent-ink);
}
.field-clear__x svg{ width:12px; height:12px; }
.checkbox{ appearance:none; flex:none; width:20px; height:20px; border:1px solid var(--line-strong); border-radius:4px; background:var(--surface); cursor:pointer; display:grid; place-items:center; }
.checkbox:checked{ background:var(--accent); border-color:var(--accent-line); }
.checkbox:checked::after{ content:""; width:10px; height:6px; margin-top:-3px; border-left:2px solid var(--accent-ink); border-bottom:2px solid var(--accent-ink); transform:rotate(-45deg); }

/* ==== 폼 : 왼쪽 라벨칸 + 오른쪽 입력 (입금 · 출금 · 계좌 · 가입 공통) ===== */
.form{ border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.form__row{ display:grid; grid-template-columns:150px 1fr; border-bottom:1px solid var(--line); }
.form__row:last-child{ border-bottom:0; }
.form__label{ display:flex; align-items:center; gap:4px; padding:var(--gap-md); background:var(--surface); color:var(--text-sub); font-weight:var(--fw-bold); }
.form__label .req{ color:var(--accent-fg); }
.form__field{ display:grid; gap:var(--gap-sm); padding:var(--gap-md) var(--gap-lg); max-width:640px; }
.form__inline{ display:flex; gap:var(--gap-sm); }
.form__inline .btn{ flex:none; width:108px; height:var(--input-h); }
.form__hint{ color:var(--text-sub); font-size:13px; }            /* 안내 — 회색 (원본은 빨강) */
.form__error{ color:var(--danger); font-size:13px; }            /* 오류만 빨강 */
.form__ok{ color:var(--success); font-size:13px; }
.form__rate{ color:var(--accent-fg); }

/* 금액 빠른 버튼 +일만 · 오만 … */
.amounts{ display:grid; grid-template-columns:repeat(auto-fit,minmax(76px,1fr)); gap:var(--gap-sm); }
.amounts button{
  height:var(--input-h); border:1px solid var(--line-strong); border-radius:var(--r);
  background:#fff; color:#000; font-size:var(--fs-lg);
  transition:background-color var(--t-fast), border-color var(--t-fast);
}
.amounts button em{ margin-right:4px; font-style:normal; color:#999; }
.amounts button:hover{ border-color:var(--accent-line); background:color-mix(in srgb, var(--accent) 10%, #fff); }
.amounts button.is-all{ background:var(--surface-2); border-color:var(--surface-2); color:var(--text); }

/* ==== 박스 (마이페이지 흰줄 상자) ======================================= */
.box{ padding:var(--gap-lg); border-radius:var(--r); background:var(--bg-deep); }
.box + .box{ margin-top:var(--gap-lg); }
.box__title{ margin-bottom:var(--gap-md); font-size:var(--fs-xl); font-weight:var(--fw-bold); }
.statusbar{ display:flex; justify-content:space-between; align-items:center; padding:var(--gap-md) var(--gap-lg); border-radius:var(--r); background:var(--surface-2); color:var(--text-sub); }
.statusbar b{ color:var(--money); }

/* 주의사항 */
.notice-box{ margin-top:var(--gap-xl); padding:var(--gap-lg) var(--gap-xl); border-radius:var(--r); background:var(--surface); }
.notice-box h4{ display:flex; align-items:center; gap:6px; margin-bottom:var(--gap-sm); font-size:var(--fs-lg); }
.notice-box h4 svg{ width:18px; height:18px; color:var(--accent-fg); }
.notice-box ol{ padding-left:18px; list-style:decimal; color:var(--text-sub); }
.notice-box li + li{ margin-top:4px; }

/* ==== 상자형 탭 (전체 · 이벤트 / 입금 내역 · 머니이동 내역 …) =========== */
.tabs{ display:flex; border:1px solid var(--line); border-radius:var(--r); background:var(--bg-deep); overflow:hidden; }
.tabs__item{
  min-width:130px; padding:14px var(--gap-lg); border-right:1px solid var(--line);
  font-size:var(--fs-lg); color:var(--text-sub); text-align:center;
  transition:background-color var(--t-fast), color var(--t-fast);
}
.tabs__item:hover{ color:var(--text); }
.tabs__item[aria-selected="true"]{ background:var(--accent); color:var(--accent-ink); font-weight:var(--fw-bold); }
.tabs__aside{ margin-left:auto; display:flex; align-items:center; padding:0 var(--gap-lg); color:var(--text-sub); }
.tabs__aside b{ margin:0 2px; color:var(--accent-fg); }
.tabs + *{ margin-top:var(--gap-lg); }
/* 글자 탭 (이용가이드 2 · 3단) */
.subtabs{ display:grid; grid-template-columns:repeat(5,1fr); padding:var(--gap-md) 0; border-radius:var(--r); background:var(--bg-deep); }
.subtabs button{ padding:6px 0; border-right:1px solid var(--line); color:var(--text-sub); transition:color var(--t-fast); }
.subtabs button:nth-child(5n){ border-right:0; }
.subtabs button:hover, .subtabs button[aria-selected="true"]{ color:var(--accent-fg); }
.chips{ display:flex; flex-wrap:wrap; justify-content:center; gap:0; margin:var(--gap-md) 0; }
.chips button{ padding:0 var(--gap-sm); border-left:1px solid var(--line-strong); color:var(--text-sub); line-height:1; }
.chips button:first-child{ border-left:0; }
.chips button[aria-selected="true"], .chips button:hover{ color:var(--accent-fg); }

/* ==== 기간 검색 줄 ====================================================== */
.filterbar{ display:flex; flex-wrap:wrap; align-items:center; gap:var(--gap-sm); padding:var(--gap-md) 0; }
.filterbar .select{ width:180px; }
.filterbar .date{ width:150px; }
.filterbar__label{ margin-left:var(--gap-md); color:var(--text-sub); }
.filterbar .btn{ margin-left:auto; min-width:80px; }
.sumchip{ display:inline-flex; align-items:stretch; height:var(--input-h); border-radius:var(--r); overflow:hidden; font-weight:var(--fw-bold); }
.sumchip span{ display:flex; align-items:center; padding:0 var(--gap-md); background:var(--accent); color:var(--accent-ink); }
.sumchip b{ display:flex; align-items:center; padding:0 var(--gap-md); background:var(--accent); color:var(--accent-ink); min-width:110px; justify-content:flex-end; }

/* ==== 표 : 한 모양 ===================================================== */
.tbl{ font-size:var(--fs-sm); }
.tbl th{ padding:12px 6px; border-top:1px solid var(--line); border-bottom:1px solid var(--line); background:var(--surface); color:var(--text-sub); font-weight:var(--fw-bold); text-align:center; white-space:nowrap; }
.tbl td{ padding:14px 6px; border-bottom:1px solid var(--line); text-align:center; }
.tbl td.l, .tbl th.l{ text-align:left; }
.tbl td.r, .tbl th.r{ text-align:right; }
.tbl tbody tr{ transition:background-color var(--t-fast); }
.tbl tbody tr:hover{ background:rgb(var(--fg-rgb) / .03); }
.tbl .is-link{ cursor:pointer; }
.tbl .is-link:hover .tbl__title{ color:var(--accent-fg); }
.tbl__title{ transition:color var(--t-fast); }
.tbl__title em{ margin-right:6px; font-style:normal; font-weight:var(--fw-bold); color:var(--accent-fg); }
.tbl tr.is-important{ background:var(--surface); }
.tbl tr.is-open{ background:var(--surface-2); }
.tbl__detail td{ padding:var(--gap-lg) var(--gap-xl); text-align:left; background:var(--surface); }
.tbl-scroll{ overflow-x:auto; }
.tbl-scroll .tbl{ min-width:100%; }

/* ==== 뱃지 ============================================================= */
.badge{ display:inline-block; padding:2px 10px; border-radius:var(--r); font-size:var(--fs-xs); font-weight:var(--fw-bold); line-height:1.6; white-space:nowrap; }
.badge--danger{ background:var(--danger); color:#fff; }
.badge--gold{ background:var(--accent); color:var(--accent-ink); }
.badge--line{ border:1px solid var(--line-strong); color:var(--text-sub); }
.badge--ok{ background:rgba(25,214,0,.15); color:var(--success); }
.badge--wait{ background:rgba(255,165,0,.15); color:var(--warn); }
.badge--no{ background:rgba(255,77,79,.15); color:var(--danger); }
.badge--mute{ background:var(--surface-2); color:var(--text-sub); }

/* ==== 페이지 번호 (원본에 없던 것 — A4) ================================== */
.paging{ display:flex; justify-content:center; gap:4px; margin-top:var(--gap-xl); }
.paging button{ min-width:36px; height:36px; padding:0 8px; border:1px solid var(--line); border-radius:var(--r); color:var(--text-sub); transition:color var(--t-fast), border-color var(--t-fast); }
.paging button:hover{ border-color:var(--accent-line); color:var(--accent-fg); }
.paging button[aria-current="page"]{ background:var(--accent); border-color:var(--accent-line); color:var(--accent-ink); font-weight:var(--fw-bold); }
.paging button:disabled{ opacity:.3; pointer-events:none; }
.paging svg{ width:14px; height:14px; margin:auto; }

/* ==== 상태 : 로딩 · 빈 목록 · 오류 — 모든 화면이 이 세 개만 쓴다 ========= */
.state{ display:grid; justify-items:center; gap:var(--gap-sm); padding:60px var(--gap-lg); color:var(--text-sub); text-align:center; }
.state > svg{ width:44px; height:44px; color:var(--surface-3); }
.state b{ font-size:var(--fs-lg); color:var(--text); }
.state--error > svg{ color:var(--danger); }
.spinner{ width:36px; height:36px; border:3px solid var(--surface-2); border-top-color:var(--accent-line); border-radius:50%; animation:spin .8s linear infinite; }
@keyframes spin{ to{ transform:rotate(360deg); } }
.skeleton{ border-radius:var(--r); background:linear-gradient(90deg,var(--surface) 25%,var(--surface-2) 50%,var(--surface) 75%); background-size:200% 100%; animation:shimmer 1.2s infinite; }
@keyframes shimmer{ to{ background-position:-200% 0; } }
.tbl td.state-cell{ padding:0; }

/* ==== 모달 : 화면 가운데, 넘치면 안쪽 스크롤 (원본 A7) ==================== */
.modal{ position:fixed; inset:0; z-index:var(--z-modal); display:grid; place-items:center; padding:30px; background:var(--dim); animation:fade var(--t-fast); }
.modal__dialog{
  position:relative; display:flex; flex-direction:column; width:min(var(--w,420px),100%);
  max-height:calc(100 * var(--vh) - 60px); border:1px solid var(--line-strong); border-radius:var(--r);
  background:var(--surface); box-shadow:var(--shadow-pop);
}
.modal__head{ display:flex; align-items:center; justify-content:space-between; padding:var(--gap-md) var(--gap-lg); border-bottom:1px solid var(--line); }
.modal__head h2{ font-size:var(--fs-lg); }
.modal__body{ overflow-y:auto; padding:var(--gap-lg); }
.modal__foot{ display:flex; gap:var(--gap-sm); justify-content:center; padding:var(--gap-md) var(--gap-lg); border-top:1px solid var(--line); }
.modal__close{ display:grid; place-items:center; width:32px; height:32px; border-radius:50%; color:var(--text-sub); transition:color var(--t-fast), background-color var(--t-fast); }
.modal__close:hover{ color:var(--text); background:var(--surface-2); }
.modal__close svg{ width:18px; height:18px; }
.modal--alert .modal__body{ text-align:center; white-space:pre-line; }
.modal--alert .modal__body h3{ margin-bottom:var(--gap-sm); font-size:var(--fs-lg); }

/* ---- 알림 · 확인 창 (js/ui.js alertBox · confirmBox) — 모든 화면 공통 한 모양 ----
   짧게: 제목 → 안내(작게) → 항목 표 → 버튼. 아이콘 없이 창 왼쪽 색 막대로 뜻을 나눈다
   (확인 금색 · 되돌리기 어려움 빨강 · 완료 초록 · 막힘 주황 · 알림 파랑) */
.modal--dlg{ --t:#4ea3ff; }
.modal--dlg.is-ok{ --t:#2fd39a; }
.modal--dlg.is-warn{ --t:#ffae3d; }
.modal--dlg.is-ask{ --t:var(--accent); }
.modal--dlg.is-danger{ --t:#ff5a6e; }
.modal--dlg .modal__dialog{ border-radius:16px; border-color:var(--line); background:linear-gradient(180deg, var(--surface-2), var(--surface)); box-shadow:inset 3px 0 0 var(--t), var(--shadow-pop); }
.modal--dlg .modal__head{ position:absolute; top:0; right:0; z-index:1; padding:8px; border:0; }
.modal--dlg .modal__head h2{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }   /* 읽기 프로그램용 제목 — 보이는 제목은 본문 안 */
.modal--dlg .modal__close{ width:30px; height:30px; }
.modal--alert.modal--dlg .modal__body{ display:grid; grid-template-columns:minmax(0,1fr); gap:6px; padding:18px 18px 2px 20px; text-align:left; white-space:normal; }
.modal--dlg .modal__body .dlg__title{ margin:0; padding-right:24px; font-size:16px; font-weight:900; line-height:1.35; color:var(--text); word-break:keep-all; }
.dlg__detail{ margin:0; font-size:var(--fs-sm); font-weight:800; color:var(--text); }
.dlg__msg{ margin:0; font-size:13px; line-height:1.55; color:var(--text-sub); white-space:pre-line; word-break:keep-all; }
.dlg__rows{ display:grid; margin:4px 0 0; padding:2px 12px; border-radius:10px; background:var(--bg); }
.dlg__rows div{ display:flex; align-items:baseline; justify-content:space-between; gap:12px; padding:7px 0; }
.dlg__rows div + div{ border-top:1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.dlg__rows dt{ flex:none; font-size:12.5px; color:var(--text-mute); }
.dlg__rows dd{ min-width:0; margin:0; font-size:13.5px; font-weight:800; color:var(--text); text-align:right; font-variant-numeric:tabular-nums; word-break:break-all; }
.dlg__rows .is-hot dd{ font-size:var(--fs-base); font-weight:900; color:var(--accent-fg); }
.modal--dlg .modal__foot{ display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); gap:8px; padding:14px 18px 18px; border-top:0; }
.modal--dlg .modal__foot .btn{ height:42px; border-radius:10px; font-size:var(--fs-sm); font-weight:800; }
.modal--dlg .modal__foot .btn:not(.btn--gold):not(.btn--danger){ background:var(--surface-2); border-color:transparent; }
.btn--danger{ background:#e5485d; border-color:#e5485d; color:#fff; }
.btn--danger:hover{ background:#f05a6e; border-color:#f05a6e; }
@keyframes fade{ from{ opacity:0; } }

/* ==== 토스트 (복사됨 · 저장됨 같은 짧은 알림) ============================= */
/* 가운데 잠깐 알림 (ui.js flash) — 복사처럼 "됐다"만 알릴 때. [✓ 글 · 작은 글] 한 줄, 버튼 없이 떴다 사라진다 */
.flash{
  position:fixed; left:50%; top:50%; z-index:calc(var(--z-toast) + 1); translate:-50% -50%;
  display:flex; align-items:center; gap:8px; max-width:calc(100 * var(--vw) - 48px); height:44px; padding:0 16px 0 12px;
  border-radius:12px; background:color-mix(in srgb, var(--surface-2) 97%, transparent); box-shadow:var(--shadow-pop), inset 0 0 0 1px var(--line);
  white-space:nowrap; pointer-events:none; animation:flashIn .16s ease-out;
  transition:opacity .25s ease, scale .25s ease;
}
.flash.is-out{ opacity:0; scale:.96; }
.flash__ico{ flex:none; display:grid; place-items:center; width:20px; height:20px; border-radius:50%; background:#2fd39a; color:#06281b; }
.flash.is-warn .flash__ico{ background:#ffae3d; color:#2a1800; }
.flash__ico svg{ width:12px; height:12px; stroke-width:3; }
.flash b{ font-size:var(--fs-sm); font-weight:800; color:var(--text); }
.flash small{ min-width:0; overflow:hidden; text-overflow:ellipsis; font-size:12px; color:var(--text-mute); font-variant-numeric:tabular-nums; }
.flash small::before{ content:"·"; margin-right:8px; color:var(--text-mute); }
@keyframes flashIn{ from{ opacity:0; scale:.92; } to{ opacity:1; scale:1; } }
@media (prefers-reduced-motion:reduce){ .flash{ animation:none; transition:none; } }
.toast{ position:fixed; left:50%; bottom:40px; z-index:var(--z-toast); transform:translateX(-50%); padding:12px 20px; border-radius:var(--r); background:var(--surface-2); color:var(--text); box-shadow:var(--shadow-pop); animation:fade var(--t-fast); }

/* ==== 준비 중 · 2026 표시 등 작은 안내 띠 =============================== */
.callout{ display:flex; gap:var(--gap-sm); align-items:flex-start; padding:var(--gap-md) var(--gap-lg); border:1px solid var(--line); border-left:3px solid var(--accent-line); border-radius:var(--r); background:var(--surface); color:var(--text-sub); }
.callout svg{ flex:none; width:18px; height:18px; margin-top:2px; color:var(--accent-fg); }

/* ==== 가운데 제목형 페이지 머리 (고객센터 · 이벤트) ======================= */
.pagehead{ padding:var(--gap-2xl) 0 var(--gap-xl); text-align:center; }
.pagehead h1{ display:inline-block; font-size:var(--fs-4xl); font-weight:var(--fw-bold); }
.pagehead h1::after{ content:""; display:block; width:60%; height:3px; margin:10px auto 0; background:var(--accent); }
.pagehead p{ margin-top:var(--gap-sm); color:var(--text-sub); }
.searchband{ display:flex; justify-content:center; gap:var(--gap-sm); padding:var(--gap-2xl) 0; border-radius:var(--r); background:var(--surface); margin-bottom:var(--gap-lg); }
.searchband .select{ width:200px; }

/* ==== 가로 게임 줄 (Empire 구도) — 제목 + [모두보기][‹][›] + 옆으로 넘기기 === */
.rail{ margin-top:var(--gap-2xl); }
.rail__head{ display:flex; align-items:center; gap:var(--gap-sm); margin-bottom:var(--gap-md); }
.rail__title{ display:flex; align-items:center; gap:12px; margin-right:auto; font-size:var(--fs-2xl); font-weight:900; letter-spacing:-.01em; }
.rail__title svg{ display:none; }   /* 아이콘 대신 사선 막대 */
.rail__nav{ display:grid; place-items:center; width:var(--btn-h-sm); height:var(--btn-h-sm); border:1px solid var(--line); border-radius:var(--r); background:var(--surface); color:var(--text-sub); transition:color var(--t-fast), border-color var(--t-fast); }
.rail__nav:hover{ color:var(--accent-fg); border-color:var(--accent-line); }
.rail__nav:disabled{ opacity:.35; pointer-events:none; }
.rail__nav svg{ width:16px; height:16px; }
.rail__track{ display:grid; grid-auto-flow:column; grid-auto-columns:calc((100% - 6 * var(--gap-md)) / 7); gap:var(--gap-md); overflow-x:auto; scroll-snap-type:x mandatory; scroll-behavior:smooth; scrollbar-width:none; padding-bottom:4px; }
.rail__track::-webkit-scrollbar{ display:none; }
.rail__track > *{ scroll-snap-align:start; }

/* 세로형 게임카드 (3:4) — 이름 · 아이콘은 그림 위 아래쪽에 겹친다 */
.gamecard--tall .gamecard__thumb{ aspect-ratio:3 / 4; }
.gamecard--tall .gamecard__thumb::after{ height:55%; background:linear-gradient(to bottom,transparent,color-mix(in srgb, var(--bg-deep) 92%, transparent)); }
.gamecard--tall .gamecard__info{ position:absolute; left:0; right:0; bottom:0; z-index:1; height:auto; padding:10px 8px 10px 14px; }
.gamecard--tall .gamecard__vendor{ left:10px; right:auto; top:10px; border-radius:var(--r); padding:3px 8px; background:color-mix(in srgb, var(--bg-deep) 70%, transparent); -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px); }
.gamecard--tall .gamecard__ribbon{ left:auto; right:-30px; transform:rotate(40deg); }
.gamecard--tall .gamecard__act{ opacity:0; transition:opacity var(--t-fast), color var(--t-fast); }
.gamecard--tall:hover .gamecard__act, .gamecard--tall:focus-within .gamecard__act, .gamecard--tall .gamecard__act[aria-pressed="true"]{ opacity:1; }
.gamecard--tall:hover{ transform:translateY(-4px); }
.gamecard--tall{ transition:transform var(--t); }
/* 그림이 아직 없을 때(대체 그림에 이름이 크게 있음)는 아래 이름을 숨긴다 — 이름이 두 번 보이지 않게 */
.gamecard--tall:has(.gamecard__ph) .gamecard__title{ visibility:hidden; }

/* ==========================================================================
   밤하늘 층 — 반짝이는 별 + 가끔 떨어지는 별똥별. 어느 상자에든 첫 자식으로 얹는다
   <span class="sky" aria-hidden="true"><i></i><i></i><i></i></span>
   ★ 별똥별은 주기(9 · 13 · 17초) 중 앞 6%만 보인다 — 늘 날아다니면 산만하다
   ========================================================================== */
.sky{ position:absolute; inset:0; z-index:0; overflow:hidden; pointer-events:none; border-radius:inherit; }
.sky::before, .sky::after{
  content:""; position:absolute; inset:0;
  background-image:
    radial-gradient(1px 1px at 20px 30px, #fff, transparent), radial-gradient(1px 1px at 140px 80px, #dfe6ff, transparent),
    radial-gradient(1.5px 1.5px at 90px 150px, #fff, transparent), radial-gradient(1px 1px at 200px 190px, #ffe9c2, transparent),
    radial-gradient(1px 1px at 260px 40px, #fff, transparent), radial-gradient(.8px .8px at 60px 220px, #cfe0ff, transparent);
  background-size:300px 240px; animation:skyTwinkle 4s ease-in-out infinite alternate;
}
.sky::after{ background-size:420px 330px; background-position:130px 90px; animation-duration:6s; animation-delay:-2s; opacity:.7; }
@keyframes skyTwinkle{ from{ opacity:.35; } to{ opacity:1; } }
.sky i{
  position:absolute; top:-10%; left:70%; width:140px; height:2px; border-radius:2px; opacity:0;
  background:linear-gradient(90deg, rgba(255,255,255,0), #fff 70%, #fff8dc);
  filter:drop-shadow(0 0 6px rgba(255,236,190,.9));
  transform:rotate(-32deg); animation:skyShoot 9s linear infinite;
}
.sky i:nth-child(2){ left:40%; animation-duration:13s; animation-delay:4s; width:110px; }
.sky i:nth-child(3){ left:90%; animation-duration:17s; animation-delay:9s; width:160px; }
@keyframes skyShoot{
  0%{ opacity:0; translate:0 0; }
  1%{ opacity:1; }
  6%{ opacity:0; translate:-420px 260px; }
  100%{ opacity:0; translate:-420px 260px; }
}
@media (prefers-reduced-motion:reduce){ .sky::before, .sky::after, .sky i{ animation:none; } .sky i{ display:none; } }

/* ---- 두 톤 아이콘 타일 (js/my-icons.js — 마이페이지 · 게시판이 함께 쓴다) ----------------------------------- */
.dt{ position:relative; display:grid; place-items:center; flex:none; width:38px; height:38px; border-radius:11px; font-style:normal;
  background:linear-gradient(145deg, var(--t1), var(--t2)); box-shadow:inset 0 1px 0 rgba(255,255,255,.35), inset 0 -2px 0 rgba(0,0,0,.18), 0 6px 14px -6px var(--t2); }
.dt::after{ content:""; position:absolute; inset:0; border-radius:inherit; background:linear-gradient(180deg, rgba(255,255,255,.22), transparent 55%); pointer-events:none; }
.dt svg{ position:relative; z-index:1; width:21px; height:21px; filter:drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.dt--gold{ --t1:color-mix(in srgb, var(--gold) 65%, #fff); --t2:color-mix(in srgb, var(--gold) 40%, var(--gold-deep)); }
.dt--green{ --t1:#4fe3ae; --t2:#0e9f6e; }
.dt--blue{ --t1:#6aa9ff; --t2:#2f5fe0; }
.dt--pink{ --t1:#ff8fc2; --t2:#d9366f; }
.dt--violet{ --t1:#b392ff; --t2:#6d3fe0; }
.dt--teal{ --t1:#5ee0e0; --t2:#138b9e; }


/* ==== 휴대폰 (1023px 이하) ================================================ */
@media (max-width:1023px){
  /* 팝업 — 화면 폭을 거의 다 쓰고, 넘치면 안쪽 스크롤 */
  .modal{ padding:12px; }
  .modal__dialog{ width:100%; max-height:calc(100 * var(--vh) - 24px); }
  .modal__body{ padding:var(--gap-md); }
  .toast{ bottom:calc(var(--mtab-h) + 16px); max-width:calc(100 * var(--vw) - 32px); }
  /* 제목줄 · 버튼 */
  .sec__head{ min-height:56px; }
  .btn--lg{ padding:0 var(--gap-lg); }
  .btn-row{ flex-wrap:wrap; }
  /* 게임 카드 — 2칸 */
  .game-grid, .game-feature .game-grid{ grid-template-columns:repeat(2, minmax(0,1fr)); }
  .game-feature{ grid-template-columns:1fr; }
  .gamecard__info{ height:44px; padding:0 8px 0 12px; }
  /* 분류 탭 — 가로로 밀어 본다 */
  .cattabs{ overflow-x:auto; scrollbar-width:none; }
  .cattabs::-webkit-scrollbar{ display:none; }
  .cattab{ flex:none; }
  .catbar__tools{ width:100%; }
  .search, .search--wide{ width:100%; }
  .search--wide .input{ flex:1; width:auto; min-width:0; }
  /* 입력 표 — 이름칸을 위로 */
  .form__row{ grid-template-columns:1fr; }
  .form__label{ padding:10px var(--gap-md) 4px; background:none; }
}

/* 가로 줄(게임사 · 슬롯 · 경기) — 휴대폰은 손가락으로 민다. 한 화면에 2장 반이 보여 옆에 더 있다는 걸 알린다 */
@media (max-width:1023px){
  .rail{ margin-top:var(--gap-xl); }
  .rail__head{ margin-bottom:var(--gap-sm); }
  .rail__nav{ display:none; }
  .rail__title{ font-size:17px; }
  .rail__title svg{ width:18px; height:18px; }
  .rail__head .btn{ height:30px; padding:0 12px; font-size:12px; }
  /* 게임 카드는 폭을 고정 — 화면이 넓어져도 카드가 커져 배너보다 길어지지 않고, 대신 보이는 장수가 늘어난다 */
  .rail--vendor .rail__track{ grid-auto-columns:84px; }
  .sec__head .btn{ height:30px; padding:0 12px; font-size:12px; }
  .rail__track{ grid-auto-columns:calc((100% - 2 * var(--gap-sm)) / 2.6); gap:var(--gap-sm); margin-inline:-16px; padding-inline:16px; scroll-padding-inline:16px; }
}

/* 표 — 휴대폰은 칸을 줄이지 않고 옆으로 민다 (글자가 한 글자씩 꺾이지 않게) */
@media (max-width:1023px){
  .tbl-scroll{ overflow-x:auto; margin-inline:-16px; padding-inline:16px; scrollbar-width:thin; }
  .tbl-scroll > .tbl{ min-width:640px; }
  .tbl-scroll .tbl :is(th, td), .tbl-scroll .tbl :is(th, td).l{ padding-inline:8px; white-space:nowrap; }
}

/* 태블릿 세로 (600~1023px) — 휴대폰 틀 그대로, 칸 수만 늘린다 */
@media (min-width:600px) and (max-width:1023px){
  .game-grid, .game-feature .game-grid{ grid-template-columns:repeat(4, minmax(0,1fr)); }
  .rail__track{ grid-auto-columns:calc((100% - 4 * var(--gap-sm)) / 4.4); }
  .rail--vendor .rail__track{ grid-auto-columns:104px; }
}

/* ---- 선택 · 삭제 (쪽지함 · 1:1 문의) ---------------------------------------
   체크 상자 .chk + 도구줄 [☐ 전체 선택 n] [선택 삭제] [전체 삭제] ……… [오른쪽 버튼] */
.chk{ position:relative; display:inline-flex; align-items:center; gap:8px; cursor:pointer; }
.chk input{ position:absolute; opacity:0; width:1px; height:1px; }
.chk > i{ flex:none; display:grid; place-items:center; width:18px; height:18px; border-radius:5px; border:1.5px solid var(--line-strong); background:transparent; color:transparent; transition:background-color .15s, border-color .15s; }
.chk > i svg{ width:12px; height:12px; }
.chk:hover > i{ border-color:var(--accent-line); }
.chk input:checked + i{ background:var(--accent); border-color:var(--accent-line); color:var(--accent-ink); }
.chk input:focus-visible + i{ outline:2px solid var(--accent-line); outline-offset:2px; }
.sel-tools{ display:flex; align-items:center; gap:6px; }
.sel-tools__all{ margin-right:6px; padding-left:18px; font-size:12px; font-weight:700; color:var(--text-sub); white-space:nowrap; }
.sel-tools__all b{ color:var(--accent-fg); }
.sel-tools__btn{ display:inline-flex; align-items:center; gap:5px; height:30px; padding:0 12px; border-radius:8px; border:1px solid var(--line); background:var(--well, rgba(0,0,0,.2)); font-size:12px; font-weight:700; color:var(--text-sub); white-space:nowrap; cursor:pointer; transition:border-color .2s, color .2s; }
.sel-tools__btn svg{ width:13px; height:13px; }
.sel-tools__btn:hover{ color:var(--text); border-color:var(--line-strong); }
.sel-tools__btn.is-del:hover{ color:var(--danger); border-color:color-mix(in srgb, var(--danger) 50%, transparent); }
.sel-tools__btn.is-end{ margin-left:auto; }
.sel-tools__btn:disabled{ opacity:.4; pointer-events:none; }
@media (max-width:1023px){
  .sel-tools{ gap:4px; }
  .sel-tools__all{ padding-left:4px; margin-right:2px; }
  .sel-tools__btn{ height:28px; padding:0 8px; font-size:11px; }
  .sel-tools__btn.is-end svg{ display:none; }
}

/* ---- 라이브챗 떠 있는 버튼 (홈 오른쪽 아래) — js/layout.js liveChatFab ----------------
   [말풍선 · 라이브챗 · 초록 점] 파란 알약. 휴대폰은 아래 탭 위에 동그라미만 */
.chat-fab{
  position:fixed; right:12px; bottom:20px; z-index:var(--z-quick);
  display:inline-flex; align-items:center; gap:8px; height:48px; padding:0 18px 0 14px; border-radius:99px;
  background:linear-gradient(180deg, #4d8dff, #2563eb); color:#fff; font-size:13px; font-weight:900;   /* 라이브챗은 파랑 · 흰 글자 */
  box-shadow:0 12px 28px -8px rgba(37,99,235,.7), 0 1px 0 rgba(255,255,255,.3) inset;
  transition:transform .2s cubic-bezier(.16,1,.3,1), filter .2s;
}
.chat-fab svg{ width:20px; height:20px; }
.chat-fab i{ position:absolute; top:6px; right:8px; width:9px; height:9px; border-radius:50%; background:#2fd39a; box-shadow:0 0 0 2px #2f6ff0; }
.chat-fab:hover{ transform:translateY(-2px); filter:brightness(1.05); }
.chat-fab:focus-visible{ outline:2px solid #fff; outline-offset:3px; }
@media (max-width:1023px){
  .chat-fab{ right:14px; bottom:calc(var(--mtab-h) + env(safe-area-inset-bottom) + 14px); width:48px; padding:0; justify-content:center; }
  .chat-fab span{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
  .chat-fab i{ top:4px; right:4px; }
}

/* ---- 옆으로 넘치는 줄의 < > (js/scroll-arrows.js) — 줄 양끝에 겹쳐 뜨고, 끝에 닿은 쪽은 숨는다 ---- */
.sx{ position:relative; min-width:0; }
.sx__btn{
  position:absolute; top:50%; z-index:2; translate:0 -50%; display:grid; place-items:center; width:28px; height:28px; border-radius:50%;
  background:var(--surface-2); border:1px solid var(--line-strong); color:var(--text); box-shadow:0 4px 12px rgba(0,0,0,.35); cursor:pointer;
}
.sx__btn svg{ width:14px; height:14px; }
.sx__btn.is-prev{ left:-6px; }
.sx__btn.is-next{ right:-6px; }
.sx__btn[hidden]{ display:none; }
.sx__btn:hover{ color:var(--accent-fg); border-color:var(--accent-line); }

/* ==========================================================================
   테마 고르기 (데모 전용) — 왼쪽 아래. js/theme.js
   [◀] [● 12/37 테마 이름] [▶] · 가운데를 누르면 전체 목록(다크 · 화이트)
   ========================================================================== */
.themer{ position:fixed; left:20px; bottom:20px; z-index:var(--z-toast); font-family:var(--font); }
.themer__bar{ display:flex; gap:2px; box-shadow:0 10px 30px rgba(0,0,0,.35); }
.themer__bar > button{ height:40px; background:#0a0a0a; color:#fff; }
.themer__step{ width:34px; font-size:10px; }
.themer__step:hover{ background:#262626; }
.themer__btn{ display:flex; align-items:center; gap:8px; max-width:280px; padding:0 14px 0 10px; font-size:12px; white-space:nowrap; }
.themer__btn:hover{ background:#1a1a1a; }
.themer__cur{ overflow:hidden; text-overflow:ellipsis; color:#9a9a9a; }
.themer__cur b{ font-family:"Barlow Condensed", sans-serif; font-size:16px; font-weight:800; color:#fff; }
.themer__cur em{ margin-left:6px; font-style:normal; font-weight:700; color:#fff; }
.themer__dot{ flex:none; width:14px; height:14px; border-radius:50%; background:conic-gradient(#e10600 0 20%, #16e05b 0 40%, #ff5f00 0 60%, #1665ff 0 80%, #c8f31d 0); }
.themer__panel{
  position:absolute; left:0; bottom:calc(100% + 10px); width:560px; max-height:min(72vh, 640px); overflow-y:auto; padding:10px;
  border-radius:8px; background:#111; color:#fff; box-shadow:0 20px 50px rgba(0,0,0,.5);
}
.themer__title{ display:flex; justify-content:space-between; align-items:baseline; padding:4px 6px 8px; font-size:13px; font-weight:800; }
.themer__title small{ font-size:11px; font-weight:500; color:#8a8a8a; }
.themer__group{ margin:8px 6px 6px; font-size:11px; font-weight:800; letter-spacing:.1em; color:#8a8a8a; }
.themer__grid{ display:grid; grid-template-columns:1fr 1fr; gap:2px; }
.themer__opt{ display:flex; align-items:center; gap:8px; height:36px; padding:0 8px; border-radius:4px; font-size:12px; font-weight:600; color:#bdbdbd; text-align:left; }
.themer__opt:hover{ background:#1f1f1f; color:#fff; }
.themer__opt[aria-checked="true"]{ background:#262626; color:#fff; box-shadow:inset 3px 0 0 #fff; }
.themer__no{ width:18px; font-family:"Barlow Condensed", sans-serif; font-size:13px; font-weight:800; color:#6f6f6f; text-align:right; }
.themer__sw{ display:flex; flex:none; overflow:hidden; border-radius:3px; box-shadow:0 0 0 1px #333; transform:skewX(-10deg); }
.themer__sw i{ width:11px; height:20px; }
.themer__name{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
@media (max-width:1023px){
  .themer{ left:12px; bottom:calc(var(--mtab-h) + 12px + env(safe-area-inset-bottom)); }
  .themer__btn{ max-width:170px; }
  .themer__cur em{ display:none; }
  .themer__panel{ width:calc(100vw - 24px); }
  .themer__grid{ grid-template-columns:1fr; }
}
