/* 刮刮乐：卡种选择、购卡确认、刮奖卡面与开奖反馈 */

.scratch-balance {
  margin: 0 auto var(--ds-space-4, 16px);
  text-align: center;
  font-size: var(--ds-fs-secondary, 14px);
  color: var(--ds-text-secondary, #6b6b70);
}

.scratch-rules {
  max-width: 720px;
  margin: 0 auto var(--ds-space-4, 16px);
  text-align: center;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ds-text-tertiary, #8e8e93);
}

.scratch-period-hint {
  max-width: 720px;
  margin: -6px auto var(--ds-space-4, 16px);
  text-align: center;
  font-size: 12px;
  color: #2c7a4b;
}

.scratch-balance.login { color: var(--ds-text-tertiary, #8e8e93); }

.scratch-types {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  max-width: 900px;
  margin: 0 auto var(--ds-space-5, 20px);
}

.scratch-type {
  flex: 1 1 190px;
  max-width: 250px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px;
  border: 1px solid var(--ds-border, rgba(0, 0, 0, 0.1));
  border-radius: 16px;
  background: var(--ds-bg, #fff);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.scratch-type:hover { transform: translateY(-2px); }

.scratch-type.active {
  border-color: #e0342b;
  box-shadow: 0 0 0 2px rgba(224, 52, 43, 0.16), 0 8px 22px rgba(190, 30, 26, 0.12);
}

.scratch-type-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ds-text, #1d1d1f);
}

.scratch-type-price { font-size: 13px; font-weight: 600; color: #d92b23; }
.scratch-type-odds { font-size: 12px; color: var(--ds-text-tertiary, #8e8e93); }
.scratch-type-stock { font-size: 12px; color: #2c7a4b; font-variant-numeric: tabular-nums; }
.scratch-type.soldout { opacity: 0.62; }
.scratch-type.soldout .scratch-type-stock { color: var(--ds-text-tertiary, #8e8e93); }

.scratch-actions { text-align: center; margin-bottom: var(--ds-space-3, 12px); }

/* ===== 购卡确认 ===== */
.scratch-confirm { text-align: left; }
.scratch-confirm-body { display: flex; flex-direction: column; gap: 10px; margin-bottom: var(--ds-space-4, 16px); }
.scratch-confirm-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; font-size: 14px; color: var(--ds-text-secondary, #6b6b70); }
.scratch-confirm-row b { color: var(--ds-text, #1d1d1f); }
.scratch-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ===== 刮奖弹窗 ===== */
.scratch-play { width: min(420px, 94vw); max-height: 92vh; overflow-y: auto; text-align: center; }
.scratch-play h3 { text-align: center; }

.scratch-card {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  margin: 4px auto 12px;
  padding: 11px;
  border-radius: 18px;
  background: linear-gradient(135deg, #ef5a4d 0%, #c0181d 42%, #a80f16 60%, #e8b545 100%);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.32);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.scratch-card-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
  padding: 14px;
  min-height: 292px;
  border-radius: 12px;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(255, 214, 122, 0.28), rgba(255, 255, 255, 0) 62%),
    linear-gradient(180deg, #fffdf6 0%, #fff4de 100%);
}

.scratch-target { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }

.scratch-targets { display: inline-flex; gap: 6px; }

.scratch-label { font-size: 12px; letter-spacing: 0.12em; color: #96631a; }

.scratch-target-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  background: radial-gradient(circle at 32% 26%, #ff8a7f, #bd1420 74%);
  box-shadow: inset -4px -6px 10px rgba(0, 0, 0, 0.3), 0 6px 14px rgba(150, 20, 24, 0.28);
}

.scratch-cells {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  flex: 1;
}

.scratch-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: 10px;
  border: 1px dashed #e3cfa6;
  background: #fff;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.scratch-cell-n { font-size: 20px; font-weight: 800; color: #3a2b1a; font-variant-numeric: tabular-nums; }
.scratch-cell-p { font-size: 11px; color: #bd7a13; }

.scratch-cell-sym {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  box-shadow: inset -3px -5px 8px rgba(0, 0, 0, 0.28), 0 3px 7px rgba(0, 0, 0, 0.2);
}

.scratch-cell-sym.red { background: radial-gradient(circle at 32% 26%, #ff6f62, #b11017 74%); }
.scratch-cell-sym.lantern { background: radial-gradient(circle at 32% 26%, #ffd873, #b56a00 74%); font-size: 11px; }

.scratch-cell.hit {
  border-color: #e6b23c;
  background: linear-gradient(180deg, #fff7d6, #ffe08a);
  box-shadow: 0 0 18px rgba(230, 178, 60, 0.55);
  animation: scratch-hit 0.6s ease;
}

@keyframes scratch-hit {
  0% { transform: scale(0.92); }
  55% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.scratch-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  cursor: crosshair;
  touch-action: none;
  transition: opacity 0.45s ease;
}

.scratch-canvas.cleared { opacity: 0; pointer-events: none; }

.scratch-lucky {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px dashed #e3cfa6;
  background: rgba(255, 255, 255, 0.7);
}

.scratch-lucky[hidden] { display: none; }

.scratch-lucky-label { font-size: 12px; letter-spacing: 0.12em; color: #96631a; }
.scratch-lucky-value { font-size: 14px; font-weight: 700; color: #bd7a13; }

.scratch-lucky-value.hit {
  padding: 2px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff3c4, #ffe08a);
  box-shadow: 0 0 14px rgba(230, 178, 60, 0.55);
}

.scratch-progress {
  min-height: 18px;
  font-size: 12.5px;
  color: var(--ds-text-tertiary, #8e8e93);
}

.scratch-result {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.35s ease, margin 0.35s ease;
}

.scratch-result.show { max-height: 130px; opacity: 1; margin: 10px 0 4px; }

.scratch-result-title { font-size: 18px; font-weight: 700; }
.scratch-result.win .scratch-result-title { color: #d92b23; }
.scratch-result.lose .scratch-result-title { color: var(--ds-text, #1d1d1f); }
.scratch-result.win .scratch-result-sub { color: #b0650f; }
.scratch-result-sub { margin-top: 4px; font-size: 13px; color: var(--ds-text-secondary, #6b6b70); }

.scratch-play-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

/* ===== 我的刮刮卡 ===== */
.scratch-list { display: flex; flex-direction: column; gap: 8px; }

.scratch-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--ds-border, rgba(0, 0, 0, 0.08));
  background: var(--ds-bg, #fff);
}

.scratch-item.won {
  border-color: rgba(230, 178, 60, 0.6);
  background: linear-gradient(90deg, rgba(255, 224, 138, 0.18), rgba(255, 255, 255, 0));
}

.scratch-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.scratch-item-name { font-size: 14px; font-weight: 600; color: var(--ds-text, #1d1d1f); }
.scratch-item-cost { font-size: 12px; color: var(--ds-text-tertiary, #8e8e93); }

.scratch-item-side { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.scratch-item-status { font-size: 12.5px; color: var(--ds-text-secondary, #6b6b70); }
.scratch-item.won .scratch-item-status { color: #b0650f; font-weight: 600; }

.scratch-item-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 999px;
  background: #d92b23;
  color: #fff;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.scratch-item-btn:hover { background: #bf1f19; }
.scratch-item-btn:active { transform: scale(0.96); }
.scratch-item-btn.ghost { background: rgba(0, 0, 0, 0.06); color: var(--ds-text, #1d1d1f); }

@media (max-width: 480px) {
  .scratch-card { padding: 9px; }
  .scratch-card-inner { min-height: 258px; padding: 11px; gap: 10px; }
  .scratch-target-num { width: 46px; height: 46px; font-size: 21px; }
  .scratch-cell-n { font-size: 18px; }
  .scratch-type { flex: 1 1 100%; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .scratch-type, .scratch-canvas, .scratch-result, .scratch-cell.hit { transition: none !important; animation: none !important; }
}
