/* 퍼즐걸스 — 게임별 레이아웃 (theme.css 위에 얹히는 전용 스타일) */

/* ---------- 공통 ---------- */
.pg-main { max-width: 1100px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 18px; }
.pg-muted { color: #9aa5b1; font-size: 0.85rem; }
.pg-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.pg-table th, .pg-table td { border: 1px solid rgba(212,175,55,.25); padding: 6px 8px; text-align: left; }
.pg-msg { min-height: 1.2em; color: #ffb4b4; font-size: .9rem; margin: 8px 0; }

.result-banner {
  text-align: center; padding: 12px; border-radius: 10px;
  background: rgba(13,17,23,.8); border: 1px solid rgba(212,175,55,.35);
  font-size: 1.05rem; min-height: 1.4em;
}
.result-banner.win  { border-color: #2ecc71; color: #7dffb0; }
.result-banner.lose { border-color: #c0392b; color: #ff9a9a; }

.chip-tray { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip-label { color: #d4af37; font-weight: 700; }
.chip {
  width: 56px; height: 56px; border-radius: 50%; border: none;
  font-weight: 800; color: #fff; cursor: pointer; font-size: .85rem;
  text-shadow: 0 1px 3px rgba(0,0,0,.85);
  background-size: 132%; background-position: center; background-repeat: no-repeat;
}
.chip-1   { background-color: #1b3a7a; background-image: url("../assets/img/chip-100.png"); }
.chip-5   { background-color: #145a32; background-image: url("../assets/img/chip-500.png"); }
.chip-25  { background-color: #4a235a; background-image: url("../assets/img/chip-1k.png"); }
.chip-100 { background-color: #7e3300; background-image: url("../assets/img/chip-5k.png"); }
.chip.selected { outline: 3px solid #ffd700; outline-offset: 2px; transform: scale(1.08); }

.bet-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bet-total { margin-right: auto; }

/* ---------- 룰렛 ---------- */
.wheel-wrap { position: relative; width: min(340px, 80vw); margin: 0 auto; }
.wheel {
  width: 100%; aspect-ratio: 1; border-radius: 50%;
  border: 10px solid #3b2a12; box-shadow: 0 0 40px rgba(0,0,0,.6), inset 0 0 30px rgba(0,0,0,.8);
}
.wheel-pointer { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: 1.6rem; color: #ffd700; z-index: 2; }
.wheel-hub {
  position: absolute; inset: 30%; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f7e7b0, #b8860b 70%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 18px rgba(0,0,0,.5);
}
.wheel-hub span { font-size: 2rem; font-weight: 900; color: #111; }
.wheel-hub .num-red { color: #fff; text-shadow: 0 0 4px #c0392b; }
.wheel-hub .num-black { color: #fff; text-shadow: 0 0 4px #000; }
.wheel-hub .num-green { color: #eaffe9; text-shadow: 0 0 4px #1e8449; }

.roulette-board { display: grid; grid-template-columns: 44px repeat(12, 1fr); gap: 4px; }
.rb-zero {
  grid-column: 1; grid-row: 1 / 4; display: flex; align-items: center; justify-content: center;
  background: #1e8449; border-radius: 8px; font-weight: 800; cursor: pointer; position: relative;
}
.rb-numbers {
  grid-column: 2 / -1; grid-row: 1 / 4;
  display: grid; grid-template-columns: repeat(12, 1fr); grid-template-rows: repeat(3, 1fr); gap: 3px;
}
.rb-n { display: flex; align-items: center; justify-content: center; height: 44px; border-radius: 6px; font-weight: 700; cursor: pointer; position: relative; color: #fff; }
.c-red { background: #c0392b; } .c-black { background: #1a1a1a; }
.rb-dozen { text-align: center; padding: 8px 0; background: #0b3d2e; border: 1px solid #d4af37; border-radius: 6px; cursor: pointer; position: relative; grid-row: 4; }
#roulette-board [data-bet="dozen"][data-value="1"] { grid-column: 2 / 6; }
#roulette-board [data-bet="dozen"][data-value="2"] { grid-column: 6 / 10; }
#roulette-board [data-bet="dozen"][data-value="3"] { grid-column: 10 / 14; }
.rb-out { display: flex; align-items: center; justify-content: center; padding: 8px 0; border-radius: 6px; cursor: pointer; font-weight: 700; position: relative; }
#roulette-board .rb-red   { grid-area: 5 / 2 / 7 / 4; }
#roulette-board .rb-even  { grid-area: 5 / 4 / 7 / 6; }
#roulette-board .rb-low   { grid-area: 5 / 6 / 7 / 8; }
#roulette-board .rb-high  { grid-area: 5 / 8 / 7 / 10; }
#roulette-board .rb-odd   { grid-area: 5 / 10 / 7 / 12; }
#roulette-board .rb-black { grid-area: 5 / 12 / 7 / 14; }
.rb-red { background: #c0392b; } .rb-black { background: #1a1a1a; }
.rb-even, .rb-odd { background: #0b3d2e; border: 1px solid #d4af37; }
.rb-low, .rb-high { background: #14532d; border: 1px solid #d4af37; }

.bet-mark {
  position: absolute; right: 2px; bottom: 2px;
  background: #ffd700; color: #111; border-radius: 8px;
  font-size: .65rem; font-weight: 800; padding: 1px 5px;
}

/* ---------- 바카라 ---------- */
.table-felt {
  background: radial-gradient(ellipse at center, #14532d 0%, #0b3d2e 70%);
  border: 2px solid #d4af37; border-radius: 24px;
  padding: 24px; display: flex; align-items: center; justify-content: space-around; gap: 12px;
  min-height: 260px;
}
.hand-title { text-align: center; margin-bottom: 10px; }
.player-title { color: #7ec8ff; } .banker-title { color: #ffb3b3; }
.hand-total { background: rgba(0,0,0,.45); border-radius: 8px; padding: 2px 10px; font-size: 1rem; }
.cards { display: flex; gap: 6px; min-height: 110px; }
.pcard {
  width: 76px; height: 108px; border-radius: 8px; background: #fff; color: #111;
  display: flex; flex-direction: column; justify-content: space-between; padding: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,.5); position: relative;
  animation: cardIn .3s ease-out;
}
.pcard.red { color: #c0392b; }
.pcard.back { background: url("../assets/img/card-back.jpg") center/cover; border: 3px solid #fff; }
.pc-suit-img {
  position: absolute; left: 50%; top: 54%; transform: translate(-50%, -50%);
  width: 46px; height: 46px; object-fit: contain; pointer-events: none;
  mix-blend-mode: multiply;
}
.pc-rank { font-size: 1.1rem; font-weight: 800; }
.pc-suit { font-size: 1.6rem; align-self: flex-end; }
@keyframes cardIn { from { transform: translateY(-30px) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }
.vs-badge { font-weight: 900; color: #d4af37; font-size: 1.3rem; }

.bacc-bets { display: flex; gap: 12px; justify-content: center; }
.bb {
  flex: 1; max-width: 220px; padding: 16px; border-radius: 12px; border: 2px solid transparent;
  font-size: 1.05rem; font-weight: 800; color: #fff; cursor: pointer; background: #0b3d2e;
}
.bb small { display: block; font-weight: 400; font-size: .75rem; color: #cbd5e0; }
.bb.bet-player { border-color: #7ec8ff; } .bb.bet-banker { border-color: #ffb3b3; } .bb.bet-tie { border-color: #d4af37; }
.bb.staked { outline: 3px solid #ffd700; outline-offset: 2px; }

/* ---------- 슬롯 ---------- */
.slot-machine {
  background: linear-gradient(180deg, #1a1035, #0d1117);
  border: 3px solid #d4af37; border-radius: 20px; padding: 18px;
}
.slot-marquee { text-align: center; color: #ffd700; font-weight: 900; letter-spacing: 2px; margin-bottom: 14px; text-shadow: 0 0 12px rgba(255,215,0,.6); }
.reels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.reel { background: #000; border-radius: 12px; overflow: hidden; border: 2px solid #333; }
.reel.spinning .reel-strip { filter: blur(1.5px); }
.reel-strip { display: flex; flex-direction: column; }
.cell {
  aspect-ratio: 1.15; display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; border-bottom: 1px solid #222; background: #111;
}
.cell:last-child { border-bottom: none; }
.cell img { width: 100%; height: 100%; object-fit: cover; }
.cell.win-cell { background: rgba(212,175,55,.25); box-shadow: inset 0 0 0 3px #ffd700; }
.paytable { background: rgba(13,17,23,.7); border-radius: 12px; padding: 12px 16px; }
.paytable img { width: 30px; height: 30px; object-fit: cover; border-radius: 6px; vertical-align: middle; background: #000; }
.paytable summary { cursor: pointer; color: #d4af37; font-weight: 700; }

/* ---------- 모달 ---------- */
.pg-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.pg-modal-overlay[hidden] { display: none; }
.pg-modal {
  position: relative; background: #141a24; border: 1px solid #d4af37; border-radius: 16px;
  width: min(440px, 92vw); max-height: 86vh; overflow-y: auto; padding: 24px;
}
.pg-modal h3 { color: #ffd700; margin: 0 0 8px; }
.pg-modal-close { position: absolute; top: 10px; right: 12px; background: none; border: none; color: #9aa5b1; font-size: 1.1rem; cursor: pointer; }
.pg-modal label { display: block; margin: 10px 0 4px; color: #cbd5e0; font-size: .9rem; }
.pg-modal input {
  width: 100%; padding: 10px; border-radius: 8px; border: 1px solid #3a4656;
  background: #0d1117; color: #e6edf3; box-sizing: border-box;
}
.dep-addr {
  display: flex; gap: 8px; align-items: center; background: #0d1117; border: 1px dashed #d4af37;
  border-radius: 10px; padding: 10px; margin: 10px 0;
}
.dep-addr code { flex: 1; word-break: break-all; font-size: .8rem; color: #7dffb0; }

/* ---------- 헤더 사용자 영역 ---------- */
.pg-user { display: flex; align-items: center; gap: 10px; }
.pg-coins b { color: #ffd700; }
.pg-username { color: #cbd5e0; font-size: .9rem; }
.pg-sm { padding: 6px 12px !important; font-size: .85rem !important; }

/* ---------- 게임 페이지 셸 (theme.css 토큰 사용) ---------- */
.pg-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 10px clamp(12px, 4vw, 32px);
  background: var(--color-surface-raised, #1b2531);
  border-bottom: 1px solid var(--color-line, #2a3542);
  box-shadow: 0 2px 12px rgba(0,0,0,.45);
}
.pg-logo { font-weight: 900; font-size: 1.15rem; color: #ffd700; text-decoration: none; letter-spacing: -.02em; }
.pg-nav { display: flex; gap: 14px; }
.pg-nav a { color: #cbd5e0; text-decoration: none; font-weight: 600; padding: 6px 4px; border-bottom: 2px solid transparent; }
.pg-nav a:hover { color: #ffd700; border-bottom-color: #ffd700; }
.pg-user { margin-left: auto; }
.pg-footer {
  margin-top: 32px; padding: 20px clamp(12px, 4vw, 32px);
  border-top: 1px solid var(--color-line, #2a3542);
  color: #9aa7b4; font-size: .82rem; text-align: center;
}
.pg-footer a { color: #d4af37; }
.dep-qr { display: flex; justify-content: center; margin: 10px 0 4px; }
.dep-qr img, .dep-qr canvas { background: #fff; padding: 8px; border-radius: 10px; }

.pg-btn {
  padding: 10px 20px; border-radius: 10px; border: 1px solid #3a4656;
  background: #1b2531; color: #e8edf2; font-weight: 700; cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}
.pg-btn:hover { filter: brightness(1.15); }
.pg-btn:active { transform: scale(.97); }
.pg-btn-gold { background: linear-gradient(180deg, #e8c96a, #b8860b); color: #1a1405; border: none; }
.pg-btn-ghost { background: transparent; }

@media (max-width: 640px) {
  .table-felt { flex-direction: column; }
  .rb-n { height: 34px; font-size: .8rem; }
  .cell { font-size: 1.5rem; }
  .pg-nav { gap: 10px; font-size: .9rem; }
}

/* ---------- 리스타일: 게임별 시네마틱 배너 (ChatGPT 생성 이미지) ---------- */
.pg-main::before {
  content: ""; display: block; height: clamp(140px, 22vw, 220px);
  border-radius: 14px; margin-bottom: 6px;
  background: center 30%/cover no-repeat;
  border: 1px solid rgba(212,175,55,.35);
  box-shadow: 0 8px 30px rgba(0,0,0,.5), inset 0 0 60px rgba(0,0,0,.35);
}
.game-roulette::before { background-image: linear-gradient(180deg, rgba(8,10,14,.25) 30%, rgba(8,10,14,.85)), url("../assets/img/bg-roulette.jpg"); }
.game-baccarat::before  { background-image: linear-gradient(180deg, rgba(8,10,14,.25) 30%, rgba(8,10,14,.85)), url("../assets/img/bg-baccarat.jpg"); }
.game-slot::before      { background-image: linear-gradient(180deg, rgba(8,10,14,.25) 30%, rgba(8,10,14,.85)), url("../assets/img/bg-slot.jpg"); }
.game-blackjack::before { background-image: linear-gradient(180deg, rgba(8,10,14,.25) 30%, rgba(8,10,14,.85)), url("../assets/img/card-blackjack.jpg"); }
.game-dice::before      { background-image: linear-gradient(180deg, rgba(8,10,14,.25) 30%, rgba(8,10,14,.85)), url("../assets/img/card-dice.jpg"); }
.game-crash::before     { background-image: linear-gradient(180deg, rgba(8,10,14,.25) 30%, rgba(8,10,14,.85)), url("../assets/img/card-crash.jpg"); }
