/* Decorative layers never change the structural grid. */
.card{color:#f6f6f6;background:#f5f5f3;--frame-radius:38px;--frame-scratches-size:760px;--frame-tread-size:64px;--frame-grunge-size:1000px;--frame-chips-size:700px}
.card::before{content:'';position:absolute;inset:0;pointer-events:none;background:var(--card-grain, url('textures/soft-grain-web.webp')) center/112% 112% no-repeat;mix-blend-mode:multiply}
/* One continuous Battle Plate material, shared by every theme. */
.frame{border-radius:var(--frame-radius);background:url('textures/scratches.webp') 0 0/var(--frame-scratches-size),url('textures/tread.svg') 0 0/var(--frame-tread-size) var(--frame-tread-size),url('textures/grunge.webp') 0 0/var(--frame-grunge-size),linear-gradient(165deg,var(--c1-light) -15%,var(--c1) 30%,color-mix(in oklch,var(--c1) 70%,#000) 105%);background-blend-mode:screen,soft-light,soft-light,normal;box-shadow:inset 0 4px 0 rgb(255 255 255 / .35),inset 0 -6px 0 rgb(0 0 0 / .35),inset 0 0 0 3px rgb(0 0 0 / .5)}
/* Edge wear stays beneath content and uses a union of horizontal/vertical masks. */
.frame::after{content:'';position:absolute;inset:0;border-radius:inherit;pointer-events:none;z-index:0;background:url('textures/chips.webp') 0 0/var(--frame-chips-size);mix-blend-mode:multiply;mask-image:linear-gradient(90deg,#000,transparent 9%,transparent 91%,#000),linear-gradient(#000,transparent 6%,transparent 94%,#000);mask-composite:add}
.interior{background:transparent;z-index:1}

/* V2 header decoration; all effects stay outside structural measurement. */
.card{--c1:var(--theme-color);--c1-light:color-mix(in oklch,var(--c1) 45%,#fff);--c1-deep:color-mix(in oklch,var(--c1) 58%,#000)}
.header::before{content:'';position:absolute;inset:0 0 var(--header-gap);border-radius:20px;z-index:-1;background:linear-gradient(rgb(8 10 12 / .9),rgb(8 10 12 / .9)),url('textures/scratches.webp') 0 0/600px,linear-gradient(#171a1d,#0d0f11);background-blend-mode:normal,screen,normal;box-shadow:inset 0 5px 10px #000d,inset 0 -2px 0 #ffffff0f,0 3px 0 #ffffff4d,0 -2px 0 #0006}
.type{color:#c9cdd3}.type::before,.type::after{background:color-mix(in oklch,var(--c1) 85%,transparent)}
.hp{border-radius:16px;border:4px solid var(--c1);background:radial-gradient(100% 65% at 50% 110%,color-mix(in oklch,var(--c1) 55%,transparent),transparent 75%),#0b0d10;box-shadow:0 0 16px color-mix(in oklch,var(--c1) 30%,transparent)}
.hp-label{color:color-mix(in oklch,var(--c1) 22%,#e9e9e9)}.hp-value{color:var(--c1-light)}
.hp[data-style=filled]{background:linear-gradient(170deg,color-mix(in oklch,var(--c1) 45%,#fff),var(--c1) 45%,color-mix(in oklch,var(--c1) 80%,#000));border-color:color-mix(in oklch,var(--c1) 55%,#fff);box-shadow:inset 0 3px 0 #ffffff80,inset 0 -5px 0 #0000002e}.hp[data-style=filled] .hp-label,.hp[data-style=filled] .hp-value{color:#121212}
/* Step 2: shared recessed panels. Insets paint inside unchanged grid rows. */
.attack::before,.footer::before{content:'';position:absolute;inset:var(--section-inset) 0;border-radius:22px;z-index:-1;pointer-events:none;background:linear-gradient(rgb(12 14 16 / .8),rgb(12 14 16 / .8)),url('textures/scratches.webp') 0 0/600px,linear-gradient(#171a1d,#0d0f11);background-blend-mode:normal,screen,normal;box-shadow:inset 0 8px 14px #000d,inset 0 -2px 0 #ffffff12,0 3px 0 #ffffff4d,0 -2px 0 #0006}
.footer::before{inset:var(--section-inset) 0 0}.footer{color:#b9c0c7}
.art{box-shadow:0 3px 0 #ffffff4d,0 -2px 0 #0006}.art::after{content:'';position:absolute;inset:0;border-radius:inherit;pointer-events:none;box-shadow:inset 0 10px 18px #000a,inset 0 0 0 4px #0009}
.star{fill:rgb(255 255 255 / .05);stroke:var(--c1);stroke-width:2.5}.star.filled{fill:var(--c1);stroke:var(--c1-light)}
.attack-name{color:var(--c1-light);text-shadow:0 3px 0 #000;letter-spacing:.02em}.damage{color:#fff;text-shadow:0 3px 0 #000}.description{color:#e7eaed}
.tagline{background:transparent;color:color-mix(in oklch,var(--c1) 18%,#000)}.tagline-text{text-shadow:0 2px 0 #ffffff73,0 -1px 0 #0008}.tagline-rule{border-block:4px solid #0009;filter:drop-shadow(0 2px 0 #ffffff59)}


/* Pain Bot: light, matte workshop steel; distinct from dark Evolution metal. */
.card[data-card="pain-bot"] .frame{background:url('textures/scratches.webp') 0 0/760px,repeating-linear-gradient(0deg,#ffffff12 0 1px,transparent 1px 5px),linear-gradient(110deg,#c8cdd0,#b2b9bd 55%,#c3c9cc);background-blend-mode:soft-light,normal,normal;box-shadow:inset 0 4px 0 #ffffff70,inset 0 -5px 0 #697176,inset 0 0 0 3px #555d61}
.card[data-card="pain-bot"] .hp{box-shadow:none;border-color:#f0443d}
.card[data-card="pain-bot"] .tagline{color:#202529}
.card[data-card="pain-bot"] .tagline-rule{border-color:#9c2929}

/* Skulleton: warm weathered bone on the Standard card frame. */
.card[data-card="skulleton"] .frame{background:url('textures/scratches.webp') 0 0/760px,url('textures/grunge.webp') 0 0/1000px,linear-gradient(155deg,#f0e1c0,#d4bd91 55%,#bc9d70);background-blend-mode:soft-light,soft-light,normal}
.card[data-card="skulleton"] .tagline{color:#362419}

html[data-image-quality="print"]{--card-grain:url("assets/print/07375f0baa5c28a5a1c3.webp")}@media print{:root{--card-grain:url("assets/print/07375f0baa5c28a5a1c3.webp")}}

/* Matte moonlit blue Standard frame, with pale accents for readable details. */
.card[data-card="guardian-of-the-night"] .frame{background:url("textures/scratches.webp") 0 0/760px,url("textures/grunge.webp") 0 0/1000px,linear-gradient(155deg,#526c91,#263b60 55%,#172945);background-blend-mode:soft-light,soft-light,normal}
.card[data-card="guardian-of-the-night"] .tagline{color:#e3ebf4}
.card[data-card="guardian-of-the-night"] .tagline-text{text-shadow:0 2px 0 #0009}
.card[data-card="guardian-of-the-night"] .tagline-rule{border-color:#91abd1}

/* Warm parchment frame with crimson detailing, retaining Standard geometry. */
.card[data-card="wedgy-ninja"] .frame{background:url('textures/scratches.webp') 0 0/760px,url('textures/grunge.webp') 0 0/1000px,linear-gradient(155deg,#ecd9b5,#d2b88b 55%,#b99b6c);background-blend-mode:soft-light,soft-light,normal}
.card[data-card="wedgy-ninja"] .attack-name,.card[data-card="wedgy-ninja"] .hp-value{color:#efdfc2}
.card[data-card="wedgy-ninja"] .tagline{color:#3b2921}
.card[data-card="wedgy-ninja"] .tagline-rule{border-color:#8f3035}

/* Turbo Sub: racing green with warm cream lettering. */
.card[data-card="turbo-sub"]{--c1-light:#fff0cf}
.card[data-card="turbo-sub"] .tagline{color:#fff0cf}
.card[data-card="turbo-sub"] .tagline-rule{border-color:#fff0cf}

.card[data-card="meatball-man"]{--c1-light:#fff0cf}
.card[data-card="meatball-man"] .tagline{color:#fff0cf}
.card[data-card="meatball-man"] .tagline-rule{border-color:#fff0cf}

/* Approved Thorium preview styling. */
.card[data-card="thorium"] .name-art{object-fit:fill;transform:scale(1,1.35);transform-origin:center}
.card[data-card="thorium"]{--c1-light:#dcff86}
.card[data-card="thorium"] .tagline{color:#dcff86}
.card[data-card="thorium"] .tagline-rule{border-color:#dcff86}
.card[data-card="thorium"] .art{position:relative;background:#27342a}
.card[data-card="thorium"] .art img{position:relative;z-index:1;object-fit:cover;object-position:center}
.card[data-card="thorium"] .frame{box-shadow:inset 0 0 40px 12px #a3ff4870}
/* Approved option B: glow follows painted rounded panels, not layout boxes. */
.card[data-card="thorium"] .art{box-shadow:0 0 14px 3px #a3ff4845}
.card[data-card="thorium"] .header,.card[data-card="thorium"] .attack{box-shadow:none}
.card[data-card="thorium"] .header::before,.card[data-card="thorium"] .attack::before,.card[data-card="thorium"] .footer::before{box-shadow:inset 0 5px 10px #000d,inset 0 -2px 0 #ffffff12,0 3px 0 #ffffff4d,0 -2px 0 #0006,0 0 14px 3px #a3ff4845}

/* User-selected Basic frame palettes, November 1, 2026. Frame-only changes.
   Saved choices and preview algorithm: docs/basic-frame-choices.json.
   Do not change card theme values: text, stars and HP accents remain approved. */
.card[data-card="guardian-of-the-night"] .frame{background-image:url('textures/scratches.webp'),url('textures/grunge.webp'),linear-gradient(155deg,#89a1c3,#6b7ea1 55%,#60728e)}
.card[data-card="carrot-kerry-mr-butter"] .frame{background-image:url('textures/scratches.webp'),url('textures/tread.svg'),url('textures/grunge.webp'),linear-gradient(155deg,#547093,#456080 55%,#3c536f)}
.card[data-card="turbo-sub"] .frame{background-image:url('textures/scratches.webp'),url('textures/tread.svg'),url('textures/grunge.webp'),linear-gradient(165deg,color-mix(in oklch,#418160 45%,#fff) -15%,#418160 30%,color-mix(in oklch,#418160 70%,#000) 105%)}
.card[data-card="meatball-man"] .frame{background-image:url('textures/scratches.webp'),url('textures/tread.svg'),url('textures/grunge.webp'),linear-gradient(165deg,color-mix(in oklch,#a14340 45%,#fff) -15%,#a14340 30%,color-mix(in oklch,#a14340 70%,#000) 105%)}
