/* ============================================================
 * 공용 스타일 — 라스베가스 밤하늘, 로비, 네온, 모달, 연출
 * ============================================================ */
:root {
  --pink: #ff2d95;
  --gold: #ffd166;
  --gold2: #d4af37;
  --cyan: #4cc9f0;
  --green: #06d6a0;
  --night: #0b0420;
  --panel: rgba(18, 8, 40, 0.78);
  --felt: #0f6b3a;
  --accent: #ffd166;
  --s: 1;
  --font-ko: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: var(--night);
  color: #f5f0ff;
  font-family: var(--font-ko);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

/* ---------------- 밤하늘 & 스카이라인 ---------------- */
#sky {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(255, 45, 149, 0.45), transparent 60%),
    radial-gradient(ellipse at 15% 100%, rgba(76, 201, 240, 0.25), transparent 50%),
    linear-gradient(180deg, #05010f 0%, #1a0838 55%, #3a0c4f 100%);
}
#sky .stars { position: absolute; inset: 0; background-image:
  radial-gradient(1px 1px at 10% 20%, #fff, transparent), radial-gradient(1px 1px at 30% 10%, #fff, transparent),
  radial-gradient(1.5px 1.5px at 55% 25%, #fff, transparent), radial-gradient(1px 1px at 70% 8%, #fff, transparent),
  radial-gradient(1px 1px at 85% 30%, #fff, transparent), radial-gradient(1px 1px at 92% 12%, #fff, transparent),
  radial-gradient(1px 1px at 22% 35%, #fff, transparent), radial-gradient(1.5px 1.5px at 44% 5%, #fff, transparent);
  animation: twinkle 4s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: 0.5; } to { opacity: 1; } }
#sky svg { position: absolute; bottom: 0; left: 0; width: 100%; height: 42vh; }
#sky .win { animation: winblink 3s steps(2) infinite; }
@keyframes winblink { 50% { opacity: 0.25; } }
#sky .searchlight { position: absolute; bottom: 0; width: 6vw; height: 120vh; transform-origin: bottom center;
  background: linear-gradient(0deg, rgba(255,255,255,0.18), transparent 80%); filter: blur(6px); animation: sweep 9s ease-in-out infinite alternate; }
#sky .searchlight.l { left: 22%; }
#sky .searchlight.r { right: 18%; animation-delay: -4s; }
@keyframes sweep { from { transform: rotate(-28deg); } to { transform: rotate(28deg); } }

/* ---------------- 화면 전환 ---------------- */
.screen { position: fixed; inset: 0; z-index: 1; display: none; }
.screen.active { display: flex; }

/* ---------------- 로비 ---------------- */
#lobby { flex-direction: column; align-items: center; overflow-y: auto; padding: 18px 16px 30px; gap: 14px; }
.vegas-sign {
  position: relative; margin-top: 6px; padding: 16px 46px 18px; text-align: center;
  background: radial-gradient(ellipse, #fffaf0 0%, #f4ecd8 100%);
  clip-path: polygon(6% 0, 94% 0, 100% 50%, 94% 100%, 6% 100%, 0 50%);
  box-shadow: 0 0 40px rgba(255, 209, 102, 0.5);
}
.vegas-sign .welcome { font-family: 'Playfair Display', serif; font-weight: 900; color: #c1121f; letter-spacing: 3px; font-size: clamp(12px, 2vw, 18px); }
.vegas-sign .fab { font-family: 'Pacifico', cursive; color: #1d3557; font-size: clamp(14px, 2.4vw, 22px); line-height: 1; }
.vegas-sign .lv { font-family: 'Playfair Display', serif; font-weight: 900; color: #c1121f; font-size: clamp(28px, 6vw, 58px); line-height: 1; letter-spacing: 2px; }
.vegas-sign .lv span { display: inline-block; width: 1.1em; height: 1.1em; line-height: 1.1em; margin: 0 2px; border-radius: 50%; background: #c1121f; color: #fff; font-size: 0.58em; vertical-align: 0.2em; text-align: center; }
.vegas-sign .nev { font-family: 'Playfair Display', serif; font-weight: 700; color: #1d3557; letter-spacing: 6px; font-size: clamp(10px, 1.6vw, 14px); }
.bulbs { position: absolute; inset: 4px; pointer-events: none; }

.neon-title { margin: 6px 0 0; text-align: center; line-height: 1.05; }
.neon-title .t1 { display: block; font-family: 'Monoton', cursive; font-weight: 400; font-size: clamp(30px, 7vw, 76px); color: #fff;
  text-shadow: 0 0 5px #fff, 0 0 12px var(--pink), 0 0 24px var(--pink), 0 0 48px var(--pink); animation: flicker 6s infinite; }
.neon-title .t2 { display: block; font-family: 'Monoton', cursive; font-weight: 400; font-size: clamp(18px, 4vw, 42px); color: #fff8e1; margin-top: 4px;
  text-shadow: 0 0 5px #fff, 0 0 12px var(--gold), 0 0 26px var(--gold), 0 0 44px #ff9f1c; }
.neon-title .t3 { display: block; font-family: 'Black Han Sans', sans-serif; font-size: clamp(14px, 2.4vw, 22px); color: var(--cyan); letter-spacing: 6px; margin-top: 6px;
  text-shadow: 0 0 8px var(--cyan); }
@keyframes flicker { 0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 1; } 20%, 24%, 55% { opacity: 0.45; } }

.lobby-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr) 260px; gap: 16px; width: min(1220px, 100%); }
@media (max-width: 1000px) { .lobby-grid { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 1px solid rgba(255, 209, 102, 0.35); border-radius: 16px; padding: 16px;
  box-shadow: 0 0 22px rgba(255, 45, 149, 0.15), inset 0 0 30px rgba(0, 0, 0, 0.4); backdrop-filter: blur(4px); }
.panel h3 { margin: 0 0 12px; font-family: 'Black Han Sans', sans-serif; font-weight: 400; color: var(--gold); letter-spacing: 1px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: #c9b8e8; margin-bottom: 5px; }
.field input[type=text], .field select { width: 100%; padding: 9px 10px; border-radius: 10px; border: 1px solid #5b3f8c; background: #140a2c; color: #fff; font-size: 14px; }
.av-pick { display: flex; gap: 10px; }
.av-pick button { flex: 1; background: #140a2c; border: 2px solid #3a2766; border-radius: 12px; padding: 6px; color: #ddd; font-size: 12px; }
.av-pick button img { width: 64px; height: 64px; display: block; margin: 0 auto 4px; }
.av-pick button.sel { border-color: var(--gold); box-shadow: 0 0 12px rgba(255, 209, 102, 0.6); color: var(--gold); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.switch { position: relative; width: 44px; height: 24px; flex: none; }
.switch input { display: none; }
.switch span { position: absolute; inset: 0; background: #3a2766; border-radius: 24px; transition: 0.2s; }
.switch span::after { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: 0.2s; }
.switch input:checked + span { background: var(--pink); box-shadow: 0 0 10px var(--pink); }
.switch input:checked + span::after { transform: translateX(20px); }
.vip { margin-top: 14px; padding: 12px; border-radius: 12px; background: linear-gradient(135deg, #3d2a00, #1a1200); border: 1px solid var(--gold2); text-align: center; }
.vip small { color: #e9d8a6; display: block; font-size: 11px; letter-spacing: 2px; }
.vip b { font-family: 'Orbitron', sans-serif; font-size: 26px; color: var(--gold); text-shadow: 0 0 10px rgba(255, 209, 102, 0.7); }
.btn-small { width: 100%; margin-top: 8px; padding: 9px; border-radius: 10px; border: 1px solid #5b3f8c; background: #1d1040; color: #e6dcff; font-size: 13px; }
.btn-small:hover { border-color: var(--gold); color: var(--gold); }

.stages { display: flex; flex-direction: column; gap: 12px; }
.stage-card { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 16px 18px; border-radius: 16px; overflow: hidden;
  border: 2px solid var(--sc, var(--gold)); background: linear-gradient(120deg, rgba(0,0,0,0.65), rgba(0,0,0,0.35)), var(--sbg, #0f6b3a);
  box-shadow: 0 0 18px color-mix(in srgb, var(--sc, #ffd166) 45%, transparent); }
.stage-card .grade { display: inline-block; padding: 3px 10px; border-radius: 999px; font-family: 'Black Han Sans', sans-serif; font-size: 14px; background: var(--sc); color: #111; margin-right: 8px; }
.stage-card .stage-no { font-family: 'Orbitron', sans-serif; font-size: 12px; color: #ddd; letter-spacing: 2px; }
.stage-card h4 { margin: 8px 0 4px; font-family: 'Monoton', cursive; font-weight: 400; font-size: clamp(18px, 2.6vw, 28px); color: #fff; text-shadow: 0 0 10px var(--sc); }
.stage-card p { margin: 0 0 10px; font-size: 13px; color: #ddd; line-height: 1.5; }
.stage-card .faces { display: flex; }
.stage-card .faces img { width: 38px; height: 38px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.7); margin-right: -8px; background: #222; }
.stage-card .play { align-self: center; padding: 14px 22px; border-radius: 14px; border: none; font-family: 'Black Han Sans', sans-serif; font-size: 18px; letter-spacing: 1px;
  background: linear-gradient(180deg, #fff3b0, var(--gold) 40%, #c98b00); color: #2b1600; box-shadow: 0 4px 0 #7a5200, 0 0 20px rgba(255, 209, 102, 0.6); }
.stage-card .play:active { transform: translateY(3px); box-shadow: 0 1px 0 #7a5200; }
.stage-card.locked { filter: grayscale(0.85) brightness(0.6); }
.stage-card.locked .play { background: #444; color: #aaa; box-shadow: none; cursor: not-allowed; }
.stage-card .clear-stamp { position: absolute; right: 120px; top: 12px; transform: rotate(-12deg); border: 3px solid var(--green); color: var(--green); font-family: 'Orbitron', sans-serif; font-weight: 900; padding: 2px 10px; border-radius: 8px; font-size: 14px; text-shadow: 0 0 8px var(--green); }
@media (max-width: 600px) { .stage-card { grid-template-columns: 1fr; } .stage-card .clear-stamp { right: 14px; } }
.lobby-foot { font-size: 11px; color: #9a88c0; text-align: center; max-width: 900px; line-height: 1.6; }
.lobby-foot a { color: #c9b8ff; }

/* ---------------- 연출 레이어 ---------------- */
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }
#flash { position: fixed; inset: 0; pointer-events: none; z-index: 49; opacity: 0; }
#flash.go { animation: flash 0.6s ease-out; }
@keyframes flash { from { opacity: 0.55; } to { opacity: 0; } }
#game.shake { animation: shake 0.5s; }
@keyframes shake { 20% { transform: translate(-8px, 4px); } 40% { transform: translate(7px, -5px); } 60% { transform: translate(-5px, 3px); } 80% { transform: translate(3px, -2px); } }
.banner { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%) scale(0.3); opacity: 0; z-index: 60; pointer-events: none; text-align: center; transition: transform 0.35s cubic-bezier(.2,1.6,.4,1), opacity 0.3s; }
.banner.show { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.banner .b-title { font-family: 'Monoton', cursive; font-size: clamp(30px, 7vw, 84px); color: #fff; white-space: nowrap;
  text-shadow: 0 0 6px #fff, 0 0 18px var(--bc, var(--cyan)), 0 0 38px var(--bc, var(--cyan)), 0 0 70px var(--bc, var(--cyan)); }
.banner .b-sub { font-family: 'Black Han Sans', sans-serif; font-size: clamp(16px, 2.6vw, 28px); color: #fff; text-shadow: 0 0 10px #000, 0 0 4px #000; margin-top: 6px; }
.banner.info { --bc: var(--cyan); }
.banner.good { --bc: var(--green); }
.banner.great { --bc: var(--pink); }
.banner.jackpot { --bc: var(--gold); }
.banner.jackpot .b-title { animation: rainbow 0.6s linear infinite; }
.banner.bad { --bc: #ff4d6d; }
@keyframes rainbow { 0% { color: #fff; } 33% { color: #ffe066; } 66% { color: #ff9ecf; } }
#slot { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0); z-index: 61; transition: transform 0.4s cubic-bezier(.2,1.5,.4,1); text-align: center;
  background: linear-gradient(180deg, #c1121f, #6a040f); border: 6px solid var(--gold); border-radius: 24px; padding: 18px 26px; box-shadow: 0 0 60px var(--gold); }
#slot.show { transform: translate(-50%, -50%) scale(1); }
#slot .reels { display: flex; gap: 10px; }
#slot .reel { width: 90px; height: 100px; background: #fff; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 48px; font-weight: 900; color: #c1121f; font-family: 'Playfair Display', serif; box-shadow: inset 0 6px 10px rgba(0,0,0,0.4); }
#slot .reel.lock { animation: lock 0.3s; }
@keyframes lock { 50% { transform: scale(1.15); } }
#slot .slot-text { font-family: 'Monoton', cursive; color: var(--gold); font-size: 36px; margin-top: 10px; text-shadow: 0 0 12px var(--gold); }

/* 모달 */
.modal { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,0.7); display: none; align-items: center; justify-content: center; padding: 16px; }
.modal.show { display: flex; }
.modal-box { width: min(620px, 100%); max-height: 88vh; overflow-y: auto; background: linear-gradient(160deg, #1d0b3d, #0b0420); border: 2px solid var(--gold); border-radius: 18px; padding: 22px 24px; box-shadow: 0 0 40px rgba(255, 45, 149, 0.4); user-select: text; }
.modal-box h2 { margin: 0 0 10px; font-family: 'Monoton', cursive; font-weight: 400; color: #fff; text-shadow: 0 0 12px var(--pink); font-size: 30px; text-align: center; }
.modal-box h3 { color: var(--gold); margin: 16px 0 6px; font-size: 16px; }
.modal-box p, .modal-box li { font-size: 14px; line-height: 1.7; color: #e6dcff; }
.modal-box table { width: 100%; border-collapse: collapse; font-size: 13px; }
.modal-box td { padding: 4px 6px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.modal-actions button { padding: 12px 22px; border-radius: 12px; border: none; font-family: 'Black Han Sans', sans-serif; font-size: 17px; }
.modal-actions .primary { background: linear-gradient(180deg, #fff3b0, var(--gold) 40%, #c98b00); color: #2b1600; }
.modal-actions .secondary { background: #3a2766; color: #fff; }
.result-big { text-align: center; font-size: 15px; color: #ddd; }
.result-big .pts { font-family: 'Orbitron', sans-serif; color: var(--gold); font-size: 24px; }
.start-overlay { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; background: rgba(5,1,15,0.85); flex-direction: column; gap: 16px; cursor: pointer; }
.start-overlay .neon-title .t1 { font-size: clamp(28px, 6vw, 60px); }
.start-overlay .tap { font-family: 'Black Han Sans', sans-serif; color: var(--gold); font-size: 20px; animation: flicker 2s infinite; }

