/* 抽奖中心 · 九宫格 · 幸运红粉 */

.lot-page.lot-grid {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #eef4fc 0%, #f5f0f8 42%, #faf8fc 100%);
  overflow-x: hidden;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

.lot-grid-topbar .lot-grid-back {
  width: 36px;
  height: 36px;
  line-height: 34px;
  text-align: center;
  font-size: 28px;
  color: #5c2030;
  text-decoration: none;
}

.lot-grid-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 8px;
}

.lot-grid-top-title {
  flex: 1;
  margin: 0;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  color: #5c2030;
}

.lot-grid-top-actions {
  display: flex;
  gap: 10px;
  min-width: 72px;
  justify-content: flex-end;
}

.lot-grid-top-link {
  border: none;
  background: transparent;
  color: #8b4050;
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
}

.lot-grid-stage-title {
  margin-bottom: 12px;
}

.lot-grid-stage-title h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  color: #6b1f32;
}

.lot-grid-stage-title--tasks {
  margin-top: 4px;
}

.lot-grid-chance {
  margin: 6px 0 0;
  font-size: 12px;
  color: #9a5060;
}

.lot-grid--celebrate {
  animation: lot-grid-flash 0.45s ease;
}
@keyframes lot-grid-flash {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.04);
  }
}

/* ── 蓝色顶区 ── */
.lot-grid-hero-wrap {
  position: relative;
  flex-shrink: 0;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 20px;
  overflow: hidden;
  background: linear-gradient(145deg, #0d5fcc 0%, #1d84ff 48%, #4da3ff 100%);
  color: #fff;
}

.lot-grid-hero-pattern {
  position: absolute;
  top: -48px;
  right: -32px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.lot-grid-hero-pattern::after {
  content: '';
  position: absolute;
  bottom: -90px;
  left: -120px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.lot-grid-nav {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 14px;
}

.lot-grid-back {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  line-height: 34px;
  text-align: center;
  font-size: 28px;
  color: #fff;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.lot-grid-nav-center {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.lot-grid-brand {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.88);
}

.lot-grid-nav-title {
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #fff;
  font-family: var(--app-display, sans-serif);
}

.lot-grid-nav-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.lot-grid-pill {
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.lot-grid-hero-copy {
  position: relative;
  text-align: center;
  padding: 0 8px 14px;
}

.lot-grid-hero-tag {
  margin: 0 auto 8px;
  display: inline-block;
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.1);
}

.lot-grid-hero-title {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
  line-height: 1.2;
  color: #fff;
  text-shadow: 0 2px 10px rgba(13, 95, 204, 0.35);
  font-family: var(--app-display, sans-serif);
}

.lot-grid-hero-sub {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.9);
}

.lot-grid-stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.lot-grid-stat {
  padding: 10px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  text-align: center;
}

.lot-grid-stat--main {
  background: rgba(255, 255, 255, 0.2);
}

.lot-grid-stat--accent .v {
  color: #fff5cc;
}

.lot-grid-stat .k {
  display: block;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 4px;
}

.lot-grid-stat .v {
  display: block;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
  font-family: var(--app-display, sans-serif);
}

.lot-grid-stat .v.sm {
  font-size: 13px;
  font-weight: 700;
}

.lot-grid-stat .v small {
  margin-left: 1px;
  font-size: 12px;
  font-weight: 600;
}

/* ── 主体 ── */
.lot-grid-body {
  flex: 1;
  padding: 4px 14px 16px;
}

.lot-grid-ticker-card {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(29, 132, 255, 0.08);
}

.lot-grid-ticker-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 800;
  color: #1d84ff;
}

.lot-grid-ticker-hd .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1d84ff;
  box-shadow: 0 0 0 3px rgba(29, 132, 255, 0.2);
  animation: lot-grid-pulse 1.4s ease infinite;
}

@keyframes lot-grid-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.lot-grid-ticker-viewport {
  overflow: hidden;
  position: relative;
}

.lot-grid-ticker-list {
  margin: 0;
  padding: 0;
  list-style: none;
  will-change: transform;
}

.lot-grid-ticker-list--anim {
  transition: transform 0.48s ease;
}

.lot-grid-ticker-list li {
  font-size: 12px;
  line-height: 24px;
  height: 24px;
  color: #555;
  padding: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lot-grid-stage-hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.lot-grid-stage-hd h2,
.lot-grid-tasks .lot-grid-stage-hd h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #1a2a3a;
  font-family: var(--app-display, sans-serif);
}

.lot-grid-stage-hd span {
  flex-shrink: 0;
  font-size: 11px;
  color: #8a96a8;
}

.lot-grid-board {
  margin-bottom: 8px;
}

.lot-grid-board.spinning .lot-grid-matrix {
  box-shadow:
    0 8px 28px rgba(220, 80, 110, 0.16),
    0 0 0 1px rgba(220, 80, 110, 0.1);
}

.lot-grid-matrix {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 6px 22px rgba(120, 40, 70, 0.08);
  border: 1px solid rgba(220, 120, 140, 0.15);
}

.lot-grid-cell {
  aspect-ratio: 1;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff 0%, #fff5f8 100%);
  border: 1px solid rgba(230, 160, 175, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 4px;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    border-color 0.12s ease,
    background 0.12s ease;
}

.lot-grid-cell.active {
  transform: scale(1.03);
  border-color: #e84a6a;
  background: linear-gradient(180deg, #ffe8ee 0%, #ffd4df 100%);
  box-shadow:
    0 0 0 2px rgba(232, 74, 106, 0.35),
    0 4px 14px rgba(220, 60, 90, 0.2);
}

.lot-grid-cell.win {
  animation: lot-grid-win 0.6s ease infinite alternate;
}

@keyframes lot-grid-win {
  from {
    box-shadow: 0 0 0 2px rgba(77, 163, 255, 0.45), 0 4px 16px rgba(29, 132, 255, 0.25);
  }
  to {
    box-shadow: 0 0 0 3px rgba(29, 132, 255, 0.65), 0 6px 20px rgba(13, 95, 204, 0.35);
  }
}

.lot-grid-icon {
  font-size: 26px;
  line-height: 1;
}

.lot-grid-label {
  font-size: 10px;
  line-height: 1.25;
  text-align: center;
  color: #2a3a4f;
  font-weight: 600;
  max-width: 100%;
  padding: 0 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lot-grid-cell--hub {
  border: none;
  background: transparent;
  padding: 0;
}

.lot-grid-draw {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  color: #fff;
  background: linear-gradient(145deg, #ff6b8a 0%, #e83a5c 52%, #c91f45 100%);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.35),
    0 6px 18px rgba(200, 40, 70, 0.35);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.lot-grid-draw.ready:active {
  transform: scale(0.97);
}

.lot-grid-draw:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: 0 2px 8px rgba(13, 95, 204, 0.15);
}

.lot-grid-draw.busy {
  opacity: 0.92;
}

.lot-grid-draw-main {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.lot-grid-draw-sub {
  font-size: 10px;
  opacity: 0.9;
}

.lot-grid-board-tip {
  margin: 8px 4px 0;
  font-size: 11px;
  color: #8a96a8;
  line-height: 1.4;
}

/* ── 任务 ── */
.lot-grid-tasks {
  margin-top: 18px;
}

.lot-grid-task-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(15, 40, 80, 0.06);
  overflow: hidden;
}

.lot-grid-task-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #f5e8ed;
}

.lot-grid-task-list li:last-child {
  border-bottom: none;
}

.lot-grid-task-list li.done .task-reward {
  color: #9a8a90;
}

.lot-grid-task-list .task-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: #3a2830;
  font-weight: 600;
}

.lot-grid-task-list .task-reward {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 800;
  color: #e83a5c;
}

.lot-grid-traits {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 12px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.lot-grid-traits li {
  font-size: 11px;
  color: #8a96a8;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(29, 132, 255, 0.06);
  border: 1px solid rgba(29, 132, 255, 0.1);
}

/* ── 弹层 ── */
.lot-grid-popup-inner {
  padding: 16px 18px calc(20px + env(safe-area-inset-bottom, 0px));
}

.lot-grid-popup-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.lot-grid-popup-hd h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #1a2a3a;
}

.lot-grid-popup-hd .close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #eef2f8;
  font-size: 20px;
  line-height: 1;
  color: #667788;
  cursor: pointer;
}

.lot-grid-popup-rules {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.55;
  color: #444;
}

.lot-grid-popup-rules li + li {
  margin-top: 8px;
}

.lot-grid-record-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 50vh;
  overflow-y: auto;
}

.lot-grid-record-list li {
  padding: 10px 0;
  border-bottom: 1px solid #eef2f8;
  font-size: 13px;
  color: #555;
  line-height: 1.45;
}

.lot-grid-popup-empty {
  margin: 0;
  padding: 24px 0;
  text-align: center;
  color: #999;
  font-size: 14px;
}
