/* 動物園骰子 — 對齊官網色票 */

:root {
  --qe-brand: #00d4ff;
  --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-font: "Segoe UI", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

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

body.zd-body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 70% 45% at 20% -5%, rgba(0, 212, 255, 0.14), transparent 55%),
    radial-gradient(ellipse 55% 40% at 100% 90%, rgba(178, 75, 255, 0.1), transparent 50%),
    var(--qe-bg);
  color: var(--qe-text);
  font-family: var(--qe-font);
  -webkit-tap-highlight-color: transparent;
}

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

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

.zd-lead {
  margin: 0 0 1.5rem;
  color: var(--qe-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.zd-stage {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.zd-vs {
  align-self: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: rgba(0, 212, 255, 0.55);
  padding-top: 0.5rem;
}

.zd-dice {
  flex: 1;
  max-width: 11rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.zd-dice__face {
  aspect-ratio: 1;
  border-radius: 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1rem;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
    var(--qe-surface);
  border: 1px solid var(--qe-border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s;
}
.zd-dice[data-idle="true"] .zd-dice__face {
  border-style: dashed;
  opacity: 0.75;
}
.zd-dice.is-spin .zd-dice__face {
  animation: zd-shake 0.12s linear infinite;
  border-color: rgba(0, 212, 255, 0.45);
}
.zd-dice.is-land .zd-dice__face {
  animation: zd-pop 0.45s ease;
  border-color: rgba(0, 212, 255, 0.55);
  box-shadow: 0 0 24px rgba(0, 212, 255, 0.22);
}
.zd-dice__icon {
  font-size: 3.2rem;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}
.zd-dice__name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.zd-dice__sound {
  font-size: 0.95rem;
  color: #7dd3fc;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.zd-dice__label {
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--qe-muted);
  text-transform: uppercase;
}

@keyframes zd-shake {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-2px) rotate(-2deg); }
  75% { transform: translateY(2px) rotate(2deg); }
}
@keyframes zd-pop {
  0% { transform: scale(0.92); }
  55% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.zd-result {
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.12), rgba(178, 75, 255, 0.1));
  border: 1px solid rgba(0, 212, 255, 0.25);
  text-align: center;
}
.zd-result__title {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: rgba(125, 211, 252, 0.9);
  font-weight: 700;
  margin-bottom: 0.65rem;
}
.zd-result__pair {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.zd-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 800;
  font-size: 1.05rem;
}
.zd-chip small {
  font-size: 0.8rem;
  font-weight: 700;
  color: #7dd3fc;
}
.zd-chip-x {
  font-weight: 800;
  color: var(--qe-muted);
}

.zd-actions {
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  margin-bottom: 2rem;
}
.zd-btn {
  border: 1px solid var(--qe-border);
  background: var(--qe-surface);
  color: var(--qe-text);
  border-radius: 10px;
  padding: 0.7rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s, opacity 0.15s;
}
.zd-btn:hover { border-color: var(--qe-brand); background: var(--qe-surface-2); }
.zd-btn:active { transform: translateY(1px); }
.zd-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.zd-btn--primary {
  min-width: 10rem;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(178, 75, 255, 0.28));
  border-color: rgba(0, 212, 255, 0.4);
  color: #fff;
}

.zd-roster h2 {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  color: var(--qe-muted);
  font-weight: 700;
}
.zd-roster__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
}
.zd-animal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.65rem 0.35rem;
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid var(--qe-border);
}
.zd-animal__icon { font-size: 1.55rem; line-height: 1; }
.zd-animal__name {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.zd-animal__sound {
  font-size: 0.7rem;
  color: #7dd3fc;
  font-weight: 600;
}

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

@media (max-width: 480px) {
  .zd-roster__grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.4rem;
  }
  .zd-animal { padding: 0.5rem 0.2rem; }
  .zd-dice__icon { font-size: 2.6rem; }
  .zd-stage { gap: 0.4rem; }
}
