/* Lineage Tactics: Fire Valley & Aden Sanctuary Stylesheet
   Gritty dark-fantasy forged-iron & volcanic-obsidian Lineage I aesthetic */

:root {
  --bg-deep: #0b0807;
  --bg-panel: rgba(20, 15, 13, 0.94);
  --bg-card: #181210;
  --border-bronze: #705535;
  --border-gold: #c99b49;
  --text-main: #efe5d1;
  --text-muted: #a9987e;
  --accent-fire: #f06d24;
  --accent-gold: #f0c259;
  --accent-azure: #4da8ff;
  --accent-crimson: #e64c3d;
  --accent-curse: #a855f7;
  --grade-common: #8b867d;
  --grade-rare: #3f8efc;
  --grade-legendary: #f0b429;
  --grade-mythic: #e8442a;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%;
  background: var(--bg-deep); color: var(--text-main);
  font-family: "Inter", "SF Pro Display", system-ui, -apple-system, sans-serif;
  overflow: hidden;
}

button {
  font: inherit; color: var(--text-main); cursor: pointer;
  background: linear-gradient(180deg, #33261d 0%, #201712 100%);
  border: 1px solid var(--border-bronze); border-radius: 6px;
  padding: 7px 13px; transition: all 0.14s ease;
}
button:hover:not(:disabled) { border-color: var(--border-gold); filter: brightness(1.16); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.primary {
  background: linear-gradient(180deg, #c97222 0%, #7d2d11 100%);
  border-color: #f3b55a; color: #fff6e3; font-weight: 700;
  box-shadow: 0 2px 14px rgba(235, 100, 26, 0.35);
}
button.gold {
  background: linear-gradient(180deg, #b98b32 0%, #6f4b14 100%);
  border-color: #ffd778; color: #fff9e6; font-weight: 700;
}
button.curse-btn {
  background: linear-gradient(180deg, #6b2aa8 0%, #3d1266 100%);
  border-color: #c78aff; color: #f7ebff; font-weight: 700;
}

.hidden { display: none !important; }

/* ── ADEN SANCTUARY (WAR ROOM / COLLECTION / MARKET) ────────── */
#sanctuary-view {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(210, 74, 24, 0.24), transparent 55%),
    radial-gradient(ellipse at 85% 90%, rgba(160, 48, 18, 0.16), transparent 50%),
    linear-gradient(180deg, #130d0b 0%, #0a0706 100%);
}

.sanc-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px; background: rgba(15, 11, 9, 0.96);
  border-bottom: 1px solid rgba(201, 155, 73, 0.38);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.55);
}
.brand-block { display: flex; align-items: center; gap: 12px; }
.brand-crest {
  width: 40px; height: 40px; border-radius: 8px;
  border: 1px solid var(--border-gold); object-fit: cover;
  box-shadow: 0 0 12px rgba(240, 148, 42, 0.35);
}
.brand-title { font-size: 18px; font-weight: 800; letter-spacing: 0.04em; color: #f6d58e; text-transform: uppercase; }
.brand-sub { font-size: 11px; color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase; }

.sanc-tabs { display: flex; gap: 6px; }
.sanc-tab {
  padding: 8px 16px; font-weight: 600; font-size: 13px; border-radius: 6px;
  background: rgba(34, 25, 20, 0.7); border: 1px solid rgba(112, 85, 53, 0.5);
}
.sanc-tab.active {
  background: linear-gradient(180deg, rgba(201, 126, 40, 0.35), rgba(110, 48, 18, 0.45));
  border-color: var(--border-gold); color: #ffe5a5;
}

.commander-bar { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.currency-pill {
  display: flex; align-items: center; gap: 6px; padding: 5px 11px;
  border-radius: 20px; background: rgba(30, 22, 16, 0.9);
  border: 1px solid rgba(201, 155, 73, 0.45); font-weight: 700;
}
.currency-pill.adena { color: #ffd96a; }
.currency-pill.shards { color: #8fd2ff; }
.currency-pill.level { color: #f3caa0; }

.sanc-body {
  flex: 1; overflow-y: auto; padding: 22px 28px 34px;
  max-width: 1480px; width: 100%; margin: 0 auto;
}

/* Hero War Room Banner */
.hero-firevalley {
  display: grid; grid-template-columns: 1.45fr 1fr; gap: 22px;
  background:
    linear-gradient(100deg, rgba(16, 11, 9, 0.94) 38%, rgba(24, 14, 10, 0.65) 100%),
    url("../firevalley/terrain/fire-valley-ref-15521.png") center/cover no-repeat;
  border: 1px solid rgba(235, 144, 58, 0.55); border-radius: 12px;
  padding: 24px 28px; margin-bottom: 22px;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.65), inset 0 0 60px rgba(220, 72, 18, 0.14);
}
.hero-firevalley h1 { margin: 0 0 6px; font-size: 28px; color: #ffdfb0; letter-spacing: 0.02em; }
.hero-firevalley p { margin: 0 0 16px; color: #d5c2a6; font-size: 14px; line-height: 1.5; max-width: 620px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.deck-selector {
  background: rgba(16, 12, 10, 0.92); border: 1px solid var(--border-gold);
  color: var(--text-main); padding: 8px 12px; border-radius: 6px; font-size: 13px;
}

.challenge-box {
  background: rgba(14, 10, 9, 0.88); border: 1px solid rgba(160, 122, 68, 0.45);
  border-radius: 10px; padding: 14px 16px;
}
.challenge-box h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: #f0c259; }
.challenge-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid rgba(255, 224, 175, 0.08); font-size: 12px;
}
.challenge-row:last-child { border-bottom: none; }
.tier-badge { font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; }
.tier-Bronze { background: #5a3c24; color: #f0c79c; }
.tier-Silver { background: #3c4b59; color: #d7e8fa; }
.tier-Gold { background: #745516; color: #ffe285; }
.tier-Mythic { background: #7a1c14; color: #ffb3a6; }

/* Section Grid & Campaign Map Strip */
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 18px 0 12px; font-size: 15px; font-weight: 700; color: #f2cf8b;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.zones-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px;
}
.zone-tile {
  background: rgba(24, 18, 15, 0.9); border: 1px solid rgba(112, 85, 53, 0.45);
  border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 4px;
}
.zone-tile.live {
  border-color: #f08932;
  background: linear-gradient(160deg, rgba(130, 42, 14, 0.35), rgba(22, 15, 12, 0.95));
  box-shadow: 0 0 18px rgba(240, 108, 36, 0.22);
}
.zone-tile .z-name { font-weight: 700; font-size: 13px; color: #f8e5c4; }
.zone-tile .z-boss { font-size: 11px; color: #e29963; }
.zone-tile .z-desc { font-size: 11px; color: var(--text-muted); line-height: 1.35; }
.zone-tile .z-tag { align-self: flex-start; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; margin-top: 4px; background: rgba(255, 255, 255, 0.07); }
.zone-tile.live .z-tag { background: #cf4a18; color: #fff; }

/* ── SEAL CARDS (COLLECTION, DECK BUILDER, PACK REVEAL) ─────── */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px;
}
.filter-pill {
  padding: 5px 11px; font-size: 12px; border-radius: 16px;
  background: rgba(28, 21, 17, 0.85); border: 1px solid rgba(112, 85, 53, 0.5);
}
.filter-pill.active { border-color: var(--accent-gold); color: #ffe399; background: rgba(155, 96, 26, 0.3); }

.seal-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: 16px;
}

.seal-card {
  position: relative; border-radius: 11px; overflow: hidden; cursor: pointer;
  background: linear-gradient(175deg, #1b1613 0%, #14100e 65%, #100c0b 100%);
  border: 2px solid var(--grade-common);
  display: flex; flex-direction: column;
  transform-style: preserve-3d;
  transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.58);
}
.seal-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.76);
}
.seal-card.is-tilting {
  transition: transform 0.06s linear, box-shadow 0.18s ease;
  transform: perspective(760px) translateY(-5px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}

/* Specular light-catch layer driven by pointer coordinates on Rare/Legendary/Mythic/Blessed */
.seal-specular {
  position: absolute; inset: 0; pointer-events: none; z-index: 4; opacity: 0;
  transition: opacity 0.22s ease;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 35%), rgba(255, 250, 232, 0.22) 0%, rgba(255, 224, 150, 0.08) 28%, transparent 62%);
  mix-blend-mode: screen;
}
.seal-card.is-tilting .seal-specular { opacity: 1; }
.seal-card.grade-Rare .seal-specular {
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 35%), rgba(180, 228, 255, 0.22) 0%, rgba(78, 168, 255, 0.08) 32%, transparent 62%);
}
.seal-card.grade-Mythic .seal-specular {
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 35%), rgba(255, 244, 198, 0.28) 0%, rgba(255, 118, 48, 0.14) 30%, transparent 64%);
}

/* ── TIER 1: COMMON (Weathered Hammered Iron) ────────────────── */
.seal-card.grade-Common, .hand-card.grade-Common {
  border: 1.5px solid #6e6961;
  background: linear-gradient(175deg, #191513 0%, #13100e 65%, #0f0c0b 100%);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.56), inset 0 1px 0 rgba(255, 245, 230, 0.06);
}

/* ── TIER 2: RARE (Tempered Sapphire & Silver Double-Bevel) ─── */
.seal-card.grade-Rare, .hand-card.grade-Rare {
  border: 2px solid transparent;
  background:
    linear-gradient(175deg, #132033 0%, #0f1624 58%, #0c101a 100%) padding-box,
    linear-gradient(145deg, #25589e 0%, #5cb2ff 30%, #c8ecff 50%, #3072cf 74%, #6ac0ff 100%) border-box;
  box-shadow:
    0 6px 20px rgba(32, 112, 232, 0.28),
    inset 0 0 0 1px rgba(154, 214, 255, 0.26),
    inset 0 1px 0 rgba(215, 242, 255, 0.42);
}
.seal-card.grade-Rare:hover {
  box-shadow:
    0 12px 30px rgba(48, 138, 255, 0.44),
    0 0 18px rgba(108, 196, 255, 0.24),
    inset 0 0 0 1px rgba(182, 228, 255, 0.42);
}

/* ── TIER 3: LEGENDARY (Forged Aden Gold & Ornate Filigree) ─── */
.seal-card.grade-Legendary, .hand-card.grade-Legendary {
  border: 2.5px solid transparent;
  background:
    linear-gradient(175deg, #261b0e 0%, #19120b 56%, #120d08 100%) padding-box,
    linear-gradient(135deg, #8a5612 0%, #f5c954 24%, #fff3b8 46%, #c88318 68%, #f8d468 88%, #9c6216 100%) border-box;
  box-shadow:
    0 6px 24px rgba(240, 178, 42, 0.34),
    inset 0 0 0 1px rgba(255, 230, 146, 0.30),
    inset 0 1px 0 rgba(255, 248, 212, 0.52);
}
.seal-card.grade-Legendary:hover {
  box-shadow:
    0 14px 34px rgba(245, 186, 46, 0.52),
    0 0 22px rgba(255, 216, 108, 0.30),
    inset 0 0 0 1px rgba(255, 238, 172, 0.48);
}

/* ── TIER 4: MYTHIC (Dragonfire Crimson-Gold Crest & Living Aura) */
.seal-card.grade-Mythic, .hand-card.grade-Mythic {
  border: 2.5px solid transparent;
  background:
    linear-gradient(175deg, #2b110c 0%, #190b09 52%, #110706 100%) padding-box,
    linear-gradient(135deg, #7d150b 0%, #f04b24 22%, #ffae42 44%, #fff2be 52%, #e6381c 70%, #ff8c30 88%, #911a0d 100%) border-box;
  box-shadow:
    0 8px 28px rgba(238, 68, 32, 0.48),
    0 0 18px rgba(255, 162, 56, 0.28),
    inset 0 0 0 1px rgba(255, 206, 128, 0.38),
    inset 0 1px 0 rgba(255, 242, 198, 0.56);
  animation: mythicAuraBreath 3.8s ease-in-out infinite;
}
.seal-card.grade-Mythic:hover {
  box-shadow:
    0 16px 40px rgba(245, 74, 30, 0.68),
    0 0 28px rgba(255, 184, 72, 0.44),
    inset 0 0 0 1px rgba(255, 224, 152, 0.56);
}
@keyframes mythicAuraBreath {
  0%, 100% {
    box-shadow:
      0 8px 26px rgba(238, 68, 32, 0.44),
      0 0 14px rgba(255, 154, 48, 0.22),
      inset 0 0 0 1px rgba(255, 206, 128, 0.34);
  }
  50% {
    box-shadow:
      0 10px 34px rgba(255, 82, 34, 0.66),
      0 0 24px rgba(255, 188, 76, 0.42),
      inset 0 0 0 1px rgba(255, 226, 156, 0.52);
  }
}

/* Ornate corner filigree clasps on Legendary (Aden Gold) & Mythic (Dragonfire Crest) */
.seal-corners {
  position: absolute; inset: 0; pointer-events: none; z-index: 3;
}
.seal-corners::before, .seal-corners::after {
  content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none;
}
.grade-Legendary > .seal-corners::before {
  bottom: 3px; left: 3px;
  border-bottom: 2px solid #ffe89c; border-left: 2px solid #ffe89c; border-bottom-left-radius: 5px;
  filter: drop-shadow(0 0 3px rgba(255, 214, 96, 0.7));
}
.grade-Legendary > .seal-corners::after {
  bottom: 3px; right: 3px;
  border-bottom: 2px solid #ffe89c; border-right: 2px solid #ffe89c; border-bottom-right-radius: 5px;
  filter: drop-shadow(0 0 3px rgba(255, 214, 96, 0.7));
}
.grade-Mythic > .seal-corners::before {
  bottom: 3px; left: 3px; width: 16px; height: 16px;
  border-bottom: 2.5px solid #ffdf91; border-left: 2.5px solid #ff7c3a; border-bottom-left-radius: 6px;
  filter: drop-shadow(0 0 5px rgba(255, 118, 42, 0.85));
}
.grade-Mythic > .seal-corners::after {
  bottom: 3px; right: 3px; width: 16px; height: 16px;
  border-bottom: 2.5px solid #ffdf91; border-right: 2.5px solid #ff7c3a; border-bottom-right-radius: 6px;
  filter: drop-shadow(0 0 5px rgba(255, 118, 42, 0.85));
}

/* Faceted Rarity Divider Bar & Centered Gem between Artwork and Nameplate */
.seal-divider {
  position: relative; height: 3px; width: 100%; z-index: 2;
  background: linear-gradient(90deg, transparent, rgba(145, 138, 126, 0.55) 20%, rgba(145, 138, 126, 0.55) 80%, transparent);
}
.seal-gem {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(45deg);
  width: 8px; height: 8px; border-radius: 1.5px;
  background: linear-gradient(135deg, #aba396, #5e5951);
  border: 1px solid #d5cec2;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}
.grade-Rare .seal-divider {
  background: linear-gradient(90deg, rgba(35, 88, 168, 0.4), #68beff 50%, rgba(35, 88, 168, 0.4));
}
.grade-Rare .seal-gem {
  width: 10px; height: 10px;
  background: radial-gradient(circle at 30% 30%, #e6f7ff, #3b96ff 55%, #164488);
  border-color: #c8ebff;
  box-shadow: 0 0 8px rgba(72, 168, 255, 0.9), 0 1px 4px rgba(0, 0, 0, 0.9);
}
.grade-Legendary .seal-divider {
  height: 3.5px;
  background: linear-gradient(90deg, rgba(138, 86, 18, 0.55), #ffe896 50%, rgba(138, 86, 18, 0.55));
}
.grade-Legendary .seal-gem {
  width: 11px; height: 11px;
  background: radial-gradient(circle at 30% 30%, #fffbe0, #f5b932 55%, #8a4f0a);
  border-color: #fff2b8;
  box-shadow: 0 0 10px rgba(248, 196, 62, 0.95), 0 1px 5px rgba(0, 0, 0, 0.95);
}
.grade-Mythic .seal-divider {
  height: 4px;
  background: linear-gradient(90deg, rgba(136, 22, 10, 0.65), #ff6c2c 28%, #ffe99d 50%, #ff6c2c 72%, rgba(136, 22, 10, 0.65));
}
.grade-Mythic .seal-gem {
  width: 12px; height: 12px;
  background: radial-gradient(circle at 30% 30%, #fffbe8, #ff9933 45%, #cc220c 85%);
  border: 1.5px solid #ffebb3;
  box-shadow: 0 0 12px rgba(255, 88, 32, 1), 0 0 6px rgba(255, 224, 128, 0.9);
}

/* Colored Rarity Typography & Title Accents */
.seal-grade-text { font-weight: 800; letter-spacing: 0.06em; }
.grade-text-Common { color: #aba193; }
.grade-text-Rare { color: #7ac8ff; text-shadow: 0 0 8px rgba(63, 142, 252, 0.55); }
.grade-text-Legendary { color: #ffda6b; text-shadow: 0 0 9px rgba(245, 184, 42, 0.62); }
.grade-text-Mythic { color: #ff9c54; text-shadow: 0 0 10px rgba(255, 74, 28, 0.8), 0 0 4px rgba(255, 224, 132, 0.55); }

.seal-card.grade-Rare:not([data-distinction="veteran"]):not([data-distinction="legend"]) .seal-name,
.hand-card.grade-Rare:not([data-distinction="veteran"]):not([data-distinction="legend"]) .seal-name {
  color: #e6f4ff;
  text-shadow: 0 1px 6px rgba(63, 142, 252, 0.32);
}
.seal-card.grade-Legendary:not([data-distinction="veteran"]):not([data-distinction="legend"]) .seal-name,
.hand-card.grade-Legendary:not([data-distinction="veteran"]):not([data-distinction="legend"]) .seal-name {
  color: #ffe699;
  text-shadow: 0 1px 8px rgba(245, 180, 40, 0.38);
}
.seal-card.grade-Mythic:not([data-distinction="veteran"]):not([data-distinction="legend"]) .seal-name > span,
.hand-card.grade-Mythic:not([data-distinction="veteran"]):not([data-distinction="legend"]) .seal-name > span {
  background: linear-gradient(180deg, #fff6d2 0%, #ffc468 58%, #ff7d40 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 6px rgba(255, 74, 24, 0.45));
}

/* Taller Art-Bleed Portrait on Mythics melting smoothly into obsidian card body */
.seal-card.grade-Mythic .seal-art-wrap { height: 134px; }
.seal-card.grade-Mythic .seal-art-wrap::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 34px; pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(34, 12, 8, 0.88));
}
.seal-card.grade-Legendary .seal-art-wrap::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 24px; pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(32, 22, 11, 0.72));
}

/* Blessed Foil animated holographic prismatic shimmer — stacks cleanly over any rarity border! */
.seal-card.is-blessed::after, .hand-card.is-blessed::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background-image: linear-gradient(125deg, transparent 32%, rgba(255, 224, 120, 0.22) 44%, rgba(154, 232, 255, 0.24) 50%, rgba(255, 195, 100, 0.20) 56%, transparent 68%);
  background-size: 320% 320%;
  animation: blessedSheen 3.8s ease-in-out infinite;
}
@keyframes blessedSheen {
  0% { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}

/* Cursed Seal dark violet miasma chains! */
.seal-card.is-cursed {
  border-color: #a855f7 !important;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.48);
}
.seal-card.is-cursed .seal-art { filter: saturate(0.45) contrast(1.15) hue-rotate(-18deg); }

.seal-art-wrap { position: relative; height: 122px; overflow: hidden; background: #0e0a09; }
.seal-art { width: 100%; height: 100%; object-fit: cover; display: block; }
.seal-cost {
  position: absolute; top: 6px; left: 6px; min-width: 28px; height: 28px;
  border-radius: 50%; background: radial-gradient(circle at 35% 30%, #4ec5ff, #144d8f);
  border: 2px solid #cbeeff; color: #fff; font-weight: 800; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}
.seal-rank {
  position: absolute; top: 6px; right: 6px; padding: 2px 7px; border-radius: 4px;
  font-size: 11px; font-weight: 800; background: rgba(12, 9, 8, 0.88);
  border: 1px solid var(--border-gold); color: #ffd978;
}
.seal-rank.r2 { border-color: #c88cff; color: #e2b8ff; }
.seal-rank.r3 { border-color: #ff7e38; color: #ffc17a; box-shadow: 0 0 10px rgba(255, 126, 56, 0.65); }

.seal-badges {
  position: absolute; bottom: 5px; left: 6px; right: 6px;
  display: flex; justify-content: space-between; align-items: center; gap: 4px;
}
.pill-blessed {
  background: linear-gradient(90deg, #b8841c, #f6d56b); color: #1d1204;
  font-size: 9px; font-weight: 900; padding: 2px 6px; border-radius: 4px; letter-spacing: 0.05em;
}
.pill-cursed {
  background: linear-gradient(90deg, #581c87, #a855f7); color: #fff;
  font-size: 9px; font-weight: 900; padding: 2px 6px; border-radius: 4px; letter-spacing: 0.05em;
}
.pill-lv {
  background: rgba(12, 9, 8, 0.88); border: 1px solid rgba(240, 194, 89, 0.55);
  color: #f6dfb0; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px;
}

.seal-info { padding: 9px 10px 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.seal-name { font-size: 13px; font-weight: 700; color: #f9ebd0; display: flex; justify-content: space-between; gap: 4px; }
.seal-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.seal-wiki-link { display: inline-block; margin-block-start: 6px; color: #e9cd91; font-size: 12px; text-underline-offset: 3px; }

/* The inset metalwork leaves the rarity edge and the Blessed art foil visible. */
[data-distinction="veteran"] {
  --seal-metal: linear-gradient(120deg, #788a96, #dce8e8 28%, #93a7af 49%, #e8eff0 75%, #85969e);
  --seal-etching: #586a73;
}
[data-distinction="legend"] {
  --seal-metal: linear-gradient(115deg, #aa7330, #f9d77f 22%, #fff3ce 37%, #b9dddc 48%, #f5d995 60%, #d69a47 84%, #fff0b6);
  --seal-etching: #87602d;
}
:is([data-distinction="veteran"], [data-distinction="legend"])::before {
  content: ""; position: absolute; inset: 2px; z-index: 2; pointer-events: none;
  border-radius: 6px; border: 3px double #bcced0;
  box-shadow: 0 0 0 1px #24313b, inset 0 0 0 1px #3d4b52;
}
:is([data-distinction="veteran"], [data-distinction="legend"]) .seal-name {
  position: relative; justify-content: center; text-align: center; align-items: center;
  padding: 4px 12px; line-height: 1.2; color: #1e2528;
  background: var(--seal-metal); border-block: 1px solid var(--seal-etching);
  clip-path: polygon(5px 0, calc(100% - 5px) 0, 100% 50%, calc(100% - 5px) 100%, 5px 100%, 0 50%);
}
[data-distinction="legend"]::before {
  padding: 3px; border: 0; border-radius: 6px; box-shadow: none;
  background: linear-gradient(110deg, transparent 34%, #fffef1 48%, transparent 59%) 100% 50% / 260% 100%, var(--seal-metal);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: aden-legend-glint 5s ease-in-out infinite;
}
[data-distinction="legend"] .seal-name {
  padding-inline: 16px; color: #38200e;
  background: linear-gradient(110deg, transparent 39%, #fff9e4bd 49%, transparent 59%) 100% 50% / 260% 100%, var(--seal-metal);
  animation: aden-legend-glint 5s ease-in-out infinite;
}
[data-distinction="legend"] .seal-name::before, [data-distinction="legend"] .seal-name::after {
  content: ""; position: absolute; top: calc(50% - 4px); width: 7px; height: 8px;
  background: #73491e; clip-path: polygon(50% 0, 64% 34%, 100% 50%, 64% 63%, 50% 100%, 36% 63%, 0 50%, 36% 34%);
}
[data-distinction="legend"] .seal-name::before { left: 6px; }
[data-distinction="legend"] .seal-name::after { right: 6px; }
@keyframes aden-legend-glint {
  0%, 35% { background-position: 100% 50%, center; }
  75%, 100% { background-position: 0% 50%, center; }
}
@media (prefers-reduced-motion: reduce) {
  [data-distinction="legend"]::before, [data-distinction="legend"] .seal-name, .seal-card.is-blessed::after, .hand-card.is-blessed::after, .seal-card.grade-Mythic, .hand-card.grade-Mythic { animation: none; }
}
.seal-meta { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.seal-text { font-size: 11px; color: #cbbba3; line-height: 1.32; flex: 1; }
.seal-stats {
  display: flex; justify-content: space-between; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 700; color: #f1dec0; white-space: nowrap;
  border-top: 1px solid rgba(255, 224, 175, 0.09); padding-top: 5px; margin-top: 2px;
}
.seal-stats > span { white-space: nowrap; }
.xp-mini-bar { height: 4px; background: rgba(255, 255, 255, 0.1); border-radius: 3px; overflow: hidden; margin-top: 2px; }
.xp-mini-fill { height: 100%; background: linear-gradient(90deg, #d89b32, #ffe280); }

/* ── MARKET & SCROLL SHOP ───────────────────────────────────── */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.shop-card {
  background: linear-gradient(170deg, rgba(32, 23, 18, 0.94), rgba(16, 12, 10, 0.96));
  border: 1px solid rgba(201, 155, 73, 0.45); border-radius: 10px; padding: 16px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
}
.shop-card.featured {
  border-color: #f39a3e;
  box-shadow: 0 0 24px rgba(240, 118, 36, 0.22);
}
.shop-card h4 { margin: 0 0 4px; font-size: 15px; color: #ffe0a3; }
.shop-card p { margin: 0; font-size: 12px; color: #c7b69b; line-height: 1.45; }
.shop-foot { display: flex; align-items: center; justify-content: space-between; }
.price-tag { font-size: 14px; font-weight: 800; color: #ffd769; }

/* ── LOANER DECK CARDS ──────────────────────────────────────── */
.loaner-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.loaner-card {
  background: rgba(24, 18, 15, 0.92); border: 1px solid rgba(112, 85, 53, 0.55);
  border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px;
}
.loaner-card.active { border-color: #f3b55a; box-shadow: 0 0 20px rgba(240, 156, 48, 0.22); }
.loaner-badge {
  display: inline-block; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 4px;
  background: rgba(77, 168, 255, 0.18); border: 1px solid rgba(77, 168, 255, 0.45); color: #9ad2ff;
}

/* ── MODALS: SEAL INSPECTOR, ENCHANTING ANVIL & CLEANSE ALTAR ── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(6, 4, 4, 0.84); backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-panel {
  width: min(860px, 95vw); max-height: 90vh; overflow-y: auto;
  background: linear-gradient(180deg, #1b1411 0%, #100c0a 100%);
  border: 1px solid var(--border-gold); border-radius: 12px; padding: 22px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
}
.inspector-grid { display: grid; grid-template-columns: 290px 1fr; gap: 22px; }
.anvil-box {
  background: rgba(12, 9, 8, 0.86); border: 1px solid rgba(235, 145, 56, 0.48);
  border-radius: 10px; padding: 14px; margin-top: 12px;
}
.anvil-odds {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; margin: 8px 0 12px; padding: 8px 10px; border-radius: 6px;
  background: rgba(255, 190, 90, 0.08);
}
.anvil-result {
  padding: 12px 14px; border-radius: 8px; margin-top: 10px; font-weight: 800; text-align: center;
  font-size: 13px; letter-spacing: 0.02em;
  animation: popIn 0.22s ease forwards;
}
.anvil-result.ok {
  background: rgba(42, 168, 92, 0.34); border: 1.5px solid #6ef2a4; color: #eafff2;
  box-shadow: 0 0 18px rgba(94, 230, 148, 0.28);
}
.anvil-result.fail {
  background: rgba(214, 52, 36, 0.34); border: 1.5px solid #ff7664; color: #ffe6e2;
  box-shadow: 0 0 18px rgba(242, 95, 76, 0.28);
}
@keyframes popIn { 0% { transform: scale(0.96); opacity: 0.85; } 100% { transform: scale(1); opacity: 1; } }

/* ── LANGRISSER-STYLE ARCANE SUMMONING / PACK OPENING CEREMONY ─ */
#summon-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: radial-gradient(circle at 50% 45%, #2b1810 0%, #100806 58%, #060404 92%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  padding: 24px; overflow: hidden;
}
#summon-overlay.flash-Rare { background: radial-gradient(circle at 50% 45%, #12294a 0%, #060910 75%); }
#summon-overlay.flash-Legendary { background: radial-gradient(circle at 50% 45%, #4d330c 0%, #0b0804 75%); }
#summon-overlay.flash-Mythic {
  background: radial-gradient(circle at 50% 45%, #66170b 0%, #1a0705 55%, #070303 85%);
  animation: screenShake 0.45s ease;
}
@keyframes screenShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-8px, 5px); }
  40% { transform: translate(8px, -6px); }
  60% { transform: translate(-6px, -4px); }
  80% { transform: translate(5px, 4px); }
}

.summon-dial-wrap {
  position: relative; width: 280px; height: 280px;
  display: flex; align-items: center; justify-content: center;
}
.summon-ring {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  border: 3px dashed rgba(242, 194, 88, 0.72);
  box-shadow: 0 0 36px rgba(242, 162, 52, 0.35), inset 0 0 30px rgba(242, 162, 52, 0.25);
  animation: spinCW 8s linear infinite;
}
.summon-ring.inner {
  inset: 28px; border-style: solid; border-width: 2px; pointer-events: none;
  border-color: rgba(255, 226, 146, 0.85) transparent rgba(255, 134, 48, 0.85) transparent;
  animation: spinCCW 4.5s linear infinite;
}
.summon-dial-wrap.charging .summon-ring { animation-duration: 1.1s; border-color: #ffd574; box-shadow: 0 0 70px rgba(255, 166, 48, 0.85); }
.summon-dial-wrap.charging .summon-ring.inner { animation-duration: 0.7s; }
.summon-core {
  position: relative; z-index: 2;
  width: 112px; height: 112px; border-radius: 50%;
  background: radial-gradient(circle, #fff8d6 0%, #f59c2e 45%, #7c1f0c 100%);
  border: 2px solid #ffe49b; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 900; color: #2b1005; text-align: center;
  box-shadow: 0 0 42px rgba(248, 140, 38, 0.7); cursor: pointer;
}
@keyframes spinCW { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes spinCCW { from { transform: rotate(360deg); } to { transform: rotate(0deg); } }

.summon-banner {
  font-size: 24px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase;
  text-shadow: 0 2px 24px rgba(255, 160, 48, 0.8);
}
.summon-banner.Mythic { color: #ffba6b; text-shadow: 0 0 32px #ff3b14, 0 0 12px #ffd875; }
.summon-banner.Legendary { color: #ffe07d; text-shadow: 0 0 26px #f0b429; }
.summon-banner.Rare { color: #8fd2ff; text-shadow: 0 0 24px #3f8efc; }

.pack-tray {
  display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; max-width: 1180px;
}
.pack-slot {
  width: 196px; min-height: 274px; border-radius: 11px; position: relative;
  cursor: pointer; transition: transform 0.22s ease;
}
.pack-slot:hover { transform: translateY(-6px); }
.pack-back {
  width: 100%; height: 274px; border-radius: 11px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: radial-gradient(circle at 50% 40%, #2d1e17, #110c0a);
  border: 2px solid #8a6c45; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
}
.pack-back.glow-Rare { border-color: #4aa3ff; box-shadow: 0 0 24px rgba(74, 163, 255, 0.55); color: #a8d8ff; }
.pack-back.glow-Legendary { border-color: #f5c342; box-shadow: 0 0 30px rgba(245, 195, 66, 0.72); color: #ffe699; }
.pack-back.glow-Mythic {
  border-color: #ff5b2e;
  box-shadow: 0 0 42px rgba(255, 72, 24, 0.9), 0 0 18px rgba(255, 214, 92, 0.75);
  color: #ffd388; animation: mythicPulse 1.1s ease-in-out infinite alternate;
}
@keyframes mythicPulse { from { transform: scale(1); } to { transform: scale(1.03); } }

/* ── FIRE VALLEY BATTLEFIELD HUD ────────────────────────────── */
#battle-view { position: relative; width: 100%; height: 100%; overflow: hidden; }
#fv-board { width: 100%; height: 100%; display: block; cursor: grab; }
#fv-board:active { cursor: grabbing; }

#fv-top {
  position: fixed; top: 10px; left: 14px; right: 14px; z-index: 20;
  display: grid; grid-template-columns: 320px 1fr 320px; gap: 12px; pointer-events: none;
}
.fv-side, .fv-turn {
  pointer-events: auto; background: var(--bg-panel);
  border: 1px solid rgba(180, 134, 70, 0.52); border-radius: 9px; padding: 9px 13px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.65);
}
.fv-turn { justify-self: center; text-align: center; min-width: 310px; }
.fv-side-name { font-size: 13px; font-weight: 800; display: flex; justify-content: space-between; align-items: center; }
.fv-you .fv-side-name { color: #8bc7ff; }
.fv-foe .fv-side-name { color: #ff9c8e; }
.fv-hp-bar { height: 7px; background: rgba(255, 255, 255, 0.1); border-radius: 4px; overflow: hidden; margin: 6px 0; }
.fv-hp-fill { height: 100%; transition: width 0.25s ease; }
.fv-you .fv-hp-fill { background: linear-gradient(90deg, #2773d8, #6cc2ff); }
.fv-foe .fv-hp-fill { background: linear-gradient(90deg, #b82b1e, #ff7056); }
.fv-side-meta { display: flex; justify-content: space-between; font-size: 12px; color: #d9cbb3; }
.fv-crystals { color: #76d8ff; font-weight: 800; }

#fv-inspect {
  position: fixed; top: 106px; left: 14px; width: 256px; z-index: 20;
  background: var(--bg-panel); border: 1px solid rgba(180, 134, 70, 0.45);
  border-radius: 9px; padding: 10px 12px; font-size: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}
#fv-inspect img { width: 100%; height: 96px; object-fit: cover; border-radius: 6px; margin-bottom: 6px; border: 1px solid rgba(255, 224, 175, 0.2); }

#fv-right {
  position: fixed; top: 106px; right: 14px; width: 236px; z-index: 20;
  display: flex; flex-direction: column; gap: 8px;
}
.fv-mini-wrap, #fv-wells, #fv-logbox {
  background: var(--bg-panel); border: 1px solid rgba(180, 134, 70, 0.45);
  border-radius: 9px; padding: 8px 10px; font-size: 11px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}
#fv-mini { width: 100%; height: 116px; display: block; border-radius: 5px; cursor: pointer; }
.fv-well-row { display: flex; justify-content: space-between; padding: 2px 0; }
#fv-log { margin: 6px 0 0; padding-left: 16px; max-height: 150px; overflow-y: auto; color: #cbbba2; line-height: 1.4; }

#fv-hint {
  position: fixed; bottom: 184px; left: 50%; transform: translateX(-50%); z-index: 22;
  background: rgba(15, 11, 9, 0.9); border: 1px solid rgba(235, 172, 72, 0.55);
  border-radius: 20px; padding: 5px 16px; font-size: 12px; color: #fae6be; pointer-events: none;
}

#fv-bottom {
  position: fixed; bottom: 10px; left: 14px; right: 14px; z-index: 24;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; pointer-events: none;
}
#fv-hand {
  pointer-events: auto; display: flex; gap: 8px; align-items: flex-end;
  max-width: calc(100% - 250px); overflow-x: auto; padding: 6px 4px 2px;
}
.hand-card {
  width: 146px; min-width: 146px; border-radius: 9px; overflow: hidden; cursor: pointer;
  background: #171210; border: 2px solid #7c776f; position: relative;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.hand-card:hover:not(.unplayable) { transform: translateY(-10px); }
.hand-card.selected { transform: translateY(-16px); border-color: #ffe27a !important; box-shadow: 0 0 24px rgba(255, 214, 96, 0.78); }
.hand-card.unplayable { opacity: 0.56; }
.hand-card .seal-art-wrap { height: 74px; }
.hand-card.grade-Mythic .seal-art-wrap { height: 80px; }
.hand-card .seal-gem { width: 7px; height: 7px; }
.hand-card.grade-Legendary .seal-gem, .hand-card.grade-Mythic .seal-gem { width: 8px; height: 8px; }
.hand-card .seal-info { padding: 7px 7px 6px; gap: 2px; }
.hand-card .seal-name { font-size: 11px; }
.hand-card .seal-text { font-size: 9.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

#fv-actions {
  pointer-events: auto; display: flex; flex-direction: column; gap: 6px; width: 220px;
}
.fv-btn-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.fv-btn-row button { padding: 6px 4px; font-size: 11px; }
.fv-end {
  padding: 12px 14px; font-size: 15px; font-weight: 800; letter-spacing: 0.04em;
  background: linear-gradient(180deg, #d4942e 0%, #8f5412 100%);
  border-color: #ffde85; color: #fff8e6; text-transform: uppercase;
}

.toast-bar {
  position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 120;
  background: rgba(18, 12, 10, 0.96); border: 1px solid var(--border-gold);
  color: #ffe9b8; padding: 9px 18px; border-radius: 8px; font-size: 13px; font-weight: 600;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.7);
}
