/* ==========================================================================
   KTK deck finishes v2 (presentation only). Each deck: metal/foil frame via
   border-image, themed accents on the non-index edges, hover glint (::before).
   Faces now use the original full-colour art; identity comes from the frame.
   ========================================================================== */
[data-deck-theme]{--dk-metal:none;--dk-acc:none;--dk-inner:rgba(0,0,0,.55);--dk-glow:transparent;--dk-glint:rgba(255,236,190,.22)}
[data-deck-theme]:not([data-deck-theme="legacy"]) .card-face.v3.full::after{
  border:max(4px,4.048cqw) solid transparent!important;border-image:var(--dk-metal) 1!important;box-sizing:border-box;
  background:var(--dk-acc),radial-gradient(ellipse 80% 75% at 50% 50%,transparent 62%,rgba(0,0,0,.42) 100%)!important;
  box-shadow:inset 0 0 0 max(2.2px,1.76cqw) var(--dk-inner),inset 0 0 max(22px,17.6cqw) var(--dk-glow)!important}
[data-deck-theme]:not([data-deck-theme="legacy"]) .card-face.v3.full::before{
  display:block!important;content:""!important;position:absolute;inset:0;z-index:1;pointer-events:none;border:0!important;border-radius:inherit;
  background:linear-gradient(115deg,transparent 35%,var(--dk-glint) 48%,transparent 60%) no-repeat;background-size:250% 100%;background-position:130% 0;opacity:0}
[data-deck-theme]:not([data-deck-theme="legacy"]) .card-face.v3.full:hover::before{animation:dkGlint 1.1s cubic-bezier(.3,.6,.3,1) both}
@keyframes dkGlint{0%{opacity:0;background-position:130% 0}15%{opacity:1}100%{opacity:0;background-position:-40% 0}}
/* edge strip helpers: accents live on top-centre and left/right mid edges (index corners stay clear) */
/* --- Soldier: bronze & leather, stitched edge, rivets --- */
[data-deck-theme="soldier"]{--dk-metal:linear-gradient(160deg,#3a2614,#a57a45 30%,#5a3c1f 52%,#c99a5c 72%,#3a2614);--dk-inner:rgba(28,16,8,.75);
 --dk-acc:repeating-linear-gradient(90deg,rgba(214,176,120,.55) 0 max(7.04px,5.632cqw),transparent max(7.04px,5.632cqw) max(13.2px,10.56cqw)) 50% max(9.68px,7.744cqw)/80% max(1.54px,1.232cqw) no-repeat,repeating-linear-gradient(90deg,rgba(214,176,120,.55) 0 max(7.04px,5.632cqw),transparent max(7.04px,5.632cqw) max(13.2px,10.56cqw)) 50% calc(100% - max(9.68px,7.744cqw))/80% max(1.54px,1.232cqw) no-repeat,
  radial-gradient(circle,#e6c48a 0 max(3.08px,2.464cqw),#5a3c1f max(3.96px,3.168cqw),transparent max(4.84px,3.872cqw)) max(7.04px,5.632cqw) 50%/max(10.56px,8.448cqw) max(10.56px,8.448cqw) no-repeat,radial-gradient(circle,#e6c48a 0 max(3.08px,2.464cqw),#5a3c1f max(3.96px,3.168cqw),transparent max(4.84px,3.872cqw)) calc(100% - max(7.04px,5.632cqw)) 50%/max(10.56px,8.448cqw) max(10.56px,8.448cqw) no-repeat;--dk-glint:rgba(255,214,150,.2)}
/* --- Knight: polished steel, mail band (cross emblem removed) --- */
[data-deck-theme="knight"]{--dk-metal:linear-gradient(150deg,#2b3238,#dfe6ea 22%,#6c7880 45%,#f4f7f8 62%,#3c454c);--dk-inner:rgba(10,14,18,.75);
 --dk-acc:radial-gradient(circle,rgba(210,220,228,.5) max(1.98px,1.584cqw),transparent max(2.64px,2.112cqw)) 50% max(10.12px,8.096cqw)/max(7.04px,5.632cqw) max(5.28px,4.224cqw) repeat-x;--dk-glint:rgba(235,245,255,.3)}
/* --- Captain: crimson lacquer, gold pinstripe, compass star --- */
[data-deck-theme="captain"]{--dk-metal:linear-gradient(160deg,#3d0a0c,#8e1a1c 35%,#e3b866 50%,#8e1a1c 65%,#2a0608);--dk-inner:rgba(70,12,14,.8);--dk-glow:rgba(140,20,24,.35);
 --dk-acc:conic-gradient(from 0deg,#e9c27a 0 6deg,transparent 6deg 39deg,#e9c27a 39deg 51deg,transparent 51deg 84deg,#e9c27a 84deg 96deg,transparent 96deg 129deg,#e9c27a 129deg 141deg,transparent 141deg 174deg,#e9c27a 174deg 186deg,transparent 186deg 219deg,#e9c27a 219deg 231deg,transparent 231deg 264deg,#e9c27a 264deg 276deg,transparent 276deg 309deg,#e9c27a 309deg 321deg,transparent 321deg 354deg,#e9c27a 354deg) 50% max(7.92px,6.336cqw)/max(22px,17.6cqw) max(22px,17.6cqw) no-repeat,
  linear-gradient(rgba(233,194,122,.6),rgba(233,194,122,.6)) 50% calc(100% - max(9.24px,7.392cqw))/70% max(1.1px,0.88cqw) no-repeat}
/* --- Warlord: blackened iron, ember edge, spikes --- */
[data-deck-theme="warlord"]{--dk-metal:linear-gradient(170deg,#120606,#4a1a10 30%,#c2401c 50%,#4a1a10 70%,#120606);--dk-inner:rgba(16,4,2,.85);--dk-glow:rgba(200,50,20,.38);
 --dk-acc:linear-gradient(135deg,transparent 50%,#2a0c06 50%) calc(50% - max(6.6px,5.28cqw)) max(5.28px,4.224cqw)/max(13.2px,10.56cqw) max(13.2px,10.56cqw) no-repeat,linear-gradient(225deg,transparent 50%,#2a0c06 50%) calc(50% + max(6.6px,5.28cqw)) max(5.28px,4.224cqw)/max(13.2px,10.56cqw) max(13.2px,10.56cqw) no-repeat,
  linear-gradient(90deg,transparent,rgba(255,110,40,.55),transparent) 50% calc(100% - max(6.16px,4.928cqw))/80% max(1.32px,1.056cqw) no-repeat;--dk-glint:rgba(255,140,80,.22)}
/* --- Kingbreaker: black-gold, gold fractures --- */
[data-deck-theme="kingbreaker"]{--dk-metal:linear-gradient(155deg,#0b0907,#7a5a20 28%,#f5d888 46%,#2a1f10 60%,#c99a3c 78%,#0b0907);--dk-inner:rgba(8,6,4,.85);--dk-glow:rgba(242,205,116,.2);
 --dk-acc:linear-gradient(62deg,transparent 48%,rgba(245,216,136,.85) 49%,rgba(245,216,136,.85) 50.5%,transparent 51.5%) 100% 0/22% 20% no-repeat,linear-gradient(118deg,transparent 48%,rgba(245,216,136,.7) 49%,rgba(245,216,136,.7) 50.3%,transparent 51.3%) 88% 0/14% 12% no-repeat,
  linear-gradient(62deg,transparent 48%,rgba(245,216,136,.85) 49%,rgba(245,216,136,.85) 50.5%,transparent 51.5%) 0 100%/22% 20% no-repeat;--dk-glint:rgba(255,226,150,.3)}
/* --- Iron: brushed iron, bolts --- */
[data-deck-theme="iron"]{--dk-metal:repeating-linear-gradient(90deg,#4a5054 0 max(1.76px,1.408cqw),#6b7378 max(1.76px,1.408cqw) max(3.52px,2.816cqw),#3c4246 max(3.52px,2.816cqw) max(5.72px,4.576cqw));--dk-inner:rgba(16,18,20,.85);
 --dk-acc:radial-gradient(circle at 40% 40%,#c6ccd0 0 max(1.76px,1.408cqw),#5c6468 max(3.96px,3.168cqw),#1c2023 max(5.28px,4.224cqw),transparent max(5.72px,4.576cqw)) 50% max(5.28px,4.224cqw)/max(12.32px,9.856cqw) max(12.32px,9.856cqw) no-repeat,radial-gradient(circle at 40% 40%,#c6ccd0 0 max(1.76px,1.408cqw),#5c6468 max(3.96px,3.168cqw),#1c2023 max(5.28px,4.224cqw),transparent max(5.72px,4.576cqw)) max(5.28px,4.224cqw) 50%/max(12.32px,9.856cqw) max(12.32px,9.856cqw) no-repeat,radial-gradient(circle at 40% 40%,#c6ccd0 0 max(1.76px,1.408cqw),#5c6468 max(3.96px,3.168cqw),#1c2023 max(5.28px,4.224cqw),transparent max(5.72px,4.576cqw)) calc(100% - max(5.28px,4.224cqw)) 50%/max(12.32px,9.856cqw) max(12.32px,9.856cqw) no-repeat;--dk-glint:rgba(220,228,232,.2)}
/* --- Enchanted Steel: blue steel, rune glints --- */
[data-deck-theme="enchanted-steel"]{--dk-metal:linear-gradient(150deg,#0d1e28,#5a8fa8 25%,#cfefff 45%,#2a4f62 65%,#0d1e28);--dk-inner:rgba(6,16,24,.85);--dk-glow:rgba(110,200,240,.22);
 --dk-acc:conic-gradient(from 45deg,#bdeaff 0 25%,transparent 0 50%,#bdeaff 0 75%,transparent 0) 50% max(7.92px,6.336cqw)/max(9.68px,7.744cqw) max(9.68px,7.744cqw) no-repeat,radial-gradient(closest-side,rgba(160,230,255,.85),transparent) max(6.16px,4.928cqw) 35%/max(7.04px,5.632cqw) max(7.04px,5.632cqw) no-repeat,radial-gradient(closest-side,rgba(160,230,255,.85),transparent) calc(100% - max(6.16px,4.928cqw)) 65%/max(7.04px,5.632cqw) max(7.04px,5.632cqw) no-repeat;--dk-glint:rgba(190,240,255,.32)}
/* --- Royal Gold: heavy gold foil, filigree --- */
[data-deck-theme="royal-gold"]{--dk-metal:linear-gradient(140deg,#6a4810,#ffe7a0 18%,#b8832a 35%,#fff3c4 52%,#a0721f 70%,#ffd982 86%,#5c3e0c);--dk-inner:rgba(40,26,6,.8);--dk-glow:rgba(255,200,90,.28);
 --dk-acc:radial-gradient(circle,transparent max(4.84px,3.872cqw),#f2cd74 max(5.28px,4.224cqw) max(6.6px,5.28cqw),transparent max(7.04px,5.632cqw)) 50% max(6.16px,4.928cqw)/max(17.6px,14.08cqw) max(17.6px,14.08cqw) no-repeat,radial-gradient(circle,#fff0b8 0 max(2.42px,1.936cqw),transparent max(3.08px,2.464cqw)) 50% max(12.54px,10.032cqw)/max(7.04px,5.632cqw) max(7.04px,5.632cqw) no-repeat,
  linear-gradient(90deg,transparent,#f2cd74 20%,transparent 40%,transparent 60%,#f2cd74 80%,transparent) 50% max(14.08px,11.264cqw)/70% max(1.1px,0.88cqw) no-repeat;--dk-glint:rgba(255,240,190,.42)}
/* --- Elemental Mythic: obsidian with four element jewels --- */
[data-deck-theme="elemental-mythic"]{--dk-metal:linear-gradient(160deg,#120a18,#5a3a70 30%,#d6b06a 50%,#3a2050 70%,#120a18);--dk-inner:rgba(14,6,20,.85);--dk-glow:rgba(170,90,230,.22);
 --dk-acc:radial-gradient(circle,#ff6a3a 0 max(2.64px,2.112cqw),#5a1408 max(4.4px,3.52cqw),transparent max(4.84px,3.872cqw)) calc(50% - max(13.2px,10.56cqw)) max(7.04px,5.632cqw)/max(10.56px,8.448cqw) max(10.56px,8.448cqw) no-repeat,radial-gradient(circle,#5ac8ff 0 max(2.64px,2.112cqw),#0a2a4a max(4.4px,3.52cqw),transparent max(4.84px,3.872cqw)) calc(50% - max(4.4px,3.52cqw)) max(7.04px,5.632cqw)/max(10.56px,8.448cqw) max(10.56px,8.448cqw) no-repeat,
  radial-gradient(circle,#7ce08a 0 max(2.64px,2.112cqw),#0e3a16 max(4.4px,3.52cqw),transparent max(4.84px,3.872cqw)) calc(50% + max(4.4px,3.52cqw)) max(7.04px,5.632cqw)/max(10.56px,8.448cqw) max(10.56px,8.448cqw) no-repeat,radial-gradient(circle,#f0f4ff 0 max(2.64px,2.112cqw),#3a4050 max(4.4px,3.52cqw),transparent max(4.84px,3.872cqw)) calc(50% + max(13.2px,10.56cqw)) max(7.04px,5.632cqw)/max(10.56px,8.448cqw) max(10.56px,8.448cqw) no-repeat;--dk-glint:rgba(230,200,255,.3)}
/* --- Celestial: moon silver, crescent, starfield --- */
[data-deck-theme="celestial"]{--dk-metal:linear-gradient(150deg,#1a1d3a,#c8ccf0 25%,#ffffff 45%,#6a70a8 65%,#1a1d3a);--dk-inner:rgba(10,12,32,.85);--dk-glow:rgba(170,180,255,.28);
 --dk-acc:radial-gradient(circle at 60% 40%,transparent max(4.4px,3.52cqw),#eef0ff max(4.84px,3.872cqw) max(7.04px,5.632cqw),transparent max(7.48px,5.984cqw)) 50% max(5.28px,4.224cqw)/max(15.84px,12.672cqw) max(15.84px,12.672cqw) no-repeat,radial-gradient(circle,#fff 0 max(0.88px,0.704cqw),transparent max(1.54px,1.232cqw)) 20% 12%/8% 8% no-repeat,radial-gradient(circle,#fff 0 max(0.88px,0.704cqw),transparent max(1.54px,1.232cqw)) 82% 30%/8% 8% no-repeat,radial-gradient(circle,#fff 0 max(0.88px,0.704cqw),transparent max(1.54px,1.232cqw)) 14% 62%/8% 8% no-repeat,radial-gradient(circle,#fff 0 max(0.88px,0.704cqw),transparent max(1.54px,1.232cqw)) 88% 78%/8% 8% no-repeat;--dk-glint:rgba(235,240,255,.38)}
/* --- AIMAGEDDON (secret): crimson-black, viewfinder brackets, REC dot --- */
[data-deck-theme="aimageddon"],[data-preview-theme="aimageddon"]{--deck-art:image-set(url("../../assets/art/backs/aimageddon-240.jpg?v=ag1") 1x,url("../../assets/art/backs/aimageddon-480.jpg?v=ag1") 2x);--deck-border:#8a1420;--deck-glow:rgba(200,24,40,.35);--deck-face-a:#efe3d0;--deck-face-b:#c9b79c}
[data-deck-theme="aimageddon"]{--sk-rim:#3a0a10;--sk-rim-hi:#e4bf66;--sk-plate:rgba(14,4,6,.86);--sk-plate-rim:rgba(228,191,102,.7);--sk-num:#fff;--sk-band:rgba(200,24,40,.75);
 --dk-metal:linear-gradient(170deg,#050203,#5a0c16 30%,#c8182a 48%,#3a0a10 62%,#d4aa5a 80%,#050203);--dk-inner:rgba(6,2,3,.9);--dk-glow:rgba(200,24,40,.3);
 --dk-acc:linear-gradient(#e4bf66,#e4bf66) 0 0/max(14px,12cqw) max(2.2px,1.76cqw) no-repeat,
  linear-gradient(#e4bf66,#e4bf66) 0 0/max(2.2px,1.76cqw) max(14px,12cqw) no-repeat,
  linear-gradient(#e4bf66,#e4bf66) 100% 0/max(14px,12cqw) max(2.2px,1.76cqw) no-repeat,
  linear-gradient(#e4bf66,#e4bf66) 100% 0/max(2.2px,1.76cqw) max(14px,12cqw) no-repeat,
  linear-gradient(#e4bf66,#e4bf66) 0 100%/max(14px,12cqw) max(2.2px,1.76cqw) no-repeat,
  linear-gradient(#e4bf66,#e4bf66) 0 100%/max(2.2px,1.76cqw) max(14px,12cqw) no-repeat,
  linear-gradient(#e4bf66,#e4bf66) 100% 100%/max(14px,12cqw) max(2.2px,1.76cqw) no-repeat,
  linear-gradient(#e4bf66,#e4bf66) 100% 100%/max(2.2px,1.76cqw) max(14px,12cqw) no-repeat,
  linear-gradient(#e4bf66,#e4bf66) 0 50%/max(2.2px,1.76cqw) max(30px,24cqw) no-repeat,
  linear-gradient(#e4bf66,#e4bf66) 100% 50%/max(2.2px,1.76cqw) max(30px,24cqw) no-repeat,
  linear-gradient(#e4bf66,#e4bf66) 50% 0/max(16px,14cqw) max(2.2px,1.76cqw) no-repeat,
  linear-gradient(#e4bf66,#e4bf66) 50% 100%/max(16px,14cqw) max(2.2px,1.76cqw) no-repeat;--dk-inner:transparent;--dk-glint:rgba(255,60,80,.22)}
[data-deck-theme="aimageddon"] .card-face.v3.full:hover::before{animation:dkGlitch .6s steps(1,end) both}
@keyframes dkGlitch{0%{opacity:.9;transform:translateX(-1.2%);background-position:60% 0;filter:drop-shadow(1px 0 0 rgba(200,24,40,.6))}25%{transform:translateX(1%);background-position:30% 0}50%{transform:translateX(-.5%);background-position:0 0}75%,100%{opacity:0;transform:none}}
/* --- backs: foil edge + hover glint on tiles, preview, board backs --- */
#cosmetics-modal .cosmetic-preview::after,#cosmetics-modal .v3c-big-back::after{content:"";position:absolute;inset:0;pointer-events:none;border-radius:inherit;
  box-shadow:inset 0 0 0 1px rgba(255,236,190,.35),inset 0 0 12px rgba(0,0,0,.55);background:linear-gradient(115deg,transparent 35%,rgba(255,236,190,.28) 48%,transparent 60%) no-repeat;background-size:250% 100%;background-position:130% 0}
#cosmetics-modal .v3c-tile:hover .cosmetic-preview::after,#cosmetics-modal .v3c-big-back:hover::after{animation:dkBack 1.1s ease both}
@keyframes dkBack{to{background-position:-40% 0}}
#cosmetics-modal .v3c-big-back[data-preview-theme="aimageddon"]:hover{animation:dkBackGlitch .5s steps(1,end)}
@keyframes dkBackGlitch{0%{transform:translateX(-2px);filter:drop-shadow(2px 0 0 rgba(200,24,40,.7))}33%{transform:translateX(2px);filter:drop-shadow(-2px 0 0 rgba(228,191,102,.5))}66%,100%{transform:none;filter:none}}
/* --- secret tile (locked) --- */
#cosmetics-modal .v3c-secret{--rar:#8a1420;--rar-g:rgba(200,24,40,.28)}
#cosmetics-modal .v3c-secret .v3c-rarity{color:#c8182a!important}
#cosmetics-modal .v3c-silhouette{background:radial-gradient(ellipse at 50% 40%,#2a0a10,#050203 75%)!important;border-color:#3a0a10!important;filter:none!important}
#cosmetics-modal .v3c-big .v3c-big-back.v3c-silhouette{background:radial-gradient(ellipse at 50% 40%,#2a0a10,#050203 75%)!important}
.v3c-aimageddon,.v3c-tile[data-cosmetic-tile="aimageddon"]:not(.v3c-secret){--rar:#c8182a;--rar-g:rgba(200,24,40,.35)}
/* --- secret reveal --- */
.ktk-secret-reveal{position:fixed;inset:0;z-index:2147483000;display:grid;place-items:center;pointer-events:none;background:radial-gradient(ellipse at center,rgba(40,4,8,.55),rgba(0,0,0,.78));animation:ksrIn .35s ease-out both}
.ktk-secret-reveal.out{animation:ksrOut .55s ease-in both}
.ksr-frame{position:relative;padding:34px 46px;text-align:center;background:
 linear-gradient(#e4bf66,#e4bf66) top left/34px 2px no-repeat,linear-gradient(#e4bf66,#e4bf66) top left/2px 34px no-repeat,linear-gradient(#e4bf66,#e4bf66) top right/34px 2px no-repeat,linear-gradient(#e4bf66,#e4bf66) top right/2px 34px no-repeat,
 linear-gradient(#e4bf66,#e4bf66) bottom left/34px 2px no-repeat,linear-gradient(#e4bf66,#e4bf66) bottom left/2px 34px no-repeat,linear-gradient(#e4bf66,#e4bf66) bottom right/34px 2px no-repeat,linear-gradient(#e4bf66,#e4bf66) bottom right/2px 34px no-repeat;animation:ksrLock .5s cubic-bezier(.2,.8,.2,1) both}
.ksr-rec{position:absolute;left:14px;top:10px;font:400 10px/1 "Press Start 2P",ui-monospace,monospace;color:#ff2436;letter-spacing:.12em;animation:ksrBlink 1s steps(1,end) infinite}
.ksr-title{display:block;font:400 clamp(16px,3.2vw,30px)/1.3 "Press Start 2P",ui-monospace,monospace;color:#f2d38a;letter-spacing:.08em;text-shadow:0 0 14px rgba(200,24,40,.6);animation:ksrGlitch .9s steps(1,end) both}
.ksr-sub{display:block;margin-top:14px;font:600 12px/1.4 'Cinzel',Georgia,serif;letter-spacing:.28em;color:rgba(232,183,94,.85)}
@keyframes ksrIn{from{opacity:0}to{opacity:1}}@keyframes ksrOut{to{opacity:0}}
@keyframes ksrLock{0%{padding:60px 90px;opacity:0}60%{padding:28px 40px;opacity:1}100%{padding:34px 46px}}
@keyframes ksrBlink{50%{opacity:0}}
@keyframes ksrGlitch{0%{transform:translateX(-6px);text-shadow:-4px 0 rgba(200,24,40,.8),4px 0 rgba(228,191,102,.6);clip-path:inset(10% 0 55% 0)}20%{transform:translateX(5px);clip-path:inset(55% 0 8% 0)}40%{transform:translateX(-2px);clip-path:none}60%,100%{transform:none;text-shadow:0 0 14px rgba(200,24,40,.6);clip-path:none}}
@media(prefers-reduced-motion:reduce){.card-face.v3.full:hover::before,.ksr-title,.ksr-frame,.ksr-rec{animation:none!important}}
/* --- secret terminal --- */
.ktk-term{position:fixed;inset:0;z-index:2147482000;display:grid;place-items:center;background:rgba(4,1,2,.72);animation:ksrIn .25s ease-out both}
.ktk-term.out{animation:ksrOut .3s ease-in both}
.kt-box{position:relative;min-width:min(520px,88vw);padding:30px 26px 22px;background:linear-gradient(180deg,#0d0406,#050203);border:1px solid rgba(200,24,40,.5);box-shadow:0 0 40px rgba(200,24,40,.25),inset 0 0 30px rgba(0,0,0,.8);font:400 12px/1.6 "Press Start 2P",ui-monospace,monospace;color:#e4bf66;animation:ksrGlitch .7s steps(1,end) both}
.kt-rec{position:absolute;left:12px;top:8px;font-size:9px;color:#ff2436;letter-spacing:.1em}
.kt-line span{animation:ksrBlink 1.2s steps(1,end) infinite}
.kt-in{display:block;width:100%;box-sizing:border-box;margin-top:12px;padding:10px 12px;background:#000;border:1px solid rgba(228,191,102,.55);color:#f2d38a;font:inherit;text-transform:uppercase;outline:none;caret-color:#ff2436}
.kt-in:focus{box-shadow:0 0 0 1px rgba(200,24,40,.6),0 0 14px rgba(200,24,40,.35)}
.kt-msg{display:block;min-height:1.6em;margin-top:8px;color:#ff2436;font-size:10px}
.kt-x{position:absolute;right:8px;top:4px;background:none;border:0;color:#e4bf66;font-size:18px}
.ktk-term.bad .kt-box{animation:ksrGlitch .45s steps(1,end)}
/* --- mobile --- */
.hero .v3m-crest,#title{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.hero .v3m-crest{position:relative}
.kt-in{font-size:16px!important;line-height:1.4}
@media (max-width:600px),(max-height:560px){
  .ktk-term{place-items:start center;padding-top:max(10px,6vh);overflow:auto}
  .kt-box{min-width:0;width:92vw;padding:26px 14px 16px;font-size:10px}
  .ksr-frame{padding:24px 18px}
}
[data-deck-theme]:not([data-deck-theme="legacy"]) .card-face.v3.full:active::before{animation:dkGlint 1.1s cubic-bezier(.3,.6,.3,1) both}
#cosmetics-modal .v3c-tile:active .cosmetic-preview::after,#cosmetics-modal .v3c-big-back:active::after{animation:dkBack 1.1s ease both}
[data-deck-theme]:not([data-deck-theme="legacy"]) .v3c-big-face:active .card-face.v3.full::before,[data-deck-theme]:not([data-deck-theme="legacy"]) .v3c-big-face:hover .card-face.v3.full::before{animation:dkGlint 1.1s cubic-bezier(.3,.6,.3,1) both}

/* small cards (phones/board): stronger contrast so frames read like desktop */
@media (max-width:700px){
  [data-deck-theme]:not([data-deck-theme="legacy"]) .card-face.v3.full::after{--dk-pin:rgba(240,206,120,.85);filter:saturate(1.15) contrast(1.1)}
  [data-deck-theme]:not([data-deck-theme="legacy"]) .card-face.v3.full{box-shadow:0 0 0 1px #000,0 0 8px var(--dk-glow)!important}
}

/* secret sequence feedback */
.hero .v3m-crest{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;-webkit-user-drag:none}
.hero .v3m-crest.ksq-hit{animation:ksqHit .42s ease-out}
.hero .v3m-crest.ksq-hit2{animation:ksqHit2 .6s ease-out}
@keyframes ksqHit{0%{filter:drop-shadow(0 0 0 rgba(228,191,102,0)) brightness(1)}35%{filter:drop-shadow(0 0 10px rgba(228,191,102,.85)) brightness(1.18);transform:translateX(-1px)}55%{transform:translateX(1px)}100%{filter:none;transform:none}}
@keyframes ksqHit2{0%{filter:none}30%{filter:drop-shadow(-2px 0 0 rgba(200,24,40,.8)) drop-shadow(2px 0 0 rgba(228,191,102,.7)) drop-shadow(0 0 14px rgba(200,24,40,.7));transform:translateX(-2px)}50%{transform:translateX(2px)}100%{filter:none;transform:none}}

/* ag2: per-rank HUD + crisp REC (only visible on AIMAGEDDON) */
.dk-hud{display:none}
[data-deck-theme="aimageddon"] .dk-hud{display:block;position:absolute;inset:0;pointer-events:none;z-index:6}
[data-deck-theme="aimageddon"] .dk-hud::before{content:"";position:absolute;left:max(10px,8.6cqw);top:calc(50% - max(46px,37.4cqw));width:max(4px,3.2cqw);height:max(4px,3.2cqw);border-radius:50%;background:#ff2436;box-shadow:0 0 max(2px,1.4cqw) rgba(255,36,54,.8);animation:ksrBlink 1.2s steps(1,end) infinite}
[data-deck-theme="aimageddon"] .dk-hud::after{content:"REC";position:absolute;left:calc(max(10px,8.6cqw) + max(6px,4.6cqw));top:calc(50% - max(46.5px,37.9cqw));font:400 max(4px,3.6cqw)/1 "Press Start 2P",ui-monospace,monospace;color:#ff5a66;opacity:.85;letter-spacing:.05em}
[data-deck-theme="aimageddon"] .dk-hud b{position:absolute;right:max(10px,8.6cqw);top:50%;transform:translateY(-50%) rotate(180deg);writing-mode:vertical-rl;font:400 max(4px,3.4cqw)/1.1 "Press Start 2P",ui-monospace,monospace;color:#f3d891;opacity:.55;letter-spacing:.08em;white-space:nowrap;text-shadow:0 0 2px #000,0 0 3px #000;max-height:max(56px,46cqw);overflow:hidden}
@media(prefers-reduced-motion:reduce){[data-deck-theme="aimageddon"] .dk-hud::before{animation:none}}
.slot.castle [data-deck-theme="aimageddon"] .dk-hud b,[data-deck-theme="aimageddon"] .slot.castle .dk-hud b{display:none}
[data-deck-theme="aimageddon"] .dk-hud::before{left:calc(50% - max(9px,7.4cqw));top:max(8px,7cqw)}
[data-deck-theme="aimageddon"] .dk-hud::after{left:calc(50% - max(3px,2.4cqw));top:calc(max(8px,7cqw) + .3px)}

/* rec1: REC/HUD only when the NEAREST deck theme is AIMAGEDDON (ancestor html/app theme no longer leaks onto other decks) */
[data-deck-theme]:not([data-deck-theme="aimageddon"]) .dk-hud{display:none!important}
[data-deck-theme]:not([data-deck-theme="aimageddon"]) [data-deck-theme="aimageddon"] .dk-hud,
[data-deck-theme]:not([data-deck-theme="aimageddon"]) [data-deck-theme]:not([data-deck-theme="aimageddon"]) [data-deck-theme="aimageddon"] .dk-hud{display:block!important}
[data-deck-theme="aimageddon"] [data-deck-theme]:not([data-deck-theme="aimageddon"]) .dk-hud,
[data-deck-theme]:not([data-deck-theme="aimageddon"]) [data-deck-theme="aimageddon"] [data-deck-theme]:not([data-deck-theme="aimageddon"]) .dk-hud{display:none!important}
