/* Table readability and expressive, optional motion. */
@font-face{font-family:'FallAbyss Forged';src:url('../assets/fonts/abyssfall-forged.ttf') format('truetype');font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:'FallAbyss Calligraphy';src:url('../assets/fonts/fallabyss-calligraphy-v2.ttf') format('truetype');font-weight:400;font-style:normal;font-display:swap;unicode-range:U+0041-005A,U+0061-007A,U+00C0-00FF}
:is(h1,h2,h3,h4,button,.title,.brand-home,.topbar nav,.deck-box-title,.phtitle,.collection-link,.pack-name,.tile-effects-heading) {
  font-family:'FallAbyss Calligraphy',Georgia,serif;
  font-weight:400;
  letter-spacing:.045em;
  text-transform:none;
  font-variant:normal;
}
/* Page palettes carry through to the matching home tiles. The original engraved borders supply texture. */
/* Real lowercase stays lowercase, including component headings and small-screen menus.
   Paragraphs, rules, inputs, numeric badges and the image wordmark keep their fonts. */
body :is(h1,h2,h3,h4,button,.title,.brand-home,.topbar nav,.deck-box-title,.phtitle,.collection-link,.pack-name,.tile-effects-heading){font-family:'FallAbyss Calligraphy',Georgia,serif!important;text-transform:none!important;font-variant:normal!important;font-weight:400!important}
.armory-eyebrow,.artbook-eyebrow,.ranked-eyebrow,.artist-state,.vs-label,.fp-who{text-transform:none!important}
:root {
  --metal-light:#f0cf8e;
  --metal-dark:#81602f;
  --section-tint:#45334b;
  --section-shadow:#1d1323;
}
html[data-section=generator],.home .tile[href="generator.html"] {
  --frame:url('../assets/ui/themes/generator.webp');
  --gold:#e3b393;--line:#8e624b;--metal-light:#eeb191;--metal-dark:#7d4632;
  --section-tint:#4e302a;--section-shadow:#221415;
}
html[data-section=deck],.home .tile[href="deck.html"] {
  --frame:url('../assets/ui/themes/deck.webp');
  --gold:#ccdfed;--line:#637e94;--metal-light:#d5e7f6;--metal-dark:#536a7d;
  --section-tint:#2c4356;--section-shadow:#131e2b;
}
html[data-section=collection],.home .tile[href="collection.html"] {
  --frame:url('../assets/ui/themes/collection.webp');
  --gold:#c5dbbd;--line:#658267;--metal-light:#c3d2a5;--metal-dark:#58725a;
  --section-tint:#334a3d;--section-shadow:#14231c;
}
html[data-section=packs],.home .tile[href="packs.html"] {
  --frame:url('../assets/ui/themes/packs.webp');
  --gold:#f1ca83;--line:#997245;--metal-light:#f1cb80;--metal-dark:#856030;
  --section-tint:#534027;--section-shadow:#251b15;
}
html[data-section=profile],.home .tile[href="profile.html"] {
  --frame:url('../assets/ui/themes/profile.webp');
  --gold:#eed0da;--line:#926778;--metal-light:#e6bfcc;--metal-dark:#81586c;
  --section-tint:#4d2c3c;--section-shadow:#241723;
}
html[data-section=rules],.home .tile[href="rules.html"] {
  --frame:url('../assets/ui/themes/rules.webp');
  --gold:#e1d0b1;--line:#8a7762;--metal-light:#d9cebc;--metal-dark:#6d6255;
  --section-tint:#4a4033;--section-shadow:#211c19;
}
html[data-section=game],.home .tile[href^="game.html"] {
  --frame:url('../assets/ui/themes/game.webp');
  --gold:#f0c2ad;--line:#8a5151;--metal-light:#e7b49b;--metal-dark:#7c4646;
  --section-tint:#4c292d;--section-shadow:#221318;
}
html[data-section] :is(.topbar,.tile,.pbox,.modal,.promptbox,.rules,.side-block,.gen .panel,.profile-row,.ws-col,.ws-wallet,.ws-pop,.deck-tool-items,.preview-header,.pk-body,.pk-top) {
  background:radial-gradient(ellipse at 12% 0%,var(--section-tint),transparent 76%),
    linear-gradient(140deg,var(--section-shadow),#100d15 90%)!important;
  border-color:var(--metal-dark)!important;
  box-shadow:inset 0 1px 0 var(--metal-light),inset 0 -1px 0 var(--metal-dark),0 10px 25px #0008!important;
}
html[data-section] :is(.tile h2,.topbar .title,.topbar .brand-home,.deck-box-title,.pk-body b) {
  color:var(--metal-light);
}
html[data-section] .deck-box-title {
  background:linear-gradient(145deg,var(--section-tint),var(--section-shadow));
  border-color:var(--metal-dark);
  box-shadow:inset 0 1px 0 var(--metal-light);
}
html[data-section] .packs-tile {
  box-shadow:inset 0 1px 0 var(--metal-light),0 0 23px #bd8f3f55!important;
}
/* Each menu has its own mist over the abyss (10 Nov 2026). Home keeps the violet abyss;
   the game table keeps the board palette chosen by the player. Same noise and motion as theme.css. */
@media screen {
  /* Card Workshop: forge embers */
  html[data-section=generator] { --abyss-violet: 190, 90, 40; background: #070405; }
  html[data-section=generator] body::before {
    background:
      url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='700' height='700'><filter id='n' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='.0032' numOctaves='3' seed='7' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.42  0 0 0 0 0.16  0 0 0 0 0.05  1.7 0 0 0 -.78'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
      url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='900' height='900'><filter id='n' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='.0024' numOctaves='3' seed='21' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.4  0 0 0 0 0.05  0 0 0 0 0.04  0 1.8 0 0 -.95'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
      radial-gradient(circle at 50% 50%, rgba(var(--abyss-violet), .22), transparent 30%),
      #070405;
  }
  /* My Decks: cold steel */
  html[data-section=deck] { --abyss-violet: 60, 110, 190; background: #04050a; }
  html[data-section=deck] body::before {
    background:
      url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='700' height='700'><filter id='n' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='.0032' numOctaves='3' seed='7' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.24  0 0 0 0 0.46  1.7 0 0 0 -.78'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
      url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='900' height='900'><filter id='n' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='.0024' numOctaves='3' seed='21' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.18  0 0 0 0 0.08  0 0 0 0 0.36  0 1.8 0 0 -.95'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
      radial-gradient(circle at 50% 50%, rgba(var(--abyss-violet), .22), transparent 30%),
      #04050a;
  }
  /* Collection: deep moss */
  html[data-section=collection] { --abyss-violet: 70, 150, 90; background: #040705; }
  html[data-section=collection] body::before {
    background:
      url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='700' height='700'><filter id='n' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='.0032' numOctaves='3' seed='7' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.28  0 0 0 0 0.15  1.7 0 0 0 -.78'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
      url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='900' height='900'><filter id='n' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='.0024' numOctaves='3' seed='21' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.26  0 0 0 0 0.24  0 0 0 0 0.06  0 1.8 0 0 -.95'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
      radial-gradient(circle at 50% 50%, rgba(var(--abyss-violet), .22), transparent 30%),
      #040705;
  }
  /* Card packs: treasure gold */
  html[data-section=packs] { --abyss-violet: 200, 140, 50; background: #070506; }
  html[data-section=packs] body::before {
    background:
      url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='700' height='700'><filter id='n' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='.0032' numOctaves='3' seed='7' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.36  0 0 0 0 0.23  0 0 0 0 0.05  1.7 0 0 0 -.78'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
      url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='900' height='900'><filter id='n' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='.0024' numOctaves='3' seed='21' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.38  0 0 0 0 0.08  0 0 0 0 0.18  0 1.8 0 0 -.95'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
      radial-gradient(circle at 50% 50%, rgba(var(--abyss-violet), .22), transparent 30%),
      #070506;
  }
  /* Profiles: wine and rose */
  html[data-section=profile] { --abyss-violet: 190, 70, 130; background: #070408; }
  html[data-section=profile] body::before {
    background:
      url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='700' height='700'><filter id='n' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='.0032' numOctaves='3' seed='7' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.44  0 0 0 0 0.1  0 0 0 0 0.3  1.7 0 0 0 -.78'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
      url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='900' height='900'><filter id='n' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='.0024' numOctaves='3' seed='21' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.2  0 0 0 0 0.06  0 0 0 0 0.4  0 1.8 0 0 -.95'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
      radial-gradient(circle at 50% 50%, rgba(var(--abyss-violet), .22), transparent 30%),
      #070408;
  }
  /* Rules: old parchment */
  html[data-section=rules] { --abyss-violet: 170, 130, 80; background: #060504; }
  html[data-section=rules] body::before {
    background:
      url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='700' height='700'><filter id='n' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='.0032' numOctaves='3' seed='7' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.3  0 0 0 0 0.22  0 0 0 0 0.13  1.7 0 0 0 -.78'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
      url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='900' height='900'><filter id='n' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='.0024' numOctaves='3' seed='21' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.22  0 0 0 0 0.12  0 0 0 0 0.08  0 1.8 0 0 -.95'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
      radial-gradient(circle at 50% 50%, rgba(var(--abyss-violet), .22), transparent 30%),
      #060504;
  }
  /* Bridgeguard: sea below the bridge */
  html[data-section=bridgeguard] { --abyss-violet: 50, 150, 160; background: #03060a; }
  html[data-section=bridgeguard] body::before {
    background:
      url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='700' height='700'><filter id='n' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='.0032' numOctaves='3' seed='7' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.05  0 0 0 0 0.27  0 0 0 0 0.31  1.7 0 0 0 -.78'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
      url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='900' height='900'><filter id='n' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='.0024' numOctaves='3' seed='21' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.1  0 0 0 0 0.34  0 1.8 0 0 -.95'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
      radial-gradient(circle at 50% 50%, rgba(var(--abyss-violet), .22), transparent 30%),
      #03060a;
  }
}
.modal.mull{width:min(1140px,97vw);max-width:1140px;overflow:visible}.mullhand{flex-wrap:nowrap;gap:12px;padding:18px 0 32px;overflow:visible}.mullcard{width:clamp(100px,16vw,194px);flex:0 1 194px;transition:transform .18s;transform-origin:50% 55%;box-shadow:0 7px 18px #0008!important}.mullcard:hover,.mullcard:focus-visible{transform:translateY(-12px) scale(1.55);z-index:15;filter:brightness(1.06)}.mullcard.on .tick{inset:auto 7px 7px auto;width:32px;height:32px;font-size:24px;background:#18111ee8}
.handzone{bottom:-87px;padding-top:25px;overflow:visible}
.unit .badges{gap:1px;bottom:-5px;flex-wrap:nowrap}.badge-s{font-size:10px;padding:1px 3px;border-radius:4px;border-color:#b08b5688;box-shadow:0 1px 3px #000}.badge-s.move{background:#2b4b58}.badge-s.melee{background:#69512b}.badge-s.armor{background:#454660}.badge-s.life{background:#783541}
.inspect-rules{font-size:13px;line-height:1.45;padding:10px 12px;background:#120e1bed;border:1px solid #8e7146;border-radius:3px;user-select:text}.inspect-rules p{margin:7px 0}.inspect-rules strong{color:var(--gold);font-size:16px}.col .inspector{max-height:calc(100vh - 190px);padding-bottom:15px}.inspect-rules em{color:#d9c194}.fight img{width:100%;height:100%;pointer-events:none}
.unit.focus.reaction-ally{box-shadow:0 0 0 2px #76b8e1,0 0 19px #64a9da99!important;animation:reactionAlly 1.6s ease-in-out infinite!important}.unit.focus.reaction-enemy{box-shadow:0 0 0 2px #d48e92,0 0 19px #ce707c99!important;animation:reactionEnemy 1.6s ease-in-out infinite!important}.reaction-link{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;z-index:8}.reaction-link line{stroke:#edd19a;stroke-width:.65;stroke-dasharray:2 1;filter:drop-shadow(0 0 2px #000);animation:reactionFlow 1.4s linear infinite}
.combat-card{position:fixed;background:center/cover;z-index:145;pointer-events:none;box-shadow:0 12px 30px #000c,0 0 0 2px #d5b16d;border-radius:4px}.combat-card>*{display:none}.battle-sigil{position:fixed;aspect-ratio:1;border:2px solid var(--fx);border-radius:50%;box-shadow:0 0 18px var(--fx),inset 0 0 16px var(--fx);z-index:150;pointer-events:none}.battle-sigil:before,.battle-sigil:after{content:'';position:absolute;inset:10%;border:1px solid var(--fx);transform:rotate(45deg)}.battle-sigil:after{inset:23%;transform:rotate(-25deg)}.fx-evocation{border-radius:12%;border-style:dashed}.fx-necromancy{border-style:double;border-width:5px}.fx-illusion{border-style:dotted}.fx-transmutation:after{border-radius:50%}.fx-divination:before{transform:scaleY(.5) rotate(45deg)}
@keyframes reactionAlly{50%{filter:drop-shadow(0 0 5px #76b8e1)}}@keyframes reactionEnemy{50%{filter:drop-shadow(0 0 5px #d48e92)}}@keyframes reactionFlow{to{stroke-dashoffset:-12}}
.pack-offer{transition:transform .25s,box-shadow .25s}.offer-art{animation:offerFloat 4.8s ease-in-out infinite;transform-origin:50% 75%;transition:scale .25s}.pack-offer:nth-child(2) .offer-art{animation-delay:-1.6s}.pack-offer:nth-child(3) .offer-art{animation-delay:-3.2s}.pack-offer:hover .offer-art{scale:1.1}.pack-offer:hover{transform:translateY(-4px)}.pack-quantity{position:absolute;right:-16px;bottom:7px;min-width:56px;padding:7px;border:1px solid #e1c079;background:linear-gradient(#5b435b,#17101e);color:#fff0c9;font:bold 22px Georgia;text-shadow:0 2px #000;box-shadow:0 4px 12px #0008;transform:rotate(5deg)}.pack-quantity small{display:block;font-size:10px;color:#e2c892}.offer-art:before{content:'';position:absolute;inset:0;z-index:-1;transform:translate(9px,6px);background:repeating-linear-gradient(90deg,#443849 0 2px,#cbb78f 2px 3px);border:1px solid #a88b57;border-radius:7px}
@keyframes offerFloat{0%,100%{transform:translateY(0) rotate(-5deg) scale(1)}50%{transform:translateY(-7px) rotate(-3deg) scale(1.025)}}
.back-arrow{display:inline-grid;place-items:center;width:32px;height:32px;margin-right:4px;font-size:23px;padding:0;flex:none}.brand-home{display:inline-flex;align-items:center;color:inherit;text-decoration:none;flex:none}.brand-home img{margin:0}.home-back{position:absolute;left:18px;top:12px}.collection-head{display:flex;align-items:center;justify-content:space-between;gap:15px;flex-wrap:wrap}.collection-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(145px,1fr));gap:18px;margin-top:24px}.collection-card{padding:0!important;background:none!important;border:0!important;box-shadow:none!important;text-align:center;cursor:zoom-in}.collection-card img{width:100%;height:auto;display:block}.collection-card span{display:block;color:var(--gold);font-size:12px;padding:7px}.collection-tools{display:flex;gap:8px;flex-wrap:wrap}.collection-main{max-width:1250px;margin:24px auto;padding:0 24px}.collection-grid .collection-card:hover{transform:translateY(-4px)}
@media(max-width:650px){.mullhand{flex-wrap:wrap;gap:8px}.mullcard{width:27vw;flex-basis:27vw}.mullcard:hover{transform:scale(1.15)}.inspect-rules{font-size:12px}}
@media(prefers-reduced-motion:reduce){.mullcard,.pack-offer,.offer-art{transition:none;animation:none}.unit.focus,.reaction-link line{animation:none!important}}

#inviteLink{width:100%;margin:8px 0;font:12px system-ui}.fx-abjuration:before{border-radius:8% 8% 48% 48%;transform:scale(.8,1.05)}.fx-conjuration:before{border-radius:50%;inset:3% 24%;transform:rotate(20deg)}.fx-enchantment:after{border-radius:45%;transform:rotate(45deg) scale(1.2)}.fx-ranged{border-style:dashed;border-width:1px}.fx-ability:after{border-radius:50%}
.home .tile h2{font-size:clamp(17px,1.65vw,21px);gap:8px;letter-spacing:.025em}
.ai-tile-wrap { position: relative; display: grid; min-width: 0; }
.ai-help {
  position: absolute; top: 0; left: 12px; z-index: 2; transform: translateY(-50%);
  display: flex; align-items: center; gap: 6px;
}
.play-tutorial, .home-rules {
  border: 1px solid #d8ad68; border-radius: 6px; padding: 5px 10px;
  background: linear-gradient(150deg,#4e335a,#211729); color: #ffe2a8;
  box-shadow: 0 3px 12px #07040ac9, 0 0 10px #d8ad6840;
  font: 700 12px/1.25 system-ui; text-decoration: none;
}
.home-rules { border-color: #987d61; background: #211729; box-shadow: 0 3px 8px #07040ac9; }
.play-tutorial:hover, .play-tutorial:focus-visible, .home-rules:hover, .home-rules:focus-visible {
  background: #593c66; color: #fff0cb; outline: 1px solid #ffe1a2; outline-offset: 2px;
}
.collection-card img{aspect-ratio:481/660;background:#1a1423;object-fit:contain}.collection-tools{align-items:center}.collection-tools label{display:inline-flex;align-items:center;gap:5px;white-space:nowrap}
.battle-trail{position:fixed;height:3px;z-index:149;pointer-events:none;transform-origin:left center;background:linear-gradient(90deg,transparent,var(--fx));box-shadow:0 0 12px var(--fx);border-radius:50%}
.tcell.faultline{outline:2px dashed #ef9b69;outline-offset:-4px;box-shadow:inset 0 0 17px #b54732cc}
.tile-effect-badge {
  position:absolute;left:2px;top:2px;z-index:5;display:grid;place-items:center;
  width:22px;height:22px;padding:0;border:1px solid #d8b373;border-radius:50%;
  background:#2c1936;color:#ffe0a0;font-size:14px;line-height:1;
}
.tile-effect-badge:focus-visible { outline:2px solid #ffe0a0;outline-offset:2px; }
.tile-effects {
  width:100%;box-sizing:border-box;
  padding:10px;margin-top:8px;border:1px solid #987347;border-radius:6px;
  background:#201629;color:#f3e5c7;overflow:auto;max-height:38vh;
}
.tile-effects-heading { display:flex;align-items:center;justify-content:space-between;gap:6px; }
.tile-effects-heading button { padding:0 6px; }
.tile-effect { border-top:1px solid #6d5142;margin-top:8px;padding-top:8px; }
.tile-effect p { margin:4px 0;line-height:1.35; }
.tile-effect small { color:#d9bb90; }
body.card-dragging, body.card-dragging * { user-select:none; }

.unit .ash-mark{position:absolute;top:3px;right:3px;z-index:2;padding:1px 5px;border:1px solid #e9a568;border-radius:50%;background:#2c1720;color:#ffca8b;box-shadow:0 0 8px #ee7c42}

.unit .oathplate-mark{position:absolute;top:3px;right:3px;z-index:2;padding:1px 5px;border:1px solid #e2ce95;border-radius:50%;background:#202437;color:#ffe0a0;box-shadow:0 0 8px #d7b762}
.unit .ash-mark + .oathplate-mark{right:28px}

/* Menu balances stay visible while scrolling, with space reserved above navigation. */
body.has-menu-currencies { padding-top: 46px; }
body.has-menu-currencies > .topbar { position: sticky; top: 46px; z-index: 110; }
.menu-currencies {
  position: fixed; top: 0; right: 12px; z-index: 120;
  display: flex; align-items: center; gap: 20px; min-height: 38px; padding: 3px 14px;
  color: #f4ddb0; background: linear-gradient(160deg, #292018f5, #100c16f5);
  border: 1px solid #9d7b47; border-top: 0; border-radius: 0 0 8px 8px;
  box-shadow: 0 3px 10px #0009; font: 13px/1.2 Georgia, serif;
}
.menu-currency { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.menu-currency img { display: block; width: 26px; height: 30px; object-fit: contain; }
.menu-currency b { font: 700 14px/1.2 system-ui, sans-serif; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  .menu-currencies { right: 6px; max-width: calc(100vw - 12px); gap: 16px; padding-inline: 10px; }
  .menu-currency > span { display: none; }
}

/* The wordmark and the shop card share the hero without covering its title. */
.home .hero .hero-brand { flex: 1 1 auto; min-width: 0; }
.home .hero .fallabyss-title { display: block; width: min(100%, 500px); }
.home .hero img.wordmark { display:block; width:100%; height:auto; }
.topbar img.wordmark { display:block; width:105px; height:auto; max-height:none; object-fit:contain; }
.home .hero .pack-callout {
  display:inline-flex; flex:0 0 auto; flex-direction:column; align-items:center; gap:7px;
  padding:8px; text-decoration:none; white-space:nowrap; color:#ffe3a1;
  font:400 clamp(13px,2.4vw,20px)/1.2 'FallAbyss Calligraphy',Georgia,serif;
  letter-spacing:.035em; text-shadow:0 2px 5px #000;
}
.pack-callout-art {
  position:relative; display:grid; place-items:center; isolation:isolate;
  width:clamp(80px,14vw,165px); aspect-ratio:1.3;
}
.pack-callout-slot { position:absolute; width:55%; height:100%; }
.home .hero .pack-callout-art img {
  position:absolute; inset:0; display:block; width:100%; height:100%; object-fit:contain;
  opacity:0;
  filter:drop-shadow(0 3px 7px #05030a) drop-shadow(0 0 7px #a666d878);
}
.pack-callout-card {
  z-index:1;
  animation:hero-pack-float 3.3s ease-in-out infinite;
}
.pack-callout-card img { animation:hero-pack-morph 13.8s ease-in-out infinite; }
.pack-callout-side { animation:hero-pack-pop 4.6s ease-in-out infinite; }
.pack-callout-side img { animation:hero-pack-side-art 13.8s steps(1,end) infinite; }
.pack-callout-slot img:nth-child(2) { animation-delay:-9.2s; }
.pack-callout-slot img:nth-child(3) { animation-delay:-4.6s; }
.pack-callout-left { --pack-out:-40%; --pack-angle:-22deg; }
.pack-callout-right { --pack-out:40%; --pack-angle:22deg; animation-delay:.18s; }
.pack-callout:is(:hover,:focus-visible) .pack-callout-art img {
  filter:drop-shadow(0 3px 7px #05030a) drop-shadow(0 0 10px #ffd280a0);
}
.pack-callout:focus-visible { outline:2px solid #f2cb7a; outline-offset:5px; border-radius:6px; }
@keyframes hero-pack-float {
  0%,100% { transform:translateY(1px) rotate(-9deg) scale(.97); }
  50% { transform:translateY(-9px) rotate(4deg) scale(1.05); }
}
@keyframes hero-pack-pop {
  0%,16%,100% { transform:translateY(4%) scale(.64); opacity:0; }
  31%,77% { transform:translate(var(--pack-out),5%) rotate(var(--pack-angle)) scale(.82); opacity:1; }
  38% { transform:translate(var(--pack-out),0) rotate(var(--pack-angle)) scale(.9); opacity:1; }
}
@keyframes hero-pack-morph {
  0%, 29% { opacity:1; transform:scale(1); }
  33.333%, 96% { opacity:0; transform:scale(.94); }
  100% { opacity:1; transform:scale(1); }
}
@keyframes hero-pack-side-art {
  0% { opacity:1; }
  33.333%, 100% { opacity:0; }
}
@media(max-width:640px) {
  .home .hero { gap:12px; }
  .home .hero .hero-emblem img { width:clamp(42px,14vw,88px); }
  .home .hero .pack-callout { padding:3px; }
}
@media(prefers-reduced-motion:reduce) {
  .pack-callout-slot, .home .hero .pack-callout-art img { animation:none; }
  .home .hero .pack-callout-art img:first-child { opacity:1; }
  .pack-callout-side { transform:translate(var(--pack-out),5%) rotate(var(--pack-angle)) scale(.82); }
}
.home .home-tile-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.home .home-hub {
  isolation: isolate;
  overflow: hidden;
  position: relative;
  padding: clamp(10px,2vw,22px);
}
.home .home-hub:hover { transform: none; }
.home .play-hub {
  --frame: url('../assets/ui/themes/game.webp');
  --metal-light: #f0c2ad;
  --metal-dark: #7c4646;
  --section-tint: #4c292d;
  --section-shadow: #221318;
}
.home .cards-hub {
  --frame: url('../assets/ui/themes/deck.webp');
  --metal-light: #d5e7f6;
  --metal-dark: #536a7d;
  --section-tint: #2c4356;
  --section-shadow: #131e2b;
}
.home-hub::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.play-hub::before {
  background: linear-gradient(90deg,#24151c 10%,#24151cb0 50%,#24151c18),
    url('../assets/ui/bridge.webp') center 48% / cover;
  opacity: .52;
}
.cards-hub::before {
  background: url('../assets/ui/back-barracks.jpg') center / cover;
  inset: -18% -2% -18% auto;
  width: 45%;
  transform: rotate(13deg);
  opacity: .4;
  mask-image: linear-gradient(90deg,transparent,#000 60%);
}
.home-hub-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.home-hub-heading h2 { margin: 0; }
.home-hub-rules { color: var(--metal-light); text-underline-offset: 3px; font-size: .85rem; }
.home-hub-links { display: grid; gap: 6px; max-width: 20rem; }
.home-hub-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--metal-light);
  background: #100c17bf;
  border: 1px solid var(--metal-dark);
  border-radius: 5px;
  padding: 7px 10px;
  text-decoration: none;
}
.home-hub-links a:hover { border-color: var(--metal-light); background: #100c17; }
.home-hub-links a:focus-visible, .home-hub-rules:focus-visible { outline: 2px solid var(--metal-light); outline-offset: 2px; }
.home-hub-links img { width: 19px; height: 19px; }
/* ---------- Play vs AI: the Play tile turns into a deck selector (a fanned hand of deck boxes) ---------- */
.home .play-hub.is-choosing > .home-hub-heading, .home .play-hub.is-choosing > .home-hub-links { display: none; }
.ai-picker { display: grid; gap: 10px; animation: pickerIn .42s cubic-bezier(.2, .8, .25, 1); }
@keyframes pickerIn { from { opacity: 0; transform: perspective(700px) rotateX(-14deg) translateY(-8px); } }
.ai-picker-head { display: flex; align-items: center; gap: 10px; }
.ai-picker-head h2 { margin: 0; }
.ai-back { flex: none; width: 32px; height: 32px; padding: 0; border-radius: 50%; font-size: 20px; line-height: 1; background: #120b11cc; border: 1px solid var(--metal-dark); color: var(--metal-light); }
.ai-back:hover { border-color: var(--metal-light); }
.ai-resume { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 7px 12px; text-decoration: none; color: #f3e1cf; border: 1px solid #b18c51; border-radius: 6px; background: linear-gradient(90deg, #2a1416f2, #2a1416b0); }
.ai-resume:hover { border-color: #f6d79b; box-shadow: 0 0 14px #f6d79b33; }
.ai-resume b { font-family: 'FallAbyss Calligraphy',Georgia,serif; font-weight: 400; letter-spacing: .04em; color: #f6d79b; }
.ai-resume small { opacity: .8; font-size: .78rem; }
.ai-resume span { margin-left: auto; color: #f6d79b; font-size: .85rem; }
/* the hand: five deck boxes, fanned and overlapping, the raised one in front */
.ai-fan { --w: clamp(84px, 9.2vw, 122px); position: relative; display: flex; justify-content: center; align-items: flex-end; height: calc(var(--w) / .76 + 34px); padding-top: 14px; }
.ai-fan-card {
  position: relative; flex: none; width: var(--w); padding: 0; margin: 0 calc(var(--w) * -.25); border: 0; background: none; cursor: pointer;
  transform-origin: 50% 130%; transform: rotate(calc(var(--off) * 6deg)) translateY(calc(var(--abs) * 6px));
  transition: transform .28s cubic-bezier(.2, .9, .3, 1.25), filter .28s; z-index: calc(10 - var(--abs));
  animation: fanDeal .55s cubic-bezier(.2, .9, .3, 1.15) both; animation-delay: calc(var(--i) * 65ms + 80ms);
}
@keyframes fanDeal { from { opacity: 0; transform: translateY(40px) rotate(0deg) scale(.8); } }
.ai-fan-card .deck-box-body { display: block; aspect-ratio: .76; transform: none; }
.ai-fan-card .deck-box-art { display: block; }
.ai-fan-card .deck-box-seal { width: 26px; height: 32px; left: calc(50% - 13px); bottom: 9px; }
.ai-fan-card .deck-box-body:before { border-width: 8px; }
.ai-fan-card:not(.is-up) { filter: brightness(.68) saturate(.85); }
.ai-fan-card.is-up { z-index: 20; filter: none; transform: rotate(calc(var(--off) * 2deg)) translateY(-16px) scale(1.12); }
.ai-fan-card.is-up .deck-box-body { border-color: #f6d79b; box-shadow: -7px 6px 0 #19121d, -9px 7px 0 #d6b56a, 0 0 0 1px #f6d79b, 0 0 26px #ffb46a99, 0 18px 26px #000d; }
.ai-fan-card:focus-visible { outline: none; }
.ai-fan-card:focus-visible .deck-box-body { outline: 2px solid #ffe2a4; outline-offset: 3px; }
.ai-mark { position: absolute; z-index: 4; top: 7px; right: 7px; width: 13px; height: 13px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff2c8, #e0a64a 55%, #7a4a14); box-shadow: 0 0 8px #ffcf7a; }
.ai-focus { display: grid; justify-items: center; gap: 1px; min-height: 42px; text-align: center; }
.ai-focus-name { font-family: 'FallAbyss Calligraphy',Georgia,serif; font-weight: 400; font-size: clamp(1.05rem, 1.8vw, 1.35rem); letter-spacing: .05em; color: #f6d79b; text-shadow: 0 2px 0 #000, 0 0 14px #ff9a4a55; }
.ai-focus-info { color: #e7cdb9; opacity: .85; font-size: .8rem; }
.ai-actions { display: flex; align-items: center; justify-content: center; gap: 14px; }
.ai-battle { padding: 8px 26px; font-size: 1rem; letter-spacing: .06em; }
.ai-all { color: var(--metal-light); font-size: .85rem; text-underline-offset: 3px; }
/* Battle: the chosen deck rises out of the hand, the others fall back */
.ai-picker.launching .ai-fan-card:not(.is-up) { opacity: 0; transform: translateY(30px) rotate(calc(var(--off) * 12deg)); transition: transform .35s ease-in, opacity .35s; }
.ai-picker.launching .ai-fan-card.is-up { transform: translateY(-46px) scale(1.22); transition: transform .4s cubic-bezier(.3, 1.4, .5, 1); }
.ai-picker.launching .ai-fan-card.is-up .deck-box-body { box-shadow: 0 0 0 2px #f6d79b, 0 0 48px #ffb46a, 0 22px 30px #000d; }
@media (max-width: 590px) {
  .ai-fan { --w: min(25vw, 112px); }
}
@media (prefers-reduced-motion: reduce) {
  .ai-picker, .ai-fan-card { animation: none; }
  .ai-fan-card, .ai-picker.launching .ai-fan-card { transition: none; }
}
@media (max-width: 590px) {
  .home .home-tile-grid { grid-template-columns: minmax(0,1fr); }
}
.home-tagline { font-size: 17px; max-width: 560px; }
@media (max-width: 590px) {
  .home { margin-top: 8px; padding-inline: max(10px,env(safe-area-inset-left)) max(10px,env(safe-area-inset-right)); }
  .home .home-profile { display: flex; align-items: center; min-height: 44px; padding-inline: 6px; }
  .home .hero { display: grid; grid-template-columns: 54px minmax(0,1fr); gap: 4px 10px; }
  .home .hero .hero-emblem { display: grid; place-items: center; min-height: 44px; }
  .home .hero .hero-emblem img { width: 50px; }
  .home .hero h1 { margin: 0; }
  .home-tagline { margin: 3px 0; font-size: .85rem; line-height: 1.3; }
  .home-edition { margin: 0; font-size: .75rem; }
  .home .hero .pack-callout {
    grid-column: 1 / -1;
    justify-self: center;
    flex-direction: row;
    gap: 8px;
    min-height: 48px;
    padding: 2px 12px 2px 8px;
    border: 1px solid #7c5e47;
    border-radius: 6px;
    background: #22142c;
    font-size: 15px;
  }
  .home .hero .pack-callout-art { width: 50px; }
  .home .home-tile-grid { gap: 10px; margin-top: 12px; }
  .home .home-hub, .home .home-profile-tile { border-width: 9px !important; padding: 8px 10px; }
  .home-hub-heading { min-height: 44px; margin-bottom: 4px; }
  .home-hub-rules { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 10px; }
  .home-hub-links { max-width: none; }
  .home-hub-links a { min-height: 46px; padding-inline: 12px; }
  .home-profile-tile h2, .home-profile-tile p { margin: 4px 0; }
}
.home-profile-controls {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 2px 7px;
  border: 1px solid #735344;
  border-radius: 24px;
  background: #211528;
}
.home-avatar {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #ab8251;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%,#704968,#2b1a35 75%);
  color: #ffe4ae;
  font: 700 12px/1 system-ui,sans-serif;
}
.home-profile-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #eed8ba; font-size: .875rem; }
.home-profile-settings {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #eec990;
}
.home-profile-settings svg { width: 19px; height: 19px; }
.home-profile-settings:is(:hover,:focus-visible) { color: #fff0c9; background: #4d3453; }
.home-profile-settings:focus-visible { outline: 2px solid #eec990; outline-offset: 2px; }
@media (max-width: 590px) {
  .home-profile-controls { gap: 6px; margin-bottom: 4px; }
  .home-profile-settings { flex-basis: 44px; width: 44px; height: 44px; }
}
.home-profile-controls { border-radius: 50px; padding: 3px 4px; }
.home-avatar {
  --portrait-size: clamp(58px,8vw,84px);
  flex-basis: var(--portrait-size); width: var(--portrait-size); height: var(--portrait-size);
  border: 3px double #e4bd78;
  box-shadow: 0 0 0 2px #4a2d2e, inset 0 0 9px #17101c, 0 0 13px #a9705655;
  background-color: #302330; background-repeat: no-repeat; background-origin: padding-box;
}
.profile-portrait-section { margin-bottom: 12px; padding: 12px; }
.profile-portraits { display: grid; grid-template-columns: repeat(auto-fit,minmax(110px,1fr)); gap: 8px; }
.profile-portraits button { display: grid; justify-items: center; align-content: start; gap: 8px; min-height: 44px; padding: 8px 4px; }
.profile-portraits button[aria-pressed=true] { outline: 2px solid #e7bf78; background: #513650; }
@media(max-width:590px) { .home-profile-controls .home-avatar { --portrait-size: 56px; } }
.profile-portraits { display: block; }
:is(.home-avatar,.match-opponent-face)[data-portrait-frame=silver] { border: 3px double #c1d9f1; box-shadow: 0 0 7px #a7ceff; }
:is(.home-avatar,.match-opponent-face)[data-portrait-frame=bronze] { border: 3px ridge #c98a58; box-shadow: 0 0 8px #a8643a; }
:is(.home-avatar,.match-opponent-face)[data-portrait-frame=violet] { border: 3px double #dca1ff; box-shadow: 0 0 10px #9b51dc; }

.portrait-editor { display: grid; justify-items: center; gap: 9px; }
.portrait-instructions, .portrait-selection { margin: 0; text-align: center; }
.portrait-selection { color: var(--metal-light); min-height: 1.3em; }
.portrait-stage { position: relative; width: min(280px,100%); aspect-ratio: 1; margin: 6px 0 12px; }
.home-avatar.portrait-preview { position: absolute; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; }
.portrait-race-nav button {
  min-height: 44px; min-width: 44px; padding: 0; border: 1px solid #d0a771;
  color: #ffe6aa; background: #1a1124dc; font: 700 1.15rem/1 system-ui; box-shadow: 0 2px 5px #05040a;
}
.portrait-race-nav {
  position: absolute; bottom: 1%; left: 50%; width: min(216px,90%); transform: translateX(-50%);
  display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; align-items: center; text-align: center;
  background: #1a1124ed; border: 1px solid #d0a771; border-radius: 8px; overflow: hidden;
}
.portrait-race-nav span { overflow-wrap: anywhere; padding: 2px; }
.portrait-editor > button { min-height: 44px; }
.home-profile-controls a.home-avatar:focus-visible { outline: 2px solid #eec990; outline-offset: 4px; }
.portrait-edit-toggle {
  position: absolute; inset: 0; width: 100%; height: 100%; padding: 0;
  border: 0 !important; border-radius: 50% !important; background: transparent !important; box-shadow: none !important;
}
.portrait-edit-toggle:hover:not(:disabled) { background: transparent !important; }
.portrait-stage:not(.editing) .portrait-race-nav { display: none; }
.portrait-outline { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; pointer-events: none; }
.home-avatar.portrait-preview { background-origin: border-box; }
.portrait-stage.editing .portrait-preview { filter: none; }
.portrait-part-picker { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; max-width: 430px; }
.portrait-part-picker button { min-height: 44px; padding: 3px 8px; font: 650 12px system-ui; }
.home-avatar[data-portrait-frame=obsidian] { border: 4px ridge #897a99; box-shadow: 0 0 0 2px #241e2c,0 0 7px #151118; }
.home-avatar[data-portrait-frame=verdigris] { border: 4px ridge #73c0ab; box-shadow: 0 0 0 2px #47352b,0 0 9px #55a59388; }
.home-avatar[data-portrait-frame=runed] { border: 4px dashed #f0bc6c; box-shadow: 0 0 0 2px #967348,0 0 10px #eeaf6c88; }
/* Printed faces remain visible when a card leaves its board for combat. */
.combat-card{isolation:isolate;contain:paint;will-change:transform}
.combat-card>.board-unit-face{display:block!important;position:absolute!important;inset:0!important;width:100%!important;height:100%!important;aspect-ratio:auto!important;object-fit:contain!important;object-position:center!important;border-radius:inherit;pointer-events:none}
