/* 라이브온 (LiveON) — 회원용 프론트 전용 화이트 테마 (관리자는 style.css 그대로 사용) */
:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-2: #f3f5fa;
  --line: #e6e9f0;
  --line-2: #d9dee9;
  --text: #191d28;
  --muted: #8a93a7;
  --blue: #3566f6;
  --blue-deep: #2450d8;
  --blue-soft: #eef2fe;
  --violet: #7c5cff;
  --jelly: #f59e0b;
  --jelly-deep: #d97706;
  --jelly-soft: #fff7e8;
  --red: #ff3b5c;
  --green: #12a876;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(20, 28, 50, .05);
  --shadow-md: 0 6px 20px rgba(20, 28, 50, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Pretendard Variable', Pretendard, -apple-system, 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  font-size: 15px;
  line-height: 1.55;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 18px; }
.main { padding-top: 20px; padding-bottom: 60px; min-height: 60vh; }
.muted { color: var(--muted); }
.center { text-align: center; }
.center-pad { text-align: center; padding: 48px 16px; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; letter-spacing: 1px; }

/* ---------- 상단바 (화이트) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .95); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 8px rgba(20, 28, 50, .05);
}
.topbar-in { display: flex; align-items: center; gap: 22px; height: 60px; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 21px; font-weight: 800; color: var(--text); white-space: nowrap; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px rgba(255, 59, 92, .6); animation: pulse 2s infinite; }
.brand-live {
  font-size: 10px; font-weight: 700; color: #fff; background: var(--red);
  border-radius: 4px; padding: 2px 5px; letter-spacing: 1px;
}
.gnb { display: flex; gap: 4px; flex: 1; }
.gnb a { color: #5b6373; font-weight: 600; padding: 6px 12px; border-radius: 8px; }
.gnb a:hover { color: var(--text); text-decoration: none; background: var(--panel-2); }
.gnb a.on { color: var(--blue); }
.top-right { display: flex; align-items: center; gap: 10px; }
.jelly-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--jelly-soft); border: 1px solid rgba(245, 158, 11, .4);
  color: var(--jelly-deep); font-weight: 700; border-radius: 999px; padding: 5px 12px; font-size: 13px;
}
.jelly-chip:hover { text-decoration: none; background: #ffefd2; }
.jelly-ico { color: var(--jelly); font-size: 11px; }
.user-chip { position: relative; }
.user-nick { cursor: pointer; font-weight: 700; padding: 6px 10px; border-radius: 8px; }
.user-nick:hover { background: var(--panel-2); }
.user-chip:hover .user-menu { display: block; }
.user-menu {
  display: none; position: absolute; right: 0; top: 100%; min-width: 150px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 6px; box-shadow: 0 12px 32px rgba(20, 28, 50, .14);
}
.user-menu a { display: block; color: var(--text); padding: 8px 12px; border-radius: 6px; font-size: 14px; }
.user-menu a:hover { background: var(--panel-2); text-decoration: none; }

/* ---------- 공지 롤링 ---------- */
.ticker { background: #fff; border-bottom: 1px solid var(--line); }
.ticker-in { display: flex; align-items: center; gap: 12px; height: 38px; }
.ticker-label {
  flex: none; font-size: 11px; font-weight: 800; color: var(--blue);
  border: 1px solid rgba(53, 102, 246, .35); border-radius: 4px; padding: 1px 7px;
}
.ticker-clip { overflow: hidden; flex: 1; }
.ticker-track { display: inline-flex; gap: 24px; white-space: nowrap; animation: tick 30s linear infinite; }
.ticker-track a { color: #5b6373; font-size: 13px; }
.ticker-track a:hover { color: var(--blue); }
.ticker-sep { color: var(--line-2); }
@keyframes tick { from { transform: translateX(100%); } to { transform: translateX(-100%); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- 패널/버튼/폼 ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.panel h2, .panel h3 { margin: 0 0 14px; }
.btn {
  display: inline-block; border-radius: 9px; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: 14px; padding: 9px 18px;
  color: var(--text); background: #fff; border: 1px solid var(--line-2);
}
.btn:hover { text-decoration: none; filter: brightness(.97); box-shadow: var(--shadow-sm); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-deep); }
.btn-jelly { background: linear-gradient(180deg, #fbbf24, var(--jelly)); border: 0; color: #402a02; }
.btn-danger { background: #fff0f2; border-color: rgba(255, 59, 92, .35); color: var(--red); }
.btn-ghost { background: transparent; border-color: var(--line-2); }
.btn-sm { padding: 6px 13px; font-size: 13px; }
.btn-xs { padding: 3px 9px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn-cell { white-space: nowrap; }
.form label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 14px; }
.form input, .form textarea, .form select, .search-row input {
  display: block; width: 100%; margin-top: 6px;
  background: #fff; border: 1px solid var(--line-2); color: var(--text);
  border-radius: 9px; padding: 10px 12px; font-family: inherit; font-size: 14px;
}
.form input:focus, .form textarea:focus, .form select:focus, .search-row input:focus,
.chat-input-row input:focus, .svc-input-row input:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(53, 102, 246, .12);
}
.form .check { display: flex; align-items: center; gap: 8px; }
.form .check input { width: auto; margin: 0; }
.form-inline { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.form-inline label { flex: 1; min-width: 160px; margin-bottom: 0; }
.form-inline .form-wide { flex-basis: 100%; }
.form-inline .btn { flex: none; margin-bottom: 0; height: 41px; }
.auth-panel { max-width: 420px; margin: 48px auto; }
.auth-panel h2 { margin-top: 0; }
.flash {
  background: var(--blue-soft); border: 1px solid rgba(53, 102, 246, .3);
  color: var(--blue-deep); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px;
}
.flash-err { background: #fff0f2; border-color: rgba(255, 59, 92, .35); color: #d61f40; }

/* ---------- 필드/라디오 ---------- */
.field-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.radio-row { display: flex; gap: 18px; padding: 4px 2px; }
.radio-item { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; }
.radio-item input { display: inline-block; width: 16px; height: 16px; margin-top: 0; accent-color: var(--blue); }

/* ---------- 홈 히어로 (라이트 배너) ---------- */
.hero {
  border-radius: var(--radius); overflow: hidden; margin-bottom: 24px;
  background: linear-gradient(115deg, #e8eeff 0%, #f1ecff 48%, #e5f6ff 100%);
  border: 1px solid var(--line);
  background-size: cover; background-position: center;
}
.hero-mask {
  background: linear-gradient(90deg, rgba(255, 255, 255, .65) 15%, rgba(255, 255, 255, .1) 70%, rgba(255, 255, 255, 0));
  padding: 72px 40px;
}
.hero h2 { margin: 0 0 8px; font-size: 30px; color: var(--text); }
.hero p { color: #5b6373; margin: 0 0 20px; }
.hero-btns { display: flex; gap: 10px; }
.hero-ghost { border-color: var(--line-2); color: var(--text); background: rgba(255, 255, 255, .7); }

/* ---------- 섹션 ---------- */
.sec-head { display: flex; align-items: center; gap: 10px; margin: 8px 0 16px; }
.sec-head h2 { margin: 0; font-size: 20px; display: flex; align-items: center; gap: 8px; }
.sec-sub { color: var(--muted); font-size: 13px; }
.sec-more { margin-left: auto; font-size: 13px; font-weight: 600; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px rgba(255, 59, 92, .5); animation: pulse 2s infinite; }
.home-grid { display: grid; grid-template-columns: 1fr 300px; gap: 24px; }

/* ---------- 카테고리 탭 (아프리카TV 스타일 칩) ---------- */
.cat-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 18px; }
.cat-tabs a {
  padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 700;
  color: #5b6373; background: #fff; border: 1px solid var(--line-2);
}
.cat-tabs a:hover { text-decoration: none; color: var(--blue); border-color: rgba(53, 102, 246, .45); }
.cat-tabs a.on { background: var(--blue); border-color: var(--blue); color: #fff; text-decoration: none; }

/* ---------- 라이브 카드 그리드 (16:9 가로형) ---------- */
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.live-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.room-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; color: var(--text); transition: transform .15s, border-color .15s, box-shadow .15s;
}
.room-card:hover { transform: translateY(-3px); border-color: rgba(53, 102, 246, .5); text-decoration: none; box-shadow: var(--shadow-md); }
.thumb { position: relative; aspect-ratio: 16/9; background: #e9edf4; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.live-card-body { padding: 11px 13px 13px; }
.badge { position: absolute; font-size: 11px; font-weight: 800; border-radius: 6px; padding: 2px 7px; }
.badge-live { top: 8px; left: 8px; background: var(--red); color: #fff; letter-spacing: 1px; box-shadow: 0 2px 6px rgba(255, 59, 92, .4); }
.badge-live::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #fff; margin-right: 5px; vertical-align: 1px; animation: pulse 1.6s infinite; }
.badge-view { bottom: 8px; right: 8px; background: rgba(0, 0, 0, .65); color: #fff; }
.badge-lock { top: 8px; right: 8px; background: rgba(0, 0, 0, .7); color: #ffd166; }
.badge-rank { bottom: 8px; left: 8px; background: rgba(245, 158, 11, .95); color: #402a02; }
.badge-chat { top: 8px; left: 8px; background: var(--blue); color: #fff; letter-spacing: 1px; }
.room-meta { padding: 12px 14px; }
.room-title { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-sub { display: flex; gap: 8px; margin-top: 5px; font-size: 12px; align-items: center; }
.nick { color: var(--blue); font-weight: 600; }
.cat { color: var(--muted); background: var(--panel-2); border-radius: 5px; padding: 1px 7px; font-size: 11px; }
.mini-jelly { color: var(--jelly-deep); font-size: 11px; font-weight: 700; }
.jelly-text { color: var(--jelly-deep); }

/* ---------- 세로형 사진 카드 (채팅방 목록 등 기존 페이지) ---------- */
.photo-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.thumb-tall { aspect-ratio: 3/4; }
.thumb-tall img { width: 100%; height: 100%; object-fit: cover; }
.photo-card .thumb { position: relative; }
.photo-info {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(0deg, rgba(10, 16, 34, .88) 30%, transparent);
  padding: 34px 12px 12px; color: #fff;
}
.photo-info .room-title { font-size: 14px; color: #fff; }
.photo-info .nick { color: #9db4ff; }

/* ---------- 랭킹 ---------- */
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.rank-list li:last-child { border-bottom: 0; }
.rank-no { flex: none; width: 22px; text-align: center; font-weight: 800; color: var(--muted); font-style: italic; }
.rank-no.hot { color: var(--jelly-deep); }
.rank-name { flex: 1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-val { color: var(--jelly-deep); font-size: 12px; font-weight: 700; white-space: nowrap; }
.rank-list .empty { justify-content: center; color: var(--muted); }
.rank-10 { columns: 2; column-gap: 32px; }
.rank-10 li { break-inside: avoid; }
@media (max-width: 700px) { .rank-10 { columns: 1; } }

/* ---------- 채팅방 스트립 (홈) ---------- */
.chatroom-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 28px; }
.chatroom-chip {
  position: relative; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 12px; color: var(--text); text-align: center;
  transition: border-color .15s, box-shadow .15s;
}
.chatroom-chip:hover { border-color: rgba(53, 102, 246, .5); text-decoration: none; box-shadow: var(--shadow-sm); }
.chatroom-chip img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; margin-bottom: 8px; border: 2px solid var(--line); }
.chip-name { display: block; font-weight: 800; font-size: 14px; }
.chip-title { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-lock { position: absolute; top: 8px; right: 8px; }

/* ---------- 라이브 목록 (2열) ---------- */
.live-list-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.live-list-head h2 { margin: 0; }
.live-search { flex: 1; min-width: 260px; max-width: 520px; margin-bottom: 0; }
.live-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.live-item {
  display: flex; gap: 14px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px; color: var(--text);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.live-item:hover { border-color: rgba(53, 102, 246, .5); transform: translateY(-2px); text-decoration: none; box-shadow: var(--shadow-sm); }
.live-thumb { position: relative; flex: none; width: 118px; height: 158px; border-radius: 10px; overflow: hidden; background: #e9edf4; }
.live-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.live-item-info { flex: 1; display: flex; flex-direction: column; gap: 6px; justify-content: center; min-width: 0; }
.live-item-info .room-title { white-space: normal; }
.live-item-info .room-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .live-list { grid-template-columns: 1fr 1fr; gap: 10px; }
  .live-item { display: block; position: relative; padding: 0; overflow: hidden; }
  .live-thumb { width: 100%; height: auto; aspect-ratio: 3 / 4; border-radius: 0; }
  .live-item-info {
    position: absolute; left: 0; right: 0; bottom: 0;
    gap: 4px; padding: 26px 10px 9px;
    background: linear-gradient(to top, rgba(0, 0, 0, .8), rgba(0, 0, 0, 0));
  }
  .live-item-info .room-title { color: #fff; font-size: 13px; font-weight: 700; text-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
  .live-item-info .room-sub { gap: 6px; font-size: 11px; }
  .live-item-info .nick, .live-item-info .cat, .live-item-info .mini-jelly { text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
  .live-item-info .nick { color: #9db4ff; }
}

/* ---------- 방송 페이지 ---------- */
.live-layout { display: grid; grid-template-columns: 1fr 360px; gap: 20px; }
.player { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.player video { width: 100%; aspect-ratio: 16/9; display: block; }
.player-live { top: 12px; left: 12px; }
.gift-overlay { position: absolute; right: 12px; top: 60px; bottom: 60px; width: 260px; pointer-events: none; overflow: hidden; }
.gift-fly {
  position: absolute; right: 0; display: flex; align-items: center; gap: 8px;
  background: rgba(255, 251, 240, .96); border: 1px solid rgba(245, 158, 11, .5);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 700; color: var(--text);
  box-shadow: 0 6px 18px rgba(20, 28, 50, .18);
  animation: giftfly 4s ease-in forwards;
}
.gift-fly .g-emoji { font-size: 22px; }
.gift-fly .g-name { color: var(--jelly-deep); }
@keyframes giftfly {
  0% { transform: translateX(60px); opacity: 0; }
  10% { transform: translateX(0); opacity: 1; }
  80% { transform: translateX(0); opacity: 1; }
  100% { transform: translateY(-24px); opacity: 0; }
}
.live-info { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.live-title { margin: 0 0 6px; font-size: 20px; }
.live-sub { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.live-total { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.live-total b { color: var(--jelly-deep); font-size: 18px; display: block; line-height: 1.2; }
.live-total .muted { font-size: 11px; }
.product-info h3 { margin-bottom: 8px; }
.product-body { color: var(--text); font-size: 14px; }

.live-side { display: flex; flex-direction: column; height: 640px; padding: 0; overflow: hidden; }
.chat-head { padding: 13px 16px; font-weight: 800; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.chat-head-side { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.chat-head-side .jelly-chip { padding: 4px 10px; font-size: 12px; white-space: nowrap; }
.chat-head-side .mini-jelly { white-space: nowrap; }
.chat-list { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { font-size: 13.5px; animation: chatin .18s ease-out; overflow-wrap: anywhere; }
.chat-msg .c-nick { font-weight: 700; color: var(--blue); margin-right: 6px; }
.chat-msg.gift .c-nick { color: var(--jelly-deep); }
.chat-msg.gift { background: var(--jelly-soft); border-radius: 8px; padding: 6px 9px; }
.chat-msg .c-time { color: var(--muted); font-size: 11px; margin-left: 6px; }
@keyframes chatin { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }
.gift-bar { border-top: 1px solid var(--line); padding: 10px 12px; }
.gift-row { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.gift-btn {
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  cursor: pointer; padding: 5px 2px; display: flex; flex-direction: column; align-items: center; gap: 1px;
  font-family: inherit; color: var(--text);
}
.gift-btn:hover { background: var(--panel-2); }
.gift-btn.sel { border-color: var(--jelly); background: var(--jelly-soft); }
.gift-emoji { font-size: 20px; }
.gift-price { font-size: 10px; color: var(--jelly-deep); font-weight: 700; }
.gift-name { font-size: 11px; font-weight: 600; }
.gift-send-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.gift-send-row input {
  width: 64px; background: #fff; border: 1px solid var(--line-2); color: var(--text);
  border-radius: 8px; padding: 6px 8px; font-family: inherit;
}
.my-jelly { margin-left: auto; font-size: 12px; color: var(--muted); }
.my-jelly b { color: var(--jelly-deep); }
.chat-input-row { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.chat-input-row input {
  flex: 1; background: #fff; border: 1px solid var(--line-2); color: var(--text);
  border-radius: 8px; padding: 8px 12px; font-family: inherit; font-size: 14px;
}

/* ---------- 방송 페이지 (심플 버전) ---------- */
.room-simple { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.room-head-card { display: flex; align-items: center; gap: 14px; }
.room-head-img { width: 84px; height: 112px; object-fit: cover; border-radius: 10px; flex: none; }
.room-head-info { flex: 1; min-width: 0; }
.room-head-info .live-title { font-size: 20px; margin: 0 0 6px; }
.room-chat-card { display: flex; flex-direction: column; height: 620px; position: relative; }
.room-chat-card .chat-list { flex: 1; }
.gift-overlay-inline { position: absolute; left: 0; right: 0; bottom: 150px; height: 0; overflow: visible; pointer-events: none; z-index: 5; }
@media (max-width: 640px) {
  .room-chat-card { height: calc(100vh - 260px); min-height: 420px; }
  .room-head-img { width: 64px; height: 86px; }
}

/* ---------- 충전 패키지 ---------- */
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.pkg-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 18px; text-align: center; position: relative; overflow: hidden;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.pkg-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: rgba(245, 158, 11, .5); }
.pkg-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--blue); }
.pkg-2::before { background: var(--jelly); }
.pkg-3::before { background: var(--violet); }
.pkg-4::before { background: linear-gradient(90deg, var(--jelly), var(--red)); }
.pkg-icon { font-size: 44px; line-height: 1; margin-bottom: 8px; }
.pkg-icon-img { width: 48px; height: 48px; object-fit: contain; display: inline-block; }
.pkg-name { font-weight: 800; font-size: 17px; }
.pkg-jelly { font-size: 26px; font-weight: 800; color: var(--jelly-deep); margin: 10px 0 2px; display: flex; align-items: center; justify-content: center; gap: 7px; }
.pkg-price { color: var(--muted); margin-bottom: 16px; }
.bank-info {
  background: var(--jelly-soft); border: 1px dashed rgba(245, 158, 11, .5);
  border-radius: 10px; padding: 14px 16px; font-size: 14px; line-height: 1.8;
}

/* ---------- 테이블/태그/탭 ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.tbl th { color: var(--muted); font-size: 12px; font-weight: 600; }
.tbl tr:hover td { background: #fafbfe; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .plus { color: var(--green); font-weight: 700; }
.tbl .minus { color: var(--red); font-weight: 700; }
.row-off { opacity: .45; }
.tag {
  display: inline-block; font-size: 11px; font-weight: 700; border-radius: 5px; white-space: nowrap;
  padding: 1px 7px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line);
}
.tag-ok { color: var(--green); border-color: rgba(18, 168, 118, .35); background: rgba(18, 168, 118, .07); }
.tag-wait { color: var(--jelly-deep); border-color: rgba(245, 158, 11, .4); background: var(--jelly-soft); }
.tag-no { color: var(--red); border-color: rgba(255, 59, 92, .35); background: #fff0f2; }
.tag-online { background: rgba(18, 168, 118, .08); color: var(--green); border: 1px solid rgba(18, 168, 118, .35); }
.tag-offline { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.search-row { display: flex; gap: 8px; margin-bottom: 16px; max-width: 460px; }
.search-row input { margin-top: 0; }
.search-row .btn { flex: none; white-space: nowrap; }
.inline-form { display: inline-flex; gap: 4px; align-items: center; margin: 0; }
.inline-form select, .inline-form input {
  background: #fff; border: 1px solid var(--line-2); color: var(--text);
  border-radius: 6px; padding: 3px 6px; font-size: 12px; font-family: inherit;
}
.pw-input { width: 90px; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; overflow: visible; max-height: none; }
.tabs a { flex: 0 0 auto; padding: 7px 16px; border-radius: 9px; color: #5b6373; font-weight: 700; font-size: 13px; border: 1px solid var(--line-2); background: #fff; }
.tabs a:hover { text-decoration: none; color: var(--blue); }
.tabs a.on { color: #fff; background: var(--blue); border-color: var(--blue); text-decoration: none; }

/* ---------- 에이전트 ---------- */
.agent-room { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; background: #fff; }
.agent-room-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.agent-room-head input { flex: 1; background: #fff; border: 1px solid var(--line-2); color: var(--text); border-radius: 8px; padding: 8px 10px; font-family: inherit; }
.agent-room textarea { width: 100%; background: #fff; border: 1px solid var(--line-2); color: var(--text); border-radius: 8px; padding: 8px 10px; font-family: inherit; margin-bottom: 8px; }
.edit-details { display: inline-block; position: relative; }
.edit-details summary { list-style: none; cursor: pointer; }
.edit-details summary::-webkit-details-marker { display: none; }
.edit-pop {
  position: absolute; right: 0; top: 110%; z-index: 20; width: 300px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; box-shadow: 0 16px 40px rgba(20, 28, 50, .16);
}

/* ---------- 지갑 ---------- */
.wallet-head { display: flex; justify-content: space-between; align-items: center; }
.wallet-balance { font-size: 34px; font-weight: 800; color: var(--jelly-deep); display: flex; align-items: center; gap: 9px; }

/* ---------- 공지 ---------- */
.notice-head { border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 16px; }
.notice-head h2 { margin: 8px 0 4px; }
.notice-body { min-height: 120px; }

/* ---------- 고객센터 / 1:1 채팅 ---------- */
.svc-panel { display: flex; flex-direction: column; height: 560px; padding: 0; overflow: hidden; }
.svc-hint { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; }
.svc-list { min-height: 200px; display: flex; flex-direction: column; gap: 8px; }
.svc-msg { max-width: 75%; padding: 8px 12px; border-radius: 12px; font-size: 14px; animation: chatin .18s ease-out; overflow-wrap: anywhere; }
.svc-msg.member { align-self: flex-end; background: var(--blue-soft); border: 1px solid rgba(53, 102, 246, .3); }
.svc-msg.admin { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); }
.svc-msg img { max-width: 220px; border-radius: 8px; display: block; }
.svc-msg .c-time { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }
.svc-input-row { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); align-items: center; }
.svc-input-row input[type="text"] {
  flex: 1; background: #fff; border: 1px solid var(--line-2); color: var(--text);
  border-radius: 8px; padding: 8px 12px; font-family: inherit; font-size: 14px;
}
.svc-img-btn { cursor: pointer; font-size: 19px; padding: 4px 6px; }
.svc-file-hint { padding: 4px 14px 10px; font-size: 12px; }
.svc-admin-layout { display: grid; grid-template-columns: 300px 1fr; gap: 18px; }
.svc-threads { max-height: 620px; overflow-y: auto; }
.thread {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 10px; color: var(--text); margin-bottom: 4px;
}
.thread:hover { background: var(--panel-2); text-decoration: none; }
.thread.on { background: var(--blue-soft); border: 1px solid rgba(53, 102, 246, .35); }
.thread-name { font-weight: 700; font-size: 14px; }
.thread-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.cnt {
  background: var(--red); color: #fff; font-size: 11px; font-weight: 800;
  border-radius: 999px; min-width: 19px; text-align: center; padding: 1px 6px;
}
.thread-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.thread-row .thread-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.thread-row .thread-name:hover { text-decoration: none; color: var(--blue); }
.chat-open-btn { white-space: nowrap; }

.svc-layout-1on1 { max-width: 720px; margin: 0 auto; }
.chat-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.svc-wrap { display: grid; grid-template-columns: 280px 1fr; gap: 18px; }
.svc-side { text-align: center; }
.svc-avatar { width: 130px; height: 130px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(53, 102, 246, .35); }
.svc-meta { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.svc-meta b { color: var(--blue); }
@media (max-width: 760px) { .svc-wrap { grid-template-columns: 1fr; } }

/* ---------- 1:1 채팅 이미지/선물 ---------- */
.svc-msg img.dm-img { max-width: 220px; max-height: 280px; border-radius: 10px; display: block; cursor: pointer; }
.dm-img-btn {
  flex: none; width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line-2); background: #fff; color: var(--muted);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.dm-img-btn:hover { color: var(--blue); border-color: rgba(53, 102, 246, .45); }
button.dm-img-btn { background: none; border: none; cursor: pointer; padding: 0; font-size: 20px; }
.dm-gift-bar { border-top: 1px solid var(--line); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.dm-gift-btns { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 4px; }
.dm-gift-custom { display: flex; gap: 8px; align-items: center; }
.dm-gift-custom input {
  flex: 1; background: #fff; border: 1px solid var(--line-2); color: var(--text);
  border-radius: 8px; padding: 7px 10px; font-family: inherit;
}
.svc-msg-gift { background: var(--jelly-soft); border: 1px solid rgba(245, 158, 11, .4); }
.dm-gift { font-weight: 700; color: var(--jelly-deep); }

/* ---------- 마이페이지 ---------- */
.mypage-card { margin-bottom: 14px; }
.mypage-top { display: flex; align-items: center; gap: 14px; }
.mypage-avatar {
  width: 56px; height: 56px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  font-size: 24px; font-weight: 800; color: #fff;
}
.mypage-nick { font-size: 18px; font-weight: 700; }
.mypage-jelly { margin-top: 4px; color: var(--muted); font-size: 14px; }
.mypage-jelly b { color: var(--jelly-deep); }
.mypage-links { display: grid; gap: 10px; margin-top: 14px; }
.mypage-link {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  color: var(--text); text-decoration: none; transition: border-color .15s;
}
.mypage-link:hover { border-color: rgba(53, 102, 246, .5); text-decoration: none; }
.mypage-link .mp-ico { font-size: 22px; width: 30px; text-align: center; flex: none; }
.mypage-link .mp-arrow { margin-left: auto; color: var(--muted); font-size: 20px; }

/* ---------- 관리자 쪽지 팝업 (회원 화면) ---------- */
.notice-pop-mask {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(20, 28, 50, .45); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.notice-pop {
  width: 100%; max-width: 400px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 16px; padding: 22px 20px;
  box-shadow: 0 18px 60px rgba(20, 28, 50, .25);
  animation: chatin .2s ease;
}
.notice-pop-title { font-size: 16px; font-weight: 800; margin-bottom: 12px; }
.notice-pop-body {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; font-size: 14px; line-height: 1.7; white-space: pre-wrap; word-break: break-word;
}
.notice-pop-time { color: var(--muted); font-size: 11px; margin: 8px 2px 14px; }
.msg-history-item {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 8px; font-size: 13px;
}

/* ---------- 푸터 ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 34px 0 44px; color: var(--muted); font-size: 13px; background: #fff; }
.foot-name { font-weight: 800; font-size: 16px; color: var(--text); margin-bottom: 6px; }
.foot-note { color: var(--jelly-deep); opacity: .9; font-size: 12px; }

/* ---------- 모바일 하단 고정 메뉴 ---------- */
.bottom-nav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: #fff; border-top: 1px solid var(--line);
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -2px 12px rgba(20, 28, 50, .06);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; color: var(--muted); text-decoration: none; padding: 4px 0;
}
.bottom-nav a.on { color: var(--blue); }
.bottom-nav .bn-ico { font-size: 20px; line-height: 1; }
@media (max-width: 640px) {
  .bottom-nav { display: grid; }
  body { padding-bottom: 64px; }
  .site-footer { margin-bottom: 8px; }
}

/* ---------- 모바일 접이식 메뉴 ---------- */
.m-menu-btn, .m-menu { display: none; }
@media (max-width: 640px) {
  .gnb { display: none; }
  .topbar-in { gap: 10px; }
  .top-right { margin-left: auto; }
  .brand { font-size: 17px; gap: 6px; }
  .brand-live { display: none; }
  .user-chip:hover .user-menu { display: none; }
  .m-menu-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 8px; flex: none;
    background: #fff; border: 1px solid var(--line-2); color: var(--text);
    font-size: 17px; cursor: pointer; padding: 0;
  }
  .m-menu-btn:active { background: var(--blue-soft); }
  .m-menu {
    display: none; position: absolute; left: 0; right: 0; top: 60px; z-index: 60;
    background: rgba(255, 255, 255, .98); border-bottom: 1px solid var(--line);
    padding: 8px 18px 14px; backdrop-filter: blur(10px);
    box-shadow: 0 12px 30px rgba(20, 28, 50, .1);
  }
  .m-menu.open { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .m-menu a {
    display: flex; align-items: center; gap: 8px;
    background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
    color: var(--text); font-weight: 700; font-size: 14px; padding: 12px 14px;
  }
  .m-menu a:active { background: var(--blue-soft); text-decoration: none; }
  .user-nick { max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
  .pkg-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-mask { padding: 40px 22px; }
  .hero h2 { font-size: 22px; }
}

/* ---------- 반응형 공통 ---------- */
@media (max-width: 1024px) {
  .home-grid { grid-template-columns: 1fr; }
  .live-layout { grid-template-columns: 1fr; }
  .live-side { height: 520px; }
  .svc-admin-layout { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
