@font-face {
  font-family: "Vazirmatn";
  src: url("/static/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-main: "Vazirmatn", system-ui, -apple-system, "Segoe UI", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  --bg: #0a0c12;
  --bg-2: #0f141d;
  --glass: rgba(18, 25, 38, 0.65);
  --glass-strong: rgba(18, 25, 38, 0.82);
  --ink: #e8edf6;
  --muted: #a7b1c2;
  --accent: #56d2b8;
  --line: rgba(255, 255, 255, 0.08);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-main);
  background:
    radial-gradient(800px 500px at 10% -10%, rgba(63, 188, 167, 0.18), transparent),
    radial-gradient(900px 600px at 100% 0%, rgba(92, 124, 255, 0.16), transparent),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  color: var(--ink);
  min-height: 100vh;
}

body.modal-open {
  overflow: hidden;
}

.has-bottom-nav .wrap {
  padding-bottom: 120px;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.title {
  font-size: 20px;
  font-weight: 600;
  margin: 8px 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.banner {
  margin: 10px 0 14px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(600px 220px at 0% 0%, rgba(86, 210, 184, 0.14), transparent 55%),
    radial-gradient(520px 220px at 100% 0%, rgba(92, 124, 255, 0.14), transparent 60%),
    var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(14px);
}

.banner::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(86, 210, 184, 0.55), rgba(92, 124, 255, 0.50), rgba(239, 71, 111, 0.35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.85;
}

.banner::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(86, 210, 184, 0.9), rgba(92, 124, 255, 0.9));
  opacity: 0.9;
}

.banner-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.banner-text {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink);
  white-space: pre-wrap;
}

.banner-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.22);
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.banner-close:active {
  transform: scale(0.96);
}

.banner-link {
  margin-top: 10px;
  width: 100%;
  border: 1px solid rgba(86, 210, 184, 0.40);
  background: linear-gradient(135deg, rgba(86, 210, 184, 0.22), rgba(92, 124, 255, 0.16));
  color: #bdf7ea;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 120ms ease, filter 120ms ease;
}

.banner-link:active {
  transform: scale(0.99);
}

.badge {
  font-size: 12px;
  color: #071014;
  background: var(--accent);
  padding: 4px 8px;
  border-radius: 999px;
}

.list {
  display: grid;
  gap: 12px;
}

.card {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.name {
  font-size: 16px;
  font-weight: 600;
}

.server {
  font-size: 12px;
  color: var(--muted);
}

.meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.pill {
  background: var(--glass-strong);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}

.loading {
  color: var(--muted);
  font-size: 12px;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--glass);
  backdrop-filter: blur(12px);
}

.error {
  color: #ff9b9b;
  background: rgba(80, 12, 12, 0.55);
  border: 1px solid rgba(255, 155, 155, 0.25);
  padding: 10px 12px;
  border-radius: 12px;
  margin-top: 12px;
  font-size: 12px;
  backdrop-filter: blur(12px);
}

.back-btn {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  margin-bottom: 12px;
  font-weight: 600;
}

.detail-card {
  margin-top: 8px;
}

.detail-section {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--glass-strong);
}

.configs-area {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.cfg-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 10px;
  background: rgba(0, 0, 0, 0.18);
}

.cfg-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cfg-value {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  word-break: break-word;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px 10px;
  border-radius: 10px;
}

.cfg-text {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 12px;
  border-radius: 10px;
  overflow: auto;
  max-height: 260px;
}

.actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.top-actions {
  display: flex;
  margin: 8px 0 12px;
  gap: 8px;
  flex-wrap: wrap;
}

.input {
  width: 100%;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  outline: none;
}

.input.textarea {
  min-height: 110px;
  resize: vertical;
  white-space: pre-wrap;
}

.ticket-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.ticket-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 12px;
  background: rgba(0, 0, 0, 0.18);
  cursor: pointer;
}

.ticket-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.ticket-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 520px;
}

.ticket-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.ticket-status {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.ticket-status.status-open {
  border-color: rgba(86, 210, 184, 0.35);
  background: rgba(86, 210, 184, 0.10);
  color: #baf6ea;
}

.ticket-status.status-in_review {
  border-color: rgba(255, 196, 46, 0.40);
  background: rgba(255, 196, 46, 0.12);
  color: rgba(255, 229, 155, 0.98);
}

.ticket-status.status-answered {
  border-color: rgba(92, 124, 255, 0.40);
  background: rgba(92, 124, 255, 0.12);
  color: rgba(200, 210, 255, 0.98);
}

.ticket-status.status-closed {
  border-color: rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding: 8px 4px;
}

.msg {
  max-width: 92%;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.18);
}

.msg.me {
  margin-right: auto;
  border-color: rgba(86, 210, 184, 0.28);
  background: linear-gradient(135deg, rgba(86, 210, 184, 0.18), rgba(86, 210, 184, 0.06));
}

.msg.them {
  margin-left: auto;
}

.msg-tag {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}

.msg-text {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.7;
  word-break: break-word;
}

.msg-ts {
  margin-top: 6px;
  font-size: 11px;
  color: rgba(255,255,255,0.55);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 28px));
  z-index: 50;
  display: flex;
  gap: 8px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(18, 25, 38, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.bottom-nav .action-btn {
  flex: 1;
  text-align: center;
  border-radius: 14px;
  padding: 9px 8px;
  font-size: 11px;
}

.action-btn {
  border: 1px solid rgba(86, 210, 184, 0.35);
  background: linear-gradient(135deg, rgba(86, 210, 184, 0.25), rgba(86, 210, 184, 0.08));
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
}

.action-btn:disabled {
  opacity: 0.55;
  cursor: default;
  filter: saturate(0.7);
}

.renew-btn {
  margin-right: 8px;
  margin-bottom: 8px;
}

.wheel-btn {
  border: 1px solid rgba(255, 196, 84, 0.45);
  background: linear-gradient(135deg, rgba(255, 196, 84, 0.35), rgba(255, 122, 0, 0.12));
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.4px;
  box-shadow: 0 10px 24px rgba(255, 180, 60, 0.12);
}

.ninja-btn {
  border: 1px solid rgba(255, 107, 107, 0.45);
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.35), rgba(255, 61, 94, 0.12));
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(255, 90, 120, 0.10);
}

.ninja-stage {
  margin-top: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0.42) 100%),
    url("/static/background-ninja.jpg") center/cover no-repeat;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.ninja-canvas {
  display: block;
  width: 100%;
  height: 420px;
  touch-action: none;
}

.ninja-stage-result {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  text-align: center;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.2px;
  color: rgba(255, 255, 255, 0.98);
  background: radial-gradient(circle at 50% 45%, rgba(0,0,0,0.12) 0%, rgba(0,0,0,0.56) 70%, rgba(0,0,0,0.72) 100%);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  pointer-events: none;
}

.ninja-stage-result.win {
  background: radial-gradient(circle at 50% 45%, rgba(25, 90, 70, 0.18) 0%, rgba(10, 60, 45, 0.62) 72%, rgba(0,0,0,0.72) 100%);
}

.ninja-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,0.0) 35%, rgba(0,0,0,0.40) 100%);
}

.ninja-overlay > * { pointer-events: auto; }

.ninja-ov-title {
  font-size: 16px;
  font-weight: 800;
}

.ninja-ov-sub {
  font-size: 12px;
  color: var(--muted);
}

.ninja-result {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.22);
  font-size: 12px;
}

.ninja-result.win {
  border-color: rgba(86, 210, 184, 0.35);
  background: rgba(20, 70, 55, 0.35);
}

@media (max-width: 420px) {
  .ninja-canvas { height: 360px; }
}

.wheel-page .wrap {
  max-width: 640px;
}

.mystery-page .wrap {
  max-width: 640px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.mystery-wrap {
  position: relative;
  display: grid;
  place-items: center;
  margin-top: 12px;
  gap: 14px;
  padding: 10px 0 4px;
  isolation: isolate;
  flex: 1;
  min-height: 280px;
}

.mystery-scene {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 0;
}

.mystery-stars {
  position: absolute;
  inset: 0;
}

.mystery-stars .star {
  position: absolute;
  width: 18px;
  height: 18px;
  background: rgba(255, 255, 255, 0.92);
  clip-path: polygon(50% 0%, 61% 34%, 98% 35%, 68% 57%, 79% 92%, 50% 72%, 21% 92%, 32% 57%, 2% 35%, 39% 34%);
  opacity: 0;
  filter: drop-shadow(0 6px 18px rgba(255,255,255,0.18));
}

.mystery-wrap.opening .mystery-stars .star,
.mystery-wrap.opened .mystery-stars .star {
  opacity: 1;
  animation: mystery-star-fade 700ms ease-out both;
}

@keyframes mystery-star-fade {
  0% { opacity: 0; }
  100% { opacity: 0.95; }
}

.mystery-stars .s1 { left: 14%; top: 46%; transform: rotate(6deg) scale(0.8); }
.mystery-stars .s2 { left: 24%; top: 36%; transform: rotate(-12deg) scale(1.0); }
.mystery-stars .s3 { left: 33%; top: 52%; transform: rotate(14deg) scale(0.7); }
.mystery-stars .s4 { left: 68%; top: 34%; transform: rotate(8deg) scale(1.05); }
.mystery-stars .s5 { left: 80%; top: 46%; transform: rotate(-8deg) scale(0.85); }
.mystery-stars .s6 { left: 60%; top: 54%; transform: rotate(16deg) scale(0.7); }
.mystery-stars .s7 { left: 46%; top: 30%; transform: rotate(-4deg) scale(0.65); }
.mystery-stars .s8 { left: 52%; top: 58%; transform: rotate(10deg) scale(0.55); }

.mystery-box {
  position: relative;
  width: min(360px, 72vmin, max(220px, calc(100vh - 260px)));
  aspect-ratio: 1 / 1;
  height: auto;
  filter: drop-shadow(0 20px 45px rgba(0,0,0,0.55));
  transform: translateZ(0);
  cursor: pointer;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

.mystery-box.disabled {
  pointer-events: none;
  opacity: 0.85;
  filter: drop-shadow(0 16px 32px rgba(0,0,0,0.45));
  cursor: not-allowed;
}

.mystery-box dotlottie-player {
  display: block;
  pointer-events: none;
  -webkit-tap-highlight-color: transparent;
  width: 100%;
  height: 100%;
}

.mystery-box:focus {
  outline: none;
}

body.user-tabbing .mystery-box:focus {
  box-shadow: 0 0 0 3px rgba(86, 210, 184, 0.35);
  border-radius: 22px;
}

.mystery-box dotlottie-player:focus {
  outline: none;
}

.mystery-box-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 150px;
  z-index: 2;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(19, 33, 56, 0.95) 0%, rgba(19, 33, 56, 0.95) 18px, rgba(19, 33, 56, 0.0) 18px),
    repeating-linear-gradient(
      90deg,
      rgba(233, 76, 116, 0.95) 0,
      rgba(233, 76, 116, 0.95) 32px,
      rgba(255, 208, 76, 0.95) 32px,
      rgba(255, 208, 76, 0.95) 64px
    ),
    radial-gradient(220px 160px at 30% 22%, rgba(255,255,255,0.26), transparent 60%),
    radial-gradient(320px 260px at 70% 90%, rgba(0,0,0,0.30), transparent 60%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,0.06),
    inset 0 -18px 30px rgba(0,0,0,0.22);
}

.mystery-box-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 14px;
  height: 84px;
  z-index: 3;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.0) 35%),
    linear-gradient(135deg, rgba(26, 42, 72, 1), rgba(12, 22, 45, 1));
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow:
    0 14px 26px rgba(0,0,0,0.30),
    inset 0 0 0 2px rgba(255,255,255,0.06),
    inset 0 -10px 18px rgba(0,0,0,0.25);
  transform-origin: center bottom;
}

.mystery-ribbon-v {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 22px;
  transform: translateX(-50%);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.0) 40%),
    linear-gradient(135deg, rgba(255, 196, 84, 0.98), rgba(236, 158, 26, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.12),
    0 10px 18px rgba(0,0,0,0.10);
}

.mystery-ribbon-h {
  position: absolute;
  left: 0;
  right: 0;
  top: 28px;
  height: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.0) 35%),
    linear-gradient(135deg, rgba(255, 196, 84, 0.98), rgba(236, 158, 26, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.12),
    0 10px 18px rgba(0,0,0,0.10);
}

.mystery-bow {
  position: absolute;
  left: 50%;
  top: -12px;
  width: 110px;
  height: 62px;
  transform: translateX(-50%);
  filter: drop-shadow(0 14px 18px rgba(0,0,0,0.25));
  background:
    radial-gradient(circle at 50% 56%, rgba(255, 216, 120, 1) 0 56%, rgba(214, 132, 14, 1) 57% 100%);
  background-size: 18px 18px;
  background-repeat: no-repeat;
  background-position: 50% 22px;
}

.mystery-bow::before,
.mystery-bow::after {
  content: "";
  position: absolute;
  top: 12px;
  width: 54px;
  height: 36px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.0) 45%),
    linear-gradient(135deg, rgba(255, 206, 96, 1), rgba(230, 145, 18, 1));
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12);
}

.mystery-bow::before {
  left: 0;
  transform: rotate(16deg);
}

.mystery-bow::after {
  right: 0;
  transform: rotate(-16deg);
}

.mystery-box-top .mystery-bow {
  left: 50%;
  top: -10px;
  transform: translateX(-50%);
}

.mystery-box-top .mystery-bow::before,
.mystery-box-top .mystery-bow::after {
  top: -6px;
}

.mystery-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16), rgba(255, 196, 84, 0.18), transparent 60%);
  filter: blur(1px);
  pointer-events: none;
  animation: mystery-pulse 1.9s ease-in-out infinite;
  z-index: 1;
}

@keyframes mystery-pulse {
  0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(0.98); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
}

.mystery-box.opening .mystery-box-top {
  animation: mystery-open 1.2s cubic-bezier(.08,.7,.12,1) forwards;
}

.mystery-box.opened .mystery-box-top {
  transform: translateY(-116px) rotate(-14deg);
}

@keyframes mystery-open {
  0% { transform: translateY(0) rotate(0deg); }
  55% { transform: translateY(-132px) rotate(-18deg); }
  100% { transform: translateY(-116px) rotate(-14deg); }
}

.mystery-result {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(86, 210, 184, 0.14);
  border: 1px solid rgba(86, 210, 184, 0.35);
  color: var(--ink);
  font-weight: 900;
  text-align: center;
  box-shadow: var(--shadow);
}

.wheel-wrap {
  position: relative;
  display: grid;
  place-items: center;
  margin-top: 18px;
  gap: 14px;
}

.wheel-frame {
  position: relative;
  width: 300px;
  height: 300px;
  display: grid;
  place-items: center;
}

.wheel {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  border: 10px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 0 0 6px rgba(255, 196, 84, 0.15),
    inset 0 0 18px rgba(0, 0, 0, 0.35),
    0 18px 40px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
}

.wheel-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.wheel-pointer {
  width: 0;
  height: 0;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 20px solid var(--accent);
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
}

.wheel-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
  pointer-events: none;
}

.wheel-label span {
  transform: translateY(-102px) rotate(90deg);
  display: inline-block;
  max-width: 90px;
  text-align: center;
  line-height: 1.1;
}

.spin-btn {
  border: 1px solid rgba(86, 210, 184, 0.35);
  background: linear-gradient(135deg, rgba(86, 210, 184, 0.35), rgba(86, 210, 184, 0.1));
  color: var(--ink);
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}

.spin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wheel-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.confetti {
  position: fixed;
  top: -10px;
  z-index: 9999;
  opacity: 0.9;
  animation: confetti-fall linear forwards;
  border-radius: 2px;
  pointer-events: none;
}

.confetti-big {
  filter: drop-shadow(0 0 8px rgba(255, 220, 120, 0.6));
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(110vh) rotate(360deg);
    opacity: 0;
  }
}


@media (max-width: 480px) {
  .wheel-frame {
    width: 240px;
    height: 240px;
  }
  .wheel {
    width: 240px;
    height: 240px;
  }
  .wheel-label {
    font-size: 11px;
  }
  .wheel-label span {
    transform: translateY(-95px) rotate(90deg);
  }

  .mystery-box {
    width: min(280px, 78vmin);
  }
}

.rings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

.ring-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.ring-wrap {
  position: relative;
  width: 120px;
  height: 120px;
}

.ring {
  width: 120px;
  height: 120px;
  transform: rotate(-90deg);
}

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  z-index: 2;
}

.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 10;
}

.ring-fg {
  fill: none;
  stroke: var(--accent);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 0;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.6s ease;
}

.ring-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ring-title {
  font-size: 12px;
  color: var(--muted);
}

.ring-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 12, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 9999;
  backdrop-filter: blur(6px);
}

.modal.open {
  display: flex;
}

.modal-card {
  width: min(520px, 100%);
  max-height: 80vh;
  overflow: auto;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 10px;
  left: 10px;
  border: 1px solid var(--line);
  background: var(--glass-strong);
  color: var(--ink);
  border-radius: 10px;
  padding: 4px 8px;
  cursor: pointer;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.modal-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

.modal-section {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--glass-strong);
}

.modal-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.modal-link {
  font-size: 12px;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
  color: var(--ink);
  margin-bottom: 10px;
  padding: 8px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.modal-btn {
  border: 1px solid rgba(86, 210, 184, 0.35);
  background: linear-gradient(135deg, rgba(86, 210, 184, 0.25), rgba(86, 210, 184, 0.08));
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}

/* Detail page overrides to ensure styles apply */
.detail-page .back-btn,
.detail-page .modal-btn {
  font-size: 13px;
  letter-spacing: 0.2px;
}

.detail-page .modal-link {
  display: block;
  max-width: 100%;
  white-space: normal;
  direction: ltr;
}

.modal-qr {
  width: 180px;
  max-width: 100%;
  height: auto;
  background: #fff;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

/* ---------- shop ---------- */
.shop-head {
  margin-top: 12px;
  margin-bottom: 12px;
}

.shop-head .shop-points {
  font-weight: 800;
  letter-spacing: 0.3px;
}

.shop-item .shop-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-start;
  gap: 8px;
}

.shop-item .shop-buy {
  border: 1px solid rgba(92, 124, 255, 0.35);
  background: linear-gradient(135deg, rgba(92, 124, 255, 0.30), rgba(92, 124, 255, 0.10));
}

.shop-item .shop-buy[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

.shop-modal-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.shop-sub-btn {
  width: 100%;
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* ---------- toast ---------- */
.toast-host {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 10000;
  display: grid;
  place-items: center;
  pointer-events: none;
  padding: 0 14px;
}

.toast {
  pointer-events: auto;
  max-width: 720px;
  width: 100%;
  background: rgba(12, 16, 24, 0.82);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition: opacity 220ms ease, transform 220ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast.error {
  border-color: rgba(255, 155, 155, 0.25);
  background: rgba(80, 12, 12, 0.62);
}

.toast.success {
  border-color: rgba(86, 210, 184, 0.35);
  background: rgba(10, 46, 40, 0.58);
}

.toast.info {
  border-color: rgba(92, 124, 255, 0.30);
  background: rgba(18, 28, 58, 0.58);
}

@media (max-width: 480px) {
  .modal-card {
    width: 100%;
    max-height: 85vh;
    padding: 14px;
  }
  .modal-qr {
    width: 140px;
  }
  .rings {
    grid-template-columns: 1fr;
  }
  .ring-card {
    grid-template-columns: 100px 1fr;
  }
  .ring-wrap,
  .ring {
    width: 100px;
    height: 100px;
  }
}
