/* =========================================================
   데모4 스킨 — 시안 A 홈 (메인시안-6 · 2026-11-14 · design-updates/land-home/a.html)
   - 3007 포트에서만 서버가 api.css 다음에 넣어요. 색은 와썹 그대로(우주 남보라 + 노랑) — 회원 화면 마크업 · hook 은 그대로예요.
   - 홈 맨 위는 서버(render/demo4-home.ts)가 넣는 .d4-home: 큰 슬라이드 → 카드 묶음 → 게임사 로비 띠
   - 이름은 모두 d4- 로 시작 (회원 사이트 css 이름과 안 겹치게) · 움직임은 assets/js/demo4-home.js
   ========================================================= */

/* ---------- 로고 ---------- */
@media (max-width: 1023px) { [data-auth="member"] .hd-logo img { content: url("../img/skin-demo4/emblem.svg"); width: 32px; height: 32px; } }

/* ---------- 홈 ---------- */
.d4-home {
  --d4-s8: #12163a; --d4-s7: #1a1f4d; --d4-line: #2b3270; --d4-line2: #5a66c2;
  --d4-ink: #f3f4ff; --d4-ink2: #a8aedb; --d4-ink3: #8189c4;
  --d4-yellow: #ffcc1a; --d4-violet: #7442e8; --d4-blue: #3a62f5; --d4-blue2: #2a4bd6; --d4-pink: #ff4fa3; --d4-mint: #2fd58a; --d4-coral: #ff5a6e;
  display: flex; flex-direction: column; gap: 14px; color: var(--d4-ink); min-width: 0;
}
.d4-home img { display: block; max-width: 100%; }
.d4-home a { color: inherit; text-decoration: none; }
.d4-home button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }

/* 버튼 */
.d4-btn { display: inline-flex; align-items: center; justify-content: center; height: 38px; padding: 0 18px; border-radius: 999px; font-weight: 800; font-size: 13.5px; white-space: nowrap; }
.d4-btn.is-yel { background: var(--d4-yellow); color: #141033; box-shadow: 0 6px 16px rgba(255, 204, 26, .28); }
.d4-btn.is-line { border: 1px solid var(--d4-line2); }
.d4-btn:hover { filter: brightness(1.08); }

/* 큰 슬라이드 — 전체 폭 · 옆으로 밀림 */
.d4-hero { position: relative; height: 320px; border-radius: 26px; overflow: hidden; border: 1px solid var(--d4-line); box-shadow: 0 18px 40px rgba(3, 5, 20, .5); background: var(--d4-s8); }
.d4-track { display: flex; height: 100%; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.d4-hs { position: relative; flex: 0 0 100%; height: 100%; display: flex; align-items: flex-start; padding: 46px 56px 0; overflow: hidden; }
.d4-bg { position: absolute; inset: 0; }
.d4-txt { position: relative; z-index: 1; max-width: 46%; }
.d4-eyebrow { display: inline-flex; align-items: center; gap: 6px; color: var(--d4-yellow); font-weight: 900; font-size: 13px; letter-spacing: .5px; }
.d4-eyebrow::before { content: ""; width: 18px; height: 2px; background: var(--d4-yellow); }
.d4-h { margin: 10px 0 8px; font-size: 40px; line-height: 1.15; font-weight: 900; letter-spacing: -1.2px; }
.d4-h em { font-style: normal; color: var(--d4-yellow); }
.d4-p { margin: 0 0 20px; color: #d3d8ff; font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.d4-acts { display: flex; gap: 8px; }
.d4-hart { position: absolute; z-index: 0; right: 8%; bottom: 0; height: 100%; width: 48%; display: flex; align-items: flex-end; justify-content: center; gap: 10px; }
.d4-hart img { max-height: 92%; object-fit: contain; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .5)); }
.d4-hart img.d4-tilt { height: 84%; width: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 18px; transform: rotate(var(--r, 0deg)); box-shadow: 0 18px 40px rgba(0, 0, 0, .5); border: 2px solid rgba(255, 255, 255, .15); filter: none; }
/* 관리자 메인 배너 그림 */
.d4-hs.is-pic { padding: 0; }
.d4-pic { display: block; width: 100%; height: 100%; }
.d4-pic picture, .d4-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.d4-ctl { position: absolute; z-index: 3; left: 56px; right: 24px; bottom: 22px; display: flex; align-items: center; gap: 14px; }
.d4-hero.is-pics .d4-ctl { left: 24px; }
.d4-prog { display: flex; gap: 6px; flex: 1; max-width: 360px; }
.d4-prog button { flex: 1; height: 4px; border-radius: 9px; background: rgba(255, 255, 255, .22) !important; overflow: hidden; }
.d4-prog button i { display: block; height: 100%; width: 0; background: var(--d4-yellow); }
.d4-prog button.is-done i { width: 100%; }
.d4-prog button.is-on i { animation: d4fill 5s linear forwards; }
.d4-hero.is-hold .d4-prog button.is-on i { animation-play-state: paused; }
@keyframes d4fill { to { width: 100%; } }
.d4-sp { flex: 1; }
.d4-arrow { width: 40px; height: 40px; border-radius: 12px; background: rgba(10, 13, 38, .55) !important; border: 1px solid rgba(255, 255, 255, .18) !important; display: grid; place-items: center; font-size: 18px; font-weight: 900; }
.d4-arrow:hover { background: var(--d4-yellow) !important; color: #141033 !important; }

/* 카드 묶음 */
.d4-bento { display: grid; grid-template-columns: 2fr 1fr 1fr 1.1fr; grid-template-rows: 210px 210px; gap: 14px; }
.d4-card { position: relative; overflow: hidden; min-width: 0; border-radius: 22px; background: linear-gradient(180deg, var(--d4-s8), #0d1130); border: 1px solid var(--d4-line); padding: 16px 18px; box-shadow: 0 10px 26px rgba(3, 5, 20, .35); }
.d4-card::before { content: ""; position: absolute; left: 18px; right: 18px; top: 0; height: 2px; border-radius: 2px; background: var(--d4-accent, var(--d4-violet)); opacity: .9; }
.d4-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; min-width: 0; }
.d4-badge { width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--d4-badge, linear-gradient(135deg, var(--d4-violet), var(--d4-blue))); }
.d4-badge img { width: 26px; height: 26px; }
/* 사용자 그림 아이콘 (skin-demo4/icon-*.webp) — 칸을 꽉 채운 둥근 그림 */
.d4-badge.is-pic { width: 46px; height: 46px; border-radius: 13px; overflow: hidden; background: #1c1c24; box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 6px 14px rgba(0, 0, 0, .35); }
.d4-badge.is-pic img { width: 100%; height: 100%; object-fit: cover; }
.d4-head h2 { margin: 0; font-size: 17px; font-weight: 900; letter-spacing: -.3px; color: var(--d4-ink); white-space: nowrap; }
.d4-head small { display: block; color: var(--d4-ink3); font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d4-head > div { min-width: 0; }
.d4-more { margin-left: auto; color: var(--d4-yellow) !important; font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.d4-more:hover { text-decoration: underline !important; }
.d4-empty { margin: 8px 0 0; color: var(--d4-ink3); font-size: 13px; }

/* 게임 그림 */
.d4-cv { position: relative; flex: none; display: block; border-radius: 10px; overflow: hidden; background: var(--d4-s7); box-shadow: 0 4px 12px rgba(0, 0, 0, .35); transition: transform .2s, box-shadow .2s; }
.d4-cv:hover { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--d4-yellow), 0 8px 18px rgba(0, 0, 0, .45); }
.d4-cv img { width: 100%; height: 100%; object-fit: cover; }
.d4-cv span { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 4px 5px; font-size: 11px; font-weight: 900; text-align: center; line-height: 1.15; color: #fff; background: linear-gradient(transparent, rgba(5, 7, 24, .9)); text-shadow: 0 1px 3px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d4-art { display: grid; place-items: center; width: 100%; height: 100%; padding: 6px; font-style: normal; font-size: 11px; font-weight: 900; text-align: center; line-height: 1.2; color: #fff; word-break: keep-all; }
.d4-ev { display: grid; place-items: center; width: 100%; }
.d4-ev img { width: 30px; height: auto; object-fit: contain; margin-top: -12px; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .35)); }

.d4-casino { grid-column: 1; grid-row: 1 / 3; --d4-accent: linear-gradient(90deg, var(--d4-pink), var(--d4-violet)); --d4-badge: linear-gradient(135deg, #ff4fa3, #7442e8); }
.d4-cgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.d4-cgrid .d4-cv { aspect-ratio: 3 / 4; }
.d4-foot { display: flex; gap: 8px; margin-top: 12px; }
.d4-foot span { flex: 1; text-align: center; padding: 7px 0; border-radius: 10px; background: rgba(255, 255, 255, .05); color: var(--d4-ink2); font-size: 12px; white-space: nowrap; }
.d4-foot b { color: var(--d4-ink); }
.d4-slot { grid-column: 2 / 4; grid-row: 1; --d4-accent: linear-gradient(90deg, #ff9a1a, var(--d4-pink)); --d4-badge: linear-gradient(135deg, #ffb02e, #ff4f7a); }
.d4-slot .d4-cv { width: 92px; height: 122px; }
.d4-sports { grid-column: 2; grid-row: 2; display: flex; flex-direction: column; --d4-accent: linear-gradient(90deg, var(--d4-mint), #18a8c9); --d4-badge: linear-gradient(135deg, #2fd58a, #127a8c); }
.d4-go { display: grid; gap: 7px; position: relative; z-index: 1; margin-top: auto; }
.d4-go a { display: flex; justify-content: space-between; align-items: center; height: 36px; padding: 0 12px; border-radius: 11px; font-weight: 800; font-size: 12.5px; }
.d4-go a:first-child { background: linear-gradient(180deg, #5577ff, var(--d4-blue2)); }
.d4-go a:last-child { border: 1px solid var(--d4-line2); background: rgba(10, 13, 38, .6); }
.d4-go a:hover { filter: brightness(1.12); }
.d4-event { grid-column: 3; grid-row: 2; --d4-accent: linear-gradient(90deg, var(--d4-yellow), #ff7a1a); --d4-badge: linear-gradient(135deg, #ffcc1a, #ff7a1a); }
.d4-egrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.d4-egrid .d4-cv { height: 62px; }
.d4-egrid .d4-cv span { font-size: 10px; padding: 10px 2px 4px; }
.d4-wins { grid-column: 4; grid-row: 1 / 3; --d4-accent: linear-gradient(90deg, var(--d4-yellow), var(--d4-mint)); --d4-badge: linear-gradient(135deg, #2fd58a, #3a62f5); }
.d4-tick { height: 356px; overflow: hidden; position: relative; }
.d4-ttrack { transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.d4-win { display: flex; align-items: center; gap: 10px; height: 55px; padding: 0 2px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.d4-win img, .d4-win .d4-art { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; flex: none; padding: 0; }
.d4-wt { flex: 1; min-width: 0; }
.d4-wt b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d4-wt small { color: var(--d4-ink3); font-size: 11px; }
.d4-wa { font-weight: 900; color: var(--d4-yellow); font-size: 13.5px; white-space: nowrap; }
.d4-win:hover .d4-wt b { color: var(--d4-yellow); }
.d4-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--d4-coral); margin-right: 6px; vertical-align: 2px; animation: d4pulse 1.8s infinite; }
@keyframes d4pulse { 50% { opacity: .35; } }

/* 흐르는 줄 (끊김 없이 — 그룹을 js 가 한 번 더 붙여요) */
.d4-flow { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent); mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent); }
.d4-ftrack { display: flex; width: max-content; }
.d4-flow.is-run .d4-ftrack { animation: d4flow var(--d4-dur, 40s) linear infinite; }
.d4-flow:hover .d4-ftrack { animation-play-state: paused; }
.d4-group { display: flex; gap: 8px; padding-right: 8px; }
@keyframes d4flow { to { transform: translateX(-50%); } }

/* 게임사 로비 띠 */
.d4-band { display: flex; align-items: center; gap: 18px; padding: 14px 18px; border-radius: 22px; background: linear-gradient(90deg, rgba(58, 98, 245, .18), rgba(116, 66, 232, .12)); border: 1px solid var(--d4-line); }
.d4-band .d4-head { margin: 0; flex: none; width: 190px; --d4-badge: linear-gradient(135deg, #3a62f5, #7442e8); }
.d4-band .d4-flow { flex: 1; min-width: 0; }
.d4-lb { width: 210px; height: 92px; }

@media (max-width: 1100px) {
  .d4-bento { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .d4-casino, .d4-slot, .d4-wins { grid-column: 1 / 3; grid-row: auto; }
  .d4-sports, .d4-event { grid-row: auto; min-height: 210px; }
  .d4-sports { grid-column: 1; }
  .d4-event { grid-column: 2; }
  .d4-tick { height: 220px; }
}
@media (max-width: 767.98px) {
  .d4-home { gap: 12px; }
  .d4-hero { height: 400px; border-radius: 20px; }
  .d4-hs { padding: 26px 22px; }
  .d4-txt { max-width: 100%; }
  .d4-h { font-size: 29px; }
  .d4-p { font-size: 13.5px; margin-bottom: 14px; }
  .d4-hart { width: 100%; right: 0; height: 52%; justify-content: flex-end; padding-right: 6%; }
  .d4-hart img.d4-tilt:first-child { display: none; } /* 좁은 화면은 두 장만 (글 · 버튼과 안 겹치게) */
  .d4-ctl, .d4-hero.is-pics .d4-ctl { left: 22px; right: 16px; bottom: 16px; }
  .d4-arrow { display: none; }
  .d4-bento { gap: 12px; }
  .d4-cgrid { gap: 6px; }
  .d4-egrid { grid-template-columns: repeat(2, 1fr); }
  .d4-band { flex-direction: column; align-items: stretch; gap: 12px; }
  .d4-band .d4-head { width: auto; }
  .d4-lb { width: 170px; height: 76px; }
}
@media (max-width: 420px) {
  .d4-bento { grid-template-columns: 1fr; }
  .d4-casino, .d4-slot, .d4-wins, .d4-sports, .d4-event { grid-column: 1; }
  .d4-egrid { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .d4-flow.is-run .d4-ftrack { animation: none; }
  .d4-track, .d4-ttrack { transition: none; }
  .d4-dot { animation: none; }
}
