/* ============================================================
   DARUMA GAMING base — 토큰(검정·진홍·금) + 공통 컴포넌트
   2026-11-09 MOMO base.css(다크 네이비) → 다루마 컨셉으로 교체.
   · 구조·선택자는 MOMO 와 동일(마크업·JS 그대로). 값만 바뀐다.
   · 이미지: assets/images/daruma/ (로고·캐릭터·사계절 풍경). 계절 이미지는 daruma.js 가 --season-img 로 바꿔 끼운다.
   · @import 는 CSS 규칙상 맨 위.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@100..900&family=Cinzel:wght@700;900&family=Shippori+Mincho+B1:wght@700;800&display=swap');

:root {
  /* ── 바탕 (옻칠 검정: 순검정보다 살짝 붉고 따뜻하게) ── */
  --bg: #08070a;
  --panel: #14101a;        /* 카드·모달·인풋 */
  --panel-2: #1c161f;      /* 한 단 떠 있는 면 */
  --panel-3: #261d27;      /* 호버 */
  --line: #2e2229;
  --bg-rgb: 8, 7, 10;
  --grad-sidebar: linear-gradient(180deg, #0a0a0d 0%, #0d0a0f 55%, #190a0f 100%);
  --text: #f3ebdf;
  --text-muted: #a99e93;
  --text-faint: #6e655d;

  /* ── 진홍 (다루마의 몸 색) ── */
  --crimson: #c4161c;
  --crimson-deep: #7a0c12;
  --crimson-light: #e8333a;
  --crimson-soft: rgba(196, 22, 28, .16);
  --crimson-edge: rgba(232, 51, 58, .48);
  --grad-crimson: linear-gradient(180deg, #e3343b 0%, #b8121a 55%, #8a0b12 100%);
  --grad-crimson-h: linear-gradient(90deg, #7a0c12 0%, #c4161c 50%, #7a0c12 100%);
  --on-crimson: #fff4e0;

  /* ── 금 (MOMO 로고 실측 램프 유지 — 금속 골드의 hue drift 그대로) ── */
  --gold: #c9a961;
  --gold-deep: #96793a;
  --gold-soft: rgba(227, 183, 87, .14);
  --gold-edge: rgba(227, 183, 87, .45);
  --on-gold: #241705;
  --accent: #c9a961;
  --lg-shadow:    #5a3307;
  --lg-deep:      #a86f18;
  --lg-mid-dark:  #cf9a36;
  --lg-mid:       #e3b757;
  --lg-light:     #f3d479;
  --lg-highlight: #f8eab2;
  --lg-cream:     #fdf4dd;
  --grad-gold-metal: linear-gradient(90deg, #c08f26 0%, #d6a94e 24%, #e9c073 50%, #f6d18e 75%, #fddb9c 100%);
  --grad-gold-plate-dark: linear-gradient(135deg, #241a12 0%, #1b130e 45%, #140e0b 100%);
  --gold-line: var(--gold-edge);
  --gold-ink:  var(--lg-light);
  --grad-gold-plate: linear-gradient(135deg,
    var(--lg-highlight) 0%, var(--lg-light) 22%, var(--lg-mid) 50%, var(--lg-mid-dark) 74%, var(--lg-deep) 100%);

  --danger: #e24a43;
  --sidebar-w: 300px;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(0, 0, 0, .5);

  /* ── 다루마 이미지 경로 (daruma.js 가 계절에 따라 --season-img 만 바꾼다) ── */
  --img-logo: url('../images/daruma/daruma-logo.webp');
  --img-logo-wide: url('../images/daruma/daruma-logo-wide.webp');
  --season-img: none;   /* 기본값은 비워 둔다(2026-11-10) — 겨울 파일을 넣어 두면 다른 계절에도 626KB 를 먼저 받는다. daruma.js 가 실행되면서 해당 계절 1장으로 채운다 */
  --font-display: 'Cinzel', 'Cambria', Georgia, serif;
  --font-jp-display: 'Shippori Mincho B1', 'Yu Mincho', 'Hiragino Mincho ProN', serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Noto Sans JP', 'Noto Sans KR', 'Hiragino Kaku Gothic Pro', Meiryo, sans-serif;
  /* 바탕: 옻칠 검정 + 위쪽에서 번지는 진홍 기운 */
  background:
    radial-gradient(1200px 700px at 70% -10%, rgba(196, 22, 28, .18) 0%, rgba(196, 22, 28, 0) 60%),
    linear-gradient(180deg, #0c0a0e 0%, var(--bg) 50%, #050406 100%);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; color: var(--text); color-scheme: dark; }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
ul { list-style: none; }

/* ── 스크롤바: 진홍 손잡이 ── */
html { scrollbar-color: var(--crimson) var(--bg); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--crimson); border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--crimson-light); }

/* ── 버튼 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; font-size: 14px; font-weight: 700;
  padding: 9px 22px; transition: filter .15s, background .15s;
}
.btn-gold { background: var(--grad-gold-metal); color: var(--on-gold); }
.btn-gold:hover { filter: brightness(1.08); }
.btn-outline { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.btn-outline:hover { background: var(--panel-3); border-color: var(--text-muted); }

/* ── 스플래시: 다루마 로고 + 금·진홍 링 2장 역회전 ── */
.page-splash {
  position: fixed; inset: 0; z-index: 9999999;
  display: flex; background: var(--bg);
  transition: opacity .4s ease;
}
.page-splash.fade-out { opacity: 0; pointer-events: none; }
.no-splash .page-splash { display: none; }
.splash-loader { position: relative; margin: auto; width: 340px; height: 340px; }
.splash-loader .loader-ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.splash-loader .ring1 { animation: ring-spin 1.5s linear infinite; }
.splash-loader .ring2 { animation: ring-spin-rev 2.4s linear infinite; }
.splash-loader .ring2 circle { stroke: var(--crimson); }
.page-splash .splash-logo {
  position: absolute; inset: 0; margin: auto;
  width: 200px; height: 200px; object-fit: contain;
  animation: logo-breathe 2s ease-in-out infinite;
}
@keyframes ring-spin     { to { transform: rotate(360deg); } }
@keyframes ring-spin-rev { to { transform: rotate(-360deg); } }
@keyframes logo-breathe {
  0%, 100% { transform: scale(1);    opacity: .92; }
  50%      { transform: scale(1.05); opacity: 1; }
}
@media (max-width: 576px) {
  .splash-loader { width: 230px; height: 230px; }
  .page-splash .splash-logo { width: 140px; height: 140px; }
}
@keyframes pulsate {
  0%   { transform: scale(.8);  opacity: 0; }
  50%  { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(.8);  opacity: 0; }
}

/* ── 게임 카드 + 로딩 연출 ── */
.game-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
@media (max-width: 1500px) { .game-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 1200px) { .game-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .game-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

.game-card { cursor: pointer; min-width: 0; }
.game-card .thumb {
  position: relative; aspect-ratio: 4 / 3;
  border-radius: var(--radius); overflow: hidden;
  background: #0f0b10;
}
.game-card .thumb::before {
  /* 로딩 중 다루마 로고 pulsate */
  content: ''; position: absolute; inset: 0;
  background: var(--img-logo) center / 90px no-repeat;
  opacity: 0; animation: pulsate 2s ease-out infinite;
}
.game-card .thumb img {
  position: relative; z-index: 1;
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .45s ease;
}
.game-card.loaded .thumb::before { animation: none; opacity: 0; }
.game-card.loaded .thumb img { opacity: 1; }
.game-card .thumb .g-hover {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 4, 6, .5);
  opacity: 0; transition: opacity .2s ease;
}
.game-card:hover .thumb .g-hover { opacity: 1; }
.g-play {
  padding: 9px 28px; border-radius: 999px;
  background: var(--grad-gold-metal); color: var(--on-gold);
  font-size: 14px; font-weight: 800; letter-spacing: .08em;
  transform: translateY(8px); transition: transform .2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .45), 0 0 0 2px rgba(122, 12, 18, .6);
}
.game-card:hover .g-play { transform: translateY(0); }
.game-card .thumb .g-badge {
  position: absolute; z-index: 2; top: 8px; left: 8px;
  padding: 3px 9px; border-radius: 4px;
  font-size: 10px; font-weight: 800; letter-spacing: .06em; color: var(--on-crimson);
  background: var(--grad-crimson); box-shadow: 0 0 0 1px rgba(243, 212, 121, .55);
}
.game-card:hover .thumb img { transform: scale(1.04); transition: opacity .45s ease, transform .3s ease; }
.game-card .g-name {
  margin-top: 9px; font-size: 15px; font-weight: 600;
  text-align: center; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.game-card .g-provider {
  margin-top: 2px; font-size: 12px; letter-spacing: .02em;
  color: var(--lg-mid); text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.game-card:hover { position: relative; z-index: 1; }
.game-card:hover .g-name {
  position: relative; left: 50%; transform: translateX(-50%);
  width: max-content; max-width: none;
  overflow: visible; text-overflow: clip;
  text-shadow: 0 0 4px var(--bg), 0 0 8px var(--bg), 0 0 14px var(--bg);
}
@media (max-width: 700px) {
  .game-card .g-name { font-size: 14px; }
  .game-card .g-provider { font-size: 11.5px; }
}

/* ── 로고 교체 깜빡임 방지: daruma.js 가 src 를 바꾸기 전까지 MOMO 로고를 감춘다.
   daruma.js 가 없으면 1.2초 뒤 원래 로고가 나타난다(폴백). ── */
img[src*="momo-logo"] { visibility: hidden; animation: drReveal 0s 1.2s forwards; }
@keyframes drReveal { to { visibility: visible; } }


/* ══════════════════════════════════════════════════════════════
   DARUMA 開眼 스플래시 (2026-11-10)
   MOMO 스플래시(#pageSplash: 로고 호흡 + 링 2장)는 마크업을 두고 안쪽만 숨긴다.
   daruma.js 가 #pageSplash 안에 .dr-kaigan 을 넣고 .is-play 를 붙이면 아래 타임라인이 돈다.
   .dr-kaigan 은 body 끝에 독립 레이어(fixed)로 붙여 MOMO 의 2초 타이머와 무관하게 2.55초에 페이드, 3.1초 제거(daruma.js).
     0.0  먹빛 진홍 기운 + 눈 없는 다루마 페이드인
     0.5  붓이 오른쪽 아래에서 들어와 0.9초에 오른쪽 눈(보는 사람 기준)을 톡
     1.0  눈동자(oneeye 프레임)가 눈 중심에서 먹 번지듯 드러남, 붓 빠짐
     1.1  눈에서 금빛 번쩍 + 금 고리
     1.2  「開運」  1.55 「願いをかけた。あとは勝つだけだ。」
   ══════════════════════════════════════════════════════════════ */
.page-splash .splash-loader { display: none; }
.page-splash.dr-splash { background: var(--bg); }
.dr-kaigan {
  position: fixed; inset: 0; z-index: 9999999; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden;
  transition: opacity .55s ease;
}
.dr-kaigan.is-out { opacity: 0; pointer-events: none; }
.dr-kaigan__glow {
  position: absolute; left: 50%; top: 50%; width: 90vmin; height: 90vmin; margin: -45vmin 0 0 -45vmin; border-radius: 50%;
  background: radial-gradient(circle, rgba(196,22,28,.46) 0%, rgba(122,12,18,.22) 38%, rgba(8,7,10,0) 70%);
  opacity: 0; transform: scale(.5);
}
.dr-kaigan__char { position: relative; width: 240px; height: 276px; opacity: 0; transform: translateY(16px) scale(.9); }
.dr-kaigan__blank, .dr-kaigan__one { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 18px 28px rgba(0,0,0,.7)); }
.dr-kaigan__one { clip-path: circle(0% at 64.4% 31.9%); }
/* 눈 중심 기준 소품들 (64.4% / 31.9% = 그려진 눈동자 위치) */
.dr-kaigan__flash, .dr-kaigan__ring { position: absolute; left: 64.4%; top: 31.9%; border-radius: 50%; opacity: 0; pointer-events: none; }
.dr-kaigan__flash {
  width: 150px; height: 150px; margin: -75px 0 0 -75px; transform: scale(.2);
  background: radial-gradient(circle, #fff8dc 0%, rgba(243,217,139,.95) 18%, rgba(240,205,110,.5) 40%, rgba(240,205,110,0) 70%);
  mix-blend-mode: screen;
}
.dr-kaigan__ring { width: 44px; height: 44px; margin: -22px 0 0 -22px; border: 3px solid #f0cd6e; box-shadow: 0 0 14px rgba(240,205,110,.8); }
.dr-kaigan__brush {
  position: absolute; left: 64.4%; top: 31.9%; width: 240px; height: auto; margin: -9px 0 0 -5px;   /* 붓끝(이미지 좌상단 2%/4%)이 눈 위에 오게 */
  transform-origin: 2% 4%; transform: translate(70vw, 60vh) rotate(10deg); opacity: 0;
  filter: drop-shadow(-6px 10px 14px rgba(0,0,0,.65));
}
.dr-kaigan__kanji {
  position: relative; margin-top: 26px; font-family: 'Shippori Mincho B1', 'Yu Mincho', 'Hiragino Mincho ProN', serif; font-weight: 800;
  font-size: clamp(56px, 9vmin, 92px); line-height: 1; letter-spacing: .2em; padding-left: .2em;
  background: linear-gradient(180deg, #fdf4ce 0%, #f0cd6e 30%, #b0781e 48%, #fce8a0 53%, #e2ac3c 78%, #8c5a14 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 rgba(60,30,5,.9)) drop-shadow(0 10px 22px rgba(0,0,0,.8));
  opacity: 0; transform: scale(1.6);
}
.dr-kaigan__line { margin-top: 16px; color: #f3e7c9; font-size: 15px; letter-spacing: .12em; text-shadow: 0 2px 8px rgba(0,0,0,.8); opacity: 0; transform: translateY(8px); }

.dr-kaigan.is-play .dr-kaigan__glow  { animation: drKgGlow .9s ease-out forwards; }
.dr-kaigan.is-play .dr-kaigan__char  { animation: drKgIn .55s cubic-bezier(.2,.8,.2,1) forwards; }
.dr-kaigan.is-play .dr-kaigan__brush { animation: drKgBrush 1.4s linear .5s forwards; }
.dr-kaigan.is-play .dr-kaigan__one   { animation: drKgInk .5s cubic-bezier(.3,.6,.2,1) .95s forwards; }
.dr-kaigan.is-play .dr-kaigan__flash { animation: drKgFlash .75s ease-out 1.08s forwards; }
.dr-kaigan.is-play .dr-kaigan__ring  { animation: drKgRing .8s ease-out 1.08s forwards; }
.dr-kaigan.is-play .dr-kaigan__kanji { animation: drKgKanji .55s cubic-bezier(.2,.9,.3,1.25) 1.2s forwards; }
.dr-kaigan.is-play .dr-kaigan__line  { animation: drKgLine .45s ease-out 1.6s forwards; }

@keyframes drKgGlow  { to { opacity: 1; transform: scale(1); } }
@keyframes drKgIn    { to { opacity: 1; transform: none; } }
@keyframes drKgBrush {
  0%   { opacity: 0; transform: translate(70vw, 60vh) rotate(10deg); }
  6%   { opacity: 1; }
  28%  { transform: translate(0, 0) rotate(0deg); }           /* 0.89초 도착 */
  33%  { transform: translate(-3px, -3px) rotate(-2deg) scale(.98); }   /* 톡 */
  38%  { transform: translate(0, 0) rotate(0deg); }
  42%  { opacity: 1; }
  75%  { opacity: 0; transform: translate(50vw, -70vh) rotate(-14deg); }
  100% { opacity: 0; transform: translate(50vw, -70vh) rotate(-14deg); }
}
@keyframes drKgInk   { 0% { clip-path: circle(0% at 64.4% 31.9%); } 35% { clip-path: circle(6% at 64.4% 31.9%); } 100% { clip-path: circle(150% at 64.4% 31.9%); } }
@keyframes drKgFlash { 0% { opacity: 0; transform: scale(.2); } 35% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.7); } }
@keyframes drKgRing  { 0% { opacity: .95; transform: scale(1); } 100% { opacity: 0; transform: scale(7); } }
@keyframes drKgKanji { to { opacity: 1; transform: scale(1); } }
@keyframes drKgLine  { to { opacity: 1; transform: none; } }

@media (max-width: 576px) {
  .dr-kaigan__char { width: 180px; height: 207px; }
  .dr-kaigan__brush { width: 180px; margin: -7px 0 0 -4px; }
  .dr-kaigan__flash { width: 110px; height: 110px; margin: -55px 0 0 -55px; }
  .dr-kaigan__kanji { font-size: 56px; margin-top: 20px; }
  .dr-kaigan__line { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) and (min-width: 99999px) {
  .dr-kaigan.is-play * { animation-duration: 0s !important; animation-delay: 0s !important; }
  .dr-kaigan.is-play .dr-kaigan__brush, .dr-kaigan.is-play .dr-kaigan__flash, .dr-kaigan.is-play .dr-kaigan__ring { animation: none; opacity: 0; }
}

/* ══════════════════════════════════════════════════════════════
   DARUMA 引幕 페이지 전환막 (2026-11-10)
   가부키 引幕처럼 진홍·검정·금 세로줄 막이 좌우에서 닫히고(페이지를 떠날 때) 열린다(다음 페이지가 준비되면).
   daruma.js 가 body 끝에 .dr-curtain 을 넣는다. 닫힌 동안 가운데에 오뚝이(pop-idle.webp, CSS 흔들림) + 한마디 + 금선.
   ══════════════════════════════════════════════════════════════ */
.dr-curtain { position: fixed; inset: 0; z-index: 9999998; pointer-events: none; }
.dr-curtain.is-closed { pointer-events: auto; }
.dr-curtain__half {
  position: absolute; top: 0; bottom: 0; width: 50.6%;
  background:
    linear-gradient(180deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,0) 14%, rgba(0,0,0,0) 82%, rgba(0,0,0,.55) 100%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.07) 0 5px, rgba(255,255,255,0) 5px 34px, rgba(0,0,0,.22) 34px 38px, rgba(0,0,0,0) 38px 72px),
    repeating-linear-gradient(90deg, #9f1017 0 76px, #0b0609 76px 150px, #c9a961 150px 160px, #0b0609 160px 172px);
  transition: transform .62s cubic-bezier(.75,0,.25,1);
  will-change: transform;
}
.dr-curtain__half--l { left: 0;  transform: translateX(-102%); box-shadow: 10px 0 30px rgba(0,0,0,.6); }
.dr-curtain__half--r { right: 0; transform: translateX(102%);  box-shadow: -10px 0 30px rgba(0,0,0,.6); }
.dr-curtain__half--l::after, .dr-curtain__half--r::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, #f3d98b, #b98a2f 50%, #f3d98b);
}
.dr-curtain__half--l::after { right: 0; } .dr-curtain__half--r::after { left: 0; }
.dr-curtain.is-closed .dr-curtain__half { transform: none; transition-duration: .45s; }
.dr-curtain.no-anim .dr-curtain__half, .dr-curtain.no-anim .dr-curtain__stage { transition: none !important; }

.dr-curtain__stage {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  opacity: 0; transition: opacity .25s ease;
}
.dr-curtain.is-closed .dr-curtain__stage { opacity: 1; transition: opacity .3s ease .25s; }
.dr-curtain__anim { width: 210px; height: auto; filter: drop-shadow(0 16px 26px rgba(0,0,0,.75)); transform-origin: 50% 94%; }
/* 오뚝이 흔들림 — 정지 이미지(pop-idle.webp)를 바닥 중앙 축으로 기울인다. 막이 닫힌 동안만 재생 */
.dr-curtain.is-closed .dr-curtain__anim { animation: drWobble .85s ease-in-out infinite alternate; }
@keyframes drWobble { from { transform: translateX(-7px) rotate(-10deg); } to { transform: translateX(7px) rotate(10deg); } }
.dr-curtain__line { font-family: 'Shippori Mincho B1', 'Yu Mincho', serif; font-weight: 800; font-size: 22px; letter-spacing: .14em; color: #f3d98b; text-shadow: 0 2px 10px rgba(0,0,0,.9); }
.dr-curtain__bar { width: 170px; height: 2px; background: rgba(201,169,97,.25); overflow: hidden; border-radius: 2px; }
.dr-curtain__bar i { display: block; height: 100%; width: 38%; background: linear-gradient(90deg, rgba(240,205,110,0), #f0cd6e, rgba(240,205,110,0)); animation: drBar 1.1s ease-in-out infinite; }
@keyframes drBar { from { transform: translateX(-110%); } to { transform: translateX(380%); } }
@media (max-width: 576px) {
  .dr-curtain__anim { width: 160px; }
  .dr-curtain__line { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) and (min-width: 99999px) {
  .dr-curtain__half, .dr-curtain__stage { transition-duration: 0s !important; }
  .dr-curtain__bar i { animation: none; width: 100%; }
  .dr-curtain.is-closed .dr-curtain__anim { animation: none; }
}

/* [2026-11-11 사용자 결정] 캐릭터·모션은 PC 의 「애니메이션 효과 끄기(prefers-reduced-motion)」 설정과 상관없이 항상 재생한다(FlashWin 과 같은 방침).
   이유: 업체·사용자 PC 중에 그 설정이 꺼진 곳이 있어 다루마 뒤뚱거림·막·눈 그리기 연출이 PC 마다 다르게 보임.
   방법: 이 파일의 reduced-motion 미디어 블록에 절대 맞지 않는 조건(min-width: 99999px)을 붙여 꺼 둠. 코드는 남겨 두었으니 되돌리려면 그 조건만 지우면 된다. */
