/* lucky-draw-v3.css — Lucky Draw underwater redesign (2026-07-28, design final).
   Presentation only: shell, 7-layer wheel, win card, button states, cyan info bar.
   Desktop ≥980: centered 400px panel · <980: bottom sheet (site convention).
   Close ✕ = .ld-close, member of the modal-close-unify.css roster (32px spec). */

/* ── shell ─────────────────────────────────────────────────────── */
html body #modal-lucky.modal-backdrop {
  background: rgba(4, 8, 12, .8) !important;
  -webkit-backdrop-filter: blur(5px) !important;
  backdrop-filter: blur(5px) !important;
  z-index: 210 !important;
}
html body #modal-lucky .modal {
  background:
    linear-gradient(180deg, rgba(9, 38, 50, .85), rgba(4, 14, 22, .94)),
    url('../img/bg/underwater-modal.jpg') center / cover no-repeat !important;
  border: 1px solid var(--fz-line-2, rgba(255,255,255,.14)) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 30px 80px rgba(0, 0, 0, .65) !important;
  position: relative !important;
  padding: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;   /* mobile-phase1 .modal{align-items:flex-end} would right-collapse children */
  justify-content: flex-start !important;
  color: #fff;
}
@media (max-width: 979px) {
  html body #modal-lucky.modal-backdrop { align-items: flex-end !important; padding: 0 !important; }
  html body #modal-lucky .modal {
    width: 100% !important; max-width: 100vw !important;
    border-radius: 18px 18px 0 0 !important; border-bottom: none !important;
    max-height: 92vh !important; margin: 0 !important;
  }
}
@media (min-width: 980px) {
  html body #modal-lucky.modal-backdrop { align-items: center !important; padding: 24px !important; }
  html body #modal-lucky .modal {
    width: 100% !important; max-width: 400px !important;
    border-radius: 18px !important; margin: auto !important; max-height: 92vh !important;
  }
}

/* ── header ────────────────────────────────────────────────────── */
#modal-lucky .ld-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 0; flex: 0 0 auto; }
#modal-lucky .ld-coin {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  color: #6B4A08;  /* coin-face glyph (inline SVG — Tabler font icons are banned: prod font subset) */
  background: radial-gradient(circle at 32% 28%, #FFE082, var(--fz-gold, #F5C842) 45%, #8A6410 100%);
  border: 1px solid rgba(255, 240, 184, .55);
  box-shadow: 0 0 14px rgba(245, 200, 66, .45), inset 0 -2px 4px rgba(0, 0, 0, .3), inset 0 2px 3px rgba(255, 255, 255, .5);
}
#modal-lucky .ld-title {
  font-family: var(--fz-font-display, 'Oswald', sans-serif);
  font-size: 22px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--fz-white, #fff); line-height: 1;
  text-shadow: 0 1px 12px rgba(245, 200, 66, .35);
}
#modal-lucky .ld-sub { font-size: 11.5px; color: var(--fz-text-3, #6E7B88); margin-top: 3px; }

/* ── wheel stage: 7 layers, outside → in ───────────────────────── */
#modal-lucky .ld-stage { position: relative; width: 300px; height: 300px; margin: 14px auto 6px; flex: 0 0 auto; }

/* 1 · ambient halo */
#modal-lucky .ld-halo {
  position: absolute; inset: -26px; border-radius: 50%; z-index: 0;
  background: radial-gradient(circle, rgba(245, 200, 66, .22), rgba(41, 182, 232, .1) 45%, transparent 72%);
  filter: blur(14px); pointer-events: none;
}

/* 2 · 16 marquee bulbs (arm at center, bulb thrown to radius 150) */
#modal-lucky .ld-lamp { position: absolute; left: 50%; top: 50%; width: 0; height: 0; z-index: 5; pointer-events: none; }
#modal-lucky .ld-lamp i {
  position: absolute; left: -3.5px; top: -144px; width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #FFFBEA, #FFD24A 55%, #A9750C 100%);
  box-shadow: 0 0 6px 2px rgba(255, 210, 74, .75), 0 0 14px 4px rgba(255, 210, 74, .3);
  animation: ld-bulb 1.4s ease-in-out infinite;
}
@keyframes ld-bulb {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px 2px rgba(255, 210, 74, .75), 0 0 14px 4px rgba(255, 210, 74, .3); }
  50% { opacity: .38; box-shadow: 0 0 3px 1px rgba(255, 210, 74, .35), 0 0 6px 2px rgba(255, 210, 74, .12); }
}

/* 3 · brass rim, flush to the stage edge — bulbs pin onto it (alternating highlight/shadow = metal) */
#modal-lucky .ld-brass {
  position: absolute; inset: 0; border-radius: 50%; z-index: 2;
  background: conic-gradient(from 210deg, #6E4A08, #FFE9A8 12%, #C79517 28%, #8A6410 44%, #FFF3C4 58%, #B8860B 74%, #6E4A08 88%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .55), inset 0 1px 2px rgba(255, 255, 255, .35);
}

/* 4 · black groove */
#modal-lucky .ld-groove {
  position: absolute; inset: 11px; border-radius: 50%; z-index: 3;
  background: linear-gradient(180deg, #0B141C, #04090E);
  box-shadow: inset 0 3px 7px rgba(0, 0, 0, .75);
}

/* 5 · dial (rotates; conic segment colours + hairline separators set inline by JS) */
#modal-lucky .ld-dial {
  position: absolute; inset: 15px; border-radius: 50%; overflow: hidden; z-index: 4;
  transform-origin: 50% 50%;
  will-change: transform;
}
/* static glass: top-left highlight arc + vignette (does not rotate) */
#modal-lucky .ld-glass {
  position: absolute; inset: 15px; border-radius: 50%; z-index: 6; pointer-events: none;
  background: radial-gradient(120% 90% at 28% 12%, rgba(255, 255, 255, .3), rgba(255, 255, 255, .06) 34%, transparent 56%);
  box-shadow: inset 0 0 44px rgba(0, 0, 0, .5), inset 0 -10px 26px rgba(0, 0, 0, .35);
}
/* segment label: horizontal, always upright, absolutely positioned near the outer edge
   (left/top set inline by JS; counter-rotation keeps it upright during the spin) */
#modal-lucky .ld-seg {
  position: absolute; width: 68px; height: 34px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-align: center; pointer-events: none;
  transform-origin: 50% 50%;
  will-change: transform;
}
#modal-lucky .ld-seg svg { display: block; }
#modal-lucky .ld-seg-t {
  font-family: var(--fz-font-mono, ui-monospace, monospace);
  font-size: 13.5px; font-weight: 800; line-height: 1; white-space: nowrap; letter-spacing: -0.01em;
}

/* 6 · pointer (top centre) */
#modal-lucky .ld-ptr {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 7;
  display: flex; flex-direction: column; align-items: center; pointer-events: none;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .55));
}
#modal-lucky .ld-ptr-orb {
  width: 15px; height: 15px; border-radius: 50%; z-index: 2;
  background: radial-gradient(circle at 35% 30%, #FFFBEA, #F5C842 50%, #8A6410);
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: 0 0 12px rgba(245, 200, 66, .8);
  margin-bottom: -3px;
}
#modal-lucky .ld-ptr-tri {
  width: 0; height: 0;
  border-left: 13px solid transparent; border-right: 13px solid transparent;
  border-top: 26px solid #FFD24A;
}

/* 7 · hub: rotating sheen ring + brass disc + anchor */
#modal-lucky .ld-hub { position: absolute; left: 50%; top: 50%; width: 82px; height: 82px; transform: translate(-50%, -50%); z-index: 8; }
#modal-lucky .ld-hub-sheen {
  position: absolute; inset: -6px; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255, 214, 74, 0), rgba(255, 240, 184, .7), rgba(255, 214, 74, 0) 55%);
  filter: blur(4px);
  animation: ld-rot 3.4s linear infinite;
}
#modal-lucky .ld-hub-disc {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 34% 24%, #FFF6D0, #F5C842 38%, #A9750C 78%, #6E4A08);
  border: 3px solid rgba(255, 255, 255, .45);
  box-shadow: inset 0 -6px 12px rgba(0, 0, 0, .35), inset 0 3px 6px rgba(255, 255, 255, .5), 0 4px 12px rgba(0, 0, 0, .5), 0 0 18px rgba(245, 200, 66, .4);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  color: #3A2B06;
}
#modal-lucky .ld-hub-spin {
  font-family: var(--fz-font-display, 'Oswald', sans-serif);
  font-size: 8px; font-weight: 600; letter-spacing: .16em;
}
@keyframes ld-rot { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ── spins count / button / info bar ───────────────────────────── */
#modal-lucky .ld-count {
  text-align: center; margin: 4px 0 8px; flex: 0 0 auto;
  font-family: var(--fz-font-mono, ui-monospace, monospace);
  font-size: 12px; font-weight: 700; color: var(--fz-gold, #F5C842); letter-spacing: .02em;
}
#modal-lucky .ld-btn {
  height: 50px; border-radius: 14px; margin: 0 18px 10px; border: none; cursor: pointer; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--fz-font-body, 'Inter', sans-serif);
  font-size: 15px; font-weight: 700; letter-spacing: .03em;
  color: var(--fz-on-gold, #14110A);
  background: linear-gradient(180deg, #FFE082 0%, #F5C842 45%, #C08E1A 100%);
  box-shadow: 0 6px 18px rgba(245, 200, 66, .35), inset 0 1px 0 rgba(255, 255, 255, .5);
  transition: transform .15s ease, box-shadow .15s ease;
}
#modal-lucky .ld-btn:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(245, 200, 66, .45), inset 0 1px 0 rgba(255, 255, 255, .5); }
#modal-lucky .ld-btn:not(:disabled):active { transform: translateY(0) scale(.985); }
#modal-lucky .ld-btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; filter: grayscale(1); }
#modal-lucky .ld-loader { animation: ld-rot 1s linear infinite; }
#modal-lucky .ld-info {
  margin: 0 18px 18px; padding: 10px 12px; border-radius: 10px; flex: 0 0 auto;
  background: var(--fz-cyan-soft, rgba(41, 182, 232, .12));
  border: 1px solid rgba(41, 182, 232, .25);
  color: #9AD8F0; font-size: 10.5px; line-height: 1.55; text-align: center;
}

/* ── win card (after the wheel stops) ──────────────────────────── */
#modal-lucky .ld-win-ov {
  position: absolute; inset: 0; z-index: 12;
  display: flex; align-items: center; justify-content: center;
  background: rgba(2, 8, 12, .55);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  cursor: pointer;
  animation: ld-ov-in .25s ease-out;
}
@keyframes ld-ov-in { from { opacity: 0; } to { opacity: 1; } }
#modal-lucky .ld-win-card {
  position: relative; overflow: hidden; text-align: center;
  width: min(320px, 84%); padding: 24px 20px 18px; border-radius: 16px;
  background: linear-gradient(160deg, rgba(30, 213, 113, .16), rgba(8, 28, 38, .85));
  border: 1px solid rgba(30, 213, 113, .45);
  box-shadow: 0 0 34px rgba(30, 213, 113, .25), inset 0 1px 0 rgba(255, 255, 255, .14);
  animation: ld-card-in .3s cubic-bezier(0.34, 1.4, 0.64, 1);
}
@keyframes ld-card-in { from { opacity: 0; transform: scale(.88); } to { opacity: 1; transform: scale(1); } }
#modal-lucky .ld-win-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, .16) 50%, transparent 65%);
  background-size: 220% 100%;
  animation: ld-sheen 2.2s linear infinite;
}
@keyframes ld-sheen { from { background-position: 120% 0; } to { background-position: -120% 0; } }
#modal-lucky .ld-win-ico { font-size: 34px; line-height: 1; }
#modal-lucky .ld-win-eyebrow {
  margin-top: 8px; font-size: 10px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase;
  color: #4EF09A;
}
#modal-lucky .ld-win-amt {
  margin-top: 6px;
  font-family: var(--fz-font-mono, ui-monospace, monospace);
  font-size: 30px; font-weight: 800; color: #fff; line-height: 1.1;
  text-shadow: 0 0 18px rgba(30, 213, 113, .55);
}
#modal-lucky .ld-win-sub { margin-top: 6px; font-size: 11px; color: rgba(255, 255, 255, .65); }
#modal-lucky .ld-win-tap { margin-top: 14px; font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .35); }
/* no-win variant: neutral, not celebratory */
#modal-lucky .ld-win-card.ld-win-none {
  background: linear-gradient(160deg, rgba(255, 255, 255, .07), rgba(8, 20, 28, .88));
  border-color: rgba(255, 255, 255, .18);
  box-shadow: 0 0 24px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .1);
}
#modal-lucky .ld-win-card.ld-win-none .ld-win-eyebrow { color: var(--fz-text-2, #A6B0BC); }
#modal-lucky .ld-win-card.ld-win-none .ld-win-amt { text-shadow: none; }

/* ── loading / disabled states ─────────────────────────────────── */
#modal-lucky .ld-loading { padding: 48px 24px; text-align: center; color: rgba(255, 255, 255, .4); font-size: 13px; }
#modal-lucky .ld-off { padding: 34px 24px 60px; text-align: center; }
#modal-lucky .ld-off-ico { font-size: 40px; margin-bottom: 10px; opacity: .4; }
#modal-lucky .ld-off-t { font-size: 15px; font-weight: 500; color: rgba(255, 255, 255, .6); margin-bottom: 6px; }
#modal-lucky .ld-off-s { font-size: 12px; color: rgba(255, 255, 255, .3); }

/* reduced motion: kill decorative loops, keep the spin itself */
@media (prefers-reduced-motion: reduce) {
  #modal-lucky .ld-lamp i, #modal-lucky .ld-hub-sheen, #modal-lucky .ld-win-card::after { animation: none !important; }
}
