:root {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-card: rgba(255, 255, 255, 0.05);
  --accent-blue: #0088cc;
  --accent-purple: #7b61ff;
  --gold: #f5c542;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --border: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 800px at 20% 0%, var(--bg-secondary), var(--bg-primary));
  color: var(--text-primary);
  overflow-x: hidden;
}

.app {
  min-height: 100vh;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 14px 10px;
}

.user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.avatar,
.center-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  object-fit: cover;
}

.center-avatar {
  width: 70px;
  height: 70px;
  border: 1px solid rgba(245, 197, 66, 0.45);
  box-shadow: 0 0 22px rgba(245, 197, 66, 0.18);
}

.user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-size: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.segmented {
  display: flex;
  gap: 8px;
  padding: 6px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.seg-btn {
  border: 0;
  outline: 0;
  cursor: pointer;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 650;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  min-height: 42px;
  transition: background 180ms ease, color 180ms ease, transform 120ms ease;
}

.seg-btn-active {
  background: linear-gradient(135deg, rgba(0, 136, 204, 0.25), rgba(123, 97, 255, 0.25));
  color: var(--accent-blue);
  box-shadow: 0 0 0 1px rgba(0, 136, 204, 0.22) inset;
}

.seg-btn:active {
  transform: scale(0.98);
}

.content {
  padding: 0 14px calc(16px + env(safe-area-inset-bottom));
}

.view {
  display: none;
  animation: viewIn 220ms ease both;
}

.view-active {
  display: block;
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0px);
  }
}

.wheel-area {
  padding-top: 8px;
}

.wheel-stack {
  position: relative;
  width: min(390px, 100%);
  margin: 14px auto 12px;
  aspect-ratio: 1 / 1;
}

.wheel-canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 999px;
  filter: drop-shadow(0 18px 50px rgba(0, 0, 0, 0.35));
}

.wheel-tgs-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform-origin: 50% 50%;
}

.wheel-tgs-layer lottie-player {
  opacity: 0.55;
  filter: saturate(0.95) brightness(0.95);
}

.wheel-arrow {
  position: absolute;
  left: 50%;
  top: -4px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-bottom: 22px solid var(--gold);
  filter: drop-shadow(0 10px 18px rgba(245, 197, 66, 0.22));
}

.wheel-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 86px;
  height: 86px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 38px rgba(0, 136, 204, 0.12);
}

.roll-btn {
  width: 100%;
  border: 0;
  cursor: pointer;
  border-radius: 18px;
  min-height: 54px;
  margin-top: 14px;
  padding: 0 16px;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  box-shadow: 0 14px 40px rgba(0, 136, 204, 0.18);
  transition: transform 120ms ease, filter 180ms ease;
}

.roll-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

.roll-btn:active:not(:disabled) {
  transform: scale(0.97);
  filter: brightness(0.82);
}

.banner {
  margin: 14px auto 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  max-width: 520px;
}

.banner-error {
  color: rgba(255, 160, 160, 0.95);
}

.banner-loading {
  color: rgba(255, 255, 255, 0.75);
}

.hidden {
  display: none !important;
}

.inventory-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
}

.inventory-title {
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 0.2px;
}

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

.gift-card {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  padding: 10px;
  position: relative;
  overflow: hidden;
}

.gift-card:before {
  content: "";
  position: absolute;
  inset: -40px;
  background: radial-gradient(circle at 30% 20%, rgba(0, 136, 204, 0.18), transparent 55%);
  pointer-events: none;
}

.gift-inner {
  position: relative;
}

.gift-lottie {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gift-lottie lottie-player {
  width: 86px;
  height: 86px;
  opacity: 0.95;
}

.gift-name {
  margin-top: 8px;
  font-weight: 800;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  min-height: 36px;
  line-height: 1.15;
}

.status-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.status-pill {
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-weight: 750;
}

.status-available {
  color: rgba(120, 255, 180, 0.95);
  background: rgba(120, 255, 180, 0.08);
}

.status-requested {
  color: rgba(255, 220, 120, 0.95);
  background: rgba(255, 220, 120, 0.08);
}

.status-received {
  color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.05);
}

.nft-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  border-radius: 999px;
  padding: 7px 10px;
  font-weight: 900;
  font-size: 12px;
  color: #2b1f00;
  background: linear-gradient(135deg, #ffd87a, var(--gold));
  box-shadow: 0 0 18px rgba(245, 197, 66, 0.22);
}

.claim-btn {
  width: 100%;
  margin-top: 10px;
  border: 0;
  cursor: pointer;
  min-height: 48px;
  border-radius: 14px;
  font-weight: 900;
  color: white;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
}

.claim-btn:active {
  transform: scale(0.98);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 50;
}

.modal-card {
  width: min(460px, 100%);
  border-radius: 22px;
  background: rgba(26, 26, 46, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 16px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.6);
}

.success-gift-anim {
  width: 140px;
  height: 140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-gift-anim lottie-player {
  width: 120px;
  height: 120px;
}

.success-text {
  margin-top: 8px;
  text-align: center;
  font-weight: 900;
  line-height: 1.25;
}

.success-btn {
  width: 100%;
  margin-top: 14px;
  border: 0;
  min-height: 54px;
  border-radius: 18px;
  font-weight: 900;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: white;
}

