/* 枪械抽卡 */
:root {
  --bg0: #070b14;
  --cyan: #00d4ff;
  --gold: #fbbf24;
}
html, body {
  margin: 0; min-height: 100%;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0,212,255,0.18), transparent),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(124,58,237,0.15), transparent),
    var(--bg0);
  color: #e8f1ff;
  font-family: Rajdhani, "Segoe UI", sans-serif;
}
.gacha-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
  box-sizing: border-box;
}
.top {
  display: flex; justify-content: space-between; gap: 0.8rem; align-items: flex-start;
  flex-wrap: wrap; margin-bottom: 0.8rem;
}
.eyebrow {
  font-family: Orbitron, sans-serif; font-size: 0.68rem; letter-spacing: 0.14em;
  color: rgba(0,212,255,0.8);
}
h1 {
  margin: 0.2rem 0 0; font-family: Orbitron, sans-serif; font-size: 1.45rem; letter-spacing: 0.06em;
}
.nav { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.nav a {
  text-decoration: none; color: #fff; font-weight: 700;
  padding: 0.45rem 0.75rem; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.06);
}
.glass {
  border-radius: 14px; padding: 0.85rem 1rem;
  border: 1px solid rgba(0,212,255,0.25);
  background: rgba(8, 14, 28, 0.72);
  backdrop-filter: blur(10px);
  margin-bottom: 0.85rem;
}
.wallet {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem;
  font-size: 0.9rem;
}
.wallet b { color: var(--cyan); font-size: 1.1rem; }
@media (max-width: 640px) {
  .wallet { grid-template-columns: 1fr 1fr; }
}

.stage { min-height: 220px; margin: 0.5rem 0 1rem; }
.hint { text-align: center; opacity: 0.75; margin-bottom: 0.75rem; font-size: 0.9rem; }
.cards {
  display: flex; flex-wrap: wrap; gap: 0.65rem; justify-content: center;
  min-height: 160px;
}
.card {
  width: 110px; height: 150px; perspective: 800px; cursor: default;
}
.card.wide { width: 120px; height: 160px; }
.card-inner {
  position: relative; width: 100%; height: 100%;
  transition: transform 0.65s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-style: preserve-3d;
}
.card.flip .card-inner { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; border-radius: 12px;
  backface-visibility: hidden; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 0.5rem;
  border: 1px solid rgba(255,255,255,0.2);
  box-sizing: border-box; text-align: center;
}
.back {
  background: linear-gradient(145deg, #12203a, #0a1020);
  background-image:
    linear-gradient(145deg, rgba(18,32,58,0.95), rgba(10,16,32,0.98)),
    repeating-linear-gradient(45deg, transparent, transparent 6px, rgba(0,212,255,0.04) 6px, rgba(0,212,255,0.04) 12px);
}
.back::after {
  content: '星枢';
  font-family: Orbitron, sans-serif; letter-spacing: 0.2em; font-size: 0.75rem; opacity: 0.7;
}
.front { transform: rotateY(180deg); }
.front .rarity {
  font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.25rem;
}
.front .name { font-weight: 800; font-size: 0.95rem; line-height: 1.2; }
.front .meta { font-size: 0.72rem; opacity: 0.75; margin-top: 0.3rem; }
.front .dup {
  margin-top: 0.35rem; font-size: 0.7rem; color: #fbbf24;
}
.rarity.common { color: #94a3b8; }
.rarity.rare { color: #38bdf8; }
.rarity.epic { color: #a78bfa; }
.rarity.legendary { color: #fbbf24; }
.rarity.mythic { color: #fb7185; text-shadow: 0 0 10px rgba(251,113,133,0.6); }

.face.common { border-color: #64748b; background: linear-gradient(160deg, #1e293b, #0f172a); }
.face.rare { border-color: #38bdf8; background: linear-gradient(160deg, #0c4a6e, #082f49); box-shadow: 0 0 16px rgba(56,189,248,0.25); }
.face.epic { border-color: #a78bfa; background: linear-gradient(160deg, #4c1d95, #1e1b4b); box-shadow: 0 0 18px rgba(167,139,250,0.3); }
.face.legendary { border-color: #fbbf24; background: linear-gradient(160deg, #78350f, #451a03); box-shadow: 0 0 22px rgba(251,191,36,0.4); }
.face.mythic {
  border-color: #fb7185;
  background: linear-gradient(160deg, #9f1239, #4c0519);
  box-shadow: 0 0 28px rgba(251,113,133,0.5);
  animation: mythPulse 1.2s ease infinite alternate;
}
@keyframes mythPulse {
  from { filter: brightness(1); }
  to { filter: brightness(1.15); }
}

.actions {
  display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap;
  margin: 0.5rem 0 1.2rem; position: sticky; bottom: 0.6rem; z-index: 5;
}
.btn {
  min-width: 140px; min-height: 52px; border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.25); background: rgba(255,255,255,0.08);
  color: #fff; font-weight: 800; font-size: 1.05rem; cursor: pointer;
}
.btn small { display: block; font-size: 0.75rem; font-weight: 600; opacity: 0.8; }
.btn.primary {
  background: linear-gradient(135deg, rgba(0,212,255,0.4), rgba(59,130,246,0.5));
  border-color: rgba(0,212,255,0.55);
  box-shadow: 0 8px 24px rgba(0,212,255,0.2);
}
.btn:disabled { opacity: 0.45; cursor: wait; }

.rates h2, .exchange h2 {
  margin: 0 0 0.55rem; font-family: Orbitron, sans-serif; font-size: 0.95rem; letter-spacing: 0.08em;
}
.rate-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.4rem; font-size: 0.82rem;
}
@media (max-width: 640px) { .rate-grid { grid-template-columns: 1fr 1fr; } }
.rate-grid div {
  padding: 0.45rem; border-radius: 8px; background: rgba(0,0,0,0.25); text-align: center;
}
.note { margin: 0.55rem 0 0; font-size: 0.82rem; opacity: 0.75; line-height: 1.45; }

.ex-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.55rem;
}
.ex-item {
  padding: 0.7rem; border-radius: 12px; border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
}
.ex-item b { display: block; margin: 0.15rem 0; }
.ex-item button {
  margin-top: 0.45rem; width: 100%; min-height: 38px; border-radius: 9px;
  border: 1px solid rgba(251,191,36,0.45); background: rgba(251,191,36,0.12);
  color: #fff; font-weight: 700; cursor: pointer;
}
.ex-item button:disabled { opacity: 0.4; cursor: default; }

.toast {
  position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%);
  padding: 0.55rem 1rem; border-radius: 12px; background: rgba(0,20,40,0.92);
  border: 1px solid var(--cyan); opacity: 0; transition: opacity 0.2s; z-index: 50;
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; }
