/* 1v1 versus AI material paint. The successful-session marker is owned by
   app.js; friend, replays and Goldfish never acquire it. Disable the link
   #ai-materials-styles for a same-DOM visual/performance comparison.

   No dimensions, transforms, artwork URLs, input behavior or animation are
   owned here. Card-state rings continue to compose with --shadow-card.
   The existing board renderer/material preference remains authoritative. */

/* Shallow black sleeve edges. Use the existing inverse-angle lighting terms
   so tapped cards retain their table-space contact shadow and semantic glows.
   Hard edges cost no extra DOM layers or blur passes per card. */
.cob-v3.rules-ai-session :is(.pt-card, .land-card, .token-card,
  .commander-card, .cob-back, .cob-railpile) {
  --shadow-card:
    0 0 0 1px #090b0de6,
    0 0 0 1.7px #c3c6c32e,
    calc(1px * sin(var(--cob-shadow-angle))) calc(1px * cos(var(--cob-shadow-angle))) 0 #42433f,
    calc(2px * sin(var(--cob-shadow-angle))) calc(2px * cos(var(--cob-shadow-angle))) 0 #080a0c,
    calc(3px * sin(var(--cob-shadow-angle))) calc(3px * cos(var(--cob-shadow-angle))) 1px var(--cob-contact-ink),
    var(--ground-dx) var(--ground-dy) var(--cob-shadow-blur) var(--cob-shadow-ink);
}

/* One inert rim inside the two card renderers. Existing ::before/::after
   belong to action/combat cues, art loading and damage: never reuse them.
   The rim is beneath those cues and state badges, with a completely clear
   center. It adds no geometry or texture layer over the live artwork. */
.cob-v3.rules-ai-session .pt-card > .rules-material-rim {
  display: block !important; /* Override mobile.css [hidden] only for this inert rim. */
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
  box-shadow: inset 0 0 0 1px #0a0d10b3,
    inset -1px 1px 0 1px #eee9da57,
    inset 1px -2px 1px 1px #020406bd;
}
.cob-v3.rules-ai-session .pt-card.pt-chip > .rules-material-rim {
  inset: calc(var(--w) * .028);
  border-radius: calc(var(--w) * .06);
  box-shadow: inset 0 0 0 1px #ffffff20,
    inset -1px 1px 1px #f4ead84d,
    inset 1px -2px 2px #020406c9,
    0 0 0 1px #030507b3;
}

/* Count-driven pile thickness already exists. Retain --edge/--edge-x and
   its real hit box; refine the laminated edge instead of inventing a stack. */
.cob-v3.rules-ai-session .cob-pile-edge {
  background:
    linear-gradient(90deg, #080b0ed9, transparent 15% 83%, #c4c2b329 96%, #090b0e),
    repeating-linear-gradient(180deg, #101317 0 1px, #85867a 1px 1.5px, #030508 1.5px 3px);
  box-shadow: inset -1px 0 1px #ebeddf55,
    inset 1px 0 2px #000b, inset 0 -2px 2px #000c;
}
.cob-v3.rules-ai-session .cob-deck-zones-row .cob-railpile .cob-railpile-face {
  box-shadow: inset 0 0 0 1px #090c0e,
    inset -1px 1px 0 1px #e8e5d759, inset 1px -2px 1px 1px #000b;
}
.cob-v3.rules-ai-session .cob-ohand i.cob-back {
  box-shadow: var(--shadow-card), inset -1px 1px 0 #f1e7cc66,
    inset 1px -1px 0 #000c;
}

/* One smoked-glass slab. Only the background has 75% opacity; foreground
   text/icons are untouched. Existing marble (or the user's selected table)
   continues behind the pane; no duplicate texture or screen-space fake mat.
   Keep the single existing rail backdrop pass, never one filter per card. */
.cob-v3.rules-ai-session:not(.rules-mobile-shell) > .cob-floating-tile {
  background: rgb(10 14 20 / .75);
  /* Neutral optical rim: bright upper/right incidence, dark inner seam and
     a narrow pale rear edge. Hard shadows suggest thickness without moving
     the pane or enlarging its interaction/scrolling box. */
  border-color: #ecf5ede6 #dbece5c9 #8eaaaeaa #8eaaaeaa;
  box-shadow: inset -1px 1px 0 #f5fffa9c,
    inset 0 0 0 2px #07101994,
    0 0 0 1px #02070ac9,
    -2px 5px 0 #08151ef2,
    -3px 6px 0 #8da4a16b,
    -4px 7px 0 #02070de6,
    -5px 11px 16px #0009;
  -webkit-backdrop-filter: blur(5px) saturate(1.08);
  backdrop-filter: blur(5px) saturate(1.08);
}
/* The reflection is background paint, behind every foreground element. It
   changes neither stacking contexts nor the rail's overflow/flyout rules. */
.cob-v3.rules-ai-session:not(.rules-mobile-shell) > .cob-floating-tile {
  /* A restrained reflected light strip crosses the upper slab from the
     upper-right source. Its narrow specular edge fades over exposed History;
     one background gradient suffices without a second incident-glow layer. */
  background-image:
    linear-gradient(145deg, transparent 27%, #e8f5ff08 31%, #f6fcff24 36%, #eefaff2e 36.5%, #e7f5ff0d 39%, transparent 46%);
}
.cob-v3.rules-ai-session:not(.rules-mobile-shell) .cob-floating-region .cob-idbox,
.cob-v3.rules-ai-session:not(.rules-mobile-shell) .cob-floating-action,
.cob-v3.rules-ai-session:not(.rules-mobile-shell) .cob-floating-action :is(.ap-panel, .ap-tile, .ap-stage, .ap-tilehead, .cob-stack-rail),
.cob-v3.rules-ai-session:not(.rules-mobile-shell) .cob-floating-action > .cob-stack-view,
.cob-v3.rules-ai-session:not(.rules-mobile-shell) .cob-rail-mid > .rules-native-choice-popout > .rules-native-choice {
  background: transparent;
}
/* Keep active-turn gold/priority teal exactly as defined by the semantic
   skin; only idle identity panels lose their old broad opaque drop shadow. */
.cob-v3.rules-ai-session:not(.rules-mobile-shell) .cob-floating-region .cob-idbox:not(.is-turn) {
  box-shadow: inset 0 1px 0 #ede7d51c;
}
/* Translucent marble is lighter than the old opaque History panel. Keep its
   nonsemantic empty-state copy readable without changing any status color. */
.cob-v3.rules-ai-session:not(.rules-mobile-shell) .cob-floating-action .ap-waiting {
  color: #c1cbd5;
}

/* No new motion or will-change hints. Existing reduced-motion and animation
   lifecycle rules continue to control every game animation. */

/* Authored two-piece AI boards own their seam and emblem. Card and control
   geometry stays on the existing projected plane above this paint. */
.cob-v3.rules-ai-session .cob-bf.cob-ai-board-art::before,
.cob-v3.rules-ai-session .cob-bf.cob-ai-board-art::after { display: none; }
.cob-v3.rules-ai-session .cob-bf.cob-ai-board-art > .cob-mat {
  background-color: #b6a793;
  background-image: linear-gradient(#171817, #171817), var(--ai-board-fill);
  background-size: 100% 4px, 256px 256px;
  background-position: 0 calc(300vh + var(--cob-seam)), 0 0;
  background-repeat: no-repeat, repeat;
  filter: none;
}
.cob-v3.rules-ai-session:not(.cob-glmat) .cob-bf.cob-ai-board-art > .cob-mat::before {
  content: ''; position: absolute; left: 100vw;
  top: calc(300vh + var(--ai-board-image-top));
  width: var(--ai-board-image-width); height: var(--ai-board-image-height);
  background: var(--ai-board-image) center / 100% 100% no-repeat;
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent),
    linear-gradient(to bottom, transparent, #000 6%, #000 94%, transparent);
  mask-composite: intersect; pointer-events: none;
}
.cob-v3.rules-ai-session.cob-glmat .cob-bf.cob-ai-board-art > .cob-mat {
  background-color: transparent;
}
/* Authored light surfaces already carry material lighting. Keep a restrained
   distance cue instead of applying the old dark repeating-mat wash twice. */
.cob-v3.rules-ai-session .cob-bf.cob-ai-board-art > .cob-mat::after {
  background: linear-gradient(to top, transparent 25vh, rgb(2 4 7 / .12) 120vh, rgb(2 4 7 / .2) 100%);
}
.cob-v3.rules-ai-session .cob-ai-board-options,
.cob-v3.rules-ai-session .cob-ai-velvet-options,
.cob-fight-gate .cob-ai-board-options,
.cob-fight-gate .cob-ai-velvet-options {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
}
.cob-ai-board-options .cob-tex-sw,
.cob-ai-velvet-options .cob-tex-sw { min-height: 52px; min-width: 44px; }
