/* =========================================================
   LUCKY SPIN - public theme
   Mobile first, no horizontal scroll, colorful gradient look
   ========================================================= */

:root {
  --ls-primary: #7c3aed;
  --ls-button: #f59e0b;
  --ls-dark: #150b2e;
  --ls-card: rgba(255, 255, 255, 0.08);
  --ls-card-border: rgba(255, 255, 255, 0.16);
  --ls-radius: 22px;
}

* {
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.ls-body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  color: #fff;
  font-family: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  background:
    radial-gradient(circle at 15% 12%, color-mix(in srgb, var(--ls-primary) 70%, #ffffff) 0%, transparent 45%),
    radial-gradient(circle at 85% 88%, color-mix(in srgb, var(--ls-button) 60%, #000000) 0%, transparent 45%),
    linear-gradient(160deg, #1b0f36 0%, var(--ls-dark) 55%, #0b0618 100%);
  background-attachment: fixed;
  position: relative;
}

.ls-body.has-bg {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.ls-body.has-bg::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, rgba(27, 15, 54, 0.86), rgba(11, 6, 24, 0.92));
  z-index: 0;
}

/* soft floating glows */
.ls-glow {
  position: fixed;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

.ls-glow-1 {
  background: var(--ls-primary);
  top: -80px;
  left: -100px;
  animation: ls-float 14s ease-in-out infinite;
}

.ls-glow-2 {
  background: var(--ls-button);
  bottom: -120px;
  right: -110px;
  animation: ls-float 18s ease-in-out infinite reverse;
}

@keyframes ls-float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(30px, 40px, 0) scale(1.12); }
}

.ls-main {
  position: relative;
  z-index: 1;
  padding: 20px 14px 32px;
}

.ls-shell {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.ls-shell-narrow {
  max-width: 460px;
}

/* ------------------------------------------------ header */
.ls-header {
  margin-bottom: 18px;
}

.ls-logo {
  max-height: 74px;
  max-width: 78%;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.45));
}

.ls-logo-fallback {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--ls-card-border);
}

.ls-title {
  margin: 14px 0 6px;
  font-size: clamp(1.45rem, 6.2vw, 2.1rem);
  font-weight: 900;
  line-height: 1.15;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
  background: linear-gradient(120deg, #fff 20%, var(--ls-button) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ls-subtitle {
  margin: 0 auto 10px;
  max-width: 34ch;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.94rem;
}

.ls-period {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--ls-card-border);
  color: rgba(255, 255, 255, 0.85);
}

/* ------------------------------------------------ cards */
.ls-card {
  background: var(--ls-card);
  border: 1px solid var(--ls-card-border);
  border-radius: var(--ls-radius);
  padding: 18px 16px;
  margin-bottom: 16px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

.ls-wheel-card {
  padding: 22px 14px 16px;
}

.ls-empty-icon {
  font-size: 2.6rem;
  color: var(--ls-button);
  display: block;
  margin-bottom: 10px;
}

/* ------------------------------------------------ wheel */
.ls-wheel-wrap {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
}

.ls-wheel-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  padding: 10px;
  background: linear-gradient(145deg, #fff5d6, var(--ls-button) 45%, #b45309 100%);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.22),
    0 18px 40px rgba(0, 0, 0, 0.5),
    inset 0 0 22px rgba(0, 0, 0, 0.3);
}

.ls-wheel {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #241247;
}

.ls-wheel-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22%;
  height: 22%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #ffffff, #e2d6ff);
  color: var(--ls-primary);
  font-weight: 900;
  font-size: clamp(0.55rem, 2.6vw, 0.8rem);
  letter-spacing: 0.08em;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), inset 0 -3px 8px rgba(124, 58, 237, 0.25);
  pointer-events: none;
}

.ls-pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 30px solid #fff;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
  z-index: 3;
}

.ls-pointer::after {
  content: '';
  position: absolute;
  top: -20px;
  left: -9px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
}

.is-spinning .ls-wheel-ring {
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.35),
    0 0 42px color-mix(in srgb, var(--ls-button) 75%, transparent),
    0 18px 40px rgba(0, 0, 0, 0.5);
}

/* ------------------------------------------------ legend */
.ls-prize-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 10px;
  margin-top: 16px;
}

.ls-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 3px 10px;
}

.ls-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

/* ------------------------------------------------ form */
.ls-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.8);
}

.ls-input-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ls-input {
  flex: 1 1 60%;
  min-width: 0;
  height: 50px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 16px;
}

.ls-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.06em;
}

.ls-input:focus {
  background: rgba(0, 0, 0, 0.36);
  color: #fff;
  border-color: var(--ls-button);
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--ls-button) 30%, transparent);
}

.ls-input:disabled {
  opacity: 0.6;
}

.btn.ls-btn-secondary {
  flex: 1 1 34%;
  min-height: 50px;
  border-radius: 14px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, color-mix(in srgb, var(--ls-primary) 90%, #fff), var(--ls-primary));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.btn.ls-btn-secondary:hover,
.btn.ls-btn-secondary:focus {
  color: #fff;
  filter: brightness(1.1);
}

.btn.ls-btn-spin {
  margin-top: 14px;
  min-height: 60px;
  border: none;
  border-radius: 18px;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: #3b1d00;
  background: linear-gradient(135deg, #ffe08a, var(--ls-button) 55%, #d97706);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--ls-button) 40%, transparent);
  transition: transform 0.12s ease, filter 0.2s ease;
}

.btn.ls-btn-spin:not(:disabled):hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
}

.btn.ls-btn-spin:not(:disabled) {
  animation: ls-pulse 2.4s ease-in-out infinite;
}

.btn.ls-btn-spin:disabled {
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.5);
  box-shadow: none;
  animation: none;
}

@keyframes ls-pulse {
  0%, 100% { box-shadow: 0 12px 28px color-mix(in srgb, var(--ls-button) 35%, transparent); }
  50% { box-shadow: 0 12px 42px color-mix(in srgb, var(--ls-button) 70%, transparent); }
}

.ls-hint {
  margin-top: 10px;
  font-size: 0.78rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
}

/* ------------------------------------------------ status */
.ls-status {
  margin-top: 14px;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
}

.ls-status-success {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
}

.ls-status-error {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.ls-status-info {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.5);
  color: #93c5fd;
}

/* ------------------------------------------------ modal */
.ls-modal {
  border: none;
  border-radius: 26px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(165deg, #2b1b58, #150b2e 70%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.ls-modal .modal-body {
  padding: 30px 22px 22px;
  position: relative;
}

.ls-result-icon {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 8px;
  color: var(--ls-button);
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.5));
  animation: ls-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes ls-pop {
  0% { transform: scale(0.4) rotate(-12deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.ls-result-heading {
  font-size: 1.7rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.ls-result-sub {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.ls-result-prize {
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px dashed rgba(255, 255, 255, 0.3);
}

.ls-result-image {
  max-height: 78px;
  margin-bottom: 10px;
  object-fit: contain;
}

.ls-result-prize-name {
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1.2;
  color: #fff;
}

.ls-result-desc {
  margin-top: 6px;
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.7);
}

.ls-claim {
  margin-top: 16px;
}

.ls-claim-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 6px;
}

.ls-claim-code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 8px 10px 8px 14px;
}

.ls-claim-code code {
  color: #fde68a;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.btn.ls-btn-copy {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
}

.ls-claim-note {
  display: block;
  margin-top: 8px;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.55);
}

/* confetti */
.ls-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ls-confetti span {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  opacity: 0.9;
  animation: ls-fall linear forwards;
}

@keyframes ls-fall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(360px) rotate(540deg); opacity: 0; }
}

/* ------------------------------------------------ claim page */
.ls-claim-detail {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 16px;
}

.ls-claim-code-plain {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #fde68a;
}

.ls-detail-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.12);
}

.ls-detail-list > div:last-child {
  border-bottom: none;
}

.ls-detail-list dt {
  font-weight: 600;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

.ls-detail-list dd {
  margin: 0;
  font-weight: 700;
  font-size: 0.88rem;
  text-align: right;
}

.ls-badge-pending { background: #f59e0b; color: #3b1d00; }
.ls-badge-claimed { background: #10b981; color: #04241a; }
.ls-badge-cancelled { background: #6b7280; color: #fff; }

/* ------------------------------------------------ misc */
.ls-accordion .accordion-item {
  background: transparent;
  border: none;
}

.ls-accordion .accordion-button {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-weight: 700;
  border-radius: 14px !important;
  box-shadow: none;
}

.ls-accordion .accordion-button::after {
  filter: invert(1);
}

.ls-terms {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.86rem;
  white-space: pre-line;
}

.ls-sound-toggle {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.ls-sound-toggle .form-check-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.82rem;
  font-weight: 600;
}

.ls-sound-toggle .form-check-input {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.ls-sound-toggle .form-check-input:checked {
  background-color: var(--ls-button);
  border-color: var(--ls-button);
}

.ls-footer {
  padding: 8px 0 4px;
}

.ls-footer-link {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
}

.ls-footer-link:hover {
  color: #fff;
}

.ls-footer-text {
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.45);
}

/* ------------------------------------------------ responsive */
@media (min-width: 576px) {
  .ls-main { padding: 34px 18px 44px; }
  .ls-wheel-wrap { max-width: 420px; }
}

@media (max-width: 360px) {
  .ls-card { padding: 15px 13px; }
  .btn.ls-btn-secondary { flex: 1 1 100%; }
  .ls-input { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .ls-glow,
  .btn.ls-btn-spin:not(:disabled),
  .ls-result-icon { animation: none; }
}
