:root {
  --nro-wheel-gold: #ffd43b;
  --nro-wheel-gold-bright: #fff1a8;
  --nro-wheel-orange: #ff8a1f;
  --nro-wheel-blue: #0b75d1;
  --nro-wheel-blue-deep: #072554;
  --nro-wheel-surface: #09132d;
  --nro-wheel-text: #f8fbff;
  --nro-wheel-muted: #c8d4e7;
}

.wheel-page {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 30px) 16px 48px;
}

.wheel-shell,
.wheel-shell * {
  box-sizing: border-box;
}

.wheel-shell {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(24px, 4vw, 36px) clamp(12px, 3vw, 24px) 24px;
  color: var(--nro-wheel-text);
  text-align: center;
  background:
    radial-gradient(circle at 50% 18%, rgba(40, 154, 255, 0.18), transparent 38%),
    radial-gradient(circle at 12% 0%, rgba(255, 176, 66, 0.18), transparent 32%),
    linear-gradient(145deg, rgba(15, 31, 70, 0.98), rgba(5, 10, 29, 0.98));
  border: 1px solid rgba(255, 212, 59, 0.28);
  border-radius: 20px;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.wheel-shell .main {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
}

.wheel-shell .span11 {
  --wheel-size: min(31rem, calc(100vw - 64px));
  position: relative;
  display: grid;
  width: var(--wheel-size);
  max-width: 100%;
  height: auto;
  aspect-ratio: 1;
  margin-inline: auto;
  place-items: center;
  isolation: isolate;
}

.wheel-shell .span11::before {
  content: "";
  position: absolute;
  inset: -3%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle, rgba(38, 169, 255, 0.26) 0 54%, transparent 70%),
    conic-gradient(from 12deg, transparent, rgba(255, 212, 59, 0.2), transparent 24% 50%, rgba(60, 179, 255, 0.16), transparent 74%);
  border-radius: 50%;
  filter: blur(8px);
  opacity: 0.86;
  transition: opacity 180ms ease;
}

.wheel-shell .wheel-stage.is-spinning::before {
  opacity: 1;
}

.wheel-shell .span11::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: 34%;
  aspect-ratio: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.2), transparent 24%),
    linear-gradient(145deg, #0b706a, #06443f);
  border: clamp(4px, 1.1vw, 7px) solid var(--nro-wheel-gold);
  border-radius: 50%;
  box-shadow:
    0 0 0 5px rgba(7, 24, 57, 0.96),
    0 0 22px rgba(255, 212, 59, 0.28),
    0 10px 22px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transform: translate(-50%, -50%);
}

.wheel-shell .wheel-pointer {
  position: absolute;
  top: -1px;
  left: 50%;
  z-index: 7;
  width: clamp(42px, 12%, 62px);
  height: clamp(48px, 14%, 72px);
  pointer-events: none;
  background: linear-gradient(90deg, #d99600, var(--nro-wheel-gold-bright) 42%, var(--nro-wheel-gold) 66%, #b96d00);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 6px 4px rgba(0, 0, 0, 0.48)) drop-shadow(0 0 8px rgba(255, 212, 59, 0.34));
  transform: translateX(-50%);
}

.wheel-shell .wheel-pointer::after {
  content: "";
  position: absolute;
  inset: 5px 8px 14px;
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0));
  clip-path: inherit;
}

.wheel-shell .wheel {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  overflow: hidden;
  list-style: none;
  background: var(--nro-wheel-blue);
  border: clamp(8px, 2vw, 12px) solid var(--nro-wheel-gold);
  border-radius: 50%;
  box-shadow:
    0 0 0 5px rgba(8, 30, 68, 0.98),
    0 0 0 8px rgba(255, 212, 59, 0.12),
    0 16px 34px rgba(0, 0, 0, 0.46),
    0 0 30px rgba(35, 151, 255, 0.22),
    inset 0 0 22px rgba(255, 255, 255, 0.13);
  transform-origin: 50% 50%;
  transition: transform 7s cubic-bezier(0.075, 0.8, 0.2, 1);
  will-change: transform;
}

.wheel-shell .wheel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    radial-gradient(circle, transparent 0 46%, rgba(255, 255, 255, 0.055) 62%, rgba(2, 17, 48, 0.16) 100%),
    linear-gradient(120deg, rgba(255, 255, 255, 0.08), transparent 31% 69%, rgba(255, 255, 255, 0.04));
  border-radius: 50%;
  box-shadow: inset 0 0 16px rgba(3, 16, 46, 0.34);
}

.wheel-shell .wheel li {
  position: absolute;
  z-index: 2;
  display: block;
  padding: 0;
  margin: 0;
  list-style: none;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  backface-visibility: hidden;
}

.wheel-shell .wheel-reward-content {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1px;
  text-align: center;
  transform-origin: 50% 50%;
  transition: transform 7s cubic-bezier(0.075, 0.8, 0.2, 1), filter 180ms ease;
  will-change: transform;
}

.wheel-shell .wheel-gift-icon {
  display: block;
  width: 86% !important;
  max-height: clamp(30px, 8vw, 66px);
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  filter:
    drop-shadow(0 4px 3px rgba(0, 0, 0, 0.38))
    drop-shadow(0 0 7px rgba(255, 226, 75, 0.38));
  transform: translateZ(0);
}

.wheel-shell .wheel-reward-name {
  display: -webkit-box;
  width: 120%;
  max-width: 90px;
  overflow: hidden;
  color: #fff;
  font-family: "Chakra Petch", sans-serif;
  font-size: clamp(0.48rem, 1.25vw, 0.68rem);
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 4px rgba(0, 0, 0, 0.72);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.wheel-shell .wheel-reward-marker-quantity {
  color: var(--nro-wheel-gold-bright);
  font-size: clamp(0.46rem, 1.1vw, 0.64rem);
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.92);
}

.wheel-shell .wheel-reward-marker.is-compact .wheel-reward-name,
.wheel-shell .wheel-reward-marker.is-compact .wheel-reward-marker-quantity {
  display: none;
}

.wheel-shell .wheel-reward-marker.is-compact .wheel-gift-icon {
  width: 100% !important;
}

.wheel-shell .wheel li.is-winner .wheel-reward-content {
  filter: brightness(1.14) saturate(1.18);
}

.wheel-shell .wheel li.is-winner .wheel-gift-icon {
  animation: wheelWinnerPop 520ms cubic-bezier(0.2, 0.85, 0.28, 1.25) both;
}

.wheel-shell .wheel-center-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  pointer-events: none;
  place-items: center;
}

.wheel-shell .butt11 {
  position: relative;
  width: 29%;
  min-width: 88px;
  max-width: 145px;
  aspect-ratio: 1;
  padding: 0;
  pointer-events: auto;
  touch-action: manipulation;
  cursor: pointer;
  background-color: transparent;
  background-image: url("/item/nutquay.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  border: 0;
  border-radius: 50%;
  filter: drop-shadow(0 9px 6px rgba(0, 0, 0, 0.46)) drop-shadow(0 0 7px rgba(255, 212, 59, 0.24));
  transform: none;
  transition: filter 180ms ease, transform 180ms ease;
}

.wheel-shell .butt11::after {
  content: "";
  position: absolute;
  inset: -7px;
  pointer-events: none;
  border: 3px solid rgba(255, 239, 168, 0.3);
  border-top-color: var(--nro-wheel-gold-bright);
  border-radius: 50%;
  opacity: 0;
}

.wheel-shell .butt11:hover:not(:disabled) {
  filter: brightness(1.07) drop-shadow(0 10px 7px rgba(0, 0, 0, 0.48)) drop-shadow(0 0 12px rgba(255, 212, 59, 0.3));
  transform: scale(1.035);
}

.wheel-shell .butt11:active:not(:disabled) {
  filter: brightness(0.98) drop-shadow(0 6px 4px rgba(0, 0, 0, 0.4));
  transform: scale(0.97);
}

.wheel-shell .butt11:focus-visible {
  outline: 4px solid #ffffff !important;
  outline-offset: 5px !important;
}

body.girlkun-bg .wheel-shell .wheel-center-layer .butt11:disabled {
  opacity: 0.68 !important;
  cursor: not-allowed !important;
  filter: grayscale(0.28) saturate(0.78) drop-shadow(0 7px 5px rgba(0, 0, 0, 0.42)) !important;
  transform: none !important;
}

.wheel-shell .butt11[aria-busy="true"]::after {
  opacity: 1;
  animation: wheelButtonBusy 900ms linear infinite;
}

.wheel-shell .textinfo {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  color: var(--nro-wheel-text);
  background:
    linear-gradient(145deg, rgba(27, 51, 98, 0.9), rgba(11, 24, 56, 0.94));
  border: 1px solid rgba(255, 212, 59, 0.78);
  border-radius: 12px;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-size: clamp(0.95rem, 2.2vw, 1.2rem);
  font-variant-numeric: tabular-nums;
}

.wheel-shell .textinfo i,
.wheel-shell .textinfo strong {
  color: var(--nro-wheel-gold-bright);
}

.wheel-shell .textinfo span {
  color: var(--nro-wheel-muted);
}

.wheel-shell .msg {
  min-height: 30px;
  margin-top: 12px;
  color: var(--nro-wheel-text);
  font-family: "Chakra Petch", sans-serif;
  font-size: clamp(0.92rem, 2vw, 1rem);
  font-weight: 700;
  line-height: 1.5;
}

@keyframes wheelButtonBusy {
  to { transform: rotate(360deg); }
}

@keyframes wheelWinnerPop {
  0% { transform: scale(1); }
  48% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.wheel-alert {
  display: inline-block;
  margin: 0 0 18px;
  padding: 10px 14px;
  color: #fff;
  background: #5d2430;
  border: 1px solid #e88091;
  border-radius: 7px;
  font-weight: 700;
}

.swal2-container.wheel-result-container {
  padding: 16px;
  background: rgba(2, 8, 27, 0.72) !important;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.swal2-popup.wheel-result-popup {
  display: flex !important;
  align-items: center;
  flex-direction: column;
  width: min(430px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  padding: 24px clamp(16px, 4vw, 28px) 22px;
  color: var(--nro-wheel-text) !important;
  background:
    radial-gradient(circle at 50% -8%, rgba(255, 212, 59, 0.2), transparent 34%),
    radial-gradient(circle at 8% 20%, rgba(24, 145, 255, 0.15), transparent 38%),
    linear-gradient(155deg, #10275a, #07132e 60%, #050b1d) !important;
  border: 1px solid rgba(255, 212, 59, 0.52) !important;
  border-radius: 20px !important;
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.58),
    0 0 34px rgba(36, 145, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.11) !important;
}

.wheel-result-popup .wheel-result-title {
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  color: var(--nro-wheel-gold-bright) !important;
  font-family: "Chakra Petch", sans-serif;
  font-size: clamp(1.45rem, 5vw, 1.85rem);
  line-height: 1.25;
}

.wheel-result-popup .wheel-result-image {
  flex: 0 0 auto;
  width: 88px;
  height: 88px;
  margin: 16px auto 4px;
  object-fit: contain;
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.42)) drop-shadow(0 0 10px rgba(255, 212, 59, 0.3));
}

.wheel-result-popup .wheel-result-body {
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  max-height: min(46vh, 390px);
  max-height: min(46dvh, 390px);
  margin: 14px 0 0;
  padding: 0 4px 2px;
  overflow-y: auto;
  color: var(--nro-wheel-muted) !important;
  line-height: 1.55;
  scrollbar-color: rgba(255, 212, 59, 0.55) rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
}

.wheel-result-reward {
  display: grid;
  gap: 4px;
  padding: 14px;
  background: rgba(7, 32, 72, 0.72);
  border: 1px solid rgba(80, 178, 255, 0.28);
  border-radius: 14px;
}

.wheel-result-kicker,
.wheel-result-code span {
  color: #9fc8f3;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.wheel-result-reward-name {
  color: #ffffff;
  font-family: "Chakra Petch", sans-serif;
  font-size: 1.14rem;
  line-height: 1.4;
}

.wheel-result-quantity {
  color: var(--nro-wheel-gold-bright);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.wheel-result-instruction,
.wheel-result-support,
.wheel-result-notice {
  margin: 12px 0 0;
}

.wheel-result-support {
  color: #9fb0c9;
  font-size: 0.84rem;
}

.wheel-result-notice {
  padding: 10px 12px;
  color: #ffedb0;
  background: rgba(255, 155, 48, 0.11);
  border: 1px solid rgba(255, 184, 77, 0.3);
  border-radius: 10px;
}

.wheel-result-code {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(2, 10, 29, 0.58);
  border: 1px solid rgba(255, 212, 59, 0.25);
  border-radius: 10px;
}

.wheel-result-code code {
  color: #fff1a8;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  user-select: text;
}

.wheel-result-popup .swal2-actions {
  flex: 0 0 auto;
  width: 100%;
  margin: 18px 0 0;
}

.wheel-result-popup .wheel-result-close {
  display: inline-flex;
  width: min(100%, 230px);
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 11px 24px;
  touch-action: manipulation;
  color: #111827 !important;
  cursor: pointer;
  background: linear-gradient(135deg, var(--nro-wheel-gold-bright), var(--nro-wheel-gold) 52%, var(--nro-wheel-orange)) !important;
  border: 1px solid rgba(255, 255, 255, 0.48) !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 24px rgba(255, 138, 31, 0.24) !important;
  font: 800 1rem/1 "Chakra Petch", sans-serif;
  transition: filter 180ms ease, transform 180ms ease;
}

.wheel-result-popup .wheel-result-close:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.wheel-result-popup .wheel-result-close:active {
  filter: brightness(0.98);
  transform: translateY(0) scale(0.98);
}

.wheel-result-popup .wheel-result-close:focus-visible {
  outline: 3px solid #ffffff !important;
  outline-offset: 3px !important;
}

.wheel-history-panel {
  margin-top: 28px;
}

.wheel-history-table {
  min-width: 980px;
}

.wheel-history-table th:nth-child(1),
.wheel-history-table td:nth-child(1),
.wheel-history-table th:nth-child(4),
.wheel-history-table td:nth-child(4) {
  text-align: center;
}

.wheel-history-transaction {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.wheel-history-code {
  color: #fde68a;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.86rem;
  user-select: text;
}

.wheel-history-copy {
  min-height: 44px;
  padding: 8px 11px;
  color: #fff;
  cursor: pointer;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.68);
  border-radius: 7px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.wheel-history-copy:hover {
  background: rgba(245, 158, 11, 0.28);
  border-color: #fbbf24;
}

.wheel-history-copy:focus-visible,
.wheel-history-pagination a:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.wheel-history-copy-status {
  min-height: 22px;
  margin: 10px 0 0;
  color: #bfdbfe;
  font-size: 0.82rem;
  text-align: center;
}

.wheel-history-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.wheel-history-pagination a {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  color: #e8edf7;
  text-decoration: none;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
  font-weight: 800;
}

.wheel-history-pagination a:hover,
.wheel-history-pagination a.is-current {
  color: #111827;
  background: #fbbf24;
  border-color: #fde68a;
}

.wheel-history-panel .history-status.is-unknown {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.12);
}

@media (max-width: 520px) {
  .wheel-page {
    padding: 20px 10px 36px;
  }

  .wheel-shell {
    padding: 22px 10px 18px;
  }

  .wheel-shell .span11::after {
    border-width: 4px;
    box-shadow:
      0 0 0 3px rgba(7, 24, 57, 0.96),
      0 0 16px rgba(255, 212, 59, 0.22),
      0 6px 14px rgba(0, 0, 0, 0.4);
  }

  .wheel-shell .textinfo {
    width: min(100%, 310px);
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
  }

  .swal2-container.wheel-result-container {
    padding: 10px;
  }

  .swal2-popup.wheel-result-popup {
    width: min(100%, calc(100vw - 20px));
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    padding: 20px 14px 16px;
    border-radius: 16px !important;
  }

  .wheel-result-popup .wheel-result-image {
    width: 76px;
    height: 76px;
    margin-top: 12px;
  }

  .wheel-result-popup .wheel-result-body {
    max-height: 43vh;
    max-height: 43dvh;
  }

  .wheel-history-panel {
    margin-top: 20px;
  }

  .wheel-history-transaction {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wheel-shell .wheel {
    transition-duration: 0.01ms;
  }

  .wheel-shell .wheel-reward-content {
    transition-duration: 0.01ms, 0.01ms;
  }

  .wheel-shell .butt11,
  .wheel-result-popup .wheel-result-close,
  .wheel-shell .span11::before {
    transition: none;
  }

  .wheel-shell .butt11::after,
  .wheel-shell .wheel li.is-winner .wheel-gift-icon,
  .wheel-result-popup.swal2-show,
  .wheel-result-popup.swal2-hide {
    animation: none !important;
  }
}
