/* 阿薩拉牌盒收集 — 對齊官網色票 */

:root {
  --qe-brand: #00d4ff;
  --qe-brand-dim: rgba(0, 212, 255, 0.14);
  --qe-accent: #b24bff;
  --qe-bg: #050505;
  --qe-surface: #111827;
  --qe-surface-2: #1f2937;
  --qe-text: #f3f4f6;
  --qe-muted: #9ca3af;
  --qe-border: rgba(255, 255, 255, 0.1);
  --qe-radius: 12px;
  --qe-font: "Segoe UI", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --g2: #188D14;
  --g3: #658BCE;
  --g4: #9b61c8;
  --g5: #e8a64e;
  --g6: #cb464a;
}

*, *::before, *::after { box-sizing: border-box; }

body.ac-body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0, 212, 255, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(178, 75, 255, 0.08), transparent 50%),
    var(--qe-bg);
  color: var(--qe-text);
  font-family: var(--qe-font);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

.ac-wrap {
  width: min(100%, 56rem);
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.ac-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.ac-top h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.ac-top a {
  color: var(--qe-muted);
  text-decoration: none;
  font-size: 0.875rem;
}
.ac-top a:hover { color: var(--qe-brand); }

.ac-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}
.ac-btn {
  border: 1px solid var(--qe-border);
  background: var(--qe-surface);
  color: var(--qe-text);
  border-radius: 8px;
  padding: 0.4rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.ac-btn:hover { border-color: var(--qe-brand); background: var(--qe-surface-2); }
.ac-btn:active { transform: translateY(1px); }
.ac-btn--primary {
  background: linear-gradient(135deg, rgba(0,212,255,0.25), rgba(178,75,255,0.25));
  border-color: rgba(0, 212, 255, 0.35);
  color: #fff;
}
.ac-btn--ghost { background: transparent; }
.ac-mode {
  display: inline-flex;
  gap: 0.35rem;
  margin-left: auto;
  align-items: center;
}
.ac-mode__label {
  font-size: 0.75rem;
  color: var(--qe-muted);
}
.ac-mode__tab {
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid var(--qe-border);
  background: var(--qe-surface-2);
  color: var(--qe-muted);
  cursor: pointer;
}
.ac-mode__tab.is-active {
  color: #041016;
  background: var(--qe-brand);
  border-color: transparent;
}

.ac-help {
  display: none;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--qe-radius);
  background: var(--qe-brand-dim);
  border: 1px solid rgba(0, 212, 255, 0.2);
  font-size: 0.75rem;
  line-height: 1.7;
  color: var(--qe-muted);
}
.ac-help.is-open { display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; }
.ac-help b { color: var(--qe-text); }

.ac-progress {
  background: var(--qe-surface);
  border: 1px solid var(--qe-border);
  border-radius: var(--qe-radius);
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}
.ac-progress__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.ac-progress__title { font-size: 1.05rem; font-weight: 700; }
.ac-progress__num {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--qe-brand);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ac-progress__num.is-done { color: #34d399; }
.ac-bar {
  height: 0.5rem;
  background: var(--qe-surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.ac-bar__fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--qe-brand), var(--qe-accent));
  border-radius: 999px;
  transition: width 0.3s ease;
}

.ac-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.ac-group {
  width: calc((100% - 0.75rem) / 2);
  background: var(--qe-surface);
  border: 1px solid var(--qe-border);
  border-radius: var(--qe-radius);
  padding: 0.85rem;
}
.ac-group__hd {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.ac-group__name {
  font-size: 0.95rem;
  font-weight: 700;
  min-width: 1.5rem;
}
.ac-group__st {
  font-size: 0.75rem;
  color: var(--qe-muted);
  flex: 1;
}
.ac-group__ok {
  font-size: 0.85rem;
  color: #34d399;
  font-weight: 700;
}
.ac-cards {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.ac-card {
  flex: 1;
  max-width: 4.75rem;
  min-width: 3.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  opacity: 0.45;
  cursor: pointer;
  transition: opacity 0.15s;
  user-select: none;
  border: none;
  background: transparent;
  padding: 0;
  color: inherit;
}
.ac-card:hover { opacity: 0.7; }
.ac-card.is-on { opacity: 1; }
.ac-card__img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  padding: 0.3rem;
  background: var(--qe-surface-2);
  border: 2px solid var(--qe-border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ac-card__img img {
  width: 80%;
  height: 80%;
  object-fit: contain;
  pointer-events: none;
}
.ac-card.is-on .ac-card__img.g2 { border-color: var(--g2); }
.ac-card.is-on .ac-card__img.g3 { border-color: var(--g3); }
.ac-card.is-on .ac-card__img.g4 { border-color: var(--g4); }
.ac-card.is-on .ac-card__img.g5 { border-color: var(--g5); }
.ac-card.is-on .ac-card__img.g6 { border-color: var(--g6); }
.ac-card__lb {
  font-size: 0.65rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  color: var(--qe-muted);
}
.ac-card.is-on .ac-card__lb { color: var(--qe-text); }
.ac-card.is-on .ac-card__lb.tc2 { color: var(--g2); }
.ac-card.is-on .ac-card__lb.tc3 { color: var(--g3); }
.ac-card.is-on .ac-card__lb.tc4 { color: var(--g4); }
.ac-card.is-on .ac-card__lb.tc5 { color: var(--g5); }
.ac-card.is-on .ac-card__lb.tc6 { color: var(--g6); }

.ac-grid.is-suit .ac-group { width: 100%; }
.ac-grid.is-suit .ac-cards {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.5rem;
}
.ac-grid.is-suit .ac-card {
  max-width: none;
  flex: none;
  min-width: 0;
}

.suit-spade, .suit-club { color: var(--qe-text); }
.suit-heart, .suit-diamond { color: #f87171; }
.suit-joker { color: var(--g5); }
.tc2 { color: var(--g2); }
.tc3 { color: var(--g3); }
.tc4 { color: var(--g4); }
.tc5 { color: var(--g5); }
.tc6 { color: var(--g6); }

.ac-foot {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.7rem;
  color: var(--qe-muted);
  line-height: 1.6;
}

/* Poster overlay */
.ac-poster-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  padding: 1rem;
}
.ac-poster-overlay.is-open { display: flex; }
.ac-poster-panel {
  background: var(--qe-surface);
  border: 1px solid var(--qe-border);
  border-radius: 16px;
  max-height: 92vh;
  width: min(100%, 26rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ac-poster-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1rem 0;
}
.ac-poster-scroll img {
  display: block;
  width: 100%;
  border-radius: 10px;
}
.ac-poster-actions {
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  padding: 0.9rem 1rem;
}
.ac-poster-loading {
  padding: 2.5rem 2rem;
  text-align: center;
  color: var(--qe-muted);
  font-size: 0.9rem;
}

/* ===== Share poster canvas ===== */
#ac-poster-source {
  position: fixed;
  left: -9999px;
  top: 0;
  pointer-events: none;
  z-index: -1;
}
#ac-poster-content {
  position: relative;
  width: 560px;
  padding: 28px 26px 22px;
  box-sizing: border-box;
  overflow: hidden;
  background:
    linear-gradient(165deg, #070b14 0%, #0d1524 42%, #10101c 100%);
  color: #e8edf5;
  font-family: var(--qe-font);
}
.pc-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
}
.pc-glow--a {
  width: 280px;
  height: 280px;
  top: -120px;
  right: -80px;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.28), transparent 68%);
}
.pc-glow--b {
  width: 240px;
  height: 240px;
  bottom: 80px;
  left: -100px;
  background: radial-gradient(circle, rgba(178, 75, 255, 0.18), transparent 70%);
}

.pc-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.pc-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px;
}
.pc-brand-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fff;
  line-height: 1.1;
}
.pc-brand-tag {
  margin-top: 3px;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: rgba(125, 211, 252, 0.75);
  font-weight: 600;
}

.pc-title-block {
  position: relative;
  z-index: 1;
  margin-bottom: 20px;
}
.pc-title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.2;
  background: linear-gradient(90deg, #7dd3fc, #e9d5ff 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pc-meta {
  margin: 0;
  font-size: 12px;
  color: rgba(156, 163, 175, 0.95);
  letter-spacing: 0.08em;
}

.pc-hero {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 18px;
  margin-bottom: 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.pc-ring-wrap {
  position: relative;
  width: 132px;
  height: 132px;
  flex-shrink: 0;
}
.pc-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.pc-ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 8;
}
.pc-ring-value {
  fill: none;
  stroke: url(#pc-ring-grad);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
}
.pc-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.pc-pct-big {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  color: #7dd3fc;
}
.pc-pct-big small {
  font-size: 13px;
  font-weight: 600;
  margin-left: 1px;
  opacity: 0.8;
}
.pc-frac {
  margin-top: 6px;
  font-size: 12px;
  color: rgba(229, 231, 235, 0.7);
  letter-spacing: 0.04em;
}
.pc-hero-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.pc-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.pc-stat:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.pc-stat-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: rgba(156, 163, 175, 0.9);
  text-transform: uppercase;
}
.pc-stat-value {
  font-size: 14px;
  font-weight: 700;
  color: #f3f4f6;
}

.pc-section-label {
  position: relative;
  z-index: 1;
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: rgba(125, 211, 252, 0.85);
}

.pc-grid {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.pc-card {
  width: calc((100% - 8px) / 2);
  border-radius: 12px;
  padding: 10px 10px 8px;
  box-sizing: border-box;
  background: rgba(17, 24, 39, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.pc-card.is-full {
  border-color: rgba(0, 212, 255, 0.35);
  box-shadow: inset 0 0 0 1px rgba(0, 212, 255, 0.12);
}
.pc-grid.is-suit .pc-card { width: 100%; }
.pc-hdr {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.pc-rank {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.pc-st {
  font-size: 11px;
  color: rgba(156, 163, 175, 0.95);
  flex: 1;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.pc-card.is-full .pc-st { color: #7dd3fc; font-weight: 700; }
.pc-cds {
  display: flex;
  gap: 5px;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.pc-grid.is-suit .pc-cds {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}
.pc-cd {
  width: calc((100% - 15px) / 4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  opacity: 0.38;
  filter: grayscale(0.35);
}
.pc-grid.is-suit .pc-cd { width: auto; }
.pc-cd.is-on {
  opacity: 1;
  filter: none;
}
.pc-img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 7px;
  padding: 3px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(160deg, #1a2233, #121821);
}
.pc-img img {
  width: 82%;
  height: 82%;
  object-fit: contain;
}
.pc-cd.is-on .pc-img.g2 { border-color: var(--g2); box-shadow: 0 0 8px rgba(24, 141, 20, 0.25); }
.pc-cd.is-on .pc-img.g3 { border-color: var(--g3); box-shadow: 0 0 8px rgba(101, 139, 206, 0.25); }
.pc-cd.is-on .pc-img.g4 { border-color: var(--g4); box-shadow: 0 0 8px rgba(155, 97, 200, 0.25); }
.pc-cd.is-on .pc-img.g5 { border-color: var(--g5); box-shadow: 0 0 8px rgba(232, 166, 78, 0.25); }
.pc-cd.is-on .pc-img.g6 { border-color: var(--g6); box-shadow: 0 0 8px rgba(203, 70, 74, 0.25); }
.pc-lb {
  font-size: 9px;
  font-weight: 600;
  text-align: center;
  line-height: 1.15;
  color: rgba(156, 163, 175, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.pc-cd.is-on .pc-lb { color: #e5e7eb; }

.pc-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.pc-fl-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #f3f4f6;
}
.pc-fl-sub {
  margin-top: 3px;
  font-size: 10px;
  color: rgba(156, 163, 175, 0.9);
  letter-spacing: 0.04em;
}
.pc-fr {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pc-qr {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background: #fff;
  padding: 3px;
  box-sizing: border-box;
  flex-shrink: 0;
}
.pc-qr canvas,
.pc-qr img {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
.pc-qr-text {
  font-size: 10px;
  line-height: 1.35;
  color: rgba(156, 163, 175, 0.95);
  text-align: right;
  letter-spacing: 0.06em;
  max-width: 4.5em;
}

@media (max-width: 640px) {
  .ac-mode { margin-left: 0; width: 100%; }
  .ac-group { width: 100%; }
  .ac-grid.is-suit .ac-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .ac-progress__row { flex-wrap: wrap; }
}
