/* ============================================================================
   BCI TACTILE HARDWARE ENGINE -- DQNAMO KITCHEN PRIMITIVES (PHASE 1)
   Surface Palette:
     Deep Midnight Blue: #040814 (--bci-midnight-void)
     Sovereign Navy:     #081226 (--bci-navy-chassis)
     Medallion Gold:     #D4AF37 (--bci-medallion-gold)
     Champagne Bronze:   #C5A059 (--bci-champagne-bronze)
     Sapphire Lightning: #38BDF8 (--bci-sapphire-lightning)
     Lower Chassis Edge: #7A5C1D (--bci-chassis-lip)
   ============================================================================ */

:root {
  --bci-midnight-void: #040814;
  --bci-navy-chassis: #081226;
  --bci-medallion-gold: #D4AF37;
  --bci-champagne-bronze: #C5A059;
  --bci-sapphire-lightning: #38BDF8;
  --bci-chassis-lip: #7A5C1D;
  --bci-foil-angle: 132deg;
  --bci-foil-x: 50%;
  --bci-foil-y: 50%;
}

/* 1. TactileButton (.bci-tactile-btn) */
.bci-tactile-btn,
bci-tactile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.58);
  background: linear-gradient(180deg, rgba(22, 38, 76, 0.96) 0%, #081226 54%, #040814 100%);
  color: #F8FAFC;
  font-family: "JetBrains Mono", "Inter", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  box-shadow:
    0 5px 0 #7A5C1D,
    0 9px 20px rgba(4, 8, 20, 0.78),
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -1px 0 rgba(212, 175, 55, 0.28);
  transform: translateY(0);
  transition:
    transform 80ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 80ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 140ms ease,
    background 140ms ease;
  position: relative; min-width: 48px;}

.bci-tactile-btn:hover,
bci-tactile-btn:hover {
  border-color: #D4AF37;
  box-shadow:
    0 5px 0 #7A5C1D,
    0 12px 26px rgba(56, 189, 248, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.35); min-height: 48px; min-width: 48px;}

.bci-tactile-btn:active,
.bci-tactile-btn.is-pressed,
bci-tactile-btn:active,
bci-tactile-btn.is-pressed {
  transform: translateY(4px) !important;
  box-shadow:
    0 1px 0 #7A5C1D,
    0 3px 8px rgba(4, 8, 20, 0.85),
    inset 0 2px 4px rgba(0, 0, 0, 0.6) !important; min-height: 48px; min-width: 48px;}

.bci-tactile-btn--gold {
  background: linear-gradient(135deg, #D4AF37 0%, #C5A059 55%, #9B7828 100%);
  color: #040814 !important;
  border-color: #FDE68A; min-height: 48px; min-width: 48px;}

/* 2. ReceiptPrinter (<bci-receipt-printer>) */
bci-receipt-printer,
.bci-receipt-printer {
  display: block;
  position: relative;
  background: linear-gradient(180deg, #040814 0%, #081226 100%);
  border: 1px solid rgba(197, 160, 89, 0.42);
  border-radius: 12px;
  padding: 12px 14px 16px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.85), 0 10px 24px rgba(4, 8, 20, 0.72);
  font-variant-numeric: tabular-nums slashed-zero; color: #F8FAFC;}

.bci-printer-slot {
  height: 10px;
  border-radius: 999px;
  background: #02040A;
  border: 1px solid rgba(212, 175, 55, 0.4);
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.95), 0 1px 0 rgba(255, 255, 255, 0.08);
  margin-bottom: 6px;
  position: relative;
}

.bci-printer-slot-led {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38BDF8;
  box-shadow: 0 0 8px #38BDF8;
}

.bci-thermal-paper-viewport {
  overflow: hidden;
  padding: 0 4px 6px;
}

.bci-thermal-paper {
  background: linear-gradient(180deg, #F8FAFC 0%, #F1F5F9 92%, #E2E8F0 100%);
  color: #040814;
  font-family: "JetBrains Mono", monospace;
  font-variant-numeric: tabular-nums slashed-zero;
  font-size: 11px;
  line-height: 1.45;
  padding: 12px 14px;
  border-radius: 2px 2px 6px 6px;
  border-top: 2px dashed rgba(4, 8, 20, 0.35);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.65);
  transform-origin: top center;
  transform: translateY(-104%);
  opacity: 0;
  max-height: 0;
  transition:
    transform 520ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 320ms ease,
    max-height 520ms cubic-bezier(0.16, 1, 0.3, 1);
}

bci-receipt-printer[data-extruded="true"] .bci-thermal-paper,
.bci-receipt-printer.is-extruded .bci-thermal-paper {
  transform: translateY(0%);
  opacity: 1;
  max-height: 440px;
}

.bci-receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px dotted rgba(4, 8, 20, 0.22);
  padding: 3px 0;
}

.bci-receipt-total {
  display: flex;
  justify-content: space-between;
  font-weight: 900;
  font-size: 12px;
  padding-top: 6px;
  margin-top: 4px;
  border-top: 2px solid #040814;
}

.bci-receipt-barcode {
  display: block;
  width: 100%;
  height: 30px;
  margin-top: 8px;
}

/* 3. CassettePlayer (<bci-cassette-player>) */
bci-cassette-player,
.bci-cassette-player {
  display: block;
  background: linear-gradient(160deg, #081226 0%, #040814 100%);
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 24px rgba(4, 8, 20, 0.72);
  font-family: "JetBrains Mono", monospace;
  font-variant-numeric: tabular-nums slashed-zero;
  color: #F8FAFC;
}

.bci-cassette-window {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(4, 8, 20, 0.88);
  border: 1px solid rgba(56, 189, 248, 0.34);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 8px 0;
  position: relative;
}

.bci-cassette-reel {
  width: 48px;
  height: 48px;
  transform-origin: 50% 50%;
}

bci-cassette-player[data-playing="true"] .bci-cassette-reel,
.bci-cassette-player.is-playing .bci-cassette-reel {
  animation: bci-reel-spin 2.2s linear infinite;
}

@keyframes bci-reel-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.bci-cassette-vtt-ticker {
  background: rgba(4, 8, 20, 0.92);
  border: 1px solid rgba(197, 160, 89, 0.34);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  color: #38BDF8;
  min-height: 28px;
  display: flex;
  align-items: center;
}

/* 4. HoldToConfirm (<bci-hold-confirm>) */
bci-hold-confirm,
.bci-hold-confirm {
  display: inline-block;
  position: relative;
  width: 100%;
}

.bci-hold-confirm-btn {
  position: relative;
  width: 100%;
  min-height: 48px;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.62);
  background: linear-gradient(180deg, #081226 0%, #040814 100%);
  color: #F8FAFC;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 16px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 5px 0 #7A5C1D, 0 8px 18px rgba(4, 8, 20, 0.72);
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.bci-hold-confirm-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.55) 0%, rgba(56, 189, 248, 0.68) 100%);
  pointer-events: none;
  transition: width 60ms linear;
}

.bci-hold-confirm-label {
  position: relative;
  z-index: 2;
}

/* 5. MagneticDropZone (<bci-magnetic-drop>) */
bci-magnetic-drop,
.bci-magnetic-drop {
  display: block;
  position: relative;
  border: 1.5px dashed rgba(212, 175, 55, 0.58);
  border-radius: 12px;
  background: radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.12), rgba(8, 18, 38, 0.92) 72%);
  padding: 14px 16px;
  text-align: center;
  color: #F8FAFC;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  cursor: pointer;
  transition:
    transform 160ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 160ms ease,
    box-shadow 160ms ease;
}

bci-magnetic-drop.is-magnetic-active,
.bci-magnetic-drop.is-magnetic-active,
bci-magnetic-drop:hover,
.bci-magnetic-drop:hover {
  border-color: #38BDF8;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.28), inset 0 0 14px rgba(212, 175, 55, 0.18);
}

/* 6. IridescentFoil (.bci-iridescent-foil) */
.bci-iridescent-foil,
bci-iridescent-foil {
  position: relative;
  isolation: isolate;
}

.bci-iridescent-foil::after,
bci-iridescent-foil::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(
      260px circle at var(--bci-foil-x, 50%) var(--bci-foil-y, 50%),
      rgba(212, 175, 55, 0.24) 0%,
      rgba(56, 189, 248, 0.18) 38%,
      rgba(197, 160, 89, 0.08) 65%,
      transparent 100%
    ),
    linear-gradient(
      var(--bci-foil-angle, 132deg),
      rgba(212, 175, 55, 0.12) 0%,
      rgba(56, 189, 248, 0.1) 48%,
      rgba(197, 160, 89, 0.14) 100%
    );
  mix-blend-mode: screen;
  opacity: 0.82;
  transition: opacity 200ms ease;
  z-index: 1;
}

/* 7. AnimatedSignature (<bci-animated-signature>) */
bci-animated-signature,
.bci-animated-signature {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.bci-signature-path {
  fill: none;
  stroke: #D4AF37;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 320;
  stroke-dashoffset: 320;
  animation: bci-signature-draw 1.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes bci-signature-draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* 8. LogoTraceLoader (<bci-logo-trace>) */
bci-logo-trace,
.bci-logo-trace {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.bci-logo-trace-path {
  fill: rgba(212, 175, 55, 0.14);
  stroke: #38BDF8;
  stroke-width: 2;
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
  animation: bci-logo-trace-anim 1.9s ease-in-out infinite alternate;
}

@keyframes bci-logo-trace-anim {
  0% {
    stroke-dashoffset: 240;
    fill: rgba(212, 175, 55, 0.04);
  }
  100% {
    stroke-dashoffset: 0;
    fill: rgba(212, 175, 55, 0.32);
  }
}

/* 9. ScrambleText, DynamicButton, Ticket, Stamp, PlayingCards, ScrollFadeList, AdvancedModelSelector */
bci-scramble-text,
.bci-scramble-text {
  font-family: "JetBrains Mono", monospace;
  font-variant-numeric: tabular-nums slashed-zero;
  letter-spacing: 0.04em;
}

bci-dynamic-button,
.bci-dynamic-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

bci-ticket,
.bci-perforated-ticket {
  display: block;
  position: relative;
  background: linear-gradient(135deg, #081226 0%, #040814 100%);
  border: 1px dashed rgba(212, 175, 55, 0.55);
  border-radius: 10px;
  padding: 10px 14px;
  font-variant-numeric: tabular-nums slashed-zero; color: #F8FAFC;}

bci-stamp,
.bci-perforated-stamp {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 4px;
  border: 1.5px double #D4AF37;
  background: rgba(212, 175, 55, 0.12);
  color: #D4AF37;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transform: rotate(-1.5deg);
}

bci-playing-cards,
.bci-playing-cards {
  display: flex;
  gap: 8px;
  perspective: 900px;
}

bci-scroll-fade-list,
.bci-scroll-fade-list {
  display: block;
  position: relative;
  max-height: 280px;
  overflow-y: auto;
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 8%,
    #000 90%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 8%,
    #000 90%,
    transparent 100%
  );
}

bci-model-selector,
.bci-model-selector {
  display: block;
  background: linear-gradient(180deg, #081226 0%, #040814 100%);
  border: 1px solid rgba(212, 175, 55, 0.42);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: #F8FAFC;
}

/* ============================================================================
   ARTISAN COPPER & GALLERY IVORY OVERRIDES FOR PUBLIC & COMMERCIAL SURFACES
   Applies whenever html[data-world] or html[data-bci-world] is active;
   leaves internal dark command surfaces (#040814) 100% untouched.
   ============================================================================ */

html[data-world] .bci-tactile-btn,
html[data-bci-world] .bci-tactile-btn,
html[data-world] bci-tactile-btn,
html[data-bci-world] bci-tactile-btn {
  border: 1.5px solid var(--bci-bronze-trim, #C59B6D);
  background: var(--bci-surface-solid, #FFFDF9);
  color: var(--bci-ink-primary, #1C130E);
  box-shadow:
    0 3px 0 var(--bci-bronze-trim, #C59B6D),
    0 8px 18px rgba(28, 19, 14, 0.08);
  transition:
    transform 200ms cubic-bezier(0.22, 1.24, 0.36, 1),
    box-shadow 160ms ease;
  white-space: normal;
  text-align: center; min-height: 48px; min-width: 48px;}

html[data-world] .bci-tactile-btn--copper,
html[data-bci-world] .bci-tactile-btn--copper {
  background-color: var(--bci-cta-bg-solid, #7C3B12);
  background-image: var(--bci-copper-cta, linear-gradient(180deg, #7C3216 0%, #964B1B 38%, #7C3B12 68%, #5E2B0B 100%));
  color: var(--bci-cta-ink, #FFFDF9) !important;
  border-color: var(--bci-bronze-trim, #C59B6D); min-height: 48px; min-width: 48px;}

html[data-world] bci-receipt-printer,
html[data-bci-world] bci-receipt-printer,
html[data-world] .bci-receipt-printer,
html[data-bci-world] .bci-receipt-printer {
  background: var(--bci-surface-recess, #F2E9DC);
  border: 1.5px solid var(--bci-border-hairline, #DFCBB5);
  box-shadow: var(--bci-shadow-elevated, 0 12px 28px rgba(28, 19, 14, 0.08));
  color: var(--bci-ink-primary, #1C130E);
}

html[data-world] .bci-printer-slot,
html[data-bci-world] .bci-printer-slot {
  background: #2C1E16;
  border-color: var(--bci-bronze-trim, #C59B6D);
}

html[data-world] .bci-printer-slot-led,
html[data-bci-world] .bci-printer-slot-led {
  background: var(--bci-patina-seal, #2E6F65);
  box-shadow: 0 0 6px rgba(46, 111, 101, 0.65);
}

html[data-world] .bci-thermal-paper,
html[data-bci-world] .bci-thermal-paper {
  background: linear-gradient(180deg, #FFFDF9 0%, #FAF5EE 90%, #F2E9DC 100%);
  color: #1C130E;
  border: 1px solid #DFCBB5;
  border-top: 2px dashed #8F4719;
  box-shadow: 0 8px 20px rgba(28, 19, 14, 0.12);
}

html[data-world] bci-cassette-player,
html[data-bci-world] bci-cassette-player,
html[data-world] .bci-cassette-player,
html[data-bci-world] .bci-cassette-player {
  background: var(--bci-surface-solid, #FFFDF9);
  border: 1.5px solid var(--bci-bronze-trim, #C59B6D);
  box-shadow: var(--bci-shadow-elevated, 0 12px 28px rgba(28, 19, 14, 0.08));
  color: var(--bci-ink-primary, #1C130E);
}

html[data-world] .bci-cassette-window,
html[data-bci-world] .bci-cassette-window {
  background: var(--bci-surface-recess, #F2E9DC);
  border: 1px solid var(--bci-border-hairline, #DFCBB5);
}

html[data-world] .bci-cassette-vtt-ticker,
html[data-bci-world] .bci-cassette-vtt-ticker {
  background: var(--bci-surface-recess, #F2E9DC);
  border: 1px solid var(--bci-border-hairline, #DFCBB5);
  color: var(--bci-ink-primary, #1C130E);
  font-weight: 700;
}

html[data-world] .bci-hold-confirm-btn,
html[data-bci-world] .bci-hold-confirm-btn {
  background: var(--bci-surface-solid, #FFFDF9);
  border: 1.5px solid var(--bci-bronze-trim, #C59B6D);
  color: var(--bci-ink-primary, #1C130E);
  box-shadow: 0 3px 0 var(--bci-bronze-trim, #C59B6D), 0 8px 18px rgba(28, 19, 14, 0.08);
}

html[data-world] .bci-hold-confirm-fill,
html[data-bci-world] .bci-hold-confirm-fill {
  background: linear-gradient(90deg, rgba(229, 154, 98, 0.38) 0%, #7C3216 100%); color: #FFFDF9;}

html[data-world="midnight-gold"] .bci-hold-confirm-fill,
html[data-bci-world="midnight-gold"] .bci-hold-confirm-fill {
  background: linear-gradient(90deg, rgba(243, 211, 122, 0.44) 0%, rgba(56, 189, 248, 0.52) 100%);
}

html[data-world] .bci-tactile-btn--copper,
html[data-bci-world] .bci-tactile-btn--copper {
  color: var(--bci-cta-ink, #FFFDF9) !important;
  background-color: var(--bci-cta-bg, #8F4719);
  background-image: var(--bci-primary-cta, var(--bci-copper-cta)); min-height: 48px; min-width: 48px;}

html[data-world] bci-magnetic-drop,
html[data-bci-world] bci-magnetic-drop,
html[data-world] .bci-magnetic-drop,
html[data-bci-world] .bci-magnetic-drop {
  border: 1.5px dashed var(--bci-copper-solid, #7C3216);
  background: var(--bci-surface-recess, #F2E9DC);
  color: var(--bci-ink-primary, #1C130E);
}

html[data-world] bci-ticket,
html[data-bci-world] bci-ticket,
html[data-world] .bci-perforated-ticket,
html[data-bci-world] .bci-perforated-ticket {
  background: var(--bci-surface-solid, #FFFDF9);
  border: 1.5px dashed var(--bci-bronze-trim, #C59B6D);
  color: var(--bci-ink-primary, #1C130E);
}

html[data-world] bci-stamp,
html[data-bci-world] bci-stamp,
html[data-world] .bci-perforated-stamp,
html[data-bci-world] .bci-perforated-stamp {
  border-color: var(--bci-patina-seal, #2E6F65);
  background: var(--bci-surface-solid, #FFFDF9);
  color: var(--bci-patina-ink, #1E524A);
}

html[data-world] bci-model-selector,
html[data-bci-world] bci-model-selector,
html[data-world] .bci-model-selector,
html[data-bci-world] .bci-model-selector {
  background: var(--bci-surface-recess, #F2E9DC);
  border: 1px solid var(--bci-border-hairline, #DFCBB5);
  color: var(--bci-ink-primary, #1C130E);
}
