/* ============================================================
   룰렛 화면 (Go-Go! Duck 시안 1:1)
   · 이 파일은 "디자인"만 담당한다. 회전은 roulette-engine.js 가 한다.
   · 실제로 rotate 가 적용되는 요소는 .rl-wheel-rotator 하나뿐이며
     이 요소에는 rotate 외의 transform 을 절대 쓰지 않는다.
     (glow / scale 같은 연출은 바깥 .rl-wheel-effects 에 건다)
   · PC(1200↑) 기준. 태블릿/모바일은 responsive.css 에서만 다룬다.
   ============================================================ */

.rl-page {
  --rl-wheel: 430px;            /* 휠 지름 — 반응형에서 이 변수만 바꾼다 */
  --rl-gold: #f6c945;
  --rl-gold-d: #e0a81f;
  max-width: 1400px;
  margin: 18px auto 34px;
  padding: 0 18px;
}

.rl-grid {
  display: grid;
  grid-template-columns: 316px minmax(0, 1fr) 386px;
  gap: 16px;
  align-items: start;
}
.rl-left, .rl-right { display: flex; flex-direction: column; gap: 16px; }

.rl-card-title { font-size: 14px; font-weight: 900; color: #16305e; margin-bottom: 12px; }
.rl-card-head { display: flex; align-items: center; justify-content: space-between; }
.rl-card-head .rl-card-title { margin-bottom: 12px; }
.rl-empty { color: #9aa7bd; font-size: 12.5px; text-align: center; padding: 14px 0; margin: 0; }
.rl-hint { color: #93a1b8; font-size: 11.5px; margin: 6px 0 0; line-height: 1.5; }

/* ---------------- 좌측: 내 정보 ---------------- */
.rl-me-top { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rl-me-avatar, .rl-me-top img { width: 64px; height: 64px; border-radius: 50%; background: #f2f7fc; }
.rl-me-name { font-size: 15px; font-weight: 900; color: #16305e; display: flex; align-items: center; gap: 6px; }
.rl-me-role {
  font-size: 10.5px; font-weight: 800; color: #4a7fd4;
  background: #eaf2ff; border: 1px solid #d8e6ff; border-radius: 999px; padding: 2px 7px;
}
.rl-me-points {
  margin-top: 12px; display: flex; align-items: center; justify-content: space-between;
  background: #f4f8fd; border: 1px solid #e6eef8; border-radius: 12px; padding: 9px 12px;
}
.rl-me-plabel { font-size: 11px; font-weight: 800; color: #7f8a9e; background: #e9f0fa; border-radius: 6px; padding: 3px 7px; }
.rl-me-points b { font-size: 20px; font-weight: 900; color: #16305e; }
.rl-me-points small { font-size: 11px; color: #7f8a9e; }
.rl-me-stats { margin-top: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rl-me-stats > div {
  background: #f4f8fd; border: 1px solid #e6eef8; border-radius: 12px;
  padding: 9px 6px; text-align: center;
}
.rl-me-stats span { display: block; font-size: 11px; color: #7f8a9e; margin-bottom: 3px; }
.rl-me-stats b { font-size: 14px; color: #16305e; }
.rl-me-btns { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rl-btn {
  height: 38px; border: none; border-radius: 11px; font-family: inherit;
  font-size: 12.5px; font-weight: 800; cursor: pointer;
}
.rl-btn-blue { background: linear-gradient(180deg, #3b86fa, #1d6bfa); color: #fff; }
.rl-btn-ghost { background: #fff; border: 1px solid #dbe6f5; color: #16305e; }
.rl-btn:disabled { opacity: .62; cursor: not-allowed; }

/* ---------------- 좌측: 게임 안내 ---------------- */
.rl-guide-row { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed #eaf0f8; }
.rl-guide-row:last-of-type { border-bottom: none; }
.rl-guide-row img { width: 26px; height: 26px; flex: none; object-fit: contain; image-rendering: pixelated; }
.rl-guide-row b { display: block; font-size: 12.5px; font-weight: 900; color: #16305e; margin-bottom: 2px; }
.rl-guide-row span { font-size: 11.5px; color: #7f8a9e; line-height: 1.5; }
.rl-tip {
  margin-top: 10px; background: #fdf6e0; border: 1px solid #f6e6b4; border-radius: 12px; padding: 10px 12px;
}
.rl-tip b { display: block; font-size: 11.5px; font-weight: 900; color: #b3860c; margin-bottom: 3px; }
.rl-tip span { font-size: 11.5px; color: #8a7433; line-height: 1.55; }

/* ---------------- 중앙: 룰렛 ---------------- */
.rl-mid { padding: 16px 16px 18px; }
.rl-mid-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.rl-mid-title { display: flex; align-items: center; gap: 10px; }
.rl-mid-title img { width: 34px; height: 36px; object-fit: contain; image-rendering: pixelated; }
.rl-mid-title h1 { font-size: 21px; font-weight: 900; color: #16305e; margin: 0; }
.rl-mid-title p { font-size: 11.5px; color: #7f8a9e; margin: 2px 0 0; }
.rl-full-btn {
  height: 32px; padding: 0 13px; border-radius: 10px; cursor: pointer;
  background: #fff; border: 1px solid #dbe6f5; color: #5a6b87;
  font-family: inherit; font-size: 12px; font-weight: 800;
}
.rl-full-btn:hover { background: #f4f8fd; }

.rl-head-btns { display: flex; align-items: center; gap: 7px; }
.rl-bgm-toggle {
  width: 32px; height: 32px; border-radius: 10px; cursor: pointer;
  background: #fff; border: 1px solid #dbe6f5; font-size: 14px; line-height: 1;
}
.rl-bgm-toggle:hover { background: #f4f8fd; }


.rl-stage {
  position: relative; margin-top: 12px;
  background: linear-gradient(180deg, #dff1fd 0%, #cfe9fb 100%);
  border: 1px solid #d5e9f8; border-radius: 16px;
  height: calc(var(--rl-wheel) + 76px);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
/* 배경의 은은한 구름 */
.rl-stage::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(60px 26px at 14% 22%, rgba(255,255,255,.75), transparent 70%),
    radial-gradient(80px 30px at 84% 30%, rgba(255,255,255,.6), transparent 70%),
    radial-gradient(70px 26px at 30% 78%, rgba(255,255,255,.5), transparent 70%);
  pointer-events: none;
}

.rl-frame {
  position: relative;
  width: var(--rl-wheel); height: var(--rl-wheel);
  border-radius: 50%;
  background: linear-gradient(160deg, #ffe27a 0%, var(--rl-gold) 46%, var(--rl-gold-d) 100%);
  padding: 13px;
  box-shadow:
    0 12px 26px rgba(70, 120, 190, .26),
    inset 0 -4px 10px rgba(160, 110, 10, .32),
    inset 0 4px 10px rgba(255, 255, 255, .6);
}

/* glow / scale 은 여기에만 (회전 요소에는 rotate 외 transform 금지) */
.rl-wheel-effects {
  position: absolute; inset: 13px;
  border-radius: 50%;
  overflow: hidden;
  transition: filter .3s ease;
}
.rl-frame.is-spinning .rl-wheel-effects { filter: brightness(1.04) saturate(1.06); }
.rl-frame.is-spinning { box-shadow: 0 14px 30px rgba(70, 120, 190, .34), inset 0 -4px 10px rgba(160, 110, 10, .32), inset 0 4px 10px rgba(255,255,255,.6), 0 0 0 6px rgba(255, 226, 122, .35); }

/* ⚠ 회전 전용 요소 — rotate 이외의 transform 을 여기에 추가하지 말 것 */
.rl-wheel-rotator { width: 100%; height: 100%; will-change: transform; }
.rl-wheel-rotator canvas { width: 100%; height: 100%; display: block; }

/* 금테 위 흰 점 장식 (고정) */
.rl-rim-dots { position: absolute; inset: 0; pointer-events: none; }
.rl-rim-dots i {
  position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px;
  border-radius: 50%; background: #fffbe9; box-shadow: 0 1px 2px rgba(150, 110, 20, .45);
}

/* 12시 포인터 (고정 — 절대 회전하지 않는다) */
.rl-pointer {
  position: absolute; left: 50%; top: -16px; width: 34px; height: 46px; margin-left: -17px;
  background: linear-gradient(180deg, #ff6a5e 0%, #ef3b34 100%);
  border-radius: 50% 50% 50% 50% / 42% 42% 62% 62%;
  clip-path: polygon(50% 100%, 100% 42%, 88% 10%, 50% 0, 12% 10%, 0 42%);
  box-shadow: 0 5px 10px rgba(190, 50, 45, .4);
  z-index: 4;
}
.rl-pointer::after {
  content: ""; position: absolute; left: 50%; top: 13px; width: 12px; height: 12px; margin-left: -6px;
  background: #fff; border-radius: 50%;
}

/* 중앙 오리 (고정) */
.rl-center {
  position: absolute; left: 50%; top: 50%; width: 88px; height: 88px; margin: -44px 0 0 -44px;
  border-radius: 50%; z-index: 3;
  background: linear-gradient(160deg, #ffe694, var(--rl-gold));
  border: 4px solid #fff;
  box-shadow: 0 5px 14px rgba(90, 130, 190, .32);
  display: flex; align-items: center; justify-content: center;
}
.rl-center img { width: 54px; height: 54px; object-fit: contain; image-rendering: pixelated; }

.rl-deco-coins { position: absolute; left: 16px; bottom: 12px; width: 92px; image-rendering: pixelated; pointer-events: none; }
.rl-deco-duck { position: absolute; right: 16px; bottom: 12px; width: 78px; image-rendering: pixelated; pointer-events: none; }

/* 결과 카드 */
.rl-result {
  margin-top: 12px; min-height: 62px;
  background: #f4f8fd; border: 1px solid #e6eef8; border-radius: 14px;
  display: flex; align-items: center; gap: 11px; padding: 11px 15px;
  transition: background .25s ease, border-color .25s ease;
}
.rl-result-ico {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  background: #e6edf7; color: #8b98ad; font-size: 15px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
}
.rl-result-tx b { display: block; font-size: 14px; font-weight: 900; color: #16305e; }
.rl-result-tx span { font-size: 11.5px; color: #8b98ad; }
.rl-result.is-spinning { background: #eef5ff; border-color: #d7e6ff; }
.rl-result.is-spinning .rl-result-ico { background: #dbe9ff; }
.rl-result.is-done { background: #fff8e4; border-color: #f5e3ae; }
.rl-result.is-done .rl-result-ico { background: #ffeec0; }
.rl-result.is-winner { background: #eafaf0; border-color: #c3ecd3; }
.rl-result.is-winner .rl-result-ico { background: #d3f3e0; }

.rl-actions { margin-top: 12px; text-align: center; }
.rl-spin-btn {
  width: 100%; max-width: 350px; height: 52px; border: none; border-radius: 14px; cursor: pointer;
  background: linear-gradient(180deg, #ffd558 0%, #f5b021 100%);
  color: #6b4708; font-family: inherit; font-size: 17px; font-weight: 900;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 6px 14px rgba(226, 163, 26, .38), inset 0 1px 0 rgba(255, 255, 255, .6);
  transition: filter .2s ease, transform .15s ease;
}
.rl-spin-btn img { width: 24px; height: 24px; image-rendering: pixelated; }
.rl-spin-btn:hover:not(:disabled) { filter: brightness(1.06); }
.rl-spin-btn:active:not(:disabled) { transform: translateY(1px); }
.rl-spin-btn:disabled { opacity: .55; cursor: not-allowed; }
.rl-watch { font-size: 13px; font-weight: 800; color: #5a6b87; margin: 6px 0 0; }
.rl-conn { font-size: 11.5px; color: #93a1b8; margin: 9px 0 0; }
.rl-conn.is-ok { color: #4a9d72; }

/* ---------------- 우측 ---------------- */
.rl-jp-panel {
  position: relative; border-radius: 14px; padding: 18px 14px 16px; text-align: center; overflow: hidden;
  background: linear-gradient(180deg, #2f6fe0 0%, #1c50b8 100%);
}
.rl-jp-crown { width: 34px; height: 26px; image-rendering: pixelated; }
.rl-jp-amt { font-size: 26px; font-weight: 900; color: #ffe071; margin-top: 4px; text-shadow: 0 2px 0 rgba(0, 0, 0, .18); }
.rl-jp-who { font-size: 13px; font-weight: 800; color: #fff; margin-top: 6px; }
.rl-jp-time { font-size: 11px; color: #c9dcff; margin-top: 3px; }
.rl-jp-strip { display: block; width: 100%; margin-top: 8px; }

.rl-recent-count { font-size: 11px; color: #93a1b8; }
.rl-recent-list { display: flex; flex-direction: column; }
.rl-recent-row {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 2px; border-bottom: 1px solid #f0f4fa; font-size: 12.5px;
}
.rl-recent-row:last-child { border-bottom: none; }
.rl-recent-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: #9aa7bd; }
.rl-recent-row.is-out .rl-recent-dot { background: #ef6a63; }
.rl-recent-row.is-bomb .rl-recent-dot { background: #2b2f3a; }
.rl-recent-row.is-win .rl-recent-dot { background: #f5b021; }
.rl-recent-row.is-sys .rl-recent-dot { background: #7fc7a4; }
.rl-recent-tx { flex: 1; min-width: 0; color: #16305e; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-recent-time { font-size: 11px; color: #9aa7bd; flex: none; }

.rl-rules { position: relative; }
.rl-rule-list { margin: 0; padding: 0; list-style: none; }
.rl-rule-list li {
  position: relative; padding-left: 20px; margin-bottom: 6px;
  font-size: 12px; color: #5a6b87; line-height: 1.55;
}
.rl-rule-list li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: #4fb98a; font-weight: 900; font-size: 12px;
}
.rl-rule-list li:nth-last-child(-n+2) { padding-right: 74px; }
.rl-rules-duck { position: absolute; right: 12px; bottom: 12px; width: 66px; image-rendering: pixelated; }

/* ---------------- 하단: 칸 설정 ---------------- */
.rl-setup { margin-top: 16px; }
.rl-setup.is-locked { opacity: .72; }
.rl-setup-head { display: flex; align-items: center; gap: 10px; }
.rl-setup-head .rl-card-title { margin-bottom: 0; }
.rl-setup-sub { font-size: 11.5px; color: #93a1b8; }
.rl-sum { margin-left: auto; font-size: 12px; font-weight: 800; color: #7f8a9e; }
.rl-sum b { font-size: 17px; color: #16305e; }

.rl-setup-body { margin-top: 12px; display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.rl-table { border: 1px solid #e9f0f8; border-radius: 12px; padding: 10px; background: #fbfdff; }
.rl-thead, .rl-row {
  display: grid;
  grid-template-columns: 30px 52px minmax(0, 1fr) 108px 56px 44px;
  gap: 8px; align-items: center;
}
.rl-thead { font-size: 11.5px; font-weight: 800; color: #93a1b8; padding: 2px 4px 8px; text-align: center; }
.rl-thead span:nth-child(3) { text-align: left; padding-left: 4px; }
.rl-rows { display: flex; flex-direction: column; gap: 7px; }
.rl-row { padding: 2px 4px; }
.rl-no { text-align: center; font-size: 12px; font-weight: 800; color: #9aa7bd; }
.rl-swatch-wrap { display: flex; justify-content: center; }
.rl-swatch { width: 44px; height: 30px; padding: 0; border: 1px solid #dbe6f5; border-radius: 7px; background: none; cursor: pointer; }
.rl-swatch::-webkit-color-swatch-wrapper { padding: 3px; }
.rl-swatch::-webkit-color-swatch { border: none; border-radius: 5px; }
.rl-swatch:disabled { cursor: default; opacity: 1; }
.rl-input {
  height: 34px; border: 1px solid #dbe6f5; border-radius: 8px; background: #fff;
  padding: 0 10px; font-family: inherit; font-size: 12.5px; color: #16305e; width: 100%;
}
.rl-input.rl-weight { text-align: center; padding: 0 6px; }
.rl-input:focus { outline: none; border-color: #7fb0ff; box-shadow: 0 0 0 3px rgba(127, 176, 255, .2); }
.rl-input:disabled { background: #f5f8fc; color: #5a6b87; }
.rl-pct { text-align: center; font-size: 12px; font-weight: 800; color: #7f8a9e; }
.rl-row-end { display: flex; align-items: center; justify-content: center; gap: 4px; }
.rl-mark { font-size: 13px; }
.rl-del {
  width: 28px; height: 28px; border: 1px solid #f3d6d6; border-radius: 8px; background: #fff;
  color: #e07b7b; cursor: pointer; font-size: 12px; font-weight: 800; line-height: 1;
}
.rl-del:hover { background: #fff2f2; }

.rl-setup-side { display: flex; flex-direction: column; gap: 12px; }
.rl-setup-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rl-sbtn {
  height: 40px; border: 1px solid #dbe6f5; border-radius: 10px; background: #fff; cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 800; color: #16305e;
}
.rl-sbtn:hover { background: #f4f8fd; }
.rl-sbtn:disabled { opacity: .5; cursor: not-allowed; }
.rl-sbtn-sm { height: 30px; font-size: 11.5px; padding: 0 9px; }
.rl-presets { border: 1px solid #e9f0f8; border-radius: 12px; padding: 10px 12px; background: #fbfdff; }
.rl-presets-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rl-presets-head b { font-size: 12.5px; color: #16305e; }
.rl-preset-rows { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.rl-preset-row { display: flex; gap: 6px; }
.rl-preset-load {
  flex: 1; min-width: 0; height: 32px; border: 1px solid #dbe6f5; border-radius: 9px; background: #fff;
  font-family: inherit; font-size: 12px; font-weight: 800; color: #16305e; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 8px;
}
.rl-preset-load small { color: #93a1b8; font-weight: 700; }
.rl-preset-del {
  width: 32px; height: 32px; flex: none; border: 1px solid #f3d6d6; border-radius: 9px;
  background: #fff; color: #e07b7b; cursor: pointer; font-weight: 800;
}
.rl-save {
  width: 100%; height: 52px; border: none; border-radius: 13px; cursor: pointer;
  background: linear-gradient(180deg, #3b86fa, #1d6bfa); color: #fff;
  font-family: inherit; font-size: 16px; font-weight: 900;
  box-shadow: 0 6px 14px rgba(29, 107, 250, .3), inset 0 1px 0 rgba(255, 255, 255, .28);
}
.rl-save:hover { filter: brightness(1.06); }
.rl-save:disabled { opacity: .55; cursor: not-allowed; }
.rl-save-wrap { text-align: center; }

/* ---------------- 전체 화면 모드 (중앙 룰렛만 크게) ---------------- */
.rl-page.is-full .rl-grid { grid-template-columns: minmax(0, 1fr); }
.rl-page.is-full .rl-left,
.rl-page.is-full .rl-right,
.rl-page.is-full .rl-setup { display: none; }
.rl-page.is-full { --rl-wheel: min(620px, 74vh); }
.rl-page.is-full .rl-mid { max-width: 860px; margin: 0 auto; }

/* ============================================================
   연출 오버레이 — 원본과 같은 문구·타이밍, 색만 고고덕 톤
   ============================================================ */
.one-more-time-overlay {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none; background: rgba(12, 40, 86, .34);
  animation: rlOverlayIn .25s ease;
}
@keyframes rlOverlayIn { from { opacity: 0; } to { opacity: 1; } }
.one-more-time-text {
  font-size: clamp(28px, 6vw, 56px); font-weight: 900; color: #fff8dc; text-align: center;
  text-shadow: 0 4px 0 rgba(180, 120, 10, .5), 0 0 26px rgba(255, 216, 110, .85);
  animation: rlPop .5s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes rlPop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.omt-heart { color: #ff9ec4; }
.elim-overlay { background: rgba(20, 20, 30, .42); }
.elim-title { color: #ffe9e9; text-shadow: 0 4px 0 rgba(120, 20, 20, .45), 0 0 26px rgba(255, 120, 120, .8); }
.bomb-title { color: #ffd9a8; }
.elim-changes { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.elim-change {
  font-size: 15px; font-weight: 900; padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .16);
}
.elim-up { color: #9ff0bd; }
.elim-down { color: #ffadad; }

/* 폭탄 붕괴 파편 */
.rl-frame.is-crumbling { animation: rlShake .5s ease; }
@keyframes rlShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-6px, 3px); }
  45% { transform: translate(5px, -3px); }
  70% { transform: translate(-3px, 2px); }
}
.roulette-debris { position: absolute; z-index: 5; display: block; pointer-events: none; }
.roulette-dust {
  position: absolute; z-index: 5; width: 70px; height: 70px; margin: -35px 0 0 -35px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(190, 180, 165, .8), rgba(190, 180, 165, 0) 70%);
  animation: rlDust 1s ease-out forwards;
}
@keyframes rlDust {
  from { transform: scale(.3); opacity: .9; }
  to { transform: scale(2.4); opacity: 0; }
}
